@agentdocumentformat/cli 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/adf.mjs +162 -0
  4. package/dist/chunks/APEv2Parser-2CNNHMXV.mjs +22 -0
  5. package/dist/chunks/AiffParser-7BR4RL6G.mjs +162 -0
  6. package/dist/chunks/App-L5L37JI5.mjs +16747 -0
  7. package/dist/chunks/AsfParser-VVRSLFOM.mjs +538 -0
  8. package/dist/chunks/DsdiffParser-CMD4AX7A.mjs +156 -0
  9. package/dist/chunks/DsfParser-UOGZDS2M.mjs +94 -0
  10. package/dist/chunks/FlacParser-HB3T3CD4.mjs +23 -0
  11. package/dist/chunks/MP4Parser-66HBRUSX.mjs +973 -0
  12. package/dist/chunks/MatroskaParser-J3HUIMEW.mjs +579 -0
  13. package/dist/chunks/MpegParser-YW6LIUEW.mjs +442 -0
  14. package/dist/chunks/MusepackParser-PAUSXP7D.mjs +252 -0
  15. package/dist/chunks/OggParser-NUBV3GWC.mjs +359 -0
  16. package/dist/chunks/WavPackParser-WQAGT7TC.mjs +171 -0
  17. package/dist/chunks/WaveParser-EWLQVDX4.mjs +238 -0
  18. package/dist/chunks/adf-schema-JRU2BTOG.mjs +62 -0
  19. package/dist/chunks/build-QF5W473T.mjs +60 -0
  20. package/dist/chunks/chatgpt-subscription-BQGWYZXE.mjs +23 -0
  21. package/dist/chunks/chunk-2DIECGFL.mjs +6 -0
  22. package/dist/chunks/chunk-2NAP2ZF7.mjs +60 -0
  23. package/dist/chunks/chunk-3AT7IIP7.mjs +25696 -0
  24. package/dist/chunks/chunk-3GNIDM53.mjs +35 -0
  25. package/dist/chunks/chunk-3M4ZPOA3.mjs +1477 -0
  26. package/dist/chunks/chunk-4MQPTCXY.mjs +510 -0
  27. package/dist/chunks/chunk-5PO5PKRV.mjs +366 -0
  28. package/dist/chunks/chunk-5QU5VY7N.mjs +52 -0
  29. package/dist/chunks/chunk-5W7KES6P.mjs +436 -0
  30. package/dist/chunks/chunk-62NE4LG4.mjs +61 -0
  31. package/dist/chunks/chunk-64OKE4X3.mjs +45 -0
  32. package/dist/chunks/chunk-6GJ4QHRI.mjs +1278 -0
  33. package/dist/chunks/chunk-6VQEXLE2.mjs +144 -0
  34. package/dist/chunks/chunk-6XUV6EK6.mjs +41 -0
  35. package/dist/chunks/chunk-776TSXEP.mjs +43 -0
  36. package/dist/chunks/chunk-7CV2SA3H.mjs +285 -0
  37. package/dist/chunks/chunk-7MTRVW2U.mjs +3103 -0
  38. package/dist/chunks/chunk-7N2R2VCG.mjs +1434 -0
  39. package/dist/chunks/chunk-7T2YMTWL.mjs +374 -0
  40. package/dist/chunks/chunk-7XYNI52E.mjs +149 -0
  41. package/dist/chunks/chunk-APHX6HSV.mjs +7731 -0
  42. package/dist/chunks/chunk-APRU6PHC.mjs +40 -0
  43. package/dist/chunks/chunk-AUYKRQPJ.mjs +499 -0
  44. package/dist/chunks/chunk-DXWDD5XJ.mjs +136 -0
  45. package/dist/chunks/chunk-EWL5FG4I.mjs +39 -0
  46. package/dist/chunks/chunk-EYX2YLJW.mjs +117 -0
  47. package/dist/chunks/chunk-F5ELW46V.mjs +27 -0
  48. package/dist/chunks/chunk-G426FACA.mjs +49 -0
  49. package/dist/chunks/chunk-GEKSJHIV.mjs +2472 -0
  50. package/dist/chunks/chunk-HBUENVQL.mjs +570 -0
  51. package/dist/chunks/chunk-HPVFJYXR.mjs +112 -0
  52. package/dist/chunks/chunk-HWLWPXQ7.mjs +721 -0
  53. package/dist/chunks/chunk-I2HJYHFT.mjs +665 -0
  54. package/dist/chunks/chunk-I3UYSITV.mjs +68 -0
  55. package/dist/chunks/chunk-IC4JDZCI.mjs +3864 -0
  56. package/dist/chunks/chunk-IHDDCZBS.mjs +112 -0
  57. package/dist/chunks/chunk-IIGMZHQQ.mjs +10416 -0
  58. package/dist/chunks/chunk-KWFOS5WC.mjs +41 -0
  59. package/dist/chunks/chunk-LAZIXV2F.mjs +5290 -0
  60. package/dist/chunks/chunk-LFMB4PAA.mjs +10814 -0
  61. package/dist/chunks/chunk-M2RX3S2T.mjs +49 -0
  62. package/dist/chunks/chunk-M3WPIJYM.mjs +65 -0
  63. package/dist/chunks/chunk-NBTUWMGP.mjs +263 -0
  64. package/dist/chunks/chunk-NGK6PVSF.mjs +2676 -0
  65. package/dist/chunks/chunk-NZ7JTHEO.mjs +85 -0
  66. package/dist/chunks/chunk-OQN33RGQ.mjs +52 -0
  67. package/dist/chunks/chunk-RIX34QHC.mjs +2935 -0
  68. package/dist/chunks/chunk-SGUTYISF.mjs +16 -0
  69. package/dist/chunks/chunk-SLJ5L7PY.mjs +1473 -0
  70. package/dist/chunks/chunk-SLUKGXKH.mjs +68 -0
  71. package/dist/chunks/chunk-TMT32MXT.mjs +419 -0
  72. package/dist/chunks/chunk-UYY5M2PB.mjs +151 -0
  73. package/dist/chunks/chunk-VAUOM3IN.mjs +298 -0
  74. package/dist/chunks/chunk-VMHTYDH4.mjs +172 -0
  75. package/dist/chunks/chunk-VZS54AA5.mjs +200 -0
  76. package/dist/chunks/chunk-WFQUVXML.mjs +295 -0
  77. package/dist/chunks/chunk-X34PDRUH.mjs +809 -0
  78. package/dist/chunks/chunk-XNPZBLYL.mjs +33 -0
  79. package/dist/chunks/chunk-XX7OSWTO.mjs +157 -0
  80. package/dist/chunks/chunk-XYTWGHFS.mjs +600 -0
  81. package/dist/chunks/chunk-XYV3VCIX.mjs +336 -0
  82. package/dist/chunks/chunk-Y5ZLKFLE.mjs +1469 -0
  83. package/dist/chunks/chunk-ZJKXHM4Q.mjs +230 -0
  84. package/dist/chunks/cli-TCMBNZF6.mjs +1030 -0
  85. package/dist/chunks/commands-DTEKM4ZL.mjs +20 -0
  86. package/dist/chunks/daemon-ZC3FZ2P4.mjs +112449 -0
  87. package/dist/chunks/daemon-control-WDX7PMTC.mjs +300 -0
  88. package/dist/chunks/daemon-token-WRSULP7G.mjs +23 -0
  89. package/dist/chunks/devtools-H7CI2ZVG.mjs +85 -0
  90. package/dist/chunks/discord-IWDQJA7A.mjs +70588 -0
  91. package/dist/chunks/dist-C57KYFS2.mjs +4952 -0
  92. package/dist/chunks/dist-I3XBAGDL.mjs +11 -0
  93. package/dist/chunks/email-V4Q4VJON.mjs +58679 -0
  94. package/dist/chunks/environment-NX277MQG.mjs +15 -0
  95. package/dist/chunks/grok-subscription-4PYX7TBF.mjs +19 -0
  96. package/dist/chunks/layout-EPJQNFAI.mjs +22 -0
  97. package/dist/chunks/lib-N7FCZWKH.mjs +4038 -0
  98. package/dist/chunks/open-OTQDGDH5.mjs +36 -0
  99. package/dist/chunks/parser-JVY2PWSM.mjs +19 -0
  100. package/dist/chunks/pipeline-executor-BHBSJX2K.mjs +19 -0
  101. package/dist/chunks/react-IUIDQ5LX.mjs +11 -0
  102. package/dist/chunks/screen-54BUTYCW.mjs +27 -0
  103. package/dist/chunks/slack-3L5QTDZX.mjs +8113 -0
  104. package/dist/chunks/store-WR7TZJZS.mjs +32 -0
  105. package/dist/chunks/telegram-5ISVFBV3.mjs +14918 -0
  106. package/dist/chunks/terminal-O5WO7C5U.mjs +48 -0
  107. package/dist/chunks/theme-NORU4J74.mjs +20 -0
  108. package/dist/chunks/themes-F2FKU7CP.mjs +23 -0
  109. package/dist/chunks/token-6G3HCMNX.mjs +54 -0
  110. package/dist/chunks/token-util-UXYSDQIW.mjs +12 -0
  111. package/dist/chunks/tui-ODVYUIMT.mjs +197 -0
  112. package/dist/chunks/welcome-XHXFV7SH.mjs +32 -0
  113. package/dist/chunks/whatsapp-XSAMNGPJ.mjs +85412 -0
  114. package/dist/chunks/xterm-headless-YF53XWXE.mjs +3353 -0
  115. package/package.json +53 -0
  116. package/resources/wasm/coreutils.LICENSE +18 -0
  117. package/resources/wasm/coreutils.wasm +0 -0
@@ -0,0 +1,3353 @@
1
+ import { createRequire as __adfCreateRequire } from 'node:module';
2
+ import { fileURLToPath as __adfFileURLToPath } from 'node:url';
3
+ import { dirname as __adfDirname } from 'node:path';
4
+ const require = __adfCreateRequire(import.meta.url);
5
+ const __filename = __adfFileURLToPath(import.meta.url);
6
+ const __dirname = __adfDirname(__filename);
7
+ import {
8
+ __commonJS
9
+ } from "./chunk-M2RX3S2T.mjs";
10
+
11
+ // node_modules/@xterm/headless/lib-headless/xterm-headless.js
12
+ var require_xterm_headless = __commonJS({
13
+ "node_modules/@xterm/headless/lib-headless/xterm-headless.js"(exports) {
14
+ (() => {
15
+ "use strict";
16
+ var e = { 349: (e2, t2, i2) => {
17
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CircularList = void 0;
18
+ let s2 = i2(460), r2 = i2(844);
19
+ class n2 extends r2.Disposable {
20
+ constructor(e3) {
21
+ super(), this._maxLength = e3, this.onDeleteEmitter = this.register(new s2.EventEmitter()), this.onDelete = this.onDeleteEmitter.event, this.onInsertEmitter = this.register(new s2.EventEmitter()), this.onInsert = this.onInsertEmitter.event, this.onTrimEmitter = this.register(new s2.EventEmitter()), this.onTrim = this.onTrimEmitter.event, this._array = new Array(this._maxLength), this._startIndex = 0, this._length = 0;
22
+ }
23
+ get maxLength() {
24
+ return this._maxLength;
25
+ }
26
+ set maxLength(e3) {
27
+ if (this._maxLength === e3) return;
28
+ let t3 = new Array(e3);
29
+ for (let i3 = 0; i3 < Math.min(e3, this.length); i3++) t3[i3] = this._array[this._getCyclicIndex(i3)];
30
+ this._array = t3, this._maxLength = e3, this._startIndex = 0;
31
+ }
32
+ get length() {
33
+ return this._length;
34
+ }
35
+ set length(e3) {
36
+ if (e3 > this._length) for (let t3 = this._length; t3 < e3; t3++) this._array[t3] = void 0;
37
+ this._length = e3;
38
+ }
39
+ get(e3) {
40
+ return this._array[this._getCyclicIndex(e3)];
41
+ }
42
+ set(e3, t3) {
43
+ this._array[this._getCyclicIndex(e3)] = t3;
44
+ }
45
+ push(e3) {
46
+ this._array[this._getCyclicIndex(this._length)] = e3, this._length === this._maxLength ? (this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1)) : this._length++;
47
+ }
48
+ recycle() {
49
+ if (this._length !== this._maxLength) throw new Error("Can only recycle when the buffer is full");
50
+ return this._startIndex = ++this._startIndex % this._maxLength, this.onTrimEmitter.fire(1), this._array[this._getCyclicIndex(this._length - 1)];
51
+ }
52
+ get isFull() {
53
+ return this._length === this._maxLength;
54
+ }
55
+ pop() {
56
+ return this._array[this._getCyclicIndex(this._length-- - 1)];
57
+ }
58
+ splice(e3, t3, ...i3) {
59
+ if (t3) {
60
+ for (let i4 = e3; i4 < this._length - t3; i4++) this._array[this._getCyclicIndex(i4)] = this._array[this._getCyclicIndex(i4 + t3)];
61
+ this._length -= t3, this.onDeleteEmitter.fire({ index: e3, amount: t3 });
62
+ }
63
+ for (let t4 = this._length - 1; t4 >= e3; t4--) this._array[this._getCyclicIndex(t4 + i3.length)] = this._array[this._getCyclicIndex(t4)];
64
+ for (let t4 = 0; t4 < i3.length; t4++) this._array[this._getCyclicIndex(e3 + t4)] = i3[t4];
65
+ if (i3.length && this.onInsertEmitter.fire({ index: e3, amount: i3.length }), this._length + i3.length > this._maxLength) {
66
+ let e4 = this._length + i3.length - this._maxLength;
67
+ this._startIndex += e4, this._length = this._maxLength, this.onTrimEmitter.fire(e4);
68
+ } else this._length += i3.length;
69
+ }
70
+ trimStart(e3) {
71
+ e3 > this._length && (e3 = this._length), this._startIndex += e3, this._length -= e3, this.onTrimEmitter.fire(e3);
72
+ }
73
+ shiftElements(e3, t3, i3) {
74
+ if (!(t3 <= 0)) {
75
+ if (e3 < 0 || e3 >= this._length) throw new Error("start argument out of range");
76
+ if (e3 + i3 < 0) throw new Error("Cannot shift elements in list beyond index 0");
77
+ if (i3 > 0) {
78
+ for (let s4 = t3 - 1; s4 >= 0; s4--) this.set(e3 + s4 + i3, this.get(e3 + s4));
79
+ let s3 = e3 + t3 + i3 - this._length;
80
+ if (s3 > 0) for (this._length += s3; this._length > this._maxLength; ) this._length--, this._startIndex++, this.onTrimEmitter.fire(1);
81
+ } else for (let s3 = 0; s3 < t3; s3++) this.set(e3 + s3 + i3, this.get(e3 + s3));
82
+ }
83
+ }
84
+ _getCyclicIndex(e3) {
85
+ return (this._startIndex + e3) % this._maxLength;
86
+ }
87
+ }
88
+ t2.CircularList = n2;
89
+ }, 439: (e2, t2) => {
90
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.clone = void 0, t2.clone = function e3(t3, i2 = 5) {
91
+ if (typeof t3 != "object") return t3;
92
+ let s2 = Array.isArray(t3) ? [] : {};
93
+ for (let r2 in t3) s2[r2] = i2 <= 1 ? t3[r2] : t3[r2] && e3(t3[r2], i2 - 1);
94
+ return s2;
95
+ };
96
+ }, 969: (e2, t2, i2) => {
97
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreTerminal = void 0;
98
+ let s2 = i2(844), r2 = i2(585), n2 = i2(348), a = i2(866), o = i2(744), h = i2(302), c = i2(83), l = i2(460), _ = i2(753), d = i2(480), f = i2(994), u = i2(282), p = i2(435), g = i2(981), v = i2(660), b = !1;
99
+ class S extends s2.Disposable {
100
+ get onScroll() {
101
+ return this._onScrollApi || (this._onScrollApi = this.register(new l.EventEmitter()), this._onScroll.event(((e3) => {
102
+ this._onScrollApi?.fire(e3.position);
103
+ }))), this._onScrollApi.event;
104
+ }
105
+ get cols() {
106
+ return this._bufferService.cols;
107
+ }
108
+ get rows() {
109
+ return this._bufferService.rows;
110
+ }
111
+ get buffers() {
112
+ return this._bufferService.buffers;
113
+ }
114
+ get options() {
115
+ return this.optionsService.options;
116
+ }
117
+ set options(e3) {
118
+ for (let t3 in e3) this.optionsService.options[t3] = e3[t3];
119
+ }
120
+ constructor(e3) {
121
+ super(), this._windowsWrappingHeuristics = this.register(new s2.MutableDisposable()), this._onBinary = this.register(new l.EventEmitter()), this.onBinary = this._onBinary.event, this._onData = this.register(new l.EventEmitter()), this.onData = this._onData.event, this._onLineFeed = this.register(new l.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onResize = this.register(new l.EventEmitter()), this.onResize = this._onResize.event, this._onWriteParsed = this.register(new l.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event, this._onScroll = this.register(new l.EventEmitter()), this._instantiationService = new n2.InstantiationService(), this.optionsService = this.register(new h.OptionsService(e3)), this._instantiationService.setService(r2.IOptionsService, this.optionsService), this._bufferService = this.register(this._instantiationService.createInstance(o.BufferService)), this._instantiationService.setService(r2.IBufferService, this._bufferService), this._logService = this.register(this._instantiationService.createInstance(a.LogService)), this._instantiationService.setService(r2.ILogService, this._logService), this.coreService = this.register(this._instantiationService.createInstance(c.CoreService)), this._instantiationService.setService(r2.ICoreService, this.coreService), this.coreMouseService = this.register(this._instantiationService.createInstance(_.CoreMouseService)), this._instantiationService.setService(r2.ICoreMouseService, this.coreMouseService), this.unicodeService = this.register(this._instantiationService.createInstance(d.UnicodeService)), this._instantiationService.setService(r2.IUnicodeService, this.unicodeService), this._charsetService = this._instantiationService.createInstance(f.CharsetService), this._instantiationService.setService(r2.ICharsetService, this._charsetService), this._oscLinkService = this._instantiationService.createInstance(v.OscLinkService), this._instantiationService.setService(r2.IOscLinkService, this._oscLinkService), this._inputHandler = this.register(new p.InputHandler(this._bufferService, this._charsetService, this.coreService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService)), this.register((0, l.forwardEvent)(this._inputHandler.onLineFeed, this._onLineFeed)), this.register(this._inputHandler), this.register((0, l.forwardEvent)(this._bufferService.onResize, this._onResize)), this.register((0, l.forwardEvent)(this.coreService.onData, this._onData)), this.register((0, l.forwardEvent)(this.coreService.onBinary, this._onBinary)), this.register(this.coreService.onRequestScrollToBottom((() => this.scrollToBottom()))), this.register(this.coreService.onUserInput((() => this._writeBuffer.handleUserInput()))), this.register(this.optionsService.onMultipleOptionChange(["windowsMode", "windowsPty"], (() => this._handleWindowsPtyOptionChange()))), this.register(this._bufferService.onScroll(((e4) => {
122
+ this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
123
+ }))), this.register(this._inputHandler.onScroll(((e4) => {
124
+ this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: 0 }), this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);
125
+ }))), this._writeBuffer = this.register(new g.WriteBuffer(((e4, t3) => this._inputHandler.parse(e4, t3)))), this.register((0, l.forwardEvent)(this._writeBuffer.onWriteParsed, this._onWriteParsed));
126
+ }
127
+ write(e3, t3) {
128
+ this._writeBuffer.write(e3, t3);
129
+ }
130
+ writeSync(e3, t3) {
131
+ this._logService.logLevel <= r2.LogLevelEnum.WARN && !b && (this._logService.warn("writeSync is unreliable and will be removed soon."), b = !0), this._writeBuffer.writeSync(e3, t3);
132
+ }
133
+ input(e3, t3 = !0) {
134
+ this.coreService.triggerDataEvent(e3, t3);
135
+ }
136
+ resize(e3, t3) {
137
+ isNaN(e3) || isNaN(t3) || (e3 = Math.max(e3, o.MINIMUM_COLS), t3 = Math.max(t3, o.MINIMUM_ROWS), this._bufferService.resize(e3, t3));
138
+ }
139
+ scroll(e3, t3 = !1) {
140
+ this._bufferService.scroll(e3, t3);
141
+ }
142
+ scrollLines(e3, t3, i3) {
143
+ this._bufferService.scrollLines(e3, t3, i3);
144
+ }
145
+ scrollPages(e3) {
146
+ this.scrollLines(e3 * (this.rows - 1));
147
+ }
148
+ scrollToTop() {
149
+ this.scrollLines(-this._bufferService.buffer.ydisp);
150
+ }
151
+ scrollToBottom() {
152
+ this.scrollLines(this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
153
+ }
154
+ scrollToLine(e3) {
155
+ let t3 = e3 - this._bufferService.buffer.ydisp;
156
+ t3 !== 0 && this.scrollLines(t3);
157
+ }
158
+ registerEscHandler(e3, t3) {
159
+ return this._inputHandler.registerEscHandler(e3, t3);
160
+ }
161
+ registerDcsHandler(e3, t3) {
162
+ return this._inputHandler.registerDcsHandler(e3, t3);
163
+ }
164
+ registerCsiHandler(e3, t3) {
165
+ return this._inputHandler.registerCsiHandler(e3, t3);
166
+ }
167
+ registerOscHandler(e3, t3) {
168
+ return this._inputHandler.registerOscHandler(e3, t3);
169
+ }
170
+ _setup() {
171
+ this._handleWindowsPtyOptionChange();
172
+ }
173
+ reset() {
174
+ this._inputHandler.reset(), this._bufferService.reset(), this._charsetService.reset(), this.coreService.reset(), this.coreMouseService.reset();
175
+ }
176
+ _handleWindowsPtyOptionChange() {
177
+ let e3 = !1, t3 = this.optionsService.rawOptions.windowsPty;
178
+ t3 && t3.buildNumber !== void 0 && t3.buildNumber !== void 0 ? e3 = t3.backend === "conpty" && t3.buildNumber < 21376 : this.optionsService.rawOptions.windowsMode && (e3 = !0), e3 ? this._enableWindowsWrappingHeuristics() : this._windowsWrappingHeuristics.clear();
179
+ }
180
+ _enableWindowsWrappingHeuristics() {
181
+ if (!this._windowsWrappingHeuristics.value) {
182
+ let e3 = [];
183
+ e3.push(this.onLineFeed(u.updateWindowsModeWrappedState.bind(null, this._bufferService))), e3.push(this.registerCsiHandler({ final: "H" }, (() => ((0, u.updateWindowsModeWrappedState)(this._bufferService), !1)))), this._windowsWrappingHeuristics.value = (0, s2.toDisposable)((() => {
184
+ for (let t3 of e3) t3.dispose();
185
+ }));
186
+ }
187
+ }
188
+ }
189
+ t2.CoreTerminal = S;
190
+ }, 460: (e2, t2) => {
191
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.runAndSubscribe = t2.forwardEvent = t2.EventEmitter = void 0, t2.EventEmitter = class {
192
+ constructor() {
193
+ this._listeners = [], this._disposed = !1;
194
+ }
195
+ get event() {
196
+ return this._event || (this._event = (e3) => (this._listeners.push(e3), { dispose: () => {
197
+ if (!this._disposed) {
198
+ for (let t4 = 0; t4 < this._listeners.length; t4++) if (this._listeners[t4] === e3) return void this._listeners.splice(t4, 1);
199
+ }
200
+ } })), this._event;
201
+ }
202
+ fire(e3, t3) {
203
+ let i2 = [];
204
+ for (let e4 = 0; e4 < this._listeners.length; e4++) i2.push(this._listeners[e4]);
205
+ for (let s2 = 0; s2 < i2.length; s2++) i2[s2].call(void 0, e3, t3);
206
+ }
207
+ dispose() {
208
+ this.clearListeners(), this._disposed = !0;
209
+ }
210
+ clearListeners() {
211
+ this._listeners && (this._listeners.length = 0);
212
+ }
213
+ }, t2.forwardEvent = function(e3, t3) {
214
+ return e3(((e4) => t3.fire(e4)));
215
+ }, t2.runAndSubscribe = function(e3, t3) {
216
+ return t3(void 0), e3(((e4) => t3(e4)));
217
+ };
218
+ }, 435: function(e2, t2, i2) {
219
+ var s2 = this && this.__decorate || function(e3, t3, i3, s3) {
220
+ var r3, n3 = arguments.length, a2 = n3 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3;
221
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a2 = Reflect.decorate(e3, t3, i3, s3);
222
+ else for (var o2 = e3.length - 1; o2 >= 0; o2--) (r3 = e3[o2]) && (a2 = (n3 < 3 ? r3(a2) : n3 > 3 ? r3(t3, i3, a2) : r3(t3, i3)) || a2);
223
+ return n3 > 3 && a2 && Object.defineProperty(t3, i3, a2), a2;
224
+ }, r2 = this && this.__param || function(e3, t3) {
225
+ return function(i3, s3) {
226
+ t3(i3, s3, e3);
227
+ };
228
+ };
229
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.InputHandler = t2.WindowsOptionsReportType = void 0;
230
+ let n2 = i2(584), a = i2(116), o = i2(15), h = i2(844), c = i2(482), l = i2(437), _ = i2(460), d = i2(643), f = i2(511), u = i2(734), p = i2(585), g = i2(480), v = i2(242), b = i2(351), S = i2(941), m = { "(": 0, ")": 1, "*": 2, "+": 3, "-": 1, ".": 2 }, C = 131072;
231
+ function y(e3, t3) {
232
+ if (e3 > 24) return t3.setWinLines || !1;
233
+ switch (e3) {
234
+ case 1:
235
+ return !!t3.restoreWin;
236
+ case 2:
237
+ return !!t3.minimizeWin;
238
+ case 3:
239
+ return !!t3.setWinPosition;
240
+ case 4:
241
+ return !!t3.setWinSizePixels;
242
+ case 5:
243
+ return !!t3.raiseWin;
244
+ case 6:
245
+ return !!t3.lowerWin;
246
+ case 7:
247
+ return !!t3.refreshWin;
248
+ case 8:
249
+ return !!t3.setWinSizeChars;
250
+ case 9:
251
+ return !!t3.maximizeWin;
252
+ case 10:
253
+ return !!t3.fullscreenWin;
254
+ case 11:
255
+ return !!t3.getWinState;
256
+ case 13:
257
+ return !!t3.getWinPosition;
258
+ case 14:
259
+ return !!t3.getWinSizePixels;
260
+ case 15:
261
+ return !!t3.getScreenSizePixels;
262
+ case 16:
263
+ return !!t3.getCellSizePixels;
264
+ case 18:
265
+ return !!t3.getWinSizeChars;
266
+ case 19:
267
+ return !!t3.getScreenSizeChars;
268
+ case 20:
269
+ return !!t3.getIconTitle;
270
+ case 21:
271
+ return !!t3.getWinTitle;
272
+ case 22:
273
+ return !!t3.pushTitle;
274
+ case 23:
275
+ return !!t3.popTitle;
276
+ case 24:
277
+ return !!t3.setWinLines;
278
+ }
279
+ return !1;
280
+ }
281
+ var w;
282
+ (function(e3) {
283
+ e3[e3.GET_WIN_SIZE_PIXELS = 0] = "GET_WIN_SIZE_PIXELS", e3[e3.GET_CELL_SIZE_PIXELS = 1] = "GET_CELL_SIZE_PIXELS";
284
+ })(w || (t2.WindowsOptionsReportType = w = {}));
285
+ let B = 0;
286
+ class E extends h.Disposable {
287
+ getAttrData() {
288
+ return this._curAttrData;
289
+ }
290
+ constructor(e3, t3, i3, s3, r3, h2, d2, u2, p2 = new o.EscapeSequenceParser()) {
291
+ super(), this._bufferService = e3, this._charsetService = t3, this._coreService = i3, this._logService = s3, this._optionsService = r3, this._oscLinkService = h2, this._coreMouseService = d2, this._unicodeService = u2, this._parser = p2, this._parseBuffer = new Uint32Array(4096), this._stringDecoder = new c.StringToUtf32(), this._utf8Decoder = new c.Utf8ToUtf32(), this._workCell = new f.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 = this.register(new _.EventEmitter()), this.onRequestBell = this._onRequestBell.event, this._onRequestRefreshRows = this.register(new _.EventEmitter()), this.onRequestRefreshRows = this._onRequestRefreshRows.event, this._onRequestReset = this.register(new _.EventEmitter()), this.onRequestReset = this._onRequestReset.event, this._onRequestSendFocus = this.register(new _.EventEmitter()), this.onRequestSendFocus = this._onRequestSendFocus.event, this._onRequestSyncScrollBar = this.register(new _.EventEmitter()), this.onRequestSyncScrollBar = this._onRequestSyncScrollBar.event, this._onRequestWindowsOptionsReport = this.register(new _.EventEmitter()), this.onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event, this._onA11yChar = this.register(new _.EventEmitter()), this.onA11yChar = this._onA11yChar.event, this._onA11yTab = this.register(new _.EventEmitter()), this.onA11yTab = this._onA11yTab.event, this._onCursorMove = this.register(new _.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onLineFeed = this.register(new _.EventEmitter()), this.onLineFeed = this._onLineFeed.event, this._onScroll = this.register(new _.EventEmitter()), this.onScroll = this._onScroll.event, this._onTitleChange = this.register(new _.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onColor = this.register(new _.EventEmitter()), this.onColor = this._onColor.event, this._parseStack = { paused: !1, cursorStartX: 0, cursorStartY: 0, decodedLength: 0, position: 0 }, this._specialColors = [256, 257, 258], this.register(this._parser), this._dirtyRowTracker = new A(this._bufferService), this._activeBuffer = this._bufferService.buffer, this.register(this._bufferService.buffers.onBufferActivate(((e4) => this._activeBuffer = e4.activeBuffer))), this._parser.setCsiHandlerFallback(((e4, t4) => {
292
+ this._logService.debug("Unknown CSI code: ", { identifier: this._parser.identToString(e4), params: t4.toArray() });
293
+ })), this._parser.setEscHandlerFallback(((e4) => {
294
+ this._logService.debug("Unknown ESC code: ", { identifier: this._parser.identToString(e4) });
295
+ })), this._parser.setExecuteHandlerFallback(((e4) => {
296
+ this._logService.debug("Unknown EXECUTE code: ", { code: e4 });
297
+ })), this._parser.setOscHandlerFallback(((e4, t4, i4) => {
298
+ this._logService.debug("Unknown OSC code: ", { identifier: e4, action: t4, data: i4 });
299
+ })), this._parser.setDcsHandlerFallback(((e4, t4, i4) => {
300
+ t4 === "HOOK" && (i4 = i4.toArray()), this._logService.debug("Unknown DCS code: ", { identifier: this._parser.identToString(e4), action: t4, payload: i4 });
301
+ })), this._parser.setPrintHandler(((e4, t4, i4) => this.print(e4, t4, i4))), this._parser.registerCsiHandler({ final: "@" }, ((e4) => this.insertChars(e4))), this._parser.registerCsiHandler({ intermediates: " ", final: "@" }, ((e4) => this.scrollLeft(e4))), this._parser.registerCsiHandler({ final: "A" }, ((e4) => this.cursorUp(e4))), this._parser.registerCsiHandler({ intermediates: " ", final: "A" }, ((e4) => this.scrollRight(e4))), this._parser.registerCsiHandler({ final: "B" }, ((e4) => this.cursorDown(e4))), this._parser.registerCsiHandler({ final: "C" }, ((e4) => this.cursorForward(e4))), this._parser.registerCsiHandler({ final: "D" }, ((e4) => this.cursorBackward(e4))), this._parser.registerCsiHandler({ final: "E" }, ((e4) => this.cursorNextLine(e4))), this._parser.registerCsiHandler({ final: "F" }, ((e4) => this.cursorPrecedingLine(e4))), this._parser.registerCsiHandler({ final: "G" }, ((e4) => this.cursorCharAbsolute(e4))), this._parser.registerCsiHandler({ final: "H" }, ((e4) => this.cursorPosition(e4))), this._parser.registerCsiHandler({ final: "I" }, ((e4) => this.cursorForwardTab(e4))), this._parser.registerCsiHandler({ final: "J" }, ((e4) => this.eraseInDisplay(e4, !1))), this._parser.registerCsiHandler({ prefix: "?", final: "J" }, ((e4) => this.eraseInDisplay(e4, !0))), this._parser.registerCsiHandler({ final: "K" }, ((e4) => this.eraseInLine(e4, !1))), this._parser.registerCsiHandler({ prefix: "?", final: "K" }, ((e4) => this.eraseInLine(e4, !0))), this._parser.registerCsiHandler({ final: "L" }, ((e4) => this.insertLines(e4))), this._parser.registerCsiHandler({ final: "M" }, ((e4) => this.deleteLines(e4))), this._parser.registerCsiHandler({ final: "P" }, ((e4) => this.deleteChars(e4))), this._parser.registerCsiHandler({ final: "S" }, ((e4) => this.scrollUp(e4))), this._parser.registerCsiHandler({ final: "T" }, ((e4) => this.scrollDown(e4))), this._parser.registerCsiHandler({ final: "X" }, ((e4) => this.eraseChars(e4))), this._parser.registerCsiHandler({ final: "Z" }, ((e4) => this.cursorBackwardTab(e4))), this._parser.registerCsiHandler({ final: "`" }, ((e4) => this.charPosAbsolute(e4))), this._parser.registerCsiHandler({ final: "a" }, ((e4) => this.hPositionRelative(e4))), this._parser.registerCsiHandler({ final: "b" }, ((e4) => this.repeatPrecedingCharacter(e4))), this._parser.registerCsiHandler({ final: "c" }, ((e4) => this.sendDeviceAttributesPrimary(e4))), this._parser.registerCsiHandler({ prefix: ">", final: "c" }, ((e4) => this.sendDeviceAttributesSecondary(e4))), this._parser.registerCsiHandler({ final: "d" }, ((e4) => this.linePosAbsolute(e4))), this._parser.registerCsiHandler({ final: "e" }, ((e4) => this.vPositionRelative(e4))), this._parser.registerCsiHandler({ final: "f" }, ((e4) => this.hVPosition(e4))), this._parser.registerCsiHandler({ final: "g" }, ((e4) => this.tabClear(e4))), this._parser.registerCsiHandler({ final: "h" }, ((e4) => this.setMode(e4))), this._parser.registerCsiHandler({ prefix: "?", final: "h" }, ((e4) => this.setModePrivate(e4))), this._parser.registerCsiHandler({ final: "l" }, ((e4) => this.resetMode(e4))), this._parser.registerCsiHandler({ prefix: "?", final: "l" }, ((e4) => this.resetModePrivate(e4))), this._parser.registerCsiHandler({ final: "m" }, ((e4) => this.charAttributes(e4))), this._parser.registerCsiHandler({ final: "n" }, ((e4) => this.deviceStatus(e4))), this._parser.registerCsiHandler({ prefix: "?", final: "n" }, ((e4) => this.deviceStatusPrivate(e4))), this._parser.registerCsiHandler({ intermediates: "!", final: "p" }, ((e4) => this.softReset(e4))), this._parser.registerCsiHandler({ intermediates: " ", final: "q" }, ((e4) => this.setCursorStyle(e4))), this._parser.registerCsiHandler({ final: "r" }, ((e4) => this.setScrollRegion(e4))), this._parser.registerCsiHandler({ final: "s" }, ((e4) => this.saveCursor(e4))), this._parser.registerCsiHandler({ final: "t" }, ((e4) => this.windowOptions(e4))), this._parser.registerCsiHandler({ final: "u" }, ((e4) => this.restoreCursor(e4))), this._parser.registerCsiHandler({ intermediates: "'", final: "}" }, ((e4) => this.insertColumns(e4))), this._parser.registerCsiHandler({ intermediates: "'", final: "~" }, ((e4) => this.deleteColumns(e4))), this._parser.registerCsiHandler({ intermediates: '"', final: "q" }, ((e4) => this.selectProtected(e4))), this._parser.registerCsiHandler({ intermediates: "$", final: "p" }, ((e4) => this.requestMode(e4, !0))), this._parser.registerCsiHandler({ prefix: "?", intermediates: "$", final: "p" }, ((e4) => this.requestMode(e4, !1))), this._parser.setExecuteHandler(n2.C0.BEL, (() => this.bell())), this._parser.setExecuteHandler(n2.C0.LF, (() => this.lineFeed())), this._parser.setExecuteHandler(n2.C0.VT, (() => this.lineFeed())), this._parser.setExecuteHandler(n2.C0.FF, (() => this.lineFeed())), this._parser.setExecuteHandler(n2.C0.CR, (() => this.carriageReturn())), this._parser.setExecuteHandler(n2.C0.BS, (() => this.backspace())), this._parser.setExecuteHandler(n2.C0.HT, (() => this.tab())), this._parser.setExecuteHandler(n2.C0.SO, (() => this.shiftOut())), this._parser.setExecuteHandler(n2.C0.SI, (() => this.shiftIn())), this._parser.setExecuteHandler(n2.C1.IND, (() => this.index())), this._parser.setExecuteHandler(n2.C1.NEL, (() => this.nextLine())), this._parser.setExecuteHandler(n2.C1.HTS, (() => this.tabSet())), this._parser.registerOscHandler(0, new v.OscHandler(((e4) => (this.setTitle(e4), this.setIconName(e4), !0)))), this._parser.registerOscHandler(1, new v.OscHandler(((e4) => this.setIconName(e4)))), this._parser.registerOscHandler(2, new v.OscHandler(((e4) => this.setTitle(e4)))), this._parser.registerOscHandler(4, new v.OscHandler(((e4) => this.setOrReportIndexedColor(e4)))), this._parser.registerOscHandler(8, new v.OscHandler(((e4) => this.setHyperlink(e4)))), this._parser.registerOscHandler(10, new v.OscHandler(((e4) => this.setOrReportFgColor(e4)))), this._parser.registerOscHandler(11, new v.OscHandler(((e4) => this.setOrReportBgColor(e4)))), this._parser.registerOscHandler(12, new v.OscHandler(((e4) => this.setOrReportCursorColor(e4)))), this._parser.registerOscHandler(104, new v.OscHandler(((e4) => this.restoreIndexedColor(e4)))), this._parser.registerOscHandler(110, new v.OscHandler(((e4) => this.restoreFgColor(e4)))), this._parser.registerOscHandler(111, new v.OscHandler(((e4) => this.restoreBgColor(e4)))), this._parser.registerOscHandler(112, new v.OscHandler(((e4) => this.restoreCursorColor(e4)))), 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()));
302
+ for (let e4 in a.CHARSETS) this._parser.registerEscHandler({ intermediates: "(", final: e4 }, (() => this.selectCharset("(" + e4))), this._parser.registerEscHandler({ intermediates: ")", final: e4 }, (() => this.selectCharset(")" + e4))), this._parser.registerEscHandler({ intermediates: "*", final: e4 }, (() => this.selectCharset("*" + e4))), this._parser.registerEscHandler({ intermediates: "+", final: e4 }, (() => this.selectCharset("+" + e4))), this._parser.registerEscHandler({ intermediates: "-", final: e4 }, (() => this.selectCharset("-" + e4))), this._parser.registerEscHandler({ intermediates: ".", final: e4 }, (() => this.selectCharset("." + e4))), this._parser.registerEscHandler({ intermediates: "/", final: e4 }, (() => this.selectCharset("/" + e4)));
303
+ this._parser.registerEscHandler({ intermediates: "#", final: "8" }, (() => this.screenAlignmentPattern())), this._parser.setErrorHandler(((e4) => (this._logService.error("Parsing error: ", e4), e4))), this._parser.registerDcsHandler({ intermediates: "$", final: "q" }, new b.DcsHandler(((e4, t4) => this.requestStatusString(e4, t4))));
304
+ }
305
+ _preserveStack(e3, t3, i3, s3) {
306
+ this._parseStack.paused = !0, this._parseStack.cursorStartX = e3, this._parseStack.cursorStartY = t3, this._parseStack.decodedLength = i3, this._parseStack.position = s3;
307
+ }
308
+ _logSlowResolvingAsync(e3) {
309
+ this._logService.logLevel <= p.LogLevelEnum.WARN && Promise.race([e3, new Promise(((e4, t3) => setTimeout((() => t3("#SLOW_TIMEOUT")), 5e3)))]).catch(((e4) => {
310
+ if (e4 !== "#SLOW_TIMEOUT") throw e4;
311
+ console.warn("async parser handler taking longer than 5000 ms");
312
+ }));
313
+ }
314
+ _getCurrentLinkId() {
315
+ return this._curAttrData.extended.urlId;
316
+ }
317
+ parse(e3, t3) {
318
+ let i3, s3 = this._activeBuffer.x, r3 = this._activeBuffer.y, n3 = 0, a2 = this._parseStack.paused;
319
+ if (a2) {
320
+ if (i3 = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, t3)) return this._logSlowResolvingAsync(i3), i3;
321
+ s3 = this._parseStack.cursorStartX, r3 = this._parseStack.cursorStartY, this._parseStack.paused = !1, e3.length > C && (n3 = this._parseStack.position + C);
322
+ }
323
+ if (this._logService.logLevel <= p.LogLevelEnum.DEBUG && this._logService.debug("parsing data" + (typeof e3 == "string" ? ` "${e3}"` : ` "${Array.prototype.map.call(e3, ((e4) => String.fromCharCode(e4))).join("")}"`), typeof e3 == "string" ? e3.split("").map(((e4) => e4.charCodeAt(0))) : e3), this._parseBuffer.length < e3.length && this._parseBuffer.length < C && (this._parseBuffer = new Uint32Array(Math.min(e3.length, C))), a2 || this._dirtyRowTracker.clearRange(), e3.length > C) for (let t4 = n3; t4 < e3.length; t4 += C) {
324
+ let n4 = t4 + C < e3.length ? t4 + C : e3.length, a3 = typeof e3 == "string" ? this._stringDecoder.decode(e3.substring(t4, n4), this._parseBuffer) : this._utf8Decoder.decode(e3.subarray(t4, n4), this._parseBuffer);
325
+ if (i3 = this._parser.parse(this._parseBuffer, a3)) return this._preserveStack(s3, r3, a3, t4), this._logSlowResolvingAsync(i3), i3;
326
+ }
327
+ else if (!a2) {
328
+ let t4 = typeof e3 == "string" ? this._stringDecoder.decode(e3, this._parseBuffer) : this._utf8Decoder.decode(e3, this._parseBuffer);
329
+ if (i3 = this._parser.parse(this._parseBuffer, t4)) return this._preserveStack(s3, r3, t4, 0), this._logSlowResolvingAsync(i3), i3;
330
+ }
331
+ this._activeBuffer.x === s3 && this._activeBuffer.y === r3 || this._onCursorMove.fire();
332
+ let o2 = this._dirtyRowTracker.end + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp), h2 = this._dirtyRowTracker.start + (this._bufferService.buffer.ybase - this._bufferService.buffer.ydisp);
333
+ h2 < this._bufferService.rows && this._onRequestRefreshRows.fire(Math.min(h2, this._bufferService.rows - 1), Math.min(o2, this._bufferService.rows - 1));
334
+ }
335
+ print(e3, t3, i3) {
336
+ let s3, r3, n3 = this._charsetService.charset, a2 = this._optionsService.rawOptions.screenReaderMode, o2 = this._bufferService.cols, h2 = this._coreService.decPrivateModes.wraparound, _2 = this._coreService.modes.insertMode, f2 = this._curAttrData, u2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
337
+ this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._activeBuffer.x && i3 - t3 > 0 && u2.getWidth(this._activeBuffer.x - 1) === 2 && u2.setCellFromCodepoint(this._activeBuffer.x - 1, 0, 1, f2);
338
+ let p2 = this._parser.precedingJoinState;
339
+ for (let v2 = t3; v2 < i3; ++v2) {
340
+ if (s3 = e3[v2], s3 < 127 && n3) {
341
+ let e4 = n3[String.fromCharCode(s3)];
342
+ e4 && (s3 = e4.charCodeAt(0));
343
+ }
344
+ let t4 = this._unicodeService.charProperties(s3, p2);
345
+ r3 = g.UnicodeService.extractWidth(t4);
346
+ let i4 = g.UnicodeService.extractShouldJoin(t4), b2 = i4 ? g.UnicodeService.extractWidth(p2) : 0;
347
+ if (p2 = t4, a2 && this._onA11yChar.fire((0, c.stringFromCodePoint)(s3)), this._getCurrentLinkId() && this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y), this._activeBuffer.x + r3 - b2 > o2) {
348
+ if (h2) {
349
+ let e4 = u2, t5 = this._activeBuffer.x - b2;
350
+ for (this._activeBuffer.x = b2, 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), u2 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y), b2 > 0 && u2 instanceof l.BufferLine && u2.copyCellsFrom(e4, t5, 0, b2, !1); t5 < o2; ) e4.setCellFromCodepoint(t5++, 0, 1, f2);
351
+ } else if (this._activeBuffer.x = o2 - 1, r3 === 2) continue;
352
+ }
353
+ if (i4 && this._activeBuffer.x) {
354
+ let e4 = u2.getWidth(this._activeBuffer.x - 1) ? 1 : 2;
355
+ u2.addCodepointToCell(this._activeBuffer.x - e4, s3, r3);
356
+ for (let e5 = r3 - b2; --e5 >= 0; ) u2.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, f2);
357
+ } else if (_2 && (u2.insertCells(this._activeBuffer.x, r3 - b2, this._activeBuffer.getNullCell(f2)), u2.getWidth(o2 - 1) === 2 && u2.setCellFromCodepoint(o2 - 1, d.NULL_CELL_CODE, d.NULL_CELL_WIDTH, f2)), u2.setCellFromCodepoint(this._activeBuffer.x++, s3, r3, f2), r3 > 0) for (; --r3; ) u2.setCellFromCodepoint(this._activeBuffer.x++, 0, 0, f2);
358
+ }
359
+ this._parser.precedingJoinState = p2, this._activeBuffer.x < o2 && i3 - t3 > 0 && u2.getWidth(this._activeBuffer.x) === 0 && !u2.hasContent(this._activeBuffer.x) && u2.setCellFromCodepoint(this._activeBuffer.x, 0, 1, f2), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
360
+ }
361
+ registerCsiHandler(e3, t3) {
362
+ return e3.final !== "t" || e3.prefix || e3.intermediates ? this._parser.registerCsiHandler(e3, t3) : this._parser.registerCsiHandler(e3, ((e4) => !y(e4.params[0], this._optionsService.rawOptions.windowOptions) || t3(e4)));
363
+ }
364
+ registerDcsHandler(e3, t3) {
365
+ return this._parser.registerDcsHandler(e3, new b.DcsHandler(t3));
366
+ }
367
+ registerEscHandler(e3, t3) {
368
+ return this._parser.registerEscHandler(e3, t3);
369
+ }
370
+ registerOscHandler(e3, t3) {
371
+ return this._parser.registerOscHandler(e3, new v.OscHandler(t3));
372
+ }
373
+ bell() {
374
+ return this._onRequestBell.fire(), !0;
375
+ }
376
+ lineFeed() {
377
+ return this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._optionsService.rawOptions.convertEol && (this._activeBuffer.x = 0), this._activeBuffer.y++, this._activeBuffer.y === this._activeBuffer.scrollBottom + 1 ? (this._activeBuffer.y--, this._bufferService.scroll(this._eraseAttrData())) : this._activeBuffer.y >= this._bufferService.rows ? this._activeBuffer.y = this._bufferService.rows - 1 : this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !1, this._activeBuffer.x >= this._bufferService.cols && this._activeBuffer.x--, this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._onLineFeed.fire(), !0;
378
+ }
379
+ carriageReturn() {
380
+ return this._activeBuffer.x = 0, !0;
381
+ }
382
+ backspace() {
383
+ if (!this._coreService.decPrivateModes.reverseWraparound) return this._restrictCursor(), this._activeBuffer.x > 0 && this._activeBuffer.x--, !0;
384
+ if (this._restrictCursor(this._bufferService.cols), this._activeBuffer.x > 0) this._activeBuffer.x--;
385
+ else if (this._activeBuffer.x === 0 && this._activeBuffer.y > this._activeBuffer.scrollTop && this._activeBuffer.y <= this._activeBuffer.scrollBottom && this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)?.isWrapped) {
386
+ this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).isWrapped = !1, this._activeBuffer.y--, this._activeBuffer.x = this._bufferService.cols - 1;
387
+ let e3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
388
+ e3.hasWidth(this._activeBuffer.x) && !e3.hasContent(this._activeBuffer.x) && this._activeBuffer.x--;
389
+ }
390
+ return this._restrictCursor(), !0;
391
+ }
392
+ tab() {
393
+ if (this._activeBuffer.x >= this._bufferService.cols) return !0;
394
+ let e3 = this._activeBuffer.x;
395
+ return this._activeBuffer.x = this._activeBuffer.nextStop(), this._optionsService.rawOptions.screenReaderMode && this._onA11yTab.fire(this._activeBuffer.x - e3), !0;
396
+ }
397
+ shiftOut() {
398
+ return this._charsetService.setgLevel(1), !0;
399
+ }
400
+ shiftIn() {
401
+ return this._charsetService.setgLevel(0), !0;
402
+ }
403
+ _restrictCursor(e3 = this._bufferService.cols - 1) {
404
+ this._activeBuffer.x = Math.min(e3, Math.max(0, this._activeBuffer.x)), this._activeBuffer.y = this._coreService.decPrivateModes.origin ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y)) : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y)), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
405
+ }
406
+ _setCursor(e3, t3) {
407
+ this._dirtyRowTracker.markDirty(this._activeBuffer.y), this._coreService.decPrivateModes.origin ? (this._activeBuffer.x = e3, this._activeBuffer.y = this._activeBuffer.scrollTop + t3) : (this._activeBuffer.x = e3, this._activeBuffer.y = t3), this._restrictCursor(), this._dirtyRowTracker.markDirty(this._activeBuffer.y);
408
+ }
409
+ _moveCursor(e3, t3) {
410
+ this._restrictCursor(), this._setCursor(this._activeBuffer.x + e3, this._activeBuffer.y + t3);
411
+ }
412
+ cursorUp(e3) {
413
+ let t3 = this._activeBuffer.y - this._activeBuffer.scrollTop;
414
+ return t3 >= 0 ? this._moveCursor(0, -Math.min(t3, e3.params[0] || 1)) : this._moveCursor(0, -(e3.params[0] || 1)), !0;
415
+ }
416
+ cursorDown(e3) {
417
+ let t3 = this._activeBuffer.scrollBottom - this._activeBuffer.y;
418
+ return t3 >= 0 ? this._moveCursor(0, Math.min(t3, e3.params[0] || 1)) : this._moveCursor(0, e3.params[0] || 1), !0;
419
+ }
420
+ cursorForward(e3) {
421
+ return this._moveCursor(e3.params[0] || 1, 0), !0;
422
+ }
423
+ cursorBackward(e3) {
424
+ return this._moveCursor(-(e3.params[0] || 1), 0), !0;
425
+ }
426
+ cursorNextLine(e3) {
427
+ return this.cursorDown(e3), this._activeBuffer.x = 0, !0;
428
+ }
429
+ cursorPrecedingLine(e3) {
430
+ return this.cursorUp(e3), this._activeBuffer.x = 0, !0;
431
+ }
432
+ cursorCharAbsolute(e3) {
433
+ return this._setCursor((e3.params[0] || 1) - 1, this._activeBuffer.y), !0;
434
+ }
435
+ cursorPosition(e3) {
436
+ return this._setCursor(e3.length >= 2 ? (e3.params[1] || 1) - 1 : 0, (e3.params[0] || 1) - 1), !0;
437
+ }
438
+ charPosAbsolute(e3) {
439
+ return this._setCursor((e3.params[0] || 1) - 1, this._activeBuffer.y), !0;
440
+ }
441
+ hPositionRelative(e3) {
442
+ return this._moveCursor(e3.params[0] || 1, 0), !0;
443
+ }
444
+ linePosAbsolute(e3) {
445
+ return this._setCursor(this._activeBuffer.x, (e3.params[0] || 1) - 1), !0;
446
+ }
447
+ vPositionRelative(e3) {
448
+ return this._moveCursor(0, e3.params[0] || 1), !0;
449
+ }
450
+ hVPosition(e3) {
451
+ return this.cursorPosition(e3), !0;
452
+ }
453
+ tabClear(e3) {
454
+ let t3 = e3.params[0];
455
+ return t3 === 0 ? delete this._activeBuffer.tabs[this._activeBuffer.x] : t3 === 3 && (this._activeBuffer.tabs = {}), !0;
456
+ }
457
+ cursorForwardTab(e3) {
458
+ if (this._activeBuffer.x >= this._bufferService.cols) return !0;
459
+ let t3 = e3.params[0] || 1;
460
+ for (; t3--; ) this._activeBuffer.x = this._activeBuffer.nextStop();
461
+ return !0;
462
+ }
463
+ cursorBackwardTab(e3) {
464
+ if (this._activeBuffer.x >= this._bufferService.cols) return !0;
465
+ let t3 = e3.params[0] || 1;
466
+ for (; t3--; ) this._activeBuffer.x = this._activeBuffer.prevStop();
467
+ return !0;
468
+ }
469
+ selectProtected(e3) {
470
+ let t3 = e3.params[0];
471
+ return t3 === 1 && (this._curAttrData.bg |= 536870912), t3 !== 2 && t3 !== 0 || (this._curAttrData.bg &= -536870913), !0;
472
+ }
473
+ _eraseInBufferLine(e3, t3, i3, s3 = !1, r3 = !1) {
474
+ let n3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e3);
475
+ n3.replaceCells(t3, i3, this._activeBuffer.getNullCell(this._eraseAttrData()), r3), s3 && (n3.isWrapped = !1);
476
+ }
477
+ _resetBufferLine(e3, t3 = !1) {
478
+ let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e3);
479
+ i3 && (i3.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), t3), this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + e3), i3.isWrapped = !1);
480
+ }
481
+ eraseInDisplay(e3, t3 = !1) {
482
+ let i3;
483
+ switch (this._restrictCursor(this._bufferService.cols), e3.params[0]) {
484
+ case 0:
485
+ for (i3 = this._activeBuffer.y, this._dirtyRowTracker.markDirty(i3), this._eraseInBufferLine(i3++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, t3); i3 < this._bufferService.rows; i3++) this._resetBufferLine(i3, t3);
486
+ this._dirtyRowTracker.markDirty(i3);
487
+ break;
488
+ case 1:
489
+ for (i3 = this._activeBuffer.y, this._dirtyRowTracker.markDirty(i3), this._eraseInBufferLine(i3, 0, this._activeBuffer.x + 1, !0, t3), this._activeBuffer.x + 1 >= this._bufferService.cols && (this._activeBuffer.lines.get(i3 + 1).isWrapped = !1); i3--; ) this._resetBufferLine(i3, t3);
490
+ this._dirtyRowTracker.markDirty(0);
491
+ break;
492
+ case 2:
493
+ for (i3 = this._bufferService.rows, this._dirtyRowTracker.markDirty(i3 - 1); i3--; ) this._resetBufferLine(i3, t3);
494
+ this._dirtyRowTracker.markDirty(0);
495
+ break;
496
+ case 3:
497
+ let e4 = this._activeBuffer.lines.length - this._bufferService.rows;
498
+ e4 > 0 && (this._activeBuffer.lines.trimStart(e4), this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - e4, 0), this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - e4, 0), this._onScroll.fire(0));
499
+ }
500
+ return !0;
501
+ }
502
+ eraseInLine(e3, t3 = !1) {
503
+ switch (this._restrictCursor(this._bufferService.cols), e3.params[0]) {
504
+ case 0:
505
+ this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, t3);
506
+ break;
507
+ case 1:
508
+ this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, !1, t3);
509
+ break;
510
+ case 2:
511
+ this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, !0, t3);
512
+ }
513
+ return this._dirtyRowTracker.markDirty(this._activeBuffer.y), !0;
514
+ }
515
+ insertLines(e3) {
516
+ this._restrictCursor();
517
+ let t3 = e3.params[0] || 1;
518
+ if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
519
+ let i3 = this._activeBuffer.ybase + this._activeBuffer.y, s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, r3 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3 + 1;
520
+ for (; t3--; ) this._activeBuffer.lines.splice(r3 - 1, 1), this._activeBuffer.lines.splice(i3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
521
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0;
522
+ }
523
+ deleteLines(e3) {
524
+ this._restrictCursor();
525
+ let t3 = e3.params[0] || 1;
526
+ if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
527
+ let i3 = this._activeBuffer.ybase + this._activeBuffer.y, s3;
528
+ for (s3 = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom, s3 = this._bufferService.rows - 1 + this._activeBuffer.ybase - s3; t3--; ) this._activeBuffer.lines.splice(i3, 1), this._activeBuffer.lines.splice(s3, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));
529
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom), this._activeBuffer.x = 0, !0;
530
+ }
531
+ insertChars(e3) {
532
+ this._restrictCursor();
533
+ let t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
534
+ return t3 && (t3.insertCells(this._activeBuffer.x, e3.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
535
+ }
536
+ deleteChars(e3) {
537
+ this._restrictCursor();
538
+ let t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
539
+ return t3 && (t3.deleteCells(this._activeBuffer.x, e3.params[0] || 1, this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
540
+ }
541
+ scrollUp(e3) {
542
+ let t3 = e3.params[0] || 1;
543
+ for (; t3--; ) 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()));
544
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
545
+ }
546
+ scrollDown(e3) {
547
+ let t3 = e3.params[0] || 1;
548
+ for (; t3--; ) 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));
549
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
550
+ }
551
+ scrollLeft(e3) {
552
+ if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
553
+ let t3 = e3.params[0] || 1;
554
+ for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) {
555
+ let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4);
556
+ i3.deleteCells(0, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1;
557
+ }
558
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
559
+ }
560
+ scrollRight(e3) {
561
+ if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
562
+ let t3 = e3.params[0] || 1;
563
+ for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) {
564
+ let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4);
565
+ i3.insertCells(0, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1;
566
+ }
567
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
568
+ }
569
+ insertColumns(e3) {
570
+ if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
571
+ let t3 = e3.params[0] || 1;
572
+ for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) {
573
+ let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4);
574
+ i3.insertCells(this._activeBuffer.x, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1;
575
+ }
576
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
577
+ }
578
+ deleteColumns(e3) {
579
+ if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) return !0;
580
+ let t3 = e3.params[0] || 1;
581
+ for (let e4 = this._activeBuffer.scrollTop; e4 <= this._activeBuffer.scrollBottom; ++e4) {
582
+ let i3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + e4);
583
+ i3.deleteCells(this._activeBuffer.x, t3, this._activeBuffer.getNullCell(this._eraseAttrData())), i3.isWrapped = !1;
584
+ }
585
+ return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom), !0;
586
+ }
587
+ eraseChars(e3) {
588
+ this._restrictCursor();
589
+ let t3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);
590
+ return t3 && (t3.replaceCells(this._activeBuffer.x, this._activeBuffer.x + (e3.params[0] || 1), this._activeBuffer.getNullCell(this._eraseAttrData())), this._dirtyRowTracker.markDirty(this._activeBuffer.y)), !0;
591
+ }
592
+ repeatPrecedingCharacter(e3) {
593
+ let t3 = this._parser.precedingJoinState;
594
+ if (!t3) return !0;
595
+ let i3 = e3.params[0] || 1, s3 = g.UnicodeService.extractWidth(t3), r3 = this._activeBuffer.x - s3, n3 = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y).getString(r3), a2 = new Uint32Array(n3.length * i3), o2 = 0;
596
+ for (let e4 = 0; e4 < n3.length; ) {
597
+ let t4 = n3.codePointAt(e4) || 0;
598
+ a2[o2++] = t4, e4 += t4 > 65535 ? 2 : 1;
599
+ }
600
+ let h2 = o2;
601
+ for (let e4 = 1; e4 < i3; ++e4) a2.copyWithin(h2, 0, o2), h2 += o2;
602
+ return this.print(a2, 0, h2), !0;
603
+ }
604
+ sendDeviceAttributesPrimary(e3) {
605
+ return e3.params[0] > 0 || (this._is("xterm") || this._is("rxvt-unicode") || this._is("screen") ? this._coreService.triggerDataEvent(n2.C0.ESC + "[?1;2c") : this._is("linux") && this._coreService.triggerDataEvent(n2.C0.ESC + "[?6c")), !0;
606
+ }
607
+ sendDeviceAttributesSecondary(e3) {
608
+ return e3.params[0] > 0 || (this._is("xterm") ? this._coreService.triggerDataEvent(n2.C0.ESC + "[>0;276;0c") : this._is("rxvt-unicode") ? this._coreService.triggerDataEvent(n2.C0.ESC + "[>85;95;0c") : this._is("linux") ? this._coreService.triggerDataEvent(e3.params[0] + "c") : this._is("screen") && this._coreService.triggerDataEvent(n2.C0.ESC + "[>83;40003;0c")), !0;
609
+ }
610
+ _is(e3) {
611
+ return (this._optionsService.rawOptions.termName + "").indexOf(e3) === 0;
612
+ }
613
+ setMode(e3) {
614
+ for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) {
615
+ case 4:
616
+ this._coreService.modes.insertMode = !0;
617
+ break;
618
+ case 20:
619
+ this._optionsService.options.convertEol = !0;
620
+ }
621
+ return !0;
622
+ }
623
+ setModePrivate(e3) {
624
+ for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) {
625
+ case 1:
626
+ this._coreService.decPrivateModes.applicationCursorKeys = !0;
627
+ break;
628
+ case 2:
629
+ this._charsetService.setgCharset(0, a.DEFAULT_CHARSET), this._charsetService.setgCharset(1, a.DEFAULT_CHARSET), this._charsetService.setgCharset(2, a.DEFAULT_CHARSET), this._charsetService.setgCharset(3, a.DEFAULT_CHARSET);
630
+ break;
631
+ case 3:
632
+ this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(132, this._bufferService.rows), this._onRequestReset.fire());
633
+ break;
634
+ case 6:
635
+ this._coreService.decPrivateModes.origin = !0, this._setCursor(0, 0);
636
+ break;
637
+ case 7:
638
+ this._coreService.decPrivateModes.wraparound = !0;
639
+ break;
640
+ case 12:
641
+ this._optionsService.options.cursorBlink = !0;
642
+ break;
643
+ case 45:
644
+ this._coreService.decPrivateModes.reverseWraparound = !0;
645
+ break;
646
+ case 66:
647
+ this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire();
648
+ break;
649
+ case 9:
650
+ this._coreMouseService.activeProtocol = "X10";
651
+ break;
652
+ case 1e3:
653
+ this._coreMouseService.activeProtocol = "VT200";
654
+ break;
655
+ case 1002:
656
+ this._coreMouseService.activeProtocol = "DRAG";
657
+ break;
658
+ case 1003:
659
+ this._coreMouseService.activeProtocol = "ANY";
660
+ break;
661
+ case 1004:
662
+ this._coreService.decPrivateModes.sendFocus = !0, this._onRequestSendFocus.fire();
663
+ break;
664
+ case 1005:
665
+ this._logService.debug("DECSET 1005 not supported (see #2507)");
666
+ break;
667
+ case 1006:
668
+ this._coreMouseService.activeEncoding = "SGR";
669
+ break;
670
+ case 1015:
671
+ this._logService.debug("DECSET 1015 not supported (see #2507)");
672
+ break;
673
+ case 1016:
674
+ this._coreMouseService.activeEncoding = "SGR_PIXELS";
675
+ break;
676
+ case 25:
677
+ this._coreService.isCursorHidden = !1;
678
+ break;
679
+ case 1048:
680
+ this.saveCursor();
681
+ break;
682
+ case 1049:
683
+ this.saveCursor();
684
+ case 47:
685
+ case 1047:
686
+ this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire();
687
+ break;
688
+ case 2004:
689
+ this._coreService.decPrivateModes.bracketedPasteMode = !0;
690
+ }
691
+ return !0;
692
+ }
693
+ resetMode(e3) {
694
+ for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) {
695
+ case 4:
696
+ this._coreService.modes.insertMode = !1;
697
+ break;
698
+ case 20:
699
+ this._optionsService.options.convertEol = !1;
700
+ }
701
+ return !0;
702
+ }
703
+ resetModePrivate(e3) {
704
+ for (let t3 = 0; t3 < e3.length; t3++) switch (e3.params[t3]) {
705
+ case 1:
706
+ this._coreService.decPrivateModes.applicationCursorKeys = !1;
707
+ break;
708
+ case 3:
709
+ this._optionsService.rawOptions.windowOptions.setWinLines && (this._bufferService.resize(80, this._bufferService.rows), this._onRequestReset.fire());
710
+ break;
711
+ case 6:
712
+ this._coreService.decPrivateModes.origin = !1, this._setCursor(0, 0);
713
+ break;
714
+ case 7:
715
+ this._coreService.decPrivateModes.wraparound = !1;
716
+ break;
717
+ case 12:
718
+ this._optionsService.options.cursorBlink = !1;
719
+ break;
720
+ case 45:
721
+ this._coreService.decPrivateModes.reverseWraparound = !1;
722
+ break;
723
+ case 66:
724
+ this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire();
725
+ break;
726
+ case 9:
727
+ case 1e3:
728
+ case 1002:
729
+ case 1003:
730
+ this._coreMouseService.activeProtocol = "NONE";
731
+ break;
732
+ case 1004:
733
+ this._coreService.decPrivateModes.sendFocus = !1;
734
+ break;
735
+ case 1005:
736
+ this._logService.debug("DECRST 1005 not supported (see #2507)");
737
+ break;
738
+ case 1006:
739
+ case 1016:
740
+ this._coreMouseService.activeEncoding = "DEFAULT";
741
+ break;
742
+ case 1015:
743
+ this._logService.debug("DECRST 1015 not supported (see #2507)");
744
+ break;
745
+ case 25:
746
+ this._coreService.isCursorHidden = !0;
747
+ break;
748
+ case 1048:
749
+ this.restoreCursor();
750
+ break;
751
+ case 1049:
752
+ case 47:
753
+ case 1047:
754
+ this._bufferService.buffers.activateNormalBuffer(), e3.params[t3] === 1049 && this.restoreCursor(), this._coreService.isCursorInitialized = !0, this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1), this._onRequestSyncScrollBar.fire();
755
+ break;
756
+ case 2004:
757
+ this._coreService.decPrivateModes.bracketedPasteMode = !1;
758
+ }
759
+ return !0;
760
+ }
761
+ requestMode(e3, t3) {
762
+ let i3 = this._coreService.decPrivateModes, { activeProtocol: s3, activeEncoding: r3 } = this._coreMouseService, a2 = this._coreService, { buffers: o2, cols: h2 } = this._bufferService, { active: c2, alt: l2 } = o2, _2 = this._optionsService.rawOptions, d2 = (e4) => e4 ? 1 : 2, f2 = e3.params[0];
763
+ return u2 = f2, p2 = t3 ? f2 === 2 ? 4 : f2 === 4 ? d2(a2.modes.insertMode) : f2 === 12 ? 3 : f2 === 20 ? d2(_2.convertEol) : 0 : f2 === 1 ? d2(i3.applicationCursorKeys) : f2 === 3 ? _2.windowOptions.setWinLines ? h2 === 80 ? 2 : h2 === 132 ? 1 : 0 : 0 : f2 === 6 ? d2(i3.origin) : f2 === 7 ? d2(i3.wraparound) : f2 === 8 ? 3 : f2 === 9 ? d2(s3 === "X10") : f2 === 12 ? d2(_2.cursorBlink) : f2 === 25 ? d2(!a2.isCursorHidden) : f2 === 45 ? d2(i3.reverseWraparound) : f2 === 66 ? d2(i3.applicationKeypad) : f2 === 67 ? 4 : f2 === 1e3 ? d2(s3 === "VT200") : f2 === 1002 ? d2(s3 === "DRAG") : f2 === 1003 ? d2(s3 === "ANY") : f2 === 1004 ? d2(i3.sendFocus) : f2 === 1005 ? 4 : f2 === 1006 ? d2(r3 === "SGR") : f2 === 1015 ? 4 : f2 === 1016 ? d2(r3 === "SGR_PIXELS") : f2 === 1048 ? 1 : f2 === 47 || f2 === 1047 || f2 === 1049 ? d2(c2 === l2) : f2 === 2004 ? d2(i3.bracketedPasteMode) : 0, a2.triggerDataEvent(`${n2.C0.ESC}[${t3 ? "" : "?"}${u2};${p2}$y`), !0;
764
+ var u2, p2;
765
+ }
766
+ _updateAttrColor(e3, t3, i3, s3, r3) {
767
+ return t3 === 2 ? (e3 |= 50331648, e3 &= -16777216, e3 |= u.AttributeData.fromColorRGB([i3, s3, r3])) : t3 === 5 && (e3 &= -50331904, e3 |= 33554432 | 255 & i3), e3;
768
+ }
769
+ _extractColor(e3, t3, i3) {
770
+ let s3 = [0, 0, -1, 0, 0, 0], r3 = 0, n3 = 0;
771
+ do {
772
+ if (s3[n3 + r3] = e3.params[t3 + n3], e3.hasSubParams(t3 + n3)) {
773
+ let i4 = e3.getSubParams(t3 + n3), a2 = 0;
774
+ do
775
+ s3[1] === 5 && (r3 = 1), s3[n3 + a2 + 1 + r3] = i4[a2];
776
+ while (++a2 < i4.length && a2 + n3 + 1 + r3 < s3.length);
777
+ break;
778
+ }
779
+ if (s3[1] === 5 && n3 + r3 >= 2 || s3[1] === 2 && n3 + r3 >= 5) break;
780
+ s3[1] && (r3 = 1);
781
+ } while (++n3 + t3 < e3.length && n3 + r3 < s3.length);
782
+ for (let e4 = 2; e4 < s3.length; ++e4) s3[e4] === -1 && (s3[e4] = 0);
783
+ switch (s3[0]) {
784
+ case 38:
785
+ i3.fg = this._updateAttrColor(i3.fg, s3[1], s3[3], s3[4], s3[5]);
786
+ break;
787
+ case 48:
788
+ i3.bg = this._updateAttrColor(i3.bg, s3[1], s3[3], s3[4], s3[5]);
789
+ break;
790
+ case 58:
791
+ i3.extended = i3.extended.clone(), i3.extended.underlineColor = this._updateAttrColor(i3.extended.underlineColor, s3[1], s3[3], s3[4], s3[5]);
792
+ }
793
+ return n3;
794
+ }
795
+ _processUnderline(e3, t3) {
796
+ t3.extended = t3.extended.clone(), (!~e3 || e3 > 5) && (e3 = 1), t3.extended.underlineStyle = e3, t3.fg |= 268435456, e3 === 0 && (t3.fg &= -268435457), t3.updateExtended();
797
+ }
798
+ _processSGR0(e3) {
799
+ e3.fg = l.DEFAULT_ATTR_DATA.fg, e3.bg = l.DEFAULT_ATTR_DATA.bg, e3.extended = e3.extended.clone(), e3.extended.underlineStyle = 0, e3.extended.underlineColor &= -67108864, e3.updateExtended();
800
+ }
801
+ charAttributes(e3) {
802
+ if (e3.length === 1 && e3.params[0] === 0) return this._processSGR0(this._curAttrData), !0;
803
+ let t3 = e3.length, i3, s3 = this._curAttrData;
804
+ for (let r3 = 0; r3 < t3; r3++) i3 = e3.params[r3], i3 >= 30 && i3 <= 37 ? (s3.fg &= -50331904, s3.fg |= 16777216 | i3 - 30) : i3 >= 40 && i3 <= 47 ? (s3.bg &= -50331904, s3.bg |= 16777216 | i3 - 40) : i3 >= 90 && i3 <= 97 ? (s3.fg &= -50331904, s3.fg |= 16777224 | i3 - 90) : i3 >= 100 && i3 <= 107 ? (s3.bg &= -50331904, s3.bg |= 16777224 | i3 - 100) : i3 === 0 ? this._processSGR0(s3) : i3 === 1 ? s3.fg |= 134217728 : i3 === 3 ? s3.bg |= 67108864 : i3 === 4 ? (s3.fg |= 268435456, this._processUnderline(e3.hasSubParams(r3) ? e3.getSubParams(r3)[0] : 1, s3)) : i3 === 5 ? s3.fg |= 536870912 : i3 === 7 ? s3.fg |= 67108864 : i3 === 8 ? s3.fg |= 1073741824 : i3 === 9 ? s3.fg |= 2147483648 : i3 === 2 ? s3.bg |= 134217728 : i3 === 21 ? this._processUnderline(2, s3) : i3 === 22 ? (s3.fg &= -134217729, s3.bg &= -134217729) : i3 === 23 ? s3.bg &= -67108865 : i3 === 24 ? (s3.fg &= -268435457, this._processUnderline(0, s3)) : i3 === 25 ? s3.fg &= -536870913 : i3 === 27 ? s3.fg &= -67108865 : i3 === 28 ? s3.fg &= -1073741825 : i3 === 29 ? s3.fg &= 2147483647 : i3 === 39 ? (s3.fg &= -67108864, s3.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg) : i3 === 49 ? (s3.bg &= -67108864, s3.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : i3 === 38 || i3 === 48 || i3 === 58 ? r3 += this._extractColor(e3, r3, s3) : i3 === 53 ? s3.bg |= 1073741824 : i3 === 55 ? s3.bg &= -1073741825 : i3 === 59 ? (s3.extended = s3.extended.clone(), s3.extended.underlineColor = -1, s3.updateExtended()) : i3 === 100 ? (s3.fg &= -67108864, s3.fg |= 16777215 & l.DEFAULT_ATTR_DATA.fg, s3.bg &= -67108864, s3.bg |= 16777215 & l.DEFAULT_ATTR_DATA.bg) : this._logService.debug("Unknown SGR attribute: %d.", i3);
805
+ return !0;
806
+ }
807
+ deviceStatus(e3) {
808
+ switch (e3.params[0]) {
809
+ case 5:
810
+ this._coreService.triggerDataEvent(`${n2.C0.ESC}[0n`);
811
+ break;
812
+ case 6:
813
+ let e4 = this._activeBuffer.y + 1, t3 = this._activeBuffer.x + 1;
814
+ this._coreService.triggerDataEvent(`${n2.C0.ESC}[${e4};${t3}R`);
815
+ }
816
+ return !0;
817
+ }
818
+ deviceStatusPrivate(e3) {
819
+ if (e3.params[0] === 6) {
820
+ let e4 = this._activeBuffer.y + 1, t3 = this._activeBuffer.x + 1;
821
+ this._coreService.triggerDataEvent(`${n2.C0.ESC}[?${e4};${t3}R`);
822
+ }
823
+ return !0;
824
+ }
825
+ softReset(e3) {
826
+ 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;
827
+ }
828
+ setCursorStyle(e3) {
829
+ let t3 = e3.params[0] || 1;
830
+ switch (t3) {
831
+ case 1:
832
+ case 2:
833
+ this._optionsService.options.cursorStyle = "block";
834
+ break;
835
+ case 3:
836
+ case 4:
837
+ this._optionsService.options.cursorStyle = "underline";
838
+ break;
839
+ case 5:
840
+ case 6:
841
+ this._optionsService.options.cursorStyle = "bar";
842
+ }
843
+ let i3 = t3 % 2 == 1;
844
+ return this._optionsService.options.cursorBlink = i3, !0;
845
+ }
846
+ setScrollRegion(e3) {
847
+ let t3 = e3.params[0] || 1, i3;
848
+ return (e3.length < 2 || (i3 = e3.params[1]) > this._bufferService.rows || i3 === 0) && (i3 = this._bufferService.rows), i3 > t3 && (this._activeBuffer.scrollTop = t3 - 1, this._activeBuffer.scrollBottom = i3 - 1, this._setCursor(0, 0)), !0;
849
+ }
850
+ windowOptions(e3) {
851
+ if (!y(e3.params[0], this._optionsService.rawOptions.windowOptions)) return !0;
852
+ let t3 = e3.length > 1 ? e3.params[1] : 0;
853
+ switch (e3.params[0]) {
854
+ case 14:
855
+ t3 !== 2 && this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);
856
+ break;
857
+ case 16:
858
+ this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);
859
+ break;
860
+ case 18:
861
+ this._bufferService && this._coreService.triggerDataEvent(`${n2.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);
862
+ break;
863
+ case 22:
864
+ t3 !== 0 && t3 !== 2 || (this._windowTitleStack.push(this._windowTitle), this._windowTitleStack.length > 10 && this._windowTitleStack.shift()), t3 !== 0 && t3 !== 1 || (this._iconNameStack.push(this._iconName), this._iconNameStack.length > 10 && this._iconNameStack.shift());
865
+ break;
866
+ case 23:
867
+ t3 !== 0 && t3 !== 2 || this._windowTitleStack.length && this.setTitle(this._windowTitleStack.pop()), t3 !== 0 && t3 !== 1 || this._iconNameStack.length && this.setIconName(this._iconNameStack.pop());
868
+ }
869
+ return !0;
870
+ }
871
+ saveCursor(e3) {
872
+ 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;
873
+ }
874
+ restoreCursor(e3) {
875
+ 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;
876
+ }
877
+ setTitle(e3) {
878
+ return this._windowTitle = e3, this._onTitleChange.fire(e3), !0;
879
+ }
880
+ setIconName(e3) {
881
+ return this._iconName = e3, !0;
882
+ }
883
+ setOrReportIndexedColor(e3) {
884
+ let t3 = [], i3 = e3.split(";");
885
+ for (; i3.length > 1; ) {
886
+ let e4 = i3.shift(), s3 = i3.shift();
887
+ if (/^\d+$/.exec(e4)) {
888
+ let i4 = parseInt(e4);
889
+ if (L(i4)) if (s3 === "?") t3.push({ type: 0, index: i4 });
890
+ else {
891
+ let e5 = (0, S.parseColor)(s3);
892
+ e5 && t3.push({ type: 1, index: i4, color: e5 });
893
+ }
894
+ }
895
+ }
896
+ return t3.length && this._onColor.fire(t3), !0;
897
+ }
898
+ setHyperlink(e3) {
899
+ let t3 = e3.split(";");
900
+ return !(t3.length < 2) && (t3[1] ? this._createHyperlink(t3[0], t3[1]) : !t3[0] && this._finishHyperlink());
901
+ }
902
+ _createHyperlink(e3, t3) {
903
+ this._getCurrentLinkId() && this._finishHyperlink();
904
+ let i3 = e3.split(":"), s3, r3 = i3.findIndex(((e4) => e4.startsWith("id=")));
905
+ return r3 !== -1 && (s3 = i3[r3].slice(3) || void 0), this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id: s3, uri: t3 }), this._curAttrData.updateExtended(), !0;
906
+ }
907
+ _finishHyperlink() {
908
+ return this._curAttrData.extended = this._curAttrData.extended.clone(), this._curAttrData.extended.urlId = 0, this._curAttrData.updateExtended(), !0;
909
+ }
910
+ _setOrReportSpecialColor(e3, t3) {
911
+ let i3 = e3.split(";");
912
+ for (let e4 = 0; e4 < i3.length && !(t3 >= this._specialColors.length); ++e4, ++t3) if (i3[e4] === "?") this._onColor.fire([{ type: 0, index: this._specialColors[t3] }]);
913
+ else {
914
+ let s3 = (0, S.parseColor)(i3[e4]);
915
+ s3 && this._onColor.fire([{ type: 1, index: this._specialColors[t3], color: s3 }]);
916
+ }
917
+ return !0;
918
+ }
919
+ setOrReportFgColor(e3) {
920
+ return this._setOrReportSpecialColor(e3, 0);
921
+ }
922
+ setOrReportBgColor(e3) {
923
+ return this._setOrReportSpecialColor(e3, 1);
924
+ }
925
+ setOrReportCursorColor(e3) {
926
+ return this._setOrReportSpecialColor(e3, 2);
927
+ }
928
+ restoreIndexedColor(e3) {
929
+ if (!e3) return this._onColor.fire([{ type: 2 }]), !0;
930
+ let t3 = [], i3 = e3.split(";");
931
+ for (let e4 = 0; e4 < i3.length; ++e4) if (/^\d+$/.exec(i3[e4])) {
932
+ let s3 = parseInt(i3[e4]);
933
+ L(s3) && t3.push({ type: 2, index: s3 });
934
+ }
935
+ return t3.length && this._onColor.fire(t3), !0;
936
+ }
937
+ restoreFgColor(e3) {
938
+ return this._onColor.fire([{ type: 2, index: 256 }]), !0;
939
+ }
940
+ restoreBgColor(e3) {
941
+ return this._onColor.fire([{ type: 2, index: 257 }]), !0;
942
+ }
943
+ restoreCursorColor(e3) {
944
+ return this._onColor.fire([{ type: 2, index: 258 }]), !0;
945
+ }
946
+ nextLine() {
947
+ return this._activeBuffer.x = 0, this.index(), !0;
948
+ }
949
+ keypadApplicationMode() {
950
+ return this._logService.debug("Serial port requested application keypad."), this._coreService.decPrivateModes.applicationKeypad = !0, this._onRequestSyncScrollBar.fire(), !0;
951
+ }
952
+ keypadNumericMode() {
953
+ return this._logService.debug("Switching back to normal keypad."), this._coreService.decPrivateModes.applicationKeypad = !1, this._onRequestSyncScrollBar.fire(), !0;
954
+ }
955
+ selectDefaultCharset() {
956
+ return this._charsetService.setgLevel(0), this._charsetService.setgCharset(0, a.DEFAULT_CHARSET), !0;
957
+ }
958
+ selectCharset(e3) {
959
+ return e3.length !== 2 ? (this.selectDefaultCharset(), !0) : (e3[0] === "/" || this._charsetService.setgCharset(m[e3[0]], a.CHARSETS[e3[1]] || a.DEFAULT_CHARSET), !0);
960
+ }
961
+ index() {
962
+ 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;
963
+ }
964
+ tabSet() {
965
+ return this._activeBuffer.tabs[this._activeBuffer.x] = !0, !0;
966
+ }
967
+ reverseIndex() {
968
+ if (this._restrictCursor(), this._activeBuffer.y === this._activeBuffer.scrollTop) {
969
+ let e3 = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;
970
+ this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, e3, 1), this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData())), this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);
971
+ } else this._activeBuffer.y--, this._restrictCursor();
972
+ return !0;
973
+ }
974
+ fullReset() {
975
+ return this._parser.reset(), this._onRequestReset.fire(), !0;
976
+ }
977
+ reset() {
978
+ this._curAttrData = l.DEFAULT_ATTR_DATA.clone(), this._eraseAttrDataInternal = l.DEFAULT_ATTR_DATA.clone();
979
+ }
980
+ _eraseAttrData() {
981
+ return this._eraseAttrDataInternal.bg &= -67108864, this._eraseAttrDataInternal.bg |= 67108863 & this._curAttrData.bg, this._eraseAttrDataInternal;
982
+ }
983
+ setgLevel(e3) {
984
+ return this._charsetService.setgLevel(e3), !0;
985
+ }
986
+ screenAlignmentPattern() {
987
+ let e3 = new f.CellData();
988
+ e3.content = 4194373, e3.fg = this._curAttrData.fg, e3.bg = this._curAttrData.bg, this._setCursor(0, 0);
989
+ for (let t3 = 0; t3 < this._bufferService.rows; ++t3) {
990
+ let i3 = this._activeBuffer.ybase + this._activeBuffer.y + t3, s3 = this._activeBuffer.lines.get(i3);
991
+ s3 && (s3.fill(e3), s3.isWrapped = !1);
992
+ }
993
+ return this._dirtyRowTracker.markAllDirty(), this._setCursor(0, 0), !0;
994
+ }
995
+ requestStatusString(e3, t3) {
996
+ let i3 = this._bufferService.buffer, s3 = this._optionsService.rawOptions;
997
+ return ((e4) => (this._coreService.triggerDataEvent(`${n2.C0.ESC}${e4}${n2.C0.ESC}\\`), !0))(e3 === '"q' ? `P1$r${this._curAttrData.isProtected() ? 1 : 0}"q` : e3 === '"p' ? 'P1$r61;1"p' : e3 === "r" ? `P1$r${i3.scrollTop + 1};${i3.scrollBottom + 1}r` : e3 === "m" ? "P1$r0m" : e3 === " q" ? `P1$r${{ block: 2, underline: 4, bar: 6 }[s3.cursorStyle] - (s3.cursorBlink ? 1 : 0)} q` : "P0$r");
998
+ }
999
+ markRangeDirty(e3, t3) {
1000
+ this._dirtyRowTracker.markRangeDirty(e3, t3);
1001
+ }
1002
+ }
1003
+ t2.InputHandler = E;
1004
+ let A = class {
1005
+ constructor(e3) {
1006
+ this._bufferService = e3, this.clearRange();
1007
+ }
1008
+ clearRange() {
1009
+ this.start = this._bufferService.buffer.y, this.end = this._bufferService.buffer.y;
1010
+ }
1011
+ markDirty(e3) {
1012
+ e3 < this.start ? this.start = e3 : e3 > this.end && (this.end = e3);
1013
+ }
1014
+ markRangeDirty(e3, t3) {
1015
+ e3 > t3 && (B = e3, e3 = t3, t3 = B), e3 < this.start && (this.start = e3), t3 > this.end && (this.end = t3);
1016
+ }
1017
+ markAllDirty() {
1018
+ this.markRangeDirty(0, this._bufferService.rows - 1);
1019
+ }
1020
+ };
1021
+ function L(e3) {
1022
+ return 0 <= e3 && e3 < 256;
1023
+ }
1024
+ A = s2([r2(0, p.IBufferService)], A);
1025
+ }, 844: (e2, t2) => {
1026
+ function i2(e3) {
1027
+ for (let t3 of e3) t3.dispose();
1028
+ e3.length = 0;
1029
+ }
1030
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getDisposeArrayDisposable = t2.disposeArray = t2.toDisposable = t2.MutableDisposable = t2.Disposable = void 0, t2.Disposable = class {
1031
+ constructor() {
1032
+ this._disposables = [], this._isDisposed = !1;
1033
+ }
1034
+ dispose() {
1035
+ this._isDisposed = !0;
1036
+ for (let e3 of this._disposables) e3.dispose();
1037
+ this._disposables.length = 0;
1038
+ }
1039
+ register(e3) {
1040
+ return this._disposables.push(e3), e3;
1041
+ }
1042
+ unregister(e3) {
1043
+ let t3 = this._disposables.indexOf(e3);
1044
+ t3 !== -1 && this._disposables.splice(t3, 1);
1045
+ }
1046
+ }, t2.MutableDisposable = class {
1047
+ constructor() {
1048
+ this._isDisposed = !1;
1049
+ }
1050
+ get value() {
1051
+ return this._isDisposed ? void 0 : this._value;
1052
+ }
1053
+ set value(e3) {
1054
+ this._isDisposed || e3 === this._value || (this._value?.dispose(), this._value = e3);
1055
+ }
1056
+ clear() {
1057
+ this.value = void 0;
1058
+ }
1059
+ dispose() {
1060
+ this._isDisposed = !0, this._value?.dispose(), this._value = void 0;
1061
+ }
1062
+ }, t2.toDisposable = function(e3) {
1063
+ return { dispose: e3 };
1064
+ }, t2.disposeArray = i2, t2.getDisposeArrayDisposable = function(e3) {
1065
+ return { dispose: () => i2(e3) };
1066
+ };
1067
+ }, 114: (e2, t2) => {
1068
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.isChromeOS = t2.isLinux = t2.isWindows = t2.isIphone = t2.isIpad = t2.isMac = t2.getSafariVersion = t2.isSafari = t2.isLegacyEdge = t2.isFirefox = t2.isNode = void 0, t2.isNode = typeof process < "u" && "title" in process;
1069
+ let i2 = t2.isNode ? "node" : navigator.userAgent, s2 = t2.isNode ? "node" : navigator.platform;
1070
+ t2.isFirefox = i2.includes("Firefox"), t2.isLegacyEdge = i2.includes("Edge"), t2.isSafari = /^((?!chrome|android).)*safari/i.test(i2), t2.getSafariVersion = function() {
1071
+ if (!t2.isSafari) return 0;
1072
+ let e3 = i2.match(/Version\/(\d+)/);
1073
+ return e3 === null || e3.length < 2 ? 0 : parseInt(e3[1]);
1074
+ }, t2.isMac = ["Macintosh", "MacIntel", "MacPPC", "Mac68K"].includes(s2), t2.isIpad = s2 === "iPad", t2.isIphone = s2 === "iPhone", t2.isWindows = ["Windows", "Win16", "Win32", "WinCE"].includes(s2), t2.isLinux = s2.indexOf("Linux") >= 0, t2.isChromeOS = /\bCrOS\b/.test(i2);
1075
+ }, 226: (e2, t2, i2) => {
1076
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DebouncedIdleTask = t2.IdleTaskQueue = t2.PriorityTaskQueue = void 0;
1077
+ let s2 = i2(114);
1078
+ class r2 {
1079
+ constructor() {
1080
+ this._tasks = [], this._i = 0;
1081
+ }
1082
+ enqueue(e3) {
1083
+ this._tasks.push(e3), this._start();
1084
+ }
1085
+ flush() {
1086
+ for (; this._i < this._tasks.length; ) this._tasks[this._i]() || this._i++;
1087
+ this.clear();
1088
+ }
1089
+ clear() {
1090
+ this._idleCallback && (this._cancelCallback(this._idleCallback), this._idleCallback = void 0), this._i = 0, this._tasks.length = 0;
1091
+ }
1092
+ _start() {
1093
+ this._idleCallback || (this._idleCallback = this._requestCallback(this._process.bind(this)));
1094
+ }
1095
+ _process(e3) {
1096
+ this._idleCallback = void 0;
1097
+ let t3 = 0, i3 = 0, s3 = e3.timeRemaining(), r3 = 0;
1098
+ for (; this._i < this._tasks.length; ) {
1099
+ if (t3 = Date.now(), this._tasks[this._i]() || this._i++, t3 = Math.max(1, Date.now() - t3), i3 = Math.max(t3, i3), r3 = e3.timeRemaining(), 1.5 * i3 > r3) return s3 - t3 < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s3 - t3))}ms`), void this._start();
1100
+ s3 = r3;
1101
+ }
1102
+ this.clear();
1103
+ }
1104
+ }
1105
+ class n2 extends r2 {
1106
+ _requestCallback(e3) {
1107
+ return setTimeout((() => e3(this._createDeadline(16))));
1108
+ }
1109
+ _cancelCallback(e3) {
1110
+ clearTimeout(e3);
1111
+ }
1112
+ _createDeadline(e3) {
1113
+ let t3 = Date.now() + e3;
1114
+ return { timeRemaining: () => Math.max(0, t3 - Date.now()) };
1115
+ }
1116
+ }
1117
+ t2.PriorityTaskQueue = n2, t2.IdleTaskQueue = !s2.isNode && "requestIdleCallback" in window ? class extends r2 {
1118
+ _requestCallback(e3) {
1119
+ return requestIdleCallback(e3);
1120
+ }
1121
+ _cancelCallback(e3) {
1122
+ cancelIdleCallback(e3);
1123
+ }
1124
+ } : n2, t2.DebouncedIdleTask = class {
1125
+ constructor() {
1126
+ this._queue = new t2.IdleTaskQueue();
1127
+ }
1128
+ set(e3) {
1129
+ this._queue.clear(), this._queue.enqueue(e3);
1130
+ }
1131
+ flush() {
1132
+ this._queue.flush();
1133
+ }
1134
+ };
1135
+ }, 282: (e2, t2, i2) => {
1136
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.updateWindowsModeWrappedState = void 0;
1137
+ let s2 = i2(643);
1138
+ t2.updateWindowsModeWrappedState = function(e3) {
1139
+ let t3 = e3.buffer.lines.get(e3.buffer.ybase + e3.buffer.y - 1), i3 = t3?.get(e3.cols - 1), r2 = e3.buffer.lines.get(e3.buffer.ybase + e3.buffer.y);
1140
+ r2 && i3 && (r2.isWrapped = i3[s2.CHAR_DATA_CODE_INDEX] !== s2.NULL_CELL_CODE && i3[s2.CHAR_DATA_CODE_INDEX] !== s2.WHITESPACE_CELL_CODE);
1141
+ };
1142
+ }, 734: (e2, t2) => {
1143
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ExtendedAttrs = t2.AttributeData = void 0;
1144
+ class i2 {
1145
+ constructor() {
1146
+ this.fg = 0, this.bg = 0, this.extended = new s2();
1147
+ }
1148
+ static toColorRGB(e3) {
1149
+ return [e3 >>> 16 & 255, e3 >>> 8 & 255, 255 & e3];
1150
+ }
1151
+ static fromColorRGB(e3) {
1152
+ return (255 & e3[0]) << 16 | (255 & e3[1]) << 8 | 255 & e3[2];
1153
+ }
1154
+ clone() {
1155
+ let e3 = new i2();
1156
+ return e3.fg = this.fg, e3.bg = this.bg, e3.extended = this.extended.clone(), e3;
1157
+ }
1158
+ isInverse() {
1159
+ return 67108864 & this.fg;
1160
+ }
1161
+ isBold() {
1162
+ return 134217728 & this.fg;
1163
+ }
1164
+ isUnderline() {
1165
+ return this.hasExtendedAttrs() && this.extended.underlineStyle !== 0 ? 1 : 268435456 & this.fg;
1166
+ }
1167
+ isBlink() {
1168
+ return 536870912 & this.fg;
1169
+ }
1170
+ isInvisible() {
1171
+ return 1073741824 & this.fg;
1172
+ }
1173
+ isItalic() {
1174
+ return 67108864 & this.bg;
1175
+ }
1176
+ isDim() {
1177
+ return 134217728 & this.bg;
1178
+ }
1179
+ isStrikethrough() {
1180
+ return 2147483648 & this.fg;
1181
+ }
1182
+ isProtected() {
1183
+ return 536870912 & this.bg;
1184
+ }
1185
+ isOverline() {
1186
+ return 1073741824 & this.bg;
1187
+ }
1188
+ getFgColorMode() {
1189
+ return 50331648 & this.fg;
1190
+ }
1191
+ getBgColorMode() {
1192
+ return 50331648 & this.bg;
1193
+ }
1194
+ isFgRGB() {
1195
+ return (50331648 & this.fg) == 50331648;
1196
+ }
1197
+ isBgRGB() {
1198
+ return (50331648 & this.bg) == 50331648;
1199
+ }
1200
+ isFgPalette() {
1201
+ return (50331648 & this.fg) == 16777216 || (50331648 & this.fg) == 33554432;
1202
+ }
1203
+ isBgPalette() {
1204
+ return (50331648 & this.bg) == 16777216 || (50331648 & this.bg) == 33554432;
1205
+ }
1206
+ isFgDefault() {
1207
+ return (50331648 & this.fg) == 0;
1208
+ }
1209
+ isBgDefault() {
1210
+ return (50331648 & this.bg) == 0;
1211
+ }
1212
+ isAttributeDefault() {
1213
+ return this.fg === 0 && this.bg === 0;
1214
+ }
1215
+ getFgColor() {
1216
+ switch (50331648 & this.fg) {
1217
+ case 16777216:
1218
+ case 33554432:
1219
+ return 255 & this.fg;
1220
+ case 50331648:
1221
+ return 16777215 & this.fg;
1222
+ default:
1223
+ return -1;
1224
+ }
1225
+ }
1226
+ getBgColor() {
1227
+ switch (50331648 & this.bg) {
1228
+ case 16777216:
1229
+ case 33554432:
1230
+ return 255 & this.bg;
1231
+ case 50331648:
1232
+ return 16777215 & this.bg;
1233
+ default:
1234
+ return -1;
1235
+ }
1236
+ }
1237
+ hasExtendedAttrs() {
1238
+ return 268435456 & this.bg;
1239
+ }
1240
+ updateExtended() {
1241
+ this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456;
1242
+ }
1243
+ getUnderlineColor() {
1244
+ if (268435456 & this.bg && ~this.extended.underlineColor) switch (50331648 & this.extended.underlineColor) {
1245
+ case 16777216:
1246
+ case 33554432:
1247
+ return 255 & this.extended.underlineColor;
1248
+ case 50331648:
1249
+ return 16777215 & this.extended.underlineColor;
1250
+ default:
1251
+ return this.getFgColor();
1252
+ }
1253
+ return this.getFgColor();
1254
+ }
1255
+ getUnderlineColorMode() {
1256
+ return 268435456 & this.bg && ~this.extended.underlineColor ? 50331648 & this.extended.underlineColor : this.getFgColorMode();
1257
+ }
1258
+ isUnderlineColorRGB() {
1259
+ return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 50331648 : this.isFgRGB();
1260
+ }
1261
+ isUnderlineColorPalette() {
1262
+ return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 16777216 || (50331648 & this.extended.underlineColor) == 33554432 : this.isFgPalette();
1263
+ }
1264
+ isUnderlineColorDefault() {
1265
+ return 268435456 & this.bg && ~this.extended.underlineColor ? (50331648 & this.extended.underlineColor) == 0 : this.isFgDefault();
1266
+ }
1267
+ getUnderlineStyle() {
1268
+ return 268435456 & this.fg ? 268435456 & this.bg ? this.extended.underlineStyle : 1 : 0;
1269
+ }
1270
+ getUnderlineVariantOffset() {
1271
+ return this.extended.underlineVariantOffset;
1272
+ }
1273
+ }
1274
+ t2.AttributeData = i2;
1275
+ class s2 {
1276
+ get ext() {
1277
+ return this._urlId ? -469762049 & this._ext | this.underlineStyle << 26 : this._ext;
1278
+ }
1279
+ set ext(e3) {
1280
+ this._ext = e3;
1281
+ }
1282
+ get underlineStyle() {
1283
+ return this._urlId ? 5 : (469762048 & this._ext) >> 26;
1284
+ }
1285
+ set underlineStyle(e3) {
1286
+ this._ext &= -469762049, this._ext |= e3 << 26 & 469762048;
1287
+ }
1288
+ get underlineColor() {
1289
+ return 67108863 & this._ext;
1290
+ }
1291
+ set underlineColor(e3) {
1292
+ this._ext &= -67108864, this._ext |= 67108863 & e3;
1293
+ }
1294
+ get urlId() {
1295
+ return this._urlId;
1296
+ }
1297
+ set urlId(e3) {
1298
+ this._urlId = e3;
1299
+ }
1300
+ get underlineVariantOffset() {
1301
+ let e3 = (3758096384 & this._ext) >> 29;
1302
+ return e3 < 0 ? 4294967288 ^ e3 : e3;
1303
+ }
1304
+ set underlineVariantOffset(e3) {
1305
+ this._ext &= 536870911, this._ext |= e3 << 29 & 3758096384;
1306
+ }
1307
+ constructor(e3 = 0, t3 = 0) {
1308
+ this._ext = 0, this._urlId = 0, this._ext = e3, this._urlId = t3;
1309
+ }
1310
+ clone() {
1311
+ return new s2(this._ext, this._urlId);
1312
+ }
1313
+ isEmpty() {
1314
+ return this.underlineStyle === 0 && this._urlId === 0;
1315
+ }
1316
+ }
1317
+ t2.ExtendedAttrs = s2;
1318
+ }, 92: (e2, t2, i2) => {
1319
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Buffer = t2.MAX_BUFFER_SIZE = void 0;
1320
+ let s2 = i2(349), r2 = i2(226), n2 = i2(734), a = i2(437), o = i2(634), h = i2(511), c = i2(643), l = i2(863), _ = i2(116);
1321
+ t2.MAX_BUFFER_SIZE = 4294967295, t2.Buffer = class {
1322
+ constructor(e3, t3, i3) {
1323
+ this._hasScrollback = e3, this._optionsService = t3, this._bufferService = i3, this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.tabs = {}, this.savedY = 0, this.savedX = 0, this.savedCurAttrData = a.DEFAULT_ATTR_DATA.clone(), this.savedCharset = _.DEFAULT_CHARSET, this.markers = [], this._nullCell = h.CellData.fromCharData([0, c.NULL_CELL_CHAR, c.NULL_CELL_WIDTH, c.NULL_CELL_CODE]), this._whitespaceCell = h.CellData.fromCharData([0, c.WHITESPACE_CELL_CHAR, c.WHITESPACE_CELL_WIDTH, c.WHITESPACE_CELL_CODE]), this._isClearing = !1, this._memoryCleanupQueue = new r2.IdleTaskQueue(), this._memoryCleanupPosition = 0, this._cols = this._bufferService.cols, this._rows = this._bufferService.rows, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
1324
+ }
1325
+ getNullCell(e3) {
1326
+ return e3 ? (this._nullCell.fg = e3.fg, this._nullCell.bg = e3.bg, this._nullCell.extended = e3.extended) : (this._nullCell.fg = 0, this._nullCell.bg = 0, this._nullCell.extended = new n2.ExtendedAttrs()), this._nullCell;
1327
+ }
1328
+ getWhitespaceCell(e3) {
1329
+ return e3 ? (this._whitespaceCell.fg = e3.fg, this._whitespaceCell.bg = e3.bg, this._whitespaceCell.extended = e3.extended) : (this._whitespaceCell.fg = 0, this._whitespaceCell.bg = 0, this._whitespaceCell.extended = new n2.ExtendedAttrs()), this._whitespaceCell;
1330
+ }
1331
+ getBlankLine(e3, t3) {
1332
+ return new a.BufferLine(this._bufferService.cols, this.getNullCell(e3), t3);
1333
+ }
1334
+ get hasScrollback() {
1335
+ return this._hasScrollback && this.lines.maxLength > this._rows;
1336
+ }
1337
+ get isCursorInViewport() {
1338
+ let e3 = this.ybase + this.y - this.ydisp;
1339
+ return e3 >= 0 && e3 < this._rows;
1340
+ }
1341
+ _getCorrectBufferLength(e3) {
1342
+ if (!this._hasScrollback) return e3;
1343
+ let i3 = e3 + this._optionsService.rawOptions.scrollback;
1344
+ return i3 > t2.MAX_BUFFER_SIZE ? t2.MAX_BUFFER_SIZE : i3;
1345
+ }
1346
+ fillViewportRows(e3) {
1347
+ if (this.lines.length === 0) {
1348
+ e3 === void 0 && (e3 = a.DEFAULT_ATTR_DATA);
1349
+ let t3 = this._rows;
1350
+ for (; t3--; ) this.lines.push(this.getBlankLine(e3));
1351
+ }
1352
+ }
1353
+ clear() {
1354
+ this.ydisp = 0, this.ybase = 0, this.y = 0, this.x = 0, this.lines = new s2.CircularList(this._getCorrectBufferLength(this._rows)), this.scrollTop = 0, this.scrollBottom = this._rows - 1, this.setupTabStops();
1355
+ }
1356
+ resize(e3, t3) {
1357
+ let i3 = this.getNullCell(a.DEFAULT_ATTR_DATA), s3 = 0, r3 = this._getCorrectBufferLength(t3);
1358
+ if (r3 > this.lines.maxLength && (this.lines.maxLength = r3), this.lines.length > 0) {
1359
+ if (this._cols < e3) for (let t4 = 0; t4 < this.lines.length; t4++) s3 += +this.lines.get(t4).resize(e3, i3);
1360
+ let n3 = 0;
1361
+ if (this._rows < t3) for (let s4 = this._rows; s4 < t3; s4++) this.lines.length < t3 + this.ybase && (this._optionsService.rawOptions.windowsMode || this._optionsService.rawOptions.windowsPty.backend !== void 0 || this._optionsService.rawOptions.windowsPty.buildNumber !== void 0 ? this.lines.push(new a.BufferLine(e3, i3)) : this.ybase > 0 && this.lines.length <= this.ybase + this.y + n3 + 1 ? (this.ybase--, n3++, this.ydisp > 0 && this.ydisp--) : this.lines.push(new a.BufferLine(e3, i3)));
1362
+ else for (let e4 = this._rows; e4 > t3; e4--) this.lines.length > t3 + this.ybase && (this.lines.length > this.ybase + this.y + 1 ? this.lines.pop() : (this.ybase++, this.ydisp++));
1363
+ if (r3 < this.lines.maxLength) {
1364
+ let e4 = this.lines.length - r3;
1365
+ e4 > 0 && (this.lines.trimStart(e4), this.ybase = Math.max(this.ybase - e4, 0), this.ydisp = Math.max(this.ydisp - e4, 0), this.savedY = Math.max(this.savedY - e4, 0)), this.lines.maxLength = r3;
1366
+ }
1367
+ this.x = Math.min(this.x, e3 - 1), this.y = Math.min(this.y, t3 - 1), n3 && (this.y += n3), this.savedX = Math.min(this.savedX, e3 - 1), this.scrollTop = 0;
1368
+ }
1369
+ if (this.scrollBottom = t3 - 1, this._isReflowEnabled && (this._reflow(e3, t3), this._cols > e3)) for (let t4 = 0; t4 < this.lines.length; t4++) s3 += +this.lines.get(t4).resize(e3, i3);
1370
+ this._cols = e3, this._rows = t3, this._memoryCleanupQueue.clear(), s3 > 0.1 * this.lines.length && (this._memoryCleanupPosition = 0, this._memoryCleanupQueue.enqueue((() => this._batchedMemoryCleanup())));
1371
+ }
1372
+ _batchedMemoryCleanup() {
1373
+ let e3 = !0;
1374
+ this._memoryCleanupPosition >= this.lines.length && (this._memoryCleanupPosition = 0, e3 = !1);
1375
+ let t3 = 0;
1376
+ for (; this._memoryCleanupPosition < this.lines.length; ) if (t3 += this.lines.get(this._memoryCleanupPosition++).cleanupMemory(), t3 > 100) return !0;
1377
+ return e3;
1378
+ }
1379
+ get _isReflowEnabled() {
1380
+ let e3 = this._optionsService.rawOptions.windowsPty;
1381
+ return e3 && e3.buildNumber ? this._hasScrollback && e3.backend === "conpty" && e3.buildNumber >= 21376 : this._hasScrollback && !this._optionsService.rawOptions.windowsMode;
1382
+ }
1383
+ _reflow(e3, t3) {
1384
+ this._cols !== e3 && (e3 > this._cols ? this._reflowLarger(e3, t3) : this._reflowSmaller(e3, t3));
1385
+ }
1386
+ _reflowLarger(e3, t3) {
1387
+ let i3 = (0, o.reflowLargerGetLinesToRemove)(this.lines, this._cols, e3, this.ybase + this.y, this.getNullCell(a.DEFAULT_ATTR_DATA));
1388
+ if (i3.length > 0) {
1389
+ let s3 = (0, o.reflowLargerCreateNewLayout)(this.lines, i3);
1390
+ (0, o.reflowLargerApplyNewLayout)(this.lines, s3.layout), this._reflowLargerAdjustViewport(e3, t3, s3.countRemoved);
1391
+ }
1392
+ }
1393
+ _reflowLargerAdjustViewport(e3, t3, i3) {
1394
+ let s3 = this.getNullCell(a.DEFAULT_ATTR_DATA), r3 = i3;
1395
+ for (; r3-- > 0; ) this.ybase === 0 ? (this.y > 0 && this.y--, this.lines.length < t3 && this.lines.push(new a.BufferLine(e3, s3))) : (this.ydisp === this.ybase && this.ydisp--, this.ybase--);
1396
+ this.savedY = Math.max(this.savedY - i3, 0);
1397
+ }
1398
+ _reflowSmaller(e3, t3) {
1399
+ let i3 = this.getNullCell(a.DEFAULT_ATTR_DATA), s3 = [], r3 = 0;
1400
+ for (let n3 = this.lines.length - 1; n3 >= 0; n3--) {
1401
+ let h2 = this.lines.get(n3);
1402
+ if (!h2 || !h2.isWrapped && h2.getTrimmedLength() <= e3) continue;
1403
+ let c2 = [h2];
1404
+ for (; h2.isWrapped && n3 > 0; ) h2 = this.lines.get(--n3), c2.unshift(h2);
1405
+ let l2 = this.ybase + this.y;
1406
+ if (l2 >= n3 && l2 < n3 + c2.length) continue;
1407
+ let _2 = c2[c2.length - 1].getTrimmedLength(), d = (0, o.reflowSmallerGetNewLineLengths)(c2, this._cols, e3), f = d.length - c2.length, u;
1408
+ u = this.ybase === 0 && this.y !== this.lines.length - 1 ? Math.max(0, this.y - this.lines.maxLength + f) : Math.max(0, this.lines.length - this.lines.maxLength + f);
1409
+ let p = [];
1410
+ for (let e4 = 0; e4 < f; e4++) {
1411
+ let e5 = this.getBlankLine(a.DEFAULT_ATTR_DATA, !0);
1412
+ p.push(e5);
1413
+ }
1414
+ p.length > 0 && (s3.push({ start: n3 + c2.length + r3, newLines: p }), r3 += p.length), c2.push(...p);
1415
+ let g = d.length - 1, v = d[g];
1416
+ v === 0 && (g--, v = d[g]);
1417
+ let b = c2.length - f - 1, S = _2;
1418
+ for (; b >= 0; ) {
1419
+ let e4 = Math.min(S, v);
1420
+ if (c2[g] === void 0) break;
1421
+ if (c2[g].copyCellsFrom(c2[b], S - e4, v - e4, e4, !0), v -= e4, v === 0 && (g--, v = d[g]), S -= e4, S === 0) {
1422
+ b--;
1423
+ let e5 = Math.max(b, 0);
1424
+ S = (0, o.getWrappedLineTrimmedLength)(c2, e5, this._cols);
1425
+ }
1426
+ }
1427
+ for (let t4 = 0; t4 < c2.length; t4++) d[t4] < e3 && c2[t4].setCell(d[t4], i3);
1428
+ let m = f - u;
1429
+ for (; m-- > 0; ) this.ybase === 0 ? this.y < t3 - 1 ? (this.y++, this.lines.pop()) : (this.ybase++, this.ydisp++) : this.ybase < Math.min(this.lines.maxLength, this.lines.length + r3) - t3 && (this.ybase === this.ydisp && this.ydisp++, this.ybase++);
1430
+ this.savedY = Math.min(this.savedY + f, this.ybase + t3 - 1);
1431
+ }
1432
+ if (s3.length > 0) {
1433
+ let e4 = [], t4 = [];
1434
+ for (let e5 = 0; e5 < this.lines.length; e5++) t4.push(this.lines.get(e5));
1435
+ let i4 = this.lines.length, n3 = i4 - 1, a2 = 0, o2 = s3[a2];
1436
+ this.lines.length = Math.min(this.lines.maxLength, this.lines.length + r3);
1437
+ let h2 = 0;
1438
+ for (let c3 = Math.min(this.lines.maxLength - 1, i4 + r3 - 1); c3 >= 0; c3--) if (o2 && o2.start > n3 + h2) {
1439
+ for (let e5 = o2.newLines.length - 1; e5 >= 0; e5--) this.lines.set(c3--, o2.newLines[e5]);
1440
+ c3++, e4.push({ index: n3 + 1, amount: o2.newLines.length }), h2 += o2.newLines.length, o2 = s3[++a2];
1441
+ } else this.lines.set(c3, t4[n3--]);
1442
+ let c2 = 0;
1443
+ for (let t5 = e4.length - 1; t5 >= 0; t5--) e4[t5].index += c2, this.lines.onInsertEmitter.fire(e4[t5]), c2 += e4[t5].amount;
1444
+ let l2 = Math.max(0, i4 + r3 - this.lines.maxLength);
1445
+ l2 > 0 && this.lines.onTrimEmitter.fire(l2);
1446
+ }
1447
+ }
1448
+ translateBufferLineToString(e3, t3, i3 = 0, s3) {
1449
+ let r3 = this.lines.get(e3);
1450
+ return r3 ? r3.translateToString(t3, i3, s3) : "";
1451
+ }
1452
+ getWrappedRangeForLine(e3) {
1453
+ let t3 = e3, i3 = e3;
1454
+ for (; t3 > 0 && this.lines.get(t3).isWrapped; ) t3--;
1455
+ for (; i3 + 1 < this.lines.length && this.lines.get(i3 + 1).isWrapped; ) i3++;
1456
+ return { first: t3, last: i3 };
1457
+ }
1458
+ setupTabStops(e3) {
1459
+ for (e3 != null ? this.tabs[e3] || (e3 = this.prevStop(e3)) : (this.tabs = {}, e3 = 0); e3 < this._cols; e3 += this._optionsService.rawOptions.tabStopWidth) this.tabs[e3] = !0;
1460
+ }
1461
+ prevStop(e3) {
1462
+ for (e3 == null && (e3 = this.x); !this.tabs[--e3] && e3 > 0; ) ;
1463
+ return e3 >= this._cols ? this._cols - 1 : e3 < 0 ? 0 : e3;
1464
+ }
1465
+ nextStop(e3) {
1466
+ for (e3 == null && (e3 = this.x); !this.tabs[++e3] && e3 < this._cols; ) ;
1467
+ return e3 >= this._cols ? this._cols - 1 : e3 < 0 ? 0 : e3;
1468
+ }
1469
+ clearMarkers(e3) {
1470
+ this._isClearing = !0;
1471
+ for (let t3 = 0; t3 < this.markers.length; t3++) this.markers[t3].line === e3 && (this.markers[t3].dispose(), this.markers.splice(t3--, 1));
1472
+ this._isClearing = !1;
1473
+ }
1474
+ clearAllMarkers() {
1475
+ this._isClearing = !0;
1476
+ for (let e3 = 0; e3 < this.markers.length; e3++) this.markers[e3].dispose(), this.markers.splice(e3--, 1);
1477
+ this._isClearing = !1;
1478
+ }
1479
+ addMarker(e3) {
1480
+ let t3 = new l.Marker(e3);
1481
+ return this.markers.push(t3), t3.register(this.lines.onTrim(((e4) => {
1482
+ t3.line -= e4, t3.line < 0 && t3.dispose();
1483
+ }))), t3.register(this.lines.onInsert(((e4) => {
1484
+ t3.line >= e4.index && (t3.line += e4.amount);
1485
+ }))), t3.register(this.lines.onDelete(((e4) => {
1486
+ t3.line >= e4.index && t3.line < e4.index + e4.amount && t3.dispose(), t3.line > e4.index && (t3.line -= e4.amount);
1487
+ }))), t3.register(t3.onDispose((() => this._removeMarker(t3)))), t3;
1488
+ }
1489
+ _removeMarker(e3) {
1490
+ this._isClearing || this.markers.splice(this.markers.indexOf(e3), 1);
1491
+ }
1492
+ };
1493
+ }, 437: (e2, t2, i2) => {
1494
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferLine = t2.DEFAULT_ATTR_DATA = void 0;
1495
+ let s2 = i2(734), r2 = i2(511), n2 = i2(643), a = i2(482);
1496
+ t2.DEFAULT_ATTR_DATA = Object.freeze(new s2.AttributeData());
1497
+ let o = 0;
1498
+ class h {
1499
+ constructor(e3, t3, i3 = !1) {
1500
+ this.isWrapped = i3, this._combined = {}, this._extendedAttrs = {}, this._data = new Uint32Array(3 * e3);
1501
+ let s3 = t3 || r2.CellData.fromCharData([0, n2.NULL_CELL_CHAR, n2.NULL_CELL_WIDTH, n2.NULL_CELL_CODE]);
1502
+ for (let t4 = 0; t4 < e3; ++t4) this.setCell(t4, s3);
1503
+ this.length = e3;
1504
+ }
1505
+ get(e3) {
1506
+ let t3 = this._data[3 * e3 + 0], i3 = 2097151 & t3;
1507
+ return [this._data[3 * e3 + 1], 2097152 & t3 ? this._combined[e3] : i3 ? (0, a.stringFromCodePoint)(i3) : "", t3 >> 22, 2097152 & t3 ? this._combined[e3].charCodeAt(this._combined[e3].length - 1) : i3];
1508
+ }
1509
+ set(e3, t3) {
1510
+ this._data[3 * e3 + 1] = t3[n2.CHAR_DATA_ATTR_INDEX], t3[n2.CHAR_DATA_CHAR_INDEX].length > 1 ? (this._combined[e3] = t3[1], this._data[3 * e3 + 0] = 2097152 | e3 | t3[n2.CHAR_DATA_WIDTH_INDEX] << 22) : this._data[3 * e3 + 0] = t3[n2.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | t3[n2.CHAR_DATA_WIDTH_INDEX] << 22;
1511
+ }
1512
+ getWidth(e3) {
1513
+ return this._data[3 * e3 + 0] >> 22;
1514
+ }
1515
+ hasWidth(e3) {
1516
+ return 12582912 & this._data[3 * e3 + 0];
1517
+ }
1518
+ getFg(e3) {
1519
+ return this._data[3 * e3 + 1];
1520
+ }
1521
+ getBg(e3) {
1522
+ return this._data[3 * e3 + 2];
1523
+ }
1524
+ hasContent(e3) {
1525
+ return 4194303 & this._data[3 * e3 + 0];
1526
+ }
1527
+ getCodePoint(e3) {
1528
+ let t3 = this._data[3 * e3 + 0];
1529
+ return 2097152 & t3 ? this._combined[e3].charCodeAt(this._combined[e3].length - 1) : 2097151 & t3;
1530
+ }
1531
+ isCombined(e3) {
1532
+ return 2097152 & this._data[3 * e3 + 0];
1533
+ }
1534
+ getString(e3) {
1535
+ let t3 = this._data[3 * e3 + 0];
1536
+ return 2097152 & t3 ? this._combined[e3] : 2097151 & t3 ? (0, a.stringFromCodePoint)(2097151 & t3) : "";
1537
+ }
1538
+ isProtected(e3) {
1539
+ return 536870912 & this._data[3 * e3 + 2];
1540
+ }
1541
+ loadCell(e3, t3) {
1542
+ return o = 3 * e3, t3.content = this._data[o + 0], t3.fg = this._data[o + 1], t3.bg = this._data[o + 2], 2097152 & t3.content && (t3.combinedData = this._combined[e3]), 268435456 & t3.bg && (t3.extended = this._extendedAttrs[e3]), t3;
1543
+ }
1544
+ setCell(e3, t3) {
1545
+ 2097152 & t3.content && (this._combined[e3] = t3.combinedData), 268435456 & t3.bg && (this._extendedAttrs[e3] = t3.extended), this._data[3 * e3 + 0] = t3.content, this._data[3 * e3 + 1] = t3.fg, this._data[3 * e3 + 2] = t3.bg;
1546
+ }
1547
+ setCellFromCodepoint(e3, t3, i3, s3) {
1548
+ 268435456 & s3.bg && (this._extendedAttrs[e3] = s3.extended), this._data[3 * e3 + 0] = t3 | i3 << 22, this._data[3 * e3 + 1] = s3.fg, this._data[3 * e3 + 2] = s3.bg;
1549
+ }
1550
+ addCodepointToCell(e3, t3, i3) {
1551
+ let s3 = this._data[3 * e3 + 0];
1552
+ 2097152 & s3 ? this._combined[e3] += (0, a.stringFromCodePoint)(t3) : 2097151 & s3 ? (this._combined[e3] = (0, a.stringFromCodePoint)(2097151 & s3) + (0, a.stringFromCodePoint)(t3), s3 &= -2097152, s3 |= 2097152) : s3 = t3 | 4194304, i3 && (s3 &= -12582913, s3 |= i3 << 22), this._data[3 * e3 + 0] = s3;
1553
+ }
1554
+ insertCells(e3, t3, i3) {
1555
+ if ((e3 %= this.length) && this.getWidth(e3 - 1) === 2 && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), t3 < this.length - e3) {
1556
+ let s3 = new r2.CellData();
1557
+ for (let i4 = this.length - e3 - t3 - 1; i4 >= 0; --i4) this.setCell(e3 + t3 + i4, this.loadCell(e3 + i4, s3));
1558
+ for (let s4 = 0; s4 < t3; ++s4) this.setCell(e3 + s4, i3);
1559
+ } else for (let t4 = e3; t4 < this.length; ++t4) this.setCell(t4, i3);
1560
+ this.getWidth(this.length - 1) === 2 && this.setCellFromCodepoint(this.length - 1, 0, 1, i3);
1561
+ }
1562
+ deleteCells(e3, t3, i3) {
1563
+ if (e3 %= this.length, t3 < this.length - e3) {
1564
+ let s3 = new r2.CellData();
1565
+ for (let i4 = 0; i4 < this.length - e3 - t3; ++i4) this.setCell(e3 + i4, this.loadCell(e3 + t3 + i4, s3));
1566
+ for (let e4 = this.length - t3; e4 < this.length; ++e4) this.setCell(e4, i3);
1567
+ } else for (let t4 = e3; t4 < this.length; ++t4) this.setCell(t4, i3);
1568
+ e3 && this.getWidth(e3 - 1) === 2 && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), this.getWidth(e3) !== 0 || this.hasContent(e3) || this.setCellFromCodepoint(e3, 0, 1, i3);
1569
+ }
1570
+ replaceCells(e3, t3, i3, s3 = !1) {
1571
+ if (s3) for (e3 && this.getWidth(e3 - 1) === 2 && !this.isProtected(e3 - 1) && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), t3 < this.length && this.getWidth(t3 - 1) === 2 && !this.isProtected(t3) && this.setCellFromCodepoint(t3, 0, 1, i3); e3 < t3 && e3 < this.length; ) this.isProtected(e3) || this.setCell(e3, i3), e3++;
1572
+ else for (e3 && this.getWidth(e3 - 1) === 2 && this.setCellFromCodepoint(e3 - 1, 0, 1, i3), t3 < this.length && this.getWidth(t3 - 1) === 2 && this.setCellFromCodepoint(t3, 0, 1, i3); e3 < t3 && e3 < this.length; ) this.setCell(e3++, i3);
1573
+ }
1574
+ resize(e3, t3) {
1575
+ if (e3 === this.length) return 4 * this._data.length * 2 < this._data.buffer.byteLength;
1576
+ let i3 = 3 * e3;
1577
+ if (e3 > this.length) {
1578
+ if (this._data.buffer.byteLength >= 4 * i3) this._data = new Uint32Array(this._data.buffer, 0, i3);
1579
+ else {
1580
+ let e4 = new Uint32Array(i3);
1581
+ e4.set(this._data), this._data = e4;
1582
+ }
1583
+ for (let i4 = this.length; i4 < e3; ++i4) this.setCell(i4, t3);
1584
+ } else {
1585
+ this._data = this._data.subarray(0, i3);
1586
+ let t4 = Object.keys(this._combined);
1587
+ for (let i4 = 0; i4 < t4.length; i4++) {
1588
+ let s4 = parseInt(t4[i4], 10);
1589
+ s4 >= e3 && delete this._combined[s4];
1590
+ }
1591
+ let s3 = Object.keys(this._extendedAttrs);
1592
+ for (let t5 = 0; t5 < s3.length; t5++) {
1593
+ let i4 = parseInt(s3[t5], 10);
1594
+ i4 >= e3 && delete this._extendedAttrs[i4];
1595
+ }
1596
+ }
1597
+ return this.length = e3, 4 * i3 * 2 < this._data.buffer.byteLength;
1598
+ }
1599
+ cleanupMemory() {
1600
+ if (4 * this._data.length * 2 < this._data.buffer.byteLength) {
1601
+ let e3 = new Uint32Array(this._data.length);
1602
+ return e3.set(this._data), this._data = e3, 1;
1603
+ }
1604
+ return 0;
1605
+ }
1606
+ fill(e3, t3 = !1) {
1607
+ if (t3) for (let t4 = 0; t4 < this.length; ++t4) this.isProtected(t4) || this.setCell(t4, e3);
1608
+ else {
1609
+ this._combined = {}, this._extendedAttrs = {};
1610
+ for (let t4 = 0; t4 < this.length; ++t4) this.setCell(t4, e3);
1611
+ }
1612
+ }
1613
+ copyFrom(e3) {
1614
+ this.length !== e3.length ? this._data = new Uint32Array(e3._data) : this._data.set(e3._data), this.length = e3.length, this._combined = {};
1615
+ for (let t3 in e3._combined) this._combined[t3] = e3._combined[t3];
1616
+ this._extendedAttrs = {};
1617
+ for (let t3 in e3._extendedAttrs) this._extendedAttrs[t3] = e3._extendedAttrs[t3];
1618
+ this.isWrapped = e3.isWrapped;
1619
+ }
1620
+ clone() {
1621
+ let e3 = new h(0);
1622
+ e3._data = new Uint32Array(this._data), e3.length = this.length;
1623
+ for (let t3 in this._combined) e3._combined[t3] = this._combined[t3];
1624
+ for (let t3 in this._extendedAttrs) e3._extendedAttrs[t3] = this._extendedAttrs[t3];
1625
+ return e3.isWrapped = this.isWrapped, e3;
1626
+ }
1627
+ getTrimmedLength() {
1628
+ for (let e3 = this.length - 1; e3 >= 0; --e3) if (4194303 & this._data[3 * e3 + 0]) return e3 + (this._data[3 * e3 + 0] >> 22);
1629
+ return 0;
1630
+ }
1631
+ getNoBgTrimmedLength() {
1632
+ for (let e3 = this.length - 1; e3 >= 0; --e3) if (4194303 & this._data[3 * e3 + 0] || 50331648 & this._data[3 * e3 + 2]) return e3 + (this._data[3 * e3 + 0] >> 22);
1633
+ return 0;
1634
+ }
1635
+ copyCellsFrom(e3, t3, i3, s3, r3) {
1636
+ let n3 = e3._data;
1637
+ if (r3) for (let r4 = s3 - 1; r4 >= 0; r4--) {
1638
+ for (let e4 = 0; e4 < 3; e4++) this._data[3 * (i3 + r4) + e4] = n3[3 * (t3 + r4) + e4];
1639
+ 268435456 & n3[3 * (t3 + r4) + 2] && (this._extendedAttrs[i3 + r4] = e3._extendedAttrs[t3 + r4]);
1640
+ }
1641
+ else for (let r4 = 0; r4 < s3; r4++) {
1642
+ for (let e4 = 0; e4 < 3; e4++) this._data[3 * (i3 + r4) + e4] = n3[3 * (t3 + r4) + e4];
1643
+ 268435456 & n3[3 * (t3 + r4) + 2] && (this._extendedAttrs[i3 + r4] = e3._extendedAttrs[t3 + r4]);
1644
+ }
1645
+ let a2 = Object.keys(e3._combined);
1646
+ for (let s4 = 0; s4 < a2.length; s4++) {
1647
+ let r4 = parseInt(a2[s4], 10);
1648
+ r4 >= t3 && (this._combined[r4 - t3 + i3] = e3._combined[r4]);
1649
+ }
1650
+ }
1651
+ translateToString(e3, t3, i3, s3) {
1652
+ t3 = t3 ?? 0, i3 = i3 ?? this.length, e3 && (i3 = Math.min(i3, this.getTrimmedLength())), s3 && (s3.length = 0);
1653
+ let r3 = "";
1654
+ for (; t3 < i3; ) {
1655
+ let e4 = this._data[3 * t3 + 0], i4 = 2097151 & e4, o2 = 2097152 & e4 ? this._combined[t3] : i4 ? (0, a.stringFromCodePoint)(i4) : n2.WHITESPACE_CELL_CHAR;
1656
+ if (r3 += o2, s3) for (let e5 = 0; e5 < o2.length; ++e5) s3.push(t3);
1657
+ t3 += e4 >> 22 || 1;
1658
+ }
1659
+ return s3 && s3.push(t3), r3;
1660
+ }
1661
+ }
1662
+ t2.BufferLine = h;
1663
+ }, 634: (e2, t2) => {
1664
+ function i2(e3, t3, i3) {
1665
+ if (t3 === e3.length - 1) return e3[t3].getTrimmedLength();
1666
+ let s2 = !e3[t3].hasContent(i3 - 1) && e3[t3].getWidth(i3 - 1) === 1, r2 = e3[t3 + 1].getWidth(0) === 2;
1667
+ return s2 && r2 ? i3 - 1 : i3;
1668
+ }
1669
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.getWrappedLineTrimmedLength = t2.reflowSmallerGetNewLineLengths = t2.reflowLargerApplyNewLayout = t2.reflowLargerCreateNewLayout = t2.reflowLargerGetLinesToRemove = void 0, t2.reflowLargerGetLinesToRemove = function(e3, t3, s2, r2, n2) {
1670
+ let a = [];
1671
+ for (let o = 0; o < e3.length - 1; o++) {
1672
+ let h = o, c = e3.get(++h);
1673
+ if (!c.isWrapped) continue;
1674
+ let l = [e3.get(o)];
1675
+ for (; h < e3.length && c.isWrapped; ) l.push(c), c = e3.get(++h);
1676
+ if (r2 >= o && r2 < h) {
1677
+ o += l.length - 1;
1678
+ continue;
1679
+ }
1680
+ let _ = 0, d = i2(l, _, t3), f = 1, u = 0;
1681
+ for (; f < l.length; ) {
1682
+ let e4 = i2(l, f, t3), r3 = e4 - u, a2 = s2 - d, o2 = Math.min(r3, a2);
1683
+ l[_].copyCellsFrom(l[f], u, d, o2, !1), d += o2, d === s2 && (_++, d = 0), u += o2, u === e4 && (f++, u = 0), d === 0 && _ !== 0 && l[_ - 1].getWidth(s2 - 1) === 2 && (l[_].copyCellsFrom(l[_ - 1], s2 - 1, d++, 1, !1), l[_ - 1].setCell(s2 - 1, n2));
1684
+ }
1685
+ l[_].replaceCells(d, s2, n2);
1686
+ let p = 0;
1687
+ for (let e4 = l.length - 1; e4 > 0 && (e4 > _ || l[e4].getTrimmedLength() === 0); e4--) p++;
1688
+ p > 0 && (a.push(o + l.length - p), a.push(p)), o += l.length - 1;
1689
+ }
1690
+ return a;
1691
+ }, t2.reflowLargerCreateNewLayout = function(e3, t3) {
1692
+ let i3 = [], s2 = 0, r2 = t3[s2], n2 = 0;
1693
+ for (let a = 0; a < e3.length; a++) if (r2 === a) {
1694
+ let i4 = t3[++s2];
1695
+ e3.onDeleteEmitter.fire({ index: a - n2, amount: i4 }), a += i4 - 1, n2 += i4, r2 = t3[++s2];
1696
+ } else i3.push(a);
1697
+ return { layout: i3, countRemoved: n2 };
1698
+ }, t2.reflowLargerApplyNewLayout = function(e3, t3) {
1699
+ let i3 = [];
1700
+ for (let s2 = 0; s2 < t3.length; s2++) i3.push(e3.get(t3[s2]));
1701
+ for (let t4 = 0; t4 < i3.length; t4++) e3.set(t4, i3[t4]);
1702
+ e3.length = t3.length;
1703
+ }, t2.reflowSmallerGetNewLineLengths = function(e3, t3, s2) {
1704
+ let r2 = [], n2 = e3.map(((s3, r3) => i2(e3, r3, t3))).reduce(((e4, t4) => e4 + t4)), a = 0, o = 0, h = 0;
1705
+ for (; h < n2; ) {
1706
+ if (n2 - h < s2) {
1707
+ r2.push(n2 - h);
1708
+ break;
1709
+ }
1710
+ a += s2;
1711
+ let c = i2(e3, o, t3);
1712
+ a > c && (a -= c, o++);
1713
+ let l = e3[o].getWidth(a - 1) === 2;
1714
+ l && a--;
1715
+ let _ = l ? s2 - 1 : s2;
1716
+ r2.push(_), h += _;
1717
+ }
1718
+ return r2;
1719
+ }, t2.getWrappedLineTrimmedLength = i2;
1720
+ }, 295: (e2, t2, i2) => {
1721
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferSet = void 0;
1722
+ let s2 = i2(460), r2 = i2(844), n2 = i2(92);
1723
+ class a extends r2.Disposable {
1724
+ constructor(e3, t3) {
1725
+ super(), this._optionsService = e3, this._bufferService = t3, this._onBufferActivate = this.register(new s2.EventEmitter()), this.onBufferActivate = this._onBufferActivate.event, this.reset(), this.register(this._optionsService.onSpecificOptionChange("scrollback", (() => this.resize(this._bufferService.cols, this._bufferService.rows)))), this.register(this._optionsService.onSpecificOptionChange("tabStopWidth", (() => this.setupTabStops())));
1726
+ }
1727
+ reset() {
1728
+ this._normal = new n2.Buffer(!0, this._optionsService, this._bufferService), this._normal.fillViewportRows(), this._alt = new n2.Buffer(!1, this._optionsService, this._bufferService), this._activeBuffer = this._normal, this._onBufferActivate.fire({ activeBuffer: this._normal, inactiveBuffer: this._alt }), this.setupTabStops();
1729
+ }
1730
+ get alt() {
1731
+ return this._alt;
1732
+ }
1733
+ get active() {
1734
+ return this._activeBuffer;
1735
+ }
1736
+ get normal() {
1737
+ return this._normal;
1738
+ }
1739
+ activateNormalBuffer() {
1740
+ 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 }));
1741
+ }
1742
+ activateAltBuffer(e3) {
1743
+ this._activeBuffer !== this._alt && (this._alt.fillViewportRows(e3), 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 }));
1744
+ }
1745
+ resize(e3, t3) {
1746
+ this._normal.resize(e3, t3), this._alt.resize(e3, t3), this.setupTabStops(e3);
1747
+ }
1748
+ setupTabStops(e3) {
1749
+ this._normal.setupTabStops(e3), this._alt.setupTabStops(e3);
1750
+ }
1751
+ }
1752
+ t2.BufferSet = a;
1753
+ }, 511: (e2, t2, i2) => {
1754
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CellData = void 0;
1755
+ let s2 = i2(482), r2 = i2(643), n2 = i2(734);
1756
+ class a extends n2.AttributeData {
1757
+ constructor() {
1758
+ super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new n2.ExtendedAttrs(), this.combinedData = "";
1759
+ }
1760
+ static fromCharData(e3) {
1761
+ let t3 = new a();
1762
+ return t3.setFromCharData(e3), t3;
1763
+ }
1764
+ isCombined() {
1765
+ return 2097152 & this.content;
1766
+ }
1767
+ getWidth() {
1768
+ return this.content >> 22;
1769
+ }
1770
+ getChars() {
1771
+ return 2097152 & this.content ? this.combinedData : 2097151 & this.content ? (0, s2.stringFromCodePoint)(2097151 & this.content) : "";
1772
+ }
1773
+ getCode() {
1774
+ return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : 2097151 & this.content;
1775
+ }
1776
+ setFromCharData(e3) {
1777
+ this.fg = e3[r2.CHAR_DATA_ATTR_INDEX], this.bg = 0;
1778
+ let t3 = !1;
1779
+ if (e3[r2.CHAR_DATA_CHAR_INDEX].length > 2) t3 = !0;
1780
+ else if (e3[r2.CHAR_DATA_CHAR_INDEX].length === 2) {
1781
+ let i3 = e3[r2.CHAR_DATA_CHAR_INDEX].charCodeAt(0);
1782
+ if (55296 <= i3 && i3 <= 56319) {
1783
+ let s3 = e3[r2.CHAR_DATA_CHAR_INDEX].charCodeAt(1);
1784
+ 56320 <= s3 && s3 <= 57343 ? this.content = 1024 * (i3 - 55296) + s3 - 56320 + 65536 | e3[r2.CHAR_DATA_WIDTH_INDEX] << 22 : t3 = !0;
1785
+ } else t3 = !0;
1786
+ } else this.content = e3[r2.CHAR_DATA_CHAR_INDEX].charCodeAt(0) | e3[r2.CHAR_DATA_WIDTH_INDEX] << 22;
1787
+ t3 && (this.combinedData = e3[r2.CHAR_DATA_CHAR_INDEX], this.content = 2097152 | e3[r2.CHAR_DATA_WIDTH_INDEX] << 22);
1788
+ }
1789
+ getAsCharData() {
1790
+ return [this.fg, this.getChars(), this.getWidth(), this.getCode()];
1791
+ }
1792
+ }
1793
+ t2.CellData = a;
1794
+ }, 643: (e2, t2) => {
1795
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.WHITESPACE_CELL_CODE = t2.WHITESPACE_CELL_WIDTH = t2.WHITESPACE_CELL_CHAR = t2.NULL_CELL_CODE = t2.NULL_CELL_WIDTH = t2.NULL_CELL_CHAR = t2.CHAR_DATA_CODE_INDEX = t2.CHAR_DATA_WIDTH_INDEX = t2.CHAR_DATA_CHAR_INDEX = t2.CHAR_DATA_ATTR_INDEX = t2.DEFAULT_EXT = t2.DEFAULT_ATTR = t2.DEFAULT_COLOR = void 0, t2.DEFAULT_COLOR = 0, t2.DEFAULT_ATTR = 256 | t2.DEFAULT_COLOR << 9, t2.DEFAULT_EXT = 0, t2.CHAR_DATA_ATTR_INDEX = 0, t2.CHAR_DATA_CHAR_INDEX = 1, t2.CHAR_DATA_WIDTH_INDEX = 2, t2.CHAR_DATA_CODE_INDEX = 3, t2.NULL_CELL_CHAR = "", t2.NULL_CELL_WIDTH = 1, t2.NULL_CELL_CODE = 0, t2.WHITESPACE_CELL_CHAR = " ", t2.WHITESPACE_CELL_WIDTH = 1, t2.WHITESPACE_CELL_CODE = 32;
1796
+ }, 863: (e2, t2, i2) => {
1797
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Marker = void 0;
1798
+ let s2 = i2(460), r2 = i2(844);
1799
+ class n2 {
1800
+ get id() {
1801
+ return this._id;
1802
+ }
1803
+ constructor(e3) {
1804
+ this.line = e3, this.isDisposed = !1, this._disposables = [], this._id = n2._nextId++, this._onDispose = this.register(new s2.EventEmitter()), this.onDispose = this._onDispose.event;
1805
+ }
1806
+ dispose() {
1807
+ this.isDisposed || (this.isDisposed = !0, this.line = -1, this._onDispose.fire(), (0, r2.disposeArray)(this._disposables), this._disposables.length = 0);
1808
+ }
1809
+ register(e3) {
1810
+ return this._disposables.push(e3), e3;
1811
+ }
1812
+ }
1813
+ t2.Marker = n2, n2._nextId = 1;
1814
+ }, 116: (e2, t2) => {
1815
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DEFAULT_CHARSET = t2.CHARSETS = void 0, t2.CHARSETS = {}, t2.DEFAULT_CHARSET = t2.CHARSETS.B, t2.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" }, t2.CHARSETS.A = { "#": "\xA3" }, t2.CHARSETS.B = void 0, t2.CHARSETS[4] = { "#": "\xA3", "@": "\xBE", "[": "ij", "\\": "\xBD", "]": "|", "{": "\xA8", "|": "f", "}": "\xBC", "~": "\xB4" }, t2.CHARSETS.C = t2.CHARSETS[5] = { "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS.R = { "#": "\xA3", "@": "\xE0", "[": "\xB0", "\\": "\xE7", "]": "\xA7", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xA8" }, t2.CHARSETS.Q = { "@": "\xE0", "[": "\xE2", "\\": "\xE7", "]": "\xEA", "^": "\xEE", "`": "\xF4", "{": "\xE9", "|": "\xF9", "}": "\xE8", "~": "\xFB" }, t2.CHARSETS.K = { "@": "\xA7", "[": "\xC4", "\\": "\xD6", "]": "\xDC", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xDF" }, t2.CHARSETS.Y = { "#": "\xA3", "@": "\xA7", "[": "\xB0", "\\": "\xE7", "]": "\xE9", "`": "\xF9", "{": "\xE0", "|": "\xF2", "}": "\xE8", "~": "\xEC" }, t2.CHARSETS.E = t2.CHARSETS[6] = { "@": "\xC4", "[": "\xC6", "\\": "\xD8", "]": "\xC5", "^": "\xDC", "`": "\xE4", "{": "\xE6", "|": "\xF8", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS.Z = { "#": "\xA3", "@": "\xA7", "[": "\xA1", "\\": "\xD1", "]": "\xBF", "{": "\xB0", "|": "\xF1", "}": "\xE7" }, t2.CHARSETS.H = t2.CHARSETS[7] = { "@": "\xC9", "[": "\xC4", "\\": "\xD6", "]": "\xC5", "^": "\xDC", "`": "\xE9", "{": "\xE4", "|": "\xF6", "}": "\xE5", "~": "\xFC" }, t2.CHARSETS["="] = { "#": "\xF9", "@": "\xE0", "[": "\xE9", "\\": "\xE7", "]": "\xEA", "^": "\xEE", _: "\xE8", "`": "\xF4", "{": "\xE4", "|": "\xF6", "}": "\xFC", "~": "\xFB" };
1816
+ }, 584: (e2, t2) => {
1817
+ var i2, s2, r2;
1818
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.C1_ESCAPED = t2.C1 = t2.C0 = void 0, (function(e3) {
1819
+ e3.NUL = "\0", e3.SOH = "", e3.STX = "", e3.ETX = "", e3.EOT = "", e3.ENQ = "", e3.ACK = "", e3.BEL = "\x07", e3.BS = "\b", e3.HT = " ", e3.LF = `
1820
+ `, e3.VT = "\v", e3.FF = "\f", e3.CR = "\r", e3.SO = "", e3.SI = "", e3.DLE = "", e3.DC1 = "", e3.DC2 = "", e3.DC3 = "", e3.DC4 = "", e3.NAK = "", e3.SYN = "", e3.ETB = "", e3.CAN = "", e3.EM = "", e3.SUB = "", e3.ESC = "\x1B", e3.FS = "", e3.GS = "", e3.RS = "", e3.US = "", e3.SP = " ", e3.DEL = "\x7F";
1821
+ })(i2 || (t2.C0 = i2 = {})), (function(e3) {
1822
+ e3.PAD = "\x80", e3.HOP = "\x81", e3.BPH = "\x82", e3.NBH = "\x83", e3.IND = "\x84", e3.NEL = "\x85", e3.SSA = "\x86", e3.ESA = "\x87", e3.HTS = "\x88", e3.HTJ = "\x89", e3.VTS = "\x8A", e3.PLD = "\x8B", e3.PLU = "\x8C", e3.RI = "\x8D", e3.SS2 = "\x8E", e3.SS3 = "\x8F", e3.DCS = "\x90", e3.PU1 = "\x91", e3.PU2 = "\x92", e3.STS = "\x93", e3.CCH = "\x94", e3.MW = "\x95", e3.SPA = "\x96", e3.EPA = "\x97", e3.SOS = "\x98", e3.SGCI = "\x99", e3.SCI = "\x9A", e3.CSI = "\x9B", e3.ST = "\x9C", e3.OSC = "\x9D", e3.PM = "\x9E", e3.APC = "\x9F";
1823
+ })(s2 || (t2.C1 = s2 = {})), (function(e3) {
1824
+ e3.ST = `${i2.ESC}\\`;
1825
+ })(r2 || (t2.C1_ESCAPED = r2 = {}));
1826
+ }, 482: (e2, t2) => {
1827
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Utf8ToUtf32 = t2.StringToUtf32 = t2.utf32ToString = t2.stringFromCodePoint = void 0, t2.stringFromCodePoint = function(e3) {
1828
+ return e3 > 65535 ? (e3 -= 65536, String.fromCharCode(55296 + (e3 >> 10)) + String.fromCharCode(e3 % 1024 + 56320)) : String.fromCharCode(e3);
1829
+ }, t2.utf32ToString = function(e3, t3 = 0, i2 = e3.length) {
1830
+ let s2 = "";
1831
+ for (let r2 = t3; r2 < i2; ++r2) {
1832
+ let t4 = e3[r2];
1833
+ t4 > 65535 ? (t4 -= 65536, s2 += String.fromCharCode(55296 + (t4 >> 10)) + String.fromCharCode(t4 % 1024 + 56320)) : s2 += String.fromCharCode(t4);
1834
+ }
1835
+ return s2;
1836
+ }, t2.StringToUtf32 = class {
1837
+ constructor() {
1838
+ this._interim = 0;
1839
+ }
1840
+ clear() {
1841
+ this._interim = 0;
1842
+ }
1843
+ decode(e3, t3) {
1844
+ let i2 = e3.length;
1845
+ if (!i2) return 0;
1846
+ let s2 = 0, r2 = 0;
1847
+ if (this._interim) {
1848
+ let i3 = e3.charCodeAt(r2++);
1849
+ 56320 <= i3 && i3 <= 57343 ? t3[s2++] = 1024 * (this._interim - 55296) + i3 - 56320 + 65536 : (t3[s2++] = this._interim, t3[s2++] = i3), this._interim = 0;
1850
+ }
1851
+ for (let n2 = r2; n2 < i2; ++n2) {
1852
+ let r3 = e3.charCodeAt(n2);
1853
+ if (55296 <= r3 && r3 <= 56319) {
1854
+ if (++n2 >= i2) return this._interim = r3, s2;
1855
+ let a = e3.charCodeAt(n2);
1856
+ 56320 <= a && a <= 57343 ? t3[s2++] = 1024 * (r3 - 55296) + a - 56320 + 65536 : (t3[s2++] = r3, t3[s2++] = a);
1857
+ } else r3 !== 65279 && (t3[s2++] = r3);
1858
+ }
1859
+ return s2;
1860
+ }
1861
+ }, t2.Utf8ToUtf32 = class {
1862
+ constructor() {
1863
+ this.interim = new Uint8Array(3);
1864
+ }
1865
+ clear() {
1866
+ this.interim.fill(0);
1867
+ }
1868
+ decode(e3, t3) {
1869
+ let i2 = e3.length;
1870
+ if (!i2) return 0;
1871
+ let s2, r2, n2, a, o = 0, h = 0, c = 0;
1872
+ if (this.interim[0]) {
1873
+ let s3 = !1, r3 = this.interim[0];
1874
+ r3 &= (224 & r3) == 192 ? 31 : (240 & r3) == 224 ? 15 : 7;
1875
+ let n3, a2 = 0;
1876
+ for (; (n3 = 63 & this.interim[++a2]) && a2 < 4; ) r3 <<= 6, r3 |= n3;
1877
+ let h2 = (224 & this.interim[0]) == 192 ? 2 : (240 & this.interim[0]) == 224 ? 3 : 4, l2 = h2 - a2;
1878
+ for (; c < l2; ) {
1879
+ if (c >= i2) return 0;
1880
+ if (n3 = e3[c++], (192 & n3) != 128) {
1881
+ c--, s3 = !0;
1882
+ break;
1883
+ }
1884
+ this.interim[a2++] = n3, r3 <<= 6, r3 |= 63 & n3;
1885
+ }
1886
+ s3 || (h2 === 2 ? r3 < 128 ? c-- : t3[o++] = r3 : h2 === 3 ? r3 < 2048 || r3 >= 55296 && r3 <= 57343 || r3 === 65279 || (t3[o++] = r3) : r3 < 65536 || r3 > 1114111 || (t3[o++] = r3)), this.interim.fill(0);
1887
+ }
1888
+ let l = i2 - 4, _ = c;
1889
+ for (; _ < i2; ) {
1890
+ for (; !(!(_ < l) || 128 & (s2 = e3[_]) || 128 & (r2 = e3[_ + 1]) || 128 & (n2 = e3[_ + 2]) || 128 & (a = e3[_ + 3])); ) t3[o++] = s2, t3[o++] = r2, t3[o++] = n2, t3[o++] = a, _ += 4;
1891
+ if (s2 = e3[_++], s2 < 128) t3[o++] = s2;
1892
+ else if ((224 & s2) == 192) {
1893
+ if (_ >= i2) return this.interim[0] = s2, o;
1894
+ if (r2 = e3[_++], (192 & r2) != 128) {
1895
+ _--;
1896
+ continue;
1897
+ }
1898
+ if (h = (31 & s2) << 6 | 63 & r2, h < 128) {
1899
+ _--;
1900
+ continue;
1901
+ }
1902
+ t3[o++] = h;
1903
+ } else if ((240 & s2) == 224) {
1904
+ if (_ >= i2) return this.interim[0] = s2, o;
1905
+ if (r2 = e3[_++], (192 & r2) != 128) {
1906
+ _--;
1907
+ continue;
1908
+ }
1909
+ if (_ >= i2) return this.interim[0] = s2, this.interim[1] = r2, o;
1910
+ if (n2 = e3[_++], (192 & n2) != 128) {
1911
+ _--;
1912
+ continue;
1913
+ }
1914
+ if (h = (15 & s2) << 12 | (63 & r2) << 6 | 63 & n2, h < 2048 || h >= 55296 && h <= 57343 || h === 65279) continue;
1915
+ t3[o++] = h;
1916
+ } else if ((248 & s2) == 240) {
1917
+ if (_ >= i2) return this.interim[0] = s2, o;
1918
+ if (r2 = e3[_++], (192 & r2) != 128) {
1919
+ _--;
1920
+ continue;
1921
+ }
1922
+ if (_ >= i2) return this.interim[0] = s2, this.interim[1] = r2, o;
1923
+ if (n2 = e3[_++], (192 & n2) != 128) {
1924
+ _--;
1925
+ continue;
1926
+ }
1927
+ if (_ >= i2) return this.interim[0] = s2, this.interim[1] = r2, this.interim[2] = n2, o;
1928
+ if (a = e3[_++], (192 & a) != 128) {
1929
+ _--;
1930
+ continue;
1931
+ }
1932
+ if (h = (7 & s2) << 18 | (63 & r2) << 12 | (63 & n2) << 6 | 63 & a, h < 65536 || h > 1114111) continue;
1933
+ t3[o++] = h;
1934
+ }
1935
+ }
1936
+ return o;
1937
+ }
1938
+ };
1939
+ }, 225: (e2, t2, i2) => {
1940
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.UnicodeV6 = void 0;
1941
+ let s2 = i2(480), r2 = [[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]], n2 = [[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]], a;
1942
+ t2.UnicodeV6 = class {
1943
+ constructor() {
1944
+ if (this.version = "6", !a) {
1945
+ a = new Uint8Array(65536), a.fill(1), a[0] = 0, a.fill(0, 1, 32), a.fill(0, 127, 160), a.fill(2, 4352, 4448), a[9001] = 2, a[9002] = 2, a.fill(2, 11904, 42192), a[12351] = 1, a.fill(2, 44032, 55204), a.fill(2, 63744, 64256), a.fill(2, 65040, 65050), a.fill(2, 65072, 65136), a.fill(2, 65280, 65377), a.fill(2, 65504, 65511);
1946
+ for (let e3 = 0; e3 < r2.length; ++e3) a.fill(0, r2[e3][0], r2[e3][1] + 1);
1947
+ }
1948
+ }
1949
+ wcwidth(e3) {
1950
+ return e3 < 32 ? 0 : e3 < 127 ? 1 : e3 < 65536 ? a[e3] : (function(e4, t3) {
1951
+ let i3, s3 = 0, r3 = t3.length - 1;
1952
+ if (e4 < t3[0][0] || e4 > t3[r3][1]) return !1;
1953
+ for (; r3 >= s3; ) if (i3 = s3 + r3 >> 1, e4 > t3[i3][1]) s3 = i3 + 1;
1954
+ else {
1955
+ if (!(e4 < t3[i3][0])) return !0;
1956
+ r3 = i3 - 1;
1957
+ }
1958
+ return !1;
1959
+ })(e3, n2) ? 0 : e3 >= 131072 && e3 <= 196605 || e3 >= 196608 && e3 <= 262141 ? 2 : 1;
1960
+ }
1961
+ charProperties(e3, t3) {
1962
+ let i3 = this.wcwidth(e3), r3 = i3 === 0 && t3 !== 0;
1963
+ if (r3) {
1964
+ let e4 = s2.UnicodeService.extractWidth(t3);
1965
+ e4 === 0 ? r3 = !1 : e4 > i3 && (i3 = e4);
1966
+ }
1967
+ return s2.UnicodeService.createPropertyValue(0, i3, r3);
1968
+ }
1969
+ };
1970
+ }, 981: (e2, t2, i2) => {
1971
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.WriteBuffer = void 0;
1972
+ let s2 = i2(460), r2 = i2(844);
1973
+ class n2 extends r2.Disposable {
1974
+ constructor(e3) {
1975
+ super(), this._action = e3, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = !1, this._syncCalls = 0, this._didUserInput = !1, this._onWriteParsed = this.register(new s2.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event;
1976
+ }
1977
+ handleUserInput() {
1978
+ this._didUserInput = !0;
1979
+ }
1980
+ writeSync(e3, t3) {
1981
+ if (t3 !== void 0 && this._syncCalls > t3) return void (this._syncCalls = 0);
1982
+ if (this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return;
1983
+ let i3;
1984
+ for (this._isSyncWriting = !0; i3 = this._writeBuffer.shift(); ) {
1985
+ this._action(i3);
1986
+ let e4 = this._callbacks.shift();
1987
+ e4 && e4();
1988
+ }
1989
+ this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = !1, this._syncCalls = 0;
1990
+ }
1991
+ write(e3, t3) {
1992
+ if (this._pendingData > 5e7) throw new Error("write data discarded, use flow control to avoid losing data");
1993
+ if (!this._writeBuffer.length) {
1994
+ if (this._bufferOffset = 0, this._didUserInput) return this._didUserInput = !1, this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(t3), void this._innerWrite();
1995
+ setTimeout((() => this._innerWrite()));
1996
+ }
1997
+ this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(t3);
1998
+ }
1999
+ _innerWrite(e3 = 0, t3 = !0) {
2000
+ let i3 = e3 || Date.now();
2001
+ for (; this._writeBuffer.length > this._bufferOffset; ) {
2002
+ let e4 = this._writeBuffer[this._bufferOffset], s3 = this._action(e4, t3);
2003
+ if (s3) {
2004
+ let e5 = (e6) => Date.now() - i3 >= 12 ? setTimeout((() => this._innerWrite(0, e6))) : this._innerWrite(i3, e6);
2005
+ return void s3.catch(((e6) => (queueMicrotask((() => {
2006
+ throw e6;
2007
+ })), Promise.resolve(!1)))).then(e5);
2008
+ }
2009
+ let r3 = this._callbacks[this._bufferOffset];
2010
+ if (r3 && r3(), this._bufferOffset++, this._pendingData -= e4.length, Date.now() - i3 >= 12) break;
2011
+ }
2012
+ 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();
2013
+ }
2014
+ }
2015
+ t2.WriteBuffer = n2;
2016
+ }, 941: (e2, t2) => {
2017
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.toRgbString = t2.parseColor = void 0;
2018
+ let i2 = /^([\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})$/, s2 = /^[\da-f]+$/;
2019
+ function r2(e3, t3) {
2020
+ let i3 = e3.toString(16), s3 = i3.length < 2 ? "0" + i3 : i3;
2021
+ switch (t3) {
2022
+ case 4:
2023
+ return i3[0];
2024
+ case 8:
2025
+ return s3;
2026
+ case 12:
2027
+ return (s3 + s3).slice(0, 3);
2028
+ default:
2029
+ return s3 + s3;
2030
+ }
2031
+ }
2032
+ t2.parseColor = function(e3) {
2033
+ if (!e3) return;
2034
+ let t3 = e3.toLowerCase();
2035
+ if (t3.indexOf("rgb:") === 0) {
2036
+ t3 = t3.slice(4);
2037
+ let e4 = i2.exec(t3);
2038
+ if (e4) {
2039
+ let t4 = e4[1] ? 15 : e4[4] ? 255 : e4[7] ? 4095 : 65535;
2040
+ return [Math.round(parseInt(e4[1] || e4[4] || e4[7] || e4[10], 16) / t4 * 255), Math.round(parseInt(e4[2] || e4[5] || e4[8] || e4[11], 16) / t4 * 255), Math.round(parseInt(e4[3] || e4[6] || e4[9] || e4[12], 16) / t4 * 255)];
2041
+ }
2042
+ } else if (t3.indexOf("#") === 0 && (t3 = t3.slice(1), s2.exec(t3) && [3, 6, 9, 12].includes(t3.length))) {
2043
+ let e4 = t3.length / 3, i3 = [0, 0, 0];
2044
+ for (let s3 = 0; s3 < 3; ++s3) {
2045
+ let r3 = parseInt(t3.slice(e4 * s3, e4 * s3 + e4), 16);
2046
+ i3[s3] = e4 === 1 ? r3 << 4 : e4 === 2 ? r3 : e4 === 3 ? r3 >> 4 : r3 >> 8;
2047
+ }
2048
+ return i3;
2049
+ }
2050
+ }, t2.toRgbString = function(e3, t3 = 16) {
2051
+ let [i3, s3, n2] = e3;
2052
+ return `rgb:${r2(i3, t3)}/${r2(s3, t3)}/${r2(n2, t3)}`;
2053
+ };
2054
+ }, 770: (e2, t2) => {
2055
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.PAYLOAD_LIMIT = void 0, t2.PAYLOAD_LIMIT = 1e7;
2056
+ }, 351: (e2, t2, i2) => {
2057
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.DcsHandler = t2.DcsParser = void 0;
2058
+ let s2 = i2(482), r2 = i2(742), n2 = i2(770), a = [];
2059
+ t2.DcsParser = class {
2060
+ constructor() {
2061
+ this._handlers = /* @__PURE__ */ Object.create(null), this._active = a, this._ident = 0, this._handlerFb = () => {
2062
+ }, this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 };
2063
+ }
2064
+ dispose() {
2065
+ this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
2066
+ }, this._active = a;
2067
+ }
2068
+ registerHandler(e3, t3) {
2069
+ this._handlers[e3] === void 0 && (this._handlers[e3] = []);
2070
+ let i3 = this._handlers[e3];
2071
+ return i3.push(t3), { dispose: () => {
2072
+ let e4 = i3.indexOf(t3);
2073
+ e4 !== -1 && i3.splice(e4, 1);
2074
+ } };
2075
+ }
2076
+ clearHandler(e3) {
2077
+ this._handlers[e3] && delete this._handlers[e3];
2078
+ }
2079
+ setHandlerFallback(e3) {
2080
+ this._handlerFb = e3;
2081
+ }
2082
+ reset() {
2083
+ if (this._active.length) for (let e3 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e3 >= 0; --e3) this._active[e3].unhook(!1);
2084
+ this._stack.paused = !1, this._active = a, this._ident = 0;
2085
+ }
2086
+ hook(e3, t3) {
2087
+ if (this.reset(), this._ident = e3, this._active = this._handlers[e3] || a, this._active.length) for (let e4 = this._active.length - 1; e4 >= 0; e4--) this._active[e4].hook(t3);
2088
+ else this._handlerFb(this._ident, "HOOK", t3);
2089
+ }
2090
+ put(e3, t3, i3) {
2091
+ if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e3, t3, i3);
2092
+ else this._handlerFb(this._ident, "PUT", (0, s2.utf32ToString)(e3, t3, i3));
2093
+ }
2094
+ unhook(e3, t3 = !0) {
2095
+ if (this._active.length) {
2096
+ let i3 = !1, s3 = this._active.length - 1, r3 = !1;
2097
+ if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i3 = t3, r3 = this._stack.fallThrough, this._stack.paused = !1), !r3 && i3 === !1) {
2098
+ for (; s3 >= 0 && (i3 = this._active[s3].unhook(e3), i3 !== !0); s3--) if (i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !1, i3;
2099
+ s3--;
2100
+ }
2101
+ for (; s3 >= 0; s3--) if (i3 = this._active[s3].unhook(!1), i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !0, i3;
2102
+ } else this._handlerFb(this._ident, "UNHOOK", e3);
2103
+ this._active = a, this._ident = 0;
2104
+ }
2105
+ };
2106
+ let o = new r2.Params();
2107
+ o.addParam(0), t2.DcsHandler = class {
2108
+ constructor(e3) {
2109
+ this._handler = e3, this._data = "", this._params = o, this._hitLimit = !1;
2110
+ }
2111
+ hook(e3) {
2112
+ this._params = e3.length > 1 || e3.params[0] ? e3.clone() : o, this._data = "", this._hitLimit = !1;
2113
+ }
2114
+ put(e3, t3, i3) {
2115
+ this._hitLimit || (this._data += (0, s2.utf32ToString)(e3, t3, i3), this._data.length > n2.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0));
2116
+ }
2117
+ unhook(e3) {
2118
+ let t3 = !1;
2119
+ if (this._hitLimit) t3 = !1;
2120
+ else if (e3 && (t3 = this._handler(this._data, this._params), t3 instanceof Promise)) return t3.then(((e4) => (this._params = o, this._data = "", this._hitLimit = !1, e4)));
2121
+ return this._params = o, this._data = "", this._hitLimit = !1, t3;
2122
+ }
2123
+ };
2124
+ }, 15: (e2, t2, i2) => {
2125
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.EscapeSequenceParser = t2.VT500_TRANSITION_TABLE = t2.TransitionTable = void 0;
2126
+ let s2 = i2(844), r2 = i2(742), n2 = i2(242), a = i2(351);
2127
+ class o {
2128
+ constructor(e3) {
2129
+ this.table = new Uint8Array(e3);
2130
+ }
2131
+ setDefault(e3, t3) {
2132
+ this.table.fill(e3 << 4 | t3);
2133
+ }
2134
+ add(e3, t3, i3, s3) {
2135
+ this.table[t3 << 8 | e3] = i3 << 4 | s3;
2136
+ }
2137
+ addMany(e3, t3, i3, s3) {
2138
+ for (let r3 = 0; r3 < e3.length; r3++) this.table[t3 << 8 | e3[r3]] = i3 << 4 | s3;
2139
+ }
2140
+ }
2141
+ t2.TransitionTable = o;
2142
+ let h = 160;
2143
+ t2.VT500_TRANSITION_TABLE = (function() {
2144
+ let e3 = new o(4095), t3 = Array.apply(null, Array(256)).map(((e4, t4) => t4)), i3 = (e4, i4) => t3.slice(e4, i4), s3 = i3(32, 127), r3 = i3(0, 24);
2145
+ r3.push(25), r3.push.apply(r3, i3(28, 32));
2146
+ let n3 = i3(0, 14), a2;
2147
+ for (a2 in e3.setDefault(1, 0), e3.addMany(s3, 0, 2, 0), n3) e3.addMany([24, 26, 153, 154], a2, 3, 0), e3.addMany(i3(128, 144), a2, 3, 0), e3.addMany(i3(144, 152), a2, 3, 0), e3.add(156, a2, 0, 0), e3.add(27, a2, 11, 1), e3.add(157, a2, 4, 8), e3.addMany([152, 158, 159], a2, 0, 7), e3.add(155, a2, 11, 3), e3.add(144, a2, 11, 9);
2148
+ return e3.addMany(r3, 0, 3, 0), e3.addMany(r3, 1, 3, 1), e3.add(127, 1, 0, 1), e3.addMany(r3, 8, 0, 8), e3.addMany(r3, 3, 3, 3), e3.add(127, 3, 0, 3), e3.addMany(r3, 4, 3, 4), e3.add(127, 4, 0, 4), e3.addMany(r3, 6, 3, 6), e3.addMany(r3, 5, 3, 5), e3.add(127, 5, 0, 5), e3.addMany(r3, 2, 3, 2), e3.add(127, 2, 0, 2), e3.add(93, 1, 4, 8), e3.addMany(s3, 8, 5, 8), e3.add(127, 8, 5, 8), e3.addMany([156, 27, 24, 26, 7], 8, 6, 0), e3.addMany(i3(28, 32), 8, 0, 8), e3.addMany([88, 94, 95], 1, 0, 7), e3.addMany(s3, 7, 0, 7), e3.addMany(r3, 7, 0, 7), e3.add(156, 7, 0, 0), e3.add(127, 7, 0, 7), e3.add(91, 1, 11, 3), e3.addMany(i3(64, 127), 3, 7, 0), e3.addMany(i3(48, 60), 3, 8, 4), e3.addMany([60, 61, 62, 63], 3, 9, 4), e3.addMany(i3(48, 60), 4, 8, 4), e3.addMany(i3(64, 127), 4, 7, 0), e3.addMany([60, 61, 62, 63], 4, 0, 6), e3.addMany(i3(32, 64), 6, 0, 6), e3.add(127, 6, 0, 6), e3.addMany(i3(64, 127), 6, 0, 0), e3.addMany(i3(32, 48), 3, 9, 5), e3.addMany(i3(32, 48), 5, 9, 5), e3.addMany(i3(48, 64), 5, 0, 6), e3.addMany(i3(64, 127), 5, 7, 0), e3.addMany(i3(32, 48), 4, 9, 5), e3.addMany(i3(32, 48), 1, 9, 2), e3.addMany(i3(32, 48), 2, 9, 2), e3.addMany(i3(48, 127), 2, 10, 0), e3.addMany(i3(48, 80), 1, 10, 0), e3.addMany(i3(81, 88), 1, 10, 0), e3.addMany([89, 90, 92], 1, 10, 0), e3.addMany(i3(96, 127), 1, 10, 0), e3.add(80, 1, 11, 9), e3.addMany(r3, 9, 0, 9), e3.add(127, 9, 0, 9), e3.addMany(i3(28, 32), 9, 0, 9), e3.addMany(i3(32, 48), 9, 9, 12), e3.addMany(i3(48, 60), 9, 8, 10), e3.addMany([60, 61, 62, 63], 9, 9, 10), e3.addMany(r3, 11, 0, 11), e3.addMany(i3(32, 128), 11, 0, 11), e3.addMany(i3(28, 32), 11, 0, 11), e3.addMany(r3, 10, 0, 10), e3.add(127, 10, 0, 10), e3.addMany(i3(28, 32), 10, 0, 10), e3.addMany(i3(48, 60), 10, 8, 10), e3.addMany([60, 61, 62, 63], 10, 0, 11), e3.addMany(i3(32, 48), 10, 9, 12), e3.addMany(r3, 12, 0, 12), e3.add(127, 12, 0, 12), e3.addMany(i3(28, 32), 12, 0, 12), e3.addMany(i3(32, 48), 12, 9, 12), e3.addMany(i3(48, 64), 12, 0, 11), e3.addMany(i3(64, 127), 12, 12, 13), e3.addMany(i3(64, 127), 10, 12, 13), e3.addMany(i3(64, 127), 9, 12, 13), e3.addMany(r3, 13, 13, 13), e3.addMany(s3, 13, 13, 13), e3.add(127, 13, 0, 13), e3.addMany([27, 156, 24, 26], 13, 14, 0), e3.add(h, 0, 2, 0), e3.add(h, 8, 5, 8), e3.add(h, 6, 0, 6), e3.add(h, 11, 0, 11), e3.add(h, 13, 13, 13), e3;
2149
+ })();
2150
+ class c extends s2.Disposable {
2151
+ constructor(e3 = t2.VT500_TRANSITION_TABLE) {
2152
+ super(), this._transitions = e3, this._parseStack = { state: 0, handlers: [], handlerPos: 0, transition: 0, chunkPos: 0 }, this.initialState = 0, this.currentState = this.initialState, this._params = new r2.Params(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._printHandlerFb = (e4, t3, i3) => {
2153
+ }, this._executeHandlerFb = (e4) => {
2154
+ }, this._csiHandlerFb = (e4, t3) => {
2155
+ }, this._escHandlerFb = (e4) => {
2156
+ }, this._errorHandlerFb = (e4) => e4, this._printHandler = this._printHandlerFb, this._executeHandlers = /* @__PURE__ */ Object.create(null), this._csiHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null), this.register((0, s2.toDisposable)((() => {
2157
+ this._csiHandlers = /* @__PURE__ */ Object.create(null), this._executeHandlers = /* @__PURE__ */ Object.create(null), this._escHandlers = /* @__PURE__ */ Object.create(null);
2158
+ }))), this._oscParser = this.register(new n2.OscParser()), this._dcsParser = this.register(new a.DcsParser()), this._errorHandler = this._errorHandlerFb, this.registerEscHandler({ final: "\\" }, (() => !0));
2159
+ }
2160
+ _identifier(e3, t3 = [64, 126]) {
2161
+ let i3 = 0;
2162
+ if (e3.prefix) {
2163
+ if (e3.prefix.length > 1) throw new Error("only one byte as prefix supported");
2164
+ if (i3 = e3.prefix.charCodeAt(0), i3 && 60 > i3 || i3 > 63) throw new Error("prefix must be in range 0x3c .. 0x3f");
2165
+ }
2166
+ if (e3.intermediates) {
2167
+ if (e3.intermediates.length > 2) throw new Error("only two bytes as intermediates are supported");
2168
+ for (let t4 = 0; t4 < e3.intermediates.length; ++t4) {
2169
+ let s4 = e3.intermediates.charCodeAt(t4);
2170
+ if (32 > s4 || s4 > 47) throw new Error("intermediate must be in range 0x20 .. 0x2f");
2171
+ i3 <<= 8, i3 |= s4;
2172
+ }
2173
+ }
2174
+ if (e3.final.length !== 1) throw new Error("final must be a single byte");
2175
+ let s3 = e3.final.charCodeAt(0);
2176
+ if (t3[0] > s3 || s3 > t3[1]) throw new Error(`final must be in range ${t3[0]} .. ${t3[1]}`);
2177
+ return i3 <<= 8, i3 |= s3, i3;
2178
+ }
2179
+ identToString(e3) {
2180
+ let t3 = [];
2181
+ for (; e3; ) t3.push(String.fromCharCode(255 & e3)), e3 >>= 8;
2182
+ return t3.reverse().join("");
2183
+ }
2184
+ setPrintHandler(e3) {
2185
+ this._printHandler = e3;
2186
+ }
2187
+ clearPrintHandler() {
2188
+ this._printHandler = this._printHandlerFb;
2189
+ }
2190
+ registerEscHandler(e3, t3) {
2191
+ let i3 = this._identifier(e3, [48, 126]);
2192
+ this._escHandlers[i3] === void 0 && (this._escHandlers[i3] = []);
2193
+ let s3 = this._escHandlers[i3];
2194
+ return s3.push(t3), { dispose: () => {
2195
+ let e4 = s3.indexOf(t3);
2196
+ e4 !== -1 && s3.splice(e4, 1);
2197
+ } };
2198
+ }
2199
+ clearEscHandler(e3) {
2200
+ this._escHandlers[this._identifier(e3, [48, 126])] && delete this._escHandlers[this._identifier(e3, [48, 126])];
2201
+ }
2202
+ setEscHandlerFallback(e3) {
2203
+ this._escHandlerFb = e3;
2204
+ }
2205
+ setExecuteHandler(e3, t3) {
2206
+ this._executeHandlers[e3.charCodeAt(0)] = t3;
2207
+ }
2208
+ clearExecuteHandler(e3) {
2209
+ this._executeHandlers[e3.charCodeAt(0)] && delete this._executeHandlers[e3.charCodeAt(0)];
2210
+ }
2211
+ setExecuteHandlerFallback(e3) {
2212
+ this._executeHandlerFb = e3;
2213
+ }
2214
+ registerCsiHandler(e3, t3) {
2215
+ let i3 = this._identifier(e3);
2216
+ this._csiHandlers[i3] === void 0 && (this._csiHandlers[i3] = []);
2217
+ let s3 = this._csiHandlers[i3];
2218
+ return s3.push(t3), { dispose: () => {
2219
+ let e4 = s3.indexOf(t3);
2220
+ e4 !== -1 && s3.splice(e4, 1);
2221
+ } };
2222
+ }
2223
+ clearCsiHandler(e3) {
2224
+ this._csiHandlers[this._identifier(e3)] && delete this._csiHandlers[this._identifier(e3)];
2225
+ }
2226
+ setCsiHandlerFallback(e3) {
2227
+ this._csiHandlerFb = e3;
2228
+ }
2229
+ registerDcsHandler(e3, t3) {
2230
+ return this._dcsParser.registerHandler(this._identifier(e3), t3);
2231
+ }
2232
+ clearDcsHandler(e3) {
2233
+ this._dcsParser.clearHandler(this._identifier(e3));
2234
+ }
2235
+ setDcsHandlerFallback(e3) {
2236
+ this._dcsParser.setHandlerFallback(e3);
2237
+ }
2238
+ registerOscHandler(e3, t3) {
2239
+ return this._oscParser.registerHandler(e3, t3);
2240
+ }
2241
+ clearOscHandler(e3) {
2242
+ this._oscParser.clearHandler(e3);
2243
+ }
2244
+ setOscHandlerFallback(e3) {
2245
+ this._oscParser.setHandlerFallback(e3);
2246
+ }
2247
+ setErrorHandler(e3) {
2248
+ this._errorHandler = e3;
2249
+ }
2250
+ clearErrorHandler() {
2251
+ this._errorHandler = this._errorHandlerFb;
2252
+ }
2253
+ reset() {
2254
+ this.currentState = this.initialState, this._oscParser.reset(), this._dcsParser.reset(), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0, this._parseStack.state !== 0 && (this._parseStack.state = 2, this._parseStack.handlers = []);
2255
+ }
2256
+ _preserveStack(e3, t3, i3, s3, r3) {
2257
+ this._parseStack.state = e3, this._parseStack.handlers = t3, this._parseStack.handlerPos = i3, this._parseStack.transition = s3, this._parseStack.chunkPos = r3;
2258
+ }
2259
+ parse(e3, t3, i3) {
2260
+ let s3, r3 = 0, n3 = 0, a2 = 0;
2261
+ if (this._parseStack.state) if (this._parseStack.state === 2) this._parseStack.state = 0, a2 = this._parseStack.chunkPos + 1;
2262
+ else {
2263
+ if (i3 === void 0 || this._parseStack.state === 1) throw this._parseStack.state = 1, new Error("improper continuation due to previous async handler, giving up parsing");
2264
+ let t4 = this._parseStack.handlers, n4 = this._parseStack.handlerPos - 1;
2265
+ switch (this._parseStack.state) {
2266
+ case 3:
2267
+ if (i3 === !1 && n4 > -1) {
2268
+ for (; n4 >= 0 && (s3 = t4[n4](this._params), s3 !== !0); n4--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n4, s3;
2269
+ }
2270
+ this._parseStack.handlers = [];
2271
+ break;
2272
+ case 4:
2273
+ if (i3 === !1 && n4 > -1) {
2274
+ for (; n4 >= 0 && (s3 = t4[n4](), s3 !== !0); n4--) if (s3 instanceof Promise) return this._parseStack.handlerPos = n4, s3;
2275
+ }
2276
+ this._parseStack.handlers = [];
2277
+ break;
2278
+ case 6:
2279
+ if (r3 = e3[this._parseStack.chunkPos], s3 = this._dcsParser.unhook(r3 !== 24 && r3 !== 26, i3), s3) return s3;
2280
+ r3 === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
2281
+ break;
2282
+ case 5:
2283
+ if (r3 = e3[this._parseStack.chunkPos], s3 = this._oscParser.end(r3 !== 24 && r3 !== 26, i3), s3) return s3;
2284
+ r3 === 27 && (this._parseStack.transition |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0;
2285
+ }
2286
+ this._parseStack.state = 0, a2 = this._parseStack.chunkPos + 1, this.precedingJoinState = 0, this.currentState = 15 & this._parseStack.transition;
2287
+ }
2288
+ for (let i4 = a2; i4 < t3; ++i4) {
2289
+ switch (r3 = e3[i4], n3 = this._transitions.table[this.currentState << 8 | (r3 < 160 ? r3 : h)], n3 >> 4) {
2290
+ case 2:
2291
+ for (let s4 = i4 + 1; ; ++s4) {
2292
+ if (s4 >= t3 || (r3 = e3[s4]) < 32 || r3 > 126 && r3 < h) {
2293
+ this._printHandler(e3, i4, s4), i4 = s4 - 1;
2294
+ break;
2295
+ }
2296
+ if (++s4 >= t3 || (r3 = e3[s4]) < 32 || r3 > 126 && r3 < h) {
2297
+ this._printHandler(e3, i4, s4), i4 = s4 - 1;
2298
+ break;
2299
+ }
2300
+ if (++s4 >= t3 || (r3 = e3[s4]) < 32 || r3 > 126 && r3 < h) {
2301
+ this._printHandler(e3, i4, s4), i4 = s4 - 1;
2302
+ break;
2303
+ }
2304
+ if (++s4 >= t3 || (r3 = e3[s4]) < 32 || r3 > 126 && r3 < h) {
2305
+ this._printHandler(e3, i4, s4), i4 = s4 - 1;
2306
+ break;
2307
+ }
2308
+ }
2309
+ break;
2310
+ case 3:
2311
+ this._executeHandlers[r3] ? this._executeHandlers[r3]() : this._executeHandlerFb(r3), this.precedingJoinState = 0;
2312
+ break;
2313
+ case 0:
2314
+ break;
2315
+ case 1:
2316
+ if (this._errorHandler({ position: i4, code: r3, currentState: this.currentState, collect: this._collect, params: this._params, abort: !1 }).abort) return;
2317
+ break;
2318
+ case 7:
2319
+ let a3 = this._csiHandlers[this._collect << 8 | r3], o2 = a3 ? a3.length - 1 : -1;
2320
+ for (; o2 >= 0 && (s3 = a3[o2](this._params), s3 !== !0); o2--) if (s3 instanceof Promise) return this._preserveStack(3, a3, o2, n3, i4), s3;
2321
+ o2 < 0 && this._csiHandlerFb(this._collect << 8 | r3, this._params), this.precedingJoinState = 0;
2322
+ break;
2323
+ case 8:
2324
+ do
2325
+ switch (r3) {
2326
+ case 59:
2327
+ this._params.addParam(0);
2328
+ break;
2329
+ case 58:
2330
+ this._params.addSubParam(-1);
2331
+ break;
2332
+ default:
2333
+ this._params.addDigit(r3 - 48);
2334
+ }
2335
+ while (++i4 < t3 && (r3 = e3[i4]) > 47 && r3 < 60);
2336
+ i4--;
2337
+ break;
2338
+ case 9:
2339
+ this._collect <<= 8, this._collect |= r3;
2340
+ break;
2341
+ case 10:
2342
+ let c2 = this._escHandlers[this._collect << 8 | r3], l = c2 ? c2.length - 1 : -1;
2343
+ for (; l >= 0 && (s3 = c2[l](), s3 !== !0); l--) if (s3 instanceof Promise) return this._preserveStack(4, c2, l, n3, i4), s3;
2344
+ l < 0 && this._escHandlerFb(this._collect << 8 | r3), this.precedingJoinState = 0;
2345
+ break;
2346
+ case 11:
2347
+ this._params.reset(), this._params.addParam(0), this._collect = 0;
2348
+ break;
2349
+ case 12:
2350
+ this._dcsParser.hook(this._collect << 8 | r3, this._params);
2351
+ break;
2352
+ case 13:
2353
+ for (let s4 = i4 + 1; ; ++s4) if (s4 >= t3 || (r3 = e3[s4]) === 24 || r3 === 26 || r3 === 27 || r3 > 127 && r3 < h) {
2354
+ this._dcsParser.put(e3, i4, s4), i4 = s4 - 1;
2355
+ break;
2356
+ }
2357
+ break;
2358
+ case 14:
2359
+ if (s3 = this._dcsParser.unhook(r3 !== 24 && r3 !== 26), s3) return this._preserveStack(6, [], 0, n3, i4), s3;
2360
+ r3 === 27 && (n3 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
2361
+ break;
2362
+ case 4:
2363
+ this._oscParser.start();
2364
+ break;
2365
+ case 5:
2366
+ for (let s4 = i4 + 1; ; s4++) if (s4 >= t3 || (r3 = e3[s4]) < 32 || r3 > 127 && r3 < h) {
2367
+ this._oscParser.put(e3, i4, s4), i4 = s4 - 1;
2368
+ break;
2369
+ }
2370
+ break;
2371
+ case 6:
2372
+ if (s3 = this._oscParser.end(r3 !== 24 && r3 !== 26), s3) return this._preserveStack(5, [], 0, n3, i4), s3;
2373
+ r3 === 27 && (n3 |= 1), this._params.reset(), this._params.addParam(0), this._collect = 0, this.precedingJoinState = 0;
2374
+ }
2375
+ this.currentState = 15 & n3;
2376
+ }
2377
+ }
2378
+ }
2379
+ t2.EscapeSequenceParser = c;
2380
+ }, 242: (e2, t2, i2) => {
2381
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OscHandler = t2.OscParser = void 0;
2382
+ let s2 = i2(770), r2 = i2(482), n2 = [];
2383
+ t2.OscParser = class {
2384
+ constructor() {
2385
+ this._state = 0, this._active = n2, this._id = -1, this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
2386
+ }, this._stack = { paused: !1, loopPosition: 0, fallThrough: !1 };
2387
+ }
2388
+ registerHandler(e3, t3) {
2389
+ this._handlers[e3] === void 0 && (this._handlers[e3] = []);
2390
+ let i3 = this._handlers[e3];
2391
+ return i3.push(t3), { dispose: () => {
2392
+ let e4 = i3.indexOf(t3);
2393
+ e4 !== -1 && i3.splice(e4, 1);
2394
+ } };
2395
+ }
2396
+ clearHandler(e3) {
2397
+ this._handlers[e3] && delete this._handlers[e3];
2398
+ }
2399
+ setHandlerFallback(e3) {
2400
+ this._handlerFb = e3;
2401
+ }
2402
+ dispose() {
2403
+ this._handlers = /* @__PURE__ */ Object.create(null), this._handlerFb = () => {
2404
+ }, this._active = n2;
2405
+ }
2406
+ reset() {
2407
+ if (this._state === 2) for (let e3 = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; e3 >= 0; --e3) this._active[e3].end(!1);
2408
+ this._stack.paused = !1, this._active = n2, this._id = -1, this._state = 0;
2409
+ }
2410
+ _start() {
2411
+ if (this._active = this._handlers[this._id] || n2, this._active.length) for (let e3 = this._active.length - 1; e3 >= 0; e3--) this._active[e3].start();
2412
+ else this._handlerFb(this._id, "START");
2413
+ }
2414
+ _put(e3, t3, i3) {
2415
+ if (this._active.length) for (let s3 = this._active.length - 1; s3 >= 0; s3--) this._active[s3].put(e3, t3, i3);
2416
+ else this._handlerFb(this._id, "PUT", (0, r2.utf32ToString)(e3, t3, i3));
2417
+ }
2418
+ start() {
2419
+ this.reset(), this._state = 1;
2420
+ }
2421
+ put(e3, t3, i3) {
2422
+ if (this._state !== 3) {
2423
+ if (this._state === 1) for (; t3 < i3; ) {
2424
+ let i4 = e3[t3++];
2425
+ if (i4 === 59) {
2426
+ this._state = 2, this._start();
2427
+ break;
2428
+ }
2429
+ if (i4 < 48 || 57 < i4) return void (this._state = 3);
2430
+ this._id === -1 && (this._id = 0), this._id = 10 * this._id + i4 - 48;
2431
+ }
2432
+ this._state === 2 && i3 - t3 > 0 && this._put(e3, t3, i3);
2433
+ }
2434
+ }
2435
+ end(e3, t3 = !0) {
2436
+ if (this._state !== 0) {
2437
+ if (this._state !== 3) if (this._state === 1 && this._start(), this._active.length) {
2438
+ let i3 = !1, s3 = this._active.length - 1, r3 = !1;
2439
+ if (this._stack.paused && (s3 = this._stack.loopPosition - 1, i3 = t3, r3 = this._stack.fallThrough, this._stack.paused = !1), !r3 && i3 === !1) {
2440
+ for (; s3 >= 0 && (i3 = this._active[s3].end(e3), i3 !== !0); s3--) if (i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !1, i3;
2441
+ s3--;
2442
+ }
2443
+ for (; s3 >= 0; s3--) if (i3 = this._active[s3].end(!1), i3 instanceof Promise) return this._stack.paused = !0, this._stack.loopPosition = s3, this._stack.fallThrough = !0, i3;
2444
+ } else this._handlerFb(this._id, "END", e3);
2445
+ this._active = n2, this._id = -1, this._state = 0;
2446
+ }
2447
+ }
2448
+ }, t2.OscHandler = class {
2449
+ constructor(e3) {
2450
+ this._handler = e3, this._data = "", this._hitLimit = !1;
2451
+ }
2452
+ start() {
2453
+ this._data = "", this._hitLimit = !1;
2454
+ }
2455
+ put(e3, t3, i3) {
2456
+ this._hitLimit || (this._data += (0, r2.utf32ToString)(e3, t3, i3), this._data.length > s2.PAYLOAD_LIMIT && (this._data = "", this._hitLimit = !0));
2457
+ }
2458
+ end(e3) {
2459
+ let t3 = !1;
2460
+ if (this._hitLimit) t3 = !1;
2461
+ else if (e3 && (t3 = this._handler(this._data), t3 instanceof Promise)) return t3.then(((e4) => (this._data = "", this._hitLimit = !1, e4)));
2462
+ return this._data = "", this._hitLimit = !1, t3;
2463
+ }
2464
+ };
2465
+ }, 742: (e2, t2) => {
2466
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Params = void 0;
2467
+ let i2 = 2147483647;
2468
+ class s2 {
2469
+ static fromArray(e3) {
2470
+ let t3 = new s2();
2471
+ if (!e3.length) return t3;
2472
+ for (let i3 = Array.isArray(e3[0]) ? 1 : 0; i3 < e3.length; ++i3) {
2473
+ let s3 = e3[i3];
2474
+ if (Array.isArray(s3)) for (let e4 = 0; e4 < s3.length; ++e4) t3.addSubParam(s3[e4]);
2475
+ else t3.addParam(s3);
2476
+ }
2477
+ return t3;
2478
+ }
2479
+ constructor(e3 = 32, t3 = 32) {
2480
+ if (this.maxLength = e3, this.maxSubParamsLength = t3, t3 > 256) throw new Error("maxSubParamsLength must not be greater than 256");
2481
+ this.params = new Int32Array(e3), this.length = 0, this._subParams = new Int32Array(t3), this._subParamsLength = 0, this._subParamsIdx = new Uint16Array(e3), this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1;
2482
+ }
2483
+ clone() {
2484
+ let e3 = new s2(this.maxLength, this.maxSubParamsLength);
2485
+ return e3.params.set(this.params), e3.length = this.length, e3._subParams.set(this._subParams), e3._subParamsLength = this._subParamsLength, e3._subParamsIdx.set(this._subParamsIdx), e3._rejectDigits = this._rejectDigits, e3._rejectSubDigits = this._rejectSubDigits, e3._digitIsSub = this._digitIsSub, e3;
2486
+ }
2487
+ toArray() {
2488
+ let e3 = [];
2489
+ for (let t3 = 0; t3 < this.length; ++t3) {
2490
+ e3.push(this.params[t3]);
2491
+ let i3 = this._subParamsIdx[t3] >> 8, s3 = 255 & this._subParamsIdx[t3];
2492
+ s3 - i3 > 0 && e3.push(Array.prototype.slice.call(this._subParams, i3, s3));
2493
+ }
2494
+ return e3;
2495
+ }
2496
+ reset() {
2497
+ this.length = 0, this._subParamsLength = 0, this._rejectDigits = !1, this._rejectSubDigits = !1, this._digitIsSub = !1;
2498
+ }
2499
+ addParam(e3) {
2500
+ if (this._digitIsSub = !1, this.length >= this.maxLength) this._rejectDigits = !0;
2501
+ else {
2502
+ if (e3 < -1) throw new Error("values lesser than -1 are not allowed");
2503
+ this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength, this.params[this.length++] = e3 > i2 ? i2 : e3;
2504
+ }
2505
+ }
2506
+ addSubParam(e3) {
2507
+ if (this._digitIsSub = !0, this.length) if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) this._rejectSubDigits = !0;
2508
+ else {
2509
+ if (e3 < -1) throw new Error("values lesser than -1 are not allowed");
2510
+ this._subParams[this._subParamsLength++] = e3 > i2 ? i2 : e3, this._subParamsIdx[this.length - 1]++;
2511
+ }
2512
+ }
2513
+ hasSubParams(e3) {
2514
+ return (255 & this._subParamsIdx[e3]) - (this._subParamsIdx[e3] >> 8) > 0;
2515
+ }
2516
+ getSubParams(e3) {
2517
+ let t3 = this._subParamsIdx[e3] >> 8, i3 = 255 & this._subParamsIdx[e3];
2518
+ return i3 - t3 > 0 ? this._subParams.subarray(t3, i3) : null;
2519
+ }
2520
+ getSubParamsAll() {
2521
+ let e3 = {};
2522
+ for (let t3 = 0; t3 < this.length; ++t3) {
2523
+ let i3 = this._subParamsIdx[t3] >> 8, s3 = 255 & this._subParamsIdx[t3];
2524
+ s3 - i3 > 0 && (e3[t3] = this._subParams.slice(i3, s3));
2525
+ }
2526
+ return e3;
2527
+ }
2528
+ addDigit(e3) {
2529
+ let t3;
2530
+ if (this._rejectDigits || !(t3 = this._digitIsSub ? this._subParamsLength : this.length) || this._digitIsSub && this._rejectSubDigits) return;
2531
+ let s3 = this._digitIsSub ? this._subParams : this.params, r2 = s3[t3 - 1];
2532
+ s3[t3 - 1] = ~r2 ? Math.min(10 * r2 + e3, i2) : e3;
2533
+ }
2534
+ }
2535
+ t2.Params = s2;
2536
+ }, 741: (e2, t2) => {
2537
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.AddonManager = void 0, t2.AddonManager = class {
2538
+ constructor() {
2539
+ this._addons = [];
2540
+ }
2541
+ dispose() {
2542
+ for (let e3 = this._addons.length - 1; e3 >= 0; e3--) this._addons[e3].instance.dispose();
2543
+ }
2544
+ loadAddon(e3, t3) {
2545
+ let i2 = { instance: t3, dispose: t3.dispose, isDisposed: !1 };
2546
+ this._addons.push(i2), t3.dispose = () => this._wrappedAddonDispose(i2), t3.activate(e3);
2547
+ }
2548
+ _wrappedAddonDispose(e3) {
2549
+ if (e3.isDisposed) return;
2550
+ let t3 = -1;
2551
+ for (let i2 = 0; i2 < this._addons.length; i2++) if (this._addons[i2] === e3) {
2552
+ t3 = i2;
2553
+ break;
2554
+ }
2555
+ if (t3 === -1) throw new Error("Could not dispose an addon that has not been loaded");
2556
+ e3.isDisposed = !0, e3.dispose.apply(e3.instance), this._addons.splice(t3, 1);
2557
+ }
2558
+ };
2559
+ }, 771: (e2, t2, i2) => {
2560
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferApiView = void 0;
2561
+ let s2 = i2(785), r2 = i2(511);
2562
+ t2.BufferApiView = class {
2563
+ constructor(e3, t3) {
2564
+ this._buffer = e3, this.type = t3;
2565
+ }
2566
+ init(e3) {
2567
+ return this._buffer = e3, this;
2568
+ }
2569
+ get cursorY() {
2570
+ return this._buffer.y;
2571
+ }
2572
+ get cursorX() {
2573
+ return this._buffer.x;
2574
+ }
2575
+ get viewportY() {
2576
+ return this._buffer.ydisp;
2577
+ }
2578
+ get baseY() {
2579
+ return this._buffer.ybase;
2580
+ }
2581
+ get length() {
2582
+ return this._buffer.lines.length;
2583
+ }
2584
+ getLine(e3) {
2585
+ let t3 = this._buffer.lines.get(e3);
2586
+ if (t3) return new s2.BufferLineApiView(t3);
2587
+ }
2588
+ getNullCell() {
2589
+ return new r2.CellData();
2590
+ }
2591
+ };
2592
+ }, 785: (e2, t2, i2) => {
2593
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferLineApiView = void 0;
2594
+ let s2 = i2(511);
2595
+ t2.BufferLineApiView = class {
2596
+ constructor(e3) {
2597
+ this._line = e3;
2598
+ }
2599
+ get isWrapped() {
2600
+ return this._line.isWrapped;
2601
+ }
2602
+ get length() {
2603
+ return this._line.length;
2604
+ }
2605
+ getCell(e3, t3) {
2606
+ if (!(e3 < 0 || e3 >= this._line.length)) return t3 ? (this._line.loadCell(e3, t3), t3) : this._line.loadCell(e3, new s2.CellData());
2607
+ }
2608
+ translateToString(e3, t3, i3) {
2609
+ return this._line.translateToString(e3, t3, i3);
2610
+ }
2611
+ };
2612
+ }, 285: (e2, t2, i2) => {
2613
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferNamespaceApi = void 0;
2614
+ let s2 = i2(771), r2 = i2(460), n2 = i2(844);
2615
+ class a extends n2.Disposable {
2616
+ constructor(e3) {
2617
+ super(), this._core = e3, this._onBufferChange = this.register(new r2.EventEmitter()), this.onBufferChange = this._onBufferChange.event, this._normal = new s2.BufferApiView(this._core.buffers.normal, "normal"), this._alternate = new s2.BufferApiView(this._core.buffers.alt, "alternate"), this._core.buffers.onBufferActivate((() => this._onBufferChange.fire(this.active)));
2618
+ }
2619
+ get active() {
2620
+ if (this._core.buffers.active === this._core.buffers.normal) return this.normal;
2621
+ if (this._core.buffers.active === this._core.buffers.alt) return this.alternate;
2622
+ throw new Error("Active buffer is neither normal nor alternate");
2623
+ }
2624
+ get normal() {
2625
+ return this._normal.init(this._core.buffers.normal);
2626
+ }
2627
+ get alternate() {
2628
+ return this._alternate.init(this._core.buffers.alt);
2629
+ }
2630
+ }
2631
+ t2.BufferNamespaceApi = a;
2632
+ }, 975: (e2, t2) => {
2633
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.ParserApi = void 0, t2.ParserApi = class {
2634
+ constructor(e3) {
2635
+ this._core = e3;
2636
+ }
2637
+ registerCsiHandler(e3, t3) {
2638
+ return this._core.registerCsiHandler(e3, ((e4) => t3(e4.toArray())));
2639
+ }
2640
+ addCsiHandler(e3, t3) {
2641
+ return this.registerCsiHandler(e3, t3);
2642
+ }
2643
+ registerDcsHandler(e3, t3) {
2644
+ return this._core.registerDcsHandler(e3, ((e4, i2) => t3(e4, i2.toArray())));
2645
+ }
2646
+ addDcsHandler(e3, t3) {
2647
+ return this.registerDcsHandler(e3, t3);
2648
+ }
2649
+ registerEscHandler(e3, t3) {
2650
+ return this._core.registerEscHandler(e3, t3);
2651
+ }
2652
+ addEscHandler(e3, t3) {
2653
+ return this.registerEscHandler(e3, t3);
2654
+ }
2655
+ registerOscHandler(e3, t3) {
2656
+ return this._core.registerOscHandler(e3, t3);
2657
+ }
2658
+ addOscHandler(e3, t3) {
2659
+ return this.registerOscHandler(e3, t3);
2660
+ }
2661
+ };
2662
+ }, 90: (e2, t2) => {
2663
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.UnicodeApi = void 0, t2.UnicodeApi = class {
2664
+ constructor(e3) {
2665
+ this._core = e3;
2666
+ }
2667
+ register(e3) {
2668
+ this._core.unicodeService.register(e3);
2669
+ }
2670
+ get versions() {
2671
+ return this._core.unicodeService.versions;
2672
+ }
2673
+ get activeVersion() {
2674
+ return this._core.unicodeService.activeVersion;
2675
+ }
2676
+ set activeVersion(e3) {
2677
+ this._core.unicodeService.activeVersion = e3;
2678
+ }
2679
+ };
2680
+ }, 744: function(e2, t2, i2) {
2681
+ var s2 = this && this.__decorate || function(e3, t3, i3, s3) {
2682
+ var r3, n3 = arguments.length, a2 = n3 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3;
2683
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a2 = Reflect.decorate(e3, t3, i3, s3);
2684
+ else for (var o2 = e3.length - 1; o2 >= 0; o2--) (r3 = e3[o2]) && (a2 = (n3 < 3 ? r3(a2) : n3 > 3 ? r3(t3, i3, a2) : r3(t3, i3)) || a2);
2685
+ return n3 > 3 && a2 && Object.defineProperty(t3, i3, a2), a2;
2686
+ }, r2 = this && this.__param || function(e3, t3) {
2687
+ return function(i3, s3) {
2688
+ t3(i3, s3, e3);
2689
+ };
2690
+ };
2691
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.BufferService = t2.MINIMUM_ROWS = t2.MINIMUM_COLS = void 0;
2692
+ let n2 = i2(460), a = i2(844), o = i2(295), h = i2(585);
2693
+ t2.MINIMUM_COLS = 2, t2.MINIMUM_ROWS = 1;
2694
+ let c = t2.BufferService = class extends a.Disposable {
2695
+ get buffer() {
2696
+ return this.buffers.active;
2697
+ }
2698
+ constructor(e3) {
2699
+ super(), this.isUserScrolling = !1, this._onResize = this.register(new n2.EventEmitter()), this.onResize = this._onResize.event, this._onScroll = this.register(new n2.EventEmitter()), this.onScroll = this._onScroll.event, this.cols = Math.max(e3.rawOptions.cols || 0, t2.MINIMUM_COLS), this.rows = Math.max(e3.rawOptions.rows || 0, t2.MINIMUM_ROWS), this.buffers = this.register(new o.BufferSet(e3, this));
2700
+ }
2701
+ resize(e3, t3) {
2702
+ this.cols = e3, this.rows = t3, this.buffers.resize(e3, t3), this._onResize.fire({ cols: e3, rows: t3 });
2703
+ }
2704
+ reset() {
2705
+ this.buffers.reset(), this.isUserScrolling = !1;
2706
+ }
2707
+ scroll(e3, t3 = !1) {
2708
+ let i3 = this.buffer, s3;
2709
+ s3 = this._cachedBlankLine, s3 && s3.length === this.cols && s3.getFg(0) === e3.fg && s3.getBg(0) === e3.bg || (s3 = i3.getBlankLine(e3, t3), this._cachedBlankLine = s3), s3.isWrapped = t3;
2710
+ let r3 = i3.ybase + i3.scrollTop, n3 = i3.ybase + i3.scrollBottom;
2711
+ if (i3.scrollTop === 0) {
2712
+ let e4 = i3.lines.isFull;
2713
+ n3 === i3.lines.length - 1 ? e4 ? i3.lines.recycle().copyFrom(s3) : i3.lines.push(s3.clone()) : i3.lines.splice(n3 + 1, 0, s3.clone()), e4 ? this.isUserScrolling && (i3.ydisp = Math.max(i3.ydisp - 1, 0)) : (i3.ybase++, this.isUserScrolling || i3.ydisp++);
2714
+ } else {
2715
+ let e4 = n3 - r3 + 1;
2716
+ i3.lines.shiftElements(r3 + 1, e4 - 1, -1), i3.lines.set(n3, s3.clone());
2717
+ }
2718
+ this.isUserScrolling || (i3.ydisp = i3.ybase), this._onScroll.fire(i3.ydisp);
2719
+ }
2720
+ scrollLines(e3, t3, i3) {
2721
+ let s3 = this.buffer;
2722
+ if (e3 < 0) {
2723
+ if (s3.ydisp === 0) return;
2724
+ this.isUserScrolling = !0;
2725
+ } else e3 + s3.ydisp >= s3.ybase && (this.isUserScrolling = !1);
2726
+ let r3 = s3.ydisp;
2727
+ s3.ydisp = Math.max(Math.min(s3.ydisp + e3, s3.ybase), 0), r3 !== s3.ydisp && (t3 || this._onScroll.fire(s3.ydisp));
2728
+ }
2729
+ };
2730
+ t2.BufferService = c = s2([r2(0, h.IOptionsService)], c);
2731
+ }, 994: (e2, t2) => {
2732
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CharsetService = void 0, t2.CharsetService = class {
2733
+ constructor() {
2734
+ this.glevel = 0, this._charsets = [];
2735
+ }
2736
+ reset() {
2737
+ this.charset = void 0, this._charsets = [], this.glevel = 0;
2738
+ }
2739
+ setgLevel(e3) {
2740
+ this.glevel = e3, this.charset = this._charsets[e3];
2741
+ }
2742
+ setgCharset(e3, t3) {
2743
+ this._charsets[e3] = t3, this.glevel === e3 && (this.charset = t3);
2744
+ }
2745
+ };
2746
+ }, 753: function(e2, t2, i2) {
2747
+ var s2 = this && this.__decorate || function(e3, t3, i3, s3) {
2748
+ var r3, n3 = arguments.length, a2 = n3 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3;
2749
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a2 = Reflect.decorate(e3, t3, i3, s3);
2750
+ else for (var o2 = e3.length - 1; o2 >= 0; o2--) (r3 = e3[o2]) && (a2 = (n3 < 3 ? r3(a2) : n3 > 3 ? r3(t3, i3, a2) : r3(t3, i3)) || a2);
2751
+ return n3 > 3 && a2 && Object.defineProperty(t3, i3, a2), a2;
2752
+ }, r2 = this && this.__param || function(e3, t3) {
2753
+ return function(i3, s3) {
2754
+ t3(i3, s3, e3);
2755
+ };
2756
+ };
2757
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreMouseService = void 0;
2758
+ let n2 = i2(585), a = i2(460), o = i2(844), h = { NONE: { events: 0, restrict: () => !1 }, X10: { events: 1, restrict: (e3) => e3.button !== 4 && e3.action === 1 && (e3.ctrl = !1, e3.alt = !1, e3.shift = !1, !0) }, VT200: { events: 19, restrict: (e3) => e3.action !== 32 }, DRAG: { events: 23, restrict: (e3) => e3.action !== 32 || e3.button !== 3 }, ANY: { events: 31, restrict: (e3) => !0 } };
2759
+ function c(e3, t3) {
2760
+ let i3 = (e3.ctrl ? 16 : 0) | (e3.shift ? 4 : 0) | (e3.alt ? 8 : 0);
2761
+ return e3.button === 4 ? (i3 |= 64, i3 |= e3.action) : (i3 |= 3 & e3.button, 4 & e3.button && (i3 |= 64), 8 & e3.button && (i3 |= 128), e3.action === 32 ? i3 |= 32 : e3.action !== 0 || t3 || (i3 |= 3)), i3;
2762
+ }
2763
+ let l = String.fromCharCode, _ = { DEFAULT: (e3) => {
2764
+ let t3 = [c(e3, !1) + 32, e3.col + 32, e3.row + 32];
2765
+ return t3[0] > 255 || t3[1] > 255 || t3[2] > 255 ? "" : `\x1B[M${l(t3[0])}${l(t3[1])}${l(t3[2])}`;
2766
+ }, SGR: (e3) => {
2767
+ let t3 = e3.action === 0 && e3.button !== 4 ? "m" : "M";
2768
+ return `\x1B[<${c(e3, !0)};${e3.col};${e3.row}${t3}`;
2769
+ }, SGR_PIXELS: (e3) => {
2770
+ let t3 = e3.action === 0 && e3.button !== 4 ? "m" : "M";
2771
+ return `\x1B[<${c(e3, !0)};${e3.x};${e3.y}${t3}`;
2772
+ } }, d = t2.CoreMouseService = class extends o.Disposable {
2773
+ constructor(e3, t3) {
2774
+ super(), this._bufferService = e3, this._coreService = t3, this._protocols = {}, this._encodings = {}, this._activeProtocol = "", this._activeEncoding = "", this._lastEvent = null, this._onProtocolChange = this.register(new a.EventEmitter()), this.onProtocolChange = this._onProtocolChange.event;
2775
+ for (let e4 of Object.keys(h)) this.addProtocol(e4, h[e4]);
2776
+ for (let e4 of Object.keys(_)) this.addEncoding(e4, _[e4]);
2777
+ this.reset();
2778
+ }
2779
+ addProtocol(e3, t3) {
2780
+ this._protocols[e3] = t3;
2781
+ }
2782
+ addEncoding(e3, t3) {
2783
+ this._encodings[e3] = t3;
2784
+ }
2785
+ get activeProtocol() {
2786
+ return this._activeProtocol;
2787
+ }
2788
+ get areMouseEventsActive() {
2789
+ return this._protocols[this._activeProtocol].events !== 0;
2790
+ }
2791
+ set activeProtocol(e3) {
2792
+ if (!this._protocols[e3]) throw new Error(`unknown protocol "${e3}"`);
2793
+ this._activeProtocol = e3, this._onProtocolChange.fire(this._protocols[e3].events);
2794
+ }
2795
+ get activeEncoding() {
2796
+ return this._activeEncoding;
2797
+ }
2798
+ set activeEncoding(e3) {
2799
+ if (!this._encodings[e3]) throw new Error(`unknown encoding "${e3}"`);
2800
+ this._activeEncoding = e3;
2801
+ }
2802
+ reset() {
2803
+ this.activeProtocol = "NONE", this.activeEncoding = "DEFAULT", this._lastEvent = null;
2804
+ }
2805
+ triggerMouseEvent(e3) {
2806
+ if (e3.col < 0 || e3.col >= this._bufferService.cols || e3.row < 0 || e3.row >= this._bufferService.rows || e3.button === 4 && e3.action === 32 || e3.button === 3 && e3.action !== 32 || e3.button !== 4 && (e3.action === 2 || e3.action === 3) || (e3.col++, e3.row++, e3.action === 32 && this._lastEvent && this._equalEvents(this._lastEvent, e3, this._activeEncoding === "SGR_PIXELS")) || !this._protocols[this._activeProtocol].restrict(e3)) return !1;
2807
+ let t3 = this._encodings[this._activeEncoding](e3);
2808
+ return t3 && (this._activeEncoding === "DEFAULT" ? this._coreService.triggerBinaryEvent(t3) : this._coreService.triggerDataEvent(t3, !0)), this._lastEvent = e3, !0;
2809
+ }
2810
+ explainEvents(e3) {
2811
+ return { down: !!(1 & e3), up: !!(2 & e3), drag: !!(4 & e3), move: !!(8 & e3), wheel: !!(16 & e3) };
2812
+ }
2813
+ _equalEvents(e3, t3, i3) {
2814
+ if (i3) {
2815
+ if (e3.x !== t3.x || e3.y !== t3.y) return !1;
2816
+ } else if (e3.col !== t3.col || e3.row !== t3.row) return !1;
2817
+ return e3.button === t3.button && e3.action === t3.action && e3.ctrl === t3.ctrl && e3.alt === t3.alt && e3.shift === t3.shift;
2818
+ }
2819
+ };
2820
+ t2.CoreMouseService = d = s2([r2(0, n2.IBufferService), r2(1, n2.ICoreService)], d);
2821
+ }, 83: function(e2, t2, i2) {
2822
+ var s2 = this && this.__decorate || function(e3, t3, i3, s3) {
2823
+ var r3, n3 = arguments.length, a2 = n3 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3;
2824
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a2 = Reflect.decorate(e3, t3, i3, s3);
2825
+ else for (var o2 = e3.length - 1; o2 >= 0; o2--) (r3 = e3[o2]) && (a2 = (n3 < 3 ? r3(a2) : n3 > 3 ? r3(t3, i3, a2) : r3(t3, i3)) || a2);
2826
+ return n3 > 3 && a2 && Object.defineProperty(t3, i3, a2), a2;
2827
+ }, r2 = this && this.__param || function(e3, t3) {
2828
+ return function(i3, s3) {
2829
+ t3(i3, s3, e3);
2830
+ };
2831
+ };
2832
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.CoreService = void 0;
2833
+ let n2 = i2(439), a = i2(460), o = i2(844), h = i2(585), c = Object.freeze({ insertMode: !1 }), l = Object.freeze({ applicationCursorKeys: !1, applicationKeypad: !1, bracketedPasteMode: !1, origin: !1, reverseWraparound: !1, sendFocus: !1, wraparound: !0 }), _ = t2.CoreService = class extends o.Disposable {
2834
+ constructor(e3, t3, i3) {
2835
+ super(), this._bufferService = e3, this._logService = t3, this._optionsService = i3, this.isCursorInitialized = !1, this.isCursorHidden = !1, this._onData = this.register(new a.EventEmitter()), this.onData = this._onData.event, this._onUserInput = this.register(new a.EventEmitter()), this.onUserInput = this._onUserInput.event, this._onBinary = this.register(new a.EventEmitter()), this.onBinary = this._onBinary.event, this._onRequestScrollToBottom = this.register(new a.EventEmitter()), this.onRequestScrollToBottom = this._onRequestScrollToBottom.event, this.modes = (0, n2.clone)(c), this.decPrivateModes = (0, n2.clone)(l);
2836
+ }
2837
+ reset() {
2838
+ this.modes = (0, n2.clone)(c), this.decPrivateModes = (0, n2.clone)(l);
2839
+ }
2840
+ triggerDataEvent(e3, t3 = !1) {
2841
+ if (this._optionsService.rawOptions.disableStdin) return;
2842
+ let i3 = this._bufferService.buffer;
2843
+ t3 && this._optionsService.rawOptions.scrollOnUserInput && i3.ybase !== i3.ydisp && this._onRequestScrollToBottom.fire(), t3 && this._onUserInput.fire(), this._logService.debug(`sending data "${e3}"`, (() => e3.split("").map(((e4) => e4.charCodeAt(0))))), this._onData.fire(e3);
2844
+ }
2845
+ triggerBinaryEvent(e3) {
2846
+ this._optionsService.rawOptions.disableStdin || (this._logService.debug(`sending binary "${e3}"`, (() => e3.split("").map(((e4) => e4.charCodeAt(0))))), this._onBinary.fire(e3));
2847
+ }
2848
+ };
2849
+ t2.CoreService = _ = s2([r2(0, h.IBufferService), r2(1, h.ILogService), r2(2, h.IOptionsService)], _);
2850
+ }, 348: (e2, t2, i2) => {
2851
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.InstantiationService = t2.ServiceCollection = void 0;
2852
+ let s2 = i2(585), r2 = i2(343);
2853
+ class n2 {
2854
+ constructor(...e3) {
2855
+ this._entries = /* @__PURE__ */ new Map();
2856
+ for (let [t3, i3] of e3) this.set(t3, i3);
2857
+ }
2858
+ set(e3, t3) {
2859
+ let i3 = this._entries.get(e3);
2860
+ return this._entries.set(e3, t3), i3;
2861
+ }
2862
+ forEach(e3) {
2863
+ for (let [t3, i3] of this._entries.entries()) e3(t3, i3);
2864
+ }
2865
+ has(e3) {
2866
+ return this._entries.has(e3);
2867
+ }
2868
+ get(e3) {
2869
+ return this._entries.get(e3);
2870
+ }
2871
+ }
2872
+ t2.ServiceCollection = n2, t2.InstantiationService = class {
2873
+ constructor() {
2874
+ this._services = new n2(), this._services.set(s2.IInstantiationService, this);
2875
+ }
2876
+ setService(e3, t3) {
2877
+ this._services.set(e3, t3);
2878
+ }
2879
+ getService(e3) {
2880
+ return this._services.get(e3);
2881
+ }
2882
+ createInstance(e3, ...t3) {
2883
+ let i3 = (0, r2.getServiceDependencies)(e3).sort(((e4, t4) => e4.index - t4.index)), s3 = [];
2884
+ for (let t4 of i3) {
2885
+ let i4 = this._services.get(t4.id);
2886
+ if (!i4) throw new Error(`[createInstance] ${e3.name} depends on UNKNOWN service ${t4.id}.`);
2887
+ s3.push(i4);
2888
+ }
2889
+ let n3 = i3.length > 0 ? i3[0].index : t3.length;
2890
+ if (t3.length !== n3) throw new Error(`[createInstance] First service dependency of ${e3.name} at position ${n3 + 1} conflicts with ${t3.length} static arguments`);
2891
+ return new e3(...t3, ...s3);
2892
+ }
2893
+ };
2894
+ }, 866: function(e2, t2, i2) {
2895
+ var s2 = this && this.__decorate || function(e3, t3, i3, s3) {
2896
+ var r3, n3 = arguments.length, a2 = n3 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3;
2897
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a2 = Reflect.decorate(e3, t3, i3, s3);
2898
+ else for (var o2 = e3.length - 1; o2 >= 0; o2--) (r3 = e3[o2]) && (a2 = (n3 < 3 ? r3(a2) : n3 > 3 ? r3(t3, i3, a2) : r3(t3, i3)) || a2);
2899
+ return n3 > 3 && a2 && Object.defineProperty(t3, i3, a2), a2;
2900
+ }, r2 = this && this.__param || function(e3, t3) {
2901
+ return function(i3, s3) {
2902
+ t3(i3, s3, e3);
2903
+ };
2904
+ };
2905
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.traceCall = t2.setTraceLogger = t2.LogService = void 0;
2906
+ let n2 = i2(844), a = i2(585), o = { trace: a.LogLevelEnum.TRACE, debug: a.LogLevelEnum.DEBUG, info: a.LogLevelEnum.INFO, warn: a.LogLevelEnum.WARN, error: a.LogLevelEnum.ERROR, off: a.LogLevelEnum.OFF }, h, c = t2.LogService = class extends n2.Disposable {
2907
+ get logLevel() {
2908
+ return this._logLevel;
2909
+ }
2910
+ constructor(e3) {
2911
+ super(), this._optionsService = e3, this._logLevel = a.LogLevelEnum.OFF, this._updateLogLevel(), this.register(this._optionsService.onSpecificOptionChange("logLevel", (() => this._updateLogLevel()))), h = this;
2912
+ }
2913
+ _updateLogLevel() {
2914
+ this._logLevel = o[this._optionsService.rawOptions.logLevel];
2915
+ }
2916
+ _evalLazyOptionalParams(e3) {
2917
+ for (let t3 = 0; t3 < e3.length; t3++) typeof e3[t3] == "function" && (e3[t3] = e3[t3]());
2918
+ }
2919
+ _log(e3, t3, i3) {
2920
+ this._evalLazyOptionalParams(i3), e3.call(console, (this._optionsService.options.logger ? "" : "xterm.js: ") + t3, ...i3);
2921
+ }
2922
+ trace(e3, ...t3) {
2923
+ this._logLevel <= a.LogLevelEnum.TRACE && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e3, t3);
2924
+ }
2925
+ debug(e3, ...t3) {
2926
+ this._logLevel <= a.LogLevelEnum.DEBUG && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e3, t3);
2927
+ }
2928
+ info(e3, ...t3) {
2929
+ this._logLevel <= a.LogLevelEnum.INFO && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e3, t3);
2930
+ }
2931
+ warn(e3, ...t3) {
2932
+ this._logLevel <= a.LogLevelEnum.WARN && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e3, t3);
2933
+ }
2934
+ error(e3, ...t3) {
2935
+ this._logLevel <= a.LogLevelEnum.ERROR && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e3, t3);
2936
+ }
2937
+ };
2938
+ t2.LogService = c = s2([r2(0, a.IOptionsService)], c), t2.setTraceLogger = function(e3) {
2939
+ h = e3;
2940
+ }, t2.traceCall = function(e3, t3, i3) {
2941
+ if (typeof i3.value != "function") throw new Error("not supported");
2942
+ let s3 = i3.value;
2943
+ i3.value = function(...e4) {
2944
+ if (h.logLevel !== a.LogLevelEnum.TRACE) return s3.apply(this, e4);
2945
+ h.trace(`GlyphRenderer#${s3.name}(${e4.map(((e5) => JSON.stringify(e5))).join(", ")})`);
2946
+ let t4 = s3.apply(this, e4);
2947
+ return h.trace(`GlyphRenderer#${s3.name} return`, t4), t4;
2948
+ };
2949
+ };
2950
+ }, 302: (e2, t2, i2) => {
2951
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OptionsService = t2.DEFAULT_OPTIONS = void 0;
2952
+ let s2 = i2(460), r2 = i2(844), n2 = i2(114);
2953
+ t2.DEFAULT_OPTIONS = { cols: 80, rows: 24, cursorBlink: !1, cursorStyle: "block", cursorWidth: 1, cursorInactiveStyle: "outline", customGlyphs: !0, drawBoldTextInBrightColors: !0, documentOverride: null, fastScrollModifier: "alt", fastScrollSensitivity: 5, fontFamily: "courier-new, courier, monospace", fontSize: 15, fontWeight: "normal", fontWeightBold: "bold", ignoreBracketedPasteMode: !1, lineHeight: 1, letterSpacing: 0, linkHandler: null, logLevel: "info", logger: null, scrollback: 1e3, scrollOnUserInput: !0, scrollSensitivity: 1, screenReaderMode: !1, smoothScrollDuration: 0, macOptionIsMeta: !1, macOptionClickForcesSelection: !1, minimumContrastRatio: 1, disableStdin: !1, allowProposedApi: !1, allowTransparency: !1, tabStopWidth: 8, theme: {}, rescaleOverlappingGlyphs: !1, rightClickSelectsWord: n2.isMac, windowOptions: {}, windowsMode: !1, windowsPty: {}, wordSeparator: " ()[]{}',\"`", altClickMovesCursor: !0, convertEol: !1, termName: "xterm", cancelEvents: !1, overviewRulerWidth: 0 };
2954
+ let a = ["normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900"];
2955
+ class o extends r2.Disposable {
2956
+ constructor(e3) {
2957
+ super(), this._onOptionChange = this.register(new s2.EventEmitter()), this.onOptionChange = this._onOptionChange.event;
2958
+ let i3 = { ...t2.DEFAULT_OPTIONS };
2959
+ for (let t3 in e3) if (t3 in i3) try {
2960
+ let s3 = e3[t3];
2961
+ i3[t3] = this._sanitizeAndValidateOption(t3, s3);
2962
+ } catch (e4) {
2963
+ console.error(e4);
2964
+ }
2965
+ this.rawOptions = i3, this.options = { ...i3 }, this._setupOptions(), this.register((0, r2.toDisposable)((() => {
2966
+ this.rawOptions.linkHandler = null, this.rawOptions.documentOverride = null;
2967
+ })));
2968
+ }
2969
+ onSpecificOptionChange(e3, t3) {
2970
+ return this.onOptionChange(((i3) => {
2971
+ i3 === e3 && t3(this.rawOptions[e3]);
2972
+ }));
2973
+ }
2974
+ onMultipleOptionChange(e3, t3) {
2975
+ return this.onOptionChange(((i3) => {
2976
+ e3.indexOf(i3) !== -1 && t3();
2977
+ }));
2978
+ }
2979
+ _setupOptions() {
2980
+ let e3 = (e4) => {
2981
+ if (!(e4 in t2.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e4}"`);
2982
+ return this.rawOptions[e4];
2983
+ }, i3 = (e4, i4) => {
2984
+ if (!(e4 in t2.DEFAULT_OPTIONS)) throw new Error(`No option with key "${e4}"`);
2985
+ i4 = this._sanitizeAndValidateOption(e4, i4), this.rawOptions[e4] !== i4 && (this.rawOptions[e4] = i4, this._onOptionChange.fire(e4));
2986
+ };
2987
+ for (let t3 in this.rawOptions) {
2988
+ let s3 = { get: e3.bind(this, t3), set: i3.bind(this, t3) };
2989
+ Object.defineProperty(this.options, t3, s3);
2990
+ }
2991
+ }
2992
+ _sanitizeAndValidateOption(e3, i3) {
2993
+ switch (e3) {
2994
+ case "cursorStyle":
2995
+ if (i3 || (i3 = t2.DEFAULT_OPTIONS[e3]), !/* @__PURE__ */ (function(e4) {
2996
+ return e4 === "block" || e4 === "underline" || e4 === "bar";
2997
+ })(i3)) throw new Error(`"${i3}" is not a valid value for ${e3}`);
2998
+ break;
2999
+ case "wordSeparator":
3000
+ i3 || (i3 = t2.DEFAULT_OPTIONS[e3]);
3001
+ break;
3002
+ case "fontWeight":
3003
+ case "fontWeightBold":
3004
+ if (typeof i3 == "number" && 1 <= i3 && i3 <= 1e3) break;
3005
+ i3 = a.includes(i3) ? i3 : t2.DEFAULT_OPTIONS[e3];
3006
+ break;
3007
+ case "cursorWidth":
3008
+ i3 = Math.floor(i3);
3009
+ case "lineHeight":
3010
+ case "tabStopWidth":
3011
+ if (i3 < 1) throw new Error(`${e3} cannot be less than 1, value: ${i3}`);
3012
+ break;
3013
+ case "minimumContrastRatio":
3014
+ i3 = Math.max(1, Math.min(21, Math.round(10 * i3) / 10));
3015
+ break;
3016
+ case "scrollback":
3017
+ if ((i3 = Math.min(i3, 4294967295)) < 0) throw new Error(`${e3} cannot be less than 0, value: ${i3}`);
3018
+ break;
3019
+ case "fastScrollSensitivity":
3020
+ case "scrollSensitivity":
3021
+ if (i3 <= 0) throw new Error(`${e3} cannot be less than or equal to 0, value: ${i3}`);
3022
+ break;
3023
+ case "rows":
3024
+ case "cols":
3025
+ if (!i3 && i3 !== 0) throw new Error(`${e3} must be numeric, value: ${i3}`);
3026
+ break;
3027
+ case "windowsPty":
3028
+ i3 = i3 ?? {};
3029
+ }
3030
+ return i3;
3031
+ }
3032
+ }
3033
+ t2.OptionsService = o;
3034
+ }, 660: function(e2, t2, i2) {
3035
+ var s2 = this && this.__decorate || function(e3, t3, i3, s3) {
3036
+ var r3, n3 = arguments.length, a2 = n3 < 3 ? t3 : s3 === null ? s3 = Object.getOwnPropertyDescriptor(t3, i3) : s3;
3037
+ if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a2 = Reflect.decorate(e3, t3, i3, s3);
3038
+ else for (var o = e3.length - 1; o >= 0; o--) (r3 = e3[o]) && (a2 = (n3 < 3 ? r3(a2) : n3 > 3 ? r3(t3, i3, a2) : r3(t3, i3)) || a2);
3039
+ return n3 > 3 && a2 && Object.defineProperty(t3, i3, a2), a2;
3040
+ }, r2 = this && this.__param || function(e3, t3) {
3041
+ return function(i3, s3) {
3042
+ t3(i3, s3, e3);
3043
+ };
3044
+ };
3045
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.OscLinkService = void 0;
3046
+ let n2 = i2(585), a = t2.OscLinkService = class {
3047
+ constructor(e3) {
3048
+ this._bufferService = e3, this._nextId = 1, this._entriesWithId = /* @__PURE__ */ new Map(), this._dataByLinkId = /* @__PURE__ */ new Map();
3049
+ }
3050
+ registerLink(e3) {
3051
+ let t3 = this._bufferService.buffer;
3052
+ if (e3.id === void 0) {
3053
+ let i4 = t3.addMarker(t3.ybase + t3.y), s4 = { data: e3, id: this._nextId++, lines: [i4] };
3054
+ return i4.onDispose((() => this._removeMarkerFromLink(s4, i4))), this._dataByLinkId.set(s4.id, s4), s4.id;
3055
+ }
3056
+ let i3 = e3, s3 = this._getEntryIdKey(i3), r3 = this._entriesWithId.get(s3);
3057
+ if (r3) return this.addLineToLink(r3.id, t3.ybase + t3.y), r3.id;
3058
+ let n3 = t3.addMarker(t3.ybase + t3.y), a2 = { id: this._nextId++, key: this._getEntryIdKey(i3), data: i3, lines: [n3] };
3059
+ return n3.onDispose((() => this._removeMarkerFromLink(a2, n3))), this._entriesWithId.set(a2.key, a2), this._dataByLinkId.set(a2.id, a2), a2.id;
3060
+ }
3061
+ addLineToLink(e3, t3) {
3062
+ let i3 = this._dataByLinkId.get(e3);
3063
+ if (i3 && i3.lines.every(((e4) => e4.line !== t3))) {
3064
+ let e4 = this._bufferService.buffer.addMarker(t3);
3065
+ i3.lines.push(e4), e4.onDispose((() => this._removeMarkerFromLink(i3, e4)));
3066
+ }
3067
+ }
3068
+ getLinkData(e3) {
3069
+ return this._dataByLinkId.get(e3)?.data;
3070
+ }
3071
+ _getEntryIdKey(e3) {
3072
+ return `${e3.id};;${e3.uri}`;
3073
+ }
3074
+ _removeMarkerFromLink(e3, t3) {
3075
+ let i3 = e3.lines.indexOf(t3);
3076
+ i3 !== -1 && (e3.lines.splice(i3, 1), e3.lines.length === 0 && (e3.data.id !== void 0 && this._entriesWithId.delete(e3.key), this._dataByLinkId.delete(e3.id)));
3077
+ }
3078
+ };
3079
+ t2.OscLinkService = a = s2([r2(0, n2.IBufferService)], a);
3080
+ }, 343: (e2, t2) => {
3081
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.createDecorator = t2.getServiceDependencies = t2.serviceRegistry = void 0;
3082
+ let i2 = "di$target", s2 = "di$dependencies";
3083
+ t2.serviceRegistry = /* @__PURE__ */ new Map(), t2.getServiceDependencies = function(e3) {
3084
+ return e3[s2] || [];
3085
+ }, t2.createDecorator = function(e3) {
3086
+ if (t2.serviceRegistry.has(e3)) return t2.serviceRegistry.get(e3);
3087
+ let r2 = function(e4, t3, n2) {
3088
+ if (arguments.length !== 3) throw new Error("@IServiceName-decorator can only be used to decorate a parameter");
3089
+ (function(e5, t4, r3) {
3090
+ t4[i2] === t4 ? t4[s2].push({ id: e5, index: r3 }) : (t4[s2] = [{ id: e5, index: r3 }], t4[i2] = t4);
3091
+ })(r2, e4, n2);
3092
+ };
3093
+ return r2.toString = () => e3, t2.serviceRegistry.set(e3, r2), r2;
3094
+ };
3095
+ }, 585: (e2, t2, i2) => {
3096
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.IDecorationService = t2.IUnicodeService = t2.IOscLinkService = t2.IOptionsService = t2.ILogService = t2.LogLevelEnum = t2.IInstantiationService = t2.ICharsetService = t2.ICoreService = t2.ICoreMouseService = t2.IBufferService = void 0;
3097
+ let s2 = i2(343);
3098
+ var r2;
3099
+ t2.IBufferService = (0, s2.createDecorator)("BufferService"), t2.ICoreMouseService = (0, s2.createDecorator)("CoreMouseService"), t2.ICoreService = (0, s2.createDecorator)("CoreService"), t2.ICharsetService = (0, s2.createDecorator)("CharsetService"), t2.IInstantiationService = (0, s2.createDecorator)("InstantiationService"), (function(e3) {
3100
+ e3[e3.TRACE = 0] = "TRACE", e3[e3.DEBUG = 1] = "DEBUG", e3[e3.INFO = 2] = "INFO", e3[e3.WARN = 3] = "WARN", e3[e3.ERROR = 4] = "ERROR", e3[e3.OFF = 5] = "OFF";
3101
+ })(r2 || (t2.LogLevelEnum = r2 = {})), t2.ILogService = (0, s2.createDecorator)("LogService"), t2.IOptionsService = (0, s2.createDecorator)("OptionsService"), t2.IOscLinkService = (0, s2.createDecorator)("OscLinkService"), t2.IUnicodeService = (0, s2.createDecorator)("UnicodeService"), t2.IDecorationService = (0, s2.createDecorator)("DecorationService");
3102
+ }, 480: (e2, t2, i2) => {
3103
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.UnicodeService = void 0;
3104
+ let s2 = i2(460), r2 = i2(225);
3105
+ class n2 {
3106
+ static extractShouldJoin(e3) {
3107
+ return (1 & e3) != 0;
3108
+ }
3109
+ static extractWidth(e3) {
3110
+ return e3 >> 1 & 3;
3111
+ }
3112
+ static extractCharKind(e3) {
3113
+ return e3 >> 3;
3114
+ }
3115
+ static createPropertyValue(e3, t3, i3 = !1) {
3116
+ return (16777215 & e3) << 3 | (3 & t3) << 1 | (i3 ? 1 : 0);
3117
+ }
3118
+ constructor() {
3119
+ this._providers = /* @__PURE__ */ Object.create(null), this._active = "", this._onChange = new s2.EventEmitter(), this.onChange = this._onChange.event;
3120
+ let e3 = new r2.UnicodeV6();
3121
+ this.register(e3), this._active = e3.version, this._activeProvider = e3;
3122
+ }
3123
+ dispose() {
3124
+ this._onChange.dispose();
3125
+ }
3126
+ get versions() {
3127
+ return Object.keys(this._providers);
3128
+ }
3129
+ get activeVersion() {
3130
+ return this._active;
3131
+ }
3132
+ set activeVersion(e3) {
3133
+ if (!this._providers[e3]) throw new Error(`unknown Unicode version "${e3}"`);
3134
+ this._active = e3, this._activeProvider = this._providers[e3], this._onChange.fire(e3);
3135
+ }
3136
+ register(e3) {
3137
+ this._providers[e3.version] = e3;
3138
+ }
3139
+ wcwidth(e3) {
3140
+ return this._activeProvider.wcwidth(e3);
3141
+ }
3142
+ getStringCellWidth(e3) {
3143
+ let t3 = 0, i3 = 0, s3 = e3.length;
3144
+ for (let r3 = 0; r3 < s3; ++r3) {
3145
+ let a = e3.charCodeAt(r3);
3146
+ if (55296 <= a && a <= 56319) {
3147
+ if (++r3 >= s3) return t3 + this.wcwidth(a);
3148
+ let i4 = e3.charCodeAt(r3);
3149
+ 56320 <= i4 && i4 <= 57343 ? a = 1024 * (a - 55296) + i4 - 56320 + 65536 : t3 += this.wcwidth(i4);
3150
+ }
3151
+ let o = this.charProperties(a, i3), h = n2.extractWidth(o);
3152
+ n2.extractShouldJoin(o) && (h -= n2.extractWidth(i3)), t3 += h, i3 = o;
3153
+ }
3154
+ return t3;
3155
+ }
3156
+ charProperties(e3, t3) {
3157
+ return this._activeProvider.charProperties(e3, t3);
3158
+ }
3159
+ }
3160
+ t2.UnicodeService = n2;
3161
+ }, 781: (e2, t2, i2) => {
3162
+ Object.defineProperty(t2, "__esModule", { value: !0 }), t2.Terminal = void 0;
3163
+ let s2 = i2(437), r2 = i2(969), n2 = i2(460);
3164
+ class a extends r2.CoreTerminal {
3165
+ constructor(e3 = {}) {
3166
+ super(e3), this._onBell = this.register(new n2.EventEmitter()), this.onBell = this._onBell.event, this._onCursorMove = this.register(new n2.EventEmitter()), this.onCursorMove = this._onCursorMove.event, this._onTitleChange = this.register(new n2.EventEmitter()), this.onTitleChange = this._onTitleChange.event, this._onA11yCharEmitter = this.register(new n2.EventEmitter()), this.onA11yChar = this._onA11yCharEmitter.event, this._onA11yTabEmitter = this.register(new n2.EventEmitter()), this.onA11yTab = this._onA11yTabEmitter.event, this._setup(), this.register(this._inputHandler.onRequestBell((() => this.bell()))), this.register(this._inputHandler.onRequestReset((() => this.reset()))), this.register((0, n2.forwardEvent)(this._inputHandler.onCursorMove, this._onCursorMove)), this.register((0, n2.forwardEvent)(this._inputHandler.onTitleChange, this._onTitleChange)), this.register((0, n2.forwardEvent)(this._inputHandler.onA11yChar, this._onA11yCharEmitter)), this.register((0, n2.forwardEvent)(this._inputHandler.onA11yTab, this._onA11yTabEmitter));
3167
+ }
3168
+ get buffer() {
3169
+ return this.buffers.active;
3170
+ }
3171
+ get markers() {
3172
+ return this.buffer.markers;
3173
+ }
3174
+ addMarker(e3) {
3175
+ if (this.buffer === this.buffers.normal) return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + e3);
3176
+ }
3177
+ bell() {
3178
+ this._onBell.fire();
3179
+ }
3180
+ input(e3, t3 = !0) {
3181
+ this.coreService.triggerDataEvent(e3, t3);
3182
+ }
3183
+ resize(e3, t3) {
3184
+ e3 === this.cols && t3 === this.rows || super.resize(e3, t3);
3185
+ }
3186
+ clear() {
3187
+ if (this.buffer.ybase !== 0 || this.buffer.y !== 0) {
3188
+ 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;
3189
+ for (let e3 = 1; e3 < this.rows; e3++) this.buffer.lines.push(this.buffer.getBlankLine(s2.DEFAULT_ATTR_DATA));
3190
+ this._onScroll.fire({ position: this.buffer.ydisp, source: 0 });
3191
+ }
3192
+ }
3193
+ reset() {
3194
+ this.options.rows = this.rows, this.options.cols = this.cols, this._setup(), super.reset();
3195
+ }
3196
+ }
3197
+ t2.Terminal = a;
3198
+ } }, t = {};
3199
+ function i(s2) {
3200
+ var r2 = t[s2];
3201
+ if (r2 !== void 0) return r2.exports;
3202
+ var n2 = t[s2] = { exports: {} };
3203
+ return e[s2].call(n2.exports, n2, n2.exports, i), n2.exports;
3204
+ }
3205
+ var s = {};
3206
+ (() => {
3207
+ var e2 = s;
3208
+ Object.defineProperty(e2, "__esModule", { value: !0 }), e2.Terminal = void 0;
3209
+ let t2 = i(285), r2 = i(975), n2 = i(90), a = i(781), o = i(741), h = i(844), c = ["cols", "rows"];
3210
+ class l extends h.Disposable {
3211
+ constructor(e3) {
3212
+ super(), this._core = this.register(new a.Terminal(e3)), this._addonManager = this.register(new o.AddonManager()), this._publicOptions = { ...this._core.options };
3213
+ let t3 = (e4) => this._core.options[e4], i2 = (e4, t4) => {
3214
+ this._checkReadonlyOptions(e4), this._core.options[e4] = t4;
3215
+ };
3216
+ for (let e4 in this._core.options) {
3217
+ Object.defineProperty(this._publicOptions, e4, { get: () => this._core.options[e4], set: (t4) => {
3218
+ this._checkReadonlyOptions(e4), this._core.options[e4] = t4;
3219
+ } });
3220
+ let s2 = { get: t3.bind(this, e4), set: i2.bind(this, e4) };
3221
+ Object.defineProperty(this._publicOptions, e4, s2);
3222
+ }
3223
+ }
3224
+ _checkReadonlyOptions(e3) {
3225
+ if (c.includes(e3)) throw new Error(`Option "${e3}" can only be set in the constructor`);
3226
+ }
3227
+ _checkProposedApi() {
3228
+ if (!this._core.optionsService.options.allowProposedApi) throw new Error("You must set the allowProposedApi option to true to use proposed API");
3229
+ }
3230
+ get onBell() {
3231
+ return this._core.onBell;
3232
+ }
3233
+ get onBinary() {
3234
+ return this._core.onBinary;
3235
+ }
3236
+ get onCursorMove() {
3237
+ return this._core.onCursorMove;
3238
+ }
3239
+ get onData() {
3240
+ return this._core.onData;
3241
+ }
3242
+ get onLineFeed() {
3243
+ return this._core.onLineFeed;
3244
+ }
3245
+ get onResize() {
3246
+ return this._core.onResize;
3247
+ }
3248
+ get onScroll() {
3249
+ return this._core.onScroll;
3250
+ }
3251
+ get onTitleChange() {
3252
+ return this._core.onTitleChange;
3253
+ }
3254
+ get parser() {
3255
+ return this._checkProposedApi(), this._parser || (this._parser = new r2.ParserApi(this._core)), this._parser;
3256
+ }
3257
+ get unicode() {
3258
+ return this._checkProposedApi(), new n2.UnicodeApi(this._core);
3259
+ }
3260
+ get rows() {
3261
+ return this._core.rows;
3262
+ }
3263
+ get cols() {
3264
+ return this._core.cols;
3265
+ }
3266
+ get buffer() {
3267
+ return this._checkProposedApi(), this._buffer || (this._buffer = this.register(new t2.BufferNamespaceApi(this._core))), this._buffer;
3268
+ }
3269
+ get markers() {
3270
+ return this._checkProposedApi(), this._core.markers;
3271
+ }
3272
+ get modes() {
3273
+ let e3 = this._core.coreService.decPrivateModes, t3 = "none";
3274
+ switch (this._core.coreMouseService.activeProtocol) {
3275
+ case "X10":
3276
+ t3 = "x10";
3277
+ break;
3278
+ case "VT200":
3279
+ t3 = "vt200";
3280
+ break;
3281
+ case "DRAG":
3282
+ t3 = "drag";
3283
+ break;
3284
+ case "ANY":
3285
+ t3 = "any";
3286
+ }
3287
+ return { applicationCursorKeysMode: e3.applicationCursorKeys, applicationKeypadMode: e3.applicationKeypad, bracketedPasteMode: e3.bracketedPasteMode, insertMode: this._core.coreService.modes.insertMode, mouseTrackingMode: t3, originMode: e3.origin, reverseWraparoundMode: e3.reverseWraparound, sendFocusMode: e3.sendFocus, wraparoundMode: e3.wraparound };
3288
+ }
3289
+ get options() {
3290
+ return this._publicOptions;
3291
+ }
3292
+ set options(e3) {
3293
+ for (let t3 in e3) this._publicOptions[t3] = e3[t3];
3294
+ }
3295
+ input(e3, t3 = !0) {
3296
+ this._core.input(e3, t3);
3297
+ }
3298
+ resize(e3, t3) {
3299
+ this._verifyIntegers(e3, t3), this._core.resize(e3, t3);
3300
+ }
3301
+ registerMarker(e3 = 0) {
3302
+ return this._checkProposedApi(), this._verifyIntegers(e3), this._core.addMarker(e3);
3303
+ }
3304
+ addMarker(e3) {
3305
+ return this.registerMarker(e3);
3306
+ }
3307
+ dispose() {
3308
+ super.dispose();
3309
+ }
3310
+ scrollLines(e3) {
3311
+ this._verifyIntegers(e3), this._core.scrollLines(e3);
3312
+ }
3313
+ scrollPages(e3) {
3314
+ this._verifyIntegers(e3), this._core.scrollPages(e3);
3315
+ }
3316
+ scrollToTop() {
3317
+ this._core.scrollToTop();
3318
+ }
3319
+ scrollToBottom() {
3320
+ this._core.scrollToBottom();
3321
+ }
3322
+ scrollToLine(e3) {
3323
+ this._verifyIntegers(e3), this._core.scrollToLine(e3);
3324
+ }
3325
+ clear() {
3326
+ this._core.clear();
3327
+ }
3328
+ write(e3, t3) {
3329
+ this._core.write(e3, t3);
3330
+ }
3331
+ writeln(e3, t3) {
3332
+ this._core.write(e3), this._core.write(`\r
3333
+ `, t3);
3334
+ }
3335
+ reset() {
3336
+ this._core.reset();
3337
+ }
3338
+ loadAddon(e3) {
3339
+ this._addonManager.loadAddon(this, e3);
3340
+ }
3341
+ _verifyIntegers(...e3) {
3342
+ for (let t3 of e3) if (t3 === 1 / 0 || isNaN(t3) || t3 % 1 != 0) throw new Error("This API only accepts integers");
3343
+ }
3344
+ }
3345
+ e2.Terminal = l;
3346
+ })();
3347
+ var r = exports;
3348
+ for (var n in s) r[n] = s[n];
3349
+ s.__esModule && Object.defineProperty(r, "__esModule", { value: !0 });
3350
+ })();
3351
+ }
3352
+ });
3353
+ export default require_xterm_headless();