(function () { const W = document.createElement("link").relList; if (W && W.supports && W.supports("modulepreload")) return; for (const U of document.querySelectorAll('link[rel="modulepreload"]')) G(U); new MutationObserver(U => { for (const q of U) if (q.type === "childList") for (const x of q.addedNodes) x.tagName === "LINK" && x.rel === "modulepreload" && G(x) } ).observe(document, { childList: !0, subtree: !0 }); function V(U) { const q = {}; return U.integrity && (q.integrity = U.integrity), U.referrerpolicy && (q.referrerPolicy = U.referrerpolicy), U.crossorigin === "use-credentials" ? q.credentials = "include" : U.crossorigin === "anonymous" ? q.credentials = "omit" : q.credentials = "same-origin", q } function G(U) { if (U.ep) return; U.ep = !0; const q = V(U); fetch(U.href, q) } } )(); var Ce = { exports: {} }; (function (z, W) { (function (V, G) { z.exports = G() } )(self, function () { return (() => { var V = { 4567: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.AccessibilityManager = void 0; const n = a(9042) , _ = a(6114) , h = a(9924) , f = a(3656) , d = a(844) , l = a(5596) , o = a(9631); class t extends d.Disposable { constructor(e, i) { super(), this._terminal = e, this._renderService = i, this._liveRegionLineCount = 0, this._charsToConsume = [], this._charsToAnnounce = "", this._accessibilityTreeRoot = document.createElement("div"), this._accessibilityTreeRoot.classList.add("xterm-accessibility"), this._accessibilityTreeRoot.tabIndex = 0, this._rowContainer = document.createElement("div"), this._rowContainer.setAttribute("role", "list"), this._rowContainer.classList.add("xterm-accessibility-tree"), this._rowElements = []; for (let c = 0; c < this._terminal.rows; c++) this._rowElements[c] = this._createAccessibilityTreeNode(), this._rowContainer.appendChild(this._rowElements[c]); if (this._topBoundaryFocusListener = c => this._onBoundaryFocus(c, 0), this._bottomBoundaryFocusListener = c => this._onBoundaryFocus(c, 1), this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._refreshRowsDimensions(), this._accessibilityTreeRoot.appendChild(this._rowContainer), this._renderRowsDebouncer = new h.TimeBasedDebouncer(this._renderRows.bind(this)), this._refreshRows(), this._liveRegion = document.createElement("div"), this._liveRegion.classList.add("live-region"), this._liveRegion.setAttribute("aria-live", "assertive"), this._accessibilityTreeRoot.appendChild(this._liveRegion), !this._terminal.element) throw new Error("Cannot enable accessibility before Terminal.open"); this._terminal.element.insertAdjacentElement("afterbegin", this._accessibilityTreeRoot), this.register(this._renderRowsDebouncer), this.register(this._terminal.onResize(c => this._onResize(c.rows))), this.register(this._terminal.onRender(c => this._refreshRows(c.start, c.end))), this.register(this._terminal.onScroll(() => this._refreshRows())), this.register(this._terminal.onA11yChar(c => this._onChar(c))), this.register(this._terminal.onLineFeed(() => this._onChar(` `))), this.register(this._terminal.onA11yTab(c => this._onTab(c))), this.register(this._terminal.onKey(c => this._onKey(c.key))), this.register(this._terminal.onBlur(() => this._clearLiveRegion())), this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions())), this._screenDprMonitor = new l.ScreenDprMonitor(window), this.register(this._screenDprMonitor), this._screenDprMonitor.setListener(() => this._refreshRowsDimensions()), this.register((0, f.addDisposableDomListener)(window, "resize", () => this._refreshRowsDimensions())) } dispose() { super.dispose(), (0, o.removeElementFromParent)(this._accessibilityTreeRoot), this._rowElements.length = 0 } _onBoundaryFocus(e, i) { const c = e.target , g = this._rowElements[i === 0 ? 1 : this._rowElements.length - 2]; if (c.getAttribute("aria-posinset") === (i === 0 ? "1" : `${this._terminal.buffer.lines.length}`) || e.relatedTarget !== g) return; let v, S; if (i === 0 ? (v = c, S = this._rowElements.pop(), this._rowContainer.removeChild(S)) : (v = this._rowElements.shift(), S = c, this._rowContainer.removeChild(v)), v.removeEventListener("focus", this._topBoundaryFocusListener), S.removeEventListener("focus", this._bottomBoundaryFocusListener), i === 0) { const u = this._createAccessibilityTreeNode(); this._rowElements.unshift(u), this._rowContainer.insertAdjacentElement("afterbegin", u) } else { const u = this._createAccessibilityTreeNode(); this._rowElements.push(u), this._rowContainer.appendChild(u) } this._rowElements[0].addEventListener("focus", this._topBoundaryFocusListener), this._rowElements[this._rowElements.length - 1].addEventListener("focus", this._bottomBoundaryFocusListener), this._terminal.scrollLines(i === 0 ? -1 : 1), this._rowElements[i === 0 ? 1 : this._rowElements.length - 2].focus(), e.preventDefault(), e.stopImmediatePropagation() } _onResize(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 = document.createElement("div"); return e.setAttribute("role", "listitem"), e.tabIndex = -1, this._refreshRowDimensions(e), e } _onTab(e) { for (let i = 0; i < e; i++) this._onChar(" ") } _onChar(e) { this._liveRegionLineCount < 21 && (this._charsToConsume.length > 0 ? this._charsToConsume.shift() !== e && (this._charsToAnnounce += e) : this._charsToAnnounce += e, e === ` ` && (this._liveRegionLineCount++, this._liveRegionLineCount === 21 && (this._liveRegion.textContent += n.tooMuchOutput)), _.isMac && this._liveRegion.textContent && this._liveRegion.textContent.length > 0 && !this._liveRegion.parentNode && setTimeout(() => { this._accessibilityTreeRoot.appendChild(this._liveRegion) } , 0)) } _clearLiveRegion() { this._liveRegion.textContent = "", this._liveRegionLineCount = 0, _.isMac && (0, o.removeElementFromParent)(this._liveRegion) } _onKey(e) { this._clearLiveRegion(), this._charsToConsume.push(e) } _refreshRows(e, i) { this._renderRowsDebouncer.refresh(e, i, this._terminal.rows) } _renderRows(e, i) { const c = this._terminal.buffer , g = c.lines.length.toString(); for (let v = e; v <= i; v++) { const S = c.translateBufferLineToString(c.ydisp + v, !0) , u = (c.ydisp + v + 1).toString() , m = this._rowElements[v]; m && (S.length === 0 ? m.innerText = "\xA0" : m.textContent = S, m.setAttribute("aria-posinset", u), m.setAttribute("aria-setsize", g)) } this._announceCharacters() } _refreshRowsDimensions() { if (this._renderService.dimensions.actualCellHeight) { this._rowElements.length !== this._terminal.rows && this._onResize(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.actualCellHeight}px` } _announceCharacters() { this._charsToAnnounce.length !== 0 && (this._liveRegion.textContent += this._charsToAnnounce, this._charsToAnnounce = "") } } r.AccessibilityManager = t } , 3614: (x, r) => { function a(f) { return f.replace(/\r?\n/g, "\r") } function n(f, d) { return d ? "\x1B[200~" + f + "\x1B[201~" : f } function _(f, d, l) { f = n(f = a(f), l.decPrivateModes.bracketedPasteMode), l.triggerDataEvent(f, !0), d.value = "" } function h(f, d, l) { const o = l.getBoundingClientRect() , t = f.clientX - o.left - 10 , s = f.clientY - o.top - 10; d.style.width = "20px", d.style.height = "20px", d.style.left = `${t}px`, d.style.top = `${s}px`, d.style.zIndex = "1000", d.focus() } Object.defineProperty(r, "__esModule", { value: !0 }), r.rightClickHandler = r.moveTextAreaUnderMouseCursor = r.paste = r.handlePasteEvent = r.copyHandler = r.bracketTextForPaste = r.prepareTextForTerminal = void 0, r.prepareTextForTerminal = a, r.bracketTextForPaste = n, r.copyHandler = function (f, d) { f.clipboardData && f.clipboardData.setData("text/plain", d.selectionText), f.preventDefault() } , r.handlePasteEvent = function (f, d, l) { f.stopPropagation(), f.clipboardData && _(f.clipboardData.getData("text/plain"), d, l) } , r.paste = _, r.moveTextAreaUnderMouseCursor = h, r.rightClickHandler = function (f, d, l, o, t) { h(f, d, l), t && o.rightClickSelect(f), d.value = o.selectionText, d.select() } } , 7239: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ColorContrastCache = void 0; const n = a(1505); r.ColorContrastCache = class { constructor() { this._color = new n.TwoKeyMap, this._css = new n.TwoKeyMap } setCss(_, h, f) { this._css.set(_, h, f) } getCss(_, h) { return this._css.get(_, h) } setColor(_, h, f) { this._color.set(_, h, f) } getColor(_, h) { return this._color.get(_, h) } clear() { this._color.clear(), this._css.clear() } } } , 5680: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ColorManager = r.DEFAULT_ANSI_COLORS = void 0; const n = a(8055) , _ = a(7239) , h = n.css.toColor("#ffffff") , f = n.css.toColor("#000000") , d = n.css.toColor("#ffffff") , l = n.css.toColor("#000000") , o = { css: "rgba(255, 255, 255, 0.3)", rgba: 4294967117 }; r.DEFAULT_ANSI_COLORS = Object.freeze((() => { const t = [n.css.toColor("#2e3436"), n.css.toColor("#cc0000"), n.css.toColor("#4e9a06"), n.css.toColor("#c4a000"), n.css.toColor("#3465a4"), n.css.toColor("#75507b"), n.css.toColor("#06989a"), n.css.toColor("#d3d7cf"), n.css.toColor("#555753"), n.css.toColor("#ef2929"), n.css.toColor("#8ae234"), n.css.toColor("#fce94f"), n.css.toColor("#729fcf"), n.css.toColor("#ad7fa8"), n.css.toColor("#34e2e2"), n.css.toColor("#eeeeec")] , s = [0, 95, 135, 175, 215, 255]; for (let e = 0; e < 216; e++) { const i = s[e / 36 % 6 | 0] , c = s[e / 6 % 6 | 0] , g = s[e % 6]; t.push({ css: n.channels.toCss(i, c, g), rgba: n.channels.toRgba(i, c, g) }) } for (let e = 0; e < 24; e++) { const i = 8 + 10 * e; t.push({ css: n.channels.toCss(i, i, i), rgba: n.channels.toRgba(i, i, i) }) } return t } )()), r.ColorManager = class { constructor(t, s) { this.allowTransparency = s; const e = t.createElement("canvas"); e.width = 1, e.height = 1; const i = e.getContext("2d"); if (!i) throw new Error("Could not get rendering context"); this._ctx = i, this._ctx.globalCompositeOperation = "copy", this._litmusColor = this._ctx.createLinearGradient(0, 0, 1, 1), this._contrastCache = new _.ColorContrastCache, this.colors = { foreground: h, background: f, cursor: d, cursorAccent: l, selectionForeground: void 0, selectionBackgroundTransparent: o, selectionBackgroundOpaque: n.color.blend(f, o), selectionInactiveBackgroundTransparent: o, selectionInactiveBackgroundOpaque: n.color.blend(f, o), ansi: r.DEFAULT_ANSI_COLORS.slice(), contrastCache: this._contrastCache }, this._updateRestoreColors() } onOptionsChange(t, s) { switch (t) { case "minimumContrastRatio": this._contrastCache.clear(); break; case "allowTransparency": this.allowTransparency = s } } setTheme(t = {}) { this.colors.foreground = this._parseColor(t.foreground, h), this.colors.background = this._parseColor(t.background, f), this.colors.cursor = this._parseColor(t.cursor, d, !0), this.colors.cursorAccent = this._parseColor(t.cursorAccent, l, !0), this.colors.selectionBackgroundTransparent = this._parseColor(t.selectionBackground, o, !0), this.colors.selectionBackgroundOpaque = n.color.blend(this.colors.background, this.colors.selectionBackgroundTransparent), this.colors.selectionInactiveBackgroundTransparent = this._parseColor(t.selectionInactiveBackground, this.colors.selectionBackgroundTransparent, !0), this.colors.selectionInactiveBackgroundOpaque = n.color.blend(this.colors.background, this.colors.selectionInactiveBackgroundTransparent); const s = { css: "", rgba: 0 }; if (this.colors.selectionForeground = t.selectionForeground ? this._parseColor(t.selectionForeground, s) : void 0, this.colors.selectionForeground === s && (this.colors.selectionForeground = void 0), n.color.isOpaque(this.colors.selectionBackgroundTransparent) && (this.colors.selectionBackgroundTransparent = n.color.opacity(this.colors.selectionBackgroundTransparent, .3)), n.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent) && (this.colors.selectionInactiveBackgroundTransparent = n.color.opacity(this.colors.selectionInactiveBackgroundTransparent, .3)), this.colors.ansi = r.DEFAULT_ANSI_COLORS.slice(), this.colors.ansi[0] = this._parseColor(t.black, r.DEFAULT_ANSI_COLORS[0]), this.colors.ansi[1] = this._parseColor(t.red, r.DEFAULT_ANSI_COLORS[1]), this.colors.ansi[2] = this._parseColor(t.green, r.DEFAULT_ANSI_COLORS[2]), this.colors.ansi[3] = this._parseColor(t.yellow, r.DEFAULT_ANSI_COLORS[3]), this.colors.ansi[4] = this._parseColor(t.blue, r.DEFAULT_ANSI_COLORS[4]), this.colors.ansi[5] = this._parseColor(t.magenta, r.DEFAULT_ANSI_COLORS[5]), this.colors.ansi[6] = this._parseColor(t.cyan, r.DEFAULT_ANSI_COLORS[6]), this.colors.ansi[7] = this._parseColor(t.white, r.DEFAULT_ANSI_COLORS[7]), this.colors.ansi[8] = this._parseColor(t.brightBlack, r.DEFAULT_ANSI_COLORS[8]), this.colors.ansi[9] = this._parseColor(t.brightRed, r.DEFAULT_ANSI_COLORS[9]), this.colors.ansi[10] = this._parseColor(t.brightGreen, r.DEFAULT_ANSI_COLORS[10]), this.colors.ansi[11] = this._parseColor(t.brightYellow, r.DEFAULT_ANSI_COLORS[11]), this.colors.ansi[12] = this._parseColor(t.brightBlue, r.DEFAULT_ANSI_COLORS[12]), this.colors.ansi[13] = this._parseColor(t.brightMagenta, r.DEFAULT_ANSI_COLORS[13]), this.colors.ansi[14] = this._parseColor(t.brightCyan, r.DEFAULT_ANSI_COLORS[14]), this.colors.ansi[15] = this._parseColor(t.brightWhite, r.DEFAULT_ANSI_COLORS[15]), t.extendedAnsi) { const e = Math.min(this.colors.ansi.length - 16, t.extendedAnsi.length); for (let i = 0; i < e; i++) this.colors.ansi[i + 16] = this._parseColor(t.extendedAnsi[i], r.DEFAULT_ANSI_COLORS[i + 16]) } this._contrastCache.clear(), this._updateRestoreColors() } restoreColor(t) { if (t !== void 0) switch (t) { 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[t] = this._restoreColors.ansi[t] } else for (let s = 0; s < this._restoreColors.ansi.length; ++s) this.colors.ansi[s] = this._restoreColors.ansi[s] } _updateRestoreColors() { this._restoreColors = { foreground: this.colors.foreground, background: this.colors.background, cursor: this.colors.cursor, ansi: this.colors.ansi.slice() } } _parseColor(t, s, e = this.allowTransparency) { if (t === void 0) return s; if (this._ctx.fillStyle = this._litmusColor, this._ctx.fillStyle = t, typeof this._ctx.fillStyle != "string") return console.warn(`Color: ${t} is invalid using fallback ${s.css}`), s; this._ctx.fillRect(0, 0, 1, 1); const i = this._ctx.getImageData(0, 0, 1, 1).data; if (i[3] !== 255) { if (!e) return console.warn(`Color: ${t} is using transparency, but allowTransparency is false. Using fallback ${s.css}.`), s; const [c, g, v, S] = this._ctx.fillStyle.substring(5, this._ctx.fillStyle.length - 1).split(",").map(m => Number(m)) , u = Math.round(255 * S); return { rgba: n.channels.toRgba(c, g, v, u), css: t } } return { css: this._ctx.fillStyle, rgba: n.channels.toRgba(i[0], i[1], i[2], i[3]) } } } } , 9631: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.removeElementFromParent = void 0, r.removeElementFromParent = function (...a) { var n; for (const _ of a) (n = _ == null ? void 0 : _.parentElement) === null || n === void 0 || n.removeChild(_) } } , 3656: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.addDisposableDomListener = void 0, r.addDisposableDomListener = function (a, n, _, h) { a.addEventListener(n, _, h); let f = !1; return { dispose: () => { f || (f = !0, a.removeEventListener(n, _, h)) } } } } , 6465: function (x, r, a) { var n = this && this.__decorate || function (t, s, e, i) { var c, g = arguments.length, v = g < 3 ? s : i === null ? i = Object.getOwnPropertyDescriptor(s, e) : i; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") v = Reflect.decorate(t, s, e, i); else for (var S = t.length - 1; S >= 0; S--) (c = t[S]) && (v = (g < 3 ? c(v) : g > 3 ? c(s, e, v) : c(s, e)) || v); return g > 3 && v && Object.defineProperty(s, e, v), v } , _ = this && this.__param || function (t, s) { return function (e, i) { s(e, i, t) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.Linkifier2 = void 0; const h = a(2585) , f = a(8460) , d = a(844) , l = a(3656); let o = class extends d.Disposable { constructor(t) { super(), this._bufferService = t, this._linkProviders = [], this._linkCacheDisposables = [], this._isMouseOut = !0, this._activeLine = -1, this._onShowLinkUnderline = this.register(new f.EventEmitter), this._onHideLinkUnderline = this.register(new f.EventEmitter), this.register((0, d.getDisposeArrayDisposable)(this._linkCacheDisposables)) } get currentLink() { return this._currentLink } get onShowLinkUnderline() { return this._onShowLinkUnderline.event } get onHideLinkUnderline() { return this._onHideLinkUnderline.event } dispose() { super.dispose(), this._lastMouseEvent = void 0 } registerLinkProvider(t) { return this._linkProviders.push(t), { dispose: () => { const s = this._linkProviders.indexOf(t); s !== -1 && this._linkProviders.splice(s, 1) } } } attachToDom(t, s, e) { this._element = t, this._mouseService = s, this._renderService = e, this.register((0, l.addDisposableDomListener)(this._element, "mouseleave", () => { this._isMouseOut = !0, this._clearCurrentLink() } )), this.register((0, l.addDisposableDomListener)(this._element, "mousemove", this._onMouseMove.bind(this))), this.register((0, l.addDisposableDomListener)(this._element, "mousedown", this._handleMouseDown.bind(this))), this.register((0, l.addDisposableDomListener)(this._element, "mouseup", this._handleMouseUp.bind(this))) } _onMouseMove(t) { if (this._lastMouseEvent = t, !this._element || !this._mouseService) return; const s = this._positionFromMouseEvent(t, this._element, this._mouseService); if (!s) return; this._isMouseOut = !1; const e = t.composedPath(); for (let i = 0; i < e.length; i++) { const c = e[i]; if (c.classList.contains("xterm")) break; if (c.classList.contains("xterm-hover")) return } this._lastBufferCell && s.x === this._lastBufferCell.x && s.y === this._lastBufferCell.y || (this._onHover(s), this._lastBufferCell = s) } _onHover(t) { if (this._activeLine !== t.y) return this._clearCurrentLink(), void this._askForLink(t, !1); this._currentLink && this._linkAtPosition(this._currentLink.link, t) || (this._clearCurrentLink(), this._askForLink(t, !0)) } _askForLink(t, s) { var e, i; this._activeProviderReplies && s || ((e = this._activeProviderReplies) === null || e === void 0 || e.forEach(g => { g == null || g.forEach(v => { v.link.dispose && v.link.dispose() } ) } ), this._activeProviderReplies = new Map, this._activeLine = t.y); let c = !1; for (const [g, v] of this._linkProviders.entries()) s ? !((i = this._activeProviderReplies) === null || i === void 0) && i.get(g) && (c = this._checkLinkProviderResult(g, t, c)) : v.provideLinks(t.y, S => { var u, m; if (this._isMouseOut) return; const w = S == null ? void 0 : S.map(R => ({ link: R })); (u = this._activeProviderReplies) === null || u === void 0 || u.set(g, w), c = this._checkLinkProviderResult(g, t, c), ((m = this._activeProviderReplies) === null || m === void 0 ? void 0 : m.size) === this._linkProviders.length && this._removeIntersectingLinks(t.y, this._activeProviderReplies) } ) } _removeIntersectingLinks(t, s) { const e = new Set; for (let i = 0; i < s.size; i++) { const c = s.get(i); if (c) for (let g = 0; g < c.length; g++) { const v = c[g] , S = v.link.range.start.y < t ? 0 : v.link.range.start.x , u = v.link.range.end.y > t ? this._bufferService.cols : v.link.range.end.x; for (let m = S; m <= u; m++) { if (e.has(m)) { c.splice(g--, 1); break } e.add(m) } } } } _checkLinkProviderResult(t, s, e) { var i; if (!this._activeProviderReplies) return e; const c = this._activeProviderReplies.get(t); let g = !1; for (let v = 0; v < t; v++) this._activeProviderReplies.has(v) && !this._activeProviderReplies.get(v) || (g = !0); if (!g && c) { const v = c.find(S => this._linkAtPosition(S.link, s)); v && (e = !0, this._handleNewLink(v)) } if (this._activeProviderReplies.size === this._linkProviders.length && !e) for (let v = 0; v < this._activeProviderReplies.size; v++) { const S = (i = this._activeProviderReplies.get(v)) === null || i === void 0 ? void 0 : i.find(u => this._linkAtPosition(u.link, s)); if (S) { e = !0, this._handleNewLink(S); break } } return e } _handleMouseDown() { this._mouseDownLink = this._currentLink } _handleMouseUp(t) { if (!this._element || !this._mouseService || !this._currentLink) return; const s = this._positionFromMouseEvent(t, this._element, this._mouseService); s && this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, s) && this._currentLink.link.activate(t, this._currentLink.link.text) } _clearCurrentLink(t, s) { this._element && this._currentLink && this._lastMouseEvent && (!t || !s || this._currentLink.link.range.start.y >= t && this._currentLink.link.range.end.y <= s) && (this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent), this._currentLink = void 0, (0, d.disposeArray)(this._linkCacheDisposables)) } _handleNewLink(t) { if (!this._element || !this._lastMouseEvent || !this._mouseService) return; const s = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService); s && this._linkAtPosition(t.link, s) && (this._currentLink = t, this._currentLink.state = { decorations: { underline: t.link.decorations === void 0 || t.link.decorations.underline, pointerCursor: t.link.decorations === void 0 || t.link.decorations.pointerCursor }, isHovered: !0 }, this._linkHover(this._element, t.link, this._lastMouseEvent), t.link.decorations = {}, Object.defineProperties(t.link.decorations, { pointerCursor: { get: () => { var e, i; return (i = (e = this._currentLink) === null || e === void 0 ? void 0 : e.state) === null || i === void 0 ? void 0 : i.decorations.pointerCursor } , set: e => { var i, c; ((i = this._currentLink) === null || i === void 0 ? void 0 : i.state) && this._currentLink.state.decorations.pointerCursor !== e && (this._currentLink.state.decorations.pointerCursor = e, this._currentLink.state.isHovered && ((c = this._element) === null || c === void 0 || c.classList.toggle("xterm-cursor-pointer", e))) } }, underline: { get: () => { var e, i; return (i = (e = this._currentLink) === null || e === void 0 ? void 0 : e.state) === null || i === void 0 ? void 0 : i.decorations.underline } , set: e => { var i, c, g; ((i = this._currentLink) === null || i === void 0 ? void 0 : i.state) && ((g = (c = this._currentLink) === null || c === void 0 ? void 0 : c.state) === null || g === void 0 ? void 0 : g.decorations.underline) !== e && (this._currentLink.state.decorations.underline = e, this._currentLink.state.isHovered && this._fireUnderlineEvent(t.link, e)) } } }), this._renderService && this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e => { const i = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp; this._clearCurrentLink(i, e.end + 1 + this._bufferService.buffer.ydisp) } ))) } _linkHover(t, s, e) { var i; !((i = this._currentLink) === null || i === void 0) && i.state && (this._currentLink.state.isHovered = !0, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(s, !0), this._currentLink.state.decorations.pointerCursor && t.classList.add("xterm-cursor-pointer")), s.hover && s.hover(e, s.text) } _fireUnderlineEvent(t, s) { const e = t.range , i = this._bufferService.buffer.ydisp , c = this._createLinkUnderlineEvent(e.start.x - 1, e.start.y - i - 1, e.end.x, e.end.y - i - 1, void 0); (s ? this._onShowLinkUnderline : this._onHideLinkUnderline).fire(c) } _linkLeave(t, s, e) { var i; !((i = this._currentLink) === null || i === void 0) && i.state && (this._currentLink.state.isHovered = !1, this._currentLink.state.decorations.underline && this._fireUnderlineEvent(s, !1), this._currentLink.state.decorations.pointerCursor && t.classList.remove("xterm-cursor-pointer")), s.leave && s.leave(e, s.text) } _linkAtPosition(t, s) { const e = t.range.start.y === t.range.end.y , i = t.range.start.y < s.y , c = t.range.end.y > s.y; return (e && t.range.start.x <= s.x && t.range.end.x >= s.x || i && t.range.end.x >= s.x || c && t.range.start.x <= s.x || i && c) && t.range.start.y <= s.y && t.range.end.y >= s.y } _positionFromMouseEvent(t, s, e) { const i = e.getCoords(t, s, this._bufferService.cols, this._bufferService.rows); if (i) return { x: i[0], y: i[1] + this._bufferService.buffer.ydisp } } _createLinkUnderlineEvent(t, s, e, i, c) { return { x1: t, y1: s, x2: e, y2: i, cols: this._bufferService.cols, fg: c } } } ; o = n([_(0, h.IBufferService)], o), r.Linkifier2 = o }, 9042: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.tooMuchOutput = r.promptLabel = void 0, r.promptLabel = "Terminal input", r.tooMuchOutput = "Too much output to announce, navigate to rows manually to read" } , 2962: function (x, r, a) { var n = this && this.__decorate || function (o, t, s, e) { var i, c = arguments.length, g = c < 3 ? t : e === null ? e = Object.getOwnPropertyDescriptor(t, s) : e; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") g = Reflect.decorate(o, t, s, e); else for (var v = o.length - 1; v >= 0; v--) (i = o[v]) && (g = (c < 3 ? i(g) : c > 3 ? i(t, s, g) : i(t, s)) || g); return c > 3 && g && Object.defineProperty(t, s, g), g } , _ = this && this.__param || function (o, t) { return function (s, e) { t(s, e, o) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.OscLinkProvider = void 0; const h = a(511) , f = a(2585); let d = class { constructor(o, t, s) { this._bufferService = o, this._optionsService = t, this._oscLinkService = s } provideLinks(o, t) { var s; const e = this._bufferService.buffer.lines.get(o - 1); if (!e) return void t(void 0); const i = [] , c = this._optionsService.rawOptions.linkHandler , g = new h.CellData , v = e.getTrimmedLength(); let S = -1 , u = -1 , m = !1; for (let w = 0; w < v; w++) if (u !== -1 || e.hasContent(w)) { if (e.loadCell(w, g), g.hasExtendedAttrs() && g.extended.urlId) { if (u === -1) { u = w, S = g.extended.urlId; continue } m = g.extended.urlId !== S } else u !== -1 && (m = !0); if (m || u !== -1 && w === v - 1) { const R = (s = this._oscLinkService.getLinkData(S)) === null || s === void 0 ? void 0 : s.uri; if (R) { const L = { start: { x: u + 1, y: o }, end: { x: w + (m || w !== v - 1 ? 0 : 1), y: o } }; i.push({ text: R, range: L, activate: (p, C) => c ? c.activate(p, C, L) : l(0, C), hover: (p, C) => { var b; return (b = c == null ? void 0 : c.hover) === null || b === void 0 ? void 0 : b.call(c, p, C, L) } , leave: (p, C) => { var b; return (b = c == null ? void 0 : c.leave) === null || b === void 0 ? void 0 : b.call(c, p, C, L) } }) } m = !1, g.hasExtendedAttrs() && g.extended.urlId ? (u = w, S = g.extended.urlId) : (u = -1, S = -1) } } t(i) } } ; function l(o, t) { if (confirm(`Do you want to navigate to ${t}?`)) { const s = window.open(); if (s) { try { s.opener = null } catch { } s.location.href = t } else console.warn("Opening link blocked as opener could not be cleared") } } d = n([_(0, f.IBufferService), _(1, f.IOptionsService), _(2, f.IOscLinkService)], d), r.OscLinkProvider = d }, 6193: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.RenderDebouncer = void 0, r.RenderDebouncer = class { constructor(a, n) { this._parentWindow = a, this._renderCallback = n, this._refreshCallbacks = [] } dispose() { this._animationFrame && (this._parentWindow.cancelAnimationFrame(this._animationFrame), this._animationFrame = void 0) } addRefreshCallback(a) { return this._refreshCallbacks.push(a), this._animationFrame || (this._animationFrame = this._parentWindow.requestAnimationFrame(() => this._innerRefresh())), this._animationFrame } refresh(a, n, _) { this._rowCount = _, a = a !== void 0 ? a : 0, n = n !== void 0 ? n : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, a) : a, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, n) : n, this._animationFrame || (this._animationFrame = this._parentWindow.requestAnimationFrame(() => this._innerRefresh())) } _innerRefresh() { if (this._animationFrame = void 0, this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) return void this._runRefreshCallbacks(); const a = Math.max(this._rowStart, 0) , n = Math.min(this._rowEnd, this._rowCount - 1); this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(a, n), this._runRefreshCallbacks() } _runRefreshCallbacks() { for (const a of this._refreshCallbacks) a(0); this._refreshCallbacks = [] } } } , 5596: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ScreenDprMonitor = void 0; const n = a(844); class _ extends n.Disposable { constructor(f) { super(), this._parentWindow = f, this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio } setListener(f) { this._listener && this.clearListener(), this._listener = f, this._outerListener = () => { this._listener && (this._listener(this._parentWindow.devicePixelRatio, this._currentDevicePixelRatio), this._updateDpr()) } , this._updateDpr() } dispose() { super.dispose(), this.clearListener() } _updateDpr() { var f; this._outerListener && ((f = this._resolutionMediaMatchList) === null || f === void 0 || f.removeListener(this._outerListener), this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio, this._resolutionMediaMatchList = this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`), this._resolutionMediaMatchList.addListener(this._outerListener)) } clearListener() { this._resolutionMediaMatchList && this._listener && this._outerListener && (this._resolutionMediaMatchList.removeListener(this._outerListener), this._resolutionMediaMatchList = void 0, this._listener = void 0, this._outerListener = void 0) } } r.ScreenDprMonitor = _ } , 3236: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.Terminal = void 0; const n = a(2950) , _ = a(1680) , h = a(3614) , f = a(2584) , d = a(5435) , l = a(9312) , o = a(6114) , t = a(3656) , s = a(9042) , e = a(4567) , i = a(1296) , c = a(7399) , g = a(8460) , v = a(8437) , S = a(5680) , u = a(3230) , m = a(4725) , w = a(428) , R = a(8934) , L = a(6465) , p = a(5114) , C = a(8969) , b = a(8055) , E = a(4269) , A = a(5941) , H = a(3107) , j = a(5744) , $ = a(9074) , P = a(2585) , N = a(2962) , y = typeof window < "u" ? window.document : null; class T extends C.CoreTerminal { constructor(k = {}) { super(k), this.browser = o, this._keyDownHandled = !1, this._keyDownSeen = !1, this._keyPressHandled = !1, this._unprocessedDeadKey = !1, this._onCursorMove = new g.EventEmitter, this._onKey = new g.EventEmitter, this._onRender = new g.EventEmitter, this._onSelectionChange = new g.EventEmitter, this._onTitleChange = new g.EventEmitter, this._onBell = new g.EventEmitter, this._onFocus = new g.EventEmitter, this._onBlur = new g.EventEmitter, this._onA11yCharEmitter = new g.EventEmitter, this._onA11yTabEmitter = new g.EventEmitter, this._setup(), this.linkifier2 = this.register(this._instantiationService.createInstance(L.Linkifier2)), this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(N.OscLinkProvider)), this._decorationService = this._instantiationService.createInstance($.DecorationService), this._instantiationService.setService(P.IDecorationService, this._decorationService), this.register(this._inputHandler.onRequestBell(() => this._onBell.fire())), this.register(this._inputHandler.onRequestRefreshRows((D, B) => this.refresh(D, B))), this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus())), this.register(this._inputHandler.onRequestReset(() => this.reset())), this.register(this._inputHandler.onRequestWindowsOptionsReport(D => this._reportWindowsOptions(D))), this.register(this._inputHandler.onColor(D => this._handleColorEvent(D))), this.register((0, g.forwardEvent)(this._inputHandler.onCursorMove, this._onCursorMove)), this.register((0, g.forwardEvent)(this._inputHandler.onTitleChange, this._onTitleChange)), this.register((0, g.forwardEvent)(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this.register((0, g.forwardEvent)(this._inputHandler.onA11yTab, this._onA11yTabEmitter)), this.register(this._bufferService.onResize(D => this._afterResize(D.cols, D.rows))) } get onCursorMove() { return this._onCursorMove.event } get onKey() { return this._onKey.event } get onRender() { return this._onRender.event } get onSelectionChange() { return this._onSelectionChange.event } get onTitleChange() { return this._onTitleChange.event } get onBell() { return this._onBell.event } get onFocus() { return this._onFocus.event } get onBlur() { return this._onBlur.event } get onA11yChar() { return this._onA11yCharEmitter.event } get onA11yTab() { return this._onA11yTabEmitter.event } _handleColorEvent(k) { var D, B; if (this._colorManager) { for (const I of k) { let F, M = ""; switch (I.index) { case 256: F = "foreground", M = "10"; break; case 257: F = "background", M = "11"; break; case 258: F = "cursor", M = "12"; break; default: F = "ansi", M = "4;" + I.index } switch (I.type) { case 0: const X = b.color.toColorRGB(F === "ansi" ? this._colorManager.colors.ansi[I.index] : this._colorManager.colors[F]); this.coreService.triggerDataEvent(`${f.C0.ESC}]${M};${(0, A.toRgbString)(X)}${f.C1_ESCAPED.ST}`); break; case 1: F === "ansi" ? this._colorManager.colors.ansi[I.index] = b.rgba.toColor(...I.color) : this._colorManager.colors[F] = b.rgba.toColor(...I.color); break; case 2: this._colorManager.restoreColor(I.index) } } (D = this._renderService) === null || D === void 0 || D.setColors(this._colorManager.colors), (B = this.viewport) === null || B === void 0 || B.onThemeChange(this._colorManager.colors) } } dispose() { var k, D, B; this._isDisposed || (super.dispose(), (k = this._renderService) === null || k === void 0 || k.dispose(), this._customKeyEventHandler = void 0, this.write = () => { } , (B = (D = this.element) === null || D === void 0 ? void 0 : D.parentNode) === null || B === void 0 || B.removeChild(this.element)) } _setup() { super._setup(), this._customKeyEventHandler = void 0 } get buffer() { return this.buffers.active } focus() { this.textarea && this.textarea.focus({ preventScroll: !0 }) } _updateOptions(k) { var D, B, I, F; switch (super._updateOptions(k), k) { case "fontFamily": case "fontSize": (D = this._renderService) === null || D === void 0 || D.clear(), (B = this._charSizeService) === null || B === void 0 || B.measure(); break; case "cursorBlink": case "cursorStyle": this.refresh(this.buffer.y, this.buffer.y); break; case "customGlyphs": case "drawBoldTextInBrightColors": case "letterSpacing": case "lineHeight": case "fontWeight": case "fontWeightBold": case "minimumContrastRatio": this._renderService && (this._renderService.clear(), this._renderService.onResize(this.cols, this.rows), this.refresh(0, this.rows - 1)); break; case "scrollback": (I = this.viewport) === null || I === void 0 || I.syncScrollArea(); break; case "screenReaderMode": this.optionsService.rawOptions.screenReaderMode ? !this._accessibilityManager && this._renderService && (this._accessibilityManager = new e.AccessibilityManager(this, this._renderService)) : ((F = this._accessibilityManager) === null || F === void 0 || F.dispose(), this._accessibilityManager = void 0); break; case "tabStopWidth": this.buffers.setupTabStops(); break; case "theme": this._setTheme(this.optionsService.rawOptions.theme) } } _onTextAreaFocus(k) { this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(f.C0.ESC + "[I"), this.updateCursorStyle(k), this.element.classList.add("focus"), this._showCursor(), this._onFocus.fire() } blur() { var k; return (k = this.textarea) === null || k === void 0 ? void 0 : k.blur() } _onTextAreaBlur() { this.textarea.value = "", this.refresh(this.buffer.y, this.buffer.y), this.coreService.decPrivateModes.sendFocus && this.coreService.triggerDataEvent(f.C0.ESC + "[O"), this.element.classList.remove("focus"), this._onBlur.fire() } _syncTextArea() { if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper.isComposing || !this._renderService) return; const k = this.buffer.ybase + this.buffer.y , D = this.buffer.lines.get(k); if (!D) return; const B = Math.min(this.buffer.x, this.cols - 1) , I = this._renderService.dimensions.actualCellHeight , F = D.getWidth(B) , M = this._renderService.dimensions.actualCellWidth * F , X = this.buffer.y * this._renderService.dimensions.actualCellHeight , K = B * this._renderService.dimensions.actualCellWidth; this.textarea.style.left = K + "px", this.textarea.style.top = X + "px", this.textarea.style.width = M + "px", this.textarea.style.height = I + "px", this.textarea.style.lineHeight = I + "px", this.textarea.style.zIndex = "-5" } _initGlobal() { this._bindKeys(), this.register((0, t.addDisposableDomListener)(this.element, "copy", D => { this.hasSelection() && (0, h.copyHandler)(D, this._selectionService) } )); const k = D => (0, h.handlePasteEvent)(D, this.textarea, this.coreService); this.register((0, t.addDisposableDomListener)(this.textarea, "paste", k)), this.register((0, t.addDisposableDomListener)(this.element, "paste", k)), o.isFirefox ? this.register((0, t.addDisposableDomListener)(this.element, "mousedown", D => { D.button === 2 && (0, h.rightClickHandler)(D, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord) } )) : this.register((0, t.addDisposableDomListener)(this.element, "contextmenu", D => { (0, h.rightClickHandler)(D, this.textarea, this.screenElement, this._selectionService, this.options.rightClickSelectsWord) } )), o.isLinux && this.register((0, t.addDisposableDomListener)(this.element, "auxclick", D => { D.button === 1 && (0, h.moveTextAreaUnderMouseCursor)(D, this.textarea, this.screenElement) } )) } _bindKeys() { this.register((0, t.addDisposableDomListener)(this.textarea, "keyup", k => this._keyUp(k), !0)), this.register((0, t.addDisposableDomListener)(this.textarea, "keydown", k => this._keyDown(k), !0)), this.register((0, t.addDisposableDomListener)(this.textarea, "keypress", k => this._keyPress(k), !0)), this.register((0, t.addDisposableDomListener)(this.textarea, "compositionstart", () => this._compositionHelper.compositionstart())), this.register((0, t.addDisposableDomListener)(this.textarea, "compositionupdate", k => this._compositionHelper.compositionupdate(k))), this.register((0, t.addDisposableDomListener)(this.textarea, "compositionend", () => this._compositionHelper.compositionend())), this.register((0, t.addDisposableDomListener)(this.textarea, "input", k => this._inputEvent(k), !0)), this.register(this.onRender(() => this._compositionHelper.updateCompositionElements())) } open(k) { var D; if (!k) throw new Error("Terminal requires a parent element."); k.isConnected || this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"), this._document = k.ownerDocument, this.element = this._document.createElement("div"), this.element.dir = "ltr", this.element.classList.add("terminal"), this.element.classList.add("xterm"), this.element.setAttribute("tabindex", "0"), k.appendChild(this.element); const B = y.createDocumentFragment(); this._viewportElement = y.createElement("div"), this._viewportElement.classList.add("xterm-viewport"), B.appendChild(this._viewportElement), this._viewportScrollArea = y.createElement("div"), this._viewportScrollArea.classList.add("xterm-scroll-area"), this._viewportElement.appendChild(this._viewportScrollArea), this.screenElement = y.createElement("div"), this.screenElement.classList.add("xterm-screen"), this._helperContainer = y.createElement("div"), this._helperContainer.classList.add("xterm-helpers"), this.screenElement.appendChild(this._helperContainer), B.appendChild(this.screenElement), this.textarea = y.createElement("textarea"), this.textarea.classList.add("xterm-helper-textarea"), this.textarea.setAttribute("aria-label", s.promptLabel), this.textarea.setAttribute("aria-multiline", "false"), this.textarea.setAttribute("autocorrect", "off"), this.textarea.setAttribute("autocapitalize", "off"), this.textarea.setAttribute("spellcheck", "false"), this.textarea.tabIndex = 0, this.register((0, t.addDisposableDomListener)(this.textarea, "focus", F => this._onTextAreaFocus(F))), this.register((0, t.addDisposableDomListener)(this.textarea, "blur", () => this._onTextAreaBlur())), this._helperContainer.appendChild(this.textarea), this._coreBrowserService = this._instantiationService.createInstance(p.CoreBrowserService, this.textarea, (D = this._document.defaultView) !== null && D !== void 0 ? D : window), this._instantiationService.setService(m.ICoreBrowserService, this._coreBrowserService), this._charSizeService = this._instantiationService.createInstance(w.CharSizeService, this._document, this._helperContainer), this._instantiationService.setService(m.ICharSizeService, this._charSizeService), this._theme = this.options.theme || this._theme, this._colorManager = new S.ColorManager(y, this.options.allowTransparency), this.register(this.optionsService.onOptionChange(F => this._colorManager.onOptionsChange(F, this.optionsService.rawOptions[F]))), this._colorManager.setTheme(this._theme), this._characterJoinerService = this._instantiationService.createInstance(E.CharacterJoinerService), this._instantiationService.setService(m.ICharacterJoinerService, this._characterJoinerService); const I = this._createRenderer(); this._renderService = this.register(this._instantiationService.createInstance(u.RenderService, I, this.rows, this.screenElement)), this._instantiationService.setService(m.IRenderService, this._renderService), this.register(this._renderService.onRenderedViewportChange(F => this._onRender.fire(F))), this.onResize(F => this._renderService.resize(F.cols, F.rows)), this._compositionView = y.createElement("div"), this._compositionView.classList.add("composition-view"), this._compositionHelper = this._instantiationService.createInstance(n.CompositionHelper, this.textarea, this._compositionView), this._helperContainer.appendChild(this._compositionView), this.element.appendChild(B), this._mouseService = this._instantiationService.createInstance(R.MouseService), this._instantiationService.setService(m.IMouseService, this._mouseService), this.viewport = this._instantiationService.createInstance(_.Viewport, F => this.scrollLines(F, !0, 1), this._viewportElement, this._viewportScrollArea, this.element), this.viewport.onThemeChange(this._colorManager.colors), this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport.syncScrollArea())), this.register(this.viewport), this.register(this.onCursorMove(() => { this._renderService.onCursorMove(), this._syncTextArea() } )), this.register(this.onResize(() => this._renderService.onResize(this.cols, this.rows))), this.register(this.onBlur(() => this._renderService.onBlur())), this.register(this.onFocus(() => this._renderService.onFocus())), this.register(this._renderService.onDimensionsChange(() => this.viewport.syncScrollArea())), this._selectionService = this.register(this._instantiationService.createInstance(l.SelectionService, this.element, this.screenElement, this.linkifier2)), this._instantiationService.setService(m.ISelectionService, this._selectionService), this.register(this._selectionService.onRequestScrollLines(F => this.scrollLines(F.amount, F.suppressScrollEvent))), this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire())), this.register(this._selectionService.onRequestRedraw(F => this._renderService.onSelectionChanged(F.start, F.end, F.columnSelectMode))), this.register(this._selectionService.onLinuxMouseSelection(F => { this.textarea.value = F, this.textarea.focus(), this.textarea.select() } )), this.register(this._onScroll.event(F => { this.viewport.syncScrollArea(), this._selectionService.refresh() } )), this.register((0, t.addDisposableDomListener)(this._viewportElement, "scroll", () => this._selectionService.refresh())), this.linkifier2.attachToDom(this.screenElement, this._mouseService, this._renderService), this.register(this._instantiationService.createInstance(H.BufferDecorationRenderer, this.screenElement)), this.register((0, t.addDisposableDomListener)(this.element, "mousedown", F => this._selectionService.onMouseDown(F))), this.coreMouseService.areMouseEventsActive ? (this._selectionService.disable(), this.element.classList.add("enable-mouse-events")) : this._selectionService.enable(), this.options.screenReaderMode && (this._accessibilityManager = new e.AccessibilityManager(this, this._renderService)), this.options.overviewRulerWidth && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(j.OverviewRulerRenderer, this._viewportElement, this.screenElement))), this.optionsService.onOptionChange(() => { !this._overviewRulerRenderer && this.options.overviewRulerWidth && this._viewportElement && this.screenElement && (this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(j.OverviewRulerRenderer, this._viewportElement, this.screenElement))) } ), this._charSizeService.measure(), this.refresh(0, this.rows - 1), this._initGlobal(), this.bindMouse() } _createRenderer() { return this._instantiationService.createInstance(i.DomRenderer, this._colorManager.colors, this.element, this.screenElement, this._viewportElement, this.linkifier2) } _setTheme(k) { var D, B, I; this._theme = k, (D = this._colorManager) === null || D === void 0 || D.setTheme(k), (B = this._renderService) === null || B === void 0 || B.setColors(this._colorManager.colors), (I = this.viewport) === null || I === void 0 || I.onThemeChange(this._colorManager.colors) } bindMouse() { const k = this , D = this.element; function B(M) { const X = k._mouseService.getMouseReportCoords(M, k.screenElement); if (!X) return !1; let K, Z; switch (M.overrideType || M.type) { case "mousemove": Z = 32, M.buttons === void 0 ? (K = 3, M.button !== void 0 && (K = M.button < 3 ? M.button : 3)) : K = 1 & M.buttons ? 0 : 4 & M.buttons ? 1 : 2 & M.buttons ? 2 : 3; break; case "mouseup": Z = 0, K = M.button < 3 ? M.button : 3; break; case "mousedown": Z = 1, K = M.button < 3 ? M.button : 3; break; case "wheel": if (k.viewport.getLinesScrolled(M) === 0) return !1; Z = M.deltaY < 0 ? 0 : 1, K = 4; break; default: return !1 } return !(Z === void 0 || K === void 0 || K > 4) && k.coreMouseService.triggerMouseEvent({ col: X.col, row: X.row, x: X.x, y: X.y, button: K, action: Z, ctrl: M.ctrlKey, alt: M.altKey, shift: M.shiftKey }) } const I = { mouseup: null, wheel: null, mousedrag: null, mousemove: null } , F = { mouseup: M => (B(M), M.buttons || (this._document.removeEventListener("mouseup", I.mouseup), I.mousedrag && this._document.removeEventListener("mousemove", I.mousedrag)), this.cancel(M)), wheel: M => (B(M), this.cancel(M, !0)), mousedrag: M => { M.buttons && B(M) } , mousemove: M => { M.buttons || B(M) } }; this.register(this.coreMouseService.onProtocolChange(M => { M ? (this.optionsService.rawOptions.logLevel === "debug" && this._logService.debug("Binding to mouse events:", this.coreMouseService.explainEvents(M)), this.element.classList.add("enable-mouse-events"), this._selectionService.disable()) : (this._logService.debug("Unbinding from mouse events."), this.element.classList.remove("enable-mouse-events"), this._selectionService.enable()), 8 & M ? I.mousemove || (D.addEventListener("mousemove", F.mousemove), I.mousemove = F.mousemove) : (D.removeEventListener("mousemove", I.mousemove), I.mousemove = null), 16 & M ? I.wheel || (D.addEventListener("wheel", F.wheel, { passive: !1 }), I.wheel = F.wheel) : (D.removeEventListener("wheel", I.wheel), I.wheel = null), 2 & M ? I.mouseup || (I.mouseup = F.mouseup) : (this._document.removeEventListener("mouseup", I.mouseup), I.mouseup = null), 4 & M ? I.mousedrag || (I.mousedrag = F.mousedrag) : (this._document.removeEventListener("mousemove", I.mousedrag), I.mousedrag = null) } )), this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol, this.register((0, t.addDisposableDomListener)(D, "mousedown", M => { if (M.preventDefault(), this.focus(), this.coreMouseService.areMouseEventsActive && !this._selectionService.shouldForceSelection(M)) return B(M), I.mouseup && this._document.addEventListener("mouseup", I.mouseup), I.mousedrag && this._document.addEventListener("mousemove", I.mousedrag), this.cancel(M) } )), this.register((0, t.addDisposableDomListener)(D, "wheel", M => { if (!I.wheel) { if (!this.buffer.hasScrollback) { const X = this.viewport.getLinesScrolled(M); if (X === 0) return; const K = f.C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? "O" : "[") + (M.deltaY < 0 ? "A" : "B"); let Z = ""; for (let ve = 0; ve < Math.abs(X); ve++) Z += K; return this.coreService.triggerDataEvent(Z, !0), this.cancel(M, !0) } return this.viewport.onWheel(M) ? this.cancel(M) : void 0 } } , { passive: !1 })), this.register((0, t.addDisposableDomListener)(D, "touchstart", M => { if (!this.coreMouseService.areMouseEventsActive) return this.viewport.onTouchStart(M), this.cancel(M) } , { passive: !0 })), this.register((0, t.addDisposableDomListener)(D, "touchmove", M => { if (!this.coreMouseService.areMouseEventsActive) return this.viewport.onTouchMove(M) ? void 0 : this.cancel(M) } , { passive: !1 })) } refresh(k, D) { var B; (B = this._renderService) === null || B === void 0 || B.refreshRows(k, D) } updateCursorStyle(k) { var D; !((D = this._selectionService) === null || D === void 0) && D.shouldColumnSelect(k) ? this.element.classList.add("column-select") : this.element.classList.remove("column-select") } _showCursor() { this.coreService.isCursorInitialized || (this.coreService.isCursorInitialized = !0, this.refresh(this.buffer.y, this.buffer.y)) } scrollLines(k, D, B = 0) { super.scrollLines(k, D, B), this.refresh(0, this.rows - 1) } paste(k) { (0, h.paste)(k, this.textarea, this.coreService) } attachCustomKeyEventHandler(k) { this._customKeyEventHandler = k } registerLinkProvider(k) { return this.linkifier2.registerLinkProvider(k) } registerCharacterJoiner(k) { if (!this._characterJoinerService) throw new Error("Terminal must be opened first"); const D = this._characterJoinerService.register(k); return this.refresh(0, this.rows - 1), D } deregisterCharacterJoiner(k) { if (!this._characterJoinerService) throw new Error("Terminal must be opened first"); this._characterJoinerService.deregister(k) && this.refresh(0, this.rows - 1) } get markers() { return this.buffer.markers } addMarker(k) { return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + k) } registerDecoration(k) { return this._decorationService.registerDecoration(k) } hasSelection() { return !!this._selectionService && this._selectionService.hasSelection } select(k, D, B) { this._selectionService.setSelection(k, D, B) } getSelection() { return this._selectionService ? this._selectionService.selectionText : "" } getSelectionPosition() { if (this._selectionService && this._selectionService.hasSelection) return { start: { x: this._selectionService.selectionStart[0], y: this._selectionService.selectionStart[1] }, end: { x: this._selectionService.selectionEnd[0], y: this._selectionService.selectionEnd[1] } } } clearSelection() { var k; (k = this._selectionService) === null || k === void 0 || k.clearSelection() } selectAll() { var k; (k = this._selectionService) === null || k === void 0 || k.selectAll() } selectLines(k, D) { var B; (B = this._selectionService) === null || B === void 0 || B.selectLines(k, D) } _keyDown(k) { if (this._keyDownHandled = !1, this._keyDownSeen = !0, this._customKeyEventHandler && this._customKeyEventHandler(k) === !1) return !1; const D = this.browser.isMac && this.options.macOptionIsMeta && k.altKey; if (!D && !this._compositionHelper.keydown(k)) return this.buffer.ybase !== this.buffer.ydisp && this._bufferService.scrollToBottom(), !1; D || k.key !== "Dead" && k.key !== "AltGraph" || (this._unprocessedDeadKey = !0); const B = (0, c.evaluateKeyboardEvent)(k, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta); if (this.updateCursorStyle(k), B.type === 3 || B.type === 2) { const I = this.rows - 1; return this.scrollLines(B.type === 2 ? -I : I), this.cancel(k, !0) } return B.type === 1 && this.selectAll(), !!this._isThirdLevelShift(this.browser, k) || (B.cancel && this.cancel(k, !0), !B.key || !!(k.key && !k.ctrlKey && !k.altKey && !k.metaKey && k.key.length === 1 && k.key.charCodeAt(0) >= 65 && k.key.charCodeAt(0) <= 90) || (this._unprocessedDeadKey ? (this._unprocessedDeadKey = !1, !0) : (B.key !== f.C0.ETX && B.key !== f.C0.CR || (this.textarea.value = ""), this._onKey.fire({ key: B.key, domEvent: k }), this._showCursor(), this.coreService.triggerDataEvent(B.key, !0), this.optionsService.rawOptions.screenReaderMode ? void (this._keyDownHandled = !0) : this.cancel(k, !0)))) } _isThirdLevelShift(k, D) { const B = k.isMac && !this.options.macOptionIsMeta && D.altKey && !D.ctrlKey && !D.metaKey || k.isWindows && D.altKey && D.ctrlKey && !D.metaKey || k.isWindows && D.getModifierState("AltGraph"); return D.type === "keypress" ? B : B && (!D.keyCode || D.keyCode > 47) } _keyUp(k) { this._keyDownSeen = !1, this._customKeyEventHandler && this._customKeyEventHandler(k) === !1 || (function (D) { return D.keyCode === 16 || D.keyCode === 17 || D.keyCode === 18 }(k) || this.focus(), this.updateCursorStyle(k), this._keyPressHandled = !1) } _keyPress(k) { let D; if (this._keyPressHandled = !1, this._keyDownHandled || this._customKeyEventHandler && this._customKeyEventHandler(k) === !1) return !1; if (this.cancel(k), k.charCode) D = k.charCode; else if (k.which === null || k.which === void 0) D = k.keyCode; else { if (k.which === 0 || k.charCode === 0) return !1; D = k.which } return !(!D || (k.altKey || k.ctrlKey || k.metaKey) && !this._isThirdLevelShift(this.browser, k) || (D = String.fromCharCode(D), this._onKey.fire({ key: D, domEvent: k }), this._showCursor(), this.coreService.triggerDataEvent(D, !0), this._keyPressHandled = !0, this._unprocessedDeadKey = !1, 0)) } _inputEvent(k) { if (k.data && k.inputType === "insertText" && (!k.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) { if (this._keyPressHandled) return !1; this._unprocessedDeadKey = !1; const D = k.data; return this.coreService.triggerDataEvent(D, !0), this.cancel(k), !0 } return !1 } resize(k, D) { k !== this.cols || D !== this.rows ? super.resize(k, D) : this._charSizeService && !this._charSizeService.hasValidSize && this._charSizeService.measure() } _afterResize(k, D) { var B, I; (B = this._charSizeService) === null || B === void 0 || B.measure(), (I = this.viewport) === null || I === void 0 || I.syncScrollArea(!0) } clear() { if (this.buffer.ybase !== 0 || this.buffer.y !== 0) { this.buffer.clearAllMarkers(), this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)), this.buffer.lines.length = 1, this.buffer.ydisp = 0, this.buffer.ybase = 0, this.buffer.y = 0; for (let k = 1; k < this.rows; k++) this.buffer.lines.push(this.buffer.getBlankLine(v.DEFAULT_ATTR_DATA)); this.refresh(0, this.rows - 1), this._onScroll.fire({ position: this.buffer.ydisp, source: 0 }) } } reset() { var k, D; this.options.rows = this.rows, this.options.cols = this.cols; const B = this._customKeyEventHandler; this._setup(), super.reset(), (k = this._selectionService) === null || k === void 0 || k.reset(), this._decorationService.reset(), this._customKeyEventHandler = B, this.refresh(0, this.rows - 1), (D = this.viewport) === null || D === void 0 || D.syncScrollArea() } clearTextureAtlas() { var k; (k = this._renderService) === null || k === void 0 || k.clearTextureAtlas() } _reportFocus() { var k; !((k = this.element) === null || k === void 0) && k.classList.contains("focus") ? this.coreService.triggerDataEvent(f.C0.ESC + "[I") : this.coreService.triggerDataEvent(f.C0.ESC + "[O") } _reportWindowsOptions(k) { if (this._renderService) switch (k) { case d.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS: const D = this._renderService.dimensions.canvasWidth.toFixed(0) , B = this._renderService.dimensions.canvasHeight.toFixed(0); this.coreService.triggerDataEvent(`${f.C0.ESC}[4;${B};${D}t`); break; case d.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS: const I = this._renderService.dimensions.actualCellWidth.toFixed(0) , F = this._renderService.dimensions.actualCellHeight.toFixed(0); this.coreService.triggerDataEvent(`${f.C0.ESC}[6;${F};${I}t`) } } cancel(k, D) { if (this.options.cancelEvents || D) return k.preventDefault(), k.stopPropagation(), !1 } } r.Terminal = T } , 9924: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.TimeBasedDebouncer = void 0, r.TimeBasedDebouncer = class { constructor(a, n = 1e3) { this._renderCallback = a, this._debounceThresholdMS = n, this._lastRefreshMs = 0, this._additionalRefreshRequested = !1 } dispose() { this._refreshTimeoutID && clearTimeout(this._refreshTimeoutID) } refresh(a, n, _) { this._rowCount = _, a = a !== void 0 ? a : 0, n = n !== void 0 ? n : this._rowCount - 1, this._rowStart = this._rowStart !== void 0 ? Math.min(this._rowStart, a) : a, this._rowEnd = this._rowEnd !== void 0 ? Math.max(this._rowEnd, n) : n; const h = Date.now(); if (h - this._lastRefreshMs >= this._debounceThresholdMS) this._lastRefreshMs = h, this._innerRefresh(); else if (!this._additionalRefreshRequested) { const f = h - this._lastRefreshMs , d = this._debounceThresholdMS - f; this._additionalRefreshRequested = !0, this._refreshTimeoutID = window.setTimeout(() => { this._lastRefreshMs = Date.now(), this._innerRefresh(), this._additionalRefreshRequested = !1, this._refreshTimeoutID = void 0 } , d) } } _innerRefresh() { if (this._rowStart === void 0 || this._rowEnd === void 0 || this._rowCount === void 0) return; const a = Math.max(this._rowStart, 0) , n = Math.min(this._rowEnd, this._rowCount - 1); this._rowStart = void 0, this._rowEnd = void 0, this._renderCallback(a, n) } } } , 1680: function (x, r, a) { var n = this && this.__decorate || function (t, s, e, i) { var c, g = arguments.length, v = g < 3 ? s : i === null ? i = Object.getOwnPropertyDescriptor(s, e) : i; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") v = Reflect.decorate(t, s, e, i); else for (var S = t.length - 1; S >= 0; S--) (c = t[S]) && (v = (g < 3 ? c(v) : g > 3 ? c(s, e, v) : c(s, e)) || v); return g > 3 && v && Object.defineProperty(s, e, v), v } , _ = this && this.__param || function (t, s) { return function (e, i) { s(e, i, t) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.Viewport = void 0; const h = a(844) , f = a(3656) , d = a(4725) , l = a(2585); let o = class extends h.Disposable { constructor(t, s, e, i, c, g, v, S, u) { super(), this._scrollLines = t, this._viewportElement = s, this._scrollArea = e, this._element = i, this._bufferService = c, this._optionsService = g, this._charSizeService = v, this._renderService = S, this._coreBrowserService = u, this.scrollBarWidth = 0, this._currentRowHeight = 0, this._currentScaledCellHeight = 0, this._lastRecordedBufferLength = 0, this._lastRecordedViewportHeight = 0, this._lastRecordedBufferHeight = 0, this._lastTouchY = 0, this._lastScrollTop = 0, this._wheelPartialScroll = 0, this._refreshAnimationFrame = null, this._ignoreNextScrollEvent = !1, this._smoothScrollState = { startTime: 0, origin: -1, target: -1 }, this.scrollBarWidth = this._viewportElement.offsetWidth - this._scrollArea.offsetWidth || 15, this.register((0, f.addDisposableDomListener)(this._viewportElement, "scroll", this._onScroll.bind(this))), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate(m => this._activeBuffer = m.activeBuffer)), this._renderDimensions = this._renderService.dimensions, this.register(this._renderService.onDimensionsChange(m => this._renderDimensions = m)), setTimeout(() => this.syncScrollArea(), 0) } onThemeChange(t) { this._viewportElement.style.backgroundColor = t.background.css } _refresh(t) { if (t) return this._innerRefresh(), void (this._refreshAnimationFrame !== null && this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame)); this._refreshAnimationFrame === null && (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh())) } _innerRefresh() { if (this._charSizeService.height > 0) { this._currentRowHeight = this._renderService.dimensions.scaledCellHeight / this._coreBrowserService.dpr, this._currentScaledCellHeight = this._renderService.dimensions.scaledCellHeight, this._lastRecordedViewportHeight = this._viewportElement.offsetHeight; const s = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderService.dimensions.canvasHeight); this._lastRecordedBufferHeight !== s && (this._lastRecordedBufferHeight = s, this._scrollArea.style.height = this._lastRecordedBufferHeight + "px") } const t = this._bufferService.buffer.ydisp * this._currentRowHeight; this._viewportElement.scrollTop !== t && (this._ignoreNextScrollEvent = !0, this._viewportElement.scrollTop = t), this._refreshAnimationFrame = null } syncScrollArea(t = !1) { if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) return this._lastRecordedBufferLength = this._bufferService.buffer.lines.length, void this._refresh(t); this._lastRecordedViewportHeight === this._renderService.dimensions.canvasHeight && this._lastScrollTop === this._activeBuffer.ydisp * this._currentRowHeight && this._renderDimensions.scaledCellHeight === this._currentScaledCellHeight || this._refresh(t) } _onScroll(t) { if (this._lastScrollTop = this._viewportElement.scrollTop, !this._viewportElement.offsetParent) return; if (this._ignoreNextScrollEvent) return this._ignoreNextScrollEvent = !1, void this._scrollLines(0); const s = Math.round(this._lastScrollTop / this._currentRowHeight) - this._bufferService.buffer.ydisp; this._scrollLines(s) } _smoothScroll() { if (this._isDisposed || this._smoothScrollState.origin === -1 || this._smoothScrollState.target === -1) return; const t = this._smoothScrollPercent(); this._viewportElement.scrollTop = this._smoothScrollState.origin + Math.round(t * (this._smoothScrollState.target - this._smoothScrollState.origin)), t < 1 ? this._coreBrowserService.window.requestAnimationFrame(() => this._smoothScroll()) : this._clearSmoothScrollState() } _smoothScrollPercent() { return this._optionsService.rawOptions.smoothScrollDuration && this._smoothScrollState.startTime ? Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0) : 1 } _clearSmoothScrollState() { this._smoothScrollState.startTime = 0, this._smoothScrollState.origin = -1, this._smoothScrollState.target = -1 } _bubbleScroll(t, s) { const e = this._viewportElement.scrollTop + this._lastRecordedViewportHeight; return !(s < 0 && this._viewportElement.scrollTop !== 0 || s > 0 && e < this._lastRecordedBufferHeight) || (t.cancelable && t.preventDefault(), !1) } onWheel(t) { const s = this._getPixelsScrolled(t); return s !== 0 && (this._optionsService.rawOptions.smoothScrollDuration ? (this._smoothScrollState.startTime = Date.now(), this._smoothScrollPercent() < 1 ? (this._smoothScrollState.origin = this._viewportElement.scrollTop, this._smoothScrollState.target === -1 ? this._smoothScrollState.target = this._viewportElement.scrollTop + s : this._smoothScrollState.target += s, this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0), this._smoothScroll()) : this._clearSmoothScrollState()) : this._viewportElement.scrollTop += s, this._bubbleScroll(t, s)) } _getPixelsScrolled(t) { if (t.deltaY === 0 || t.shiftKey) return 0; let s = this._applyScrollModifier(t.deltaY, t); return t.deltaMode === WheelEvent.DOM_DELTA_LINE ? s *= this._currentRowHeight : t.deltaMode === WheelEvent.DOM_DELTA_PAGE && (s *= this._currentRowHeight * this._bufferService.rows), s } getLinesScrolled(t) { if (t.deltaY === 0 || t.shiftKey) return 0; let s = this._applyScrollModifier(t.deltaY, t); return t.deltaMode === WheelEvent.DOM_DELTA_PIXEL ? (s /= this._currentRowHeight + 0, this._wheelPartialScroll += s, s = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1), this._wheelPartialScroll %= 1) : t.deltaMode === WheelEvent.DOM_DELTA_PAGE && (s *= this._bufferService.rows), s } _applyScrollModifier(t, s) { const e = this._optionsService.rawOptions.fastScrollModifier; return e === "alt" && s.altKey || e === "ctrl" && s.ctrlKey || e === "shift" && s.shiftKey ? t * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity : t * this._optionsService.rawOptions.scrollSensitivity } onTouchStart(t) { this._lastTouchY = t.touches[0].pageY } onTouchMove(t) { const s = this._lastTouchY - t.touches[0].pageY; return this._lastTouchY = t.touches[0].pageY, s !== 0 && (this._viewportElement.scrollTop += s, this._bubbleScroll(t, s)) } } ; o = n([_(4, l.IBufferService), _(5, l.IOptionsService), _(6, d.ICharSizeService), _(7, d.IRenderService), _(8, d.ICoreBrowserService)], o), r.Viewport = o }, 3107: function (x, r, a) { var n = this && this.__decorate || function (t, s, e, i) { var c, g = arguments.length, v = g < 3 ? s : i === null ? i = Object.getOwnPropertyDescriptor(s, e) : i; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") v = Reflect.decorate(t, s, e, i); else for (var S = t.length - 1; S >= 0; S--) (c = t[S]) && (v = (g < 3 ? c(v) : g > 3 ? c(s, e, v) : c(s, e)) || v); return g > 3 && v && Object.defineProperty(s, e, v), v } , _ = this && this.__param || function (t, s) { return function (e, i) { s(e, i, t) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferDecorationRenderer = void 0; const h = a(3656) , f = a(4725) , d = a(844) , l = a(2585); let o = class extends d.Disposable { constructor(t, s, e, i) { super(), this._screenElement = t, this._bufferService = s, this._decorationService = e, this._renderService = i, this._decorationElements = new Map, this._altBufferIsActive = !1, this._dimensionsChanged = !1, this._container = document.createElement("div"), this._container.classList.add("xterm-decoration-container"), this._screenElement.appendChild(this._container), this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this.register(this._renderService.onDimensionsChange(() => { this._dimensionsChanged = !0, this._queueRefresh() } )), this.register((0, h.addDisposableDomListener)(window, "resize", () => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => { this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt } )), this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh())), this.register(this._decorationService.onDecorationRemoved(c => this._removeDecoration(c))) } dispose() { this._container.remove(), this._decorationElements.clear(), super.dispose() } _queueRefresh() { this._animationFrame === void 0 && (this._animationFrame = this._renderService.addRefreshCallback(() => { this.refreshDecorations(), this._animationFrame = void 0 } )) } refreshDecorations() { for (const t of this._decorationService.decorations) this._renderDecoration(t); this._dimensionsChanged = !1 } _renderDecoration(t) { this._refreshStyle(t), this._dimensionsChanged && this._refreshXPosition(t) } _createElement(t) { var s; const e = document.createElement("div"); e.classList.add("xterm-decoration"), e.style.width = `${Math.round((t.options.width || 1) * this._renderService.dimensions.actualCellWidth)}px`, e.style.height = (t.options.height || 1) * this._renderService.dimensions.actualCellHeight + "px", e.style.top = (t.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.actualCellHeight + "px", e.style.lineHeight = `${this._renderService.dimensions.actualCellHeight}px`; const i = (s = t.options.x) !== null && s !== void 0 ? s : 0; return i && i > this._bufferService.cols && (e.style.display = "none"), this._refreshXPosition(t, e), e } _refreshStyle(t) { const s = t.marker.line - this._bufferService.buffers.active.ydisp; if (s < 0 || s >= this._bufferService.rows) t.element && (t.element.style.display = "none", t.onRenderEmitter.fire(t.element)); else { let e = this._decorationElements.get(t); e || (t.onDispose(() => this._removeDecoration(t)), e = this._createElement(t), t.element = e, this._decorationElements.set(t, e), this._container.appendChild(e)), e.style.top = s * this._renderService.dimensions.actualCellHeight + "px", e.style.display = this._altBufferIsActive ? "none" : "block", t.onRenderEmitter.fire(e) } } _refreshXPosition(t, s = t.element) { var e; if (!s) return; const i = (e = t.options.x) !== null && e !== void 0 ? e : 0; (t.options.anchor || "left") === "right" ? s.style.right = i ? i * this._renderService.dimensions.actualCellWidth + "px" : "" : s.style.left = i ? i * this._renderService.dimensions.actualCellWidth + "px" : "" } _removeDecoration(t) { var s; (s = this._decorationElements.get(t)) === null || s === void 0 || s.remove(), this._decorationElements.delete(t) } } ; o = n([_(1, l.IBufferService), _(2, l.IDecorationService), _(3, f.IRenderService)], o), r.BufferDecorationRenderer = o }, 5871: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ColorZoneStore = void 0, r.ColorZoneStore = class { constructor() { this._zones = [], this._zonePool = [], this._zonePoolIndex = 0, this._linePadding = { full: 0, left: 0, center: 0, right: 0 } } get zones() { return this._zonePool.length = Math.min(this._zonePool.length, this._zones.length), this._zones } clear() { this._zones.length = 0, this._zonePoolIndex = 0 } addDecoration(a) { if (a.options.overviewRulerOptions) { for (const n of this._zones) if (n.color === a.options.overviewRulerOptions.color && n.position === a.options.overviewRulerOptions.position) { if (this._lineIntersectsZone(n, a.marker.line)) return; if (this._lineAdjacentToZone(n, a.marker.line, a.options.overviewRulerOptions.position)) return void this._addLineToZone(n, a.marker.line) } if (this._zonePoolIndex < this._zonePool.length) return this._zonePool[this._zonePoolIndex].color = a.options.overviewRulerOptions.color, this._zonePool[this._zonePoolIndex].position = a.options.overviewRulerOptions.position, this._zonePool[this._zonePoolIndex].startBufferLine = a.marker.line, this._zonePool[this._zonePoolIndex].endBufferLine = a.marker.line, void this._zones.push(this._zonePool[this._zonePoolIndex++]); this._zones.push({ color: a.options.overviewRulerOptions.color, position: a.options.overviewRulerOptions.position, startBufferLine: a.marker.line, endBufferLine: a.marker.line }), this._zonePool.push(this._zones[this._zones.length - 1]), this._zonePoolIndex++ } } setPadding(a) { this._linePadding = a } _lineIntersectsZone(a, n) { return n >= a.startBufferLine && n <= a.endBufferLine } _lineAdjacentToZone(a, n, _) { return n >= a.startBufferLine - this._linePadding[_ || "full"] && n <= a.endBufferLine + this._linePadding[_ || "full"] } _addLineToZone(a, n) { a.startBufferLine = Math.min(a.startBufferLine, n), a.endBufferLine = Math.max(a.endBufferLine, n) } } } , 5744: function (x, r, a) { var n = this && this.__decorate || function (c, g, v, S) { var u, m = arguments.length, w = m < 3 ? g : S === null ? S = Object.getOwnPropertyDescriptor(g, v) : S; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") w = Reflect.decorate(c, g, v, S); else for (var R = c.length - 1; R >= 0; R--) (u = c[R]) && (w = (m < 3 ? u(w) : m > 3 ? u(g, v, w) : u(g, v)) || w); return m > 3 && w && Object.defineProperty(g, v, w), w } , _ = this && this.__param || function (c, g) { return function (v, S) { g(v, S, c) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.OverviewRulerRenderer = void 0; const h = a(5871) , f = a(3656) , d = a(4725) , l = a(844) , o = a(2585) , t = { full: 0, left: 0, center: 0, right: 0 } , s = { full: 0, left: 0, center: 0, right: 0 } , e = { full: 0, left: 0, center: 0, right: 0 }; let i = class extends l.Disposable { constructor(c, g, v, S, u, m, w) { var R; super(), this._viewportElement = c, this._screenElement = g, this._bufferService = v, this._decorationService = S, this._renderService = u, this._optionsService = m, this._coreBrowseService = w, this._colorZoneStore = new h.ColorZoneStore, this._shouldUpdateDimensions = !0, this._shouldUpdateAnchor = !0, this._lastKnownBufferLength = 0, this._canvas = document.createElement("canvas"), this._canvas.classList.add("xterm-decoration-overview-ruler"), this._refreshCanvasDimensions(), (R = this._viewportElement.parentElement) === null || R === void 0 || R.insertBefore(this._canvas, this._viewportElement); const L = this._canvas.getContext("2d"); if (!L) throw new Error("Ctx cannot be null"); this._ctx = L, this._registerDecorationListeners(), this._registerBufferChangeListeners(), this._registerDimensionChangeListeners() } get _width() { return this._optionsService.options.overviewRulerWidth || 0 } _registerDecorationListeners() { this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(void 0, !0))), this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(void 0, !0))) } _registerBufferChangeListeners() { this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh())), this.register(this._bufferService.buffers.onBufferActivate(() => { this._canvas.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? "none" : "block" } )), this.register(this._bufferService.onScroll(() => { this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length && (this._refreshDrawHeightConstants(), this._refreshColorZonePadding()) } )) } _registerDimensionChangeListeners() { this.register(this._renderService.onRender(() => { this._containerHeight && this._containerHeight === this._screenElement.clientHeight || (this._queueRefresh(!0), this._containerHeight = this._screenElement.clientHeight) } )), this.register(this._optionsService.onOptionChange(c => { c === "overviewRulerWidth" && this._queueRefresh(!0) } )), this.register((0, f.addDisposableDomListener)(this._coreBrowseService.window, "resize", () => { this._queueRefresh(!0) } )), this._queueRefresh(!0) } dispose() { var c; (c = this._canvas) === null || c === void 0 || c.remove(), super.dispose() } _refreshDrawConstants() { const c = Math.floor(this._canvas.width / 3) , g = Math.ceil(this._canvas.width / 3); s.full = this._canvas.width, s.left = c, s.center = g, s.right = c, this._refreshDrawHeightConstants(), e.full = 0, e.left = 0, e.center = s.left, e.right = s.left + s.center } _refreshDrawHeightConstants() { t.full = Math.round(2 * this._coreBrowseService.dpr); const c = this._canvas.height / this._bufferService.buffer.lines.length , g = Math.round(Math.max(Math.min(c, 12), 6) * this._coreBrowseService.dpr); t.left = g, t.center = g, t.right = g } _refreshColorZonePadding() { this._colorZoneStore.setPadding({ full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * t.full), left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * t.left), center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * t.center), right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * t.right) }), this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length } _refreshCanvasDimensions() { this._canvas.style.width = `${this._width}px`, this._canvas.width = Math.round(this._width * this._coreBrowseService.dpr), this._canvas.style.height = `${this._screenElement.clientHeight}px`, this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowseService.dpr), this._refreshDrawConstants(), this._refreshColorZonePadding() } _refreshDecorations() { this._shouldUpdateDimensions && this._refreshCanvasDimensions(), this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height), this._colorZoneStore.clear(); for (const g of this._decorationService.decorations) this._colorZoneStore.addDecoration(g); this._ctx.lineWidth = 1; const c = this._colorZoneStore.zones; for (const g of c) g.position !== "full" && this._renderColorZone(g); for (const g of c) g.position === "full" && this._renderColorZone(g); this._shouldUpdateDimensions = !1, this._shouldUpdateAnchor = !1 } _renderColorZone(c) { this._ctx.fillStyle = c.color, this._ctx.fillRect(e[c.position || "full"], Math.round((this._canvas.height - 1) * (c.startBufferLine / this._bufferService.buffers.active.lines.length) - t[c.position || "full"] / 2), s[c.position || "full"], Math.round((this._canvas.height - 1) * ((c.endBufferLine - c.startBufferLine) / this._bufferService.buffers.active.lines.length) + t[c.position || "full"])) } _queueRefresh(c, g) { this._shouldUpdateDimensions = c || this._shouldUpdateDimensions, this._shouldUpdateAnchor = g || this._shouldUpdateAnchor, this._animationFrame === void 0 && (this._animationFrame = this._coreBrowseService.window.requestAnimationFrame(() => { this._refreshDecorations(), this._animationFrame = void 0 } )) } } ; i = n([_(2, o.IBufferService), _(3, o.IDecorationService), _(4, d.IRenderService), _(5, o.IOptionsService), _(6, d.ICoreBrowserService)], i), r.OverviewRulerRenderer = i }, 2950: function (x, r, a) { var n = this && this.__decorate || function (o, t, s, e) { var i, c = arguments.length, g = c < 3 ? t : e === null ? e = Object.getOwnPropertyDescriptor(t, s) : e; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") g = Reflect.decorate(o, t, s, e); else for (var v = o.length - 1; v >= 0; v--) (i = o[v]) && (g = (c < 3 ? i(g) : c > 3 ? i(t, s, g) : i(t, s)) || g); return c > 3 && g && Object.defineProperty(t, s, g), g } , _ = this && this.__param || function (o, t) { return function (s, e) { t(s, e, o) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.CompositionHelper = void 0; const h = a(4725) , f = a(2585) , d = a(2584); let l = class { constructor(o, t, s, e, i, c) { this._textarea = o, this._compositionView = t, this._bufferService = s, this._optionsService = e, this._coreService = i, this._renderService = c, this._isComposing = !1, this._isSendingComposition = !1, this._compositionPosition = { start: 0, end: 0 }, this._dataAlreadySent = "" } get isComposing() { return this._isComposing } compositionstart() { this._isComposing = !0, this._compositionPosition.start = this._textarea.value.length, this._compositionView.textContent = "", this._dataAlreadySent = "", this._compositionView.classList.add("active") } compositionupdate(o) { this._compositionView.textContent = o.data, this.updateCompositionElements(), setTimeout(() => { this._compositionPosition.end = this._textarea.value.length } , 0) } compositionend() { this._finalizeComposition(!0) } keydown(o) { if (this._isComposing || this._isSendingComposition) { if (o.keyCode === 229 || o.keyCode === 16 || o.keyCode === 17 || o.keyCode === 18) return !1; this._finalizeComposition(!1) } return o.keyCode !== 229 || (this._handleAnyTextareaChanges(), !1) } _finalizeComposition(o) { if (this._compositionView.classList.remove("active"), this._isComposing = !1, o) { const t = { start: this._compositionPosition.start, end: this._compositionPosition.end }; this._isSendingComposition = !0, setTimeout(() => { if (this._isSendingComposition) { let s; this._isSendingComposition = !1, t.start += this._dataAlreadySent.length, s = this._isComposing ? this._textarea.value.substring(t.start, t.end) : this._textarea.value.substring(t.start), s.length > 0 && this._coreService.triggerDataEvent(s, !0) } } , 0) } else { this._isSendingComposition = !1; const t = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end); this._coreService.triggerDataEvent(t, !0) } } _handleAnyTextareaChanges() { const o = this._textarea.value; setTimeout(() => { if (!this._isComposing) { const t = this._textarea.value , s = t.replace(o, ""); this._dataAlreadySent = s, t.length > o.length ? this._coreService.triggerDataEvent(s, !0) : t.length < o.length ? this._coreService.triggerDataEvent(`${d.C0.DEL}`, !0) : t.length === o.length && t !== o && this._coreService.triggerDataEvent(t, !0) } } , 0) } updateCompositionElements(o) { if (this._isComposing) { if (this._bufferService.buffer.isCursorInViewport) { const t = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1) , s = this._renderService.dimensions.actualCellHeight , e = this._bufferService.buffer.y * this._renderService.dimensions.actualCellHeight , i = t * this._renderService.dimensions.actualCellWidth; this._compositionView.style.left = i + "px", this._compositionView.style.top = e + "px", this._compositionView.style.height = s + "px", this._compositionView.style.lineHeight = s + "px", this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + "px"; const c = this._compositionView.getBoundingClientRect(); this._textarea.style.left = i + "px", this._textarea.style.top = e + "px", this._textarea.style.width = Math.max(c.width, 1) + "px", this._textarea.style.height = Math.max(c.height, 1) + "px", this._textarea.style.lineHeight = c.height + "px" } o || setTimeout(() => this.updateCompositionElements(!0), 0) } } } ; l = n([_(2, f.IBufferService), _(3, f.IOptionsService), _(4, f.ICoreService), _(5, h.IRenderService)], l), r.CompositionHelper = l }, 9806: (x, r) => { function a(n, _, h) { const f = h.getBoundingClientRect() , d = n.getComputedStyle(h) , l = parseInt(d.getPropertyValue("padding-left")) , o = parseInt(d.getPropertyValue("padding-top")); return [_.clientX - f.left - l, _.clientY - f.top - o] } Object.defineProperty(r, "__esModule", { value: !0 }), r.getCoords = r.getCoordsRelativeToElement = void 0, r.getCoordsRelativeToElement = a, r.getCoords = function (n, _, h, f, d, l, o, t, s) { if (!l) return; const e = a(n, _, h); return e ? (e[0] = Math.ceil((e[0] + (s ? o / 2 : 0)) / o), e[1] = Math.ceil(e[1] / t), e[0] = Math.min(Math.max(e[0], 1), f + (s ? 1 : 0)), e[1] = Math.min(Math.max(e[1], 1), d), e) : void 0 } } , 9504: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.moveToCellSequence = void 0; const n = a(2584); function _(t, s, e, i) { const c = t - h(e, t) , g = s - h(e, s) , v = Math.abs(c - g) - function (S, u, m) { let w = 0; const R = S - h(m, S) , L = u - h(m, u); for (let p = 0; p < Math.abs(R - L); p++) { const C = f(S, u) === "A" ? -1 : 1 , b = m.buffer.lines.get(R + C * p); b != null && b.isWrapped && w++ } return w }(t, s, e); return o(v, l(f(t, s), i)) } function h(t, s) { let e = 0 , i = t.buffer.lines.get(s) , c = i == null ? void 0 : i.isWrapped; for (; c && s >= 0 && s < t.rows;) e++, i = t.buffer.lines.get(--s), c = i == null ? void 0 : i.isWrapped; return e } function f(t, s) { return t > s ? "A" : "B" } function d(t, s, e, i, c, g) { let v = t , S = s , u = ""; for (; v !== e || S !== i;) v += c ? 1 : -1, c && v > g.cols - 1 ? (u += g.buffer.translateBufferLineToString(S, !1, t, v), v = 0, t = 0, S++) : !c && v < 0 && (u += g.buffer.translateBufferLineToString(S, !1, 0, t + 1), v = g.cols - 1, t = v, S--); return u + g.buffer.translateBufferLineToString(S, !1, t, v) } function l(t, s) { const e = s ? "O" : "["; return n.C0.ESC + e + t } function o(t, s) { t = Math.floor(t); let e = ""; for (let i = 0; i < t; i++) e += s; return e } r.moveToCellSequence = function (t, s, e, i) { const c = e.buffer.x , g = e.buffer.y; if (!e.buffer.hasScrollback) return function (u, m, w, R, L, p) { return _(m, R, L, p).length === 0 ? "" : o(d(u, m, u, m - h(L, m), !1, L).length, l("D", p)) }(c, g, 0, s, e, i) + _(g, s, e, i) + function (u, m, w, R, L, p) { let C; C = _(m, R, L, p).length > 0 ? R - h(L, R) : m; const b = R , E = function (A, H, j, $, P, N) { let y; return y = _(j, $, P, N).length > 0 ? $ - h(P, $) : H, A < j && y <= $ || A >= j && y < $ ? "C" : "D" }(u, m, w, R, L, p); return o(d(u, C, w, b, E === "C", L).length, l(E, p)) }(c, g, t, s, e, i); let v; if (g === s) return v = c > t ? "D" : "C", o(Math.abs(c - t), l(v, i)); v = g > s ? "D" : "C"; const S = Math.abs(g - s); return o(function (u, m) { return m.cols - u }(g > s ? t : c, e) + (S - 1) * e.cols + 1 + ((g > s ? c : t) - 1), l(v, i)) } } , 8036: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.TEXT_BASELINE = r.DIM_OPACITY = r.INVERTED_DEFAULT_COLOR = void 0; const n = a(6114); r.INVERTED_DEFAULT_COLOR = 257, r.DIM_OPACITY = .5, r.TEXT_BASELINE = n.isFirefox || n.isLegacyEdge ? "bottom" : "ideographic" } , 1752: (x, r) => { function a(n) { return 57508 <= n && n <= 57558 } Object.defineProperty(r, "__esModule", { value: !0 }), r.excludeFromContrastRatioDemands = r.isRestrictedPowerlineGlyph = r.isPowerlineGlyph = r.throwIfFalsy = void 0, r.throwIfFalsy = function (n) { if (!n) throw new Error("value must not be falsy"); return n } , r.isPowerlineGlyph = a, r.isRestrictedPowerlineGlyph = function (n) { return 57520 <= n && n <= 57527 } , r.excludeFromContrastRatioDemands = function (n) { return a(n) || function (_) { return 9472 <= _ && _ <= 9631 }(n) } } , 1296: function (x, r, a) { var n = this && this.__decorate || function (S, u, m, w) { var R, L = arguments.length, p = L < 3 ? u : w === null ? w = Object.getOwnPropertyDescriptor(u, m) : w; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") p = Reflect.decorate(S, u, m, w); else for (var C = S.length - 1; C >= 0; C--) (R = S[C]) && (p = (L < 3 ? R(p) : L > 3 ? R(u, m, p) : R(u, m)) || p); return L > 3 && p && Object.defineProperty(u, m, p), p } , _ = this && this.__param || function (S, u) { return function (m, w) { u(m, w, S) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.DomRenderer = void 0; const h = a(3787) , f = a(8036) , d = a(844) , l = a(4725) , o = a(2585) , t = a(8460) , s = a(8055) , e = a(9631) , i = "xterm-dom-renderer-owner-" , c = "xterm-focus"; let g = 1 , v = class extends d.Disposable { constructor(S, u, m, w, R, L, p, C, b, E) { super(), this._colors = S, this._element = u, this._screenElement = m, this._viewportElement = w, this._linkifier2 = R, this._charSizeService = p, this._optionsService = C, this._bufferService = b, this._coreBrowserService = E, this._terminalClass = g++, this._rowElements = [], this._rowContainer = document.createElement("div"), this._rowContainer.classList.add("xterm-rows"), this._rowContainer.style.lineHeight = "normal", this._rowContainer.setAttribute("aria-hidden", "true"), this._refreshRowElements(this._bufferService.cols, this._bufferService.rows), this._selectionContainer = document.createElement("div"), this._selectionContainer.classList.add("xterm-selection"), this._selectionContainer.setAttribute("aria-hidden", "true"), this.dimensions = { scaledCharWidth: 0, scaledCharHeight: 0, scaledCellWidth: 0, scaledCellHeight: 0, scaledCharLeft: 0, scaledCharTop: 0, scaledCanvasWidth: 0, scaledCanvasHeight: 0, canvasWidth: 0, canvasHeight: 0, actualCellWidth: 0, actualCellHeight: 0 }, this._updateDimensions(), this._injectCss(), this._rowFactory = L.createInstance(h.DomRendererRowFactory, document, this._colors), this._element.classList.add(i + this._terminalClass), this._screenElement.appendChild(this._rowContainer), this._screenElement.appendChild(this._selectionContainer), this.register(this._linkifier2.onShowLinkUnderline(A => this._onLinkHover(A))), this.register(this._linkifier2.onHideLinkUnderline(A => this._onLinkLeave(A))) } get onRequestRedraw() { return new t.EventEmitter().event } dispose() { this._element.classList.remove(i + this._terminalClass), (0, e.removeElementFromParent)(this._rowContainer, this._selectionContainer, this._themeStyleElement, this._dimensionsStyleElement), super.dispose() } _updateDimensions() { const S = this._coreBrowserService.dpr; this.dimensions.scaledCharWidth = this._charSizeService.width * S, this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * S), this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.rawOptions.lineHeight), this.dimensions.scaledCharLeft = 0, this.dimensions.scaledCharTop = 0, this.dimensions.scaledCanvasWidth = this.dimensions.scaledCellWidth * this._bufferService.cols, this.dimensions.scaledCanvasHeight = this.dimensions.scaledCellHeight * this._bufferService.rows, this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / S), this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / S), this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols, this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows; for (const m of this._rowElements) m.style.width = `${this.dimensions.canvasWidth}px`, m.style.height = `${this.dimensions.actualCellHeight}px`, m.style.lineHeight = `${this.dimensions.actualCellHeight}px`, m.style.overflow = "hidden"; this._dimensionsStyleElement || (this._dimensionsStyleElement = document.createElement("style"), this._screenElement.appendChild(this._dimensionsStyleElement)); const u = `${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`; this._dimensionsStyleElement.textContent = u, this._selectionContainer.style.height = this._viewportElement.style.height, this._screenElement.style.width = `${this.dimensions.canvasWidth}px`, this._screenElement.style.height = `${this.dimensions.canvasHeight}px` } setColors(S) { this._colors = S, this._injectCss() } _injectCss() { this._themeStyleElement || (this._themeStyleElement = document.createElement("style"), this._screenElement.appendChild(this._themeStyleElement)); let S = `${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`; S += `${this._terminalSelector} span:not(.${h.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${h.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${h.ITALIC_CLASS} { font-style: italic;}`, S += "@keyframes blink_box_shadow_" + this._terminalClass + " { 50% { box-shadow: none; }}", S += "@keyframes blink_block_" + this._terminalClass + ` { 0% { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css}; } 50% { background-color: ${this._colors.cursorAccent.css}; color: ${this._colors.cursor.css}; }}`, S += `${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${h.CURSOR_CLASS}.${h.CURSOR_BLINK_CLASS}:not(.${h.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_` + this._terminalClass + ` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${h.CURSOR_CLASS}.${h.CURSOR_BLINK_CLASS}.${h.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_` + this._terminalClass + ` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css};}${this._terminalSelector} .xterm-rows .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}${this._terminalSelector} .xterm-rows .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`, S += `${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`, this._colors.ansi.forEach((u, m) => { S += `${this._terminalSelector} .xterm-fg-${m} { color: ${u.css}; }${this._terminalSelector} .xterm-bg-${m} { background-color: ${u.css}; }` } ), S += `${this._terminalSelector} .xterm-fg-${f.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${f.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`, this._themeStyleElement.textContent = S } onDevicePixelRatioChange() { this._updateDimensions() } _refreshRowElements(S, u) { for (let m = this._rowElements.length; m <= u; m++) { const w = document.createElement("div"); this._rowContainer.appendChild(w), this._rowElements.push(w) } for (; this._rowElements.length > u;) this._rowContainer.removeChild(this._rowElements.pop()) } onResize(S, u) { this._refreshRowElements(S, u), this._updateDimensions() } onCharSizeChanged() { this._updateDimensions() } onBlur() { this._rowContainer.classList.remove(c) } onFocus() { this._rowContainer.classList.add(c) } onSelectionChanged(S, u, m) { for (; this._selectionContainer.children.length;) this._selectionContainer.removeChild(this._selectionContainer.children[0]); if (this._rowFactory.onSelectionChanged(S, u, m), this.renderRows(0, this._bufferService.rows - 1), !S || !u) return; const w = S[1] - this._bufferService.buffer.ydisp , R = u[1] - this._bufferService.buffer.ydisp , L = Math.max(w, 0) , p = Math.min(R, this._bufferService.rows - 1); if (L >= this._bufferService.rows || p < 0) return; const C = document.createDocumentFragment(); if (m) { const b = S[0] > u[0]; C.appendChild(this._createSelectionElement(L, b ? u[0] : S[0], b ? S[0] : u[0], p - L + 1)) } else { const b = w === L ? S[0] : 0 , E = L === R ? u[0] : this._bufferService.cols; C.appendChild(this._createSelectionElement(L, b, E)); const A = p - L - 1; if (C.appendChild(this._createSelectionElement(L + 1, 0, this._bufferService.cols, A)), L !== p) { const H = R === p ? u[0] : this._bufferService.cols; C.appendChild(this._createSelectionElement(p, 0, H)) } } this._selectionContainer.appendChild(C) } _createSelectionElement(S, u, m, w = 1) { const R = document.createElement("div"); return R.style.height = w * this.dimensions.actualCellHeight + "px", R.style.top = S * this.dimensions.actualCellHeight + "px", R.style.left = u * this.dimensions.actualCellWidth + "px", R.style.width = this.dimensions.actualCellWidth * (m - u) + "px", R } onCursorMove() { } onOptionsChanged() { this._updateDimensions(), this._injectCss() } clear() { for (const S of this._rowElements) S.innerText = "" } renderRows(S, u) { const m = this._bufferService.buffer.ybase + this._bufferService.buffer.y , w = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1) , R = this._optionsService.rawOptions.cursorBlink; for (let L = S; L <= u; L++) { const p = this._rowElements[L]; p.innerText = ""; const C = L + this._bufferService.buffer.ydisp , b = this._bufferService.buffer.lines.get(C) , E = this._optionsService.rawOptions.cursorStyle; p.appendChild(this._rowFactory.createRow(b, C, C === m, E, w, R, this.dimensions.actualCellWidth, this._bufferService.cols)) } } get _terminalSelector() { return `.${i}${this._terminalClass}` } _onLinkHover(S) { this._setCellUnderline(S.x1, S.x2, S.y1, S.y2, S.cols, !0) } _onLinkLeave(S) { this._setCellUnderline(S.x1, S.x2, S.y1, S.y2, S.cols, !1) } _setCellUnderline(S, u, m, w, R, L) { for (; S !== u || m !== w;) { const p = this._rowElements[m]; if (!p) return; const C = p.children[S]; C && (C.style.textDecoration = L ? "underline" : "none"), ++S >= R && (S = 0, m++) } } } ; v = n([_(5, o.IInstantiationService), _(6, l.ICharSizeService), _(7, o.IOptionsService), _(8, o.IBufferService), _(9, l.ICoreBrowserService)], v), r.DomRenderer = v }, 3787: function (x, r, a) { var n = this && this.__decorate || function (v, S, u, m) { var w, R = arguments.length, L = R < 3 ? S : m === null ? m = Object.getOwnPropertyDescriptor(S, u) : m; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") L = Reflect.decorate(v, S, u, m); else for (var p = v.length - 1; p >= 0; p--) (w = v[p]) && (L = (R < 3 ? w(L) : R > 3 ? w(S, u, L) : w(S, u)) || L); return R > 3 && L && Object.defineProperty(S, u, L), L } , _ = this && this.__param || function (v, S) { return function (u, m) { S(u, m, v) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.DomRendererRowFactory = r.CURSOR_STYLE_UNDERLINE_CLASS = r.CURSOR_STYLE_BAR_CLASS = r.CURSOR_STYLE_BLOCK_CLASS = r.CURSOR_BLINK_CLASS = r.CURSOR_CLASS = r.STRIKETHROUGH_CLASS = r.UNDERLINE_CLASS = r.ITALIC_CLASS = r.DIM_CLASS = r.BOLD_CLASS = void 0; const h = a(8036) , f = a(643) , d = a(511) , l = a(2585) , o = a(8055) , t = a(4725) , s = a(4269) , e = a(1752) , i = a(3734); r.BOLD_CLASS = "xterm-bold", r.DIM_CLASS = "xterm-dim", r.ITALIC_CLASS = "xterm-italic", r.UNDERLINE_CLASS = "xterm-underline", r.STRIKETHROUGH_CLASS = "xterm-strikethrough", r.CURSOR_CLASS = "xterm-cursor", r.CURSOR_BLINK_CLASS = "xterm-cursor-blink", r.CURSOR_STYLE_BLOCK_CLASS = "xterm-cursor-block", r.CURSOR_STYLE_BAR_CLASS = "xterm-cursor-bar", r.CURSOR_STYLE_UNDERLINE_CLASS = "xterm-cursor-underline"; let c = class { constructor(v, S, u, m, w, R, L) { this._document = v, this._colors = S, this._characterJoinerService = u, this._optionsService = m, this._coreBrowserService = w, this._coreService = R, this._decorationService = L, this._workCell = new d.CellData, this._columnSelectMode = !1 } setColors(v) { this._colors = v } onSelectionChanged(v, S, u) { this._selectionStart = v, this._selectionEnd = S, this._columnSelectMode = u } createRow(v, S, u, m, w, R, L, p) { const C = this._document.createDocumentFragment() , b = this._characterJoinerService.getJoinedCharacters(S); let E = 0; for (let A = Math.min(v.length, p) - 1; A >= 0; A--) if (v.loadCell(A, this._workCell).getCode() !== f.NULL_CELL_CODE || u && A === w) { E = A + 1; break } for (let A = 0; A < E; A++) { v.loadCell(A, this._workCell); let H = this._workCell.getWidth(); if (H === 0) continue; let j = !1 , $ = A , P = this._workCell; if (b.length > 0 && A === b[0][0]) { j = !0; const K = b.shift(); P = new s.JoinedCellData(this._workCell, v.translateToString(!0, K[0], K[1]), K[1] - K[0]), $ = K[1] - 1, H = P.getWidth() } const N = this._document.createElement("span"); if (H > 1 && (N.style.width = L * H + "px"), j && (N.style.display = "inline", w >= A && w <= $ && (w = A)), !this._coreService.isCursorHidden && u && A === w) switch (N.classList.add(r.CURSOR_CLASS), R && N.classList.add(r.CURSOR_BLINK_CLASS), m) { case "bar": N.classList.add(r.CURSOR_STYLE_BAR_CLASS); break; case "underline": N.classList.add(r.CURSOR_STYLE_UNDERLINE_CLASS); break; default: N.classList.add(r.CURSOR_STYLE_BLOCK_CLASS) } if (P.isBold() && N.classList.add(r.BOLD_CLASS), P.isItalic() && N.classList.add(r.ITALIC_CLASS), P.isDim() && N.classList.add(r.DIM_CLASS), P.isInvisible() ? N.textContent = f.WHITESPACE_CELL_CHAR : N.textContent = P.getChars() || f.WHITESPACE_CELL_CHAR, P.isUnderline() && (N.classList.add(`${r.UNDERLINE_CLASS}-${P.extended.underlineStyle}`), N.textContent === " " && (N.innerHTML = " "), !P.isUnderlineColorDefault())) if (P.isUnderlineColorRGB()) N.style.textDecorationColor = `rgb(${i.AttributeData.toColorRGB(P.getUnderlineColor()).join(",")})`; else { let K = P.getUnderlineColor(); this._optionsService.rawOptions.drawBoldTextInBrightColors && P.isBold() && K < 8 && (K += 8), N.style.textDecorationColor = this._colors.ansi[K].css } P.isStrikethrough() && N.classList.add(r.STRIKETHROUGH_CLASS); let y = P.getFgColor() , T = P.getFgColorMode() , O = P.getBgColor() , k = P.getBgColorMode(); const D = !!P.isInverse(); if (D) { const K = y; y = O, O = K; const Z = T; T = k, k = Z } let B, I, F = !1; this._decorationService.forEachDecorationAtCell(A, S, void 0, K => { K.options.layer !== "top" && F || (K.backgroundColorRGB && (k = 50331648, O = K.backgroundColorRGB.rgba >> 8 & 16777215, B = K.backgroundColorRGB), K.foregroundColorRGB && (T = 50331648, y = K.foregroundColorRGB.rgba >> 8 & 16777215, I = K.foregroundColorRGB), F = K.options.layer === "top") } ); const M = this._isCellInSelection(A, S); let X; switch (F || this._colors.selectionForeground && M && (T = 50331648, y = this._colors.selectionForeground.rgba >> 8 & 16777215, I = this._colors.selectionForeground), M && (B = this._coreBrowserService.isFocused ? this._colors.selectionBackgroundOpaque : this._colors.selectionInactiveBackgroundOpaque, F = !0), F && N.classList.add("xterm-decoration-top"), k) { case 16777216: case 33554432: X = this._colors.ansi[O], N.classList.add(`xterm-bg-${O}`); break; case 50331648: X = o.rgba.toColor(O >> 16, O >> 8 & 255, 255 & O), this._addStyle(N, `background-color:#${g((O >>> 0).toString(16), "0", 6)}`); break; default: D ? (X = this._colors.foreground, N.classList.add(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)) : X = this._colors.background } switch (B || P.isDim() && (B = o.color.multiplyOpacity(X, .5)), T) { case 16777216: case 33554432: P.isBold() && y < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors && (y += 8), this._applyMinimumContrast(N, X, this._colors.ansi[y], P, B, void 0) || N.classList.add(`xterm-fg-${y}`); break; case 50331648: const K = o.rgba.toColor(y >> 16 & 255, y >> 8 & 255, 255 & y); this._applyMinimumContrast(N, X, K, P, B, I) || this._addStyle(N, `color:#${g(y.toString(16), "0", 6)}`); break; default: this._applyMinimumContrast(N, X, this._colors.foreground, P, B, void 0) || D && N.classList.add(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`) } C.appendChild(N), A = $ } return C } _applyMinimumContrast(v, S, u, m, w, R) { if (this._optionsService.rawOptions.minimumContrastRatio === 1 || (0, e.excludeFromContrastRatioDemands)(m.getCode())) return !1; let L; return w || R || (L = this._colors.contrastCache.getColor(S.rgba, u.rgba)), L === void 0 && (L = o.color.ensureContrastRatio(w || S, R || u, this._optionsService.rawOptions.minimumContrastRatio), this._colors.contrastCache.setColor((w || S).rgba, (R || u).rgba, L != null ? L : null)), !!L && (this._addStyle(v, `color:${L.css}`), !0) } _addStyle(v, S) { v.setAttribute("style", `${v.getAttribute("style") || ""}${S};`) } _isCellInSelection(v, S) { const u = this._selectionStart , m = this._selectionEnd; return !(!u || !m) && (this._columnSelectMode ? u[0] <= m[0] ? v >= u[0] && S >= u[1] && v < m[0] && S <= m[1] : v < u[0] && S >= u[1] && v >= m[0] && S <= m[1] : S > u[1] && S < m[1] || u[1] === m[1] && S === u[1] && v >= u[0] && v < m[0] || u[1] < m[1] && S === m[1] && v < m[0] || u[1] < m[1] && S === u[1] && v >= u[0]) } } ; function g(v, S, u) { for (; v.length < u;) v = S + v; return v } c = n([_(2, t.ICharacterJoinerService), _(3, l.IOptionsService), _(4, t.ICoreBrowserService), _(5, l.ICoreService), _(6, l.IDecorationService)], c), r.DomRendererRowFactory = c }, 456: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.SelectionModel = void 0, r.SelectionModel = class { constructor(a) { this._bufferService = a, this.isSelectAllActive = !1, this.selectionStartLength = 0 } clearSelection() { this.selectionStart = void 0, this.selectionEnd = void 0, this.isSelectAllActive = !1, this.selectionStartLength = 0 } get finalSelectionStart() { return this.isSelectAllActive ? [0, 0] : this.selectionEnd && this.selectionStart && this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart } get finalSelectionEnd() { if (this.isSelectAllActive) return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1]; if (this.selectionStart) { if (!this.selectionEnd || this.areSelectionValuesReversed()) { const a = this.selectionStart[0] + this.selectionStartLength; return a > this._bufferService.cols ? a % this._bufferService.cols == 0 ? [this._bufferService.cols, this.selectionStart[1] + Math.floor(a / this._bufferService.cols) - 1] : [a % this._bufferService.cols, this.selectionStart[1] + Math.floor(a / this._bufferService.cols)] : [a, this.selectionStart[1]] } if (this.selectionStartLength && this.selectionEnd[1] === this.selectionStart[1]) { const a = this.selectionStart[0] + this.selectionStartLength; return a > this._bufferService.cols ? [a % this._bufferService.cols, this.selectionStart[1] + Math.floor(a / this._bufferService.cols)] : [Math.max(a, this.selectionEnd[0]), this.selectionEnd[1]] } return this.selectionEnd } } areSelectionValuesReversed() { const a = this.selectionStart , n = this.selectionEnd; return !(!a || !n) && (a[1] > n[1] || a[1] === n[1] && a[0] > n[0]) } onTrim(a) { return this.selectionStart && (this.selectionStart[1] -= a), this.selectionEnd && (this.selectionEnd[1] -= a), this.selectionEnd && this.selectionEnd[1] < 0 ? (this.clearSelection(), !0) : (this.selectionStart && this.selectionStart[1] < 0 && (this.selectionStart[1] = 0), !1) } } } , 428: function (x, r, a) { var n = this && this.__decorate || function (o, t, s, e) { var i, c = arguments.length, g = c < 3 ? t : e === null ? e = Object.getOwnPropertyDescriptor(t, s) : e; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") g = Reflect.decorate(o, t, s, e); else for (var v = o.length - 1; v >= 0; v--) (i = o[v]) && (g = (c < 3 ? i(g) : c > 3 ? i(t, s, g) : i(t, s)) || g); return c > 3 && g && Object.defineProperty(t, s, g), g } , _ = this && this.__param || function (o, t) { return function (s, e) { t(s, e, o) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.CharSizeService = void 0; const h = a(2585) , f = a(8460); let d = class { constructor(o, t, s) { this._optionsService = s, this.width = 0, this.height = 0, this._onCharSizeChange = new f.EventEmitter, this._measureStrategy = new l(o, t, this._optionsService) } get hasValidSize() { return this.width > 0 && this.height > 0 } get onCharSizeChange() { return this._onCharSizeChange.event } measure() { const o = this._measureStrategy.measure(); o.width === this.width && o.height === this.height || (this.width = o.width, this.height = o.height, this._onCharSizeChange.fire()) } } ; d = n([_(2, h.IOptionsService)], d), r.CharSizeService = d; class l { constructor(t, s, e) { this._document = t, this._parentElement = s, this._optionsService = e, this._result = { width: 0, height: 0 }, this._measureElement = this._document.createElement("span"), this._measureElement.classList.add("xterm-char-measure-element"), this._measureElement.textContent = "W", this._measureElement.setAttribute("aria-hidden", "true"), this._parentElement.appendChild(this._measureElement) } measure() { this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily, this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`; const t = this._measureElement.getBoundingClientRect(); return t.width !== 0 && t.height !== 0 && (this._result.width = t.width, this._result.height = Math.ceil(t.height)), this._result } } }, 4269: function (x, r, a) { var n = this && this.__decorate || function (s, e, i, c) { var g, v = arguments.length, S = v < 3 ? e : c === null ? c = Object.getOwnPropertyDescriptor(e, i) : c; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") S = Reflect.decorate(s, e, i, c); else for (var u = s.length - 1; u >= 0; u--) (g = s[u]) && (S = (v < 3 ? g(S) : v > 3 ? g(e, i, S) : g(e, i)) || S); return v > 3 && S && Object.defineProperty(e, i, S), S } , _ = this && this.__param || function (s, e) { return function (i, c) { e(i, c, s) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.CharacterJoinerService = r.JoinedCellData = void 0; const h = a(3734) , f = a(643) , d = a(511) , l = a(2585); class o extends h.AttributeData { constructor(e, i, c) { super(), this.content = 0, this.combinedData = "", this.fg = e.fg, this.bg = e.bg, this.combinedData = i, this._width = c } isCombined() { return 2097152 } getWidth() { return this._width } getChars() { return this.combinedData } getCode() { return 2097151 } setFromCharData(e) { throw new Error("not implemented") } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()] } } r.JoinedCellData = o; let t = class be { constructor(e) { this._bufferService = e, this._characterJoiners = [], this._nextCharacterJoinerId = 0, this._workCell = new d.CellData } register(e) { const i = { id: this._nextCharacterJoinerId++, handler: e }; return this._characterJoiners.push(i), i.id } deregister(e) { for (let i = 0; i < this._characterJoiners.length; i++) if (this._characterJoiners[i].id === e) return this._characterJoiners.splice(i, 1), !0; return !1 } getJoinedCharacters(e) { if (this._characterJoiners.length === 0) return []; const i = this._bufferService.buffer.lines.get(e); if (!i || i.length === 0) return []; const c = [] , g = i.translateToString(!0); let v = 0 , S = 0 , u = 0 , m = i.getFg(0) , w = i.getBg(0); for (let R = 0; R < i.getTrimmedLength(); R++) if (i.loadCell(R, this._workCell), this._workCell.getWidth() !== 0) { if (this._workCell.fg !== m || this._workCell.bg !== w) { if (R - v > 1) { const L = this._getJoinedRanges(g, u, S, i, v); for (let p = 0; p < L.length; p++) c.push(L[p]) } v = R, u = S, m = this._workCell.fg, w = this._workCell.bg } S += this._workCell.getChars().length || f.WHITESPACE_CELL_CHAR.length } if (this._bufferService.cols - v > 1) { const R = this._getJoinedRanges(g, u, S, i, v); for (let L = 0; L < R.length; L++) c.push(R[L]) } return c } _getJoinedRanges(e, i, c, g, v) { const S = e.substring(i, c); let u = []; try { u = this._characterJoiners[0].handler(S) } catch (m) { console.error(m) } for (let m = 1; m < this._characterJoiners.length; m++) try { const w = this._characterJoiners[m].handler(S); for (let R = 0; R < w.length; R++) be._mergeRanges(u, w[R]) } catch (w) { console.error(w) } return this._stringRangesToCellRanges(u, g, v), u } _stringRangesToCellRanges(e, i, c) { let g = 0 , v = !1 , S = 0 , u = e[g]; if (u) { for (let m = c; m < this._bufferService.cols; m++) { const w = i.getWidth(m) , R = i.getString(m).length || f.WHITESPACE_CELL_CHAR.length; if (w !== 0) { if (!v && u[0] <= S && (u[0] = m, v = !0), u[1] <= S) { if (u[1] = m, u = e[++g], !u) break; u[0] <= S ? (u[0] = m, v = !0) : v = !1 } S += R } } u && (u[1] = this._bufferService.cols) } } static _mergeRanges(e, i) { let c = !1; for (let g = 0; g < e.length; g++) { const v = e[g]; if (c) { if (i[1] <= v[0]) return e[g - 1][1] = i[1], e; if (i[1] <= v[1]) return e[g - 1][1] = Math.max(i[1], v[1]), e.splice(g, 1), e; e.splice(g, 1), g-- } else { if (i[1] <= v[0]) return e.splice(g, 0, i), e; if (i[1] <= v[1]) return v[0] = Math.min(i[0], v[0]), e; i[0] < v[1] && (v[0] = Math.min(i[0], v[0]), c = !0) } } return c ? e[e.length - 1][1] = i[1] : e.push(i), e } } ; t = n([_(0, l.IBufferService)], t), r.CharacterJoinerService = t }, 5114: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.CoreBrowserService = void 0, r.CoreBrowserService = class { constructor(a, n) { this._textarea = a, this.window = n } get dpr() { return this.window.devicePixelRatio } get isFocused() { return (this._textarea.getRootNode ? this._textarea.getRootNode() : this._textarea.ownerDocument).activeElement === this._textarea && this._textarea.ownerDocument.hasFocus() } } } , 8934: function (x, r, a) { var n = this && this.__decorate || function (l, o, t, s) { var e, i = arguments.length, c = i < 3 ? o : s === null ? s = Object.getOwnPropertyDescriptor(o, t) : s; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(l, o, t, s); else for (var g = l.length - 1; g >= 0; g--) (e = l[g]) && (c = (i < 3 ? e(c) : i > 3 ? e(o, t, c) : e(o, t)) || c); return i > 3 && c && Object.defineProperty(o, t, c), c } , _ = this && this.__param || function (l, o) { return function (t, s) { o(t, s, l) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.MouseService = void 0; const h = a(4725) , f = a(9806); let d = class { constructor(l, o) { this._renderService = l, this._charSizeService = o } getCoords(l, o, t, s, e) { return (0, f.getCoords)(window, l, o, t, s, this._charSizeService.hasValidSize, this._renderService.dimensions.actualCellWidth, this._renderService.dimensions.actualCellHeight, e) } getMouseReportCoords(l, o) { const t = (0, f.getCoordsRelativeToElement)(window, l, o); if (!(!this._charSizeService.hasValidSize || t[0] < 0 || t[1] < 0 || t[0] >= this._renderService.dimensions.canvasWidth || t[1] >= this._renderService.dimensions.canvasHeight)) return { col: Math.floor(t[0] / this._renderService.dimensions.actualCellWidth), row: Math.floor(t[1] / this._renderService.dimensions.actualCellHeight), x: Math.floor(t[0]), y: Math.floor(t[1]) } } } ; d = n([_(0, h.IRenderService), _(1, h.ICharSizeService)], d), r.MouseService = d }, 3230: function (x, r, a) { var n = this && this.__decorate || function (i, c, g, v) { var S, u = arguments.length, m = u < 3 ? c : v === null ? v = Object.getOwnPropertyDescriptor(c, g) : v; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") m = Reflect.decorate(i, c, g, v); else for (var w = i.length - 1; w >= 0; w--) (S = i[w]) && (m = (u < 3 ? S(m) : u > 3 ? S(c, g, m) : S(c, g)) || m); return u > 3 && m && Object.defineProperty(c, g, m), m } , _ = this && this.__param || function (i, c) { return function (g, v) { c(g, v, i) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.RenderService = void 0; const h = a(6193) , f = a(8460) , d = a(844) , l = a(5596) , o = a(3656) , t = a(2585) , s = a(4725); let e = class extends d.Disposable { constructor(i, c, g, v, S, u, m, w) { if (super(), this._renderer = i, this._rowCount = c, this._charSizeService = S, this._isPaused = !1, this._needsFullRefresh = !1, this._isNextRenderRedrawOnly = !0, this._needsSelectionRefresh = !1, this._canvasWidth = 0, this._canvasHeight = 0, this._selectionState = { start: void 0, end: void 0, columnSelectMode: !1 }, this._onDimensionsChange = new f.EventEmitter, this._onRenderedViewportChange = new f.EventEmitter, this._onRender = new f.EventEmitter, this._onRefreshRequest = new f.EventEmitter, this.register({ dispose: () => this._renderer.dispose() }), this._renderDebouncer = new h.RenderDebouncer(w.window, (R, L) => this._renderRows(R, L)), this.register(this._renderDebouncer), this._screenDprMonitor = new l.ScreenDprMonitor(w.window), this._screenDprMonitor.setListener(() => this.onDevicePixelRatioChange()), this.register(this._screenDprMonitor), this.register(m.onResize(() => this._fullRefresh())), this.register(m.buffers.onBufferActivate(() => { var R; return (R = this._renderer) === null || R === void 0 ? void 0 : R.clear() } )), this.register(v.onOptionChange(() => this._handleOptionsChanged())), this.register(this._charSizeService.onCharSizeChange(() => this.onCharSizeChanged())), this.register(u.onDecorationRegistered(() => this._fullRefresh())), this.register(u.onDecorationRemoved(() => this._fullRefresh())), this._renderer.onRequestRedraw(R => this.refreshRows(R.start, R.end, !0)), this.register((0, o.addDisposableDomListener)(w.window, "resize", () => this.onDevicePixelRatioChange())), "IntersectionObserver" in w.window) { const R = new w.window.IntersectionObserver(L => this._onIntersectionChange(L[L.length - 1]), { threshold: 0 }); R.observe(g), this.register({ dispose: () => R.disconnect() }) } } get onDimensionsChange() { return this._onDimensionsChange.event } get onRenderedViewportChange() { return this._onRenderedViewportChange.event } get onRender() { return this._onRender.event } get onRefreshRequest() { return this._onRefreshRequest.event } get dimensions() { return this._renderer.dimensions } _onIntersectionChange(i) { this._isPaused = i.isIntersecting === void 0 ? i.intersectionRatio === 0 : !i.isIntersecting, this._isPaused || this._charSizeService.hasValidSize || this._charSizeService.measure(), !this._isPaused && this._needsFullRefresh && (this.refreshRows(0, this._rowCount - 1), this._needsFullRefresh = !1) } refreshRows(i, c, g = !1) { this._isPaused ? this._needsFullRefresh = !0 : (g || (this._isNextRenderRedrawOnly = !1), this._renderDebouncer.refresh(i, c, this._rowCount)) } _renderRows(i, c) { this._renderer.renderRows(i, c), this._needsSelectionRefresh && (this._renderer.onSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode), this._needsSelectionRefresh = !1), this._isNextRenderRedrawOnly || this._onRenderedViewportChange.fire({ start: i, end: c }), this._onRender.fire({ start: i, end: c }), this._isNextRenderRedrawOnly = !0 } resize(i, c) { this._rowCount = c, this._fireOnCanvasResize() } _handleOptionsChanged() { this._renderer.onOptionsChanged(), this.refreshRows(0, this._rowCount - 1), this._fireOnCanvasResize() } _fireOnCanvasResize() { this._renderer.dimensions.canvasWidth === this._canvasWidth && this._renderer.dimensions.canvasHeight === this._canvasHeight || this._onDimensionsChange.fire(this._renderer.dimensions) } dispose() { super.dispose() } setRenderer(i) { this._renderer.dispose(), this._renderer = i, this._renderer.onRequestRedraw(c => this.refreshRows(c.start, c.end, !0)), this._needsSelectionRefresh = !0, this._fullRefresh() } addRefreshCallback(i) { return this._renderDebouncer.addRefreshCallback(i) } _fullRefresh() { this._isPaused ? this._needsFullRefresh = !0 : this.refreshRows(0, this._rowCount - 1) } clearTextureAtlas() { var i, c; (c = (i = this._renderer) === null || i === void 0 ? void 0 : i.clearTextureAtlas) === null || c === void 0 || c.call(i), this._fullRefresh() } setColors(i) { this._renderer.setColors(i), this._fullRefresh() } onDevicePixelRatioChange() { this._charSizeService.measure(), this._renderer.onDevicePixelRatioChange(), this.refreshRows(0, this._rowCount - 1) } onResize(i, c) { this._renderer.onResize(i, c), this._fullRefresh() } onCharSizeChanged() { this._renderer.onCharSizeChanged() } onBlur() { this._renderer.onBlur() } onFocus() { this._renderer.onFocus() } onSelectionChanged(i, c, g) { this._selectionState.start = i, this._selectionState.end = c, this._selectionState.columnSelectMode = g, this._renderer.onSelectionChanged(i, c, g) } onCursorMove() { this._renderer.onCursorMove() } clear() { this._renderer.clear() } } ; e = n([_(3, t.IOptionsService), _(4, s.ICharSizeService), _(5, t.IDecorationService), _(6, t.IBufferService), _(7, s.ICoreBrowserService)], e), r.RenderService = e }, 9312: function (x, r, a) { var n = this && this.__decorate || function (u, m, w, R) { var L, p = arguments.length, C = p < 3 ? m : R === null ? R = Object.getOwnPropertyDescriptor(m, w) : R; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") C = Reflect.decorate(u, m, w, R); else for (var b = u.length - 1; b >= 0; b--) (L = u[b]) && (C = (p < 3 ? L(C) : p > 3 ? L(m, w, C) : L(m, w)) || C); return p > 3 && C && Object.defineProperty(m, w, C), C } , _ = this && this.__param || function (u, m) { return function (w, R) { m(w, R, u) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.SelectionService = void 0; const h = a(6114) , f = a(456) , d = a(511) , l = a(8460) , o = a(4725) , t = a(2585) , s = a(9806) , e = a(9504) , i = a(844) , c = a(4841) , g = String.fromCharCode(160) , v = new RegExp(g, "g"); let S = class extends i.Disposable { constructor(u, m, w, R, L, p, C, b, E) { super(), this._element = u, this._screenElement = m, this._linkifier = w, this._bufferService = R, this._coreService = L, this._mouseService = p, this._optionsService = C, this._renderService = b, this._coreBrowserService = E, this._dragScrollAmount = 0, this._enabled = !0, this._workCell = new d.CellData, this._mouseDownTimeStamp = 0, this._oldHasSelection = !1, this._oldSelectionStart = void 0, this._oldSelectionEnd = void 0, this._onLinuxMouseSelection = this.register(new l.EventEmitter), this._onRedrawRequest = this.register(new l.EventEmitter), this._onSelectionChange = this.register(new l.EventEmitter), this._onRequestScrollLines = this.register(new l.EventEmitter), this._mouseMoveListener = A => this._onMouseMove(A), this._mouseUpListener = A => this._onMouseUp(A), this._coreService.onUserInput(() => { this.hasSelection && this.clearSelection() } ), this._trimListener = this._bufferService.buffer.lines.onTrim(A => this._onTrim(A)), this.register(this._bufferService.buffers.onBufferActivate(A => this._onBufferActivate(A))), this.enable(), this._model = new f.SelectionModel(this._bufferService), this._activeSelectionMode = 0 } get onLinuxMouseSelection() { return this._onLinuxMouseSelection.event } get onRequestRedraw() { return this._onRedrawRequest.event } get onSelectionChange() { return this._onSelectionChange.event } get onRequestScrollLines() { return this._onRequestScrollLines.event } dispose() { this._removeMouseDownListeners() } reset() { this.clearSelection() } disable() { this.clearSelection(), this._enabled = !1 } enable() { this._enabled = !0 } get selectionStart() { return this._model.finalSelectionStart } get selectionEnd() { return this._model.finalSelectionEnd } get hasSelection() { const u = this._model.finalSelectionStart , m = this._model.finalSelectionEnd; return !(!u || !m || u[0] === m[0] && u[1] === m[1]) } get selectionText() { const u = this._model.finalSelectionStart , m = this._model.finalSelectionEnd; if (!u || !m) return ""; const w = this._bufferService.buffer , R = []; if (this._activeSelectionMode === 3) { if (u[0] === m[0]) return ""; const L = u[0] < m[0] ? u[0] : m[0] , p = u[0] < m[0] ? m[0] : u[0]; for (let C = u[1]; C <= m[1]; C++) { const b = w.translateBufferLineToString(C, !0, L, p); R.push(b) } } else { const L = u[1] === m[1] ? m[0] : void 0; R.push(w.translateBufferLineToString(u[1], !0, u[0], L)); for (let p = u[1] + 1; p <= m[1] - 1; p++) { const C = w.lines.get(p) , b = w.translateBufferLineToString(p, !0); C != null && C.isWrapped ? R[R.length - 1] += b : R.push(b) } if (u[1] !== m[1]) { const p = w.lines.get(m[1]) , C = w.translateBufferLineToString(m[1], !0, 0, m[0]); p && p.isWrapped ? R[R.length - 1] += C : R.push(C) } } return R.map(L => L.replace(v, " ")).join(h.isWindows ? `\r ` : ` `) } clearSelection() { this._model.clearSelection(), this._removeMouseDownListeners(), this.refresh(), this._onSelectionChange.fire() } refresh(u) { this._refreshAnimationFrame || (this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._refresh())), h.isLinux && u && this.selectionText.length && this._onLinuxMouseSelection.fire(this.selectionText) } _refresh() { this._refreshAnimationFrame = void 0, this._onRedrawRequest.fire({ start: this._model.finalSelectionStart, end: this._model.finalSelectionEnd, columnSelectMode: this._activeSelectionMode === 3 }) } _isClickInSelection(u) { const m = this._getMouseBufferCoords(u) , w = this._model.finalSelectionStart , R = this._model.finalSelectionEnd; return !!(w && R && m) && this._areCoordsInSelection(m, w, R) } isCellInSelection(u, m) { const w = this._model.finalSelectionStart , R = this._model.finalSelectionEnd; return !(!w || !R) && this._areCoordsInSelection([u, m], w, R) } _areCoordsInSelection(u, m, w) { return u[1] > m[1] && u[1] < w[1] || m[1] === w[1] && u[1] === m[1] && u[0] >= m[0] && u[0] < w[0] || m[1] < w[1] && u[1] === w[1] && u[0] < w[0] || m[1] < w[1] && u[1] === m[1] && u[0] >= m[0] } _selectWordAtCursor(u, m) { var w, R; const L = (R = (w = this._linkifier.currentLink) === null || w === void 0 ? void 0 : w.link) === null || R === void 0 ? void 0 : R.range; if (L) return this._model.selectionStart = [L.start.x - 1, L.start.y - 1], this._model.selectionStartLength = (0, c.getRangeLength)(L, this._bufferService.cols), this._model.selectionEnd = void 0, !0; const p = this._getMouseBufferCoords(u); return !!p && (this._selectWordAt(p, m), this._model.selectionEnd = void 0, !0) } selectAll() { this._model.isSelectAllActive = !0, this.refresh(), this._onSelectionChange.fire() } selectLines(u, m) { this._model.clearSelection(), u = Math.max(u, 0), m = Math.min(m, this._bufferService.buffer.lines.length - 1), this._model.selectionStart = [0, u], this._model.selectionEnd = [this._bufferService.cols, m], this.refresh(), this._onSelectionChange.fire() } _onTrim(u) { this._model.onTrim(u) && this.refresh() } _getMouseBufferCoords(u) { const m = this._mouseService.getCoords(u, this._screenElement, this._bufferService.cols, this._bufferService.rows, !0); if (m) return m[0]--, m[1]--, m[1] += this._bufferService.buffer.ydisp, m } _getMouseEventScrollAmount(u) { let m = (0, s.getCoordsRelativeToElement)(this._coreBrowserService.window, u, this._screenElement)[1]; const w = this._renderService.dimensions.canvasHeight; return m >= 0 && m <= w ? 0 : (m > w && (m -= w), m = Math.min(Math.max(m, -50), 50), m /= 50, m / Math.abs(m) + Math.round(14 * m)) } shouldForceSelection(u) { return h.isMac ? u.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection : u.shiftKey } onMouseDown(u) { if (this._mouseDownTimeStamp = u.timeStamp, (u.button !== 2 || !this.hasSelection) && u.button === 0) { if (!this._enabled) { if (!this.shouldForceSelection(u)) return; u.stopPropagation() } u.preventDefault(), this._dragScrollAmount = 0, this._enabled && u.shiftKey ? this._onIncrementalClick(u) : u.detail === 1 ? this._onSingleClick(u) : u.detail === 2 ? this._onDoubleClick(u) : u.detail === 3 && this._onTripleClick(u), this._addMouseDownListeners(), this.refresh(!0) } } _addMouseDownListeners() { this._screenElement.ownerDocument && (this._screenElement.ownerDocument.addEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.addEventListener("mouseup", this._mouseUpListener)), this._dragScrollIntervalTimer = this._coreBrowserService.window.setInterval(() => this._dragScroll(), 50) } _removeMouseDownListeners() { this._screenElement.ownerDocument && (this._screenElement.ownerDocument.removeEventListener("mousemove", this._mouseMoveListener), this._screenElement.ownerDocument.removeEventListener("mouseup", this._mouseUpListener)), this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer), this._dragScrollIntervalTimer = void 0 } _onIncrementalClick(u) { this._model.selectionStart && (this._model.selectionEnd = this._getMouseBufferCoords(u)) } _onSingleClick(u) { if (this._model.selectionStartLength = 0, this._model.isSelectAllActive = !1, this._activeSelectionMode = this.shouldColumnSelect(u) ? 3 : 0, this._model.selectionStart = this._getMouseBufferCoords(u), !this._model.selectionStart) return; this._model.selectionEnd = void 0; const m = this._bufferService.buffer.lines.get(this._model.selectionStart[1]); m && m.length !== this._model.selectionStart[0] && m.hasWidth(this._model.selectionStart[0]) === 0 && this._model.selectionStart[0]++ } _onDoubleClick(u) { this._selectWordAtCursor(u, !0) && (this._activeSelectionMode = 1) } _onTripleClick(u) { const m = this._getMouseBufferCoords(u); m && (this._activeSelectionMode = 2, this._selectLineAt(m[1])) } shouldColumnSelect(u) { return u.altKey && !(h.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection) } _onMouseMove(u) { if (u.stopImmediatePropagation(), !this._model.selectionStart) return; const m = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null; if (this._model.selectionEnd = this._getMouseBufferCoords(u), !this._model.selectionEnd) return void this.refresh(!0); this._activeSelectionMode === 2 ? this._model.selectionEnd[1] < this._model.selectionStart[1] ? this._model.selectionEnd[0] = 0 : this._model.selectionEnd[0] = this._bufferService.cols : this._activeSelectionMode === 1 && this._selectToWordAt(this._model.selectionEnd), this._dragScrollAmount = this._getMouseEventScrollAmount(u), this._activeSelectionMode !== 3 && (this._dragScrollAmount > 0 ? this._model.selectionEnd[0] = this._bufferService.cols : this._dragScrollAmount < 0 && (this._model.selectionEnd[0] = 0)); const w = this._bufferService.buffer; if (this._model.selectionEnd[1] < w.lines.length) { const R = w.lines.get(this._model.selectionEnd[1]); R && R.hasWidth(this._model.selectionEnd[0]) === 0 && this._model.selectionEnd[0]++ } m && m[0] === this._model.selectionEnd[0] && m[1] === this._model.selectionEnd[1] || this.refresh(!0) } _dragScroll() { if (this._model.selectionEnd && this._model.selectionStart && this._dragScrollAmount) { this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: !1 }); const u = this._bufferService.buffer; this._dragScrollAmount > 0 ? (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = this._bufferService.cols), this._model.selectionEnd[1] = Math.min(u.ydisp + this._bufferService.rows, u.lines.length - 1)) : (this._activeSelectionMode !== 3 && (this._model.selectionEnd[0] = 0), this._model.selectionEnd[1] = u.ydisp), this.refresh() } } _onMouseUp(u) { const m = u.timeStamp - this._mouseDownTimeStamp; if (this._removeMouseDownListeners(), this.selectionText.length <= 1 && m < 500 && u.altKey && this._optionsService.rawOptions.altClickMovesCursor) { if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) { const w = this._mouseService.getCoords(u, this._element, this._bufferService.cols, this._bufferService.rows, !1); if (w && w[0] !== void 0 && w[1] !== void 0) { const R = (0, e.moveToCellSequence)(w[0] - 1, w[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys); this._coreService.triggerDataEvent(R, !0) } } } else this._fireEventIfSelectionChanged() } _fireEventIfSelectionChanged() { const u = this._model.finalSelectionStart , m = this._model.finalSelectionEnd , w = !(!u || !m || u[0] === m[0] && u[1] === m[1]); w ? u && m && (this._oldSelectionStart && this._oldSelectionEnd && u[0] === this._oldSelectionStart[0] && u[1] === this._oldSelectionStart[1] && m[0] === this._oldSelectionEnd[0] && m[1] === this._oldSelectionEnd[1] || this._fireOnSelectionChange(u, m, w)) : this._oldHasSelection && this._fireOnSelectionChange(u, m, w) } _fireOnSelectionChange(u, m, w) { this._oldSelectionStart = u, this._oldSelectionEnd = m, this._oldHasSelection = w, this._onSelectionChange.fire() } _onBufferActivate(u) { this.clearSelection(), this._trimListener.dispose(), this._trimListener = u.activeBuffer.lines.onTrim(m => this._onTrim(m)) } _convertViewportColToCharacterIndex(u, m) { let w = m[0]; for (let R = 0; m[0] >= R; R++) { const L = u.loadCell(R, this._workCell).getChars().length; this._workCell.getWidth() === 0 ? w-- : L > 1 && m[0] !== R && (w += L - 1) } return w } setSelection(u, m, w) { this._model.clearSelection(), this._removeMouseDownListeners(), this._model.selectionStart = [u, m], this._model.selectionStartLength = w, this.refresh(), this._fireEventIfSelectionChanged() } rightClickSelect(u) { this._isClickInSelection(u) || (this._selectWordAtCursor(u, !1) && this.refresh(!0), this._fireEventIfSelectionChanged()) } _getWordAt(u, m, w = !0, R = !0) { if (u[0] >= this._bufferService.cols) return; const L = this._bufferService.buffer , p = L.lines.get(u[1]); if (!p) return; const C = L.translateBufferLineToString(u[1], !1); let b = this._convertViewportColToCharacterIndex(p, u) , E = b; const A = u[0] - b; let H = 0 , j = 0 , $ = 0 , P = 0; if (C.charAt(b) === " ") { for (; b > 0 && C.charAt(b - 1) === " ";) b--; for (; E < C.length && C.charAt(E + 1) === " ";) E++ } else { let T = u[0] , O = u[0]; p.getWidth(T) === 0 && (H++, T--), p.getWidth(O) === 2 && (j++, O++); const k = p.getString(O).length; for (k > 1 && (P += k - 1, E += k - 1); T > 0 && b > 0 && !this._isCharWordSeparator(p.loadCell(T - 1, this._workCell));) { p.loadCell(T - 1, this._workCell); const D = this._workCell.getChars().length; this._workCell.getWidth() === 0 ? (H++, T--) : D > 1 && ($ += D - 1, b -= D - 1), b--, T-- } for (; O < p.length && E + 1 < C.length && !this._isCharWordSeparator(p.loadCell(O + 1, this._workCell));) { p.loadCell(O + 1, this._workCell); const D = this._workCell.getChars().length; this._workCell.getWidth() === 2 ? (j++, O++) : D > 1 && (P += D - 1, E += D - 1), E++, O++ } } E++; let N = b + A - H + $ , y = Math.min(this._bufferService.cols, E - b + H + j - $ - P); if (m || C.slice(b, E).trim() !== "") { if (w && N === 0 && p.getCodePoint(0) !== 32) { const T = L.lines.get(u[1] - 1); if (T && p.isWrapped && T.getCodePoint(this._bufferService.cols - 1) !== 32) { const O = this._getWordAt([this._bufferService.cols - 1, u[1] - 1], !1, !0, !1); if (O) { const k = this._bufferService.cols - O.start; N -= k, y += k } } } if (R && N + y === this._bufferService.cols && p.getCodePoint(this._bufferService.cols - 1) !== 32) { const T = L.lines.get(u[1] + 1); if ((T == null ? void 0 : T.isWrapped) && T.getCodePoint(0) !== 32) { const O = this._getWordAt([0, u[1] + 1], !1, !1, !0); O && (y += O.length) } } return { start: N, length: y } } } _selectWordAt(u, m) { const w = this._getWordAt(u, m); if (w) { for (; w.start < 0;) w.start += this._bufferService.cols, u[1]--; this._model.selectionStart = [w.start, u[1]], this._model.selectionStartLength = w.length } } _selectToWordAt(u) { const m = this._getWordAt(u, !0); if (m) { let w = u[1]; for (; m.start < 0;) m.start += this._bufferService.cols, w--; if (!this._model.areSelectionValuesReversed()) for (; m.start + m.length > this._bufferService.cols;) m.length -= this._bufferService.cols, w++; this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? m.start : m.start + m.length, w] } } _isCharWordSeparator(u) { return u.getWidth() !== 0 && this._optionsService.rawOptions.wordSeparator.indexOf(u.getChars()) >= 0 } _selectLineAt(u) { const m = this._bufferService.buffer.getWrappedRangeForLine(u) , w = { start: { x: 0, y: m.first }, end: { x: this._bufferService.cols - 1, y: m.last } }; this._model.selectionStart = [0, m.first], this._model.selectionEnd = void 0, this._model.selectionStartLength = (0, c.getRangeLength)(w, this._bufferService.cols) } } ; S = n([_(3, t.IBufferService), _(4, t.ICoreService), _(5, o.IMouseService), _(6, t.IOptionsService), _(7, o.IRenderService), _(8, o.ICoreBrowserService)], S), r.SelectionService = S }, 4725: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ICharacterJoinerService = r.ISelectionService = r.IRenderService = r.IMouseService = r.ICoreBrowserService = r.ICharSizeService = void 0; const n = a(8343); r.ICharSizeService = (0, n.createDecorator)("CharSizeService"), r.ICoreBrowserService = (0, n.createDecorator)("CoreBrowserService"), r.IMouseService = (0, n.createDecorator)("MouseService"), r.IRenderService = (0, n.createDecorator)("RenderService"), r.ISelectionService = (0, n.createDecorator)("SelectionService"), r.ICharacterJoinerService = (0, n.createDecorator)("CharacterJoinerService") } , 6349: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.CircularList = void 0; const n = a(8460); r.CircularList = class { constructor(_) { this._maxLength = _, this.onDeleteEmitter = new n.EventEmitter, this.onInsertEmitter = new n.EventEmitter, this.onTrimEmitter = new n.EventEmitter, this._array = new Array(this._maxLength), this._startIndex = 0, this._length = 0 } get onDelete() { return this.onDeleteEmitter.event } get onInsert() { return this.onInsertEmitter.event } get onTrim() { return this.onTrimEmitter.event } get maxLength() { return this._maxLength } set maxLength(_) { if (this._maxLength === _) return; const h = new Array(_); for (let f = 0; f < Math.min(_, this.length); f++) h[f] = this._array[this._getCyclicIndex(f)]; this._array = h, this._maxLength = _, this._startIndex = 0 } get length() { return this._length } set length(_) { if (_ > this._length) for (let h = this._length; h < _; h++) this._array[h] = void 0; this._length = _ } get(_) { return this._array[this._getCyclicIndex(_)] } set(_, h) { this._array[this._getCyclicIndex(_)] = h } 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(_, h, ...f) { if (h) { for (let d = _; d < this._length - h; d++) this._array[this._getCyclicIndex(d)] = this._array[this._getCyclicIndex(d + h)]; this._length -= h, this.onDeleteEmitter.fire({ index: _, amount: h }) } for (let d = this._length - 1; d >= _; d--) this._array[this._getCyclicIndex(d + f.length)] = this._array[this._getCyclicIndex(d)]; for (let d = 0; d < f.length; d++) this._array[this._getCyclicIndex(_ + d)] = f[d]; if (f.length && this.onInsertEmitter.fire({ index: _, amount: f.length }), this._length + f.length > this._maxLength) { const d = this._length + f.length - this._maxLength; this._startIndex += d, this._length = this._maxLength, this.onTrimEmitter.fire(d) } else this._length += f.length } trimStart(_) { _ > this._length && (_ = this._length), this._startIndex += _, this._length -= _, this.onTrimEmitter.fire(_) } shiftElements(_, h, f) { if (!(h <= 0)) { if (_ < 0 || _ >= this._length) throw new Error("start argument out of range"); if (_ + f < 0) throw new Error("Cannot shift elements in list beyond index 0"); if (f > 0) { for (let l = h - 1; l >= 0; l--) this.set(_ + l + f, this.get(_ + l)); const d = _ + h + f - this._length; if (d > 0) for (this._length += d; this._length > this._maxLength;) this._length--, this._startIndex++, this.onTrimEmitter.fire(1) } else for (let d = 0; d < h; d++) this.set(_ + d + f, this.get(_ + d)) } } _getCyclicIndex(_) { return (this._startIndex + _) % this._maxLength } } } , 1439: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.clone = void 0, r.clone = function a(n, _ = 5) { if (typeof n != "object") return n; const h = Array.isArray(n) ? [] : {}; for (const f in n) h[f] = _ <= 1 ? n[f] : n[f] && a(n[f], _ - 1); return h } } , 8055: (x, r) => { var a, n, _; function h(d) { const l = d.toString(16); return l.length < 2 ? "0" + l : l } function f(d, l) { return d < l ? (l + .05) / (d + .05) : (d + .05) / (l + .05) } Object.defineProperty(r, "__esModule", { value: !0 }), r.contrastRatio = r.toPaddedHex = r.rgba = r.rgb = r.css = r.color = r.channels = void 0, function (d) { d.toCss = function (l, o, t, s) { return s !== void 0 ? `#${h(l)}${h(o)}${h(t)}${h(s)}` : `#${h(l)}${h(o)}${h(t)}` } , d.toRgba = function (l, o, t, s = 255) { return (l << 24 | o << 16 | t << 8 | s) >>> 0 } }(a = r.channels || (r.channels = {})), function (d) { function l(o, t) { const s = Math.round(255 * t) , [e, i, c] = _.toChannels(o.rgba); return { css: a.toCss(e, i, c, s), rgba: a.toRgba(e, i, c, s) } } d.blend = function (o, t) { const s = (255 & t.rgba) / 255; if (s === 1) return { css: t.css, rgba: t.rgba }; const e = t.rgba >> 24 & 255 , i = t.rgba >> 16 & 255 , c = t.rgba >> 8 & 255 , g = o.rgba >> 24 & 255 , v = o.rgba >> 16 & 255 , S = o.rgba >> 8 & 255 , u = g + Math.round((e - g) * s) , m = v + Math.round((i - v) * s) , w = S + Math.round((c - S) * s); return { css: a.toCss(u, m, w), rgba: a.toRgba(u, m, w) } } , d.isOpaque = function (o) { return (255 & o.rgba) == 255 } , d.ensureContrastRatio = function (o, t, s) { const e = _.ensureContrastRatio(o.rgba, t.rgba, s); if (e) return _.toColor(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255) } , d.opaque = function (o) { const t = (255 | o.rgba) >>> 0 , [s, e, i] = _.toChannels(t); return { css: a.toCss(s, e, i), rgba: t } } , d.opacity = l, d.multiplyOpacity = function (o, t) { return l(o, (255 & o.rgba) * t / 255) } , d.toColorRGB = function (o) { return [o.rgba >> 24 & 255, o.rgba >> 16 & 255, o.rgba >> 8 & 255] } }(r.color || (r.color = {})), (r.css || (r.css = {})).toColor = function (d) { if (d.match(/#[0-9a-f]{3,8}/i)) switch (d.length) { case 4: { const o = parseInt(d.slice(1, 2).repeat(2), 16) , t = parseInt(d.slice(2, 3).repeat(2), 16) , s = parseInt(d.slice(3, 4).repeat(2), 16); return _.toColor(o, t, s) } case 5: { const o = parseInt(d.slice(1, 2).repeat(2), 16) , t = parseInt(d.slice(2, 3).repeat(2), 16) , s = parseInt(d.slice(3, 4).repeat(2), 16) , e = parseInt(d.slice(4, 5).repeat(2), 16); return _.toColor(o, t, s, e) } case 7: return { css: d, rgba: (parseInt(d.slice(1), 16) << 8 | 255) >>> 0 }; case 9: return { css: d, rgba: parseInt(d.slice(1), 16) >>> 0 } } const l = d.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/); if (l) { const o = parseInt(l[1]) , t = parseInt(l[2]) , s = parseInt(l[3]) , e = Math.round(255 * (l[5] === void 0 ? 1 : parseFloat(l[5]))); return _.toColor(o, t, s, e) } throw new Error("css.toColor: Unsupported css format") } , function (d) { function l(o, t, s) { const e = o / 255 , i = t / 255 , c = s / 255; return .2126 * (e <= .03928 ? e / 12.92 : Math.pow((e + .055) / 1.055, 2.4)) + .7152 * (i <= .03928 ? i / 12.92 : Math.pow((i + .055) / 1.055, 2.4)) + .0722 * (c <= .03928 ? c / 12.92 : Math.pow((c + .055) / 1.055, 2.4)) } d.relativeLuminance = function (o) { return l(o >> 16 & 255, o >> 8 & 255, 255 & o) } , d.relativeLuminance2 = l }(n = r.rgb || (r.rgb = {})), function (d) { function l(t, s, e) { const i = t >> 24 & 255 , c = t >> 16 & 255 , g = t >> 8 & 255; let v = s >> 24 & 255 , S = s >> 16 & 255 , u = s >> 8 & 255 , m = f(n.relativeLuminance2(v, S, u), n.relativeLuminance2(i, c, g)); for (; m < e && (v > 0 || S > 0 || u > 0);) v -= Math.max(0, Math.ceil(.1 * v)), S -= Math.max(0, Math.ceil(.1 * S)), u -= Math.max(0, Math.ceil(.1 * u)), m = f(n.relativeLuminance2(v, S, u), n.relativeLuminance2(i, c, g)); return (v << 24 | S << 16 | u << 8 | 255) >>> 0 } function o(t, s, e) { const i = t >> 24 & 255 , c = t >> 16 & 255 , g = t >> 8 & 255; let v = s >> 24 & 255 , S = s >> 16 & 255 , u = s >> 8 & 255 , m = f(n.relativeLuminance2(v, S, u), n.relativeLuminance2(i, c, g)); for (; m < e && (v < 255 || S < 255 || u < 255);) v = Math.min(255, v + Math.ceil(.1 * (255 - v))), S = Math.min(255, S + Math.ceil(.1 * (255 - S))), u = Math.min(255, u + Math.ceil(.1 * (255 - u))), m = f(n.relativeLuminance2(v, S, u), n.relativeLuminance2(i, c, g)); return (v << 24 | S << 16 | u << 8 | 255) >>> 0 } d.ensureContrastRatio = function (t, s, e) { const i = n.relativeLuminance(t >> 8) , c = n.relativeLuminance(s >> 8); if (f(i, c) < e) { if (c < i) { const S = l(t, s, e) , u = f(i, n.relativeLuminance(S >> 8)); if (u < e) { const m = o(t, s, e); return u > f(i, n.relativeLuminance(m >> 8)) ? S : m } return S } const g = o(t, s, e) , v = f(i, n.relativeLuminance(g >> 8)); if (v < e) { const S = l(t, s, e); return v > f(i, n.relativeLuminance(S >> 8)) ? g : S } return g } } , d.reduceLuminance = l, d.increaseLuminance = o, d.toChannels = function (t) { return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t] } , d.toColor = function (t, s, e, i) { return { css: a.toCss(t, s, e, i), rgba: a.toRgba(t, s, e, i) } } }(_ = r.rgba || (r.rgba = {})), r.toPaddedHex = h, r.contrastRatio = f } , 8969: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.CoreTerminal = void 0; const n = a(844) , _ = a(2585) , h = a(4348) , f = a(7866) , d = a(744) , l = a(7302) , o = a(6975) , t = a(8460) , s = a(1753) , e = a(3730) , i = a(1480) , c = a(7994) , g = a(9282) , v = a(5435) , S = a(5981) , u = a(2660); let m = !1; class w extends n.Disposable { constructor(L) { super(), this._onBinary = new t.EventEmitter, this._onData = new t.EventEmitter, this._onLineFeed = new t.EventEmitter, this._onResize = new t.EventEmitter, this._onScroll = new t.EventEmitter, this._onWriteParsed = new t.EventEmitter, this._instantiationService = new h.InstantiationService, this.optionsService = new l.OptionsService(L), this._instantiationService.setService(_.IOptionsService, this.optionsService), this._bufferService = this.register(this._instantiationService.createInstance(d.BufferService)), this._instantiationService.setService(_.IBufferService, this._bufferService), this._logService = this._instantiationService.createInstance(f.LogService), this._instantiationService.setService(_.ILogService, this._logService), this.coreService = this.register(this._instantiationService.createInstance(o.CoreService, () => this.scrollToBottom())), this._instantiationService.setService(_.ICoreService, this.coreService), this.coreMouseService = this._instantiationService.createInstance(s.CoreMouseService), this._instantiationService.setService(_.ICoreMouseService, this.coreMouseService), this._dirtyRowService = this._instantiationService.createInstance(e.DirtyRowService), this._instantiationService.setService(_.IDirtyRowService, this._dirtyRowService), this.unicodeService = this._instantiationService.createInstance(i.UnicodeService), this._instantiationService.setService(_.IUnicodeService, this.unicodeService), this._charsetService = this._instantiationService.createInstance(c.CharsetService), this._instantiationService.setService(_.ICharsetService, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(u.OscLinkService), this._instantiationService.setService(_.IOscLinkService, this._oscLinkService), this._inputHandler = new v.InputHandler(this._bufferService, this._charsetService, this.coreService, this._dirtyRowService, 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.optionsService.onOptionChange(p => this._updateOptions(p))), this.register(this._bufferService.onScroll(p => { this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom) } )), this.register(this._inputHandler.onScroll(p => { this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom) } )), this._writeBuffer = new S.WriteBuffer((p, C) => this._inputHandler.parse(p, C)), this.register((0, t.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed)) } get onBinary() { return this._onBinary.event } get onData() { return this._onData.event } get onLineFeed() { return this._onLineFeed.event } get onResize() { return this._onResize.event } get onWriteParsed() { return this._onWriteParsed.event } get onScroll() { return this._onScrollApi || (this._onScrollApi = new t.EventEmitter, this.register(this._onScroll.event(L => { var p; (p = this._onScrollApi) === null || p === void 0 || p.fire(L.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(L) { for (const p in L) this.optionsService.options[p] = L[p] } dispose() { var L; this._isDisposed || (super.dispose(), (L = this._windowsMode) === null || L === void 0 || L.dispose(), this._windowsMode = void 0) } write(L, p) { this._writeBuffer.write(L, p) } writeSync(L, p) { this._logService.logLevel <= _.LogLevelEnum.WARN && !m && (this._logService.warn("writeSync is unreliable and will be removed soon."), m = !0), this._writeBuffer.writeSync(L, p) } resize(L, p) { isNaN(L) || isNaN(p) || (L = Math.max(L, d.MINIMUM_COLS), p = Math.max(p, d.MINIMUM_ROWS), this._bufferService.resize(L, p)) } scroll(L, p = !1) { this._bufferService.scroll(L, p) } scrollLines(L, p, C) { this._bufferService.scrollLines(L, p, C) } scrollPages(L) { this._bufferService.scrollPages(L) } scrollToTop() { this._bufferService.scrollToTop() } scrollToBottom() { this._bufferService.scrollToBottom() } scrollToLine(L) { this._bufferService.scrollToLine(L) } registerEscHandler(L, p) { return this._inputHandler.registerEscHandler(L, p) } registerDcsHandler(L, p) { return this._inputHandler.registerDcsHandler(L, p) } registerCsiHandler(L, p) { return this._inputHandler.registerCsiHandler(L, p) } registerOscHandler(L, p) { return this._inputHandler.registerOscHandler(L, p) } _setup() { this.optionsService.rawOptions.windowsMode && this._enableWindowsMode() } reset() { this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset() } _updateOptions(L) { var p; switch (L) { case "scrollback": this.buffers.resize(this.cols, this.rows); break; case "windowsMode": this.optionsService.rawOptions.windowsMode ? this._enableWindowsMode() : ((p = this._windowsMode) === null || p === void 0 || p.dispose(), this._windowsMode = void 0) } } _enableWindowsMode() { if (!this._windowsMode) { const L = []; L.push(this.onLineFeed(g.updateWindowsModeWrappedState.bind(null, this._bufferService))), L.push(this.registerCsiHandler({ final: "H" }, () => ((0, g.updateWindowsModeWrappedState)(this._bufferService), !1))), this._windowsMode = { dispose: () => { for (const p of L) p.dispose() } } } } } r.CoreTerminal = w } , 8460: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.forwardEvent = r.EventEmitter = void 0, r.EventEmitter = class { constructor() { this._listeners = [], this._disposed = !1 } get event() { return this._event || (this._event = a => (this._listeners.push(a), { dispose: () => { if (!this._disposed) { for (let n = 0; n < this._listeners.length; n++) if (this._listeners[n] === a) return void this._listeners.splice(n, 1) } } })), this._event } fire(a, n) { const _ = []; for (let h = 0; h < this._listeners.length; h++) _.push(this._listeners[h]); for (let h = 0; h < _.length; h++) _[h].call(void 0, a, n) } dispose() { this._listeners && (this._listeners.length = 0), this._disposed = !0 } } , r.forwardEvent = function (a, n) { return a(_ => n.fire(_)) } } , 5435: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.InputHandler = r.WindowsOptionsReportType = void 0; const n = a(2584) , _ = a(7116) , h = a(2015) , f = a(844) , d = a(482) , l = a(8437) , o = a(8460) , t = a(643) , s = a(511) , e = a(3734) , i = a(2585) , c = a(6242) , g = a(6351) , v = a(5941) , S = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 } , u = 131072; function m(L, p) { if (L > 24) return p.setWinLines || !1; switch (L) { case 1: return !!p.restoreWin; case 2: return !!p.minimizeWin; case 3: return !!p.setWinPosition; case 4: return !!p.setWinSizePixels; case 5: return !!p.raiseWin; case 6: return !!p.lowerWin; case 7: return !!p.refreshWin; case 8: return !!p.setWinSizeChars; case 9: return !!p.maximizeWin; case 10: return !!p.fullscreenWin; case 11: return !!p.getWinState; case 13: return !!p.getWinPosition; case 14: return !!p.getWinSizePixels; case 15: return !!p.getScreenSizePixels; case 16: return !!p.getCellSizePixels; case 18: return !!p.getWinSizeChars; case 19: return !!p.getScreenSizeChars; case 20: return !!p.getIconTitle; case 21: return !!p.getWinTitle; case 22: return !!p.pushTitle; case 23: return !!p.popTitle; case 24: return !!p.setWinLines } return !1 } var w; (function (L) { L[L.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", L[L.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS" } )(w = r.WindowsOptionsReportType || (r.WindowsOptionsReportType = {})); class R extends f.Disposable { constructor(p, C, b, E, A, H, j, $, P, N = new h.EscapeSequenceParser) { super(), this._bufferService = p, this._charsetService = C, this._coreService = b, this._dirtyRowService = E, this._logService = A, this._optionsService = H, this._oscLinkService = j, this._coreMouseService = $, this._unicodeService = P, this._parser = N, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new d.StringToUtf32, this._utf8Decoder = new d.Utf8ToUtf32, this._workCell = new s.CellData, this._windowTitle = "", this._iconName = "", this._windowTitleStack = [], this._iconNameStack = [], this._curAttrData = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone(), this._onRequestBell = new o.EventEmitter, this._onRequestRefreshRows = new o.EventEmitter, this._onRequestReset = new o.EventEmitter, this._onRequestSendFocus = new o.EventEmitter, this._onRequestSyncScrollBar = new o.EventEmitter, this._onRequestWindowsOptionsReport = new o.EventEmitter, this._onA11yChar = new o.EventEmitter, this._onA11yTab = new o.EventEmitter, this._onCursorMove = new o.EventEmitter, this._onLineFeed = new o.EventEmitter, this._onScroll = new o.EventEmitter, this._onTitleChange = new o.EventEmitter, this._onColor = new o.EventEmitter, this._parseStack = { paused: !1, cursorStartX: 0, cursorStartY: 0, decodedLength: 0, position: 0 }, this._specialColors = [256, 257, 258], this.register(this._parser), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate(y => this._activeBuffer = y.activeBuffer)), this._parser.setCsiHandlerFallback((y, T) => { this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(y), params: T.toArray() }) } ), this._parser.setEscHandlerFallback(y => { this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(y) }) } ), this._parser.setExecuteHandlerFallback(y => { this._logService.debug("Unknown EXECUTE code: ", { code: y }) } ), this._parser.setOscHandlerFallback((y, T, O) => { this._logService.debug("Unknown OSC code: ", { identifier: y, action: T, data: O }) } ), this._parser.setDcsHandlerFallback((y, T, O) => { T === "HOOK" && (O = O.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(y), action: T, payload: O }) } ), this._parser.setPrintHandler((y, T, O) => this.print(y, T, O)), this._parser.registerCsiHandler({ final: "@" }, y => this.insertChars(y)), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, y => this.scrollLeft(y)), this._parser.registerCsiHandler({ final: "A" }, y => this.cursorUp(y)), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, y => this.scrollRight(y)), this._parser.registerCsiHandler({ final: "B" }, y => this.cursorDown(y)), this._parser.registerCsiHandler({ final: "C" }, y => this.cursorForward(y)), this._parser.registerCsiHandler({ final: "D" }, y => this.cursorBackward(y)), this._parser.registerCsiHandler({ final: "E" }, y => this.cursorNextLine(y)), this._parser.registerCsiHandler({ final: "F" }, y => this.cursorPrecedingLine(y)), this._parser.registerCsiHandler({ final: "G" }, y => this.cursorCharAbsolute(y)), this._parser.registerCsiHandler({ final: "H" }, y => this.cursorPosition(y)), this._parser.registerCsiHandler({ final: "I" }, y => this.cursorForwardTab(y)), this._parser.registerCsiHandler({ final: "J" }, y => this.eraseInDisplay(y, !1)), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, y => this.eraseInDisplay(y, !0)), this._parser.registerCsiHandler({ final: "K" }, y => this.eraseInLine(y, !1)), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, y => this.eraseInLine(y, !0)), this._parser.registerCsiHandler({ final: "L" }, y => this.insertLines(y)), this._parser.registerCsiHandler({ final: "M" }, y => this.deleteLines(y)), this._parser.registerCsiHandler({ final: "P" }, y => this.deleteChars(y)), this._parser.registerCsiHandler({ final: "S" }, y => this.scrollUp(y)), this._parser.registerCsiHandler({ final: "T" }, y => this.scrollDown(y)), this._parser.registerCsiHandler({ final: "X" }, y => this.eraseChars(y)), this._parser.registerCsiHandler({ final: "Z" }, y => this.cursorBackwardTab(y)), this._parser.registerCsiHandler({ final: "`" }, y => this.charPosAbsolute(y)), this._parser.registerCsiHandler({ final: "a" }, y => this.hPositionRelative(y)), this._parser.registerCsiHandler({ final: "b" }, y => this.repeatPrecedingCharacter(y)), this._parser.registerCsiHandler({ final: "c" }, y => this.sendDeviceAttributesPrimary(y)), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, y => this.sendDeviceAttributesSecondary(y)), this._parser.registerCsiHandler({ final: "d" }, y => this.linePosAbsolute(y)), this._parser.registerCsiHandler({ final: "e" }, y => this.vPositionRelative(y)), this._parser.registerCsiHandler({ final: "f" }, y => this.hVPosition(y)), this._parser.registerCsiHandler({ final: "g" }, y => this.tabClear(y)), this._parser.registerCsiHandler({ final: "h" }, y => this.setMode(y)), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, y => this.setModePrivate(y)), this._parser.registerCsiHandler({ final: "l" }, y => this.resetMode(y)), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, y => this.resetModePrivate(y)), this._parser.registerCsiHandler({ final: "m" }, y => this.charAttributes(y)), this._parser.registerCsiHandler({ final: "n" }, y => this.deviceStatus(y)), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, y => this.deviceStatusPrivate(y)), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, y => this.softReset(y)), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, y => this.setCursorStyle(y)), this._parser.registerCsiHandler({ final: "r" }, y => this.setScrollRegion(y)), this._parser.registerCsiHandler({ final: "s" }, y => this.saveCursor(y)), this._parser.registerCsiHandler({ final: "t" }, y => this.windowOptions(y)), this._parser.registerCsiHandler({ final: "u" }, y => this.restoreCursor(y)), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, y => this.insertColumns(y)), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, y => this.deleteColumns(y)), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, y => this.selectProtected(y)), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, y => this.requestMode(y, !0)), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, y => this.requestMode(y, !1)), this._parser.setExecuteHandler(n.C0.BEL, () => this.bell()), this._parser.setExecuteHandler(n.C0.LF, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.VT, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.FF, () => this.lineFeed()), this._parser.setExecuteHandler(n.C0.CR, () => this.carriageReturn()), this._parser.setExecuteHandler(n.C0.BS, () => this.backspace()), this._parser.setExecuteHandler(n.C0.HT, () => this.tab()), this._parser.setExecuteHandler(n.C0.SO, () => this.shiftOut()), this._parser.setExecuteHandler(n.C0.SI, () => this.shiftIn()), this._parser.setExecuteHandler(n.C1.IND, () => this.index()), this._parser.setExecuteHandler(n.C1.NEL, () => this.nextLine()), this._parser.setExecuteHandler(n.C1.HTS, () => this.tabSet()), this._parser.registerOscHandler(0, new c.OscHandler(y => (this.setTitle(y), this.setIconName(y), !0))), this._parser.registerOscHandler(1, new c.OscHandler(y => this.setIconName(y))), this._parser.registerOscHandler(2, new c.OscHandler(y => this.setTitle(y))), this._parser.registerOscHandler(4, new c.OscHandler(y => this.setOrReportIndexedColor(y))), this._parser.registerOscHandler(8, new c.OscHandler(y => this.setHyperlink(y))), this._parser.registerOscHandler(10, new c.OscHandler(y => this.setOrReportFgColor(y))), this._parser.registerOscHandler(11, new c.OscHandler(y => this.setOrReportBgColor(y))), this._parser.registerOscHandler(12, new c.OscHandler(y => this.setOrReportCursorColor(y))), this._parser.registerOscHandler(104, new c.OscHandler(y => this.restoreIndexedColor(y))), this._parser.registerOscHandler(110, new c.OscHandler(y => this.restoreFgColor(y))), this._parser.registerOscHandler(111, new c.OscHandler(y => this.restoreBgColor(y))), this._parser.registerOscHandler(112, new c.OscHandler(y => this.restoreCursorColor(y))), 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 y in _.CHARSETS) this._parser.registerEscHandler({ intermediates: "(", final: y }, () => this.selectCharset("(" + y)), this._parser.registerEscHandler({ intermediates: ")", final: y }, () => this.selectCharset(")" + y)), this._parser.registerEscHandler({ intermediates: "*", final: y }, () => this.selectCharset("*" + y)), this._parser.registerEscHandler({ intermediates: "+", final: y }, () => this.selectCharset("+" + y)), this._parser.registerEscHandler({ intermediates: "-", final: y }, () => this.selectCharset("-" + y)), this._parser.registerEscHandler({ intermediates: ".", final: y }, () => this.selectCharset("." + y)), this._parser.registerEscHandler({ intermediates: "/", final: y }, () => this.selectCharset("/" + y)); this._parser.registerEscHandler({ intermediates: "#", final: "8" }, () => this.screenAlignmentPattern()), this._parser.setErrorHandler(y => (this._logService.error("Parsing error: ", y), y)), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new g.DcsHandler((y, T) => this.requestStatusString(y, T))) } getAttrData() { return this._curAttrData } get onRequestBell() { return this._onRequestBell.event } get onRequestRefreshRows() { return this._onRequestRefreshRows.event } get onRequestReset() { return this._onRequestReset.event } get onRequestSendFocus() { return this._onRequestSendFocus.event } get onRequestSyncScrollBar() { return this._onRequestSyncScrollBar.event } get onRequestWindowsOptionsReport() { return this._onRequestWindowsOptionsReport.event } get onA11yChar() { return this._onA11yChar.event } get onA11yTab() { return this._onA11yTab.event } get onCursorMove() { return this._onCursorMove.event } get onLineFeed() { return this._onLineFeed.event } get onScroll() { return this._onScroll.event } get onTitleChange() { return this._onTitleChange.event } get onColor() { return this._onColor.event } dispose() { super.dispose() } _preserveStack(p, C, b, E) { this._parseStack.paused = !0, this._parseStack.cursorStartX = p, this._parseStack.cursorStartY = C, this._parseStack.decodedLength = b, this._parseStack.position = E } _logSlowResolvingAsync(p) { this._logService.logLevel <= i.LogLevelEnum.WARN && Promise.race([p, new Promise((C, b) => setTimeout(() => b("#SLOW_TIMEOUT"), 5e3))]).catch(C => { if (C !== "#SLOW_TIMEOUT") throw C; console.warn("async parser handler taking longer than 5000 ms") } ) } parse(p, C) { let b, E = this._activeBuffer.x, A = this._activeBuffer.y, H = 0; const j = this._parseStack.paused; if (j) { if (b = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, C)) return this._logSlowResolvingAsync(b), b; E = this._parseStack.cursorStartX, A = this._parseStack.cursorStartY, this._parseStack.paused = !1, p.length > u && (H = this._parseStack.position + u) } if (this._logService.logLevel <= i.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof p == "string" ? ` "${p}"` : ` "${Array.prototype.map.call(p, $ => String.fromCharCode($)).join("")}"`), typeof p == "string" ? p.split("").map($ => $.charCodeAt(0)) : p), this._parseBuffer.length < p.length && this._parseBuffer.length < u && (this._parseBuffer = new Uint32Array(Math.min(p.length, u))), j || this._dirtyRowService.clearRange(), p.length > u) for (let$ = H; $ < p.length; $ += u) { const P = $ + u < p.length ? $ + u : p.length , N = typeof p == "string" ? this._stringDecoder.decode(p.substring($, P), this._parseBuffer) : this._utf8Decoder.decode(p.subarray($, P), this._parseBuffer); if (b = this._parser.parse(this._parseBuffer, N)) return this._preserveStack(E, A, N, $), this._logSlowResolvingAsync(b), b } else if (!j) { const $ = typeof p == "string" ? this._stringDecoder.decode(p, this._parseBuffer) : this._utf8Decoder.decode(p, this._parseBuffer); if (b = this._parser.parse(this._parseBuffer, $)) return this._preserveStack(E, A, $, 0), this._logSlowResolvingAsync(b), b } this._activeBuffer.x === E && this._activeBuffer.y === A || this._onCursorMove.fire(), this._onRequestRefreshRows.fire(this._dirtyRowService.start, this._dirtyRowService.end) } print(p, C, b) { let E, A; const H = this._charsetService.charset , j = this._optionsService.rawOptions.screenReaderMode , $ = this._bufferService.cols , P = this._coreService.decPrivateModes.wraparound , N = this._coreService.modes.insertMode , y = this._curAttrData; let T = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); this._dirtyRowService.markDirty(this._activeBuffer.y), this._activeBuffer.x && b - C > 0 && T.getWidth(this._activeBuffer.x - 1) === 2 && T.setCellFromCodePoint(this._activeBuffer.x - 1, 0, 1, y.fg, y.bg, y.extended); for (let O = C; O < b; ++O) { if (E = p[O], A = this._unicodeService.wcwidth(E), E < 127 && H) { const k = H[String.fromCharCode(E)]; k && (E = k.charCodeAt(0)) } if (j && this._onA11yChar.fire((0, d.stringFromCodePoint)(E)), this._currentLinkId !== void 0 && this._oscLinkService.addLineToLink(this._currentLinkId, this._activeBuffer.ybase + this._activeBuffer.y), A || !this._activeBuffer.x) { if (this._activeBuffer.x + A - 1 >= $) { if (P) { for (; this._activeBuffer.x < $;) T.setCellFromCodePoint(this._activeBuffer.x++, 0, 1, y.fg, y.bg, y.extended); this._activeBuffer.x = 0, this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData(), !0)) : (this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !0), T = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y) } else if (this._activeBuffer.x = $ - 1, A === 2) continue } if (N && (T.insertCells(this._activeBuffer.x, A, this._activeBuffer.getNullCell(y), y), T.getWidth($ - 1) === 2 && T.setCellFromCodePoint($ - 1, t.NULL_CELL_CODE, t.NULL_CELL_WIDTH, y.fg, y.bg, y.extended)), T.setCellFromCodePoint(this._activeBuffer.x++, E, A, y.fg, y.bg, y.extended), A > 0) for (; --A;) T.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, y.fg, y.bg, y.extended) } else T.getWidth(this._activeBuffer.x - 1) ? T.addCodepointToCell(this._activeBuffer.x - 1, E) : T.addCodepointToCell(this._activeBuffer.x - 2, E) } b - C > 0 && (T.loadCell(this._activeBuffer.x - 1, this._workCell), this._workCell.getWidth() === 2 || this._workCell.getCode() > 65535 ? this._parser.precedingCodepoint = 0 : this._workCell.isCombined() ? this._parser.precedingCodepoint = this._workCell.getChars().charCodeAt(0) : this._parser.precedingCodepoint = this._workCell.content), this._activeBuffer.x < $ && b - C > 0 && T.getWidth(this._activeBuffer.x) === 0 && !T.hasContent(this._activeBuffer.x) && T.setCellFromCodePoint(this._activeBuffer.x, 0, 1, y.fg, y.bg, y.extended), this._dirtyRowService.markDirty(this._activeBuffer.y) } registerCsiHandler(p, C) { return p.final !== "t" || p.prefix || p.intermediates ? this._parser.registerCsiHandler(p, C) : this._parser.registerCsiHandler(p, b => !m(b.params[0], this._optionsService.rawOptions.windowOptions) || C(b)) } registerDcsHandler(p, C) { return this._parser.registerDcsHandler(p, new g.DcsHandler(C)) } registerEscHandler(p, C) { return this._parser.registerEscHandler(p, C) } registerOscHandler(p, C) { return this._parser.registerOscHandler(p, new c.OscHandler(C)) } bell() { return this._onRequestBell.fire(), !0 } lineFeed() { return this._dirtyRowService.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.x >= this._bufferService.cols && this._activeBuffer.x--, this._dirtyRowService.markDirty(this._activeBuffer.y), this._onLineFeed.fire(), !0 } carriageReturn() { return this._activeBuffer.x = 0, !0 } backspace() { var p; 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 && ((p = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)) === null || p === void 0 ? void 0 : p.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 p = this._activeBuffer.x; return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - p), !0 } shiftOut() { return this._charsetService.setgLevel(1), !0 } shiftIn() { return this._charsetService.setgLevel(0), !0 } _restrictCursor(p = this._bufferService.cols - 1) { this._activeBuffer.x = Math.min(p, 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._dirtyRowService.markDirty(this._activeBuffer.y) } _setCursor(p, C) { this._dirtyRowService.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = p, this._activeBuffer.y = this._activeBuffer.scrollTop + C) : (this._activeBuffer.x = p, this._activeBuffer.y = C), this._restrictCursor(), this._dirtyRowService.markDirty(this._activeBuffer.y) } _moveCursor(p, C) { this._restrictCursor(), this._setCursor(this._activeBuffer.x + p, this._activeBuffer.y + C) } cursorUp(p) { const C = this._activeBuffer.y - this._activeBuffer.scrollTop; return C >= 0 ? this._moveCursor(0, -Math.min(C, p.params[0] || 1)) : this._moveCursor(0, -(p.params[0] || 1)), !0 } cursorDown(p) { const C = this._activeBuffer.scrollBottom - this._activeBuffer.y; return C >= 0 ? this._moveCursor(0, Math.min(C, p.params[0] || 1)) : this._moveCursor(0, p.params[0] || 1), !0 } cursorForward(p) { return this._moveCursor(p.params[0] || 1, 0), !0 } cursorBackward(p) { return this._moveCursor(-(p.params[0] || 1), 0), !0 } cursorNextLine(p) { return this.cursorDown(p), this._activeBuffer.x = 0, !0 } cursorPrecedingLine(p) { return this.cursorUp(p), this._activeBuffer.x = 0, !0 } cursorCharAbsolute(p) { return this._setCursor((p.params[0] || 1) - 1, this._activeBuffer.y), !0 } cursorPosition(p) { return this._setCursor(p.length >= 2 ? (p.params[1] || 1) - 1 : 0, (p.params[0] || 1) - 1), !0 } charPosAbsolute(p) { return this._setCursor((p.params[0] || 1) - 1, this._activeBuffer.y), !0 } hPositionRelative(p) { return this._moveCursor(p.params[0] || 1, 0), !0 } linePosAbsolute(p) { return this._setCursor(this._activeBuffer.x, (p.params[0] || 1) - 1), !0 } vPositionRelative(p) { return this._moveCursor(0, p.params[0] || 1), !0 } hVPosition(p) { return this.cursorPosition(p), !0 } tabClear(p) { const C = p.params[0]; return C === 0 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : C === 3 && (this._activeBuffer.tabs = {}), !0 } cursorForwardTab(p) { if (this._activeBuffer.x >= this._bufferService.cols) return !0; let C = p.params[0] || 1; for (; C--;) this._activeBuffer.x = this._activeBuffer.nextStop(); return !0 } cursorBackwardTab(p) { if (this._activeBuffer.x >= this._bufferService.cols) return !0; let C = p.params[0] || 1; for (; C--;) this._activeBuffer.x = this._activeBuffer.prevStop(); return !0 } selectProtected(p) { const C = p.params[0]; return C === 1 && (this._curAttrData.bg |= 536870912), C !== 2 && C !== 0 || (this._curAttrData.bg &= -536870913), !0 } _eraseInBufferLine(p, C, b, E = !1, A = !1) { const H = this._activeBuffer.lines.get(this._activeBuffer.ybase + p); H.replaceCells(C, b, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData(), A), E && (H.isWrapped = !1) } _resetBufferLine(p, C = !1) { const b = this._activeBuffer.lines.get(this._activeBuffer.ybase + p); b.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), C), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + p), b.isWrapped = !1 } eraseInDisplay(p, C = !1) { let b; switch (this._restrictCursor(this._bufferService.cols), p.params[0]) { case 0: for (b = this._activeBuffer.y, this._dirtyRowService.markDirty(b), this._eraseInBufferLine(b++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, C); b < this._bufferService.rows; b++) this._resetBufferLine(b, C); this._dirtyRowService.markDirty(b); break; case 1: for (b = this._activeBuffer.y, this._dirtyRowService.markDirty(b), this._eraseInBufferLine(b, 0, this._activeBuffer.x + 1, !0, C), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(b + 1).isWrapped = !1); b--;) this._resetBufferLine(b, C); this._dirtyRowService.markDirty(0); break; case 2: for (b = this._bufferService.rows, this._dirtyRowService.markDirty(b - 1); b--;) this._resetBufferLine(b, C); this._dirtyRowService.markDirty(0); break; case 3: const E = this._activeBuffer.lines.length - this._bufferService.rows; E > 0 && (this._activeBuffer.lines.trimStart(E), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - E, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - E, 0), this._onScroll.fire(0)) } return !0 } eraseInLine(p, C = !1) { switch (this._restrictCursor(this._bufferService.cols), p.params[0]) { case 0: this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, C); break; case 1: this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, !1, C); break; case 2: this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, !0, C) } return this._dirtyRowService.markDirty(this._activeBuffer.y), !0 } insertLines(p) { this._restrictCursor(); let C = p.params[0] || 1; if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; const b = this._activeBuffer.ybase + this._activeBuffer.y , E = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom , A = this._bufferService.rows - 1 + this._activeBuffer.ybase - E + 1; for (; C--;) this._activeBuffer.lines.splice(A - 1, 1), this._activeBuffer.lines.splice(b, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0 } deleteLines(p) { this._restrictCursor(); let C = p.params[0] || 1; if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; const b = this._activeBuffer.ybase + this._activeBuffer.y; let E; for (E = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, E = this._bufferService.rows - 1 + this._activeBuffer.ybase - E; C--;) this._activeBuffer.lines.splice(b, 1), this._activeBuffer.lines.splice(E, 0, this._activeBuffer.getBlankLine(this._eraseAttrData())); return this._dirtyRowService.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0 } insertChars(p) { this._restrictCursor(); const C = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return C && (C.insertCells(this._activeBuffer.x, p.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), this._dirtyRowService.markDirty(this._activeBuffer.y)), !0 } deleteChars(p) { this._restrictCursor(); const C = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return C && (C.deleteCells(this._activeBuffer.x, p.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), this._dirtyRowService.markDirty(this._activeBuffer.y)), !0 } scrollUp(p) { let C = p.params[0] || 1; for (; C--;) 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._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0 } scrollDown(p) { let C = p.params[0] || 1; for (; C--;) 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(l.DEFAULT_ATTR_DATA)); return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0 } scrollLeft(p) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; const C = p.params[0] || 1; for (let b = this._activeBuffer.scrollTop; b <= this._activeBuffer.scrollBottom; ++b) { const E = this._activeBuffer.lines.get(this._activeBuffer.ybase + b); E.deleteCells(0, C, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), E.isWrapped = !1 } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0 } scrollRight(p) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; const C = p.params[0] || 1; for (let b = this._activeBuffer.scrollTop; b <= this._activeBuffer.scrollBottom; ++b) { const E = this._activeBuffer.lines.get(this._activeBuffer.ybase + b); E.insertCells(0, C, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), E.isWrapped = !1 } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0 } insertColumns(p) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; const C = p.params[0] || 1; for (let b = this._activeBuffer.scrollTop; b <= this._activeBuffer.scrollBottom; ++b) { const E = this._activeBuffer.lines.get(this._activeBuffer.ybase + b); E.insertCells(this._activeBuffer.x, C, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), E.isWrapped = !1 } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0 } deleteColumns(p) { if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0; const C = p.params[0] || 1; for (let b = this._activeBuffer.scrollTop; b <= this._activeBuffer.scrollBottom; ++b) { const E = this._activeBuffer.lines.get(this._activeBuffer.ybase + b); E.deleteCells(this._activeBuffer.x, C, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), E.isWrapped = !1 } return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0 } eraseChars(p) { this._restrictCursor(); const C = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y); return C && (C.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (p.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData()), this._dirtyRowService.markDirty(this._activeBuffer.y)), !0 } repeatPrecedingCharacter(p) { if (!this._parser.precedingCodepoint) return !0; const C = p.params[0] || 1 , b = new Uint32Array(C); for (let E = 0; E < C; ++E) b[E] = this._parser.precedingCodepoint; return this.print(b, 0, b.length), !0 } sendDeviceAttributesPrimary(p) { return p.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(n.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(n.C0.ESC + "[?6c")), !0 } sendDeviceAttributesSecondary(p) { return p.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(n.C0.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(n.C0.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(p.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(n.C0.ESC + "[>83;40003;0c")), !0 } _is(p) { return (this._optionsService.rawOptions.termName + "").indexOf(p) === 0 } setMode(p) { for (let C = 0; C < p.length; C++) switch (p.params[C]) { case 4: this._coreService.modes.insertMode = !0; break; case 20: this._optionsService.options.convertEol = !0 } return !0 } setModePrivate(p) { for (let C = 0; C < p.length; C++) switch (p.params[C]) { case 1: this._coreService.decPrivateModes.applicationCursorKeys = !0; break; case 2: this._charsetService.setgCharset(0, _.DEFAULT_CHARSET), this._charsetService.setgCharset(1, _.DEFAULT_CHARSET), this._charsetService.setgCharset(2, _.DEFAULT_CHARSET), this._charsetService.setgCharset(3, _.DEFAULT_CHARSET); break; case 3: this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(132, this._bufferService.rows), this._onRequestReset.fire()); break; case 6: this._coreService.decPrivateModes.origin = !0, this._setCursor(0, 0); break; case 7: this._coreService.decPrivateModes.wraparound = !0; break; case 12: this._optionsService.options.cursorBlink = !0; break; case 45: this._coreService.decPrivateModes.reverseWraparound = !0; break; case 66: this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire(); break; case 9: this._coreMouseService.activeProtocol = "X10"; break; case 1e3: this._coreMouseService.activeProtocol = "VT200"; break; case 1002: this._coreMouseService.activeProtocol = "DRAG"; break; case 1003: this._coreMouseService.activeProtocol = "ANY"; break; case 1004: this._coreService.decPrivateModes.sendFocus = !0, this._onRequestSendFocus.fire(); break; case 1005: this._logService.debug("DECSET 1005 not supported (see #2507)"); break; case 1006: this._coreMouseService.activeEncoding = "SGR"; break; case 1015: this._logService.debug("DECSET 1015 not supported (see #2507)"); break; case 1016: this._coreMouseService.activeEncoding = "SGR_PIXELS"; break; case 25: this._coreService.isCursorHidden = !1; break; case 1048: this.saveCursor(); break; case 1049: this.saveCursor(); case 47: case 1047: this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire(); break; case 2004: this._coreService.decPrivateModes.bracketedPasteMode = !0 } return !0 } resetMode(p) { for (let C = 0; C < p.length; C++) switch (p.params[C]) { case 4: this._coreService.modes.insertMode = !1; break; case 20: this._optionsService.options.convertEol = !1 } return !0 } resetModePrivate(p) { for (let C = 0; C < p.length; C++) switch (p.params[C]) { 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(), p.params[C] === 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(p, C) { const b = this._coreService.decPrivateModes , { activeProtocol: E, activeEncoding: A } = this._coreMouseService , H = this._coreService , { buffers: j, cols: $ } = this._bufferService , { active: P, alt: N } = j , y = this._optionsService.rawOptions , T = B => B ? 1 : 2 , O = p.params[0]; return k = O, D = C ? O === 2 ? 3 : O === 4 ? T(H.modes.insertMode) : O === 12 ? 4 : O === 20 ? T(y.convertEol) : 0 : O === 1 ? T(b.applicationCursorKeys) : O === 3 ? y.windowOptions.setWinLines ? $ === 80 ? 2 : $ === 132 ? 1 : 0 : 0 : O === 6 ? T(b.origin) : O === 7 ? T(b.wraparound) : O === 8 ? 3 : O === 9 ? T(E === "X10") : O === 12 ? T(y.cursorBlink) : O === 25 ? T(!H.isCursorHidden) : O === 45 ? T(b.reverseWraparound) : O === 66 ? T(b.applicationKeypad) : O === 1e3 ? T(E === "VT200") : O === 1002 ? T(E === "DRAG") : O === 1003 ? T(E === "ANY") : O === 1004 ? T(b.sendFocus) : O === 1005 ? 4 : O === 1006 ? T(A === "SGR") : O === 1015 ? 4 : O === 1016 ? T(A === "SGR_PIXELS") : O === 1048 ? 1 : O === 47 || O === 1047 || O === 1049 ? T(P === N) : O === 2004 ? T(b.bracketedPasteMode) : 0, H.triggerDataEvent(`${n.C0.ESC}[${C ? "" : "?"}${k};${D}$y`), !0; var k, D } _updateAttrColor(p, C, b, E, A) { return C === 2 ? (p |= 50331648, p &= -16777216, p |= e.AttributeData.fromColorRGB([b, E, A])) : C === 5 && (p &= -50331904, p |= 33554432 | 255 & b), p } _extractColor(p, C, b) { const E = [0, 0, -1, 0, 0, 0]; let A = 0 , H = 0; do { if (E[H + A] = p.params[C + H], p.hasSubParams(C + H)) { const j = p.getSubParams(C + H); let$ = 0; do E[1] === 5 && (A = 1), E[H + $ + 1 + A] = j[$]; while (++$ < j.length && $ + H + 1 + A < E.length); break } if (E[1] === 5 && H + A >= 2 || E[1] === 2 && H + A >= 5) break; E[1] && (A = 1) } while (++H + C < p.length && H + A < E.length); for (let j = 2; j < E.length; ++j) E[j] === -1 && (E[j] = 0); switch (E[0]) { case 38: b.fg = this._updateAttrColor(b.fg, E[1], E[3], E[4], E[5]); break; case 48: b.bg = this._updateAttrColor(b.bg, E[1], E[3], E[4], E[5]); break; case 58: b.extended = b.extended.clone(), b.extended.underlineColor = this._updateAttrColor(b.extended.underlineColor, E[1], E[3], E[4], E[5]) } return H } _processUnderline(p, C) { C.extended = C.extended.clone(), (!~p || p > 5) && (p = 1), C.extended.underlineStyle = p, C.fg |= 268435456, p === 0 && (C.fg &= -268435457), C.updateExtended() } charAttributes(p) { if (p.length === 1 && p.params[0] === 0) return this._curAttrData.fg = l.DEFAULT_ATTR_DATA.fg, this._curAttrData.bg = l.DEFAULT_ATTR_DATA.bg, !0; const C = p.length; let b; const E = this._curAttrData; for (let A = 0; A < C; A++) b = p.params[A], b >= 30 && b <= 37 ? (E.fg &= -50331904, E.fg |= 16777216 | b - 30) : b >= 40 && b <= 47 ? (E.bg &= -50331904, E.bg |= 16777216 | b - 40) : b >= 90 && b <= 97 ? (E.fg &= -50331904, E.fg |= 16777224 | b - 90) : b >= 100 && b <= 107 ? (E.bg &= -50331904, E.bg |= 16777224 | b - 100) : b === 0 ? (E.fg = l.DEFAULT_ATTR_DATA.fg, E.bg = l.DEFAULT_ATTR_DATA.bg) : b === 1 ? E.fg |= 134217728 : b === 3 ? E.bg |= 67108864 : b === 4 ? (E.fg |= 268435456, this._processUnderline(p.hasSubParams(A) ? p.getSubParams(A)[0] : 1, E)) : b === 5 ? E.fg |= 536870912 : b === 7 ? E.fg |= 67108864 : b === 8 ? E.fg |= 1073741824 : b === 9 ? E.fg |= 2147483648 : b === 2 ? E.bg |= 134217728 : b === 21 ? this._processUnderline(2, E) : b === 22 ? (E.fg &= -134217729, E.bg &= -134217729) : b === 23 ? E.bg &= -67108865 : b === 24 ? (E.fg &= -268435457, this._processUnderline(0, E)) : b === 25 ? E.fg &= -536870913 : b === 27 ? E.fg &= -67108865 : b === 28 ? E.fg &= -1073741825 : b === 29 ? E.fg &= 2147483647 : b === 39 ? (E.fg &= -67108864, E.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg) : b === 49 ? (E.bg &= -67108864, E.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : b === 38 || b === 48 || b === 58 ? A += this._extractColor(p, A, E) : b === 59 ? (E.extended = E.extended.clone(), E.extended.underlineColor = -1, E.updateExtended()) : b === 100 ? (E.fg &= -67108864, E.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg, E.bg &= -67108864, E.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : this._logService.debug("Unknown SGR attribute: %d.", b); return !0 } deviceStatus(p) { switch (p.params[0]) { case 5: this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`); break; case 6: const C = this._activeBuffer.y + 1 , b = this._activeBuffer.x + 1; this._coreService.triggerDataEvent(`${n.C0.ESC}[${C};${b}R`) } return !0 } deviceStatusPrivate(p) { if (p.params[0] === 6) { const C = this._activeBuffer.y + 1 , b = this._activeBuffer.x + 1; this._coreService.triggerDataEvent(`${n.C0.ESC}[?${C};${b}R`) } return !0 } softReset(p) { return this._coreService.isCursorHidden = !1, this._onRequestSyncScrollBar.fire(), this._activeBuffer.scrollTop = 0, this._activeBuffer.scrollBottom = this._bufferService.rows - 1, this._curAttrData = l.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(p) { const C = p.params[0] || 1; switch (C) { 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 b = C % 2 == 1; return this._optionsService.options.cursorBlink = b, !0 } setScrollRegion(p) { const C = p.params[0] || 1; let b; return (p.length < 2 || (b = p.params[1]) > this._bufferService.rows || b === 0) && (b = this._bufferService.rows), b > C && (this._activeBuffer.scrollTop = C - 1, this._activeBuffer.scrollBottom = b - 1, this._setCursor(0, 0)), !0 } windowOptions(p) { if (!m(p.params[0], this._optionsService.rawOptions.windowOptions)) return !0; const C = p.length > 1 ? p.params[1] : 0; switch (p.params[0]) { case 14: C !== 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(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`); break; case 22: C !== 0 && C !== 2 || (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > 10 && this._windowTitleStack.shift()), C !== 0 && C !== 1 || (this._iconNameStack.push(this._iconName), this._iconNameStack.length > 10 && this._iconNameStack.shift()); break; case 23: C !== 0 && C !== 2 || this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), C !== 0 && C !== 1 || this._iconNameStack.length && this.setIconName(this._iconNameStack.pop()) } return !0 } saveCursor(p) { 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(p) { 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(p) { return this._windowTitle = p, this._onTitleChange.fire(p), !0 } setIconName(p) { return this._iconName = p, !0 } setOrReportIndexedColor(p) { const C = [] , b = p.split(";"); for (; b.length > 1;) { const E = b.shift() , A = b.shift(); if (/^\d+$/.exec(E)) { const H = parseInt(E); if (0 <= H && H < 256) if (A === "?") C.push({ type: 0, index: H }); else { const j = (0, v.parseColor)(A); j && C.push({ type: 1, index: H, color: j }) } } } return C.length && this._onColor.fire(C), !0 } setHyperlink(p) { const C = p.split(";"); return !(C.length < 2) && (C[1] ? this._createHyperlink(C[0], C[1]) : !C[0] && this._finishHyperlink()) } _createHyperlink(p, C) { this._currentLinkId !== void 0 && this._finishHyperlink(); const b = p.split(":"); let E; const A = b.findIndex(H => H.startsWith("id=")); return A !== -1 && (E = b[A].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._currentLinkId = this._oscLinkService.registerLink({ id: E, uri: C }), this._curAttrData.extended.urlId = this._currentLinkId, this._curAttrData.updateExtended(), !0 } _finishHyperlink() { return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), this._currentLinkId = void 0, !0 } _setOrReportSpecialColor(p, C) { const b = p.split(";"); for (let E = 0; E < b.length && !(C >= this._specialColors.length); ++E, ++C) if (b[E] === "?") this._onColor.fire([{ type: 0, index: this._specialColors[C] }]); else { const A = (0, v.parseColor)(b[E]); A && this._onColor.fire([{ type: 1, index: this._specialColors[C], color: A }]) } return !0 } setOrReportFgColor(p) { return this._setOrReportSpecialColor(p, 0) } setOrReportBgColor(p) { return this._setOrReportSpecialColor(p, 1) } setOrReportCursorColor(p) { return this._setOrReportSpecialColor(p, 2) } restoreIndexedColor(p) { if (!p) return this._onColor.fire([{ type: 2 }]), !0; const C = [] , b = p.split(";"); for (let E = 0; E < b.length; ++E) if (/^\d+$/.exec(b[E])) { const A = parseInt(b[E]); 0 <= A && A < 256 && C.push({ type: 2, index: A }) } return C.length && this._onColor.fire(C), !0 } restoreFgColor(p) { return this._onColor.fire([{ type: 2, index: 256 }]), !0 } restoreBgColor(p) { return this._onColor.fire([{ type: 2, index: 257 }]), !0 } restoreCursorColor(p) { return this._onColor.fire([{ type: 2, index: 258 }]), !0 } nextLine() { return this._activeBuffer.x = 0, this.index(), !0 } keypadApplicationMode() { return this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire(), !0 } keypadNumericMode() { return this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire(), !0 } selectDefaultCharset() { return this._charsetService.setgLevel(0), this._charsetService.setgCharset(0, _.DEFAULT_CHARSET), !0 } selectCharset(p) { return p.length !== 2 ? (this.selectDefaultCharset(), !0) : (p[0] === "/" || this._charsetService.setgCharset(S[p[0]], _.CHARSETS[p[1]] || _.DEFAULT_CHARSET), !0) } index() { return this._restrictCursor(), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows && (this._activeBuffer.y = this._bufferService.rows - 1), this._restrictCursor(), !0 } tabSet() { return this._activeBuffer.tabs[this._activeBuffer.x] = !0, !0 } reverseIndex() { if (this._restrictCursor(), this._activeBuffer.y === this._activeBuffer.scrollTop) { const p = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop; this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, p, 1), this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData())), this._dirtyRowService.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 = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone() } _eraseAttrData() { return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= 67108863 & this._curAttrData.bg, this._eraseAttrDataInternal } setgLevel(p) { return this._charsetService.setgLevel(p), !0 } screenAlignmentPattern() { const p = new s.CellData; p.content = 4194304 | "E".charCodeAt(0), p.fg = this._curAttrData.fg, p.bg = this._curAttrData.bg, this._setCursor(0, 0); for (let C = 0; C < this._bufferService.rows; ++C) { const b = this._activeBuffer.ybase + this._activeBuffer.y + C , E = this._activeBuffer.lines.get(b); E && (E.fill(p), E.isWrapped = !1) } return this._dirtyRowService.markAllDirty(), this._setCursor(0, 0), !0 } requestStatusString(p, C) { const b = this._bufferService.buffer , E = this._optionsService.rawOptions; return (A => (this._coreService.triggerDataEvent(`${n.C0.ESC}${A}${n.C0.ESC}\\`), !0))(p === '"q' ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : p === '"p' ? 'P1$r61;1"p' : p === "r" ? `P1$r${b.scrollTop + 1};${b.scrollBottom + 1}r` : p === "m" ? "P1$r0m" : p === " q" ? `P1$r${{ block: 2, underline: 4, bar: 6 }[E.cursorStyle] - (E.cursorBlink ? 1 : 0)} q` : "P0$r") } } r.InputHandler = R } , 844: (x, r) => { function a(n) { for (const _ of n) _.dispose(); n.length = 0 } Object.defineProperty(r, "__esModule", { value: !0 }), r.getDisposeArrayDisposable = r.disposeArray = r.toDisposable = r.Disposable = void 0, r.Disposable = class { constructor() { this._disposables = [], this._isDisposed = !1 } dispose() { this._isDisposed = !0; for (const n of this._disposables) n.dispose(); this._disposables.length = 0 } register(n) { return this._disposables.push(n), n } unregister(n) { const _ = this._disposables.indexOf(n); _ !== -1 && this._disposables.splice(_, 1) } } , r.toDisposable = function (n) { return { dispose: n } } , r.disposeArray = a, r.getDisposeArrayDisposable = function (n) { return { dispose: () => a(n) } } } , 1505: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.FourKeyMap = r.TwoKeyMap = void 0; class a { constructor() { this._data = {} } set(_, h, f) { this._data[_] || (this._data[_] = {}), this._data[_][h] = f } get(_, h) { return this._data[_] ? this._data[_][h] : void 0 } clear() { this._data = {} } } r.TwoKeyMap = a, r.FourKeyMap = class { constructor() { this._data = new a } set(n, _, h, f, d) { this._data.get(n, _) || this._data.set(n, _, new a), this._data.get(n, _).set(h, f, d) } get(n, _, h, f) { var d; return (d = this._data.get(n, _)) === null || d === void 0 ? void 0 : d.get(h, f) } clear() { this._data.clear() } } } , 6114: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.isLinux = r.isWindows = r.isIphone = r.isIpad = r.isMac = r.isSafari = r.isLegacyEdge = r.isFirefox = void 0; const a = typeof navigator > "u" , n = a ? "node" : navigator.userAgent , _ = a ? "node" : navigator.platform; r.isFirefox = n.includes("Firefox"), r.isLegacyEdge = n.includes("Edge"), r.isSafari = /^((?!chrome|android).)*safari/i.test(n), r.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(_), r.isIpad = _ === "iPad", r.isIphone = _ === "iPhone", r.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(_), r.isLinux = _.indexOf("Linux") >= 0 } , 6106: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.SortedList = void 0; let a = 0; r.SortedList = class { constructor(n) { this._getKey = n, this._array = [] } clear() { this._array.length = 0 } insert(n) { this._array.length !== 0 ? (a = this._search(this._getKey(n), 0, this._array.length - 1), this._array.splice(a, 0, n)) : this._array.push(n) } delete(n) { if (this._array.length === 0) return !1; const _ = this._getKey(n); if (_ === void 0 || (a = this._search(_, 0, this._array.length - 1), a === -1) || this._getKey(this._array[a]) !== _) return !1; do if (this._array[a] === n) return this._array.splice(a, 1), !0; while (++a < this._array.length && this._getKey(this._array[a]) === _); return !1 } *getKeyIterator(n) { if (this._array.length !== 0 && (a = this._search(n, 0, this._array.length - 1), !(a < 0 || a >= this._array.length) && this._getKey(this._array[a]) === n)) do yield this._array[a]; while (++a < this._array.length && this._getKey(this._array[a]) === n) } forEachByKey(n, _) { if (this._array.length !== 0 && (a = this._search(n, 0, this._array.length - 1), !(a < 0 || a >= this._array.length) && this._getKey(this._array[a]) === n)) do _(this._array[a]); while (++a < this._array.length && this._getKey(this._array[a]) === n) } values() { return this._array.values() } _search(n, _, h) { if (h < _) return _; let f = Math.floor((_ + h) / 2); const d = this._getKey(this._array[f]); if (d > n) return this._search(n, _, f - 1); if (d < n) return this._search(n, f + 1, h); for (; f > 0 && this._getKey(this._array[f - 1]) === n;) f--; return f } } } , 8273: (x, r) => { function a(n, _, h = 0, f = n.length) { if (h >= n.length) return n; h = (n.length + h) % n.length, f = f >= n.length ? n.length : (n.length + f) % n.length; for (let d = h; d < f; ++d) n[d] = _; return n } Object.defineProperty(r, "__esModule", { value: !0 }), r.concat = r.fillFallback = r.fill = void 0, r.fill = function (n, _, h, f) { return n.fill ? n.fill(_, h, f) : a(n, _, h, f) } , r.fillFallback = a, r.concat = function (n, _) { const h = new n.constructor(n.length + _.length); return h.set(n), h.set(_, n.length), h } } , 9282: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.updateWindowsModeWrappedState = void 0; const n = a(643); r.updateWindowsModeWrappedState = function (_) { const h = _.buffer.lines.get(_.buffer.ybase + _.buffer.y - 1) , f = h == null ? void 0 : h.get(_.cols - 1) , d = _.buffer.lines.get(_.buffer.ybase + _.buffer.y); d && f && (d.isWrapped = f[n.CHAR_DATA_CODE_INDEX] !== n.NULL_CELL_CODE && f[n.CHAR_DATA_CODE_INDEX] !== n.WHITESPACE_CELL_CODE) } } , 3734: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ExtendedAttrs = r.AttributeData = void 0; class a { constructor() { this.fg = 0, this.bg = 0, this.extended = new n } static toColorRGB(h) { return [h >>> 16 & 255, h >>> 8 & 255, 255 & h] } static fromColorRGB(h) { return (255 & h[0]) << 16 | (255 & h[1]) << 8 | 255 & h[2] } clone() { const h = new a; return h.fg = this.fg, h.bg = this.bg, h.extended = this.extended.clone(), h } 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 } getFgColorMode() { return 50331648 & this.fg } getBgColorMode() { return 50331648 & this.bg } isFgRGB() { return (50331648 & this.fg) == 50331648 } isBgRGB() { return (50331648 & this.bg) == 50331648 } isFgPalette() { return (50331648 & this.fg) == 16777216 || (50331648 & this.fg) == 33554432 } isBgPalette() { return (50331648 & this.bg) == 16777216 || (50331648 & this.bg) == 33554432 } isFgDefault() { return (50331648 & this.fg) == 0 } isBgDefault() { return (50331648 & this.bg) == 0 } isAttributeDefault() { return this.fg === 0 && this.bg === 0 } getFgColor() { switch (50331648 & this.fg) { case 16777216: case 33554432: return 255 & this.fg; case 50331648: return 16777215 & this.fg; default: return -1 } } getBgColor() { switch (50331648 & this.bg) { case 16777216: case 33554432: return 255 & this.bg; case 50331648: return 16777215 & this.bg; default: return -1 } } hasExtendedAttrs() { return 268435456 & this.bg } updateExtended() { this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456 } getUnderlineColor() { if (268435456 & this.bg && ~this.extended.underlineColor) switch (50331648 & this.extended.underlineColor) { case 16777216: case 33554432: return 255 & this.extended.underlineColor; case 50331648: return 16777215 & this.extended.underlineColor; default: return this.getFgColor() } return this.getFgColor() } getUnderlineColorMode() { return 268435456 & this.bg && ~this.extended.underlineColor ? 50331648 & this.extended.underlineColor : this.getFgColorMode() } isUnderlineColorRGB() { return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 50331648 : this.isFgRGB() } isUnderlineColorPalette() { return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 16777216 || (50331648 & this.extended.underlineColor) == 33554432 : this.isFgPalette() } isUnderlineColorDefault() { return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 0 : this.isFgDefault() } getUnderlineStyle() { return 268435456 & this.fg ? 268435456 & this.bg ? this.extended.underlineStyle : 1 : 0 } } r.AttributeData = a; class n { constructor(h = 0, f = 0) { this._ext = 0, this._urlId = 0, this._ext = h, this._urlId = f } get ext() { return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext } set ext(h) { this._ext = h } get underlineStyle() { return this._urlId ? 5 : (469762048 & this._ext) >> 26 } set underlineStyle(h) { this._ext &= -469762049, this._ext |= h << 26 & 469762048 } get underlineColor() { return 67108863 & this._ext } set underlineColor(h) { this._ext &= -67108864, this._ext |= 67108863 & h } get urlId() { return this._urlId } set urlId(h) { this._urlId = h } clone() { return new n(this._ext, this._urlId) } isEmpty() { return this.underlineStyle === 0 && this._urlId === 0 } } r.ExtendedAttrs = n } , 9092: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferStringIterator = r.Buffer = r.MAX_BUFFER_SIZE = void 0; const n = a(6349) , _ = a(8437) , h = a(511) , f = a(643) , d = a(4634) , l = a(4863) , o = a(7116) , t = a(3734); r.MAX_BUFFER_SIZE = 4294967295, r.Buffer = class { constructor(e, i, c) { this._hasScrollback = e, this._optionsService = i, this._bufferService = c, this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.savedY = 0, this.savedX = 0, this.savedCurAttrData = _.DEFAULT_ATTR_DATA.clone(), this.savedCharset = o.DEFAULT_CHARSET, this.markers = [], this._nullCell = h.CellData.fromCharData([0, f.NULL_CELL_CHAR, f.NULL_CELL_WIDTH, f.NULL_CELL_CODE]), this._whitespaceCell = h.CellData.fromCharData([0, f.WHITESPACE_CELL_CHAR, f.WHITESPACE_CELL_WIDTH, f.WHITESPACE_CELL_CODE]), this._isClearing = !1, this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new n.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 t.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 t.ExtendedAttrs), this._whitespaceCell } getBlankLine(e, i) { return new _.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 > r.MAX_BUFFER_SIZE ? r.MAX_BUFFER_SIZE : i } fillViewportRows(e) { if (this.lines.length === 0) { e === void 0 && (e = _.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 n.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops() } resize(e, i) { const c = this.getNullCell(_.DEFAULT_ATTR_DATA) , g = this._getCorrectBufferLength(i); if (g > this.lines.maxLength && (this.lines.maxLength = g), this.lines.length > 0) { if (this._cols < e) for (let S = 0; S < this.lines.length; S++) this.lines.get(S).resize(e, c); let v = 0; if (this._rows < i) for (let S = this._rows; S < i; S++) this.lines.length < i + this.ybase && (this._optionsService.rawOptions.windowsMode ? this.lines.push(new _.BufferLine(e, c)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + v + 1 ? (this.ybase--, v++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new _.BufferLine(e, c))); else for (let S = this._rows; S > i; S--) this.lines.length > i + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++)); if (g < this.lines.maxLength) { const S = this.lines.length - g; S > 0 && (this.lines.trimStart(S), this.ybase = Math.max(this.ybase - S, 0), this.ydisp = Math.max(this.ydisp - S, 0), this.savedY = Math.max(this.savedY - S, 0)), this.lines.maxLength = g } this.x = Math.min(this.x, e - 1), this.y = Math.min(this.y, i - 1), v && (this.y += v), 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 v = 0; v < this.lines.length; v++) this.lines.get(v).resize(e, c); this._cols = e, this._rows = i } get _isReflowEnabled() { return 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 c = (0, d.reflowLargerGetLinesToRemove)(this.lines, this._cols, e, this.ybase + this.y, this.getNullCell(_.DEFAULT_ATTR_DATA)); if (c.length > 0) { const g = (0, d.reflowLargerCreateNewLayout)(this.lines, c); (0, d.reflowLargerApplyNewLayout)(this.lines, g.layout), this._reflowLargerAdjustViewport(e, i, g.countRemoved) } } _reflowLargerAdjustViewport(e, i, c) { const g = this.getNullCell(_.DEFAULT_ATTR_DATA); let v = c; for (; v-- > 0;) this.ybase === 0 ? (this.y > 0 && this.y--, this.lines.length < i && this.lines.push(new _.BufferLine(e, g))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--); this.savedY = Math.max(this.savedY - c, 0) } _reflowSmaller(e, i) { const c = this.getNullCell(_.DEFAULT_ATTR_DATA) , g = []; let v = 0; for (let S = this.lines.length - 1; S >= 0; S--) { let u = this.lines.get(S); if (!u || !u.isWrapped && u.getTrimmedLength() <= e) continue; const m = [u]; for (; u.isWrapped && S > 0;) u = this.lines.get(--S), m.unshift(u); const w = this.ybase + this.y; if (w >= S && w < S + m.length) continue; const R = m[m.length - 1].getTrimmedLength() , L = (0, d.reflowSmallerGetNewLineLengths)(m, this._cols, e) , p = L.length - m.length; let C; C = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + p) : Math.max(0, this.lines.length - this.lines.maxLength + p); const b = []; for (let P = 0; P < p; P++) { const N = this.getBlankLine(_.DEFAULT_ATTR_DATA, !0); b.push(N) } b.length > 0 && (g.push({ start: S + m.length + v, newLines: b }), v += b.length), m.push(...b); let E = L.length - 1 , A = L[E]; A === 0 && (E--, A = L[E]); let H = m.length - p - 1 , j = R; for (; H >= 0;) { const P = Math.min(j, A); if (m[E] === void 0) break; if (m[E].copyCellsFrom(m[H], j - P, A - P, P, !0), A -= P, A === 0 && (E--, A = L[E]), j -= P, j === 0) { H--; const N = Math.max(H, 0); j = (0, d.getWrappedLineTrimmedLength)(m, N, this._cols) } } for (let P = 0; P < m.length; P++) L[P] < e && m[P].setCell(L[P], c); let$ = p - C; for (; $-- > 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 + v) - i && (this.ybase === this.ydisp && this.ydisp++, this.ybase++); this.savedY = Math.min(this.savedY + p, this.ybase + i - 1) } if (g.length > 0) { const S = [] , u = []; for (let E = 0; E < this.lines.length; E++) u.push(this.lines.get(E)); const m = this.lines.length; let w = m - 1 , R = 0 , L = g[R]; this.lines.length = Math.min(this.lines.maxLength, this.lines.length + v); let p = 0; for (let E = Math.min(this.lines.maxLength - 1, m + v - 1); E >= 0; E--) if (L && L.start > w + p) { for (let A = L.newLines.length - 1; A >= 0; A--) this.lines.set(E--, L.newLines[A]); E++, S.push({ index: w + 1, amount: L.newLines.length }), p += L.newLines.length, L = g[++R] } else this.lines.set(E, u[w--]); let C = 0; for (let E = S.length - 1; E >= 0; E--) S[E].index += C, this.lines.onInsertEmitter.fire(S[E]), C += S[E].amount; const b = Math.max(0, m + v - this.lines.maxLength); b > 0 && this.lines.onTrimEmitter.fire(b) } } stringIndexToBufferIndex(e, i, c = !1) { for (; i;) { const g = this.lines.get(e); if (!g) return [-1, -1]; const v = c ? g.getTrimmedLength() : g.length; for (let S = 0; S < v; ++S) if (g.get(S)[f.CHAR_DATA_WIDTH_INDEX] && (i -= g.get(S)[f.CHAR_DATA_CHAR_INDEX].length || 1), i < 0) return [e, S]; e++ } return [e, 0] } translateBufferLineToString(e, i, c = 0, g) { const v = this.lines.get(e); return v ? v.translateToString(i, c, g) : "" } getWrappedRangeForLine(e) { let i = e , c = e; for (; i > 0 && this.lines.get(i).isWrapped;) i--; for (; c + 1 < this.lines.length && this.lines.get(c + 1).isWrapped;) c++; return { first: i, last: c } } setupTabStops(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 l.Marker(e); return this.markers.push(i), i.register(this.lines.onTrim(c => { i.line -= c, i.line < 0 && i.dispose() } )), i.register(this.lines.onInsert(c => { i.line >= c.index && (i.line += c.amount) } )), i.register(this.lines.onDelete(c => { i.line >= c.index && i.line < c.index + c.amount && i.dispose(), i.line > c.index && (i.line -= c.amount) } )), i.register(i.onDispose(() => this._removeMarker(i))), i } _removeMarker(e) { this._isClearing || this.markers.splice(this.markers.indexOf(e), 1) } iterator(e, i, c, g, v) { return new s(this, e, i, c, g, v) } } ; class s { constructor(i, c, g = 0, v = i.lines.length, S = 0, u = 0) { this._buffer = i, this._trimRight = c, this._startIndex = g, this._endIndex = v, this._startOverscan = S, this._endOverscan = u, this._startIndex < 0 && (this._startIndex = 0), this._endIndex > this._buffer.lines.length && (this._endIndex = this._buffer.lines.length), this._current = this._startIndex } hasNext() { return this._current < this._endIndex } next() { const i = this._buffer.getWrappedRangeForLine(this._current); i.first < this._startIndex - this._startOverscan && (i.first = this._startIndex - this._startOverscan), i.last > this._endIndex + this._endOverscan && (i.last = this._endIndex + this._endOverscan), i.first = Math.max(i.first, 0), i.last = Math.min(i.last, this._buffer.lines.length); let c = ""; for (let g = i.first; g <= i.last; ++g) c += this._buffer.translateBufferLineToString(g, this._trimRight); return this._current = i.last + 1, { range: i, content: c } } } r.BufferStringIterator = s } , 8437: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferLine = r.DEFAULT_ATTR_DATA = void 0; const n = a(482) , _ = a(643) , h = a(511) , f = a(3734); r.DEFAULT_ATTR_DATA = Object.freeze(new f.AttributeData); const d = { startIndex: 0 }; class l { constructor(t, s, e = !1) { this.isWrapped = e, this._combined = {}, this._extendedAttrs = {}, this._data = new Uint32Array(3 * t); const i = s || h.CellData.fromCharData([0, _.NULL_CELL_CHAR, _.NULL_CELL_WIDTH, _.NULL_CELL_CODE]); for (let c = 0; c < t; ++c) this.setCell(c, i); this.length = t } get(t) { const s = this._data[3 * t + 0] , e = 2097151 & s; return [this._data[3 * t + 1], 2097152 & s ? this._combined[t] : e ? (0, n.stringFromCodePoint)(e) : "", s >> 22, 2097152 & s ? this._combined[t].charCodeAt(this._combined[t].length - 1) : e] } set(t, s) { this._data[3 * t + 1] = s[_.CHAR_DATA_ATTR_INDEX], s[_.CHAR_DATA_CHAR_INDEX].length > 1 ? (this._combined[t] = s[1], this._data[3 * t + 0] = 2097152 | t | s[_.CHAR_DATA_WIDTH_INDEX] << 22) : this._data[3 * t + 0] = s[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | 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 s = this._data[3 * t + 0]; return 2097152 & s ? this._combined[t].charCodeAt(this._combined[t].length - 1) : 2097151 & s } isCombined(t) { return 2097152 & this._data[3 * t + 0] } getString(t) { const s = this._data[3 * t + 0]; return 2097152 & s ? this._combined[t] : 2097151 & s ? (0, n.stringFromCodePoint)(2097151 & s) : "" } isProtected(t) { return 536870912 & this._data[3 * t + 2] } loadCell(t, s) { return d.startIndex = 3 * t, s.content = this._data[d.startIndex + 0], s.fg = this._data[d.startIndex + 1], s.bg = this._data[d.startIndex + 2], 2097152 & s.content && (s.combinedData = this._combined[t]), 268435456 & s.bg && (s.extended = this._extendedAttrs[t]), s } setCell(t, s) { 2097152 & s.content && (this._combined[t] = s.combinedData), 268435456 & s.bg && (this._extendedAttrs[t] = s.extended), this._data[3 * t + 0] = s.content, this._data[3 * t + 1] = s.fg, this._data[3 * t + 2] = s.bg } setCellFromCodePoint(t, s, e, i, c, g) { 268435456 & c && (this._extendedAttrs[t] = g), this._data[3 * t + 0] = s | e << 22, this._data[3 * t + 1] = i, this._data[3 * t + 2] = c } addCodepointToCell(t, s) { let e = this._data[3 * t + 0]; 2097152 & e ? this._combined[t] += (0, n.stringFromCodePoint)(s) : (2097151 & e ? (this._combined[t] = (0, n.stringFromCodePoint)(2097151 & e) + (0, n.stringFromCodePoint)(s), e &= -2097152, e |= 2097152) : e = s | 4194304, this._data[3 * t + 0] = e) } insertCells(t, s, e, i) { if ((t %= this.length) && this.getWidth(t - 1) === 2 && this.setCellFromCodePoint(t - 1, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs), s < this.length - t) { const c = new h.CellData; for (let g = this.length - t - s - 1; g >= 0; --g) this.setCell(t + s + g, this.loadCell(t + g, c)); for (let g = 0; g < s; ++g) this.setCell(t + g, e) } else for (let c = t; c < this.length; ++c) this.setCell(c, e); this.getWidth(this.length - 1) === 2 && this.setCellFromCodePoint(this.length - 1, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs) } deleteCells(t, s, e, i) { if (t %= this.length, s < this.length - t) { const c = new h.CellData; for (let g = 0; g < this.length - t - s; ++g) this.setCell(t + g, this.loadCell(t + s + g, c)); for (let g = this.length - s; g < this.length; ++g) this.setCell(g, e) } else for (let c = t; c < this.length; ++c) this.setCell(c, e); t && this.getWidth(t - 1) === 2 && this.setCellFromCodePoint(t - 1, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs), this.getWidth(t) !== 0 || this.hasContent(t) || this.setCellFromCodePoint(t, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs) } replaceCells(t, s, e, i, c = !1) { if (c) for (t && this.getWidth(t - 1) === 2 && !this.isProtected(t - 1) && this.setCellFromCodePoint(t - 1, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs), s < this.length && this.getWidth(s - 1) === 2 && !this.isProtected(s) && this.setCellFromCodePoint(s, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs); t < s && 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, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs), s < this.length && this.getWidth(s - 1) === 2 && this.setCellFromCodePoint(s, 0, 1, (i == null ? void 0 : i.fg) || 0, (i == null ? void 0 : i.bg) || 0, (i == null ? void 0 : i.extended) || new f.ExtendedAttrs); t < s && t < this.length;) this.setCell(t++, e) } resize(t, s) { if (t !== this.length) { if (t > this.length) { const e = new Uint32Array(3 * t); this.length && (3 * t < this._data.length ? e.set(this._data.subarray(0, 3 * t)) : e.set(this._data)), this._data = e; for (let i = this.length; i < t; ++i) this.setCell(i, s) } else if (t) { const e = new Uint32Array(3 * t); e.set(this._data.subarray(0, 3 * t)), this._data = e; const i = Object.keys(this._combined); for (let c = 0; c < i.length; c++) { const g = parseInt(i[c], 10); g >= t && delete this._combined[g] } } else this._data = new Uint32Array(0), this._combined = {}; this.length = t } } fill(t, s = !1) { if (s) 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 s in t._combined) this._combined[s] = t._combined[s]; this._extendedAttrs = {}; for (const s in t._extendedAttrs) this._extendedAttrs[s] = t._extendedAttrs[s]; this.isWrapped = t.isWrapped } clone() { const t = new l(0); t._data = new Uint32Array(this._data), t.length = this.length; for (const s in this._combined) t._combined[s] = this._combined[s]; for (const s in this._extendedAttrs) t._extendedAttrs[s] = this._extendedAttrs[s]; 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 } copyCellsFrom(t, s, e, i, c) { const g = t._data; if (c) for (let S = i - 1; S >= 0; S--) { for (let u = 0; u < 3; u++) this._data[3 * (e + S) + u] = g[3 * (s + S) + u]; 268435456 & g[3 * (s + S) + 2] && (this._extendedAttrs[e + S] = t._extendedAttrs[s + S]) } else for (let S = 0; S < i; S++) { for (let u = 0; u < 3; u++) this._data[3 * (e + S) + u] = g[3 * (s + S) + u]; 268435456 & g[3 * (s + S) + 2] && (this._extendedAttrs[e + S] = t._extendedAttrs[s + S]) } const v = Object.keys(t._combined); for (let S = 0; S < v.length; S++) { const u = parseInt(v[S], 10); u >= s && (this._combined[u - s + e] = t._combined[u]) } } translateToString(t = !1, s = 0, e = this.length) { t && (e = Math.min(e, this.getTrimmedLength())); let i = ""; for (; s < e;) { const c = this._data[3 * s + 0] , g = 2097151 & c; i += 2097152 & c ? this._combined[s] : g ? (0, n.stringFromCodePoint)(g) : _.WHITESPACE_CELL_CHAR, s += c >> 22 || 1 } return i } } r.BufferLine = l } , 4841: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.getRangeLength = void 0, r.getRangeLength = function (a, n) { if (a.start.y > a.end.y) throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`); return n * (a.end.y - a.start.y) + (a.end.x - a.start.x + 1) } } , 4634: (x, r) => { function a(n, _, h) { if (_ === n.length - 1) return n[_].getTrimmedLength(); const f = !n[_].hasContent(h - 1) && n[_].getWidth(h - 1) === 1 , d = n[_ + 1].getWidth(0) === 2; return f && d ? h - 1 : h } Object.defineProperty(r, "__esModule", { value: !0 }), r.getWrappedLineTrimmedLength = r.reflowSmallerGetNewLineLengths = r.reflowLargerApplyNewLayout = r.reflowLargerCreateNewLayout = r.reflowLargerGetLinesToRemove = void 0, r.reflowLargerGetLinesToRemove = function (n, _, h, f, d) { const l = []; for (let o = 0; o < n.length - 1; o++) { let t = o , s = n.get(++t); if (!s.isWrapped) continue; const e = [n.get(o)]; for (; t < n.length && s.isWrapped;) e.push(s), s = n.get(++t); if (f >= o && f < t) { o += e.length - 1; continue } let i = 0 , c = a(e, i, _) , g = 1 , v = 0; for (; g < e.length;) { const u = a(e, g, _) , m = u - v , w = h - c , R = Math.min(m, w); e[i].copyCellsFrom(e[g], v, c, R, !1), c += R, c === h && (i++, c = 0), v += R, v === u && (g++, v = 0), c === 0 && i !== 0 && e[i - 1].getWidth(h - 1) === 2 && (e[i].copyCellsFrom(e[i - 1], h - 1, c++, 1, !1), e[i - 1].setCell(h - 1, d)) } e[i].replaceCells(c, h, d); let S = 0; for (let u = e.length - 1; u > 0 && (u > i || e[u].getTrimmedLength() === 0); u--) S++; S > 0 && (l.push(o + e.length - S), l.push(S)), o += e.length - 1 } return l } , r.reflowLargerCreateNewLayout = function (n, _) { const h = []; let f = 0 , d = _[f] , l = 0; for (let o = 0; o < n.length; o++) if (d === o) { const t = _[++f]; n.onDeleteEmitter.fire({ index: o - l, amount: t }), o += t - 1, l += t, d = _[++f] } else h.push(o); return { layout: h, countRemoved: l } } , r.reflowLargerApplyNewLayout = function (n, _) { const h = []; for (let f = 0; f < _.length; f++) h.push(n.get(_[f])); for (let f = 0; f < h.length; f++) n.set(f, h[f]); n.length = _.length } , r.reflowSmallerGetNewLineLengths = function (n, _, h) { const f = [] , d = n.map((s, e) => a(n, e, _)).reduce((s, e) => s + e); let l = 0 , o = 0 , t = 0; for (; t < d;) { if (d - t < h) { f.push(d - t); break } l += h; const s = a(n, o, _); l > s && (l -= s, o++); const e = n[o].getWidth(l - 1) === 2; e && l--; const i = e ? h - 1 : h; f.push(i), t += i } return f } , r.getWrappedLineTrimmedLength = a } , 5295: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferSet = void 0; const n = a(9092) , _ = a(8460) , h = a(844); class f extends h.Disposable { constructor(l, o) { super(), this._optionsService = l, this._bufferService = o, this._onBufferActivate = this.register(new _.EventEmitter), this.reset() } get onBufferActivate() { return this._onBufferActivate.event } reset() { this._normal = new n.Buffer(!0, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new n.Buffer(!1, this._optionsService, this._bufferService), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }), this.setupTabStops() } get alt() { return this._alt } get active() { return this._activeBuffer } get normal() { return this._normal } activateNormalBuffer() { this._activeBuffer !== this._normal && (this._normal.x = this._alt.x, this._normal.y = this._alt.y, this._alt.clearAllMarkers(), this._alt.clear(), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt })) } activateAltBuffer(l) { this._activeBuffer !== this._alt && (this._alt.fillViewportRows(l), 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(l, o) { this._normal.resize(l, o), this._alt.resize(l, o) } setupTabStops(l) { this._normal.setupTabStops(l), this._alt.setupTabStops(l) } } r.BufferSet = f } , 511: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.CellData = void 0; const n = a(482) , _ = a(643) , h = a(3734); class f extends h.AttributeData { constructor() { super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new h.ExtendedAttrs, this.combinedData = "" } static fromCharData(l) { const o = new f; return o.setFromCharData(l), o } isCombined() { return 2097152 & this.content } getWidth() { return this.content >> 22 } getChars() { return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, n.stringFromCodePoint)(2097151 & this.content) : "" } getCode() { return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content } setFromCharData(l) { this.fg = l[_.CHAR_DATA_ATTR_INDEX], this.bg = 0; let o = !1; if (l[_.CHAR_DATA_CHAR_INDEX].length > 2) o = !0; else if (l[_.CHAR_DATA_CHAR_INDEX].length === 2) { const t = l[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0); if (55296 <= t && t <= 56319) { const s = l[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1); 56320 <= s && s <= 57343 ? this.content = 1024 * (t - 55296) + s - 56320 + 65536 | l[_.CHAR_DATA_WIDTH_INDEX] << 22 : o = !0 } else o = !0 } else this.content = l[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | l[_.CHAR_DATA_WIDTH_INDEX] << 22; o && (this.combinedData = l[_.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | l[_.CHAR_DATA_WIDTH_INDEX] << 22) } getAsCharData() { return [this.fg, this.getChars(), this.getWidth(), this.getCode()] } } r.CellData = f } , 643: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.WHITESPACE_CELL_CODE = r.WHITESPACE_CELL_WIDTH = r.WHITESPACE_CELL_CHAR = r.NULL_CELL_CODE = r.NULL_CELL_WIDTH = r.NULL_CELL_CHAR = r.CHAR_DATA_CODE_INDEX = r.CHAR_DATA_WIDTH_INDEX = r.CHAR_DATA_CHAR_INDEX = r.CHAR_DATA_ATTR_INDEX = r.DEFAULT_EXT = r.DEFAULT_ATTR = r.DEFAULT_COLOR = void 0, r.DEFAULT_COLOR = 256, r.DEFAULT_ATTR = 256 | r.DEFAULT_COLOR << 9, r.DEFAULT_EXT = 0, r.CHAR_DATA_ATTR_INDEX = 0, r.CHAR_DATA_CHAR_INDEX = 1, r.CHAR_DATA_WIDTH_INDEX = 2, r.CHAR_DATA_CODE_INDEX = 3, r.NULL_CELL_CHAR = "", r.NULL_CELL_WIDTH = 1, r.NULL_CELL_CODE = 0, r.WHITESPACE_CELL_CHAR = " ", r.WHITESPACE_CELL_WIDTH = 1, r.WHITESPACE_CELL_CODE = 32 } , 4863: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.Marker = void 0; const n = a(8460) , _ = a(844); class h extends _.Disposable { constructor(d) { super(), this.line = d, this._id = h._nextId++, this.isDisposed = !1, this._onDispose = new n.EventEmitter } get id() { return this._id } get onDispose() { return this._onDispose.event } dispose() { this.isDisposed || (this.isDisposed = !0, this.line = -1, this._onDispose.fire(), super.dispose()) } } r.Marker = h, h._nextId = 1 } , 7116: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.DEFAULT_CHARSET = r.CHARSETS = void 0, r.CHARSETS = {}, r.DEFAULT_CHARSET = r.CHARSETS.B, r.CHARSETS[0] = { "`": "\u25C6", a: "\u2592", b: "\u2409", c: "\u240C", d: "\u240D", e: "\u240A", f: "\xB0", g: "\xB1", h: "\u2424", i: "\u240B", j: "\u2518", k: "\u2510", l: "\u250C", m: "\u2514", n: "\u253C", o: "\u23BA", p: "\u23BB", q: "\u2500", r: "\u23BC", s: "\u23BD", t: "\u251C", u: "\u2524", v: "\u2534", w: "\u252C", x: "\u2502", y: "\u2264", z: "\u2265", "{": "\u03C0", "|": "\u2260", "}": "\xA3", "~": "\xB7" }, r.CHARSETS.A = { "#": "\xA3" }, r.CHARSETS.B = void 0, r.CHARSETS[4] = { "#": "\xA3", "@": "\xBE", "[": "ij", "\\": "\xBD", "]": "|", "{": "\xA8", "|": "f", "}": "\xBC", "~": "\xB4" }, r.CHARSETS.C = r.CHARSETS[5] = { "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, r.CHARSETS.R = { "#": "\xA3", "@": "\xE0", "[": "\xB0", "\\": "\xE7", "]": "\xA7", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xA8" }, r.CHARSETS.Q = { "@": "\xE0", "[": "\xE2", "\\": "\xE7", "]": "\xEA", "^": "\xEE", "`": "\xF4", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xFB" }, r.CHARSETS.K = { "@": "\xA7", "[": "\xC4", "\\": "\xD6", "]": "\xDC", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xDF" }, r.CHARSETS.Y = { "#": "\xA3", "@": "\xA7", "[": "\xB0", "\\": "\xE7", "]": "\xE9", "`": "\xF9", "{": "\xE0", "|": "\xF2", "}": "\xE8", "~": "\xEC" }, r.CHARSETS.E = r.CHARSETS[6] = { "@": "\xC4", "[": "\xC6", "\\": "\xD8", "]": "\xC5", "^": "\xDC", "`": "\xE4", "{": "\xE6", "|": "\xF8", "}": "\xE5", "~": "\xFC" }, r.CHARSETS.Z = { "#": "\xA3", "@": "\xA7", "[": "\xA1", "\\": "\xD1", "]": "\xBF", "{": "\xB0", "|": "\xF1", "}": "\xE7" }, r.CHARSETS.H = r.CHARSETS[7] = { "@": "\xC9", "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, r.CHARSETS["="] = { "#": "\xF9", "@": "\xE0", "[": "\xE9", "\\": "\xE7", "]": "\xEA", "^": "\xEE", _: "\xE8", "`": "\xF4", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xFB" } } , 2584: (x, r) => { var a, n; Object.defineProperty(r, "__esModule", { value: !0 }), r.C1_ESCAPED = r.C1 = r.C0 = void 0, function (_) { _.NUL = "\0", _.SOH = "", _.STX = "", _.ETX = "", _.EOT = "", _.ENQ = "", _.ACK = "", _.BEL = "\x07", _.BS = "\b", _.HT = " ", _.LF = ` `, _.VT = "\v", _.FF = "\f", _.CR = "\r", _.SO = "", _.SI = "", _.DLE = "", _.DC1 = "", _.DC2 = "", _.DC3 = "", _.DC4 = "", _.NAK = "", _.SYN = "", _.ETB = "", _.CAN = "", _.EM = "", _.SUB = "", _.ESC = "\x1B", _.FS = "", _.GS = "", _.RS = "", _.US = "", _.SP = " ", _.DEL = "\x7F" }(a = r.C0 || (r.C0 = {})), (n = r.C1 || (r.C1 = {})).PAD = "\x80", n.HOP = "\x81", n.BPH = "\x82", n.NBH = "\x83", n.IND = "\x84", n.NEL = "\x85", n.SSA = "\x86", n.ESA = "\x87", n.HTS = "\x88", n.HTJ = "\x89", n.VTS = "\x8A", n.PLD = "\x8B", n.PLU = "\x8C", n.RI = "\x8D", n.SS2 = "\x8E", n.SS3 = "\x8F", n.DCS = "\x90", n.PU1 = "\x91", n.PU2 = "\x92", n.STS = "\x93", n.CCH = "\x94", n.MW = "\x95", n.SPA = "\x96", n.EPA = "\x97", n.SOS = "\x98", n.SGCI = "\x99", n.SCI = "\x9A", n.CSI = "\x9B", n.ST = "\x9C", n.OSC = "\x9D", n.PM = "\x9E", n.APC = "\x9F", (r.C1_ESCAPED || (r.C1_ESCAPED = {})).ST = `${a.ESC}\\` } , 7399: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.evaluateKeyboardEvent = void 0; const n = a(2584) , _ = { 48: ["0", ")"], 49: ["1", "!"], 50: ["2", "@"], 51: ["3", "#"], 52: ["4", "$"], 53: ["5", "%"], 54: ["6", "^"], 55: ["7", "&"], 56: ["8", "*"], 57: ["9", "("], 186: [";", ":"], 187: ["=", "+"], 188: [",", "<"], 189: ["-", "_"], 190: [".", ">"], 191: ["/", "?"], 192: ["`", "~"], 219: ["[", "{"], 220: ["\\", "|"], 221: ["]", "}"], 222: ["'", '"'] }; r.evaluateKeyboardEvent = function (h, f, d, l) { const o = { type: 0, cancel: !1, key: void 0 } , t = (h.shiftKey ? 1 : 0) | (h.altKey ? 2 : 0) | (h.ctrlKey ? 4 : 0) | (h.metaKey ? 8 : 0); switch (h.keyCode) { case 0: h.key === "UIKeyInputUpArrow" ? o.key = f ? n.C0.ESC + "OA" : n.C0.ESC + "[A" : h.key === "UIKeyInputLeftArrow" ? o.key = f ? n.C0.ESC + "OD" : n.C0.ESC + "[D" : h.key === "UIKeyInputRightArrow" ? o.key = f ? n.C0.ESC + "OC" : n.C0.ESC + "[C" : h.key === "UIKeyInputDownArrow" && (o.key = f ? n.C0.ESC + "OB" : n.C0.ESC + "[B"); break; case 8: if (h.altKey) { o.key = n.C0.ESC + n.C0.DEL; break } o.key = n.C0.DEL; break; case 9: if (h.shiftKey) { o.key = n.C0.ESC + "[Z"; break } o.key = n.C0.HT, o.cancel = !0; break; case 13: o.key = h.altKey ? n.C0.ESC + n.C0.CR : n.C0.CR, o.cancel = !0; break; case 27: o.key = n.C0.ESC, h.altKey && (o.key = n.C0.ESC + n.C0.ESC), o.cancel = !0; break; case 37: if (h.metaKey) break; t ? (o.key = n.C0.ESC + "[1;" + (t + 1) + "D", o.key === n.C0.ESC + "[1;3D" && (o.key = n.C0.ESC + (d ? "b" : "[1;5D"))) : o.key = f ? n.C0.ESC + "OD" : n.C0.ESC + "[D"; break; case 39: if (h.metaKey) break; t ? (o.key = n.C0.ESC + "[1;" + (t + 1) + "C", o.key === n.C0.ESC + "[1;3C" && (o.key = n.C0.ESC + (d ? "f" : "[1;5C"))) : o.key = f ? n.C0.ESC + "OC" : n.C0.ESC + "[C"; break; case 38: if (h.metaKey) break; t ? (o.key = n.C0.ESC + "[1;" + (t + 1) + "A", d || o.key !== n.C0.ESC + "[1;3A" || (o.key = n.C0.ESC + "[1;5A")) : o.key = f ? n.C0.ESC + "OA" : n.C0.ESC + "[A"; break; case 40: if (h.metaKey) break; t ? (o.key = n.C0.ESC + "[1;" + (t + 1) + "B", d || o.key !== n.C0.ESC + "[1;3B" || (o.key = n.C0.ESC + "[1;5B")) : o.key = f ? n.C0.ESC + "OB" : n.C0.ESC + "[B"; break; case 45: h.shiftKey || h.ctrlKey || (o.key = n.C0.ESC + "[2~"); break; case 46: o.key = t ? n.C0.ESC + "[3;" + (t + 1) + "~" : n.C0.ESC + "[3~"; break; case 36: o.key = t ? n.C0.ESC + "[1;" + (t + 1) + "H" : f ? n.C0.ESC + "OH" : n.C0.ESC + "[H"; break; case 35: o.key = t ? n.C0.ESC + "[1;" + (t + 1) + "F" : f ? n.C0.ESC + "OF" : n.C0.ESC + "[F"; break; case 33: h.shiftKey ? o.type = 2 : h.ctrlKey ? o.key = n.C0.ESC + "[5;" + (t + 1) + "~" : o.key = n.C0.ESC + "[5~"; break; case 34: h.shiftKey ? o.type = 3 : h.ctrlKey ? o.key = n.C0.ESC + "[6;" + (t + 1) + "~" : o.key = n.C0.ESC + "[6~"; break; case 112: o.key = t ? n.C0.ESC + "[1;" + (t + 1) + "P" : n.C0.ESC + "OP"; break; case 113: o.key = t ? n.C0.ESC + "[1;" + (t + 1) + "Q" : n.C0.ESC + "OQ"; break; case 114: o.key = t ? n.C0.ESC + "[1;" + (t + 1) + "R" : n.C0.ESC + "OR"; break; case 115: o.key = t ? n.C0.ESC + "[1;" + (t + 1) + "S" : n.C0.ESC + "OS"; break; case 116: o.key = t ? n.C0.ESC + "[15;" + (t + 1) + "~" : n.C0.ESC + "[15~"; break; case 117: o.key = t ? n.C0.ESC + "[17;" + (t + 1) + "~" : n.C0.ESC + "[17~"; break; case 118: o.key = t ? n.C0.ESC + "[18;" + (t + 1) + "~" : n.C0.ESC + "[18~"; break; case 119: o.key = t ? n.C0.ESC + "[19;" + (t + 1) + "~" : n.C0.ESC + "[19~"; break; case 120: o.key = t ? n.C0.ESC + "[20;" + (t + 1) + "~" : n.C0.ESC + "[20~"; break; case 121: o.key = t ? n.C0.ESC + "[21;" + (t + 1) + "~" : n.C0.ESC + "[21~"; break; case 122: o.key = t ? n.C0.ESC + "[23;" + (t + 1) + "~" : n.C0.ESC + "[23~"; break; case 123: o.key = t ? n.C0.ESC + "[24;" + (t + 1) + "~" : n.C0.ESC + "[24~"; break; default: if (!h.ctrlKey || h.shiftKey || h.altKey || h.metaKey) if (d && !l || !h.altKey || h.metaKey) !d || h.altKey || h.ctrlKey || h.shiftKey || !h.metaKey ? h.key && !h.ctrlKey && !h.altKey && !h.metaKey && h.keyCode >= 48 && h.key.length === 1 ? o.key = h.key : h.key && h.ctrlKey && (h.key === "_" && (o.key = n.C0.US), h.key === "@" && (o.key = n.C0.NUL)) : h.keyCode === 65 && (o.type = 1); else { const s = _[h.keyCode] , e = s == null ? void 0 : s[h.shiftKey ? 1 : 0]; if (e) o.key = n.C0.ESC + e; else if (h.keyCode >= 65 && h.keyCode <= 90) { const i = h.ctrlKey ? h.keyCode - 64 : h.keyCode + 32; let c = String.fromCharCode(i); h.shiftKey && (c = c.toUpperCase()), o.key = n.C0.ESC + c } else if (h.key === "Dead" && h.code.startsWith("Key")) { let i = h.code.slice(3, 4); h.shiftKey || (i = i.toLowerCase()), o.key = n.C0.ESC + i, o.cancel = !0 } } else h.keyCode >= 65 && h.keyCode <= 90 ? o.key = String.fromCharCode(h.keyCode - 64) : h.keyCode === 32 ? o.key = n.C0.NUL : h.keyCode >= 51 && h.keyCode <= 55 ? o.key = String.fromCharCode(h.keyCode - 51 + 27) : h.keyCode === 56 ? o.key = n.C0.DEL : h.keyCode === 219 ? o.key = n.C0.ESC : h.keyCode === 220 ? o.key = n.C0.FS : h.keyCode === 221 && (o.key = n.C0.GS) } return o } } , 482: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.Utf8ToUtf32 = r.StringToUtf32 = r.utf32ToString = r.stringFromCodePoint = void 0, r.stringFromCodePoint = function (a) { return a > 65535 ? (a -= 65536, String.fromCharCode(55296 + (a >> 10)) + String.fromCharCode(a % 1024 + 56320)) : String.fromCharCode(a) } , r.utf32ToString = function (a, n = 0, _ = a.length) { let h = ""; for (let f = n; f < _; ++f) { let d = a[f]; d > 65535 ? (d -= 65536, h += String.fromCharCode(55296 + (d >> 10)) + String.fromCharCode(d % 1024 + 56320)) : h += String.fromCharCode(d) } return h } , r.StringToUtf32 = class { constructor() { this._interim = 0 } clear() { this._interim = 0 } decode(a, n) { const _ = a.length; if (!_) return 0; let h = 0 , f = 0; if (this._interim) { const d = a.charCodeAt(f++); 56320 <= d && d <= 57343 ? n[h++] = 1024 * (this._interim - 55296) + d - 56320 + 65536 : (n[h++] = this._interim, n[h++] = d), this._interim = 0 } for (let d = f; d < _; ++d) { const l = a.charCodeAt(d); if (55296 <= l && l <= 56319) { if (++d >= _) return this._interim = l, h; const o = a.charCodeAt(d); 56320 <= o && o <= 57343 ? n[h++] = 1024 * (l - 55296) + o - 56320 + 65536 : (n[h++] = l, n[h++] = o) } else l !== 65279 && (n[h++] = l) } return h } } , r.Utf8ToUtf32 = class { constructor() { this.interim = new Uint8Array(3) } clear() { this.interim.fill(0) } decode(a, n) { const _ = a.length; if (!_) return 0; let h, f, d, l, o = 0, t = 0, s = 0; if (this.interim[0]) { let c = !1 , g = this.interim[0]; g &= (224 & g) == 192 ? 31 : (240 & g) == 224 ? 15 : 7; let v, S = 0; for (; (v = 63 & this.interim[++S]) && S < 4;) g <<= 6, g |= v; const u = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4 , m = u - S; for (; s < m;) { if (s >= _) return 0; if (v = a[s++], (192 & v) != 128) { s--, c = !0; break } this.interim[S++] = v, g <<= 6, g |= 63 & v } c || (u === 2 ? g < 128 ? s-- : n[o++] = g : u === 3 ? g < 2048 || g >= 55296 && g <= 57343 || g === 65279 || (n[o++] = g) : g < 65536 || g > 1114111 || (n[o++] = g)), this.interim.fill(0) } const e = _ - 4; let i = s; for (; i < _;) { for (; !(!(i < e) || 128 & (h = a[i]) || 128 & (f = a[i + 1]) || 128 & (d = a[i + 2]) || 128 & (l = a[i + 3]));) n[o++] = h, n[o++] = f, n[o++] = d, n[o++] = l, i += 4; if (h = a[i++], h < 128) n[o++] = h; else if ((224 & h) == 192) { if (i >= _) return this.interim[0] = h, o; if (f = a[i++], (192 & f) != 128) { i--; continue } if (t = (31 & h) << 6 | 63 & f, t < 128) { i--; continue } n[o++] = t } else if ((240 & h) == 224) { if (i >= _) return this.interim[0] = h, o; if (f = a[i++], (192 & f) != 128) { i--; continue } if (i >= _) return this.interim[0] = h, this.interim[1] = f, o; if (d = a[i++], (192 & d) != 128) { i--; continue } if (t = (15 & h) << 12 | (63 & f) << 6 | 63 & d, t < 2048 || t >= 55296 && t <= 57343 || t === 65279) continue; n[o++] = t } else if ((248 & h) == 240) { if (i >= _) return this.interim[0] = h, o; if (f = a[i++], (192 & f) != 128) { i--; continue } if (i >= _) return this.interim[0] = h, this.interim[1] = f, o; if (d = a[i++], (192 & d) != 128) { i--; continue } if (i >= _) return this.interim[0] = h, this.interim[1] = f, this.interim[2] = d, o; if (l = a[i++], (192 & l) != 128) { i--; continue } if (t = (7 & h) << 18 | (63 & f) << 12 | (63 & d) << 6 | 63 & l, t < 65536 || t > 1114111) continue; n[o++] = t } } return o } } } , 225: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.UnicodeV6 = void 0; const n = a(8273) , _ = [[768, 879], [1155, 1158], [1160, 1161], [1425, 1469], [1471, 1471], [1473, 1474], [1476, 1477], [1479, 1479], [1536, 1539], [1552, 1557], [1611, 1630], [1648, 1648], [1750, 1764], [1767, 1768], [1770, 1773], [1807, 1807], [1809, 1809], [1840, 1866], [1958, 1968], [2027, 2035], [2305, 2306], [2364, 2364], [2369, 2376], [2381, 2381], [2385, 2388], [2402, 2403], [2433, 2433], [2492, 2492], [2497, 2500], [2509, 2509], [2530, 2531], [2561, 2562], [2620, 2620], [2625, 2626], [2631, 2632], [2635, 2637], [2672, 2673], [2689, 2690], [2748, 2748], [2753, 2757], [2759, 2760], [2765, 2765], [2786, 2787], [2817, 2817], [2876, 2876], [2879, 2879], [2881, 2883], [2893, 2893], [2902, 2902], [2946, 2946], [3008, 3008], [3021, 3021], [3134, 3136], [3142, 3144], [3146, 3149], [3157, 3158], [3260, 3260], [3263, 3263], [3270, 3270], [3276, 3277], [3298, 3299], [3393, 3395], [3405, 3405], [3530, 3530], [3538, 3540], [3542, 3542], [3633, 3633], [3636, 3642], [3655, 3662], [3761, 3761], [3764, 3769], [3771, 3772], [3784, 3789], [3864, 3865], [3893, 3893], [3895, 3895], [3897, 3897], [3953, 3966], [3968, 3972], [3974, 3975], [3984, 3991], [3993, 4028], [4038, 4038], [4141, 4144], [4146, 4146], [4150, 4151], [4153, 4153], [4184, 4185], [4448, 4607], [4959, 4959], [5906, 5908], [5938, 5940], [5970, 5971], [6002, 6003], [6068, 6069], [6071, 6077], [6086, 6086], [6089, 6099], [6109, 6109], [6155, 6157], [6313, 6313], [6432, 6434], [6439, 6440], [6450, 6450], [6457, 6459], [6679, 6680], [6912, 6915], [6964, 6964], [6966, 6970], [6972, 6972], [6978, 6978], [7019, 7027], [7616, 7626], [7678, 7679], [8203, 8207], [8234, 8238], [8288, 8291], [8298, 8303], [8400, 8431], [12330, 12335], [12441, 12442], [43014, 43014], [43019, 43019], [43045, 43046], [64286, 64286], [65024, 65039], [65056, 65059], [65279, 65279], [65529, 65531]] , h = [[68097, 68099], [68101, 68102], [68108, 68111], [68152, 68154], [68159, 68159], [119143, 119145], [119155, 119170], [119173, 119179], [119210, 119213], [119362, 119364], [917505, 917505], [917536, 917631], [917760, 917999]]; let f; r.UnicodeV6 = class { constructor() { if (this.version = "6", !f) { f = new Uint8Array(65536), (0, n.fill)(f, 1), f[0] = 0, (0, n.fill)(f, 0, 1, 32), (0, n.fill)(f, 0, 127, 160), (0, n.fill)(f, 2, 4352, 4448), f[9001] = 2, f[9002] = 2, (0, n.fill)(f, 2, 11904, 42192), f[12351] = 1, (0, n.fill)(f, 2, 44032, 55204), (0, n.fill)(f, 2, 63744, 64256), (0, n.fill)(f, 2, 65040, 65050), (0, n.fill)(f, 2, 65072, 65136), (0, n.fill)(f, 2, 65280, 65377), (0, n.fill)(f, 2, 65504, 65511); for (let d = 0; d < _.length; ++d) (0, n.fill)(f, 0, _[d][0], _[d][1] + 1) } } wcwidth(d) { return d < 32 ? 0 : d < 127 ? 1 : d < 65536 ? f[d] : function (l, o) { let t, s = 0, e = o.length - 1; if (l < o[0][0] || l > o[e][1]) return !1; for (; e >= s;) if (t = s + e >> 1, l > o[t][1]) s = t + 1; else { if (!(l < o[t][0])) return !0; e = t - 1 } return !1 }(d, h) ? 0 : d >= 131072 && d <= 196605 || d >= 196608 && d <= 262141 ? 2 : 1 } } } , 5981: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.WriteBuffer = void 0; const n = a(8460) , _ = typeof queueMicrotask > "u" ? h => { Promise.resolve().then(h) } : queueMicrotask; r.WriteBuffer = class { constructor(h) { this._action = h, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = !1, this._syncCalls = 0, this._onWriteParsed = new n.EventEmitter } get onWriteParsed() { return this._onWriteParsed.event } writeSync(h, f) { if (f !== void 0 && this._syncCalls > f) return void (this._syncCalls = 0); if (this._pendingData += h.length, this._writeBuffer.push(h), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return; let d; for (this._isSyncWriting = !0; d = this._writeBuffer.shift();) { this._action(d); const l = this._callbacks.shift(); l && l() } this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = !1, this._syncCalls = 0 } write(h, f) { if (this._pendingData > 5e7) throw new Error("write data discarded, use flow control to avoid losing data"); this._writeBuffer.length || (this._bufferOffset = 0, setTimeout(() => this._innerWrite())), this._pendingData += h.length, this._writeBuffer.push(h), this._callbacks.push(f) } _innerWrite(h = 0, f = !0) { const d = h || Date.now(); for (; this._writeBuffer.length > this._bufferOffset;) { const l = this._writeBuffer[this._bufferOffset] , o = this._action(l, f); if (o) { const s = e => Date.now() - d >= 12 ? setTimeout(() => this._innerWrite(0, e)) : this._innerWrite(d, e); return void o.catch(e => (_(() => { throw e } ), Promise.resolve(!1))).then(s) } const t = this._callbacks[this._bufferOffset]; if (t && t(), this._bufferOffset++, this._pendingData -= l.length, Date.now() - d >= 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() } } } , 5941: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.toRgbString = r.parseColor = void 0; const a = /^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/ , n = /^[\da-f]+$/; function _(h, f) { const d = h.toString(16) , l = d.length < 2 ? "0" + d : d; switch (f) { case 4: return d[0]; case 8: return l; case 12: return (l + l).slice(0, 3); default: return l + l } } r.parseColor = function (h) { if (!h) return; let f = h.toLowerCase(); if (f.indexOf("rgb:") === 0) { f = f.slice(4); const d = a.exec(f); if (d) { const l = d[1] ? 15 : d[4] ? 255 : d[7] ? 4095 : 65535; return [Math.round(parseInt(d[1] || d[4] || d[7] || d[10], 16) / l * 255), Math.round(parseInt(d[2] || d[5] || d[8] || d[11], 16) / l * 255), Math.round(parseInt(d[3] || d[6] || d[9] || d[12], 16) / l * 255)] } } else if (f.indexOf("#") === 0 && (f = f.slice(1), n.exec(f) && [3, 6, 9, 12].includes(f.length))) { const d = f.length / 3 , l = [0, 0, 0]; for (let o = 0; o < 3; ++o) { const t = parseInt(f.slice(d * o, d * o + d), 16); l[o] = d === 1 ? t << 4 : d === 2 ? t : d === 3 ? t >> 4 : t >> 8 } return l } } , r.toRgbString = function (h, f = 16) { const [d, l, o] = h; return `rgb:${_(d, f)}/${_(l, f)}/${_(o, f)}` } } , 5770: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.PAYLOAD_LIMIT = void 0, r.PAYLOAD_LIMIT = 1e7 } , 6351: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.DcsHandler = r.DcsParser = void 0; const n = a(482) , _ = a(8742) , h = a(5770) , f = []; r.DcsParser = class { constructor() { this._handlers = Object.create(null), this._active = f, this._ident = 0, this._handlerFb = () => { } , this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 } } dispose() { this._handlers = Object.create(null), this._handlerFb = () => { } , this._active = f } registerHandler(l, o) { this._handlers[l] === void 0 && (this._handlers[l] = []); const t = this._handlers[l]; return t.push(o), { dispose: () => { const s = t.indexOf(o); s !== -1 && t.splice(s, 1) } } } clearHandler(l) { this._handlers[l] && delete this._handlers[l] } setHandlerFallback(l) { this._handlerFb = l } reset() { if (this._active.length) for (let l = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; l >= 0; --l) this._active[l].unhook(!1); this._stack.paused = !1, this._active = f, this._ident = 0 } hook(l, o) { if (this.reset(), this._ident = l, this._active = this._handlers[l] || f, this._active.length) for (let t = this._active.length - 1; t >= 0; t--) this._active[t].hook(o); else this._handlerFb(this._ident, "HOOK", o) } put(l, o, t) { if (this._active.length) for (let s = this._active.length - 1; s >= 0; s--) this._active[s].put(l, o, t); else this._handlerFb(this._ident, "PUT", (0, n.utf32ToString)(l, o, t)) } unhook(l, o = !0) { if (this._active.length) { let t = !1 , s = this._active.length - 1 , e = !1; if (this._stack.paused && (s = this._stack.loopPosition - 1, t = o, e = this._stack.fallThrough, this._stack.paused = !1), !e && t === !1) { for (; s >= 0 && (t = this._active[s].unhook(l), t !== !0); s--) if (t instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s, this._stack.fallThrough = !1, t; s-- } for (; s >= 0; s--) if (t = this._active[s].unhook(!1), t instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s, this._stack.fallThrough = !0, t } else this._handlerFb(this._ident, "UNHOOK", l); this._active = f, this._ident = 0 } } ; const d = new _.Params; d.addParam(0), r.DcsHandler = class { constructor(l) { this._handler = l, this._data = "", this._params = d, this._hitLimit = !1 } hook(l) { this._params = l.length > 1 || l.params[0] ? l.clone() : d, this._data = "", this._hitLimit = !1 } put(l, o, t) { this._hitLimit || (this._data += (0, n.utf32ToString)(l, o, t), this._data.length > h.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0)) } unhook(l) { let o = !1; if (this._hitLimit) o = !1; else if (l && (o = this._handler(this._data, this._params), o instanceof Promise)) return o.then(t => (this._params = d, this._data = "", this._hitLimit = !1, t)); return this._params = d, this._data = "", this._hitLimit = !1, o } } } , 2015: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.EscapeSequenceParser = r.VT500_TRANSITION_TABLE = r.TransitionTable = void 0; const n = a(844) , _ = a(8273) , h = a(8742) , f = a(6242) , d = a(6351); class l { constructor(e) { this.table = new Uint8Array(e) } setDefault(e, i) { (0, _.fill)(this.table, e << 4 | i) } add(e, i, c, g) { this.table[i << 8 | e] = c << 4 | g } addMany(e, i, c, g) { for (let v = 0; v < e.length; v++) this.table[i << 8 | e[v]] = c << 4 | g } } r.TransitionTable = l; const o = 160; r.VT500_TRANSITION_TABLE = function () { const s = new l(4095) , e = Array.apply(null, Array(256)).map((u, m) => m) , i = (u, m) => e.slice(u, m) , c = i(32, 127) , g = i(0, 24); g.push(25), g.push.apply(g, i(28, 32)); const v = i(0, 14); let S; for (S in s.setDefault(1, 0), s.addMany(c, 0, 2, 0), v) s.addMany([24, 26, 153, 154], S, 3, 0), s.addMany(i(128, 144), S, 3, 0), s.addMany(i(144, 152), S, 3, 0), s.add(156, S, 0, 0), s.add(27, S, 11, 1), s.add(157, S, 4, 8), s.addMany([152, 158, 159], S, 0, 7), s.add(155, S, 11, 3), s.add(144, S, 11, 9); return s.addMany(g, 0, 3, 0), s.addMany(g, 1, 3, 1), s.add(127, 1, 0, 1), s.addMany(g, 8, 0, 8), s.addMany(g, 3, 3, 3), s.add(127, 3, 0, 3), s.addMany(g, 4, 3, 4), s.add(127, 4, 0, 4), s.addMany(g, 6, 3, 6), s.addMany(g, 5, 3, 5), s.add(127, 5, 0, 5), s.addMany(g, 2, 3, 2), s.add(127, 2, 0, 2), s.add(93, 1, 4, 8), s.addMany(c, 8, 5, 8), s.add(127, 8, 5, 8), s.addMany([156, 27, 24, 26, 7], 8, 6, 0), s.addMany(i(28, 32), 8, 0, 8), s.addMany([88, 94, 95], 1, 0, 7), s.addMany(c, 7, 0, 7), s.addMany(g, 7, 0, 7), s.add(156, 7, 0, 0), s.add(127, 7, 0, 7), s.add(91, 1, 11, 3), s.addMany(i(64, 127), 3, 7, 0), s.addMany(i(48, 60), 3, 8, 4), s.addMany([60, 61, 62, 63], 3, 9, 4), s.addMany(i(48, 60), 4, 8, 4), s.addMany(i(64, 127), 4, 7, 0), s.addMany([60, 61, 62, 63], 4, 0, 6), s.addMany(i(32, 64), 6, 0, 6), s.add(127, 6, 0, 6), s.addMany(i(64, 127), 6, 0, 0), s.addMany(i(32, 48), 3, 9, 5), s.addMany(i(32, 48), 5, 9, 5), s.addMany(i(48, 64), 5, 0, 6), s.addMany(i(64, 127), 5, 7, 0), s.addMany(i(32, 48), 4, 9, 5), s.addMany(i(32, 48), 1, 9, 2), s.addMany(i(32, 48), 2, 9, 2), s.addMany(i(48, 127), 2, 10, 0), s.addMany(i(48, 80), 1, 10, 0), s.addMany(i(81, 88), 1, 10, 0), s.addMany([89, 90, 92], 1, 10, 0), s.addMany(i(96, 127), 1, 10, 0), s.add(80, 1, 11, 9), s.addMany(g, 9, 0, 9), s.add(127, 9, 0, 9), s.addMany(i(28, 32), 9, 0, 9), s.addMany(i(32, 48), 9, 9, 12), s.addMany(i(48, 60), 9, 8, 10), s.addMany([60, 61, 62, 63], 9, 9, 10), s.addMany(g, 11, 0, 11), s.addMany(i(32, 128), 11, 0, 11), s.addMany(i(28, 32), 11, 0, 11), s.addMany(g, 10, 0, 10), s.add(127, 10, 0, 10), s.addMany(i(28, 32), 10, 0, 10), s.addMany(i(48, 60), 10, 8, 10), s.addMany([60, 61, 62, 63], 10, 0, 11), s.addMany(i(32, 48), 10, 9, 12), s.addMany(g, 12, 0, 12), s.add(127, 12, 0, 12), s.addMany(i(28, 32), 12, 0, 12), s.addMany(i(32, 48), 12, 9, 12), s.addMany(i(48, 64), 12, 0, 11), s.addMany(i(64, 127), 12, 12, 13), s.addMany(i(64, 127), 10, 12, 13), s.addMany(i(64, 127), 9, 12, 13), s.addMany(g, 13, 13, 13), s.addMany(c, 13, 13, 13), s.add(127, 13, 0, 13), s.addMany([27, 156, 24, 26], 13, 14, 0), s.add(o, 0, 2, 0), s.add(o, 8, 5, 8), s.add(o, 6, 0, 6), s.add(o, 11, 0, 11), s.add(o, 13, 13, 13), s }(); class t extends n.Disposable { constructor(e = r.VT500_TRANSITION_TABLE) { super(), this._transitions = e, this._parseStack = { state: 0, handlers: [], handlerPos: 0, transition: 0, chunkPos: 0 }, this.initialState = 0, this.currentState = this.initialState, this._params = new h.Params, this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0, this._printHandlerFb = (i, c, g) => { } , this._executeHandlerFb = i => { } , this._csiHandlerFb = (i, c) => { } , this._escHandlerFb = i => { } , this._errorHandlerFb = i => i, this._printHandler = this._printHandlerFb, this._executeHandlers = Object.create(null), this._csiHandlers = Object.create(null), this._escHandlers = Object.create(null), this._oscParser = new f.OscParser, this._dcsParser = new d.DcsParser, this._errorHandler = this._errorHandlerFb, this.registerEscHandler({ final: "\\" }, () => !0) } _identifier(e, i = [64, 126]) { let c = 0; if (e.prefix) { if (e.prefix.length > 1) throw new Error("only one byte as prefix supported"); if (c = e.prefix.charCodeAt(0), c && 60 > c || c > 63) throw new Error("prefix must be in range 0x3c .. 0x3f") } if (e.intermediates) { if (e.intermediates.length > 2) throw new Error("only two bytes as intermediates are supported"); for (let v = 0; v < e.intermediates.length; ++v) { const S = e.intermediates.charCodeAt(v); if (32 > S || S > 47) throw new Error("intermediate must be in range 0x20 .. 0x2f"); c <<= 8, c |= S } } if (e.final.length !== 1) throw new Error("final must be a single byte"); const g = e.final.charCodeAt(0); if (i[0] > g || g > i[1]) throw new Error(`final must be in range ${i[0]} .. ${i[1]}`); return c <<= 8, c |= g, c } identToString(e) { const i = []; for (; e;) i.push(String.fromCharCode(255 & e)), e >>= 8; return i.reverse().join("") } dispose() { this._csiHandlers = Object.create(null), this._executeHandlers = Object.create(null), this._escHandlers = Object.create(null), this._oscParser.dispose(), this._dcsParser.dispose() } setPrintHandler(e) { this._printHandler = e } clearPrintHandler() { this._printHandler = this._printHandlerFb } registerEscHandler(e, i) { const c = this._identifier(e, [48, 126]); this._escHandlers[c] === void 0 && (this._escHandlers[c] = []); const g = this._escHandlers[c]; return g.push(i), { dispose: () => { const v = g.indexOf(i); v !== -1 && g.splice(v, 1) } } } clearEscHandler(e) { this._escHandlers[this._identifier(e, [48, 126])] && delete this._escHandlers[this._identifier(e, [48, 126])] } setEscHandlerFallback(e) { this._escHandlerFb = e } setExecuteHandler(e, i) { this._executeHandlers[e.charCodeAt(0)] = i } clearExecuteHandler(e) { this._executeHandlers[e.charCodeAt(0)] && delete this._executeHandlers[e.charCodeAt(0)] } setExecuteHandlerFallback(e) { this._executeHandlerFb = e } registerCsiHandler(e, i) { const c = this._identifier(e); this._csiHandlers[c] === void 0 && (this._csiHandlers[c] = []); const g = this._csiHandlers[c]; return g.push(i), { dispose: () => { const v = g.indexOf(i); v !== -1 && g.splice(v, 1) } } } clearCsiHandler(e) { this._csiHandlers[this._identifier(e)] && delete this._csiHandlers[this._identifier(e)] } setCsiHandlerFallback(e) { this._csiHandlerFb = e } registerDcsHandler(e, i) { return this._dcsParser.registerHandler(this._identifier(e), i) } clearDcsHandler(e) { this._dcsParser.clearHandler(this._identifier(e)) } setDcsHandlerFallback(e) { this._dcsParser.setHandlerFallback(e) } registerOscHandler(e, i) { return this._oscParser.registerHandler(e, i) } clearOscHandler(e) { this._oscParser.clearHandler(e) } setOscHandlerFallback(e) { this._oscParser.setHandlerFallback(e) } setErrorHandler(e) { this._errorHandler = e } clearErrorHandler() { this._errorHandler = this._errorHandlerFb } reset() { this.currentState = this.initialState, this._oscParser.reset(), this._dcsParser.reset(), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0, this._parseStack.state !== 0 && (this._parseStack.state = 2, this._parseStack.handlers = []) } _preserveStack(e, i, c, g, v) { this._parseStack.state = e, this._parseStack.handlers = i, this._parseStack.handlerPos = c, this._parseStack.transition = g, this._parseStack.chunkPos = v } parse(e, i, c) { let g, v = 0, S = 0, u = 0; if (this._parseStack.state) if (this._parseStack.state === 2) this._parseStack.state = 0, u = this._parseStack.chunkPos + 1; else { if (c === void 0 || this._parseStack.state === 1) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing"); const m = this._parseStack.handlers; let w = this._parseStack.handlerPos - 1; switch (this._parseStack.state) { case 3: if (c === !1 && w > -1) { for (; w >= 0 && (g = m[w](this._params), g !== !0); w--) if (g instanceof Promise) return this._parseStack.handlerPos = w, g } this._parseStack.handlers = []; break; case 4: if (c === !1 && w > -1) { for (; w >= 0 && (g = m[w](), g !== !0); w--) if (g instanceof Promise) return this._parseStack.handlerPos = w, g } this._parseStack.handlers = []; break; case 6: if (v = e[this._parseStack.chunkPos], g = this._dcsParser.unhook(v !== 24 && v !== 26, c), g) return g; v === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0; break; case 5: if (v = e[this._parseStack.chunkPos], g = this._oscParser.end(v !== 24 && v !== 26, c), g) return g; v === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0 } this._parseStack.state = 0, u = this._parseStack.chunkPos + 1, this.precedingCodepoint = 0, this.currentState = 15 & this._parseStack.transition } for (let m = u; m < i; ++m) { switch (v = e[m], S = this._transitions.table[this.currentState << 8 | (v < 160 ? v : o)], S >> 4) { case 2: for (let C = m + 1; ; ++C) { if (C >= i || (v = e[C]) < 32 || v > 126 && v < o) { this._printHandler(e, m, C), m = C - 1; break } if (++C >= i || (v = e[C]) < 32 || v > 126 && v < o) { this._printHandler(e, m, C), m = C - 1; break } if (++C >= i || (v = e[C]) < 32 || v > 126 && v < o) { this._printHandler(e, m, C), m = C - 1; break } if (++C >= i || (v = e[C]) < 32 || v > 126 && v < o) { this._printHandler(e, m, C), m = C - 1; break } } break; case 3: this._executeHandlers[v] ? this._executeHandlers[v]() : this._executeHandlerFb(v), this.precedingCodepoint = 0; break; case 0: break; case 1: if (this._errorHandler({ position: m, code: v, currentState: this.currentState, collect: this._collect, params: this._params, abort: !1 }).abort) return; break; case 7: const w = this._csiHandlers[this._collect << 8 | v]; let R = w ? w.length - 1 : -1; for (; R >= 0 && (g = w[R](this._params), g !== !0); R--) if (g instanceof Promise) return this._preserveStack(3, w, R, S, m), g; R < 0 && this._csiHandlerFb(this._collect << 8 | v, this._params), this.precedingCodepoint = 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 (++m < i && (v = e[m]) > 47 && v < 60); m--; break; case 9: this._collect <<= 8, this._collect |= v; break; case 10: const L = this._escHandlers[this._collect << 8 | v]; let p = L ? L.length - 1 : -1; for (; p >= 0 && (g = L[p](), g !== !0); p--) if (g instanceof Promise) return this._preserveStack(4, L, p, S, m), g; p < 0 && this._escHandlerFb(this._collect << 8 | v), this.precedingCodepoint = 0; break; case 11: this._params.reset(), this._params.addParam(0), this._collect = 0; break; case 12: this._dcsParser.hook(this._collect << 8 | v, this._params); break; case 13: for (let C = m + 1; ; ++C) if (C >= i || (v = e[C]) === 24 || v === 26 || v === 27 || v > 127 && v < o) { this._dcsParser.put(e, m, C), m = C - 1; break } break; case 14: if (g = this._dcsParser.unhook(v !== 24 && v !== 26), g) return this._preserveStack(6, [], 0, S, m), g; v === 27 && (S |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0; break; case 4: this._oscParser.start(); break; case 5: for (let C = m + 1; ; C++) if (C >= i || (v = e[C]) < 32 || v > 127 && v < o) { this._oscParser.put(e, m, C), m = C - 1; break } break; case 6: if (g = this._oscParser.end(v !== 24 && v !== 26), g) return this._preserveStack(5, [], 0, S, m), g; v === 27 && (S |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingCodepoint = 0 } this.currentState = 15 & S } } } r.EscapeSequenceParser = t } , 6242: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.OscHandler = r.OscParser = void 0; const n = a(5770) , _ = a(482) , h = []; r.OscParser = class { constructor() { this._state = 0, this._active = h, this._id = -1, this._handlers = Object.create(null), this._handlerFb = () => { } , this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 } } registerHandler(f, d) { this._handlers[f] === void 0 && (this._handlers[f] = []); const l = this._handlers[f]; return l.push(d), { dispose: () => { const o = l.indexOf(d); o !== -1 && l.splice(o, 1) } } } clearHandler(f) { this._handlers[f] && delete this._handlers[f] } setHandlerFallback(f) { this._handlerFb = f } dispose() { this._handlers = Object.create(null), this._handlerFb = () => { } , this._active = h } reset() { if (this._state === 2) for (let f = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; f >= 0; --f) this._active[f].end(!1); this._stack.paused = !1, this._active = h, this._id = -1, this._state = 0 } _start() { if (this._active = this._handlers[this._id] || h, this._active.length) for (let f = this._active.length - 1; f >= 0; f--) this._active[f].start(); else this._handlerFb(this._id, "START") } _put(f, d, l) { if (this._active.length) for (let o = this._active.length - 1; o >= 0; o--) this._active[o].put(f, d, l); else this._handlerFb(this._id, "PUT", (0, _.utf32ToString)(f, d, l)) } start() { this.reset(), this._state = 1 } put(f, d, l) { if (this._state !== 3) { if (this._state === 1) for (; d < l;) { const o = f[d++]; if (o === 59) { this._state = 2, this._start(); break } if (o < 48 || 57 < o) return void (this._state = 3); this._id === -1 && (this._id = 0), this._id = 10 * this._id + o - 48 } this._state === 2 && l - d > 0 && this._put(f, d, l) } } end(f, d = !0) { if (this._state !== 0) { if (this._state !== 3) if (this._state === 1 && this._start(), this._active.length) { let l = !1 , o = this._active.length - 1 , t = !1; if (this._stack.paused && (o = this._stack.loopPosition - 1, l = d, t = this._stack.fallThrough, this._stack.paused = !1), !t && l === !1) { for (; o >= 0 && (l = this._active[o].end(f), l !== !0); o--) if (l instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = o, this._stack.fallThrough = !1, l; o-- } for (; o >= 0; o--) if (l = this._active[o].end(!1), l instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = o, this._stack.fallThrough = !0, l } else this._handlerFb(this._id, "END", f); this._active = h, this._id = -1, this._state = 0 } } } , r.OscHandler = class { constructor(f) { this._handler = f, this._data = "", this._hitLimit = !1 } start() { this._data = "", this._hitLimit = !1 } put(f, d, l) { this._hitLimit || (this._data += (0, _.utf32ToString)(f, d, l), this._data.length > n.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0)) } end(f) { let d = !1; if (this._hitLimit) d = !1; else if (f && (d = this._handler(this._data), d instanceof Promise)) return d.then(l => (this._data = "", this._hitLimit = !1, l)); return this._data = "", this._hitLimit = !1, d } } } , 8742: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.Params = void 0; const a = 2147483647; class n { constructor(h = 32, f = 32) { if (this.maxLength = h, this.maxSubParamsLength = f, f > 256) throw new Error("maxSubParamsLength must not be greater than 256"); this.params = new Int32Array(h), this.length = 0, this._subParams = new Int32Array(f), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(h), this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1 } static fromArray(h) { const f = new n; if (!h.length) return f; for (let d = Array.isArray(h[0]) ? 1 : 0; d < h.length; ++d) { const l = h[d]; if (Array.isArray(l)) for (let o = 0; o < l.length; ++o) f.addSubParam(l[o]); else f.addParam(l) } return f } clone() { const h = new n(this.maxLength, this.maxSubParamsLength); return h.params.set(this.params), h.length = this.length, h._subParams.set(this._subParams), h._subParamsLength = this._subParamsLength, h._subParamsIdx.set(this._subParamsIdx), h._rejectDigits = this._rejectDigits, h._rejectSubDigits = this._rejectSubDigits, h._digitIsSub = this._digitIsSub, h } toArray() { const h = []; for (let f = 0; f < this.length; ++f) { h.push(this.params[f]); const d = this._subParamsIdx[f] >> 8 , l = 255 & this._subParamsIdx[f]; l - d > 0 && h.push(Array.prototype.slice.call(this._subParams, d, l)) } return h } reset() { this.length = 0, this._subParamsLength = 0, this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1 } addParam(h) { if (this._digitIsSub = !1, this.length >= this.maxLength) this._rejectDigits = !0; else { if (h < -1) throw new Error("values lesser than -1 are not allowed"); this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = h > a ? a : h } } addSubParam(h) { if (this._digitIsSub = !0, this.length) if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) this._rejectSubDigits = !0; else { if (h < -1) throw new Error("values lesser than -1 are not allowed"); this._subParams[this._subParamsLength++] = h > a ? a : h, this._subParamsIdx[this.length - 1]++ } } hasSubParams(h) { return (255 & this._subParamsIdx[h]) - (this._subParamsIdx[h] >> 8) > 0 } getSubParams(h) { const f = this._subParamsIdx[h] >> 8 , d = 255 & this._subParamsIdx[h]; return d - f > 0 ? this._subParams.subarray(f, d) : null } getSubParamsAll() { const h = {}; for (let f = 0; f < this.length; ++f) { const d = this._subParamsIdx[f] >> 8 , l = 255 & this._subParamsIdx[f]; l - d > 0 && (h[f] = this._subParams.slice(d, l)) } return h } addDigit(h) { let f; if (this._rejectDigits || !(f = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits) return; const d = this._digitIsSub ? this._subParams : this.params , l = d[f - 1]; d[f - 1] = ~l ? Math.min(10 * l + h, a) : h } } r.Params = n } , 5741: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.AddonManager = void 0, r.AddonManager = class { constructor() { this._addons = [] } dispose() { for (let a = this._addons.length - 1; a >= 0; a--) this._addons[a].instance.dispose() } loadAddon(a, n) { const _ = { instance: n, dispose: n.dispose, isDisposed: !1 }; this._addons.push(_), n.dispose = () => this._wrappedAddonDispose(_), n.activate(a) } _wrappedAddonDispose(a) { if (a.isDisposed) return; let n = -1; for (let _ = 0; _ < this._addons.length; _++) if (this._addons[_] === a) { n = _; break } if (n === -1) throw new Error("Could not dispose an addon that has not been loaded"); a.isDisposed = !0, a.dispose.apply(a.instance), this._addons.splice(n, 1) } } } , 8771: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferApiView = void 0; const n = a(3785) , _ = a(511); r.BufferApiView = class { constructor(h, f) { this._buffer = h, this.type = f } init(h) { return this._buffer = h, 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(h) { const f = this._buffer.lines.get(h); if (f) return new n.BufferLineApiView(f) } getNullCell() { return new _.CellData } } } , 3785: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferLineApiView = void 0; const n = a(511); r.BufferLineApiView = class { constructor(_) { this._line = _ } get isWrapped() { return this._line.isWrapped } get length() { return this._line.length } getCell(_, h) { if (!(_ < 0 || _ >= this._line.length)) return h ? (this._line.loadCell(_, h), h) : this._line.loadCell(_, new n.CellData) } translateToString(_, h, f) { return this._line.translateToString(_, h, f) } } } , 8285: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferNamespaceApi = void 0; const n = a(8771) , _ = a(8460); r.BufferNamespaceApi = class { constructor(h) { this._core = h, this._onBufferChange = new _.EventEmitter, this._normal = new n.BufferApiView(this._core.buffers.normal, "normal"), this._alternate = new n.BufferApiView(this._core.buffers.alt, "alternate"), this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active)) } get onBufferChange() { return this._onBufferChange.event } get active() { if (this._core.buffers.active === this._core.buffers.normal) return this.normal; if (this._core.buffers.active === this._core.buffers.alt) return this.alternate; throw new Error("Active buffer is neither normal nor alternate") } get normal() { return this._normal.init(this._core.buffers.normal) } get alternate() { return this._alternate.init(this._core.buffers.alt) } } } , 7975: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.ParserApi = void 0, r.ParserApi = class { constructor(a) { this._core = a } registerCsiHandler(a, n) { return this._core.registerCsiHandler(a, _ => n(_.toArray())) } addCsiHandler(a, n) { return this.registerCsiHandler(a, n) } registerDcsHandler(a, n) { return this._core.registerDcsHandler(a, (_, h) => n(_, h.toArray())) } addDcsHandler(a, n) { return this.registerDcsHandler(a, n) } registerEscHandler(a, n) { return this._core.registerEscHandler(a, n) } addEscHandler(a, n) { return this.registerEscHandler(a, n) } registerOscHandler(a, n) { return this._core.registerOscHandler(a, n) } addOscHandler(a, n) { return this.registerOscHandler(a, n) } } } , 7090: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.UnicodeApi = void 0, r.UnicodeApi = class { constructor(a) { this._core = a } register(a) { this._core.unicodeService.register(a) } get versions() { return this._core.unicodeService.versions } get activeVersion() { return this._core.unicodeService.activeVersion } set activeVersion(a) { this._core.unicodeService.activeVersion = a } } } , 744: function (x, r, a) { var n = this && this.__decorate || function (t, s, e, i) { var c, g = arguments.length, v = g < 3 ? s : i === null ? i = Object.getOwnPropertyDescriptor(s, e) : i; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") v = Reflect.decorate(t, s, e, i); else for (var S = t.length - 1; S >= 0; S--) (c = t[S]) && (v = (g < 3 ? c(v) : g > 3 ? c(s, e, v) : c(s, e)) || v); return g > 3 && v && Object.defineProperty(s, e, v), v } , _ = this && this.__param || function (t, s) { return function (e, i) { s(e, i, t) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.BufferService = r.MINIMUM_ROWS = r.MINIMUM_COLS = void 0; const h = a(2585) , f = a(5295) , d = a(8460) , l = a(844); r.MINIMUM_COLS = 2, r.MINIMUM_ROWS = 1; let o = class extends l.Disposable { constructor(t) { super(), this.isUserScrolling = !1, this._onResize = new d.EventEmitter, this._onScroll = new d.EventEmitter, this.cols = Math.max(t.rawOptions.cols || 0, r.MINIMUM_COLS), this.rows = Math.max(t.rawOptions.rows || 0, r.MINIMUM_ROWS), this.buffers = new f.BufferSet(t, this) } get onResize() { return this._onResize.event } get onScroll() { return this._onScroll.event } get buffer() { return this.buffers.active } dispose() { super.dispose(), this.buffers.dispose() } resize(t, s) { this.cols = t, this.rows = s, this.buffers.resize(t, s), this.buffers.setupTabStops(this.cols), this._onResize.fire({ cols: t, rows: s }) } reset() { this.buffers.reset(), this.isUserScrolling = !1 } scroll(t, s = !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, s), this._cachedBlankLine = i), i.isWrapped = s; const c = e.ybase + e.scrollTop , g = e.ybase + e.scrollBottom; if (e.scrollTop === 0) { const v = e.lines.isFull; g === e.lines.length - 1 ? v ? e.lines.recycle().copyFrom(i) : e.lines.push(i.clone()) : e.lines.splice(g + 1, 0, i.clone()), v ? this.isUserScrolling && (e.ydisp = Math.max(e.ydisp - 1, 0)) : (e.ybase++, this.isUserScrolling || e.ydisp++) } else { const v = g - c + 1; e.lines.shiftElements(c + 1, v - 1, -1), e.lines.set(g, i.clone()) } this.isUserScrolling || (e.ydisp = e.ybase), this._onScroll.fire(e.ydisp) } scrollLines(t, s, 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 c = i.ydisp; i.ydisp = Math.max(Math.min(i.ydisp + t, i.ybase), 0), c !== i.ydisp && (s || this._onScroll.fire(i.ydisp)) } scrollPages(t) { this.scrollLines(t * (this.rows - 1)) } scrollToTop() { this.scrollLines(-this.buffer.ydisp) } scrollToBottom() { this.scrollLines(this.buffer.ybase - this.buffer.ydisp) } scrollToLine(t) { const s = t - this.buffer.ydisp; s !== 0 && this.scrollLines(s) } } ; o = n([_(0, h.IOptionsService)], o), r.BufferService = o }, 7994: (x, r) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.CharsetService = void 0, r.CharsetService = class { constructor() { this.glevel = 0, this._charsets = [] } reset() { this.charset = void 0, this._charsets = [], this.glevel = 0 } setgLevel(a) { this.glevel = a, this.charset = this._charsets[a] } setgCharset(a, n) { this._charsets[a] = n, this.glevel === a && (this.charset = n) } } } , 1753: function (x, r, a) { var n = this && this.__decorate || function (e, i, c, g) { var v, S = arguments.length, u = S < 3 ? i : g === null ? g = Object.getOwnPropertyDescriptor(i, c) : g; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") u = Reflect.decorate(e, i, c, g); else for (var m = e.length - 1; m >= 0; m--) (v = e[m]) && (u = (S < 3 ? v(u) : S > 3 ? v(i, c, u) : v(i, c)) || u); return S > 3 && u && Object.defineProperty(i, c, u), u } , _ = this && this.__param || function (e, i) { return function (c, g) { i(c, g, e) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.CoreMouseService = void 0; const h = a(2585) , f = a(8460) , d = { NONE: { events: 0, restrict: () => !1 }, X10: { events: 1, restrict: e => e.button !== 4 && e.action === 1 && (e.ctrl = !1, e.alt = !1, e.shift = !1, !0) }, VT200: { events: 19, restrict: e => e.action !== 32 }, DRAG: { events: 23, restrict: e => e.action !== 32 || e.button !== 3 }, ANY: { events: 31, restrict: e => !0 } }; function l(e, i) { let c = (e.ctrl ? 16 : 0) | (e.shift ? 4 : 0) | (e.alt ? 8 : 0); return e.button === 4 ? (c |= 64, c |= e.action) : (c |= 3 & e.button, 4 & e.button && (c |= 64), 8 & e.button && (c |= 128), e.action === 32 ? c |= 32 : e.action !== 0 || i || (c |= 3)), c } const o = String.fromCharCode , t = { DEFAULT: e => { const i = [l(e, !1) + 32, e.col + 32, e.row + 32]; return i[0] > 255 || i[1] > 255 || i[2] > 255 ? "" : `\x1B[M${o(i[0])}${o(i[1])}${o(i[2])}` } , SGR: e => { const i = e.action === 0 && e.button !== 4 ? "m" : "M"; return `\x1B[<${l(e, !0)};${e.col};${e.row}${i}` } , SGR_PIXELS: e => { const i = e.action === 0 && e.button !== 4 ? "m" : "M"; return `\x1B[<${l(e, !0)};${e.x};${e.y}${i}` } }; let s = class { constructor(e, i) { this._bufferService = e, this._coreService = i, this._protocols = {}, this._encodings = {}, this._activeProtocol = "", this._activeEncoding = "", this._onProtocolChange = new f.EventEmitter, this._lastEvent = null; for (const c of Object.keys(d)) this.addProtocol(c, d[c]); for (const c of Object.keys(t)) this.addEncoding(c, t[c]); this.reset() } addProtocol(e, i) { this._protocols[e] = i } addEncoding(e, i) { this._encodings[e] = i } get activeProtocol() { return this._activeProtocol } get areMouseEventsActive() { return this._protocols[this._activeProtocol].events !== 0 } set activeProtocol(e) { if (!this._protocols[e]) throw new Error(`unknown protocol "${e}"`); this._activeProtocol = e, this._onProtocolChange.fire(this._protocols[e].events) } get activeEncoding() { return this._activeEncoding } set activeEncoding(e) { if (!this._encodings[e]) throw new Error(`unknown encoding "${e}"`); this._activeEncoding = e } reset() { this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null } get onProtocolChange() { return this._onProtocolChange.event } triggerMouseEvent(e) { if (e.col < 0 || e.col >= this._bufferService.cols || e.row < 0 || e.row >= this._bufferService.rows || e.button === 4 && e.action === 32 || e.button === 3 && e.action !== 32 || e.button !== 4 && (e.action === 2 || e.action === 3) || (e.col++, e.row++, e.action === 32 && this._lastEvent && this._equalEvents(this._lastEvent, e, this._activeEncoding === "SGR_PIXELS")) || !this._protocols[this._activeProtocol].restrict(e)) return !1; const i = this._encodings[this._activeEncoding](e); return i && (this._activeEncoding === "DEFAULT" ? this._coreService.triggerBinaryEvent(i) : this._coreService.triggerDataEvent(i, !0)), this._lastEvent = e, !0 } explainEvents(e) { return { down: !!(1 & e), up: !!(2 & e), drag: !!(4 & e), move: !!(8 & e), wheel: !!(16 & e) } } _equalEvents(e, i, c) { if (c) { if (e.x !== i.x || e.y !== i.y) return !1 } else if (e.col !== i.col || e.row !== i.row) return !1; return e.button === i.button && e.action === i.action && e.ctrl === i.ctrl && e.alt === i.alt && e.shift === i.shift } } ; s = n([_(0, h.IBufferService), _(1, h.ICoreService)], s), r.CoreMouseService = s }, 6975: function (x, r, a) { var n = this && this.__decorate || function (e, i, c, g) { var v, S = arguments.length, u = S < 3 ? i : g === null ? g = Object.getOwnPropertyDescriptor(i, c) : g; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") u = Reflect.decorate(e, i, c, g); else for (var m = e.length - 1; m >= 0; m--) (v = e[m]) && (u = (S < 3 ? v(u) : S > 3 ? v(i, c, u) : v(i, c)) || u); return S > 3 && u && Object.defineProperty(i, c, u), u } , _ = this && this.__param || function (e, i) { return function (c, g) { i(c, g, e) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.CoreService = void 0; const h = a(2585) , f = a(8460) , d = a(1439) , l = a(844) , o = Object.freeze({ insertMode: !1 }) , t = Object.freeze({ applicationCursorKeys: !1, applicationKeypad: !1, bracketedPasteMode: !1, origin: !1, reverseWraparound: !1, sendFocus: !1, wraparound: !0 }); let s = class extends l.Disposable { constructor(e, i, c, g) { super(), this._bufferService = i, this._logService = c, this._optionsService = g, this.isCursorInitialized = !1, this.isCursorHidden = !1, this._onData = this.register(new f.EventEmitter), this._onUserInput = this.register(new f.EventEmitter), this._onBinary = this.register(new f.EventEmitter), this._scrollToBottom = e, this.register({ dispose: () => this._scrollToBottom = void 0 }), this.modes = (0, d.clone)(o), this.decPrivateModes = (0, d.clone)(t) } get onData() { return this._onData.event } get onUserInput() { return this._onUserInput.event } get onBinary() { return this._onBinary.event } reset() { this.modes = (0, d.clone)(o), this.decPrivateModes = (0, d.clone)(t) } triggerDataEvent(e, i = !1) { if (this._optionsService.rawOptions.disableStdin) return; const c = this._bufferService.buffer; c.ybase !== c.ydisp && this._scrollToBottom(), i && this._onUserInput.fire(), this._logService.debug(`sending data "${e}"`, () => e.split("").map(g => g.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)) } } ; s = n([_(1, h.IBufferService), _(2, h.ILogService), _(3, h.IOptionsService)], s), r.CoreService = s }, 9074: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.DecorationService = void 0; const n = a(8055) , _ = a(8460) , h = a(844) , f = a(6106) , d = { xmin: 0, xmax: 0 }; class l extends h.Disposable { constructor() { super(...arguments), this._decorations = new f.SortedList(s => s == null ? void 0 : s.marker.line), this._onDecorationRegistered = this.register(new _.EventEmitter), this._onDecorationRemoved = this.register(new _.EventEmitter) } get onDecorationRegistered() { return this._onDecorationRegistered.event } get onDecorationRemoved() { return this._onDecorationRemoved.event } get decorations() { return this._decorations.values() } registerDecoration(s) { if (s.marker.isDisposed) return; const e = new o(s); if (e) { const i = e.marker.onDispose(() => e.dispose()); e.onDispose(() => { e && (this._decorations.delete(e) && this._onDecorationRemoved.fire(e), i.dispose()) } ), this._decorations.insert(e), this._onDecorationRegistered.fire(e) } return e } reset() { for (const s of this._decorations.values()) s.dispose(); this._decorations.clear() } *getDecorationsAtCell(s, e, i) { var c, g, v; let S = 0 , u = 0; for (const m of this._decorations.getKeyIterator(e)) S = (c = m.options.x) !== null && c !== void 0 ? c : 0, u = S + ((g = m.options.width) !== null && g !== void 0 ? g : 1), s >= S && s < u && (!i || ((v = m.options.layer) !== null && v !== void 0 ? v : "bottom") === i) && (yield m) } forEachDecorationAtCell(s, e, i, c) { this._decorations.forEachByKey(e, g => { var v, S, u; d.xmin = (v = g.options.x) !== null && v !== void 0 ? v : 0, d.xmax = d.xmin + ((S = g.options.width) !== null && S !== void 0 ? S : 1), s >= d.xmin && s < d.xmax && (!i || ((u = g.options.layer) !== null && u !== void 0 ? u : "bottom") === i) && c(g) } ) } dispose() { for (const s of this._decorations.values()) this._onDecorationRemoved.fire(s); this.reset() } } r.DecorationService = l; class o extends h.Disposable { constructor(s) { super(), this.options = s, this.isDisposed = !1, this.onRenderEmitter = this.register(new _.EventEmitter), this.onRender = this.onRenderEmitter.event, this._onDispose = this.register(new _.EventEmitter), this.onDispose = this._onDispose.event, this._cachedBg = null, this._cachedFg = null, this.marker = s.marker, this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position && (this.options.overviewRulerOptions.position = "full") } get backgroundColorRGB() { return this._cachedBg === null && (this.options.backgroundColor ? this._cachedBg = n.css.toColor(this.options.backgroundColor) : this._cachedBg = void 0), this._cachedBg } get foregroundColorRGB() { return this._cachedFg === null && (this.options.foregroundColor ? this._cachedFg = n.css.toColor(this.options.foregroundColor) : this._cachedFg = void 0), this._cachedFg } dispose() { this._isDisposed || (this._isDisposed = !0, this._onDispose.fire(), super.dispose()) } } } , 3730: function (x, r, a) { var n = this && this.__decorate || function (d, l, o, t) { var s, e = arguments.length, i = e < 3 ? l : t === null ? t = Object.getOwnPropertyDescriptor(l, o) : t; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(d, l, o, t); else for (var c = d.length - 1; c >= 0; c--) (s = d[c]) && (i = (e < 3 ? s(i) : e > 3 ? s(l, o, i) : s(l, o)) || i); return e > 3 && i && Object.defineProperty(l, o, i), i } , _ = this && this.__param || function (d, l) { return function (o, t) { l(o, t, d) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.DirtyRowService = void 0; const h = a(2585); let f = class { constructor(d) { this._bufferService = d, this.clearRange() } get start() { return this._start } get end() { return this._end } clearRange() { this._start = this._bufferService.buffer.y, this._end = this._bufferService.buffer.y } markDirty(d) { d < this._start ? this._start = d : d > this._end && (this._end = d) } markRangeDirty(d, l) { if (d > l) { const o = d; d = l, l = o } d < this._start && (this._start = d), l > this._end && (this._end = l) } markAllDirty() { this.markRangeDirty(0, this._bufferService.rows - 1) } } ; f = n([_(0, h.IBufferService)], f), r.DirtyRowService = f }, 4348: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.InstantiationService = r.ServiceCollection = void 0; const n = a(2585) , _ = a(8343); class h { constructor(...d) { this._entries = new Map; for (const [l, o] of d) this.set(l, o) } set(d, l) { const o = this._entries.get(d); return this._entries.set(d, l), o } forEach(d) { this._entries.forEach((l, o) => d(o, l)) } has(d) { return this._entries.has(d) } get(d) { return this._entries.get(d) } } r.ServiceCollection = h, r.InstantiationService = class { constructor() { this._services = new h, this._services.set(n.IInstantiationService, this) } setService(f, d) { this._services.set(f, d) } getService(f) { return this._services.get(f) } createInstance(f, ...d) { const l = (0, _.getServiceDependencies)(f).sort((s, e) => s.index - e.index) , o = []; for (const s of l) { const e = this._services.get(s.id); if (!e) throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${s.id}.`); o.push(e) } const t = l.length > 0 ? l[0].index : d.length; if (d.length !== t) throw new Error(`[createInstance] First service dependency of ${f.name} at position ${t + 1} conflicts with ${d.length} static arguments`); return new f(...d, ...o) } } } , 7866: function (x, r, a) { var n = this && this.__decorate || function (l, o, t, s) { var e, i = arguments.length, c = i < 3 ? o : s === null ? s = Object.getOwnPropertyDescriptor(o, t) : s; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") c = Reflect.decorate(l, o, t, s); else for (var g = l.length - 1; g >= 0; g--) (e = l[g]) && (c = (i < 3 ? e(c) : i > 3 ? e(o, t, c) : e(o, t)) || c); return i > 3 && c && Object.defineProperty(o, t, c), c } , _ = this && this.__param || function (l, o) { return function (t, s) { o(t, s, l) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.LogService = void 0; const h = a(2585) , f = { debug: h.LogLevelEnum.DEBUG, info: h.LogLevelEnum.INFO, warn: h.LogLevelEnum.WARN, error: h.LogLevelEnum.ERROR, off: h.LogLevelEnum.OFF }; let d = class { constructor(l) { this._optionsService = l, this.logLevel = h.LogLevelEnum.OFF, this._updateLogLevel(), this._optionsService.onOptionChange(o => { o === "logLevel" && this._updateLogLevel() } ) } _updateLogLevel() { this.logLevel = f[this._optionsService.rawOptions.logLevel] } _evalLazyOptionalParams(l) { for (let o = 0; o < l.length; o++) typeof l[o] == "function" && (l[o] = l[o]()) } _log(l, o, t) { this._evalLazyOptionalParams(t), l.call(console, "xterm.js: " + o, ...t) } debug(l, ...o) { this.logLevel <= h.LogLevelEnum.DEBUG && this._log(console.log, l, o) } info(l, ...o) { this.logLevel <= h.LogLevelEnum.INFO && this._log(console.info, l, o) } warn(l, ...o) { this.logLevel <= h.LogLevelEnum.WARN && this._log(console.warn, l, o) } error(l, ...o) { this.logLevel <= h.LogLevelEnum.ERROR && this._log(console.error, l, o) } } ; d = n([_(0, h.IOptionsService)], d), r.LogService = d }, 7302: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.OptionsService = r.DEFAULT_OPTIONS = void 0; const n = a(8460) , _ = a(6114); r.DEFAULT_OPTIONS = { cols: 80, rows: 24, cursorBlink: !1, cursorStyle: "block", cursorWidth: 1, customGlyphs: !0, drawBoldTextInBrightColors: !0, fastScrollModifier: "alt", fastScrollSensitivity: 5, fontFamily: "courier-new, courier, monospace", fontSize: 15, fontWeight: "normal", fontWeightBold: "bold", lineHeight: 1, letterSpacing: 0, linkHandler: null, logLevel: "info", scrollback: 1e3, scrollSensitivity: 1, screenReaderMode: !1, smoothScrollDuration: 0, macOptionIsMeta: !1, macOptionClickForcesSelection: !1, minimumContrastRatio: 1, disableStdin: !1, allowProposedApi: !1, allowTransparency: !1, tabStopWidth: 8, theme: {}, rightClickSelectsWord: _.isMac, windowOptions: {}, windowsMode: !1, wordSeparator: " ()[]{}',\"`", altClickMovesCursor: !0, convertEol: !1, termName: "xterm", cancelEvents: !1, overviewRulerWidth: 0 }; const h = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"]; r.OptionsService = class { constructor(f) { this._onOptionChange = new n.EventEmitter; const d = Object.assign({}, r.DEFAULT_OPTIONS); for (const l in f) if (l in d) try { const o = f[l]; d[l] = this._sanitizeAndValidateOption(l, o) } catch (o) { console.error(o) } this.rawOptions = d, this.options = Object.assign({}, d), this._setupOptions() } get onOptionChange() { return this._onOptionChange.event } _setupOptions() { const f = l => { if (!(l in r.DEFAULT_OPTIONS)) throw new Error(`No option with key "${l}"`); return this.rawOptions[l] } , d = (l, o) => { if (!(l in r.DEFAULT_OPTIONS)) throw new Error(`No option with key "${l}"`); o = this._sanitizeAndValidateOption(l, o), this.rawOptions[l] !== o && (this.rawOptions[l] = o, this._onOptionChange.fire(l)) } ; for (const l in this.rawOptions) { const o = { get: f.bind(this, l), set: d.bind(this, l) }; Object.defineProperty(this.options, l, o) } } _sanitizeAndValidateOption(f, d) { switch (f) { case "cursorStyle": if (d || (d = r.DEFAULT_OPTIONS[f]), !function (l) { return l === "block" || l === "underline" || l === "bar" }(d)) throw new Error(`"${d}" is not a valid value for ${f}`); break; case "wordSeparator": d || (d = r.DEFAULT_OPTIONS[f]); break; case "fontWeight": case "fontWeightBold": if (typeof d == "number" && 1 <= d && d <= 1e3) break; d = h.includes(d) ? d : r.DEFAULT_OPTIONS[f]; break; case "cursorWidth": d = Math.floor(d); case "lineHeight": case "tabStopWidth": if (d < 1) throw new Error(`${f} cannot be less than 1, value: ${d}`); break; case "minimumContrastRatio": d = Math.max(1, Math.min(21, Math.round(10 * d) / 10)); break; case "scrollback": if ((d = Math.min(d, 4294967295)) < 0) throw new Error(`${f} cannot be less than 0, value: ${d}`); break; case "fastScrollSensitivity": case "scrollSensitivity": if (d <= 0) throw new Error(`${f} cannot be less than or equal to 0, value: ${d}`); case "rows": case "cols": if (!d && d !== 0) throw new Error(`${f} must be numeric, value: ${d}`) } return d } } } , 2660: function (x, r, a) { var n = this && this.__decorate || function (d, l, o, t) { var s, e = arguments.length, i = e < 3 ? l : t === null ? t = Object.getOwnPropertyDescriptor(l, o) : t; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(d, l, o, t); else for (var c = d.length - 1; c >= 0; c--) (s = d[c]) && (i = (e < 3 ? s(i) : e > 3 ? s(l, o, i) : s(l, o)) || i); return e > 3 && i && Object.defineProperty(l, o, i), i } , _ = this && this.__param || function (d, l) { return function (o, t) { l(o, t, d) } } ; Object.defineProperty(r, "__esModule", { value: !0 }), r.OscLinkService = void 0; const h = a(2585); let f = class { constructor(d) { this._bufferService = d, this._nextId = 1, this._entriesWithId = new Map, this._dataByLinkId = new Map } registerLink(d) { const l = this._bufferService.buffer; if (d.id === void 0) { const c = l.addMarker(l.ybase + l.y) , g = { data: d, id: this._nextId++, lines: [c] }; return c.onDispose(() => this._removeMarkerFromLink(g, c)), this._dataByLinkId.set(g.id, g), g.id } const o = d , t = this._getEntryIdKey(o) , s = this._entriesWithId.get(t); if (s) return this.addLineToLink(s.id, l.ybase + l.y), s.id; const e = l.addMarker(l.ybase + l.y) , i = { id: this._nextId++, key: this._getEntryIdKey(o), data: o, lines: [e] }; return e.onDispose(() => this._removeMarkerFromLink(i, e)), this._entriesWithId.set(i.key, i), this._dataByLinkId.set(i.id, i), i.id } addLineToLink(d, l) { const o = this._dataByLinkId.get(d); if (o && o.lines.every(t => t.line !== l)) { const t = this._bufferService.buffer.addMarker(l); o.lines.push(t), t.onDispose(() => this._removeMarkerFromLink(o, t)) } } getLinkData(d) { var l; return (l = this._dataByLinkId.get(d)) === null || l === void 0 ? void 0 : l.data } _getEntryIdKey(d) { return `${d.id};;${d.uri}` } _removeMarkerFromLink(d, l) { const o = d.lines.indexOf(l); o !== -1 && (d.lines.splice(o, 1), d.lines.length === 0 && (d.data.id !== void 0 && this._entriesWithId.delete(d.key), this._dataByLinkId.delete(d.id))) } } ; f = n([_(0, h.IBufferService)], f), r.OscLinkService = f }, 8343: (x, r) => { function a(n, _, h) { _.di$target === _ ? _.di$dependencies.push({ id: n, index: h }) : (_.di$dependencies = [{ id: n, index: h }], _.di$target = _) } Object.defineProperty(r, "__esModule", { value: !0 }), r.createDecorator = r.getServiceDependencies = r.serviceRegistry = void 0, r.serviceRegistry = new Map, r.getServiceDependencies = function (n) { return n.di$dependencies || [] } , r.createDecorator = function (n) { if (r.serviceRegistry.has(n)) return r.serviceRegistry.get(n); const _ = function (h, f, d) { if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter"); a(_, h, d) }; return _.toString = () => n, r.serviceRegistry.set(n, _), _ } } , 2585: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.IDecorationService = r.IUnicodeService = r.IOscLinkService = r.IOptionsService = r.ILogService = r.LogLevelEnum = r.IInstantiationService = r.IDirtyRowService = r.ICharsetService = r.ICoreService = r.ICoreMouseService = r.IBufferService = void 0; const n = a(8343); var _; r.IBufferService = (0, n.createDecorator)("BufferService"), r.ICoreMouseService = (0, n.createDecorator)("CoreMouseService"), r.ICoreService = (0, n.createDecorator)("CoreService"), r.ICharsetService = (0, n.createDecorator)("CharsetService"), r.IDirtyRowService = (0, n.createDecorator)("DirtyRowService"), r.IInstantiationService = (0, n.createDecorator)("InstantiationService"), (_ = r.LogLevelEnum || (r.LogLevelEnum = {}))[_.DEBUG = 0] = "DEBUG", _[_.INFO = 1] = "INFO", _[_.WARN = 2] = "WARN", _[_.ERROR = 3] = "ERROR", _[_.OFF = 4] = "OFF", r.ILogService = (0, n.createDecorator)("LogService"), r.IOptionsService = (0, n.createDecorator)("OptionsService"), r.IOscLinkService = (0, n.createDecorator)("OscLinkService"), r.IUnicodeService = (0, n.createDecorator)("UnicodeService"), r.IDecorationService = (0, n.createDecorator)("DecorationService") } , 1480: (x, r, a) => { Object.defineProperty(r, "__esModule", { value: !0 }), r.UnicodeService = void 0; const n = a(8460) , _ = a(225); r.UnicodeService = class { constructor() { this._providers = Object.create(null), this._active = "", this._onChange = new n.EventEmitter; const h = new _.UnicodeV6; this.register(h), this._active = h.version, this._activeProvider = h } get onChange() { return this._onChange.event } get versions() { return Object.keys(this._providers) } get activeVersion() { return this._active } set activeVersion(h) { if (!this._providers[h]) throw new Error(`unknown Unicode version "${h}"`); this._active = h, this._activeProvider = this._providers[h], this._onChange.fire(h) } register(h) { this._providers[h.version] = h } wcwidth(h) { return this._activeProvider.wcwidth(h) } getStringCellWidth(h) { let f = 0; const d = h.length; for (let l = 0; l < d; ++l) { let o = h.charCodeAt(l); if (55296 <= o && o <= 56319) { if (++l >= d) return f + this.wcwidth(o); const t = h.charCodeAt(l); 56320 <= t && t <= 57343 ? o = 1024 * (o - 55296) + t - 56320 + 65536 : f += this.wcwidth(t) } f += this.wcwidth(o) } return f } } } } , G = {}; function U(x) { var r = G[x]; if (r !== void 0) return r.exports; var a = G[x] = { exports: {} }; return V[x].call(a.exports, a, a.exports, U), a.exports } var q = {}; return (() => { var x = q; Object.defineProperty(x, "__esModule", { value: !0 }), x.Terminal = void 0; const r = U(3236) , a = U(9042) , n = U(7975) , _ = U(7090) , h = U(5741) , f = U(8285) , d = ["cols", "rows"]; x.Terminal = class { constructor(l) { this._core = new r.Terminal(l), this._addonManager = new h.AddonManager, this._publicOptions = Object.assign({}, this._core.options); const o = s => this._core.options[s] , t = (s, e) => { this._checkReadonlyOptions(s), this._core.options[s] = e } ; for (const s in this._core.options) { const e = { get: o.bind(this, s), set: t.bind(this, s) }; Object.defineProperty(this._publicOptions, s, e) } } _checkReadonlyOptions(l) { if (d.includes(l)) throw new Error(`Option "${l}" 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._checkProposedApi(), this._parser || (this._parser = new n.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._checkProposedApi(), this._buffer || (this._buffer = new f.BufferNamespaceApi(this._core)), this._buffer } get markers() { return this._checkProposedApi(), this._core.markers } get modes() { const l = this._core.coreService.decPrivateModes; let o = "none"; switch (this._core.coreMouseService.activeProtocol) { case "X10": o = "x10"; break; case "VT200": o = "vt200"; break; case "DRAG": o = "drag"; break; case "ANY": o = "any" } return { applicationCursorKeysMode: l.applicationCursorKeys, applicationKeypadMode: l.applicationKeypad, bracketedPasteMode: l.bracketedPasteMode, insertMode: this._core.coreService.modes.insertMode, mouseTrackingMode: o, originMode: l.origin, reverseWraparoundMode: l.reverseWraparound, sendFocusMode: l.sendFocus, wraparoundMode: l.wraparound } } get options() { return this._publicOptions } set options(l) { for (const o in l) this._publicOptions[o] = l[o] } blur() { this._core.blur() } focus() { this._core.focus() } resize(l, o) { this._verifyIntegers(l, o), this._core.resize(l, o) } open(l) { this._core.open(l) } attachCustomKeyEventHandler(l) { this._core.attachCustomKeyEventHandler(l) } registerLinkProvider(l) { return this._checkProposedApi(), this._core.registerLinkProvider(l) } registerCharacterJoiner(l) { return this._checkProposedApi(), this._core.registerCharacterJoiner(l) } deregisterCharacterJoiner(l) { this._checkProposedApi(), this._core.deregisterCharacterJoiner(l) } registerMarker(l = 0) { return this._verifyIntegers(l), this._core.addMarker(l) } registerDecoration(l) { var o, t, s; return this._checkProposedApi(), this._verifyPositiveIntegers((o = l.x) !== null && o !== void 0 ? o : 0, (t = l.width) !== null && t !== void 0 ? t : 0, (s = l.height) !== null && s !== void 0 ? s : 0), this._core.registerDecoration(l) } hasSelection() { return this._core.hasSelection() } select(l, o, t) { this._verifyIntegers(l, o, t), this._core.select(l, o, t) } getSelection() { return this._core.getSelection() } getSelectionPosition() { return this._core.getSelectionPosition() } clearSelection() { this._core.clearSelection() } selectAll() { this._core.selectAll() } selectLines(l, o) { this._verifyIntegers(l, o), this._core.selectLines(l, o) } dispose() { this._addonManager.dispose(), this._core.dispose() } scrollLines(l) { this._verifyIntegers(l), this._core.scrollLines(l) } scrollPages(l) { this._verifyIntegers(l), this._core.scrollPages(l) } scrollToTop() { this._core.scrollToTop() } scrollToBottom() { this._core.scrollToBottom() } scrollToLine(l) { this._verifyIntegers(l), this._core.scrollToLine(l) } clear() { this._core.clear() } write(l, o) { this._core.write(l, o) } writeln(l, o) { this._core.write(l), this._core.write(`\r `, o) } paste(l) { this._core.paste(l) } refresh(l, o) { this._verifyIntegers(l, o), this._core.refresh(l, o) } reset() { this._core.reset() } clearTextureAtlas() { this._core.clearTextureAtlas() } loadAddon(l) { return this._addonManager.loadAddon(this, l) } static get strings() { return a } _verifyIntegers(...l) { for (const o of l) if (o === 1 / 0 || isNaN(o) || o % 1 != 0) throw new Error("This API only accepts integers") } _verifyPositiveIntegers(...l) { for (const o of l) if (o && (o === 1 / 0 || isNaN(o) || o % 1 != 0 || o < 0)) throw new Error("This API only accepts positive integers") } } } )(), q } )() }) } )(Ce); var ye = { exports: {} }; (function (z, W) { (function (V, G) { z.exports = G() } )(self, function () { return (() => { var V = {}; return (() => { var G = V; Object.defineProperty(G, "__esModule", { value: !0 }), G.FitAddon = void 0, G.FitAddon = class { constructor() { } activate(U) { this._terminal = U } dispose() { } fit() { const U = this.proposeDimensions(); if (!U || !this._terminal || isNaN(U.cols) || isNaN(U.rows)) return; const q = this._terminal._core; this._terminal.rows === U.rows && this._terminal.cols === U.cols || (q._renderService.clear(), this._terminal.resize(U.cols, U.rows)) } proposeDimensions() { if (!this._terminal || !this._terminal.element || !this._terminal.element.parentElement) return; const U = this._terminal._core; if (U._renderService.dimensions.actualCellWidth === 0 || U._renderService.dimensions.actualCellHeight === 0) return; const q = this._terminal.options.scrollback === 0 ? 0 : U.viewport.scrollBarWidth , x = window.getComputedStyle(this._terminal.element.parentElement) , r = parseInt(x.getPropertyValue("height")) , a = Math.max(0, parseInt(x.getPropertyValue("width"))) , n = window.getComputedStyle(this._terminal.element) , _ = r - (parseInt(n.getPropertyValue("padding-top")) + parseInt(n.getPropertyValue("padding-bottom"))) , h = a - (parseInt(n.getPropertyValue("padding-right")) + parseInt(n.getPropertyValue("padding-left"))) - q; return { cols: Math.max(2, Math.floor(h / U._renderService.dimensions.actualCellWidth)), rows: Math.max(1, Math.floor(_ / U._renderService.dimensions.actualCellHeight)) } } } } )(), V } )() }) } )(ye); var fe = {}; (function (z) { Object.defineProperty(z, "__esModule", { value: !0 }), z.serial = z.SerialPort = z.SerialPolyfillProtocol = void 0; var W; (function (g) { g[g.UsbCdcAcm = 0] = "UsbCdcAcm" } )(W = z.SerialPolyfillProtocol || (z.SerialPolyfillProtocol = {})); const V = 32 , G = 34 , U = 35 , q = 255 , x = 8 , r = "none" , a = 1 , n = [16, 8, 7, 6, 5] , _ = [1, 2] , h = ["none", "even", "odd"] , f = ["none", "odd", "even"] , d = [1, 1.5, 2] , l = { protocol: W.UsbCdcAcm, usbControlInterfaceClass: 2, usbTransferInterfaceClass: 10 }; function o(g, v) { const S = g.configurations[0]; for (const u of S.interfaces) if (u.alternates[0].interfaceClass === v) return u; throw new TypeError(`Unable to find interface with class ${v}.`) } function t(g, v) { const S = g.alternates[0]; for (const u of S.endpoints) if (u.direction == v) return u; throw new TypeError(`Interface ${g.interfaceNumber} does not have an ${v} endpoint.`) } class s { constructor(v, S, u) { this.type = "bytes", this.device_ = v, this.endpoint_ = S, this.onError_ = u } pull(v) { (async () => { var S; let u; if (v.desiredSize) { const m = v.desiredSize / this.endpoint_.packetSize; u = Math.ceil(m) * this.endpoint_.packetSize } else u = this.endpoint_.packetSize; try { const m = await this.device_.transferIn(this.endpoint_.endpointNumber, u); if (m.status != "ok" && (v.error(`USB error: ${m.status}`), this.onError_()), !((S = m.data) === null || S === void 0) && S.buffer) { const w = new Uint8Array(m.data.buffer, m.data.byteOffset, m.data.byteLength); v.enqueue(w) } } catch (m) { v.error(m.toString()), this.onError_() } } )() } } class e { constructor(v, S, u) { this.device_ = v, this.endpoint_ = S, this.onError_ = u } async write(v, S) { try { const u = await this.device_.transferOut(this.endpoint_.endpointNumber, v); u.status != "ok" && (S.error(u.status), this.onError_()) } catch (u) { S.error(u.toString()), this.onError_() } } } class i { constructor(v, S) { this.polyfillOptions_ = Object.assign(Object.assign({}, l), S), this.outputSignals_ = { dataTerminalReady: !1, requestToSend: !1, break: !1 }, this.device_ = v, this.controlInterface_ = o(this.device_, this.polyfillOptions_.usbControlInterfaceClass), this.transferInterface_ = o(this.device_, this.polyfillOptions_.usbTransferInterfaceClass), this.inEndpoint_ = t(this.transferInterface_, "in"), this.outEndpoint_ = t(this.transferInterface_, "out") } get readable() { var v; return !this.readable_ && this.device_.opened && (this.readable_ = new ReadableStream(new s(this.device_, this.inEndpoint_, () => { this.readable_ = null } ), { highWaterMark: (v = this.serialOptions_.bufferSize) !== null && v !== void 0 ? v : q })), this.readable_ } get writable() { var v; return !this.writable_ && this.device_.opened && (this.writable_ = new WritableStream(new e(this.device_, this.outEndpoint_, () => { this.writable_ = null } ), new ByteLengthQueuingStrategy({ highWaterMark: (v = this.serialOptions_.bufferSize) !== null && v !== void 0 ? v : q }))), this.writable_ } async open(v) { this.serialOptions_ = v, this.validateOptions(); try { await this.device_.open(), this.device_.configuration === null && await this.device_.selectConfiguration(1), await this.device_.claimInterface(this.controlInterface_.interfaceNumber), this.controlInterface_ !== this.transferInterface_ && await this.device_.claimInterface(this.transferInterface_.interfaceNumber), await this.setLineCoding(), await this.setSignals({ dataTerminalReady: !0 }) } catch (S) { throw this.device_.opened && await this.device_.close(), new Error("Error setting up device: " + S.toString()) } } async close() { const v = []; this.readable_ && v.push(this.readable_.cancel()), this.writable_ && v.push(this.writable_.abort()), await Promise.all(v), this.readable_ = null, this.writable_ = null, this.device_.opened && (await this.setSignals({ dataTerminalReady: !1, requestToSend: !1 }), await this.device_.close()) } async forget() { return this.device_.forget() } getInfo() { return { usbVendorId: this.device_.vendorId, usbProductId: this.device_.productId } } reconfigure(v) { return this.serialOptions_ = Object.assign(Object.assign({}, this.serialOptions_), v), this.validateOptions(), this.setLineCoding() } async setSignals(v) { if (this.outputSignals_ = Object.assign(Object.assign({}, this.outputSignals_), v), v.dataTerminalReady !== void 0 || v.requestToSend !== void 0) { const S = (this.outputSignals_.dataTerminalReady ? 1 : 0) | (this.outputSignals_.requestToSend ? 2 : 0); await this.device_.controlTransferOut({ requestType: "class", recipient: "interface", request: G, value: S, index: this.controlInterface_.interfaceNumber }) } if (v.break !== void 0) { const S = this.outputSignals_.break ? 65535 : 0; await this.device_.controlTransferOut({ requestType: "class", recipient: "interface", request: U, value: S, index: this.controlInterface_.interfaceNumber }) } } validateOptions() { if (!this.isValidBaudRate(this.serialOptions_.baudRate)) throw new RangeError("invalid Baud Rate " + this.serialOptions_.baudRate); if (!this.isValidDataBits(this.serialOptions_.dataBits)) throw new RangeError("invalid dataBits " + this.serialOptions_.dataBits); if (!this.isValidStopBits(this.serialOptions_.stopBits)) throw new RangeError("invalid stopBits " + this.serialOptions_.stopBits); if (!this.isValidParity(this.serialOptions_.parity)) throw new RangeError("invalid parity " + this.serialOptions_.parity) } isValidBaudRate(v) { return v % 1 === 0 } isValidDataBits(v) { return typeof v > "u" ? !0 : n.includes(v) } isValidStopBits(v) { return typeof v > "u" ? !0 : _.includes(v) } isValidParity(v) { return typeof v > "u" ? !0 : h.includes(v) } async setLineCoding() { var v, S, u; const m = new ArrayBuffer(7) , w = new DataView(m); if (w.setUint32(0, this.serialOptions_.baudRate, !0), w.setUint8(4, d.indexOf((v = this.serialOptions_.stopBits) !== null && v !== void 0 ? v : a)), w.setUint8(5, f.indexOf((S = this.serialOptions_.parity) !== null && S !== void 0 ? S : r)), w.setUint8(6, (u = this.serialOptions_.dataBits) !== null && u !== void 0 ? u : x), (await this.device_.controlTransferOut({ requestType: "class", recipient: "interface", request: V, value: 0, index: this.controlInterface_.interfaceNumber }, m)).status != "ok") throw new DOMException("NetworkError", "Failed to set line coding.") } } z.SerialPort = i; class c { async requestPort(v, S) { S = Object.assign(Object.assign({}, l), S); const u = []; if (v && v.filters) for (const R of v.filters) { const L = { classCode: S.usbControlInterfaceClass }; R.usbVendorId !== void 0 && (L.vendorId = R.usbVendorId), R.usbProductId !== void 0 && (L.productId = R.usbProductId), u.push(L) } u.length === 0 && u.push({ classCode: S.usbControlInterfaceClass }); const m = await navigator.usb.requestDevice({ filters: u }); return new i(m, S) } async getPorts(v) { v = Object.assign(Object.assign({}, l), v); const S = await navigator.usb.getDevices() , u = []; return S.forEach(m => { try { const w = new i(m, v); u.push(w) } catch { } } ), u } } z.serial = new c } )(fe); let te, ee, ie, se, re, ae, ne, oe, we, Ee, ge, ke = 1, J, Q; const Re = new URLSearchParams(window.location.search) , le = Re.has("polyfill") , he = 8 * 1024 , Y = new Ce.exports.Terminal({ scrollback: 1e4 }) , de = new ye.exports.FitAddon; Y.loadAddon(de); const pe = new TextEncoder; let ce = ""; Y.onData(z => { if (we.checked && Y.write(z), (J == null ? void 0 : J.writable) == null) { console.warn("unable to find writable port"); return } const W = J.writable.getWriter(); Ee.checked ? (ce += z, z === "\r" && (W.write(pe.encode(ce)), W.releaseLock(), ce = "")) : W.write(pe.encode(z)), W.releaseLock() } ); function Le(z) { for (let W = 0; W < te.options.length; ++W) { const V = te.options[W]; if (V.value === "prompt") continue; const G = V; if (G.port === z) return G } return null } function _e(z) { const W = document.createElement("option"); return W.textContent = `Port ${ke++}`, W.port = z, te.appendChild(W), W } function De(z) { const W = Le(z); return W || _e(z) } function Ae() { if (!Y) throw new Error("no terminal instance found"); if (Y.rows === 0) { console.log("No output yet"); return } Y.selectAll(); const z = Y.getSelection(); Y.clearSelection(); const W = URL.createObjectURL(new Blob([new TextEncoder().encode(z).buffer], { type: "text/plain" })) , V = document.createElement("a"); V.download = `terminal_content_${new Date().getTime()}.txt`, V.href = W, V.click() } function xe() { if (!Y) throw new Error("no terminal instance found"); if (Y.rows === 0) { console.log("No output yet"); return } Y.clear() } async function Be() { if (te.value == "prompt") { try { J = await (le ? fe.serial : navigator.serial).requestPort({}) } catch { return } const z = De(J); z.selected = !0 } else J = te.selectedOptions[0].port } function Se() { return ie.value == "custom" ? Number.parseInt(se.value) : Number.parseInt(ie.value) } function ue() { Y.writeln(""), te.disabled = !1, ee.textContent = "Connect", ee.disabled = !1, ie.disabled = !1, se.disabled = !1, re.disabled = !1, ae.disabled = !1, ne.disabled = !1, oe.disabled = !1, J = void 0 } async function me() { if (await Be(), !J) return; const z = { baudRate: Se(), dataBits: Number.parseInt(re.value), parity: ae.value, stopBits: Number.parseInt(ne.value), flowControl: oe.checked ? "hardware" : "none", bufferSize: he, baudrate: Se(), databits: Number.parseInt(re.value), stopbits: Number.parseInt(ne.value), rtscts: oe.checked }; console.log(z), te.disabled = !0, ee.textContent = "Connecting...", ee.disabled = !0, ie.disabled = !0, se.disabled = !0, re.disabled = !0, ae.disabled = !0, ne.disabled = !0, oe.disabled = !0; try { await J.open(z), Y.writeln(""), ee.textContent = "Disconnect", ee.disabled = !1 } catch (W) { console.error(W), W instanceof Error && Y.writeln(``), ue(); return } for (; J && J.readable;) try { try { Q = J.readable.getReader({ mode: "byob" }) } catch { Q = J.readable.getReader() } let W = null; for (; ;) { const { value: V, done: G } = await (async () => { if (Q instanceof ReadableStreamBYOBReader) { W || (W = new ArrayBuffer(he)); const { value: U, done: q } = await Q.read(new Uint8Array(W, 0, he)); return W = U == null ? void 0 : U.buffer, { value: U, done: q } } else return await Q.read() } )(); if (V && await new Promise(U => { Y.write(V, U) } ), G) break } } catch (W) { console.error(W), await new Promise(V => { W instanceof Error && Y.writeln(``, V) } ) } finally { Q && (Q.releaseLock(), Q = void 0) } if (J) { try { await J.close() } catch (W) { console.error(W), W instanceof Error && Y.writeln(``) } ue() } } async function Te() { const z = J; if (J = void 0, Q && await Q.cancel(), z) try { await z.close() } catch (W) { console.error(W), W instanceof Error && Y.writeln(``) } ue() } document.addEventListener("DOMContentLoaded", async () => { const z = document.getElementById("terminal"); z && (Y.open(z), de.fit(), window.addEventListener("resize", () => { de.fit() } )), document.getElementById("download").addEventListener("click", Ae), document.getElementById("clear").addEventListener("click", xe), te = document.getElementById("ports"), ee = document.getElementById("connect"), ee.addEventListener("click", () => { J ? Te() : me() } ), ie = document.getElementById("baudrate"), ie.addEventListener("input", () => { ie.value == "custom" ? se.hidden = !1 : se.hidden = !0 } ), se = document.getElementById("custom_baudrate"), re = document.getElementById("databits"), ae = document.getElementById("parity"), ne = document.getElementById("stopbits"), oe = document.getElementById("rtscts"), we = document.getElementById("echo"), Ee = document.getElementById("enter_flush"), ge = document.getElementById("autoconnect"); const G = document.getElementById("convert_eol") , U = () => { Y.options.convertEol = G.checked } ; G.addEventListener("change", U), U(), (await (le ? fe.serial : navigator.serial).getPorts()).forEach(r => _e(r)), le || (navigator.serial.addEventListener("connect", r => { const a = _e(r.target); ge.checked && (a.selected = !0, me()) } ), navigator.serial.addEventListener("disconnect", r => { const a = Le(r.target); a && a.remove() } )) } );