comp-hub 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli copy.js +15 -0
- package/bin/cli.js +63 -8
- package/dist/index.js +1 -1
- package/dist/website/dist/assets/{atom-one-dark-DaKCeli0.js → atom-one-dark-B2H-r86L.js} +1 -1
- package/dist/website/dist/assets/{index-Dw87Gdio.js → index-4kzrJosw.js} +1 -1
- package/dist/website/dist/assets/{index-BnB32Ro9.js → index-BfqhDZ1z.js} +1 -1
- package/dist/website/dist/assets/{index-CyyX--pb.js → index-BrnVzb3E.js} +1 -1
- package/dist/website/dist/assets/{index-NCe1bOPR.js → index-CPx4gS-Z.js} +1 -1
- package/dist/website/dist/assets/{index-CFV42Y_E.js → index-CUKBRQJT.js} +1 -1
- package/dist/website/dist/assets/{index-DBvas-y2.js → index-Cfid4FBF.js} +1 -1
- package/dist/website/dist/assets/{index-xm1Yd9S3.js → index-D8NW2qZW.js} +1 -1
- package/dist/website/dist/assets/{index-CP0aBF8i.js → index-DDURCXIZ.js} +1 -1
- package/dist/website/dist/assets/{index-DKoDSCVP.js → index-DNxTJC5Q.js} +1 -1
- package/dist/website/dist/assets/{index-C73x0f6L.js → index-DS9olnsn.js} +1 -1
- package/dist/website/dist/assets/{index-BoHsrwck.js → index-DhTRF1Cu.js} +1 -1
- package/dist/website/dist/assets/{index-DMoUzjSX.js → index-DuJUC7Nj.js} +1 -1
- package/dist/website/dist/assets/{index-DiscR8nA.js → index-J0Dg-l9h.js} +1 -1
- package/dist/website/dist/assets/{index-DxJFvPw9.css → index-XTZOLvZN.css} +1 -1
- package/dist/website/dist/assets/{index-CRBXbZDI.js → index-YOgOWiS9.js} +1 -1
- package/dist/website/dist/assets/{index-Cg5tYaaJ.js → index-cHbH7T5D.js} +12 -12
- package/dist/website/dist/assets/{index-B22RDKbu.js → index-nDiFvJw_.js} +1 -1
- package/dist/website/dist/assets/index-qsWrHMBc.js +1 -0
- package/dist/website/dist/assets/{index-CJKsmxmW.js → index-szn1X1M8.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-BbAIbHBw.js → index.vue_vue_type_script_setup_true_lang-BMtIwDs3.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-CnpXawsg.js → index.vue_vue_type_script_setup_true_lang-C2jCrlom.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-DpO50vhc.js → index.vue_vue_type_script_setup_true_lang-Cj1ig2OS.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-BalQl2B-.js → index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-BosJ7ja_.js → index.vue_vue_type_script_setup_true_lang-Deq2IwpY.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-EA2vbOKr.js → index.vue_vue_type_script_setup_true_lang-RtjuxFdx.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-DDAGjvUI.js → index.vue_vue_type_script_setup_true_lang-mjupg3Z_.js} +3 -3
- package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-DpkZmowp.js → index.vue_vue_type_script_setup_true_lang-s3TpsvnW.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-CYK4UZZC.js → index.vue_vue_type_style_index_0_lang-BVuL5ED4.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-BnHuZh3W.js → index.vue_vue_type_style_index_0_lang-CVT5yNeL.js} +1 -1
- package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-D2TO0bNe.js → index.vue_vue_type_style_index_0_lang-Dhu78hQ_.js} +1 -1
- package/dist/website/dist/assets/{md5-CnuFqbuY.js → md5-CejJMKeR.js} +1 -1
- package/dist/website/dist/assets/{moment-DzYjZP69.js → moment-DYVhN5eu.js} +1 -1
- package/dist/website/dist/assets/useCompEditStore-C3L6eIoz.js +1 -0
- package/dist/website/dist/assets/{useCompEditStore-Z_9v-nSk.css → useCompEditStore-Dca_66Tn.css} +1 -1
- package/dist/website/dist/assets/{useTeamHeaders-C9_IL2Bb.js → useTeamHeaders-22mJVwWy.js} +1 -1
- package/dist/website/dist/assets/{v1Keyword-C5T2aAkq.js → v1Keyword-JxL-DecN.js} +1 -1
- package/dist/website/dist/assets/{v1Module-BMO4-eIJ.js → v1Module-Clll6gmK.js} +1 -1
- package/dist/website/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/website/dist/assets/index-CYs8hR-i.js +0 -1
- package/dist/website/dist/assets/useCompEditStore-DsmNqPiJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as ye,m as Me,aP as ie,aQ as Oe,
|
|
1
|
+
import{k as ye,m as Me,aP as ie,aQ as Oe,d as Pe,i as xe,aR as Ie,j as Fe,aS as He,y as We,x as Ue,D as Ne,c as $e,a as je,o as ze}from"./index-cHbH7T5D.js";var me={exports:{}},Ee;function Ke(){return Ee||(Ee=1,(function(Q,J){(function(Z,K){Q.exports=K()})(globalThis,(()=>(()=>{var Z={4567:function(u,n,o){var l=this&&this.__decorate||function(e,i,a,v){var p,m=arguments.length,f=m<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(p=e[S])&&(f=(m<3?p(f):m>3?p(i,a,f):p(i,a))||f);return m>3&&f&&Object.defineProperty(i,a,f),f},d=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const s=o(9042),h=o(9924),_=o(844),g=o(4725),c=o(2585),t=o(3656);let r=n.AccessibilityManager=class extends _.Disposable{constructor(e,i,a,v){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=v,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let p=0;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);if(this._topBoundaryFocusListener=p=>this._handleBoundaryFocus(p,0),this._bottomBoundaryFocusListener=p=>this._handleBoundaryFocus(p,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new h.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((p=>this._handleResize(p.rows)))),this.register(this._terminal.onRender((p=>this._refreshRows(p.start,p.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((p=>this._handleChar(p)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
2
|
`)))),this.register(this._terminal.onA11yTab((p=>this._handleTab(p)))),this.register(this._terminal.onKey((p=>this._handleKey(p.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,t.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let i=0;i<e;i++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
3
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=s.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,i){this._liveRegionDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){const a=this._terminal.buffer,v=a.lines.length.toString();for(let p=e;p<=i;p++){const m=a.lines.get(a.ydisp+p),f=[],S=m?.translateToString(!0,void 0,void 0,f)||"",E=(a.ydisp+p+1).toString(),k=this._rowElements[p];k&&(S.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=S,this._rowColumns.set(k,f)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,i){const a=e.target,v=this._rowElements[i===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==v)return;let p,m;if(i===0?(p=a,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(p=this._rowElements.shift(),m=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){const f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{const f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let i={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((i.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||i.node===a.node&&i.offset>a.offset)&&([i,a]=[a,i]),i.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(i={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(i.node))return;const v=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(v)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:v,offset:v.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const p=({node:S,offset:E})=>{const k=S instanceof Text?S.parentNode:S;let A=parseInt(k?.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const w=this._rowColumns.get(k);if(!w)return console.warn("columns is null. Race condition?"),null;let R=E<w.length?w[E]:w.slice(-1)[0]+1;return R>=this._terminal.cols&&(++A,R=0),{row:A,column:R}},m=p(i),f=p(a);if(m&&f){if(m.row>f.row||m.row===f.row&&m.column>=f.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(f.row-m.row)*this._terminal.cols-m.column+f.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=r=l([d(1,c.IInstantiationService),d(2,g.ICoreBrowserService),d(3,g.IRenderService)],r)},3614:(u,n)=>{function o(h){return h.replace(/\r?\n/g,"\r")}function l(h,_){return _?"\x1B[200~"+h+"\x1B[201~":h}function d(h,_,g,c){h=l(h=o(h),g.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(h,!0),_.value=""}function s(h,_,g){const c=g.getBoundingClientRect(),t=h.clientX-c.left-10,r=h.clientY-c.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${t}px`,_.style.top=`${r}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=o,n.bracketTextForPaste=l,n.copyHandler=function(h,_){h.clipboardData&&h.clipboardData.setData("text/plain",_.selectionText),h.preventDefault()},n.handlePasteEvent=function(h,_,g,c){h.stopPropagation(),h.clipboardData&&d(h.clipboardData.getData("text/plain"),_,g,c)},n.paste=d,n.moveTextAreaUnderMouseCursor=s,n.rightClickHandler=function(h,_,g,c,t){s(h,_,g),t&&c.rightClickSelect(h),_.value=c.selectionText,_.select()}},7239:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const l=o(1505);n.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(d,s,h){this._css.set(d,s,h)}getCss(d,s){return this._css.get(d,s)}setColor(d,s,h){this._color.set(d,s,h)}getColor(d,s){return this._color.get(d,s)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(o,l,d,s){o.addEventListener(l,d,s);let h=!1;return{dispose:()=>{h||(h=!0,o.removeEventListener(l,d,s))}}}},3551:function(u,n,o){var l=this&&this.__decorate||function(r,e,i,a){var v,p=arguments.length,m=p<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(r,e,i,a);else for(var f=r.length-1;f>=0;f--)(v=r[f])&&(m=(p<3?v(m):p>3?v(e,i,m):v(e,i))||m);return p>3&&m&&Object.defineProperty(e,i,m),m},d=this&&this.__param||function(r,e){return function(i,a){e(i,a,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const s=o(3656),h=o(8460),_=o(844),g=o(2585),c=o(4725);let t=n.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(r,e,i,a,v){super(),this._element=r,this._mouseService=e,this._renderService=i,this._bufferService=a,this._linkProviderService=v,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new h.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new h.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,s.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,s.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,s.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,s.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(r){this._lastMouseEvent=r;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const i=r.composedPath();for(let a=0;a<i.length;a++){const v=i[a];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(r){if(this._activeLine!==r.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(r,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))}_askForLink(r,e){this._activeProviderReplies&&e||(this._activeProviderReplies?.forEach((a=>{a?.forEach((v=>{v.link.dispose&&v.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=r.y);let i=!1;for(const[a,v]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(i=this._checkLinkProviderResult(a,r,i)):v.provideLinks(r.y,(p=>{if(this._isMouseOut)return;const m=p?.map((f=>({link:f})));this._activeProviderReplies?.set(a,m),i=this._checkLinkProviderResult(a,r,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies)}))}_removeIntersectingLinks(r,e){const i=new Set;for(let a=0;a<e.size;a++){const v=e.get(a);if(v)for(let p=0;p<v.length;p++){const m=v[p],f=m.link.range.start.y<r?0:m.link.range.start.x,S=m.link.range.end.y>r?this._bufferService.cols:m.link.range.end.x;for(let E=f;E<=S;E++){if(i.has(E)){v.splice(p--,1);break}i.add(E)}}}}_checkLinkProviderResult(r,e,i){if(!this._activeProviderReplies)return i;const a=this._activeProviderReplies.get(r);let v=!1;for(let p=0;p<r;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(v=!0);if(!v&&a){const p=a.find((m=>this._linkAtPosition(m.link,e)));p&&(i=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let p=0;p<this._activeProviderReplies.size;p++){const m=this._activeProviderReplies.get(p)?.find((f=>this._linkAtPosition(f.link,e)));if(m){i=!0,this._handleNewLink(m);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(r){if(!this._currentLink)return;const e=this._positionFromMouseEvent(r,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(r,this._currentLink.link.text)}_clearCurrentLink(r,e){this._currentLink&&this._lastMouseEvent&&(!r||!e||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(r){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(r.link,e)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(r.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((i=>{if(!this._currentLink)return;const a=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=v&&(this._clearCurrentLink(a,v),this._lastMouseEvent)){const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._askForLink(p,!1)}}))))}_linkHover(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(r,e){const i=r.range,a=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-a-1,i.end.x,i.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)}_linkLeave(r,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(r,e){const i=r.range.start.y*this._bufferService.cols+r.range.start.x,a=r.range.end.y*this._bufferService.cols+r.range.end.x,v=e.y*this._bufferService.cols+e.x;return i<=v&&v<=a}_positionFromMouseEvent(r,e,i){const a=i.getCoords(r,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(r,e,i,a,v){return{x1:r,y1:e,x2:i,y2:a,cols:this._bufferService.cols,fg:v}}};n.Linkifier=t=l([d(1,c.IMouseService),d(2,c.IRenderService),d(3,g.IBufferService),d(4,c.ILinkProviderService)],t)},9042:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,n,o){var l=this&&this.__decorate||function(c,t,r,e){var i,a=arguments.length,v=a<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(c,t,r,e);else for(var p=c.length-1;p>=0;p--)(i=c[p])&&(v=(a<3?i(v):a>3?i(t,r,v):i(t,r))||v);return a>3&&v&&Object.defineProperty(t,r,v),v},d=this&&this.__param||function(c,t){return function(r,e){t(r,e,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const s=o(511),h=o(2585);let _=n.OscLinkProvider=class{constructor(c,t,r){this._bufferService=c,this._optionsService=t,this._oscLinkService=r}provideLinks(c,t){const r=this._bufferService.buffer.lines.get(c-1);if(!r)return void t(void 0);const e=[],i=this._optionsService.rawOptions.linkHandler,a=new s.CellData,v=r.getTrimmedLength();let p=-1,m=-1,f=!1;for(let S=0;S<v;S++)if(m!==-1||r.hasContent(S)){if(r.loadCell(S,a),a.hasExtendedAttrs()&&a.extended.urlId){if(m===-1){m=S,p=a.extended.urlId;continue}f=a.extended.urlId!==p}else m!==-1&&(f=!0);if(f||m!==-1&&S===v-1){const E=this._oscLinkService.getLinkData(p)?.uri;if(E){const k={start:{x:m+1,y:c},end:{x:S+(f||S!==v-1?0:1),y:c}};let A=!1;if(!i?.allowNonHttpProtocols)try{const w=new URL(E);["http:","https:"].includes(w.protocol)||(A=!0)}catch{A=!0}A||e.push({text:E,range:k,activate:(w,R)=>i?i.activate(w,R,k):g(0,R),hover:(w,R)=>i?.hover?.(w,R,k),leave:(w,R)=>i?.leave?.(w,R,k)})}f=!1,a.hasExtendedAttrs()&&a.extended.urlId?(m=S,p=a.extended.urlId):(m=-1,p=-1)}}t(e)}};function g(c,t){if(confirm(`Do you want to navigate to ${t}?
|
|
4
4
|
|
|
@@ -6,10 +6,10 @@ 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(f){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),r.isLinux&&f&&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(f){const S=this._getMouseBufferCoords(f),E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(E&&k&&S)&&this._areCoordsInSelection(S,E,k)}isCellInSelection(f,S){const E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!E||!k)&&this._areCoordsInSelection([f,S],E,k)}_areCoordsInSelection(f,S,E){return f[1]>S[1]&&f[1]<E[1]||S[1]===E[1]&&f[1]===S[1]&&f[0]>=S[0]&&f[0]<E[0]||S[1]<E[1]&&f[1]===E[1]&&f[0]<E[0]||S[1]<E[1]&&f[1]===S[1]&&f[0]>=S[0]}_selectWordAtCursor(f,S){const E=this._linkifier.currentLink?.link?.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(f);return!!k&&(this._selectWordAt(k,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(f,S){this._model.clearSelection(),f=Math.max(f,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,f],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(f){this._model.handleTrim(f)&&this.refresh()}_getMouseBufferCoords(f){const S=this._mouseService.getCoords(f,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(f){let S=(0,s.getCoordsRelativeToElement)(this._coreBrowserService.window,f,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=E?0:(S>E&&(S-=E),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(f){return r.isMac?f.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:f.shiftKey}handleMouseDown(f){if(this._mouseDownTimeStamp=f.timeStamp,(f.button!==2||!this.hasSelection)&&f.button===0){if(!this._enabled){if(!this.shouldForceSelection(f))return;f.stopPropagation()}f.preventDefault(),this._dragScrollAmount=0,this._enabled&&f.shiftKey?this._handleIncrementalClick(f):f.detail===1?this._handleSingleClick(f):f.detail===2?this._handleDoubleClick(f):f.detail===3&&this._handleTripleClick(f),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(f){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(f))}_handleSingleClick(f){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(f)?3:0,this._model.selectionStart=this._getMouseBufferCoords(f),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(f){this._selectWordAtCursor(f,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(f){const S=this._getMouseBufferCoords(f);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(f){return f.altKey&&!(r.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(f){if(f.stopImmediatePropagation(),!this._model.selectionStart)return;const S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(f),!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(f),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const E=this._bufferService.buffer;if(this._model.selectionEnd[1]<E.lines.length){const k=E.lines.get(this._model.selectionEnd[1]);k&&k.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const f=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(f.ydisp+this._bufferService.rows,f.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=f.ydisp),this.refresh()}}_handleMouseUp(f){const S=f.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&f.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(f,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const k=(0,h.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const f=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,E=!(!f||!S||f[0]===S[0]&&f[1]===S[1]);E?f&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&f[0]===this._oldSelectionStart[0]&&f[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(f,S,E)):this._oldHasSelection&&this._fireOnSelectionChange(f,S,E)}_fireOnSelectionChange(f,S,E){this._oldSelectionStart=f,this._oldSelectionEnd=S,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(f){this.clearSelection(),this._trimListener.dispose(),this._trimListener=f.activeBuffer.lines.onTrim((S=>this._handleTrim(S)))}_convertViewportColToCharacterIndex(f,S){let E=S;for(let k=0;S>=k;k++){const A=f.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:A>1&&S!==k&&(E+=A-1)}return E}setSelection(f,S,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[f,S],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(f){this._isClickInSelection(f)||(this._selectWordAtCursor(f,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(f,S,E=!0,k=!0){if(f[0]>=this._bufferService.cols)return;const A=this._bufferService.buffer,w=A.lines.get(f[1]);if(!w)return;const R=A.translateBufferLineToString(f[1],!1);let M=this._convertViewportColToCharacterIndex(w,f[0]),F=M;const U=f[0]-M;let H=0,C=0,y=0,x=0;if(R.charAt(M)===" "){for(;M>0&&R.charAt(M-1)===" ";)M--;for(;F<R.length&&R.charAt(F+1)===" ";)F++}else{let W=f[0],$=f[0];w.getWidth(W)===0&&(H++,W--),w.getWidth($)===2&&(C++,$++);const j=w.getString($).length;for(j>1&&(x+=j-1,F+=j-1);W>0&&M>0&&!this._isCharWordSeparator(w.loadCell(W-1,this._workCell));){w.loadCell(W-1,this._workCell);const B=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,W--):B>1&&(y+=B-1,M-=B-1),M--,W--}for(;$<w.length&&F+1<R.length&&!this._isCharWordSeparator(w.loadCell($+1,this._workCell));){w.loadCell($+1,this._workCell);const B=this._workCell.getChars().length;this._workCell.getWidth()===2?(C++,$++):B>1&&(x+=B-1,F+=B-1),F++,$++}}F++;let L=M+U-H+y,P=Math.min(this._bufferService.cols,F-M+H+C-y-x);if(S||R.slice(M,F).trim()!==""){if(E&&L===0&&w.getCodePoint(0)!==32){const W=A.lines.get(f[1]-1);if(W&&w.isWrapped&&W.getCodePoint(this._bufferService.cols-1)!==32){const $=this._getWordAt([this._bufferService.cols-1,f[1]-1],!1,!0,!1);if($){const j=this._bufferService.cols-$.start;L-=j,P+=j}}}if(k&&L+P===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const W=A.lines.get(f[1]+1);if(W?.isWrapped&&W.getCodePoint(0)!==32){const $=this._getWordAt([0,f[1]+1],!1,!1,!0);$&&(P+=$.length)}}return{start:L,length:P}}}_selectWordAt(f,S){const E=this._getWordAt(f,S);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,f[1]--;this._model.selectionStart=[E.start,f[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(f){const S=this._getWordAt(f,!0);if(S){let E=f[1];for(;S.start<0;)S.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,E]}}_isCharWordSeparator(f){return f.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(f.getChars())>=0}_selectLineAt(f){const S=this._bufferService.buffer.getWrappedRangeForLine(f),E={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};n.SelectionService=m=l([d(3,a.IBufferService),d(4,a.ICoreService),d(5,g.IMouseService),d(6,a.IOptionsService),d(7,g.IRenderService),d(8,g.ICoreBrowserService)],m)},4725:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const l=o(8343);n.ICharSizeService=(0,l.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),n.IMouseService=(0,l.createDecorator)("MouseService"),n.IRenderService=(0,l.createDecorator)("RenderService"),n.ISelectionService=(0,l.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,l.createDecorator)("ThemeService"),n.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(u,n,o){var l=this&&this.__decorate||function(m,f,S,E){var k,A=arguments.length,w=A<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(m,f,S,E);else for(var R=m.length-1;R>=0;R--)(k=m[R])&&(w=(A<3?k(w):A>3?k(f,S,w):k(f,S))||w);return A>3&&w&&Object.defineProperty(f,S,w),w},d=this&&this.__param||function(m,f){return function(S,E){f(S,E,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const s=o(7239),h=o(8055),_=o(8460),g=o(844),c=o(2585),t=h.css.toColor("#ffffff"),r=h.css.toColor("#000000"),e=h.css.toColor("#ffffff"),i=h.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],f=[0,95,135,175,215,255];for(let S=0;S<216;S++){const E=f[S/36%6|0],k=f[S/6%6|0],A=f[S%6];m.push({css:h.channels.toCss(E,k,A),rgba:h.channels.toRgba(E,k,A)})}for(let S=0;S<24;S++){const E=8+10*S;m.push({css:h.channels.toCss(E,E,E),rgba:h.channels.toRgba(E,E,E)})}return m})());let v=n.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new s.ColorContrastCache,this._halfContrastCache=new s.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:t,background:r,cursor:e,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:h.color.blend(r,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:h.color.blend(r,a),ansi:n.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(m={}){const f=this._colors;if(f.foreground=p(m.foreground,t),f.background=p(m.background,r),f.cursor=p(m.cursor,e),f.cursorAccent=p(m.cursorAccent,i),f.selectionBackgroundTransparent=p(m.selectionBackground,a),f.selectionBackgroundOpaque=h.color.blend(f.background,f.selectionBackgroundTransparent),f.selectionInactiveBackgroundTransparent=p(m.selectionInactiveBackground,f.selectionBackgroundTransparent),f.selectionInactiveBackgroundOpaque=h.color.blend(f.background,f.selectionInactiveBackgroundTransparent),f.selectionForeground=m.selectionForeground?p(m.selectionForeground,h.NULL_COLOR):void 0,f.selectionForeground===h.NULL_COLOR&&(f.selectionForeground=void 0),h.color.isOpaque(f.selectionBackgroundTransparent)&&(f.selectionBackgroundTransparent=h.color.opacity(f.selectionBackgroundTransparent,.3)),h.color.isOpaque(f.selectionInactiveBackgroundTransparent)&&(f.selectionInactiveBackgroundTransparent=h.color.opacity(f.selectionInactiveBackgroundTransparent,.3)),f.ansi=n.DEFAULT_ANSI_COLORS.slice(),f.ansi[0]=p(m.black,n.DEFAULT_ANSI_COLORS[0]),f.ansi[1]=p(m.red,n.DEFAULT_ANSI_COLORS[1]),f.ansi[2]=p(m.green,n.DEFAULT_ANSI_COLORS[2]),f.ansi[3]=p(m.yellow,n.DEFAULT_ANSI_COLORS[3]),f.ansi[4]=p(m.blue,n.DEFAULT_ANSI_COLORS[4]),f.ansi[5]=p(m.magenta,n.DEFAULT_ANSI_COLORS[5]),f.ansi[6]=p(m.cyan,n.DEFAULT_ANSI_COLORS[6]),f.ansi[7]=p(m.white,n.DEFAULT_ANSI_COLORS[7]),f.ansi[8]=p(m.brightBlack,n.DEFAULT_ANSI_COLORS[8]),f.ansi[9]=p(m.brightRed,n.DEFAULT_ANSI_COLORS[9]),f.ansi[10]=p(m.brightGreen,n.DEFAULT_ANSI_COLORS[10]),f.ansi[11]=p(m.brightYellow,n.DEFAULT_ANSI_COLORS[11]),f.ansi[12]=p(m.brightBlue,n.DEFAULT_ANSI_COLORS[12]),f.ansi[13]=p(m.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),f.ansi[14]=p(m.brightCyan,n.DEFAULT_ANSI_COLORS[14]),f.ansi[15]=p(m.brightWhite,n.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const S=Math.min(f.ansi.length-16,m.extendedAnsi.length);for(let E=0;E<S;E++)f.ansi[E+16]=p(m.extendedAnsi[E],n.DEFAULT_ANSI_COLORS[E+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let f=0;f<this._restoreColors.ansi.length;++f)this._colors.ansi[f]=this._restoreColors.ansi[f]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function p(m,f){if(m!==void 0)try{return h.css.toColor(m)}catch{}return f}n.ThemeService=v=l([d(0,c.IOptionsService)],v)},6349:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const l=o(8460),d=o(844);class s extends d.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const g=new Array(_);for(let c=0;c<Math.min(_,this.length);c++)g[c]=this._array[this._getCyclicIndex(c)];this._array=g,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let g=this._length;g<_;g++)this._array[g]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,g){this._array[this._getCyclicIndex(_)]=g}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,g,...c){if(g){for(let t=_;t<this._length-g;t++)this._array[this._getCyclicIndex(t)]=this._array[this._getCyclicIndex(t+g)];this._length-=g,this.onDeleteEmitter.fire({index:_,amount:g})}for(let t=this._length-1;t>=_;t--)this._array[this._getCyclicIndex(t+c.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<c.length;t++)this._array[this._getCyclicIndex(_+t)]=c[t];if(c.length&&this.onInsertEmitter.fire({index:_,amount:c.length}),this._length+c.length>this._maxLength){const t=this._length+c.length-this._maxLength;this._startIndex+=t,this._length=this._maxLength,this.onTrimEmitter.fire(t)}else this._length+=c.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,g,c){if(!(g<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let r=g-1;r>=0;r--)this.set(_+r+c,this.get(_+r));const t=_+g+c-this._length;if(t>0)for(this._length+=t;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let t=0;t<g;t++)this.set(_+t+c,this.get(_+t))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}n.CircularList=s},1439:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function o(l,d=5){if(typeof l!="object")return l;const s=Array.isArray(l)?[]:{};for(const h in l)s[h]=d<=1?l[h]:l[h]&&o(l[h],d-1);return s}},8055:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let o=0,l=0,d=0,s=0;var h,_,g,c,t;function r(i){const a=i.toString(16);return a.length<2?"0"+a:a}function e(i,a){return i<a?(a+.05)/(i+.05):(i+.05)/(a+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(i){i.toCss=function(a,v,p,m){return m!==void 0?`#${r(a)}${r(v)}${r(p)}${r(m)}`:`#${r(a)}${r(v)}${r(p)}`},i.toRgba=function(a,v,p,m=255){return(a<<24|v<<16|p<<8|m)>>>0},i.toColor=function(a,v,p,m){return{css:i.toCss(a,v,p,m),rgba:i.toRgba(a,v,p,m)}}})(h||(n.channels=h={})),(function(i){function a(v,p){return s=Math.round(255*p),[o,l,d]=t.toChannels(v.rgba),{css:h.toCss(o,l,d,s),rgba:h.toRgba(o,l,d,s)}}i.blend=function(v,p){if(s=(255&p.rgba)/255,s===1)return{css:p.css,rgba:p.rgba};const m=p.rgba>>24&255,f=p.rgba>>16&255,S=p.rgba>>8&255,E=v.rgba>>24&255,k=v.rgba>>16&255,A=v.rgba>>8&255;return o=E+Math.round((m-E)*s),l=k+Math.round((f-k)*s),d=A+Math.round((S-A)*s),{css:h.toCss(o,l,d),rgba:h.toRgba(o,l,d)}},i.isOpaque=function(v){return(255&v.rgba)==255},i.ensureContrastRatio=function(v,p,m){const f=t.ensureContrastRatio(v.rgba,p.rgba,m);if(f)return h.toColor(f>>24&255,f>>16&255,f>>8&255)},i.opaque=function(v){const p=(255|v.rgba)>>>0;return[o,l,d]=t.toChannels(p),{css:h.toCss(o,l,d),rgba:p}},i.opacity=a,i.multiplyOpacity=function(v,p){return s=255&v.rgba,a(v,s*p/255)},i.toColorRGB=function(v){return[v.rgba>>24&255,v.rgba>>16&255,v.rgba>>8&255]}})(_||(n.color=_={})),(function(i){let a,v;try{const p=document.createElement("canvas");p.width=1,p.height=1;const m=p.getContext("2d",{willReadFrequently:!0});m&&(a=m,a.globalCompositeOperation="copy",v=a.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return o=parseInt(p.slice(1,2).repeat(2),16),l=parseInt(p.slice(2,3).repeat(2),16),d=parseInt(p.slice(3,4).repeat(2),16),h.toColor(o,l,d);case 5:return o=parseInt(p.slice(1,2).repeat(2),16),l=parseInt(p.slice(2,3).repeat(2),16),d=parseInt(p.slice(3,4).repeat(2),16),s=parseInt(p.slice(4,5).repeat(2),16),h.toColor(o,l,d,s);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const m=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return o=parseInt(m[1]),l=parseInt(m[2]),d=parseInt(m[3]),s=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),h.toColor(o,l,d,s);if(!a||!v)throw new Error("css.toColor: Unsupported css format");if(a.fillStyle=v,a.fillStyle=p,typeof a.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(a.fillRect(0,0,1,1),[o,l,d,s]=a.getImageData(0,0,1,1).data,s!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:h.toRgba(o,l,d,s),css:p}}})(g||(n.css=g={})),(function(i){function a(v,p,m){const f=v/255,S=p/255,E=m/255;return .2126*(f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}i.relativeLuminance=function(v){return a(v>>16&255,v>>8&255,255&v)},i.relativeLuminance2=a})(c||(n.rgb=c={})),(function(i){function a(p,m,f){const S=p>>24&255,E=p>>16&255,k=p>>8&255;let A=m>>24&255,w=m>>16&255,R=m>>8&255,M=e(c.relativeLuminance2(A,w,R),c.relativeLuminance2(S,E,k));for(;M<f&&(A>0||w>0||R>0);)A-=Math.max(0,Math.ceil(.1*A)),w-=Math.max(0,Math.ceil(.1*w)),R-=Math.max(0,Math.ceil(.1*R)),M=e(c.relativeLuminance2(A,w,R),c.relativeLuminance2(S,E,k));return(A<<24|w<<16|R<<8|255)>>>0}function v(p,m,f){const S=p>>24&255,E=p>>16&255,k=p>>8&255;let A=m>>24&255,w=m>>16&255,R=m>>8&255,M=e(c.relativeLuminance2(A,w,R),c.relativeLuminance2(S,E,k));for(;M<f&&(A<255||w<255||R<255);)A=Math.min(255,A+Math.ceil(.1*(255-A))),w=Math.min(255,w+Math.ceil(.1*(255-w))),R=Math.min(255,R+Math.ceil(.1*(255-R))),M=e(c.relativeLuminance2(A,w,R),c.relativeLuminance2(S,E,k));return(A<<24|w<<16|R<<8|255)>>>0}i.blend=function(p,m){if(s=(255&m)/255,s===1)return m;const f=m>>24&255,S=m>>16&255,E=m>>8&255,k=p>>24&255,A=p>>16&255,w=p>>8&255;return o=k+Math.round((f-k)*s),l=A+Math.round((S-A)*s),d=w+Math.round((E-w)*s),h.toRgba(o,l,d)},i.ensureContrastRatio=function(p,m,f){const S=c.relativeLuminance(p>>8),E=c.relativeLuminance(m>>8);if(e(S,E)<f){if(E<S){const w=a(p,m,f),R=e(S,c.relativeLuminance(w>>8));if(R<f){const M=v(p,m,f);return R>e(S,c.relativeLuminance(M>>8))?w:M}return w}const k=v(p,m,f),A=e(S,c.relativeLuminance(k>>8));if(A<f){const w=a(p,m,f);return A>e(S,c.relativeLuminance(w>>8))?k:w}return k}},i.reduceLuminance=a,i.increaseLuminance=v,i.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]}})(t||(n.rgba=t={})),n.toPaddedHex=r,n.contrastRatio=e},8969:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const l=o(844),d=o(2585),s=o(4348),h=o(7866),_=o(744),g=o(7302),c=o(6975),t=o(8460),r=o(1753),e=o(1480),i=o(7994),a=o(9282),v=o(5435),p=o(5981),m=o(2660);let f=!1;class S extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new t.EventEmitter),this._onScroll.event((k=>{this._onScrollApi?.fire(k.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(k){for(const A in k)this.optionsService.options[A]=k[A]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new t.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new t.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new t.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new t.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new t.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new t.EventEmitter),this._instantiationService=new s.InstantiationService,this.optionsService=this.register(new g.OptionsService(k)),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(h.LogService)),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService)),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(r.CoreMouseService)),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.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((A=>{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((A=>{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 p.WriteBuffer(((A,w)=>this._inputHandler.parse(A,w)))),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,A){this._writeBuffer.write(k,A)}writeSync(k,A){this._logService.logLevel<=d.LogLevelEnum.WARN&&!f&&(this._logService.warn("writeSync is unreliable and will be removed soon."),f=!0),this._writeBuffer.writeSync(k,A)}input(k,A=!0){this.coreService.triggerDataEvent(k,A)}resize(k,A){isNaN(k)||isNaN(A)||(k=Math.max(k,_.MINIMUM_COLS),A=Math.max(A,_.MINIMUM_ROWS),this._bufferService.resize(k,A))}scroll(k,A=!1){this._bufferService.scroll(k,A)}scrollLines(k,A,w){this._bufferService.scrollLines(k,A,w)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const A=k-this._bufferService.buffer.ydisp;A!==0&&this.scrollLines(A)}registerEscHandler(k,A){return this._inputHandler.registerEscHandler(k,A)}registerDcsHandler(k,A){return this._inputHandler.registerDcsHandler(k,A)}registerCsiHandler(k,A){return this._inputHandler.registerCsiHandler(k,A)}registerOscHandler(k,A){return this._inputHandler.registerOscHandler(k,A)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const A=this.optionsService.rawOptions.windowsPty;A&&A.buildNumber!==void 0&&A.buildNumber!==void 0?k=A.backend==="conpty"&&A.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},(()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const A of k)A.dispose()}))}}}n.CoreTerminal=S},8460:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===o)return void this._listeners.splice(l,1)}}})),this._event}fire(o,l){const d=[];for(let s=0;s<this._listeners.length;s++)d.push(this._listeners[s]);for(let s=0;s<d.length;s++)d[s].call(void 0,o,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(o,l){return o((d=>l.fire(d)))},n.runAndSubscribe=function(o,l){return l(void 0),o((d=>l(d)))}},5435:function(u,n,o){var l=this&&this.__decorate||function(H,C,y,x){var L,P=arguments.length,W=P<3?C:x===null?x=Object.getOwnPropertyDescriptor(C,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(H,C,y,x);else for(var $=H.length-1;$>=0;$--)(L=H[$])&&(W=(P<3?L(W):P>3?L(C,y,W):L(C,y))||W);return P>3&&W&&Object.defineProperty(C,y,W),W},d=this&&this.__param||function(H,C){return function(y,x){C(y,x,H)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const s=o(2584),h=o(7116),_=o(2015),g=o(844),c=o(482),t=o(8437),r=o(8460),e=o(643),i=o(511),a=o(3734),v=o(2585),p=o(1480),m=o(6242),f=o(6351),S=o(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},k=131072;function A(H,C){if(H>24)return C.setWinLines||!1;switch(H){case 1:return!!C.restoreWin;case 2:return!!C.minimizeWin;case 3:return!!C.setWinPosition;case 4:return!!C.setWinSizePixels;case 5:return!!C.raiseWin;case 6:return!!C.lowerWin;case 7:return!!C.refreshWin;case 8:return!!C.setWinSizeChars;case 9:return!!C.maximizeWin;case 10:return!!C.fullscreenWin;case 11:return!!C.getWinState;case 13:return!!C.getWinPosition;case 14:return!!C.getWinSizePixels;case 15:return!!C.getScreenSizePixels;case 16:return!!C.getCellSizePixels;case 18:return!!C.getWinSizeChars;case 19:return!!C.getScreenSizeChars;case 20:return!!C.getIconTitle;case 21:return!!C.getWinTitle;case 22:return!!C.pushTitle;case 23:return!!C.popTitle;case 24:return!!C.setWinLines}return!1}var w;(function(H){H[H.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",H[H.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(n.WindowsOptionsReportType=w={}));let R=0;class M extends g.Disposable{getAttrData(){return this._curAttrData}constructor(C,y,x,L,P,W,$,j,B=new _.EscapeSequenceParser){super(),this._bufferService=C,this._charsetService=y,this._coreService=x,this._logService=L,this._optionsService=P,this._oscLinkService=W,this._coreMouseService=$,this._unicodeService=j,this._parser=B,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new i.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((b=>this._activeBuffer=b.activeBuffer))),this._parser.setCsiHandlerFallback(((b,O)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(b),params:O.toArray()})})),this._parser.setEscHandlerFallback((b=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(b)})})),this._parser.setExecuteHandlerFallback((b=>{this._logService.debug("Unknown EXECUTE code: ",{code:b})})),this._parser.setOscHandlerFallback(((b,O,D)=>{this._logService.debug("Unknown OSC code: ",{identifier:b,action:O,data:D})})),this._parser.setDcsHandlerFallback(((b,O,D)=>{O==="HOOK"&&(D=D.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(b),action:O,payload:D})})),this._parser.setPrintHandler(((b,O,D)=>this.print(b,O,D))),this._parser.registerCsiHandler({final:"@"},(b=>this.insertChars(b))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(b=>this.scrollLeft(b))),this._parser.registerCsiHandler({final:"A"},(b=>this.cursorUp(b))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(b=>this.scrollRight(b))),this._parser.registerCsiHandler({final:"B"},(b=>this.cursorDown(b))),this._parser.registerCsiHandler({final:"C"},(b=>this.cursorForward(b))),this._parser.registerCsiHandler({final:"D"},(b=>this.cursorBackward(b))),this._parser.registerCsiHandler({final:"E"},(b=>this.cursorNextLine(b))),this._parser.registerCsiHandler({final:"F"},(b=>this.cursorPrecedingLine(b))),this._parser.registerCsiHandler({final:"G"},(b=>this.cursorCharAbsolute(b))),this._parser.registerCsiHandler({final:"H"},(b=>this.cursorPosition(b))),this._parser.registerCsiHandler({final:"I"},(b=>this.cursorForwardTab(b))),this._parser.registerCsiHandler({final:"J"},(b=>this.eraseInDisplay(b,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(b=>this.eraseInDisplay(b,!0))),this._parser.registerCsiHandler({final:"K"},(b=>this.eraseInLine(b,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(b=>this.eraseInLine(b,!0))),this._parser.registerCsiHandler({final:"L"},(b=>this.insertLines(b))),this._parser.registerCsiHandler({final:"M"},(b=>this.deleteLines(b))),this._parser.registerCsiHandler({final:"P"},(b=>this.deleteChars(b))),this._parser.registerCsiHandler({final:"S"},(b=>this.scrollUp(b))),this._parser.registerCsiHandler({final:"T"},(b=>this.scrollDown(b))),this._parser.registerCsiHandler({final:"X"},(b=>this.eraseChars(b))),this._parser.registerCsiHandler({final:"Z"},(b=>this.cursorBackwardTab(b))),this._parser.registerCsiHandler({final:"`"},(b=>this.charPosAbsolute(b))),this._parser.registerCsiHandler({final:"a"},(b=>this.hPositionRelative(b))),this._parser.registerCsiHandler({final:"b"},(b=>this.repeatPrecedingCharacter(b))),this._parser.registerCsiHandler({final:"c"},(b=>this.sendDeviceAttributesPrimary(b))),this._parser.registerCsiHandler({prefix:">",final:"c"},(b=>this.sendDeviceAttributesSecondary(b))),this._parser.registerCsiHandler({final:"d"},(b=>this.linePosAbsolute(b))),this._parser.registerCsiHandler({final:"e"},(b=>this.vPositionRelative(b))),this._parser.registerCsiHandler({final:"f"},(b=>this.hVPosition(b))),this._parser.registerCsiHandler({final:"g"},(b=>this.tabClear(b))),this._parser.registerCsiHandler({final:"h"},(b=>this.setMode(b))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(b=>this.setModePrivate(b))),this._parser.registerCsiHandler({final:"l"},(b=>this.resetMode(b))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(b=>this.resetModePrivate(b))),this._parser.registerCsiHandler({final:"m"},(b=>this.charAttributes(b))),this._parser.registerCsiHandler({final:"n"},(b=>this.deviceStatus(b))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(b=>this.deviceStatusPrivate(b))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(b=>this.softReset(b))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(b=>this.setCursorStyle(b))),this._parser.registerCsiHandler({final:"r"},(b=>this.setScrollRegion(b))),this._parser.registerCsiHandler({final:"s"},(b=>this.saveCursor(b))),this._parser.registerCsiHandler({final:"t"},(b=>this.windowOptions(b))),this._parser.registerCsiHandler({final:"u"},(b=>this.restoreCursor(b))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(b=>this.insertColumns(b))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(b=>this.deleteColumns(b))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(b=>this.selectProtected(b))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(b=>this.requestMode(b,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(b=>this.requestMode(b,!1))),this._parser.setExecuteHandler(s.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(s.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(s.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(s.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(s.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(s.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(s.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(s.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(s.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new m.OscHandler((b=>(this.setTitle(b),this.setIconName(b),!0)))),this._parser.registerOscHandler(1,new m.OscHandler((b=>this.setIconName(b)))),this._parser.registerOscHandler(2,new m.OscHandler((b=>this.setTitle(b)))),this._parser.registerOscHandler(4,new m.OscHandler((b=>this.setOrReportIndexedColor(b)))),this._parser.registerOscHandler(8,new m.OscHandler((b=>this.setHyperlink(b)))),this._parser.registerOscHandler(10,new m.OscHandler((b=>this.setOrReportFgColor(b)))),this._parser.registerOscHandler(11,new m.OscHandler((b=>this.setOrReportBgColor(b)))),this._parser.registerOscHandler(12,new m.OscHandler((b=>this.setOrReportCursorColor(b)))),this._parser.registerOscHandler(104,new m.OscHandler((b=>this.restoreIndexedColor(b)))),this._parser.registerOscHandler(110,new m.OscHandler((b=>this.restoreFgColor(b)))),this._parser.registerOscHandler(111,new m.OscHandler((b=>this.restoreBgColor(b)))),this._parser.registerOscHandler(112,new m.OscHandler((b=>this.restoreCursorColor(b)))),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 b in h.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:b},(()=>this.selectCharset("("+b))),this._parser.registerEscHandler({intermediates:")",final:b},(()=>this.selectCharset(")"+b))),this._parser.registerEscHandler({intermediates:"*",final:b},(()=>this.selectCharset("*"+b))),this._parser.registerEscHandler({intermediates:"+",final:b},(()=>this.selectCharset("+"+b))),this._parser.registerEscHandler({intermediates:"-",final:b},(()=>this.selectCharset("-"+b))),this._parser.registerEscHandler({intermediates:".",final:b},(()=>this.selectCharset("."+b))),this._parser.registerEscHandler({intermediates:"/",final:b},(()=>this.selectCharset("/"+b)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((b=>(this._logService.error("Parsing error: ",b),b))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new f.DcsHandler(((b,O)=>this.requestStatusString(b,O))))}_preserveStack(C,y,x,L){this._parseStack.paused=!0,this._parseStack.cursorStartX=C,this._parseStack.cursorStartY=y,this._parseStack.decodedLength=x,this._parseStack.position=L}_logSlowResolvingAsync(C){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([C,new Promise(((y,x)=>setTimeout((()=>x("#SLOW_TIMEOUT")),5e3)))]).catch((y=>{if(y!=="#SLOW_TIMEOUT")throw y;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(C,y){let x,L=this._activeBuffer.x,P=this._activeBuffer.y,W=0;const $=this._parseStack.paused;if($){if(x=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,y))return this._logSlowResolvingAsync(x),x;L=this._parseStack.cursorStartX,P=this._parseStack.cursorStartY,this._parseStack.paused=!1,C.length>k&&(W=this._parseStack.position+k)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof C=="string"?` "${C}"`:` "${Array.prototype.map.call(C,(b=>String.fromCharCode(b))).join("")}"`),typeof C=="string"?C.split("").map((b=>b.charCodeAt(0))):C),this._parseBuffer.length<C.length&&this._parseBuffer.length<k&&(this._parseBuffer=new Uint32Array(Math.min(C.length,k))),$||this._dirtyRowTracker.clearRange(),C.length>k)for(let b=W;b<C.length;b+=k){const O=b+k<C.length?b+k:C.length,D=typeof C=="string"?this._stringDecoder.decode(C.substring(b,O),this._parseBuffer):this._utf8Decoder.decode(C.subarray(b,O),this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,D))return this._preserveStack(L,P,D,b),this._logSlowResolvingAsync(x),x}else if(!$){const b=typeof C=="string"?this._stringDecoder.decode(C,this._parseBuffer):this._utf8Decoder.decode(C,this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,b))return this._preserveStack(L,P,b,0),this._logSlowResolvingAsync(x),x}this._activeBuffer.x===L&&this._activeBuffer.y===P||this._onCursorMove.fire();const j=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),B=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);B<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(B,this._bufferService.rows-1),Math.min(j,this._bufferService.rows-1))}print(C,y,x){let L,P;const W=this._charsetService.charset,$=this._optionsService.rawOptions.screenReaderMode,j=this._bufferService.cols,B=this._coreService.decPrivateModes.wraparound,b=this._coreService.modes.insertMode,O=this._curAttrData;let D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&x-y>0&&D.getWidth(this._activeBuffer.x-1)===2&&D.setCellFromCodepoint(this._activeBuffer.x-1,0,1,O);let T=this._parser.precedingJoinState;for(let I=y;I<x;++I){if(L=C[I],L<127&&W){const ee=W[String.fromCharCode(L)];ee&&(L=ee.charCodeAt(0))}const q=this._unicodeService.charProperties(L,T);P=p.UnicodeService.extractWidth(q);const X=p.UnicodeService.extractShouldJoin(q),G=X?p.UnicodeService.extractWidth(T):0;if(T=q,$&&this._onA11yChar.fire((0,c.stringFromCodePoint)(L)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+P-G>j){if(B){const ee=D;let z=this._activeBuffer.x-G;for(this._activeBuffer.x=G,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),D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),G>0&&D instanceof t.BufferLine&&D.copyCellsFrom(ee,z,0,G,!1);z<j;)ee.setCellFromCodepoint(z++,0,1,O)}else if(this._activeBuffer.x=j-1,P===2)continue}if(X&&this._activeBuffer.x){const ee=D.getWidth(this._activeBuffer.x-1)?1:2;D.addCodepointToCell(this._activeBuffer.x-ee,L,P);for(let z=P-G;--z>=0;)D.setCellFromCodepoint(this._activeBuffer.x++,0,0,O)}else if(b&&(D.insertCells(this._activeBuffer.x,P-G,this._activeBuffer.getNullCell(O)),D.getWidth(j-1)===2&&D.setCellFromCodepoint(j-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,O)),D.setCellFromCodepoint(this._activeBuffer.x++,L,P,O),P>0)for(;--P;)D.setCellFromCodepoint(this._activeBuffer.x++,0,0,O)}this._parser.precedingJoinState=T,this._activeBuffer.x<j&&x-y>0&&D.getWidth(this._activeBuffer.x)===0&&!D.hasContent(this._activeBuffer.x)&&D.setCellFromCodepoint(this._activeBuffer.x,0,1,O),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(C,y){return C.final!=="t"||C.prefix||C.intermediates?this._parser.registerCsiHandler(C,y):this._parser.registerCsiHandler(C,(x=>!A(x.params[0],this._optionsService.rawOptions.windowOptions)||y(x)))}registerDcsHandler(C,y){return this._parser.registerDcsHandler(C,new f.DcsHandler(y))}registerEscHandler(C,y){return this._parser.registerEscHandler(C,y)}registerOscHandler(C,y){return this._parser.registerOscHandler(C,new m.OscHandler(y))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);C.hasWidth(this._activeBuffer.x)&&!C.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const C=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-C),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(C=this._bufferService.cols-1){this._activeBuffer.x=Math.min(C,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(C,y){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=C,this._activeBuffer.y=this._activeBuffer.scrollTop+y):(this._activeBuffer.x=C,this._activeBuffer.y=y),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(C,y){this._restrictCursor(),this._setCursor(this._activeBuffer.x+C,this._activeBuffer.y+y)}cursorUp(C){const y=this._activeBuffer.y-this._activeBuffer.scrollTop;return y>=0?this._moveCursor(0,-Math.min(y,C.params[0]||1)):this._moveCursor(0,-(C.params[0]||1)),!0}cursorDown(C){const y=this._activeBuffer.scrollBottom-this._activeBuffer.y;return y>=0?this._moveCursor(0,Math.min(y,C.params[0]||1)):this._moveCursor(0,C.params[0]||1),!0}cursorForward(C){return this._moveCursor(C.params[0]||1,0),!0}cursorBackward(C){return this._moveCursor(-(C.params[0]||1),0),!0}cursorNextLine(C){return this.cursorDown(C),this._activeBuffer.x=0,!0}cursorPrecedingLine(C){return this.cursorUp(C),this._activeBuffer.x=0,!0}cursorCharAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(C){return this._setCursor(C.length>=2?(C.params[1]||1)-1:0,(C.params[0]||1)-1),!0}charPosAbsolute(C){return this._setCursor((C.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(C){return this._moveCursor(C.params[0]||1,0),!0}linePosAbsolute(C){return this._setCursor(this._activeBuffer.x,(C.params[0]||1)-1),!0}vPositionRelative(C){return this._moveCursor(0,C.params[0]||1),!0}hVPosition(C){return this.cursorPosition(C),!0}tabClear(C){const y=C.params[0];return y===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:y===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let y=C.params[0]||1;for(;y--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(C){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let y=C.params[0]||1;for(;y--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(C){const y=C.params[0];return y===1&&(this._curAttrData.bg|=536870912),y!==2&&y!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(C,y,x,L=!1,P=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);W.replaceCells(y,x,this._activeBuffer.getNullCell(this._eraseAttrData()),P),L&&(W.isWrapped=!1)}_resetBufferLine(C,y=!1){const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+C);x&&(x.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),y),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+C),x.isWrapped=!1)}eraseInDisplay(C,y=!1){let x;switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,y);x<this._bufferService.rows;x++)this._resetBufferLine(x,y);this._dirtyRowTracker.markDirty(x);break;case 1:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x,0,this._activeBuffer.x+1,!0,y),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(x+1).isWrapped=!1);x--;)this._resetBufferLine(x,y);this._dirtyRowTracker.markDirty(0);break;case 2:for(x=this._bufferService.rows,this._dirtyRowTracker.markDirty(x-1);x--;)this._resetBufferLine(x,y);this._dirtyRowTracker.markDirty(0);break;case 3:const L=this._activeBuffer.lines.length-this._bufferService.rows;L>0&&(this._activeBuffer.lines.trimStart(L),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-L,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-L,0),this._onScroll.fire(0))}return!0}eraseInLine(C,y=!1){switch(this._restrictCursor(this._bufferService.cols),C.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,y);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,y);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,y)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(C){this._restrictCursor();let y=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y,L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-L+1;for(;y--;)this._activeBuffer.lines.splice(P-1,1),this._activeBuffer.lines.splice(x,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(C){this._restrictCursor();let y=C.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y;let L;for(L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,L=this._bufferService.rows-1+this._activeBuffer.ybase-L;y--;)this._activeBuffer.lines.splice(x,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}insertChars(C){this._restrictCursor();const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return y&&(y.insertCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(C){this._restrictCursor();const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return y&&(y.deleteCells(this._activeBuffer.x,C.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(C){let y=C.params[0]||1;for(;y--;)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(C){let y=C.params[0]||1;for(;y--;)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(t.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=C.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);L.deleteCells(0,y,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=C.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);L.insertCells(0,y,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=C.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);L.insertCells(this._activeBuffer.x,y,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(C){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const y=C.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);L.deleteCells(this._activeBuffer.x,y,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(C){this._restrictCursor();const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return y&&(y.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(C.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(C){const y=this._parser.precedingJoinState;if(!y)return!0;const x=C.params[0]||1,L=p.UnicodeService.extractWidth(y),P=this._activeBuffer.x-L,W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(P),$=new Uint32Array(W.length*x);let j=0;for(let b=0;b<W.length;){const O=W.codePointAt(b)||0;$[j++]=O,b+=O>65535?2:1}let B=j;for(let b=1;b<x;++b)$.copyWithin(B,0,j),B+=j;return this.print($,0,B),!0}sendDeviceAttributesPrimary(C){return C.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(s.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(s.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(C){return C.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(s.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(s.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(C.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(s.C0.ESC+"[>83;40003;0c")),!0}_is(C){return(this._optionsService.rawOptions.termName+"").indexOf(C)===0}setMode(C){for(let y=0;y<C.length;y++)switch(C.params[y]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(C){for(let y=0;y<C.length;y++)switch(C.params[y]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,h.DEFAULT_CHARSET),this._charsetService.setgCharset(1,h.DEFAULT_CHARSET),this._charsetService.setgCharset(2,h.DEFAULT_CHARSET),this._charsetService.setgCharset(3,h.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(C){for(let y=0;y<C.length;y++)switch(C.params[y]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(C){for(let y=0;y<C.length;y++)switch(C.params[y]){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(),C.params[y]===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(C,y){const x=this._coreService.decPrivateModes,{activeProtocol:L,activeEncoding:P}=this._coreMouseService,W=this._coreService,{buffers:$,cols:j}=this._bufferService,{active:B,alt:b}=$,O=this._optionsService.rawOptions,D=X=>X?1:2,T=C.params[0];return I=T,q=y?T===2?4:T===4?D(W.modes.insertMode):T===12?3:T===20?D(O.convertEol):0:T===1?D(x.applicationCursorKeys):T===3?O.windowOptions.setWinLines?j===80?2:j===132?1:0:0:T===6?D(x.origin):T===7?D(x.wraparound):T===8?3:T===9?D(L==="X10"):T===12?D(O.cursorBlink):T===25?D(!W.isCursorHidden):T===45?D(x.reverseWraparound):T===66?D(x.applicationKeypad):T===67?4:T===1e3?D(L==="VT200"):T===1002?D(L==="DRAG"):T===1003?D(L==="ANY"):T===1004?D(x.sendFocus):T===1005?4:T===1006?D(P==="SGR"):T===1015?4:T===1016?D(P==="SGR_PIXELS"):T===1048?1:T===47||T===1047||T===1049?D(B===b):T===2004?D(x.bracketedPasteMode):0,W.triggerDataEvent(`${s.C0.ESC}[${y?"":"?"}${I};${q}$y`),!0;var I,q}_updateAttrColor(C,y,x,L,P){return y===2?(C|=50331648,C&=-16777216,C|=a.AttributeData.fromColorRGB([x,L,P])):y===5&&(C&=-50331904,C|=33554432|255&x),C}_extractColor(C,y,x){const L=[0,0,-1,0,0,0];let P=0,W=0;do{if(L[W+P]=C.params[y+W],C.hasSubParams(y+W)){const $=C.getSubParams(y+W);let j=0;do L[1]===5&&(P=1),L[W+j+1+P]=$[j];while(++j<$.length&&j+W+1+P<L.length);break}if(L[1]===5&&W+P>=2||L[1]===2&&W+P>=5)break;L[1]&&(P=1)}while(++W+y<C.length&&W+P<L.length);for(let $=2;$<L.length;++$)L[$]===-1&&(L[$]=0);switch(L[0]){case 38:x.fg=this._updateAttrColor(x.fg,L[1],L[3],L[4],L[5]);break;case 48:x.bg=this._updateAttrColor(x.bg,L[1],L[3],L[4],L[5]);break;case 58:x.extended=x.extended.clone(),x.extended.underlineColor=this._updateAttrColor(x.extended.underlineColor,L[1],L[3],L[4],L[5])}return W}_processUnderline(C,y){y.extended=y.extended.clone(),(!~C||C>5)&&(C=1),y.extended.underlineStyle=C,y.fg|=268435456,C===0&&(y.fg&=-268435457),y.updateExtended()}_processSGR0(C){C.fg=t.DEFAULT_ATTR_DATA.fg,C.bg=t.DEFAULT_ATTR_DATA.bg,C.extended=C.extended.clone(),C.extended.underlineStyle=0,C.extended.underlineColor&=-67108864,C.updateExtended()}charAttributes(C){if(C.length===1&&C.params[0]===0)return this._processSGR0(this._curAttrData),!0;const y=C.length;let x;const L=this._curAttrData;for(let P=0;P<y;P++)x=C.params[P],x>=30&&x<=37?(L.fg&=-50331904,L.fg|=16777216|x-30):x>=40&&x<=47?(L.bg&=-50331904,L.bg|=16777216|x-40):x>=90&&x<=97?(L.fg&=-50331904,L.fg|=16777224|x-90):x>=100&&x<=107?(L.bg&=-50331904,L.bg|=16777224|x-100):x===0?this._processSGR0(L):x===1?L.fg|=134217728:x===3?L.bg|=67108864:x===4?(L.fg|=268435456,this._processUnderline(C.hasSubParams(P)?C.getSubParams(P)[0]:1,L)):x===5?L.fg|=536870912:x===7?L.fg|=67108864:x===8?L.fg|=1073741824:x===9?L.fg|=2147483648:x===2?L.bg|=134217728:x===21?this._processUnderline(2,L):x===22?(L.fg&=-134217729,L.bg&=-134217729):x===23?L.bg&=-67108865:x===24?(L.fg&=-268435457,this._processUnderline(0,L)):x===25?L.fg&=-536870913:x===27?L.fg&=-67108865:x===28?L.fg&=-1073741825:x===29?L.fg&=2147483647:x===39?(L.fg&=-67108864,L.fg|=16777215&t.DEFAULT_ATTR_DATA.fg):x===49?(L.bg&=-67108864,L.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):x===38||x===48||x===58?P+=this._extractColor(C,P,L):x===53?L.bg|=1073741824:x===55?L.bg&=-1073741825:x===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):x===100?(L.fg&=-67108864,L.fg|=16777215&t.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&t.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",x);return!0}deviceStatus(C){switch(C.params[0]){case 5:this._coreService.triggerDataEvent(`${s.C0.ESC}[0n`);break;case 6:const y=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[${y};${x}R`)}return!0}deviceStatusPrivate(C){if(C.params[0]===6){const y=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[?${y};${x}R`)}return!0}softReset(C){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=t.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(C){const y=C.params[0]||1;switch(y){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const x=y%2==1;return this._optionsService.options.cursorBlink=x,!0}setScrollRegion(C){const y=C.params[0]||1;let x;return(C.length<2||(x=C.params[1])>this._bufferService.rows||x===0)&&(x=this._bufferService.rows),x>y&&(this._activeBuffer.scrollTop=y-1,this._activeBuffer.scrollBottom=x-1,this._setCursor(0,0)),!0}windowOptions(C){if(!A(C.params[0],this._optionsService.rawOptions.windowOptions))return!0;const y=C.length>1?C.params[1]:0;switch(C.params[0]){case 14:y!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${s.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:y!==0&&y!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),y!==0&&y!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:y!==0&&y!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),y!==0&&y!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(C){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(C){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(C){return this._windowTitle=C,this._onTitleChange.fire(C),!0}setIconName(C){return this._iconName=C,!0}setOrReportIndexedColor(C){const y=[],x=C.split(";");for(;x.length>1;){const L=x.shift(),P=x.shift();if(/^\d+$/.exec(L)){const W=parseInt(L);if(U(W))if(P==="?")y.push({type:0,index:W});else{const $=(0,S.parseColor)(P);$&&y.push({type:1,index:W,color:$})}}}return y.length&&this._onColor.fire(y),!0}setHyperlink(C){const y=C.split(";");return!(y.length<2)&&(y[1]?this._createHyperlink(y[0],y[1]):!y[0]&&this._finishHyperlink())}_createHyperlink(C,y){this._getCurrentLinkId()&&this._finishHyperlink();const x=C.split(":");let L;const P=x.findIndex((W=>W.startsWith("id=")));return P!==-1&&(L=x[P].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:L,uri:y}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(C,y){const x=C.split(";");for(let L=0;L<x.length&&!(y>=this._specialColors.length);++L,++y)if(x[L]==="?")this._onColor.fire([{type:0,index:this._specialColors[y]}]);else{const P=(0,S.parseColor)(x[L]);P&&this._onColor.fire([{type:1,index:this._specialColors[y],color:P}])}return!0}setOrReportFgColor(C){return this._setOrReportSpecialColor(C,0)}setOrReportBgColor(C){return this._setOrReportSpecialColor(C,1)}setOrReportCursorColor(C){return this._setOrReportSpecialColor(C,2)}restoreIndexedColor(C){if(!C)return this._onColor.fire([{type:2}]),!0;const y=[],x=C.split(";");for(let L=0;L<x.length;++L)if(/^\d+$/.exec(x[L])){const P=parseInt(x[L]);U(P)&&y.push({type:2,index:P})}return y.length&&this._onColor.fire(y),!0}restoreFgColor(C){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(C){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(C){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,h.DEFAULT_CHARSET),!0}selectCharset(C){return C.length!==2?(this.selectDefaultCharset(),!0):(C[0]==="/"||this._charsetService.setgCharset(E[C[0]],h.CHARSETS[C[1]]||h.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 C=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,C,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=t.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=t.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(C){return this._charsetService.setgLevel(C),!0}screenAlignmentPattern(){const C=new i.CellData;C.content=4194373,C.fg=this._curAttrData.fg,C.bg=this._curAttrData.bg,this._setCursor(0,0);for(let y=0;y<this._bufferService.rows;++y){const x=this._activeBuffer.ybase+this._activeBuffer.y+y,L=this._activeBuffer.lines.get(x);L&&(L.fill(C),L.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(C,y){const x=this._bufferService.buffer,L=this._optionsService.rawOptions;return(P=>(this._coreService.triggerDataEvent(`${s.C0.ESC}${P}${s.C0.ESC}\\`),!0))(C==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:C==='"p'?'P1$r61;1"p':C==="r"?`P1$r${x.scrollTop+1};${x.scrollBottom+1}r`:C==="m"?"P1$r0m":C===" q"?`P1$r${{block:2,underline:4,bar:6}[L.cursorStyle]-(L.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(C,y){this._dirtyRowTracker.markRangeDirty(C,y)}}n.InputHandler=M;let F=class{constructor(H){this._bufferService=H,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(H){H<this.start?this.start=H:H>this.end&&(this.end=H)}markRangeDirty(H,C){H>C&&(R=H,H=C,C=R),H<this.start&&(this.start=H),C>this.end&&(this.end=C)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(H){return 0<=H&&H<256}F=l([d(0,v.IBufferService)],F)},844:(u,n)=>{function o(l){for(const d of l)d.dispose();l.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const d=this._disposables.indexOf(l);d!==-1&&this._disposables.splice(d,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){this._isDisposed||l===this._value||(this._value?.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},n.toDisposable=function(l){return{dispose:l}},n.disposeArray=o,n.getDisposeArrayDisposable=function(l){return{dispose:()=>o(l)}}},1505:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(d,s,h){this._data[d]||(this._data[d]={}),this._data[d][s]=h}get(d,s){return this._data[d]?this._data[d][s]:void 0}clear(){this._data={}}}n.TwoKeyMap=o,n.FourKeyMap=class{constructor(){this._data=new o}set(l,d,s,h,_){this._data.get(l,d)||this._data.set(l,d,new o),this._data.get(l,d).set(s,h,_)}get(l,d,s,h){return this._data.get(l,d)?.get(s,h)}clear(){this._data.clear()}}},6114:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const o=n.isNode?"node":navigator.userAgent,l=n.isNode?"node":navigator.platform;n.isFirefox=o.includes("Firefox"),n.isLegacyEdge=o.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(o),n.getSafariVersion=function(){if(!n.isSafari)return 0;const d=o.match(/Version\/(\d+)/);return d===null||d.length<2?0:parseInt(d[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),n.isIpad=l==="iPad",n.isIphone=l==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),n.isLinux=l.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(o)},6106:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let o=0;n.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(o=this._search(this._getKey(l)),this._array.splice(o,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const d=this._getKey(l);if(d===void 0||(o=this._search(d),o===-1)||this._getKey(this._array[o])!==d)return!1;do if(this._array[o]===l)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===d);return!1}*getKeyIterator(l){if(this._array.length!==0&&(o=this._search(l),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===l))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===l)}forEachByKey(l,d){if(this._array.length!==0&&(o=this._search(l),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===l))do d(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===l)}values(){return[...this._array].values()}_search(l){let d=0,s=this._array.length-1;for(;s>=d;){let h=d+s>>1;const _=this._getKey(this._array[h]);if(_>l)s=h-1;else{if(!(_<l)){for(;h>0&&this._getKey(this._array[h-1])===l;)h--;return h}d=h+1}}return d}}},7226:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const l=o(6114);class d{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(_){this._idleCallback=void 0;let g=0,c=0,t=_.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),c=Math.max(g,c),r=_.timeRemaining(),1.5*c>r)return t-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(t-g))}ms`),void this._start();t=r}this.clear()}}class s extends d{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const g=Date.now()+_;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}n.PriorityTaskQueue=s,n.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends d{_requestCallback(h){return requestIdleCallback(h)}_cancelCallback(h){cancelIdleCallback(h)}}:s,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(h){this._queue.clear(),this._queue.enqueue(h)}flush(){this._queue.flush()}}},9282:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const l=o(643);n.updateWindowsModeWrappedState=function(d){const s=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),h=s?.get(d.cols-1),_=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);_&&h&&(_.isWrapped=h[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&h[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(s){return[s>>>16&255,s>>>8&255,255&s]}static fromColorRGB(s){return(255&s[0])<<16|(255&s[1])<<8|255&s[2]}clone(){const s=new o;return s.fg=this.fg,s.bg=this.bg,s.extended=this.extended.clone(),s}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=o;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(s){this._ext=s}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(s){this._ext&=-469762049,this._ext|=s<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(s){this._ext&=-67108864,this._ext|=67108863&s}get urlId(){return this._urlId}set urlId(s){this._urlId=s}get underlineVariantOffset(){const s=(3758096384&this._ext)>>29;return s<0?4294967288^s:s}set underlineVariantOffset(s){this._ext&=536870911,this._ext|=s<<29&3758096384}constructor(s=0,h=0){this._ext=0,this._urlId=0,this._ext=s,this._urlId=h}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=l},9092:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const l=o(6349),d=o(7226),s=o(3734),h=o(8437),_=o(4634),g=o(511),c=o(643),t=o(4863),r=o(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(e,i,a){this._hasScrollback=e,this._optionsService=i,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=h.DEFAULT_ATTR_DATA.clone(),this.savedCharset=r.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new d.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new s.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new s.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,i){return new h.BufferLine(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const i=e+this._optionsService.rawOptions.scrollback;return i>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=h.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){const a=this.getNullCell(h.DEFAULT_ATTR_DATA);let v=0;const p=this._getCorrectBufferLength(i);if(p>this.lines.maxLength&&(this.lines.maxLength=p),this.lines.length>0){if(this._cols<e)for(let f=0;f<this.lines.length;f++)v+=+this.lines.get(f).resize(e,a);let m=0;if(this._rows<i)for(let f=this._rows;f<i;f++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new h.BufferLine(e,a)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new h.BufferLine(e,a)));else for(let f=this._rows;f>i;f--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(p<this.lines.maxLength){const f=this.lines.length-p;f>0&&(this.lines.trimStart(f),this.ybase=Math.max(this.ybase-f,0),this.ydisp=Math.max(this.ydisp-f,0),this.savedY=Math.max(this.savedY-f,0)),this.lines.maxLength=p}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let m=0;m<this.lines.length;m++)v+=+this.lines.get(m).resize(e,a);this._cols=e,this._rows=i,this._memoryCleanupQueue.clear(),v>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){const a=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(h.DEFAULT_ATTR_DATA));if(a.length>0){const v=(0,_.reflowLargerCreateNewLayout)(this.lines,a);(0,_.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(e,i,v.countRemoved)}}_reflowLargerAdjustViewport(e,i,a){const v=this.getNullCell(h.DEFAULT_ATTR_DATA);let p=a;for(;p-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new h.BufferLine(e,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-a,0)}_reflowSmaller(e,i){const a=this.getNullCell(h.DEFAULT_ATTR_DATA),v=[];let p=0;for(let m=this.lines.length-1;m>=0;m--){let f=this.lines.get(m);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;const S=[f];for(;f.isWrapped&&m>0;)f=this.lines.get(--m),S.unshift(f);const E=this.ybase+this.y;if(E>=m&&E<m+S.length)continue;const k=S[S.length-1].getTrimmedLength(),A=(0,_.reflowSmallerGetNewLineLengths)(S,this._cols,e),w=A.length-S.length;let R;R=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+w):Math.max(0,this.lines.length-this.lines.maxLength+w);const M=[];for(let x=0;x<w;x++){const L=this.getBlankLine(h.DEFAULT_ATTR_DATA,!0);M.push(L)}M.length>0&&(v.push({start:m+S.length+p,newLines:M}),p+=M.length),S.push(...M);let F=A.length-1,U=A[F];U===0&&(F--,U=A[F]);let H=S.length-w-1,C=k;for(;H>=0;){const x=Math.min(C,U);if(S[F]===void 0)break;if(S[F].copyCellsFrom(S[H],C-x,U-x,x,!0),U-=x,U===0&&(F--,U=A[F]),C-=x,C===0){H--;const L=Math.max(H,0);C=(0,_.getWrappedLineTrimmedLength)(S,L,this._cols)}}for(let x=0;x<S.length;x++)A[x]<e&&S[x].setCell(A[x],a);let y=w-R;for(;y-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+p)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+w,this.ybase+i-1)}if(v.length>0){const m=[],f=[];for(let F=0;F<this.lines.length;F++)f.push(this.lines.get(F));const S=this.lines.length;let E=S-1,k=0,A=v[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+p);let w=0;for(let F=Math.min(this.lines.maxLength-1,S+p-1);F>=0;F--)if(A&&A.start>E+w){for(let U=A.newLines.length-1;U>=0;U--)this.lines.set(F--,A.newLines[U]);F++,m.push({index:E+1,amount:A.newLines.length}),w+=A.newLines.length,A=v[++k]}else this.lines.set(F,f[E--]);let R=0;for(let F=m.length-1;F>=0;F--)m[F].index+=R,this.lines.onInsertEmitter.fire(m[F]),R+=m[F].amount;const M=Math.max(0,S+p-this.lines.maxLength);M>0&&this.lines.onTrimEmitter.fire(M)}}translateBufferLineToString(e,i,a=0,v){const p=this.lines.get(e);return p?p.translateToString(i,a,v):""}getWrappedRangeForLine(e){let i=e,a=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:i,last:a}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const i=new t.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim((a=>{i.line-=a,i.line<0&&i.dispose()}))),i.register(this.lines.onInsert((a=>{i.line>=a.index&&(i.line+=a.amount)}))),i.register(this.lines.onDelete((a=>{i.line>=a.index&&i.line<a.index+a.amount&&i.dispose(),i.line>a.index&&(i.line-=a.amount)}))),i.register(i.onDispose((()=>this._removeMarker(i)))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const l=o(3734),d=o(511),s=o(643),h=o(482);n.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let _=0;class g{constructor(t,r,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);const i=r||d.CellData.fromCharData([0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]);for(let a=0;a<t;++a)this.setCell(a,i);this.length=t}get(t){const r=this._data[3*t+0],e=2097151&r;return[this._data[3*t+1],2097152&r?this._combined[t]:e?(0,h.stringFromCodePoint)(e):"",r>>22,2097152&r?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,r){this._data[3*t+1]=r[s.CHAR_DATA_ATTR_INDEX],r[s.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=r[1],this._data[3*t+0]=2097152|t|r[s.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=r[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|r[s.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){const r=this._data[3*t+0];return 2097152&r?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&r}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){const r=this._data[3*t+0];return 2097152&r?this._combined[t]:2097151&r?(0,h.stringFromCodePoint)(2097151&r):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,r){return _=3*t,r.content=this._data[_+0],r.fg=this._data[_+1],r.bg=this._data[_+2],2097152&r.content&&(r.combinedData=this._combined[t]),268435456&r.bg&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){2097152&r.content&&(this._combined[t]=r.combinedData),268435456&r.bg&&(this._extendedAttrs[t]=r.extended),this._data[3*t+0]=r.content,this._data[3*t+1]=r.fg,this._data[3*t+2]=r.bg}setCellFromCodepoint(t,r,e,i){268435456&i.bg&&(this._extendedAttrs[t]=i.extended),this._data[3*t+0]=r|e<<22,this._data[3*t+1]=i.fg,this._data[3*t+2]=i.bg}addCodepointToCell(t,r,e){let i=this._data[3*t+0];2097152&i?this._combined[t]+=(0,h.stringFromCodePoint)(r):2097151&i?(this._combined[t]=(0,h.stringFromCodePoint)(2097151&i)+(0,h.stringFromCodePoint)(r),i&=-2097152,i|=2097152):i=r|4194304,e&&(i&=-12582913,i|=e<<22),this._data[3*t+0]=i}insertCells(t,r,e){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),r<this.length-t){const i=new d.CellData;for(let a=this.length-t-r-1;a>=0;--a)this.setCell(t+r+a,this.loadCell(t+a,i));for(let a=0;a<r;++a)this.setCell(t+a,e)}else for(let i=t;i<this.length;++i)this.setCell(i,e);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,e)}deleteCells(t,r,e){if(t%=this.length,r<this.length-t){const i=new d.CellData;for(let a=0;a<this.length-t-r;++a)this.setCell(t+a,this.loadCell(t+r+a,i));for(let a=this.length-r;a<this.length;++a)this.setCell(a,e)}else for(let i=t;i<this.length;++i)this.setCell(i,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodepoint(t,0,1,e)}replaceCells(t,r,e,i=!1){if(i)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,e),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,e);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,e),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,e);t<r&&t<this.length;)this.setCell(t++,e)}resize(t,r){if(t===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const e=3*t;if(t>this.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const i=new Uint32Array(e);i.set(this._data),this._data=i}for(let i=this.length;i<t;++i)this.setCell(i,r)}else{this._data=this._data.subarray(0,e);const i=Object.keys(this._combined);for(let v=0;v<i.length;v++){const p=parseInt(i[v],10);p>=t&&delete this._combined[p]}const a=Object.keys(this._extendedAttrs);for(let v=0;v<a.length;v++){const p=parseInt(a[v],10);p>=t&&delete this._extendedAttrs[p]}}return this.length=t,4*e*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(const r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(const r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){const t=new g(0);t._data=new Uint32Array(this._data),t.length=this.length;for(const r in this._combined)t._combined[r]=this._combined[r];for(const r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0]||50331648&this._data[3*t+2])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,r,e,i,a){const v=t._data;if(a)for(let m=i-1;m>=0;m--){for(let f=0;f<3;f++)this._data[3*(e+m)+f]=v[3*(r+m)+f];268435456&v[3*(r+m)+2]&&(this._extendedAttrs[e+m]=t._extendedAttrs[r+m])}else for(let m=0;m<i;m++){for(let f=0;f<3;f++)this._data[3*(e+m)+f]=v[3*(r+m)+f];268435456&v[3*(r+m)+2]&&(this._extendedAttrs[e+m]=t._extendedAttrs[r+m])}const p=Object.keys(t._combined);for(let m=0;m<p.length;m++){const f=parseInt(p[m],10);f>=r&&(this._combined[f-r+e]=t._combined[f])}}translateToString(t,r,e,i){r=r??0,e=e??this.length,t&&(e=Math.min(e,this.getTrimmedLength())),i&&(i.length=0);let a="";for(;r<e;){const v=this._data[3*r+0],p=2097151&v,m=2097152&v?this._combined[r]:p?(0,h.stringFromCodePoint)(p):s.WHITESPACE_CELL_CHAR;if(a+=m,i)for(let f=0;f<m.length;++f)i.push(r);r+=v>>22||1}return i&&i.push(r),a}}n.BufferLine=g},4841:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(o,l){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return l*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(u,n)=>{function o(l,d,s){if(d===l.length-1)return l[d].getTrimmedLength();const h=!l[d].hasContent(s-1)&&l[d].getWidth(s-1)===1,_=l[d+1].getWidth(0)===2;return h&&_?s-1:s}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(l,d,s,h,_){const g=[];for(let c=0;c<l.length-1;c++){let t=c,r=l.get(++t);if(!r.isWrapped)continue;const e=[l.get(c)];for(;t<l.length&&r.isWrapped;)e.push(r),r=l.get(++t);if(h>=c&&h<t){c+=e.length-1;continue}let i=0,a=o(e,i,d),v=1,p=0;for(;v<e.length;){const f=o(e,v,d),S=f-p,E=s-a,k=Math.min(S,E);e[i].copyCellsFrom(e[v],p,a,k,!1),a+=k,a===s&&(i++,a=0),p+=k,p===f&&(v++,p=0),a===0&&i!==0&&e[i-1].getWidth(s-1)===2&&(e[i].copyCellsFrom(e[i-1],s-1,a++,1,!1),e[i-1].setCell(s-1,_))}e[i].replaceCells(a,s,_);let m=0;for(let f=e.length-1;f>0&&(f>i||e[f].getTrimmedLength()===0);f--)m++;m>0&&(g.push(c+e.length-m),g.push(m)),c+=e.length-1}return g},n.reflowLargerCreateNewLayout=function(l,d){const s=[];let h=0,_=d[h],g=0;for(let c=0;c<l.length;c++)if(_===c){const t=d[++h];l.onDeleteEmitter.fire({index:c-g,amount:t}),c+=t-1,g+=t,_=d[++h]}else s.push(c);return{layout:s,countRemoved:g}},n.reflowLargerApplyNewLayout=function(l,d){const s=[];for(let h=0;h<d.length;h++)s.push(l.get(d[h]));for(let h=0;h<s.length;h++)l.set(h,s[h]);l.length=d.length},n.reflowSmallerGetNewLineLengths=function(l,d,s){const h=[],_=l.map(((r,e)=>o(l,e,d))).reduce(((r,e)=>r+e));let g=0,c=0,t=0;for(;t<_;){if(_-t<s){h.push(_-t);break}g+=s;const r=o(l,c,d);g>r&&(g-=r,c++);const e=l[c].getWidth(g-1)===2;e&&g--;const i=e?s-1:s;h.push(i),t+=i}return h},n.getWrappedLineTrimmedLength=o},5295:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const l=o(8460),d=o(844),s=o(9092);class h extends d.Disposable{constructor(g,c){super(),this._optionsService=g,this._bufferService=c,this._onBufferActivate=this.register(new l.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new s.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new s.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,c){this._normal.resize(g,c),this._alt.resize(g,c),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}n.BufferSet=h},511:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const l=o(482),d=o(643),s=o(3734);class h extends s.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new s.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const c=new h;return c.setFromCharData(g),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let c=!1;if(g[d.CHAR_DATA_CHAR_INDEX].length>2)c=!0;else if(g[d.CHAR_DATA_CHAR_INDEX].length===2){const t=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){const r=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(t-55296)+r-56320+65536|g[d.CHAR_DATA_WIDTH_INDEX]<<22:c=!0}else c=!0}else this.content=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22;c&&(this.combinedData=g[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=h},643:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const l=o(8460),d=o(844);class s{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=s._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,d.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}n.Marker=s,s._nextId=1},7116:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,n)=>{var o,l,d;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(s){s.NUL="\0",s.SOH="",s.STX="",s.ETX="",s.EOT="",s.ENQ="",s.ACK="",s.BEL="\x07",s.BS="\b",s.HT=" ",s.LF=`
|
|
8
8
|
`,s.VT="\v",s.FF="\f",s.CR="\r",s.SO="",s.SI="",s.DLE="",s.DC1="",s.DC2="",s.DC3="",s.DC4="",s.NAK="",s.SYN="",s.ETB="",s.CAN="",s.EM="",s.SUB="",s.ESC="\x1B",s.FS="",s.GS="",s.RS="",s.US="",s.SP=" ",s.DEL=""})(o||(n.C0=o={})),(function(s){s.PAD="",s.HOP="",s.BPH="",s.NBH="",s.IND="",s.NEL="
",s.SSA="",s.ESA="",s.HTS="",s.HTJ="",s.VTS="",s.PLD="",s.PLU="",s.RI="",s.SS2="",s.SS3="",s.DCS="",s.PU1="",s.PU2="",s.STS="",s.CCH="",s.MW="",s.SPA="",s.EPA="",s.SOS="",s.SGCI="",s.SCI="",s.CSI="",s.ST="",s.OSC="",s.PM="",s.APC=""})(l||(n.C1=l={})),(function(s){s.ST=`${o.ESC}\\`})(d||(n.C1_ESCAPED=d={}))},7399:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const l=o(2584),d={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:["'",'"']};n.evaluateKeyboardEvent=function(s,h,_,g){const c={type:0,cancel:!1,key:void 0},t=(s.shiftKey?1:0)|(s.altKey?2:0)|(s.ctrlKey?4:0)|(s.metaKey?8:0);switch(s.keyCode){case 0:s.key==="UIKeyInputUpArrow"?c.key=h?l.C0.ESC+"OA":l.C0.ESC+"[A":s.key==="UIKeyInputLeftArrow"?c.key=h?l.C0.ESC+"OD":l.C0.ESC+"[D":s.key==="UIKeyInputRightArrow"?c.key=h?l.C0.ESC+"OC":l.C0.ESC+"[C":s.key==="UIKeyInputDownArrow"&&(c.key=h?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:c.key=s.ctrlKey?"\b":l.C0.DEL,s.altKey&&(c.key=l.C0.ESC+c.key);break;case 9:if(s.shiftKey){c.key=l.C0.ESC+"[Z";break}c.key=l.C0.HT,c.cancel=!0;break;case 13:c.key=s.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,c.cancel=!0;break;case 27:c.key=l.C0.ESC,s.altKey&&(c.key=l.C0.ESC+l.C0.ESC),c.cancel=!0;break;case 37:if(s.metaKey)break;t?(c.key=l.C0.ESC+"[1;"+(t+1)+"D",c.key===l.C0.ESC+"[1;3D"&&(c.key=l.C0.ESC+(_?"b":"[1;5D"))):c.key=h?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(s.metaKey)break;t?(c.key=l.C0.ESC+"[1;"+(t+1)+"C",c.key===l.C0.ESC+"[1;3C"&&(c.key=l.C0.ESC+(_?"f":"[1;5C"))):c.key=h?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(s.metaKey)break;t?(c.key=l.C0.ESC+"[1;"+(t+1)+"A",_||c.key!==l.C0.ESC+"[1;3A"||(c.key=l.C0.ESC+"[1;5A")):c.key=h?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(s.metaKey)break;t?(c.key=l.C0.ESC+"[1;"+(t+1)+"B",_||c.key!==l.C0.ESC+"[1;3B"||(c.key=l.C0.ESC+"[1;5B")):c.key=h?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:s.shiftKey||s.ctrlKey||(c.key=l.C0.ESC+"[2~");break;case 46:c.key=t?l.C0.ESC+"[3;"+(t+1)+"~":l.C0.ESC+"[3~";break;case 36:c.key=t?l.C0.ESC+"[1;"+(t+1)+"H":h?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:c.key=t?l.C0.ESC+"[1;"+(t+1)+"F":h?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:s.shiftKey?c.type=2:s.ctrlKey?c.key=l.C0.ESC+"[5;"+(t+1)+"~":c.key=l.C0.ESC+"[5~";break;case 34:s.shiftKey?c.type=3:s.ctrlKey?c.key=l.C0.ESC+"[6;"+(t+1)+"~":c.key=l.C0.ESC+"[6~";break;case 112:c.key=t?l.C0.ESC+"[1;"+(t+1)+"P":l.C0.ESC+"OP";break;case 113:c.key=t?l.C0.ESC+"[1;"+(t+1)+"Q":l.C0.ESC+"OQ";break;case 114:c.key=t?l.C0.ESC+"[1;"+(t+1)+"R":l.C0.ESC+"OR";break;case 115:c.key=t?l.C0.ESC+"[1;"+(t+1)+"S":l.C0.ESC+"OS";break;case 116:c.key=t?l.C0.ESC+"[15;"+(t+1)+"~":l.C0.ESC+"[15~";break;case 117:c.key=t?l.C0.ESC+"[17;"+(t+1)+"~":l.C0.ESC+"[17~";break;case 118:c.key=t?l.C0.ESC+"[18;"+(t+1)+"~":l.C0.ESC+"[18~";break;case 119:c.key=t?l.C0.ESC+"[19;"+(t+1)+"~":l.C0.ESC+"[19~";break;case 120:c.key=t?l.C0.ESC+"[20;"+(t+1)+"~":l.C0.ESC+"[20~";break;case 121:c.key=t?l.C0.ESC+"[21;"+(t+1)+"~":l.C0.ESC+"[21~";break;case 122:c.key=t?l.C0.ESC+"[23;"+(t+1)+"~":l.C0.ESC+"[23~";break;case 123:c.key=t?l.C0.ESC+"[24;"+(t+1)+"~":l.C0.ESC+"[24~";break;default:if(!s.ctrlKey||s.shiftKey||s.altKey||s.metaKey)if(_&&!g||!s.altKey||s.metaKey)!_||s.altKey||s.ctrlKey||s.shiftKey||!s.metaKey?s.key&&!s.ctrlKey&&!s.altKey&&!s.metaKey&&s.keyCode>=48&&s.key.length===1?c.key=s.key:s.key&&s.ctrlKey&&(s.key==="_"&&(c.key=l.C0.US),s.key==="@"&&(c.key=l.C0.NUL)):s.keyCode===65&&(c.type=1);else{const r=d[s.keyCode],e=r?.[s.shiftKey?1:0];if(e)c.key=l.C0.ESC+e;else if(s.keyCode>=65&&s.keyCode<=90){const i=s.ctrlKey?s.keyCode-64:s.keyCode+32;let a=String.fromCharCode(i);s.shiftKey&&(a=a.toUpperCase()),c.key=l.C0.ESC+a}else if(s.keyCode===32)c.key=l.C0.ESC+(s.ctrlKey?l.C0.NUL:" ");else if(s.key==="Dead"&&s.code.startsWith("Key")){let i=s.code.slice(3,4);s.shiftKey||(i=i.toLowerCase()),c.key=l.C0.ESC+i,c.cancel=!0}}else s.keyCode>=65&&s.keyCode<=90?c.key=String.fromCharCode(s.keyCode-64):s.keyCode===32?c.key=l.C0.NUL:s.keyCode>=51&&s.keyCode<=55?c.key=String.fromCharCode(s.keyCode-51+27):s.keyCode===56?c.key=l.C0.DEL:s.keyCode===219?c.key=l.C0.ESC:s.keyCode===220?c.key=l.C0.FS:s.keyCode===221&&(c.key=l.C0.GS)}return c}},482:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},n.utf32ToString=function(o,l=0,d=o.length){let s="";for(let h=l;h<d;++h){let _=o[h];_>65535?(_-=65536,s+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):s+=String.fromCharCode(_)}return s},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,l){const d=o.length;if(!d)return 0;let s=0,h=0;if(this._interim){const _=o.charCodeAt(h++);56320<=_&&_<=57343?l[s++]=1024*(this._interim-55296)+_-56320+65536:(l[s++]=this._interim,l[s++]=_),this._interim=0}for(let _=h;_<d;++_){const g=o.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=d)return this._interim=g,s;const c=o.charCodeAt(_);56320<=c&&c<=57343?l[s++]=1024*(g-55296)+c-56320+65536:(l[s++]=g,l[s++]=c)}else g!==65279&&(l[s++]=g)}return s}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,l){const d=o.length;if(!d)return 0;let s,h,_,g,c=0,t=0,r=0;if(this.interim[0]){let a=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let p,m=0;for(;(p=63&this.interim[++m])&&m<4;)v<<=6,v|=p;const f=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=f-m;for(;r<S;){if(r>=d)return 0;if(p=o[r++],(192&p)!=128){r--,a=!0;break}this.interim[m++]=p,v<<=6,v|=63&p}a||(f===2?v<128?r--:l[c++]=v:f===3?v<2048||v>=55296&&v<=57343||v===65279||(l[c++]=v):v<65536||v>1114111||(l[c++]=v)),this.interim.fill(0)}const e=d-4;let i=r;for(;i<d;){for(;!(!(i<e)||128&(s=o[i])||128&(h=o[i+1])||128&(_=o[i+2])||128&(g=o[i+3]));)l[c++]=s,l[c++]=h,l[c++]=_,l[c++]=g,i+=4;if(s=o[i++],s<128)l[c++]=s;else if((224&s)==192){if(i>=d)return this.interim[0]=s,c;if(h=o[i++],(192&h)!=128){i--;continue}if(t=(31&s)<<6|63&h,t<128){i--;continue}l[c++]=t}else if((240&s)==224){if(i>=d)return this.interim[0]=s,c;if(h=o[i++],(192&h)!=128){i--;continue}if(i>=d)return this.interim[0]=s,this.interim[1]=h,c;if(_=o[i++],(192&_)!=128){i--;continue}if(t=(15&s)<<12|(63&h)<<6|63&_,t<2048||t>=55296&&t<=57343||t===65279)continue;l[c++]=t}else if((248&s)==240){if(i>=d)return this.interim[0]=s,c;if(h=o[i++],(192&h)!=128){i--;continue}if(i>=d)return this.interim[0]=s,this.interim[1]=h,c;if(_=o[i++],(192&_)!=128){i--;continue}if(i>=d)return this.interim[0]=s,this.interim[1]=h,this.interim[2]=_,c;if(g=o[i++],(192&g)!=128){i--;continue}if(t=(7&s)<<18|(63&h)<<12|(63&_)<<6|63&g,t<65536||t>1114111)continue;l[c++]=t}}return c}}},225:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const l=o(1480),d=[[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]],s=[[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 h;n.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let _=0;_<d.length;++_)h.fill(0,d[_][0],d[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?h[_]:(function(g,c){let t,r=0,e=c.length-1;if(g<c[0][0]||g>c[e][1])return!1;for(;e>=r;)if(t=r+e>>1,g>c[t][1])r=t+1;else{if(!(g<c[t][0]))return!0;e=t-1}return!1})(_,s)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,g){let c=this.wcwidth(_),t=c===0&&g!==0;if(t){const r=l.UnicodeService.extractWidth(g);r===0?t=!1:r>c&&(c=r)}return l.UnicodeService.createPropertyValue(0,c,t)}}},5981:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const l=o(8460),d=o(844);class s extends d.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let c;for(this._isSyncWriting=!0;c=this._writeBuffer.shift();){this._action(c);const t=this._callbacks.shift();t&&t()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(g)}_innerWrite(_=0,g=!0){const c=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const t=this._writeBuffer[this._bufferOffset],r=this._action(t,g);if(r){const i=a=>Date.now()-c>=12?setTimeout((()=>this._innerWrite(0,a))):this._innerWrite(c,a);return void r.catch((a=>(queueMicrotask((()=>{throw a})),Promise.resolve(!1)))).then(i)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=t.length,Date.now()-c>=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()}}n.WriteBuffer=s},5941:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function d(s,h){const _=s.toString(16),g=_.length<2?"0"+_:_;switch(h){case 4:return _[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}n.parseColor=function(s){if(!s)return;let h=s.toLowerCase();if(h.indexOf("rgb:")===0){h=h.slice(4);const _=o.exec(h);if(_){const g=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/g*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/g*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/g*255)]}}else if(h.indexOf("#")===0&&(h=h.slice(1),l.exec(h)&&[3,6,9,12].includes(h.length))){const _=h.length/3,g=[0,0,0];for(let c=0;c<3;++c){const t=parseInt(h.slice(_*c,_*c+_),16);g[c]=_===1?t<<4:_===2?t:_===3?t>>4:t>>8}return g}},n.toRgbString=function(s,h=16){const[_,g,c]=s;return`rgb:${d(_,h)}/${d(g,h)}/${d(c,h)}`}},5770:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const l=o(482),d=o(8742),s=o(5770),h=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=h,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}registerHandler(g,c){this._handlers[g]===void 0&&(this._handlers[g]=[]);const t=this._handlers[g];return t.push(c),{dispose:()=>{const r=t.indexOf(c);r!==-1&&t.splice(r,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=h,this._ident=0}hook(g,c){if(this.reset(),this._ident=g,this._active=this._handlers[g]||h,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(c);else this._handlerFb(this._ident,"HOOK",c)}put(g,c,t){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(g,c,t);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,c,t))}unhook(g,c=!0){if(this._active.length){let t=!1,r=this._active.length-1,e=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,t=c,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;r>=0&&(t=this._active[r].unhook(g),t!==!0);r--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,t;r--}for(;r>=0;r--)if(t=this._active[r].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",g);this._active=h,this._ident=0}};const _=new d.Params;_.addParam(0),n.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=_,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():_,this._data="",this._hitLimit=!1}put(g,c,t){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,c,t),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let c=!1;if(this._hitLimit)c=!1;else if(g&&(c=this._handler(this._data,this._params),c instanceof Promise))return c.then((t=>(this._params=_,this._data="",this._hitLimit=!1,t)));return this._params=_,this._data="",this._hitLimit=!1,c}}},2015:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const l=o(844),d=o(8742),s=o(6242),h=o(6351);class _{constructor(r){this.table=new Uint8Array(r)}setDefault(r,e){this.table.fill(r<<4|e)}add(r,e,i,a){this.table[e<<8|r]=i<<4|a}addMany(r,e,i,a){for(let v=0;v<r.length;v++)this.table[e<<8|r[v]]=i<<4|a}}n.TransitionTable=_;const g=160;n.VT500_TRANSITION_TABLE=(function(){const t=new _(4095),r=Array.apply(null,Array(256)).map(((m,f)=>f)),e=(m,f)=>r.slice(m,f),i=e(32,127),a=e(0,24);a.push(25),a.push.apply(a,e(28,32));const v=e(0,14);let p;for(p in t.setDefault(1,0),t.addMany(i,0,2,0),v)t.addMany([24,26,153,154],p,3,0),t.addMany(e(128,144),p,3,0),t.addMany(e(144,152),p,3,0),t.add(156,p,0,0),t.add(27,p,11,1),t.add(157,p,4,8),t.addMany([152,158,159],p,0,7),t.add(155,p,11,3),t.add(144,p,11,9);return t.addMany(a,0,3,0),t.addMany(a,1,3,1),t.add(127,1,0,1),t.addMany(a,8,0,8),t.addMany(a,3,3,3),t.add(127,3,0,3),t.addMany(a,4,3,4),t.add(127,4,0,4),t.addMany(a,6,3,6),t.addMany(a,5,3,5),t.add(127,5,0,5),t.addMany(a,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(i,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(i,7,0,7),t.addMany(a,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(a,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(a,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(a,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(a,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(a,13,13,13),t.addMany(i,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(g,0,2,0),t.add(g,8,5,8),t.add(g,6,0,6),t.add(g,11,0,11),t.add(g,13,13,13),t})();class c extends l.Disposable{constructor(r=n.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 d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,i,a)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,i)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new s.OscParser),this._dcsParser=this.register(new h.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(r,e=[64,126]){let i=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=r.prefix.charCodeAt(0),i&&60>i||i>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 v=0;v<r.intermediates.length;++v){const p=r.intermediates.charCodeAt(v);if(32>p||p>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=p}}if(r.final.length!==1)throw new Error("final must be a single byte");const a=r.final.charCodeAt(0);if(e[0]>a||a>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return i<<=8,i|=a,i}identToString(r){const e=[];for(;r;)e.push(String.fromCharCode(255&r)),r>>=8;return e.reverse().join("")}setPrintHandler(r){this._printHandler=r}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(r,e){const i=this._identifier(r,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const a=this._escHandlers[i];return a.push(e),{dispose:()=>{const v=a.indexOf(e);v!==-1&&a.splice(v,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,e){this._executeHandlers[r.charCodeAt(0)]=e}clearExecuteHandler(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]}setExecuteHandlerFallback(r){this._executeHandlerFb=r}registerCsiHandler(r,e){const i=this._identifier(r);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const a=this._csiHandlers[i];return a.push(e),{dispose:()=>{const v=a.indexOf(e);v!==-1&&a.splice(v,1)}}}clearCsiHandler(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]}setCsiHandlerFallback(r){this._csiHandlerFb=r}registerDcsHandler(r,e){return this._dcsParser.registerHandler(this._identifier(r),e)}clearDcsHandler(r){this._dcsParser.clearHandler(this._identifier(r))}setDcsHandlerFallback(r){this._dcsParser.setHandlerFallback(r)}registerOscHandler(r,e){return this._oscParser.registerHandler(r,e)}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.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(r,e,i,a,v){this._parseStack.state=r,this._parseStack.handlers=e,this._parseStack.handlerPos=i,this._parseStack.transition=a,this._parseStack.chunkPos=v}parse(r,e,i){let a,v=0,p=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const f=this._parseStack.handlers;let S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&S>-1){for(;S>=0&&(a=f[S](this._params),a!==!0);S--)if(a instanceof Promise)return this._parseStack.handlerPos=S,a}this._parseStack.handlers=[];break;case 4:if(i===!1&&S>-1){for(;S>=0&&(a=f[S](),a!==!0);S--)if(a instanceof Promise)return this._parseStack.handlerPos=S,a}this._parseStack.handlers=[];break;case 6:if(v=r[this._parseStack.chunkPos],a=this._dcsParser.unhook(v!==24&&v!==26,i),a)return a;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=r[this._parseStack.chunkPos],a=this._oscParser.end(v!==24&&v!==26,i),a)return a;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let f=m;f<e;++f){switch(v=r[f],p=this._transitions.table[this.currentState<<8|(v<160?v:g)],p>>4){case 2:for(let w=f+1;;++w){if(w>=e||(v=r[w])<32||v>126&&v<g){this._printHandler(r,f,w),f=w-1;break}if(++w>=e||(v=r[w])<32||v>126&&v<g){this._printHandler(r,f,w),f=w-1;break}if(++w>=e||(v=r[w])<32||v>126&&v<g){this._printHandler(r,f,w),f=w-1;break}if(++w>=e||(v=r[w])<32||v>126&&v<g){this._printHandler(r,f,w),f=w-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const S=this._csiHandlers[this._collect<<8|v];let E=S?S.length-1:-1;for(;E>=0&&(a=S[E](this._params),a!==!0);E--)if(a instanceof Promise)return this._preserveStack(3,S,E,p,f),a;E<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingJoinState=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++f<e&&(v=r[f])>47&&v<60);f--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const k=this._escHandlers[this._collect<<8|v];let A=k?k.length-1:-1;for(;A>=0&&(a=k[A](),a!==!0);A--)if(a instanceof Promise)return this._preserveStack(4,k,A,p,f),a;A<0&&this._escHandlerFb(this._collect<<8|v),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|v,this._params);break;case 13:for(let w=f+1;;++w)if(w>=e||(v=r[w])===24||v===26||v===27||v>127&&v<g){this._dcsParser.put(r,f,w),f=w-1;break}break;case 14:if(a=this._dcsParser.unhook(v!==24&&v!==26),a)return this._preserveStack(6,[],0,p,f),a;v===27&&(p|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let w=f+1;;w++)if(w>=e||(v=r[w])<32||v>127&&v<g){this._oscParser.put(r,f,w),f=w-1;break}break;case 6:if(a=this._oscParser.end(v!==24&&v!==26),a)return this._preserveStack(5,[],0,p,f),a;v===27&&(p|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&p}}}n.EscapeSequenceParser=c},6242:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const l=o(5770),d=o(482),s=[];n.OscParser=class{constructor(){this._state=0,this._active=s,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(h,_){this._handlers[h]===void 0&&(this._handlers[h]=[]);const g=this._handlers[h];return g.push(_),{dispose:()=>{const c=g.indexOf(_);c!==-1&&g.splice(c,1)}}}clearHandler(h){this._handlers[h]&&delete this._handlers[h]}setHandlerFallback(h){this._handlerFb=h}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=s}reset(){if(this._state===2)for(let h=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;h>=0;--h)this._active[h].end(!1);this._stack.paused=!1,this._active=s,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||s,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].start();else this._handlerFb(this._id,"START")}_put(h,_,g){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(h,_,g);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(h,_,g))}start(){this.reset(),this._state=1}put(h,_,g){if(this._state!==3){if(this._state===1)for(;_<g;){const c=h[_++];if(c===59){this._state=2,this._start();break}if(c<48||57<c)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+c-48}this._state===2&&g-_>0&&this._put(h,_,g)}}end(h,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,c=this._active.length-1,t=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,g=_,t=this._stack.fallThrough,this._stack.paused=!1),!t&&g===!1){for(;c>=0&&(g=this._active[c].end(h),g!==!0);c--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,g;c--}for(;c>=0;c--)if(g=this._active[c].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",h);this._active=s,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(h){this._handler=h,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(h,_,g){this._hitLimit||(this._data+=(0,d.utf32ToString)(h,_,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(h){let _=!1;if(this._hitLimit)_=!1;else if(h&&(_=this._handler(this._data),_ instanceof Promise))return _.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,_}}},8742:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const o=2147483647;class l{static fromArray(s){const h=new l;if(!s.length)return h;for(let _=Array.isArray(s[0])?1:0;_<s.length;++_){const g=s[_];if(Array.isArray(g))for(let c=0;c<g.length;++c)h.addSubParam(g[c]);else h.addParam(g)}return h}constructor(s=32,h=32){if(this.maxLength=s,this.maxSubParamsLength=h,h>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(s),this.length=0,this._subParams=new Int32Array(h),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(s),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const s=new l(this.maxLength,this.maxSubParamsLength);return s.params.set(this.params),s.length=this.length,s._subParams.set(this._subParams),s._subParamsLength=this._subParamsLength,s._subParamsIdx.set(this._subParamsIdx),s._rejectDigits=this._rejectDigits,s._rejectSubDigits=this._rejectSubDigits,s._digitIsSub=this._digitIsSub,s}toArray(){const s=[];for(let h=0;h<this.length;++h){s.push(this.params[h]);const _=this._subParamsIdx[h]>>8,g=255&this._subParamsIdx[h];g-_>0&&s.push(Array.prototype.slice.call(this._subParams,_,g))}return s}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(s){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(s<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=s>o?o:s}}addSubParam(s){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(s<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=s>o?o:s,this._subParamsIdx[this.length-1]++}}hasSubParams(s){return(255&this._subParamsIdx[s])-(this._subParamsIdx[s]>>8)>0}getSubParams(s){const h=this._subParamsIdx[s]>>8,_=255&this._subParamsIdx[s];return _-h>0?this._subParams.subarray(h,_):null}getSubParamsAll(){const s={};for(let h=0;h<this.length;++h){const _=this._subParamsIdx[h]>>8,g=255&this._subParamsIdx[h];g-_>0&&(s[h]=this._subParams.slice(_,g))}return s}addDigit(s){let h;if(this._rejectDigits||!(h=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,g=_[h-1];_[h-1]=~g?Math.min(10*g+s,o):s}}n.Params=l},5741:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,l){const d={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(d),l.dispose=()=>this._wrappedAddonDispose(d),l.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let l=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===o){l=d;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(l,1)}}},8771:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const l=o(3785),d=o(511);n.BufferApiView=class{constructor(s,h){this._buffer=s,this.type=h}init(s){return this._buffer=s,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(s){const h=this._buffer.lines.get(s);if(h)return new l.BufferLineApiView(h)}getNullCell(){return new d.CellData}}},3785:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const l=o(511);n.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,s){if(!(d<0||d>=this._line.length))return s?(this._line.loadCell(d,s),s):this._line.loadCell(d,new l.CellData)}translateToString(d,s,h){return this._line.translateToString(d,s,h)}}},8285:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const l=o(8771),d=o(8460),s=o(844);class h extends s.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}n.BufferNamespaceApi=h},7975:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,l){return this._core.registerCsiHandler(o,(d=>l(d.toArray())))}addCsiHandler(o,l){return this.registerCsiHandler(o,l)}registerDcsHandler(o,l){return this._core.registerDcsHandler(o,((d,s)=>l(d,s.toArray())))}addDcsHandler(o,l){return this.registerDcsHandler(o,l)}registerEscHandler(o,l){return this._core.registerEscHandler(o,l)}addEscHandler(o,l){return this.registerEscHandler(o,l)}registerOscHandler(o,l){return this._core.registerOscHandler(o,l)}addOscHandler(o,l){return this.registerOscHandler(o,l)}}},7090:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(u,n,o){var l=this&&this.__decorate||function(t,r,e,i){var a,v=arguments.length,p=v<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,r,e,i);else for(var m=t.length-1;m>=0;m--)(a=t[m])&&(p=(v<3?a(p):v>3?a(r,e,p):a(r,e))||p);return v>3&&p&&Object.defineProperty(r,e,p),p},d=this&&this.__param||function(t,r){return function(e,i){r(e,i,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const s=o(8460),h=o(844),_=o(5295),g=o(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let c=n.BufferService=class extends h.Disposable{get buffer(){return this.buffers.active}constructor(t){super(),this.isUserScrolling=!1,this._onResize=this.register(new s.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(t,this))}resize(t,r){this.cols=t,this.rows=r,this.buffers.resize(t,r),this._onResize.fire({cols:t,rows:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,r=!1){const e=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===t.fg&&i.getBg(0)===t.bg||(i=e.getBlankLine(t,r),this._cachedBlankLine=i),i.isWrapped=r;const a=e.ybase+e.scrollTop,v=e.ybase+e.scrollBottom;if(e.scrollTop===0){const p=e.lines.isFull;v===e.lines.length-1?p?e.lines.recycle().copyFrom(i):e.lines.push(i.clone()):e.lines.splice(v+1,0,i.clone()),p?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const p=v-a+1;e.lines.shiftElements(a+1,p-1,-1),e.lines.set(v,i.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,r,e){const i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const a=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),a!==i.ydisp&&(r||this._onScroll.fire(i.ydisp))}};n.BufferService=c=l([d(0,g.IOptionsService)],c)},7994:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,l){this._charsets[o]=l,this.glevel===o&&(this.charset=l)}}},1753:function(u,n,o){var l=this&&this.__decorate||function(i,a,v,p){var m,f=arguments.length,S=f<3?a:p===null?p=Object.getOwnPropertyDescriptor(a,v):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(i,a,v,p);else for(var E=i.length-1;E>=0;E--)(m=i[E])&&(S=(f<3?m(S):f>3?m(a,v,S):m(a,v))||S);return f>3&&S&&Object.defineProperty(a,v,S),S},d=this&&this.__param||function(i,a){return function(v,p){a(v,p,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const s=o(2585),h=o(8460),_=o(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function c(i,a){let v=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(v|=64,v|=i.action):(v|=3&i.button,4&i.button&&(v|=64),8&i.button&&(v|=128),i.action===32?v|=32:i.action!==0||a||(v|=3)),v}const t=String.fromCharCode,r={DEFAULT:i=>{const a=[c(i,!1)+32,i.col+32,i.row+32];return a[0]>255||a[1]>255||a[2]>255?"":`\x1B[M${t(a[0])}${t(a[1])}${t(a[2])}`},SGR:i=>{const a=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${c(i,!0)};${i.col};${i.row}${a}`},SGR_PIXELS:i=>{const a=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${c(i,!0)};${i.x};${i.y}${a}`}};let e=n.CoreMouseService=class extends _.Disposable{constructor(i,a){super(),this._bufferService=i,this._coreService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new h.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(g))this.addProtocol(v,g[v]);for(const v of Object.keys(r))this.addEncoding(v,r[v]);this.reset()}addProtocol(i,a){this._protocols[i]=a}addEncoding(i,a){this._encodings[i]=a}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;const a=this._encodings[this._activeEncoding](i);return a&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(a):this._coreService.triggerDataEvent(a,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,a,v){if(v){if(i.x!==a.x||i.y!==a.y)return!1}else if(i.col!==a.col||i.row!==a.row)return!1;return i.button===a.button&&i.action===a.action&&i.ctrl===a.ctrl&&i.alt===a.alt&&i.shift===a.shift}};n.CoreMouseService=e=l([d(0,s.IBufferService),d(1,s.ICoreService)],e)},6975:function(u,n,o){var l=this&&this.__decorate||function(e,i,a,v){var p,m=arguments.length,f=m<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,i,a,v);else for(var S=e.length-1;S>=0;S--)(p=e[S])&&(f=(m<3?p(f):m>3?p(i,a,f):p(i,a))||f);return m>3&&f&&Object.defineProperty(i,a,f),f},d=this&&this.__param||function(e,i){return function(a,v){i(a,v,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const s=o(1439),h=o(8460),_=o(844),g=o(2585),c=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let r=n.CoreService=class extends _.Disposable{constructor(e,i,a){super(),this._bufferService=e,this._logService=i,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new h.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new h.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,s.clone)(c),this.decPrivateModes=(0,s.clone)(t)}reset(){this.modes=(0,s.clone)(c),this.decPrivateModes=(0,s.clone)(t)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const a=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((v=>v.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((i=>i.charCodeAt(0))))),this._onBinary.fire(e))}};n.CoreService=r=l([d(0,g.IBufferService),d(1,g.ILogService),d(2,g.IOptionsService)],r)},9074:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const l=o(8055),d=o(8460),s=o(844),h=o(6106);let _=0,g=0;class c extends s.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new h.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,s.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const i=new t(e);if(i){const a=i.marker.onDispose((()=>i.dispose()));i.onDispose((()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),a.dispose())})),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,i,a){let v=0,p=0;for(const m of this._decorations.getKeyIterator(i))v=m.options.x??0,p=v+(m.options.width??1),e>=v&&e<p&&(!a||(m.options.layer??"bottom")===a)&&(yield m)}forEachDecorationAtCell(e,i,a,v){this._decorations.forEachByKey(i,(p=>{_=p.options.x??0,g=_+(p.options.width??1),e>=_&&e<g&&(!a||(p.options.layer??"bottom")===a)&&v(p)}))}}n.DecorationService=c;class t extends s.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const l=o(2585),d=o(8343);class s{constructor(..._){this._entries=new Map;for(const[g,c]of _)this.set(g,c)}set(_,g){const c=this._entries.get(_);return this._entries.set(_,g),c}forEach(_){for(const[g,c]of this._entries.entries())_(g,c)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}n.ServiceCollection=s,n.InstantiationService=class{constructor(){this._services=new s,this._services.set(l.IInstantiationService,this)}setService(h,_){this._services.set(h,_)}getService(h){return this._services.get(h)}createInstance(h,..._){const g=(0,d.getServiceDependencies)(h).sort(((r,e)=>r.index-e.index)),c=[];for(const r of g){const e=this._services.get(r.id);if(!e)throw new Error(`[createInstance] ${h.name} depends on UNKNOWN service ${r.id}.`);c.push(e)}const t=g.length>0?g[0].index:_.length;if(_.length!==t)throw new Error(`[createInstance] First service dependency of ${h.name} at position ${t+1} conflicts with ${_.length} static arguments`);return new h(..._,...c)}}},7866:function(u,n,o){var l=this&&this.__decorate||function(t,r,e,i){var a,v=arguments.length,p=v<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,r,e,i);else for(var m=t.length-1;m>=0;m--)(a=t[m])&&(p=(v<3?a(p):v>3?a(r,e,p):a(r,e))||p);return v>3&&p&&Object.defineProperty(r,e,p),p},d=this&&this.__param||function(t,r){return function(e,i){r(e,i,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const s=o(844),h=o(2585),_={trace:h.LogLevelEnum.TRACE,debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF};let g,c=n.LogService=class extends s.Disposable{get logLevel(){return this._logLevel}constructor(t){super(),this._optionsService=t,this._logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let r=0;r<t.length;r++)typeof t[r]=="function"&&(t[r]=t[r]())}_log(t,r,e){this._evalLazyOptionalParams(e),t.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+r,...e)}trace(t,...r){this._logLevel<=h.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,r)}debug(t,...r){this._logLevel<=h.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,r)}info(t,...r){this._logLevel<=h.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,r)}warn(t,...r){this._logLevel<=h.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,r)}error(t,...r){this._logLevel<=h.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,r)}};n.LogService=c=l([d(0,h.IOptionsService)],c),n.setTraceLogger=function(t){g=t},n.traceCall=function(t,r,e){if(typeof e.value!="function")throw new Error("not supported");const i=e.value;e.value=function(...a){if(g.logLevel!==h.LogLevelEnum.TRACE)return i.apply(this,a);g.trace(`GlyphRenderer#${i.name}(${a.map((p=>JSON.stringify(p))).join(", ")})`);const v=i.apply(this,a);return g.trace(`GlyphRenderer#${i.name} return`,v),v}}},7302:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const l=o(8460),d=o(844),s=o(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:s.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const h=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends d.Disposable{constructor(c){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const t={...n.DEFAULT_OPTIONS};for(const r in c)if(r in t)try{const e=c[r];t[r]=this._sanitizeAndValidateOption(r,e)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this.register((0,d.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(c,t){return this.onOptionChange((r=>{r===c&&t(this.rawOptions[c])}))}onMultipleOptionChange(c,t){return this.onOptionChange((r=>{c.indexOf(r)!==-1&&t()}))}_setupOptions(){const c=r=>{if(!(r in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,e)=>{if(!(r in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);e=this._sanitizeAndValidateOption(r,e),this.rawOptions[r]!==e&&(this.rawOptions[r]=e,this._onOptionChange.fire(r))};for(const r in this.rawOptions){const e={get:c.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,e)}}_sanitizeAndValidateOption(c,t){switch(c){case"cursorStyle":if(t||(t=n.DEFAULT_OPTIONS[c]),!(function(r){return r==="block"||r==="underline"||r==="bar"})(t))throw new Error(`"${t}" is not a valid value for ${c}`);break;case"wordSeparator":t||(t=n.DEFAULT_OPTIONS[c]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=h.includes(t)?t:n.DEFAULT_OPTIONS[c];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${c} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(`${c} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${c} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${c} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{}}return t}}n.OptionsService=_},2660:function(u,n,o){var l=this&&this.__decorate||function(_,g,c,t){var r,e=arguments.length,i=e<3?g:t===null?t=Object.getOwnPropertyDescriptor(g,c):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(_,g,c,t);else for(var a=_.length-1;a>=0;a--)(r=_[a])&&(i=(e<3?r(i):e>3?r(g,c,i):r(g,c))||i);return e>3&&i&&Object.defineProperty(g,c,i),i},d=this&&this.__param||function(_,g){return function(c,t){g(c,t,_)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const s=o(2585);let h=n.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const g=this._bufferService.buffer;if(_.id===void 0){const a=g.addMarker(g.ybase+g.y),v={data:_,id:this._nextId++,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(v,a))),this._dataByLinkId.set(v.id,v),v.id}const c=_,t=this._getEntryIdKey(c),r=this._entriesWithId.get(t);if(r)return this.addLineToLink(r.id,g.ybase+g.y),r.id;const e=g.addMarker(g.ybase+g.y),i={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[e]};return e.onDispose((()=>this._removeMarkerFromLink(i,e))),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(_,g){const c=this._dataByLinkId.get(_);if(c&&c.lines.every((t=>t.line!==g))){const t=this._bufferService.buffer.addMarker(g);c.lines.push(t),t.onDispose((()=>this._removeMarkerFromLink(c,t)))}}getLinkData(_){return this._dataByLinkId.get(_)?.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,g){const c=_.lines.indexOf(g);c!==-1&&(_.lines.splice(c,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};n.OscLinkService=h=l([d(0,s.IBufferService)],h)},8343:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const o="di$target",l="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(d){return d[l]||[]},n.createDecorator=function(d){if(n.serviceRegistry.has(d))return n.serviceRegistry.get(d);const s=function(h,_,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,t,r){t[o]===t?t[l].push({id:c,index:r}):(t[l]=[{id:c,index:r}],t[o]=t)})(s,h,g)};return s.toString=()=>d,n.serviceRegistry.set(d,s),s}},2585:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const l=o(8343);var d;n.IBufferService=(0,l.createDecorator)("BufferService"),n.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),n.ICoreService=(0,l.createDecorator)("CoreService"),n.ICharsetService=(0,l.createDecorator)("CharsetService"),n.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(s){s[s.TRACE=0]="TRACE",s[s.DEBUG=1]="DEBUG",s[s.INFO=2]="INFO",s[s.WARN=3]="WARN",s[s.ERROR=4]="ERROR",s[s.OFF=5]="OFF"})(d||(n.LogLevelEnum=d={})),n.ILogService=(0,l.createDecorator)("LogService"),n.IOptionsService=(0,l.createDecorator)("OptionsService"),n.IOscLinkService=(0,l.createDecorator)("OscLinkService"),n.IUnicodeService=(0,l.createDecorator)("UnicodeService"),n.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const l=o(8460),d=o(225);class s{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,g,c=!1){return(16777215&_)<<3|(3&g)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const _=new d.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let g=0,c=0;const t=_.length;for(let r=0;r<t;++r){let e=_.charCodeAt(r);if(55296<=e&&e<=56319){if(++r>=t)return g+this.wcwidth(e);const v=_.charCodeAt(r);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:g+=this.wcwidth(v)}const i=this.charProperties(e,c);let a=s.extractWidth(i);s.extractShouldJoin(i)&&(a-=s.extractWidth(c)),g+=a,c=i}return g}charProperties(_,g){return this._activeProvider.charProperties(_,g)}}n.UnicodeService=s}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u].call(o.exports,o,o.exports,N),o.exports}var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const n=N(9042),o=N(3236),l=N(844),d=N(5741),s=N(8285),h=N(7975),_=N(7090),g=["cols","rows"];class c extends l.Disposable{constructor(r){super(),this._core=this.register(new o.Terminal(r)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const e=a=>this._core.options[a],i=(a,v)=>{this._checkReadonlyOptions(a),this._core.options[a]=v};for(const a in this._core.options){const v={get:e.bind(this,a),set:i.bind(this,a)};Object.defineProperty(this._publicOptions,a,v)}}_checkReadonlyOptions(r){if(g.includes(r))throw new Error(`Option "${r}" 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 _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new s.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const r=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:r.applicationCursorKeys,applicationKeypadMode:r.applicationKeypad,bracketedPasteMode:r.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:r.origin,reverseWraparoundMode:r.reverseWraparound,sendFocusMode:r.sendFocus,wraparoundMode:r.wraparound}}get options(){return this._publicOptions}set options(r){for(const e in r)this._publicOptions[e]=r[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(r,e=!0){this._core.input(r,e)}resize(r,e){this._verifyIntegers(r,e),this._core.resize(r,e)}open(r){this._core.open(r)}attachCustomKeyEventHandler(r){this._core.attachCustomKeyEventHandler(r)}attachCustomWheelEventHandler(r){this._core.attachCustomWheelEventHandler(r)}registerLinkProvider(r){return this._core.registerLinkProvider(r)}registerCharacterJoiner(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)}deregisterCharacterJoiner(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)}registerMarker(r=0){return this._verifyIntegers(r),this._core.registerMarker(r)}registerDecoration(r){return this._checkProposedApi(),this._verifyPositiveIntegers(r.x??0,r.width??0,r.height??0),this._core.registerDecoration(r)}hasSelection(){return this._core.hasSelection()}select(r,e,i){this._verifyIntegers(r,e,i),this._core.select(r,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(r,e){this._verifyIntegers(r,e),this._core.selectLines(r,e)}dispose(){super.dispose()}scrollLines(r){this._verifyIntegers(r),this._core.scrollLines(r)}scrollPages(r){this._verifyIntegers(r),this._core.scrollPages(r)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(r){this._verifyIntegers(r),this._core.scrollToLine(r)}clear(){this._core.clear()}write(r,e){this._core.write(r,e)}writeln(r,e){this._core.write(r),this._core.write(`\r
|
|
9
|
-
`,e)}paste(r){this._core.paste(r)}refresh(r,e){this._verifyIntegers(r,e),this._core.refresh(r,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(r){this._addonManager.loadAddon(this,r)}static get strings(){return n}_verifyIntegers(...r){for(const e of r)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...r){for(const e of r)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}u.Terminal=c})(),V})()))})(me)),me.exports}var Ve=qe(),Se={exports:{}},ke;function Ge(){return ke||(ke=1,(function(Q,J){(function(Z,K){Q.exports=K()})(self,(()=>(()=>{var Z={};return(()=>{var K=Z;Object.defineProperty(K,"__esModule",{value:!0}),K.FitAddon=void 0,K.FitAddon=class{activate(N){this._terminal=N}dispose(){}fit(){const N=this.proposeDimensions();if(!N||!this._terminal||isNaN(N.cols)||isNaN(N.rows))return;const V=this._terminal._core;this._terminal.rows===N.rows&&this._terminal.cols===N.cols||(V._renderService.clear(),this._terminal.resize(N.cols,N.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const N=this._terminal._core,V=N._renderService.dimensions;if(V.css.cell.width===0||V.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:N.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(n.getPropertyValue("height")),l=Math.max(0,parseInt(n.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),s=o-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),h=l-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(h/V.css.cell.width)),rows:Math.max(1,Math.floor(s/V.css.cell.height))}}}})(),Z})()))})(Se)),Se.exports}var Xe=Ge(),_e={exports:{}},Je=_e.exports,De;function Ye(){return De||(De=1,(function(Q,J){(function(Z,K){Q.exports=K()})(Je,(()=>(()=>{var Z={433:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV11=void 0;const l=o(938),d=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],s=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],h=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let g;function c(t,r){let e,i=0,a=r.length-1;if(t<r[0][0]||t>r[a][1])return!1;for(;a>=i;)if(e=i+a>>1,t>r[e][1])i=e+1;else{if(!(t<r[e][0]))return!0;a=e-1}return!1}n.UnicodeV11=class{constructor(){if(this.version="11",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160);for(let t=0;t<d.length;++t)g.fill(0,d[t][0],d[t][1]+1);for(let t=0;t<h.length;++t)g.fill(2,h[t][0],h[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?g[t]:c(t,s)?0:c(t,_)?2:1}charProperties(t,r){let e=this.wcwidth(t),i=e===0&&r!==0;if(i){const a=l.UnicodeService.extractWidth(r);a===0?i=!1:a>e&&(e=a)}return l.UnicodeService.createPropertyValue(0,e,i)}}},345:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===o)return void this._listeners.splice(l,1)}}})),this._event}fire(o,l){const d=[];for(let s=0;s<this._listeners.length;s++)d.push(this._listeners[s]);for(let s=0;s<d.length;s++)d[s].call(void 0,o,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(o,l){return o((d=>l.fire(d)))},n.runAndSubscribe=function(o,l){return l(void 0),o((d=>l(d)))}},490:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const l=o(938),d=[[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]],s=[[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 h;n.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let _=0;_<d.length;++_)h.fill(0,d[_][0],d[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?h[_]:(function(g,c){let t,r=0,e=c.length-1;if(g<c[0][0]||g>c[e][1])return!1;for(;e>=r;)if(t=r+e>>1,g>c[t][1])r=t+1;else{if(!(g<c[t][0]))return!0;e=t-1}return!1})(_,s)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,g){let c=this.wcwidth(_),t=c===0&&g!==0;if(t){const r=l.UnicodeService.extractWidth(g);r===0?t=!1:r>c&&(c=r)}return l.UnicodeService.createPropertyValue(0,c,t)}}},938:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const l=o(345),d=o(490);class s{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,g,c=!1){return(16777215&_)<<3|(3&g)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const _=new d.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let g=0,c=0;const t=_.length;for(let r=0;r<t;++r){let e=_.charCodeAt(r);if(55296<=e&&e<=56319){if(++r>=t)return g+this.wcwidth(e);const v=_.charCodeAt(r);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:g+=this.wcwidth(v)}const i=this.charProperties(e,c);let a=s.extractWidth(i);s.extractShouldJoin(i)&&(a-=s.extractWidth(c)),g+=a,c=i}return g}charProperties(_,g){return this._activeProvider.charProperties(_,g)}}n.UnicodeService=s}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u](o,o.exports,N),o.exports}var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.Unicode11Addon=void 0;const n=N(433);u.Unicode11Addon=class{activate(o){o.unicode.register(new n.UnicodeV11)}dispose(){}}})(),V})()))})(_e)),_e.exports}var Ze=Ye(),Ce={exports:{}},Le;function Qe(){return Le||(Le=1,(function(Q){var J={};Q.exports=J,J.eastAsianWidth=function(K){var N=K.charCodeAt(0),V=K.length===2?K.charCodeAt(1):0,u=N;return 55296<=N&&N<=56319&&56320<=V&&V<=57343&&(N&=1023,V&=1023,u=N<<10|V,u+=65536),u===12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u===8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u===172||u===175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u===161||u===164||167<=u&&u<=168||u===170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u===198||u===208||215<=u&&u<=216||222<=u&&u<=225||u===230||232<=u&&u<=234||236<=u&&u<=237||u===240||242<=u&&u<=243||247<=u&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||294<=u&&u<=295||u===299||305<=u&&u<=307||u===312||319<=u&&u<=322||u===324||328<=u&&u<=331||u===333||338<=u&&u<=339||358<=u&&u<=359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||713<=u&&u<=715||u===717||u===720||728<=u&&u<=731||u===733||u===735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u===1025||1040<=u&&u<=1103||u===1105||u===8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u===8240||8242<=u&&u<=8243||u===8245||u===8251||u===8254||u===8308||u===8319||8321<=u&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||8481<=u&&u<=8482||u===8486||u===8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u===8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u===8658||u===8660||u===8679||u===8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u===8715||u===8719||u===8721||u===8725||u===8730||8733<=u&&u<=8736||u===8739||u===8741||8743<=u&&u<=8748||u===8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u===8776||u===8780||u===8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u===8853||u===8857||u===8869||u===8895||u===8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u===9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u===9711||9733<=u&&u<=9734||u===9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u===9756||u===9758||u===9792||u===9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u===9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u===9955||9960<=u&&u<=9983||u===10045||u===10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u===65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},J.characterLength=function(K){var N=this.eastAsianWidth(K);return N==="F"||N==="W"||N==="A"?2:1};function Z(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}J.length=function(K){for(var N=Z(K),V=0,u=0;u<N.length;u++)V=V+this.characterLength(N[u]);return V},J.slice=function(K,N,V){var u=J.length(K);N=N??0,V=V===void 0||N===null?1:V,N<0&&(N=u+N),V<0&&(V=u+V);for(var n="",o=0,l=Z(K),d=0;d<l.length;d++){var s=l[d],h=J.length(s);if(o>=N-(h===2?1:0))if(o+h<=V)n+=s;else break;o+=h}return n}})(Ce)),Ce.exports}var le=Qe();const et=()=>{const Q=ye("/"),J=o=>{const l=/^([A-Za-z]):[\\/]?(.*)/.exec(o);if(!l)return{letter:"",rest:o.replace(/\\/g,"/")};if(!l[1]||!l[2])throw new Error("splitDriveLetter path error");return{letter:l[1].toUpperCase(),rest:l[2].replace(/\\/g,"/")}},Z=(o,l)=>o?`${o}:\\${l.replace(/\//g,"\\")}`:l.replace(/\//g,"\\"),K=async()=>{const o=await Oe();Q.value=o.data?.cwd||"/"},N=o=>{Q.value=o},V=o=>{const l=/^\s*cd\s+([^\s]*)\s*$/i,d=o.match(l);if(!d)return{isCd:!1};const s=d[1]||"/",{rest:h,letter:_}=J(Q.value),g=Pe.resolve(`/${h}`,s);return{newCwd:Z(_,g.slice(1)),oldCwd:Q.value,isCd:!0}},u=o=>{const{isCd:l,newCwd:d,oldCwd:s}=V(o);if(l){ie.emit("command",{command:"",cwd:d,oldCwd:s});return}ie.emit("command",{command:o,cwd:Q.value})},n=(o="")=>{ie.emit("tab",{cwd:Q.value,lastWord:o})};return{cwd:Me(()=>Q.value),initCwd:K,sendCommand:u,updateCwd:N,sendTabCommand:n}};var be={exports:{}},Re;function tt(){return Re||(Re=1,(function(Q,J){(function(Z,K){Q.exports=K()})(self,(()=>(()=>{var Z={6:(u,n)=>{function o(d){try{const s=new URL(d),h=s.password&&s.username?`${s.protocol}//${s.username}:${s.password}@${s.host}`:s.username?`${s.protocol}//${s.username}@${s.host}`:`${s.protocol}//${s.host}`;return d.toLocaleLowerCase().startsWith(h.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(d,s,h,_={}){this._terminal=d,this._regex=s,this._handler=h,this._options=_}provideLinks(d,s){const h=l.computeLink(d,this._regex,this._terminal,this._handler);s(this._addCallbacks(h))}_addCallbacks(d){return d.map((s=>(s.leave=this._options.leave,s.hover=(h,_)=>{if(this._options.hover){const{range:g}=s;this._options.hover(h,_,g)}},s)))}};class l{static computeLink(s,h,_,g){const c=new RegExp(h.source,(h.flags||"")+"g"),[t,r]=l._getWindowedLineStrings(s-1,_),e=t.join("");let i;const a=[];for(;i=c.exec(e);){const v=i[0];if(!o(v))continue;const[p,m]=l._mapStrIdx(_,r,0,i.index),[f,S]=l._mapStrIdx(_,p,m,v.length);if(p===-1||m===-1||f===-1||S===-1)continue;const E={start:{x:m+1,y:p+1},end:{x:S,y:f+1}};a.push({range:E,text:v,activate:g})}return a}static _getWindowedLineStrings(s,h){let _,g=s,c=s,t=0,r="";const e=[];if(_=h.buffer.active.getLine(s)){const i=_.translateToString(!0);if(_.isWrapped&&i[0]!==" "){for(t=0;(_=h.buffer.active.getLine(--g))&&t<2048&&(r=_.translateToString(!0),t+=r.length,e.push(r),_.isWrapped&&r.indexOf(" ")===-1););e.reverse()}for(e.push(i),t=0;(_=h.buffer.active.getLine(++c))&&_.isWrapped&&t<2048&&(r=_.translateToString(!0),t+=r.length,e.push(r),r.indexOf(" ")===-1););}return[e,g]}static _mapStrIdx(s,h,_,g){const c=s.buffer.active,t=c.getNullCell();let r=_;for(;g;){const e=c.getLine(h);if(!e)return[-1,-1];for(let i=r;i<e.length;++i){e.getCell(i,t);const a=t.getChars();if(t.getWidth()&&(g-=a.length||1,i===e.length-1&&a==="")){const v=c.getLine(h+1);v&&v.isWrapped&&(v.getCell(0,t),t.getWidth()===2&&(g+=1))}if(g<0)return[h,i]}h++,r=0}return[h,r]}}n.LinkComputer=l}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u](o,o.exports,N),o.exports}var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const n=N(6),o=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function l(d,s){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(d=l,s={}){this._handler=d,this._options=s}activate(d){this._terminal=d;const s=this._options,h=s.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,h,this._handler,s))}dispose(){this._linkProvider?.dispose()}}})(),V})()))})(be)),be.exports}var it=tt(),we={exports:{}},Ae;function rt(){return Ae||(Ae=1,(function(Q,J){(function(Z,K){Q.exports=K()})(self,(()=>(()=>{var Z={575:function(u,n,o){typeof self<"u"||typeof window<"u"||o.g!==void 0&&o.g,u.exports=(function(){var l,d="3.7.7",s=d,h=typeof Buffer=="function",_=typeof TextDecoder=="function"?new TextDecoder:void 0,g=typeof TextEncoder=="function"?new TextEncoder:void 0,c=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),t=(l={},c.forEach((function(D,T){return l[D]=T})),l),r=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,e=String.fromCharCode.bind(String),i=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(D){return new Uint8Array(Array.prototype.slice.call(D,0))},a=function(D){return D.replace(/=/g,"").replace(/[+\/]/g,(function(T){return T=="+"?"-":"_"}))},v=function(D){return D.replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(D){for(var T,I,q,X,G="",ee=D.length%3,z=0;z<D.length;){if((I=D.charCodeAt(z++))>255||(q=D.charCodeAt(z++))>255||(X=D.charCodeAt(z++))>255)throw new TypeError("invalid character found");G+=c[(T=I<<16|q<<8|X)>>18&63]+c[T>>12&63]+c[T>>6&63]+c[63&T]}return ee?G.slice(0,ee-3)+"===".substring(ee):G},m=typeof btoa=="function"?function(D){return btoa(D)}:h?function(D){return Buffer.from(D,"binary").toString("base64")}:p,f=h?function(D){return Buffer.from(D).toString("base64")}:function(D){for(var T=[],I=0,q=D.length;I<q;I+=4096)T.push(e.apply(null,D.subarray(I,I+4096)));return m(T.join(""))},S=function(D,T){return T===void 0&&(T=!1),T?a(f(D)):f(D)},E=function(D){if(D.length<2)return(T=D.charCodeAt(0))<128?D:T<2048?e(192|T>>>6)+e(128|63&T):e(224|T>>>12&15)+e(128|T>>>6&63)+e(128|63&T);var T=65536+1024*(D.charCodeAt(0)-55296)+(D.charCodeAt(1)-56320);return e(240|T>>>18&7)+e(128|T>>>12&63)+e(128|T>>>6&63)+e(128|63&T)},k=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(D){return D.replace(k,E)},w=h?function(D){return Buffer.from(D,"utf8").toString("base64")}:g?function(D){return f(g.encode(D))}:function(D){return m(A(D))},R=function(D,T){return T===void 0&&(T=!1),T?a(w(D)):w(D)},M=function(D){return R(D,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,U=function(D){switch(D.length){case 4:var T=((7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3))-65536;return e(55296+(T>>>10))+e(56320+(1023&T));case 3:return e((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return e((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},H=function(D){return D.replace(F,U)},C=function(D){if(D=D.replace(/\s+/g,""),!r.test(D))throw new TypeError("malformed base64.");D+="==".slice(2-(3&D.length));for(var T,I,q,X="",G=0;G<D.length;)T=t[D.charAt(G++)]<<18|t[D.charAt(G++)]<<12|(I=t[D.charAt(G++)])<<6|(q=t[D.charAt(G++)]),X+=I===64?e(T>>16&255):q===64?e(T>>16&255,T>>8&255):e(T>>16&255,T>>8&255,255&T);return X},y=typeof atob=="function"?function(D){return atob(v(D))}:h?function(D){return Buffer.from(D,"base64").toString("binary")}:C,x=h?function(D){return i(Buffer.from(D,"base64"))}:function(D){return i(y(D).split("").map((function(T){return T.charCodeAt(0)})))},L=function(D){return x(W(D))},P=h?function(D){return Buffer.from(D,"base64").toString("utf8")}:_?function(D){return _.decode(x(D))}:function(D){return H(y(D))},W=function(D){return v(D.replace(/[-_]/g,(function(T){return T=="-"?"+":"/"})))},$=function(D){return P(W(D))},j=function(D){return{value:D,enumerable:!1,writable:!0,configurable:!0}},B=function(){var D=function(T,I){return Object.defineProperty(String.prototype,T,j(I))};D("fromBase64",(function(){return $(this)})),D("toBase64",(function(T){return R(this,T)})),D("toBase64URI",(function(){return R(this,!0)})),D("toBase64URL",(function(){return R(this,!0)})),D("toUint8Array",(function(){return L(this)}))},b=function(){var D=function(T,I){return Object.defineProperty(Uint8Array.prototype,T,j(I))};D("toBase64",(function(T){return S(this,T)})),D("toBase64URI",(function(){return S(this,!0)})),D("toBase64URL",(function(){return S(this,!0)}))},O={version:d,VERSION:s,atob:y,atobPolyfill:C,btoa:m,btoaPolyfill:p,fromBase64:$,toBase64:R,encode:R,encodeURI:M,encodeURL:M,utob:A,btou:H,decode:$,isValid:function(D){if(typeof D!="string")return!1;var T=D.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(T)||!/[^\s0-9a-zA-Z\-_]/.test(T)},fromUint8Array:S,toUint8Array:L,extendString:B,extendUint8Array:b,extendBuiltins:function(){B(),b()},Base64:{}};return Object.keys(O).forEach((function(D){return O.Base64[D]=O[D]})),O})()}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u].call(o.exports,o,o.exports,N),o.exports}N.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})();var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.Base64=u.BrowserClipboardProvider=u.ClipboardAddon=void 0;const n=N(575);u.ClipboardAddon=class{constructor(d=new l,s=new o){this._base64=d,this._provider=s}activate(d){this._terminal=d,this._disposable=d.parser.registerOscHandler(52,(s=>this._setOrReportClipboard(s)))}dispose(){return this._disposable?.dispose()}_readText(d,s){const h=this._base64.encodeText(s);this._terminal?.input(`\x1B]52;${d};${h}\x07`,!1)}_setOrReportClipboard(d){const s=d.split(";");if(s.length<2)return!0;const h=s[0],_=s[1];if(_==="?"){const t=this._provider.readText(h);return t instanceof Promise?t.then((r=>(this._readText(h,r),!0))):(this._readText(h,t),!0)}let g="";try{g=this._base64.decodeText(_)}catch{}const c=this._provider.writeText(h,g);return!(c instanceof Promise)||c.then((()=>!0))}};class o{async readText(s){return s!=="c"?Promise.resolve(""):navigator.clipboard.readText()}async writeText(s,h){return s!=="c"?Promise.resolve():navigator.clipboard.writeText(h)}}u.BrowserClipboardProvider=o;class l{encodeText(s){return n.Base64.encode(s)}decodeText(s){const h=n.Base64.decode(s);return n.Base64.isValid(s)&&n.Base64.encode(h)===s?h:""}}u.Base64=l})(),V})()))})(we)),we.exports}var st=rt();const nt={class:"size-full overflow-hidden",ref:"terminalContainer"},ot={ref:"terminalEl",class:"size-full"},ht=Ie({__name:"index",setup(Q){const J=et(),Z=xe("terminalContainer"),K=xe("terminalEl"),{height:N,width:V}=Fe(Z),u=new Xe.FitAddon,n=ye(!1),o=He(We,[]),l=ye(-1);let d=null,s="",h="",_="",g;const c={RESET:"\x1B[0m",RED:"\x1B[31m"},t=async()=>{d||(d=new Ve.Terminal({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#c5c5c5"},fontSize:14,fontFamily:'Consolas, "Courier New", monospace',cursorBlink:!0,windowsMode:!0,allowProposedApi:!0,convertEol:!0}),d.loadAddon(u),d.loadAddon(new Ze.Unicode11Addon),d.loadAddon(new it.WebLinksAddon),d.loadAddon(new st.ClipboardAddon),K.value&&(d.open(K.value),u.fit()),d.onData(e),g=await w())},r=()=>{s="",h="",_=""},e=R=>{if(d){if(R==="\x1B[A"||R==="\x1B[B"){k(R);return}if(R==="\r"){f();return}if(R===""){a();return}if(R.charCodeAt(0)===9||R===" "){v();return}if(R===""){i();return}R.charCodeAt(0)<32&&R!==" "||(s+=R,d.write(R))}},i=()=>{r(),d?.write("^C"),d?.write(`\r
|
|
9
|
+
`,e)}paste(r){this._core.paste(r)}refresh(r,e){this._verifyIntegers(r,e),this._core.refresh(r,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(r){this._addonManager.loadAddon(this,r)}static get strings(){return n}_verifyIntegers(...r){for(const e of r)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...r){for(const e of r)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}u.Terminal=c})(),V})()))})(me)),me.exports}var qe=Ke(),Se={exports:{}},ke;function Ve(){return ke||(ke=1,(function(Q,J){(function(Z,K){Q.exports=K()})(self,(()=>(()=>{var Z={};return(()=>{var K=Z;Object.defineProperty(K,"__esModule",{value:!0}),K.FitAddon=void 0,K.FitAddon=class{activate(N){this._terminal=N}dispose(){}fit(){const N=this.proposeDimensions();if(!N||!this._terminal||isNaN(N.cols)||isNaN(N.rows))return;const V=this._terminal._core;this._terminal.rows===N.rows&&this._terminal.cols===N.cols||(V._renderService.clear(),this._terminal.resize(N.cols,N.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const N=this._terminal._core,V=N._renderService.dimensions;if(V.css.cell.width===0||V.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:N.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(n.getPropertyValue("height")),l=Math.max(0,parseInt(n.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),s=o-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),h=l-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(h/V.css.cell.width)),rows:Math.max(1,Math.floor(s/V.css.cell.height))}}}})(),Z})()))})(Se)),Se.exports}var Ge=Ve(),_e={exports:{}},Xe=_e.exports,De;function Je(){return De||(De=1,(function(Q,J){(function(Z,K){Q.exports=K()})(Xe,(()=>(()=>{var Z={433:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV11=void 0;const l=o(938),d=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],s=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],h=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let g;function c(t,r){let e,i=0,a=r.length-1;if(t<r[0][0]||t>r[a][1])return!1;for(;a>=i;)if(e=i+a>>1,t>r[e][1])i=e+1;else{if(!(t<r[e][0]))return!0;a=e-1}return!1}n.UnicodeV11=class{constructor(){if(this.version="11",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160);for(let t=0;t<d.length;++t)g.fill(0,d[t][0],d[t][1]+1);for(let t=0;t<h.length;++t)g.fill(2,h[t][0],h[t][1]+1)}}wcwidth(t){return t<32?0:t<127?1:t<65536?g[t]:c(t,s)?0:c(t,_)?2:1}charProperties(t,r){let e=this.wcwidth(t),i=e===0&&r!==0;if(i){const a=l.UnicodeService.extractWidth(r);a===0?i=!1:a>e&&(e=a)}return l.UnicodeService.createPropertyValue(0,e,i)}}},345:(u,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===o)return void this._listeners.splice(l,1)}}})),this._event}fire(o,l){const d=[];for(let s=0;s<this._listeners.length;s++)d.push(this._listeners[s]);for(let s=0;s<d.length;s++)d[s].call(void 0,o,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(o,l){return o((d=>l.fire(d)))},n.runAndSubscribe=function(o,l){return l(void 0),o((d=>l(d)))}},490:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const l=o(938),d=[[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]],s=[[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 h;n.UnicodeV6=class{constructor(){if(this.version="6",!h){h=new Uint8Array(65536),h.fill(1),h[0]=0,h.fill(0,1,32),h.fill(0,127,160),h.fill(2,4352,4448),h[9001]=2,h[9002]=2,h.fill(2,11904,42192),h[12351]=1,h.fill(2,44032,55204),h.fill(2,63744,64256),h.fill(2,65040,65050),h.fill(2,65072,65136),h.fill(2,65280,65377),h.fill(2,65504,65511);for(let _=0;_<d.length;++_)h.fill(0,d[_][0],d[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?h[_]:(function(g,c){let t,r=0,e=c.length-1;if(g<c[0][0]||g>c[e][1])return!1;for(;e>=r;)if(t=r+e>>1,g>c[t][1])r=t+1;else{if(!(g<c[t][0]))return!0;e=t-1}return!1})(_,s)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,g){let c=this.wcwidth(_),t=c===0&&g!==0;if(t){const r=l.UnicodeService.extractWidth(g);r===0?t=!1:r>c&&(c=r)}return l.UnicodeService.createPropertyValue(0,c,t)}}},938:(u,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const l=o(345),d=o(490);class s{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,g,c=!1){return(16777215&_)<<3|(3&g)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const _=new d.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let g=0,c=0;const t=_.length;for(let r=0;r<t;++r){let e=_.charCodeAt(r);if(55296<=e&&e<=56319){if(++r>=t)return g+this.wcwidth(e);const v=_.charCodeAt(r);56320<=v&&v<=57343?e=1024*(e-55296)+v-56320+65536:g+=this.wcwidth(v)}const i=this.charProperties(e,c);let a=s.extractWidth(i);s.extractShouldJoin(i)&&(a-=s.extractWidth(c)),g+=a,c=i}return g}charProperties(_,g){return this._activeProvider.charProperties(_,g)}}n.UnicodeService=s}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u](o,o.exports,N),o.exports}var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.Unicode11Addon=void 0;const n=N(433);u.Unicode11Addon=class{activate(o){o.unicode.register(new n.UnicodeV11)}dispose(){}}})(),V})()))})(_e)),_e.exports}var Ye=Je(),Ce={exports:{}},Le;function Ze(){return Le||(Le=1,(function(Q){var J={};Q.exports=J,J.eastAsianWidth=function(K){var N=K.charCodeAt(0),V=K.length===2?K.charCodeAt(1):0,u=N;return 55296<=N&&N<=56319&&56320<=V&&V<=57343&&(N&=1023,V&=1023,u=N<<10|V,u+=65536),u===12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u===8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u===172||u===175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u===161||u===164||167<=u&&u<=168||u===170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u===198||u===208||215<=u&&u<=216||222<=u&&u<=225||u===230||232<=u&&u<=234||236<=u&&u<=237||u===240||242<=u&&u<=243||247<=u&&u<=250||u===252||u===254||u===257||u===273||u===275||u===283||294<=u&&u<=295||u===299||305<=u&&u<=307||u===312||319<=u&&u<=322||u===324||328<=u&&u<=331||u===333||338<=u&&u<=339||358<=u&&u<=359||u===363||u===462||u===464||u===466||u===468||u===470||u===472||u===474||u===476||u===593||u===609||u===708||u===711||713<=u&&u<=715||u===717||u===720||728<=u&&u<=731||u===733||u===735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u===1025||1040<=u&&u<=1103||u===1105||u===8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u===8240||8242<=u&&u<=8243||u===8245||u===8251||u===8254||u===8308||u===8319||8321<=u&&u<=8324||u===8364||u===8451||u===8453||u===8457||u===8467||u===8470||8481<=u&&u<=8482||u===8486||u===8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u===8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u===8658||u===8660||u===8679||u===8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u===8715||u===8719||u===8721||u===8725||u===8730||8733<=u&&u<=8736||u===8739||u===8741||8743<=u&&u<=8748||u===8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u===8776||u===8780||u===8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u===8853||u===8857||u===8869||u===8895||u===8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u===9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u===9711||9733<=u&&u<=9734||u===9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u===9756||u===9758||u===9792||u===9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u===9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u===9955||9960<=u&&u<=9983||u===10045||u===10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u===65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},J.characterLength=function(K){var N=this.eastAsianWidth(K);return N==="F"||N==="W"||N==="A"?2:1};function Z(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}J.length=function(K){for(var N=Z(K),V=0,u=0;u<N.length;u++)V=V+this.characterLength(N[u]);return V},J.slice=function(K,N,V){var u=J.length(K);N=N??0,V=V===void 0||N===null?1:V,N<0&&(N=u+N),V<0&&(V=u+V);for(var n="",o=0,l=Z(K),d=0;d<l.length;d++){var s=l[d],h=J.length(s);if(o>=N-(h===2?1:0))if(o+h<=V)n+=s;else break;o+=h}return n}})(Ce)),Ce.exports}var le=Ze();const Qe=()=>{const Q=ye("/"),J=o=>{const l=/^([A-Za-z]):[\\/]?(.*)/.exec(o);if(!l)return{letter:"",rest:o.replace(/\\/g,"/")};if(!l[1]||!l[2])throw new Error("splitDriveLetter path error");return{letter:l[1].toUpperCase(),rest:l[2].replace(/\\/g,"/")}},Z=(o,l)=>o?`${o}:\\${l.replace(/\//g,"\\")}`:l.replace(/\//g,"\\"),K=async()=>{Q.value=window.__GLOBAL_CONFIG__.cwd||"/"},N=o=>{Q.value=o},V=o=>{const l=/^\s*cd\s+([^\s]*)\s*$/i,d=o.match(l);if(!d)return{isCd:!1};const s=d[1]||"/",{rest:h,letter:_}=J(Q.value),g=Oe.resolve(`/${h}`,s);return{newCwd:Z(_,g.slice(1)),oldCwd:Q.value,isCd:!0}},u=o=>{const{isCd:l,newCwd:d,oldCwd:s}=V(o);if(l){ie.emit("command",{command:"",cwd:d,oldCwd:s});return}ie.emit("command",{command:o,cwd:Q.value})},n=(o="")=>{ie.emit("tab",{cwd:Q.value,lastWord:o})};return{cwd:Me(()=>Q.value),initCwd:K,sendCommand:u,updateCwd:N,sendTabCommand:n}};var be={exports:{}},Re;function et(){return Re||(Re=1,(function(Q,J){(function(Z,K){Q.exports=K()})(self,(()=>(()=>{var Z={6:(u,n)=>{function o(d){try{const s=new URL(d),h=s.password&&s.username?`${s.protocol}//${s.username}:${s.password}@${s.host}`:s.username?`${s.protocol}//${s.username}@${s.host}`:`${s.protocol}//${s.host}`;return d.toLocaleLowerCase().startsWith(h.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(n,"__esModule",{value:!0}),n.LinkComputer=n.WebLinkProvider=void 0,n.WebLinkProvider=class{constructor(d,s,h,_={}){this._terminal=d,this._regex=s,this._handler=h,this._options=_}provideLinks(d,s){const h=l.computeLink(d,this._regex,this._terminal,this._handler);s(this._addCallbacks(h))}_addCallbacks(d){return d.map((s=>(s.leave=this._options.leave,s.hover=(h,_)=>{if(this._options.hover){const{range:g}=s;this._options.hover(h,_,g)}},s)))}};class l{static computeLink(s,h,_,g){const c=new RegExp(h.source,(h.flags||"")+"g"),[t,r]=l._getWindowedLineStrings(s-1,_),e=t.join("");let i;const a=[];for(;i=c.exec(e);){const v=i[0];if(!o(v))continue;const[p,m]=l._mapStrIdx(_,r,0,i.index),[f,S]=l._mapStrIdx(_,p,m,v.length);if(p===-1||m===-1||f===-1||S===-1)continue;const E={start:{x:m+1,y:p+1},end:{x:S,y:f+1}};a.push({range:E,text:v,activate:g})}return a}static _getWindowedLineStrings(s,h){let _,g=s,c=s,t=0,r="";const e=[];if(_=h.buffer.active.getLine(s)){const i=_.translateToString(!0);if(_.isWrapped&&i[0]!==" "){for(t=0;(_=h.buffer.active.getLine(--g))&&t<2048&&(r=_.translateToString(!0),t+=r.length,e.push(r),_.isWrapped&&r.indexOf(" ")===-1););e.reverse()}for(e.push(i),t=0;(_=h.buffer.active.getLine(++c))&&_.isWrapped&&t<2048&&(r=_.translateToString(!0),t+=r.length,e.push(r),r.indexOf(" ")===-1););}return[e,g]}static _mapStrIdx(s,h,_,g){const c=s.buffer.active,t=c.getNullCell();let r=_;for(;g;){const e=c.getLine(h);if(!e)return[-1,-1];for(let i=r;i<e.length;++i){e.getCell(i,t);const a=t.getChars();if(t.getWidth()&&(g-=a.length||1,i===e.length-1&&a==="")){const v=c.getLine(h+1);v&&v.isWrapped&&(v.getCell(0,t),t.getWidth()===2&&(g+=1))}if(g<0)return[h,i]}h++,r=0}return[h,r]}}n.LinkComputer=l}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u](o,o.exports,N),o.exports}var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const n=N(6),o=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function l(d,s){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(d=l,s={}){this._handler=d,this._options=s}activate(d){this._terminal=d;const s=this._options,h=s.urlRegex||o;this._linkProvider=this._terminal.registerLinkProvider(new n.WebLinkProvider(this._terminal,h,this._handler,s))}dispose(){this._linkProvider?.dispose()}}})(),V})()))})(be)),be.exports}var tt=et(),we={exports:{}},Ae;function it(){return Ae||(Ae=1,(function(Q,J){(function(Z,K){Q.exports=K()})(self,(()=>(()=>{var Z={575:function(u,n,o){typeof self<"u"||typeof window<"u"||o.g!==void 0&&o.g,u.exports=(function(){var l,d="3.7.7",s=d,h=typeof Buffer=="function",_=typeof TextDecoder=="function"?new TextDecoder:void 0,g=typeof TextEncoder=="function"?new TextEncoder:void 0,c=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),t=(l={},c.forEach((function(D,T){return l[D]=T})),l),r=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,e=String.fromCharCode.bind(String),i=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(D){return new Uint8Array(Array.prototype.slice.call(D,0))},a=function(D){return D.replace(/=/g,"").replace(/[+\/]/g,(function(T){return T=="+"?"-":"_"}))},v=function(D){return D.replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(D){for(var T,I,q,X,G="",ee=D.length%3,z=0;z<D.length;){if((I=D.charCodeAt(z++))>255||(q=D.charCodeAt(z++))>255||(X=D.charCodeAt(z++))>255)throw new TypeError("invalid character found");G+=c[(T=I<<16|q<<8|X)>>18&63]+c[T>>12&63]+c[T>>6&63]+c[63&T]}return ee?G.slice(0,ee-3)+"===".substring(ee):G},m=typeof btoa=="function"?function(D){return btoa(D)}:h?function(D){return Buffer.from(D,"binary").toString("base64")}:p,f=h?function(D){return Buffer.from(D).toString("base64")}:function(D){for(var T=[],I=0,q=D.length;I<q;I+=4096)T.push(e.apply(null,D.subarray(I,I+4096)));return m(T.join(""))},S=function(D,T){return T===void 0&&(T=!1),T?a(f(D)):f(D)},E=function(D){if(D.length<2)return(T=D.charCodeAt(0))<128?D:T<2048?e(192|T>>>6)+e(128|63&T):e(224|T>>>12&15)+e(128|T>>>6&63)+e(128|63&T);var T=65536+1024*(D.charCodeAt(0)-55296)+(D.charCodeAt(1)-56320);return e(240|T>>>18&7)+e(128|T>>>12&63)+e(128|T>>>6&63)+e(128|63&T)},k=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,A=function(D){return D.replace(k,E)},w=h?function(D){return Buffer.from(D,"utf8").toString("base64")}:g?function(D){return f(g.encode(D))}:function(D){return m(A(D))},R=function(D,T){return T===void 0&&(T=!1),T?a(w(D)):w(D)},M=function(D){return R(D,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,U=function(D){switch(D.length){case 4:var T=((7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3))-65536;return e(55296+(T>>>10))+e(56320+(1023&T));case 3:return e((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return e((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},H=function(D){return D.replace(F,U)},C=function(D){if(D=D.replace(/\s+/g,""),!r.test(D))throw new TypeError("malformed base64.");D+="==".slice(2-(3&D.length));for(var T,I,q,X="",G=0;G<D.length;)T=t[D.charAt(G++)]<<18|t[D.charAt(G++)]<<12|(I=t[D.charAt(G++)])<<6|(q=t[D.charAt(G++)]),X+=I===64?e(T>>16&255):q===64?e(T>>16&255,T>>8&255):e(T>>16&255,T>>8&255,255&T);return X},y=typeof atob=="function"?function(D){return atob(v(D))}:h?function(D){return Buffer.from(D,"base64").toString("binary")}:C,x=h?function(D){return i(Buffer.from(D,"base64"))}:function(D){return i(y(D).split("").map((function(T){return T.charCodeAt(0)})))},L=function(D){return x(W(D))},P=h?function(D){return Buffer.from(D,"base64").toString("utf8")}:_?function(D){return _.decode(x(D))}:function(D){return H(y(D))},W=function(D){return v(D.replace(/[-_]/g,(function(T){return T=="-"?"+":"/"})))},$=function(D){return P(W(D))},j=function(D){return{value:D,enumerable:!1,writable:!0,configurable:!0}},B=function(){var D=function(T,I){return Object.defineProperty(String.prototype,T,j(I))};D("fromBase64",(function(){return $(this)})),D("toBase64",(function(T){return R(this,T)})),D("toBase64URI",(function(){return R(this,!0)})),D("toBase64URL",(function(){return R(this,!0)})),D("toUint8Array",(function(){return L(this)}))},b=function(){var D=function(T,I){return Object.defineProperty(Uint8Array.prototype,T,j(I))};D("toBase64",(function(T){return S(this,T)})),D("toBase64URI",(function(){return S(this,!0)})),D("toBase64URL",(function(){return S(this,!0)}))},O={version:d,VERSION:s,atob:y,atobPolyfill:C,btoa:m,btoaPolyfill:p,fromBase64:$,toBase64:R,encode:R,encodeURI:M,encodeURL:M,utob:A,btou:H,decode:$,isValid:function(D){if(typeof D!="string")return!1;var T=D.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(T)||!/[^\s0-9a-zA-Z\-_]/.test(T)},fromUint8Array:S,toUint8Array:L,extendString:B,extendUint8Array:b,extendBuiltins:function(){B(),b()},Base64:{}};return Object.keys(O).forEach((function(D){return O.Base64[D]=O[D]})),O})()}},K={};function N(u){var n=K[u];if(n!==void 0)return n.exports;var o=K[u]={exports:{}};return Z[u].call(o.exports,o,o.exports,N),o.exports}N.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})();var V={};return(()=>{var u=V;Object.defineProperty(u,"__esModule",{value:!0}),u.Base64=u.BrowserClipboardProvider=u.ClipboardAddon=void 0;const n=N(575);u.ClipboardAddon=class{constructor(d=new l,s=new o){this._base64=d,this._provider=s}activate(d){this._terminal=d,this._disposable=d.parser.registerOscHandler(52,(s=>this._setOrReportClipboard(s)))}dispose(){return this._disposable?.dispose()}_readText(d,s){const h=this._base64.encodeText(s);this._terminal?.input(`\x1B]52;${d};${h}\x07`,!1)}_setOrReportClipboard(d){const s=d.split(";");if(s.length<2)return!0;const h=s[0],_=s[1];if(_==="?"){const t=this._provider.readText(h);return t instanceof Promise?t.then((r=>(this._readText(h,r),!0))):(this._readText(h,t),!0)}let g="";try{g=this._base64.decodeText(_)}catch{}const c=this._provider.writeText(h,g);return!(c instanceof Promise)||c.then((()=>!0))}};class o{async readText(s){return s!=="c"?Promise.resolve(""):navigator.clipboard.readText()}async writeText(s,h){return s!=="c"?Promise.resolve():navigator.clipboard.writeText(h)}}u.BrowserClipboardProvider=o;class l{encodeText(s){return n.Base64.encode(s)}decodeText(s){const h=n.Base64.decode(s);return n.Base64.isValid(s)&&n.Base64.encode(h)===s?h:""}}u.Base64=l})(),V})()))})(we)),we.exports}var rt=it();const st={class:"size-full overflow-hidden",ref:"terminalContainer"},nt={ref:"terminalEl",class:"size-full"},at=Pe({__name:"index",setup(Q){const J=Qe(),Z=xe("terminalContainer"),K=xe("terminalEl"),{height:N,width:V}=Ie(Z),u=new Ge.FitAddon,n=ye(!1),o=Fe(He,[]),l=ye(-1);let d=null,s="",h="",_="",g;const c={RESET:"\x1B[0m",RED:"\x1B[31m"},t=async()=>{d||(d=new qe.Terminal({theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#c5c5c5"},fontSize:14,fontFamily:'Consolas, "Courier New", monospace',cursorBlink:!0,windowsMode:!0,allowProposedApi:!0,convertEol:!0}),d.loadAddon(u),d.loadAddon(new Ye.Unicode11Addon),d.loadAddon(new tt.WebLinksAddon),d.loadAddon(new rt.ClipboardAddon),K.value&&(d.open(K.value),u.fit()),d.onData(e),g=await w())},r=()=>{s="",h="",_=""},e=R=>{if(d){if(R==="\x1B[A"||R==="\x1B[B"){k(R);return}if(R==="\r"){f();return}if(R===""){a();return}if(R.charCodeAt(0)===9||R===" "){v();return}if(R===""){i();return}R.charCodeAt(0)<32&&R!==" "||(s+=R,d.write(R))}},i=()=>{r(),d?.write("^C"),d?.write(`\r
|
|
10
10
|
`),J.sendCommand("^C")},a=()=>{if(h.length){_.length&&(_=h);const R=h.slice(-1),M=le.characterLength(R);d?.write("\b \b".repeat(M)),h=h.slice(0,-1),_=_.slice(0,-1);return}if(s.length){const R=s.slice(-1),M=le.characterLength(R);d?.write("\b \b".repeat(M)),s=s.slice(0,-1)}},v=()=>{if(_){J.sendTabCommand(_);return}if(!/^\S+[\s\S]*[^\S\r\n]+/.test(s))return;const R=s.split(" ").map(M=>M.trim());if(R.length){const[M]=R.slice(-1);_=M??"",J.sendTabCommand(_)}},p=()=>{for(const R of s){const M=le.characterLength(R);d?.write("\b \b".repeat(M))}s=""},m=()=>{for(const R of h){const M=le.characterLength(R);d?.write("\b \b".repeat(M))}h=""},f=()=>{if(d?.write(`\r
|
|
11
11
|
`),s==="clear"){d?.clear(),J.sendCommand("");return}s.trim()?J.sendCommand(s+h):J.sendCommand(""),r()},S=R=>{if(R){const M=o.value.filter(F=>F===R);o.value=o.value.filter(F=>!M.includes(F)),o.value.unshift(R)}},E=R=>`${c.RESET}PS ${R}>`,k=R=>{R==="\x1B[A"&&(l.value<o.value.length-1?l.value++:l.value=0),R==="\x1B[B"&&(l.value>0?l.value--:l.value=o.value.length-1),p(),s=o.value[l.value]??"",d?.write(s)},A=R=>{if(R){if(m(),s.endsWith(_))for(const F of _){const U=F.slice(-1),H=le.characterLength(U);d?.write("\b \b".repeat(H)),s=s.slice(0,-1)}d?.write(`${c.RESET}${R}`),h=`${R}`}},w=async()=>{await J.initCwd(),ie.connected||ie.connect();const R=U=>{console.log("终端输出:",U);const{stderr:H,stdout:C,cwd:y,err:x,command:L,tab:P}=U;if(H){d?.write(`${c.RED}${H}`),d?.write(`\r
|
|
12
12
|
`);return}if(C){d?.write(`${c.RESET}${C}`);return}if(y){const W=E(y);d?.write(W),J.updateCwd(y),L&&S(L),l.value=-1;return}if(x){d?.write(`${c.RED}${x}`),d?.write(`\r
|
|
13
13
|
`);return}P&&A(P)},M=()=>{n.value=!0,J.sendCommand("")},F=()=>{n.value=!1,d?.writeln(`
|
|
14
14
|
终端已断开连接
|
|
15
|
-
`)};return ie.on("output",R),ie.on("connect",M),ie.on("disconnect",F),()=>{ie.off("output",R),ie.off("connect",M),ie.off("disconnect",F)}};return
|
|
15
|
+
`)};return ie.on("output",R),ie.on("connect",M),ie.on("disconnect",F),()=>{ie.off("output",R),ie.off("connect",M),ie.off("disconnect",F)}};return We(()=>[V.value,N.value],async()=>{u?.fit()},{immediate:!0}),Ue(()=>{t()}),Ne(()=>{d?.clear(),d?.dispose(),g?.(),ie?.disconnect()}),(R,M)=>(ze(),$e("div",st,[je("div",nt,null,512)],512))}});export{at as _};
|