@gilav21/shadcn-angular-rte 0.1.1

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.
@@ -0,0 +1,290 @@
1
+ /**
2
+ * A growable byte buffer with a hard ceiling, for decoders that produce output
3
+ * of unknown length.
4
+ *
5
+ * Every decoder here used to accumulate into a `number[]` and convert at the
6
+ * end. That representation costs 4-8 bytes per output byte, so a "256 MB"
7
+ * decompression ceiling let a hostile stream take 1-2 GB of memory before the
8
+ * guard tripped -- the bomb was stopped after it had done its damage. A typed
9
+ * array costs one byte per byte, doubles as it grows, and refuses the write
10
+ * that would cross the ceiling before allocating for it.
11
+ */
12
+ class ByteSink {
13
+ /**
14
+ * @param maxBytes Largest output permitted; a write past it throws. Omit
15
+ * for no ceiling.
16
+ * @param initialCapacity Starting allocation, doubled on demand.
17
+ */
18
+ constructor(maxBytes = Number.POSITIVE_INFINITY, initialCapacity = 4096) {
19
+ this.maxBytes = maxBytes;
20
+ this.size = 0;
21
+ this.buffer = new Uint8Array(Math.max(16, Math.min(initialCapacity, this.capacityCap())));
22
+ }
23
+ /** Bytes written so far. */
24
+ get length() {
25
+ return this.size;
26
+ }
27
+ /** The byte at `index`, which must already have been written. */
28
+ at(index) {
29
+ return this.buffer[index];
30
+ }
31
+ push(byte) {
32
+ this.ensure(1);
33
+ this.buffer[this.size++] = byte;
34
+ }
35
+ pushSlice(bytes) {
36
+ this.ensure(bytes.length);
37
+ this.buffer.set(bytes, this.size);
38
+ this.size += bytes.length;
39
+ }
40
+ /**
41
+ * Append `length` bytes copied from `distance` bytes back -- the DEFLATE
42
+ * back-reference. Copied one byte at a time on purpose: when `length`
43
+ * exceeds `distance` the source overlaps the bytes being written, which is
44
+ * how a run is expressed, and a block copy would read stale data.
45
+ */
46
+ copyBack(distance, length) {
47
+ const start = this.size - distance;
48
+ if (start < 0)
49
+ throw new Error('Invalid back-reference distance');
50
+ this.ensure(length);
51
+ for (let i = 0; i < length; i++) {
52
+ this.buffer[this.size + i] = this.buffer[start + i];
53
+ }
54
+ this.size += length;
55
+ }
56
+ /** The bytes written, as an exact-length view over a fresh array. */
57
+ toUint8Array() {
58
+ return this.buffer.slice(0, this.size);
59
+ }
60
+ capacityCap() {
61
+ return Number.isFinite(this.maxBytes) ? this.maxBytes : Number.MAX_SAFE_INTEGER;
62
+ }
63
+ ensure(extra) {
64
+ const needed = this.size + extra;
65
+ if (needed > this.maxBytes) {
66
+ throw new Error(`Decompressed data exceeds the maximum allowed size of ${this.maxBytes} bytes`);
67
+ }
68
+ if (needed <= this.buffer.length)
69
+ return;
70
+ let capacity = this.buffer.length;
71
+ while (capacity < needed)
72
+ capacity *= 2;
73
+ const grown = new Uint8Array(Math.min(capacity, this.capacityCap()));
74
+ grown.set(this.buffer.subarray(0, this.size));
75
+ this.buffer = grown;
76
+ }
77
+ }
78
+
79
+ const LENGTH_EXTRA_BITS = [
80
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
81
+ ];
82
+ const LENGTH_BASE = [
83
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59,
84
+ 67, 83, 99, 115, 131, 163, 195, 227, 258
85
+ ];
86
+ const DIST_EXTRA_BITS = [
87
+ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13
88
+ ];
89
+ const DIST_BASE = [
90
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
91
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
92
+ ];
93
+ const CL_ORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
94
+ class BitReader {
95
+ constructor(data) {
96
+ this.pos = 0;
97
+ this.bitBuf = 0;
98
+ this.bitCount = 0;
99
+ this.data = data;
100
+ }
101
+ bits(n) {
102
+ while (this.bitCount < n) {
103
+ if (this.pos >= this.data.length)
104
+ throw new Error('Unexpected end of deflate stream');
105
+ this.bitBuf |= this.data[this.pos++] << this.bitCount;
106
+ this.bitCount += 8;
107
+ }
108
+ const val = this.bitBuf & ((1 << n) - 1);
109
+ this.bitBuf >>>= n;
110
+ this.bitCount -= n;
111
+ return val;
112
+ }
113
+ alignByte() {
114
+ this.bitBuf = 0;
115
+ this.bitCount = 0;
116
+ }
117
+ readByte() {
118
+ if (this.pos >= this.data.length)
119
+ throw new Error('Unexpected end of deflate stream');
120
+ return this.data[this.pos++];
121
+ }
122
+ readU16LE() {
123
+ const lo = this.readByte();
124
+ const hi = this.readByte();
125
+ return lo | (hi << 8);
126
+ }
127
+ }
128
+ function buildHuffmanTable(codeLengths, maxSymbol) {
129
+ let maxBits = 0;
130
+ for (let i = 0; i < maxSymbol; i++) {
131
+ if (codeLengths[i] > maxBits)
132
+ maxBits = codeLengths[i];
133
+ }
134
+ const counts = new Uint16Array(maxBits + 1);
135
+ for (let i = 0; i < maxSymbol; i++) {
136
+ if (codeLengths[i])
137
+ counts[codeLengths[i]]++;
138
+ }
139
+ const offsets = new Uint16Array(maxBits + 1);
140
+ for (let i = 1; i <= maxBits; i++) {
141
+ offsets[i] = offsets[i - 1] + counts[i - 1];
142
+ }
143
+ const symbols = new Uint16Array(offsets[maxBits] + counts[maxBits]);
144
+ for (let i = 0; i < maxSymbol; i++) {
145
+ if (codeLengths[i]) {
146
+ symbols[offsets[codeLengths[i]]++] = i;
147
+ }
148
+ }
149
+ return { counts, symbols };
150
+ }
151
+ function decodeSymbol(reader, table) {
152
+ let code = 0;
153
+ let first = 0;
154
+ let index = 0;
155
+ for (let len = 1; len < table.counts.length; len++) {
156
+ code |= reader.bits(1);
157
+ const count = table.counts[len];
158
+ if (code < first + count) {
159
+ return table.symbols[index + (code - first)];
160
+ }
161
+ index += count;
162
+ first = (first + count) << 1;
163
+ code <<= 1;
164
+ }
165
+ throw new Error('Invalid Huffman code');
166
+ }
167
+ function buildFixedLitTable() {
168
+ const lengths = new Uint8Array(288);
169
+ for (let i = 0; i <= 143; i++)
170
+ lengths[i] = 8;
171
+ for (let i = 144; i <= 255; i++)
172
+ lengths[i] = 9;
173
+ for (let i = 256; i <= 279; i++)
174
+ lengths[i] = 7;
175
+ for (let i = 280; i <= 287; i++)
176
+ lengths[i] = 8;
177
+ return buildHuffmanTable(lengths, 288);
178
+ }
179
+ function buildFixedDistTable() {
180
+ const lengths = new Uint8Array(32);
181
+ for (let i = 0; i < 32; i++)
182
+ lengths[i] = 5;
183
+ return buildHuffmanTable(lengths, 32);
184
+ }
185
+ const FIXED_LIT_TABLE = buildFixedLitTable();
186
+ const FIXED_DIST_TABLE = buildFixedDistTable();
187
+ function inflateStoredBlock(reader, output) {
188
+ reader.alignByte();
189
+ const len = reader.readU16LE();
190
+ reader.readU16LE();
191
+ for (let i = 0; i < len; i++) {
192
+ output.push(reader.readByte());
193
+ }
194
+ }
195
+ function fillRepeatLengths(allLengths, startIdx, count, value) {
196
+ let idx = startIdx;
197
+ for (let r = 0; r < count; r++) {
198
+ allLengths[idx++] = value;
199
+ }
200
+ return idx;
201
+ }
202
+ function decodeLengthSymbol(reader, clTable, allLengths, idx) {
203
+ const sym = decodeSymbol(reader, clTable);
204
+ if (sym < 16) {
205
+ allLengths[idx++] = sym;
206
+ return idx;
207
+ }
208
+ if (sym === 16) {
209
+ const rep = reader.bits(2) + 3;
210
+ const prev = idx > 0 ? allLengths[idx - 1] : 0;
211
+ return fillRepeatLengths(allLengths, idx, rep, prev);
212
+ }
213
+ const rep = sym === 17 ? reader.bits(3) + 3 : reader.bits(7) + 11;
214
+ return fillRepeatLengths(allLengths, idx, rep, 0);
215
+ }
216
+ function buildDynamicTables(reader) {
217
+ const hlit = reader.bits(5) + 257;
218
+ const hdist = reader.bits(5) + 1;
219
+ const hclen = reader.bits(4) + 4;
220
+ const clLengths = new Uint8Array(19);
221
+ for (let i = 0; i < hclen; i++) {
222
+ clLengths[CL_ORDER[i]] = reader.bits(3);
223
+ }
224
+ const clTable = buildHuffmanTable(clLengths, 19);
225
+ const allLengths = new Uint8Array(hlit + hdist);
226
+ let i = 0;
227
+ while (i < hlit + hdist) {
228
+ i = decodeLengthSymbol(reader, clTable, allLengths, i);
229
+ }
230
+ const litLengths = allLengths.slice(0, hlit);
231
+ const distLengths = allLengths.slice(hlit);
232
+ return {
233
+ litTable: buildHuffmanTable(litLengths, hlit),
234
+ distTable: buildHuffmanTable(distLengths, hdist),
235
+ };
236
+ }
237
+ function inflateCompressedBlock(reader, output, litTable, distTable) {
238
+ for (;;) {
239
+ const sym = decodeSymbol(reader, litTable);
240
+ if (sym === 256)
241
+ break;
242
+ if (sym < 256) {
243
+ output.push(sym);
244
+ continue;
245
+ }
246
+ const lengthIdx = sym - 257;
247
+ const length = LENGTH_BASE[lengthIdx] + reader.bits(LENGTH_EXTRA_BITS[lengthIdx]);
248
+ const distSym = decodeSymbol(reader, distTable);
249
+ const distance = DIST_BASE[distSym] + reader.bits(DIST_EXTRA_BITS[distSym]);
250
+ output.copyBack(distance, length);
251
+ }
252
+ }
253
+ function inflate(compressed, options) {
254
+ const reader = new BitReader(compressed);
255
+ // A typed sink, not a number[]: at 4-8 bytes per element a "256 MB" ceiling
256
+ // let a bomb take over a gigabyte before it tripped. The sink refuses the
257
+ // write that would cross the ceiling before allocating for it.
258
+ const output = new ByteSink(options?.maxOutputBytes);
259
+ let finalBlock = false;
260
+ while (!finalBlock) {
261
+ finalBlock = reader.bits(1) === 1;
262
+ const blockType = reader.bits(2);
263
+ if (blockType === 0) {
264
+ inflateStoredBlock(reader, output);
265
+ }
266
+ else if (blockType === 1) {
267
+ inflateCompressedBlock(reader, output, FIXED_LIT_TABLE, FIXED_DIST_TABLE);
268
+ }
269
+ else if (blockType === 2) {
270
+ const { litTable, distTable } = buildDynamicTables(reader);
271
+ inflateCompressedBlock(reader, output, litTable, distTable);
272
+ }
273
+ else {
274
+ throw new Error('Invalid deflate block type');
275
+ }
276
+ }
277
+ return output.toUint8Array();
278
+ }
279
+ function zlibInflate(data, options) {
280
+ if (data.length < 2)
281
+ return data;
282
+ const cmf = data[0];
283
+ const cm = cmf & 0x0f;
284
+ if (cm !== 8)
285
+ return inflate(data, options);
286
+ return inflate(data.subarray(2), options);
287
+ }
288
+
289
+ export { ByteSink as B, inflate as i, zlibInflate as z };
290
+ //# sourceMappingURL=gilav21-shadcn-angular-rte-inflate-laXxypva.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gilav21-shadcn-angular-rte-inflate-laXxypva.mjs","sources":["../../../packages/rte-package/src/lib/parsers/byte-sink.ts","../../../packages/rte-package/src/lib/parsers/inflate.ts"],"sourcesContent":["/**\n * A growable byte buffer with a hard ceiling, for decoders that produce output\n * of unknown length.\n *\n * Every decoder here used to accumulate into a `number[]` and convert at the\n * end. That representation costs 4-8 bytes per output byte, so a \"256 MB\"\n * decompression ceiling let a hostile stream take 1-2 GB of memory before the\n * guard tripped -- the bomb was stopped after it had done its damage. A typed\n * array costs one byte per byte, doubles as it grows, and refuses the write\n * that would cross the ceiling before allocating for it.\n */\nexport class ByteSink {\n private buffer: Uint8Array;\n private size = 0;\n\n /**\n * @param maxBytes Largest output permitted; a write past it throws. Omit\n * for no ceiling.\n * @param initialCapacity Starting allocation, doubled on demand.\n */\n constructor(\n private readonly maxBytes: number = Number.POSITIVE_INFINITY,\n initialCapacity = 4096,\n ) {\n this.buffer = new Uint8Array(Math.max(16, Math.min(initialCapacity, this.capacityCap())));\n }\n\n /** Bytes written so far. */\n get length(): number {\n return this.size;\n }\n\n /** The byte at `index`, which must already have been written. */\n at(index: number): number {\n return this.buffer[index];\n }\n\n push(byte: number): void {\n this.ensure(1);\n this.buffer[this.size++] = byte;\n }\n\n pushSlice(bytes: ArrayLike<number>): void {\n this.ensure(bytes.length);\n this.buffer.set(bytes, this.size);\n this.size += bytes.length;\n }\n\n /**\n * Append `length` bytes copied from `distance` bytes back -- the DEFLATE\n * back-reference. Copied one byte at a time on purpose: when `length`\n * exceeds `distance` the source overlaps the bytes being written, which is\n * how a run is expressed, and a block copy would read stale data.\n */\n copyBack(distance: number, length: number): void {\n const start = this.size - distance;\n if (start < 0) throw new Error('Invalid back-reference distance');\n this.ensure(length);\n for (let i = 0; i < length; i++) {\n this.buffer[this.size + i] = this.buffer[start + i];\n }\n this.size += length;\n }\n\n /** The bytes written, as an exact-length view over a fresh array. */\n toUint8Array(): Uint8Array {\n return this.buffer.slice(0, this.size);\n }\n\n private capacityCap(): number {\n return Number.isFinite(this.maxBytes) ? this.maxBytes : Number.MAX_SAFE_INTEGER;\n }\n\n private ensure(extra: number): void {\n const needed = this.size + extra;\n if (needed > this.maxBytes) {\n throw new Error(\n `Decompressed data exceeds the maximum allowed size of ${this.maxBytes} bytes`,\n );\n }\n if (needed <= this.buffer.length) return;\n\n let capacity = this.buffer.length;\n while (capacity < needed) capacity *= 2;\n const grown = new Uint8Array(Math.min(capacity, this.capacityCap()));\n grown.set(this.buffer.subarray(0, this.size));\n this.buffer = grown;\n }\n}\n","import { ByteSink } from './byte-sink';\n\nconst LENGTH_EXTRA_BITS = [\n 0,0,0,0,0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3, 4,4,4,4, 5,5,5,5, 0\n];\nconst LENGTH_BASE = [\n 3,4,5,6,7,8,9,10, 11,13,15,17, 19,23,27,31, 35,43,51,59,\n 67,83,99,115, 131,163,195,227, 258\n];\nconst DIST_EXTRA_BITS = [\n 0,0,0,0, 1,1,2,2, 3,3,4,4, 5,5,6,6, 7,7,8,8, 9,9,10,10, 11,11,12,12, 13,13\n];\nconst DIST_BASE = [\n 1,2,3,4, 5,7,9,13, 17,25,33,49, 65,97,129,193,\n 257,385,513,769, 1025,1537,2049,3073, 4097,6145,8193,12289, 16385,24577\n];\nconst CL_ORDER = [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n\nclass BitReader {\n private readonly data: Uint8Array;\n private pos = 0;\n private bitBuf = 0;\n private bitCount = 0;\n\n constructor(data: Uint8Array) {\n this.data = data;\n }\n\n bits(n: number): number {\n while (this.bitCount < n) {\n if (this.pos >= this.data.length) throw new Error('Unexpected end of deflate stream');\n this.bitBuf |= this.data[this.pos++] << this.bitCount;\n this.bitCount += 8;\n }\n const val = this.bitBuf & ((1 << n) - 1);\n this.bitBuf >>>= n;\n this.bitCount -= n;\n return val;\n }\n\n alignByte(): void {\n this.bitBuf = 0;\n this.bitCount = 0;\n }\n\n readByte(): number {\n if (this.pos >= this.data.length) throw new Error('Unexpected end of deflate stream');\n return this.data[this.pos++];\n }\n\n readU16LE(): number {\n const lo = this.readByte();\n const hi = this.readByte();\n return lo | (hi << 8);\n }\n}\n\ninterface HuffmanTable {\n readonly counts: Uint16Array;\n readonly symbols: Uint16Array;\n}\n\nfunction buildHuffmanTable(codeLengths: Uint8Array, maxSymbol: number): HuffmanTable {\n let maxBits = 0;\n for (let i = 0; i < maxSymbol; i++) {\n if (codeLengths[i] > maxBits) maxBits = codeLengths[i];\n }\n const counts = new Uint16Array(maxBits + 1);\n for (let i = 0; i < maxSymbol; i++) {\n if (codeLengths[i]) counts[codeLengths[i]]++;\n }\n const offsets = new Uint16Array(maxBits + 1);\n for (let i = 1; i <= maxBits; i++) {\n offsets[i] = offsets[i - 1] + counts[i - 1];\n }\n const symbols = new Uint16Array(offsets[maxBits] + counts[maxBits]);\n for (let i = 0; i < maxSymbol; i++) {\n if (codeLengths[i]) {\n symbols[offsets[codeLengths[i]]++] = i;\n }\n }\n return { counts, symbols };\n}\n\nfunction decodeSymbol(reader: BitReader, table: HuffmanTable): number {\n let code = 0;\n let first = 0;\n let index = 0;\n for (let len = 1; len < table.counts.length; len++) {\n code |= reader.bits(1);\n const count = table.counts[len];\n if (code < first + count) {\n return table.symbols[index + (code - first)];\n }\n index += count;\n first = (first + count) << 1;\n code <<= 1;\n }\n throw new Error('Invalid Huffman code');\n}\n\nfunction buildFixedLitTable(): HuffmanTable {\n const lengths = new Uint8Array(288);\n for (let i = 0; i <= 143; i++) lengths[i] = 8;\n for (let i = 144; i <= 255; i++) lengths[i] = 9;\n for (let i = 256; i <= 279; i++) lengths[i] = 7;\n for (let i = 280; i <= 287; i++) lengths[i] = 8;\n return buildHuffmanTable(lengths, 288);\n}\n\nfunction buildFixedDistTable(): HuffmanTable {\n const lengths = new Uint8Array(32);\n for (let i = 0; i < 32; i++) lengths[i] = 5;\n return buildHuffmanTable(lengths, 32);\n}\n\nconst FIXED_LIT_TABLE = buildFixedLitTable();\nconst FIXED_DIST_TABLE = buildFixedDistTable();\n\n/** Options accepted by {@link inflate} and {@link zlibInflate}. */\nexport interface InflateOptions {\n /**\n * Maximum number of bytes the stream may decompress to. Omit for no limit.\n *\n * A DEFLATE stream's expansion ratio is unbounded, and a container's\n * declared uncompressed size is attacker-controlled metadata that says\n * nothing about what the stream actually produces — so callers handling\n * untrusted archives must bound the OUTPUT here rather than trust a header.\n * The ceiling is checked as the output grows, not afterwards, so a\n * decompression bomb is stopped while it inflates instead of after it has\n * already exhausted memory.\n */\n readonly maxOutputBytes?: number;\n}\n\nfunction inflateStoredBlock(reader: BitReader, output: ByteSink): void {\n reader.alignByte();\n const len = reader.readU16LE();\n reader.readU16LE();\n for (let i = 0; i < len; i++) {\n output.push(reader.readByte());\n }\n}\n\nfunction fillRepeatLengths(allLengths: Uint8Array, startIdx: number, count: number, value: number): number {\n let idx = startIdx;\n for (let r = 0; r < count; r++) {\n allLengths[idx++] = value;\n }\n return idx;\n}\n\nfunction decodeLengthSymbol(reader: BitReader, clTable: HuffmanTable, allLengths: Uint8Array, idx: number): number {\n const sym = decodeSymbol(reader, clTable);\n if (sym < 16) {\n allLengths[idx++] = sym;\n return idx;\n }\n if (sym === 16) {\n const rep = reader.bits(2) + 3;\n const prev = idx > 0 ? allLengths[idx - 1] : 0;\n return fillRepeatLengths(allLengths, idx, rep, prev);\n }\n const rep = sym === 17 ? reader.bits(3) + 3 : reader.bits(7) + 11;\n return fillRepeatLengths(allLengths, idx, rep, 0);\n}\n\nfunction buildDynamicTables(reader: BitReader): { litTable: HuffmanTable; distTable: HuffmanTable } {\n const hlit = reader.bits(5) + 257;\n const hdist = reader.bits(5) + 1;\n const hclen = reader.bits(4) + 4;\n const clLengths = new Uint8Array(19);\n for (let i = 0; i < hclen; i++) {\n clLengths[CL_ORDER[i]] = reader.bits(3);\n }\n const clTable = buildHuffmanTable(clLengths, 19);\n const allLengths = new Uint8Array(hlit + hdist);\n let i = 0;\n while (i < hlit + hdist) {\n i = decodeLengthSymbol(reader, clTable, allLengths, i);\n }\n const litLengths = allLengths.slice(0, hlit);\n const distLengths = allLengths.slice(hlit);\n return {\n litTable: buildHuffmanTable(litLengths, hlit),\n distTable: buildHuffmanTable(distLengths, hdist),\n };\n}\n\nfunction inflateCompressedBlock(\n reader: BitReader,\n output: ByteSink,\n litTable: HuffmanTable,\n distTable: HuffmanTable,\n): void {\n for (;;) {\n const sym = decodeSymbol(reader, litTable);\n if (sym === 256) break;\n if (sym < 256) {\n output.push(sym);\n continue;\n }\n const lengthIdx = sym - 257;\n const length = LENGTH_BASE[lengthIdx] + reader.bits(LENGTH_EXTRA_BITS[lengthIdx]);\n const distSym = decodeSymbol(reader, distTable);\n const distance = DIST_BASE[distSym] + reader.bits(DIST_EXTRA_BITS[distSym]);\n output.copyBack(distance, length);\n }\n}\n\nexport function inflate(compressed: Uint8Array, options?: InflateOptions): Uint8Array {\n const reader = new BitReader(compressed);\n // A typed sink, not a number[]: at 4-8 bytes per element a \"256 MB\" ceiling\n // let a bomb take over a gigabyte before it tripped. The sink refuses the\n // write that would cross the ceiling before allocating for it.\n const output = new ByteSink(options?.maxOutputBytes);\n let finalBlock = false;\n\n while (!finalBlock) {\n finalBlock = reader.bits(1) === 1;\n const blockType = reader.bits(2);\n\n if (blockType === 0) {\n inflateStoredBlock(reader, output);\n } else if (blockType === 1) {\n inflateCompressedBlock(reader, output, FIXED_LIT_TABLE, FIXED_DIST_TABLE);\n } else if (blockType === 2) {\n const { litTable, distTable } = buildDynamicTables(reader);\n inflateCompressedBlock(reader, output, litTable, distTable);\n } else {\n throw new Error('Invalid deflate block type');\n }\n }\n\n return output.toUint8Array();\n}\n\nexport function zlibInflate(data: Uint8Array, options?: InflateOptions): Uint8Array {\n if (data.length < 2) return data;\n const cmf = data[0];\n const cm = cmf & 0x0f;\n if (cm !== 8) return inflate(data, options);\n return inflate(data.subarray(2), options);\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;AAUG;MACU,QAAQ,CAAA;AAIjB;;;;AAIG;AACH,IAAA,WAAA,CACqB,WAAmB,MAAM,CAAC,iBAAiB,EAC5D,eAAe,GAAG,IAAI,EAAA;QADL,IAAA,CAAA,QAAQ,GAAR,QAAQ;QARrB,IAAA,CAAA,IAAI,GAAG,CAAC;QAWZ,IAAI,CAAC,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAC7F;;AAGA,IAAA,IAAI,MAAM,GAAA;QACN,OAAO,IAAI,CAAC,IAAI;IACpB;;AAGA,IAAA,EAAE,CAAC,KAAa,EAAA;AACZ,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;IAC7B;AAEA,IAAA,IAAI,CAAC,IAAY,EAAA;AACb,QAAA,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IACnC;AAEA,IAAA,SAAS,CAAC,KAAwB,EAAA;AAC9B,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;QACzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAA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