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AQuB,OAChBiD,qBAAsBA,EACtBN,cAAeA,IAEnBlE,EAAU,IAAI0C,EACdwB,EAAgB,SAjChCxZ,G","sources":["webpack://_N_E/./node_modules/@datadog/browser-rum/esm/domain/segmentCollection/deflateWorker.js"],"sourcesContent":["var workerURL;\nexport function createDeflateWorker() {\n // Lazily compute the worker URL to allow importing the SDK in NodeJS\n if (!workerURL) {\n workerURL = URL.createObjectURL(new Blob([\"(\".concat(workerCodeFn, \")(self)\")]));\n }\n return new Worker(workerURL);\n}\nfunction workerCodeFn() {\n monitor(function () {\n var _a = makePakoDeflate(), Deflate = _a.Deflate, constants = _a.constants, string2buf = _a.string2buf;\n var deflate = new Deflate();\n var rawBytesCount = 0;\n self.addEventListener('message', monitor(function (event) {\n var data = event.data;\n switch (data.action) {\n case 'init':\n self.postMessage({\n type: 'initialized',\n });\n break;\n case 'write': {\n var additionalBytesCount = pushData(data.data);\n self.postMessage({\n type: 'wrote',\n id: data.id,\n compressedBytesCount: deflate.chunks.reduce(function (total, chunk) { return total + chunk.length; }, 0),\n additionalBytesCount: additionalBytesCount,\n });\n break;\n }\n case 'flush': {\n var additionalBytesCount = data.data ? pushData(data.data) : 0;\n deflate.push('', constants.Z_FINISH);\n self.postMessage({\n type: 'flushed',\n id: data.id,\n result: deflate.result,\n additionalBytesCount: additionalBytesCount,\n rawBytesCount: rawBytesCount,\n });\n deflate = new Deflate();\n rawBytesCount = 0;\n break;\n }\n }\n }));\n function pushData(data) {\n // TextEncoder is not supported on old browser version like Edge 18, therefore we use string2buf\n var binaryData = string2buf(data);\n deflate.push(binaryData, constants.Z_SYNC_FLUSH);\n rawBytesCount += binaryData.length;\n return binaryData.length;\n }\n })();\n function monitor(fn) {\n return function () {\n try {\n return fn.apply(this, arguments);\n }\n catch (e) {\n try {\n self.postMessage({\n type: 'errored',\n error: e,\n });\n }\n catch (_) {\n // DATA_CLONE_ERR, cf https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n self.postMessage({\n type: 'errored',\n error: \"\".concat(e),\n });\n }\n }\n };\n }\n // https://github.com/nodeca/pako/blob/034669ba0f1a4c0590e45f7c2820128200f972b3/dist/pako_deflate.es5.js\n function makePakoDeflate() {\n /* eslint-disable camelcase, no-bitwise */\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n /* Public constants ========================================================== */\n /* =========================================================================== */\n // const Z_FILTERED = 1;\n // const Z_HUFFMAN_ONLY = 2;\n // const Z_RLE = 3;\n var Z_FIXED = 4; // const Z_DEFAULT_STRATEGY = 0;\n /* Possible values of the data_type field (though see inflate()) */\n var Z_BINARY = 0;\n var Z_TEXT = 1; // const Z_ASCII = 1; // = Z_TEXT\n var Z_UNKNOWN = 2;\n /* ============================================================================ */\n function zero(buf) {\n var len = buf.length;\n while (--len >= 0) {\n buf[len] = 0;\n }\n } // From zutil.h\n var STORED_BLOCK = 0;\n var STATIC_TREES = 1;\n var DYN_TREES = 2;\n /* The three kinds of block type */\n var MIN_MATCH = 3;\n var MAX_MATCH = 258;\n /* The minimum and maximum match lengths */\n // From deflate.h\n /* ===========================================================================\n * Internal compression state.\n */\n var LENGTH_CODES = 29;\n /* number of length codes, not counting the special END_BLOCK code */\n var LITERALS = 256;\n /* number of literal bytes 0..255 */\n var L_CODES = LITERALS + 1 + LENGTH_CODES;\n /* number of Literal or Length codes, including the END_BLOCK code */\n var D_CODES = 30;\n /* number of distance codes */\n var BL_CODES = 19;\n /* number of codes used to transfer the bit lengths */\n var HEAP_SIZE = 2 * L_CODES + 1;\n /* maximum heap size */\n var MAX_BITS = 15;\n /* All codes must not exceed MAX_BITS bits */\n var Buf_size = 16;\n /* size of bit buffer in bi_buf */\n /* ===========================================================================\n * Constants\n */\n var MAX_BL_BITS = 7;\n /* Bit length codes must not exceed MAX_BL_BITS bits */\n var END_BLOCK = 256;\n /* end of block literal code */\n var REP_3_6 = 16;\n /* repeat previous bit length 3-6 times (2 bits of repeat count) */\n var REPZ_3_10 = 17;\n /* repeat a zero length 3-10 times (3 bits of repeat count) */\n var REPZ_11_138 = 18;\n /* repeat a zero length 11-138 times (7 bits of repeat count) */\n var extra_lbits = \n /* extra bits for each length code */\n new Uint8Array([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 var extra_dbits = \n /* extra bits for each distance code */\n new Uint8Array([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 var extra_blbits = \n /* extra bits for each bit length code */\n new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]);\n var bl_order = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);\n /* eslint-enable comma-spacing,array-bracket-spacing */\n /* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n /* ===========================================================================\n * Local data. These are initialized only once.\n */\n // We pre-fill arrays with 0 to avoid uninitialized gaps\n var DIST_CODE_LEN = 512;\n /* see definition of array dist_code below */\n // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\n var static_ltree = new Array((L_CODES + 2) * 2);\n zero(static_ltree);\n /* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n var static_dtree = new Array(D_CODES * 2);\n zero(static_dtree);\n /* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n var _dist_code = new Array(DIST_CODE_LEN);\n zero(_dist_code);\n /* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\n zero(_length_code);\n /* length code for each normalized match length (0 == MIN_MATCH) */\n var base_length = new Array(LENGTH_CODES);\n zero(base_length);\n /* First normalized length for each code (0 = MIN_MATCH) */\n var base_dist = new Array(D_CODES);\n zero(base_dist);\n /* First normalized distance for each code (0 = distance of 1) */\n function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n this.static_tree = static_tree;\n /* static tree or NULL */\n this.extra_bits = extra_bits;\n /* extra bits for each code or NULL */\n this.extra_base = extra_base;\n /* base index for extra_bits */\n this.elems = elems;\n /* max number of elements in the tree */\n this.max_length = max_length;\n /* max bit length for the codes */\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n }\n var static_l_desc;\n var static_d_desc;\n var static_bl_desc;\n function TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree;\n /* the dynamic tree */\n this.max_code = 0;\n /* largest code with non zero frequency */\n this.stat_desc = stat_desc;\n /* the corresponding static tree */\n }\n var d_code = function d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n };\n /* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\n var put_short = function put_short(s, w) {\n // put_byte(s, (uch)((w) & 0xff));\n // put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = w & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n };\n /* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\n var send_bits = function send_bits(s, value, length) {\n if (s.bi_valid > Buf_size - length) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n }\n else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n };\n var send_code = function send_code(s, c, tree) {\n send_bits(s, tree[c * 2], \n /* .Code */\n tree[c * 2 + 1]\n /* .Len */\n );\n };\n /* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\n var bi_reverse = function bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n };\n /* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\n var bi_flush = function bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n }\n else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n };\n /* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\n var gen_bitlen = function gen_bitlen(s, desc // deflate_state *s; // tree_desc *desc; /* the tree descriptor */\n ) {\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h;\n /* heap index */\n var n;\n var m;\n /* iterate over the tree elements */\n var bits;\n /* bit length */\n var xbits;\n /* extra bits */\n var f;\n /* frequency */\n var overflow = 0;\n /* number of elements with bit length too large */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1] =\n /* .Len */\n 0;\n /* root of the heap */\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits =\n tree[tree[n * 2 + 1] *\n /* .Dad */\n 2 +\n 1] +\n /* .Len */\n 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1] =\n /* .Len */\n bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n if (n > max_code) {\n continue;\n }\n /* not a leaf node */\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2];\n /* .Freq */\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len +=\n f *\n (stree[n * 2 + 1] +\n /* .Len */\n xbits);\n }\n }\n if (overflow === 0) {\n return;\n } // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) {\n bits--;\n }\n s.bl_count[bits]--;\n /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2;\n /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) {\n continue;\n }\n if (tree[m * 2 + 1] !==\n /* .Len */\n bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len +=\n (bits - tree[m * 2 + 1]) *\n /* .Len */\n tree[m * 2];\n /* .Freq */\n tree[m * 2 + 1] =\n /* .Len */\n bits;\n }\n n--;\n }\n }\n };\n /* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\n var gen_codes = function gen_codes(tree, max_code, bl_count\n // ct_data *tree; /* the tree to decorate */\n // int max_code; /* largest code with non zero frequency */\n // ushf *bl_count; /* number of codes at each bit length */\n ) {\n var next_code = new Array(MAX_BITS + 1);\n /* next code value for each bit length */\n var code = 0;\n /* running code value */\n var bits;\n /* bit index */\n var n;\n /* code index */\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n // Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < 1 << extra_lbits[code]; n++) {\n _length_code[length++] = code;\n }\n } // Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < 1 << extra_dbits[code]; n++) {\n _dist_code[dist++] = code;\n }\n } // Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7;\n /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < 1 << (extra_dbits[code] - 7); n++) {\n _dist_code[256 + dist++] = code;\n }\n } // Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1] =\n /* .Len */\n 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1] =\n /* .Len */\n 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1] =\n /* .Len */\n 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1] =\n /* .Len */\n 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1] =\n /* .Len */\n 5;\n static_dtree[n * 2] =\n /* .Code */\n bi_reverse(n, 5);\n } // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n // static_init_done = true;\n };\n /* ===========================================================================\n * Initialize a new block.\n */\n var init_block = function init_block(s) {\n var n;\n /* iterates over tree elements */\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) {\n s.dyn_ltree[n * 2] =\n /* .Freq */\n 0;\n }\n for (n = 0; n < D_CODES; n++) {\n s.dyn_dtree[n * 2] =\n /* .Freq */\n 0;\n }\n for (n = 0; n < BL_CODES; n++) {\n s.bl_tree[n * 2] =\n /* .Freq */\n 0;\n }\n s.dyn_ltree[END_BLOCK * 2] =\n /* .Freq */\n 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n };\n /* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\n var bi_windup = function bi_windup(s) {\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n }\n else if (s.bi_valid > 0) {\n // put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n };\n /* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\n var copy_block = function copy_block(s, buf, len, header\n // DeflateState *s;\n // charf *buf; /* the input data */\n // unsigned len; /* its length */\n // int header; /* true if block header must be written */\n ) {\n bi_windup(s);\n /* align on byte boundary */\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n // while (len--) {\n // put_byte(s, *buf++);\n // }\n s.pending_buf.set(s.window.subarray(buf, buf + len), s.pending);\n s.pending += len;\n };\n /* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\n var smaller = function smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2] <\n /* .Freq */\n tree[_m2] ||\n /* .Freq */\n (tree[_n2] ===\n /* .Freq */\n tree[_m2] &&\n /* .Freq */\n depth[n] <= depth[m]));\n };\n /* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\n var pqdownheap = function pqdownheap(s, tree, k\n // deflate_state *s;\n // ct_data *tree; /* the tree to restore */\n // int k; /* node to move down */\n ) {\n var v = s.heap[k];\n var j = k << 1;\n /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) {\n break;\n }\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n }; // inlined manually\n // const SMALLEST = 1;\n /* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\n var compress_block = function compress_block(s, ltree, dtree\n // deflate_state *s;\n // const ct_data *ltree; /* literal tree */\n // const ct_data *dtree; /* distance tree */\n ) {\n var dist;\n /* distance of matched string */\n var lc;\n /* match length or unmatched char (if dist == 0) */\n var lx = 0;\n /* running index in l_buf */\n var code;\n /* the code to send */\n var extra;\n /* number of extra bits to send */\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | s.pending_buf[s.d_buf + lx * 2 + 1];\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n if (dist === 0) {\n send_code(s, lc, ltree);\n /* send a literal byte */\n // Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n }\n else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree);\n /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra);\n /* send the extra length bits */\n }\n dist--;\n /* dist is now the match distance - 1 */\n code = d_code(dist); // Assert (code < D_CODES, \"bad d_code\");\n send_code(s, code, dtree);\n /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra);\n /* send the extra distance bits */\n }\n }\n /* literal or match pair ? */\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n // Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n } while (lx < s.last_lit);\n }\n send_code(s, END_BLOCK, ltree);\n };\n /* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\n var build_tree = function build_tree(s, desc // deflate_state *s; // tree_desc *desc; /* the tree descriptor */\n ) {\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n;\n var m;\n /* iterate over heap elements */\n var max_code = -1;\n /* largest code with non zero frequency */\n var node;\n /* new node being created */\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n for (n = 0; n < elems; n++) {\n if (tree[n * 2] !==\n /* .Freq */\n 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n }\n else {\n tree[n * 2 + 1] =\n /* .Len */\n 0;\n }\n }\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;\n tree[node * 2] =\n /* .Freq */\n 1;\n s.depth[node] = 0;\n s.opt_len--;\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1];\n /* .Len */\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = s.heap_len >> 1; \n /* int /2 */\n n >= 1; n--) {\n pqdownheap(s, tree, n);\n }\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems;\n /* next internal node of the tree */\n do {\n // pqremove(s, tree, n); /* n = node of least frequency */\n /** * pqremove ** */\n n = s.heap[1];\n /* SMALLEST */\n s.heap[1] = s.heap[s.heap_len--];\n /* SMALLEST */\n pqdownheap(s, tree, 1\n /* SMALLEST */\n );\n /***/\n m = s.heap[1];\n /* SMALLEST */\n /* m = node of next least frequency */\n s.heap[--s.heap_max] = n;\n /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n /* Create a new node father of n and m */\n tree[node * 2] =\n /* .Freq */\n tree[n * 2] +\n /* .Freq */\n tree[m * 2];\n /* .Freq */\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1] =\n /* .Dad */\n tree[m * 2 + 1] =\n /* .Dad */\n node;\n /* and insert the new node in the heap */\n s.heap[1] = node++;\n /* SMALLEST */\n pqdownheap(s, tree, 1\n /* SMALLEST */\n );\n } while (s.heap_len >= 2);\n s.heap[--s.heap_max] = s.heap[1];\n /* SMALLEST */\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n };\n /* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\n var scan_tree = function scan_tree(s, tree, max_code\n // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n ) {\n var n;\n /* iterates over all tree elements */\n var prevlen = -1;\n /* last emitted length */\n var curlen;\n /* length of current code */\n var nextlen = tree[0 * 2 + 1];\n /* .Len */\n /* length of next code */\n var count = 0;\n /* repeat count of the current code */\n var max_count = 7;\n /* max repeat count */\n var min_count = 4;\n /* min repeat count */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1] =\n /* .Len */\n 0xffff;\n /* guard */\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1];\n /* .Len */\n if (++count < max_count && curlen === nextlen) {\n continue;\n }\n else if (count < min_count) {\n s.bl_tree[curlen * 2] +=\n /* .Freq */\n count;\n }\n else if (curlen !== 0) {\n if (curlen !== prevlen) {\n s.bl_tree[curlen * 2] /* .Freq */++;\n }\n s.bl_tree[REP_3_6 * 2] /* .Freq */++;\n }\n else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2] /* .Freq */++;\n }\n else {\n s.bl_tree[REPZ_11_138 * 2] /* .Freq */++;\n }\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n }\n else {\n max_count = 7;\n min_count = 4;\n }\n }\n };\n /* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\n var send_tree = function send_tree(s, tree, max_code\n // deflate_state *s;\n // ct_data *tree; /* the tree to be scanned */\n // int max_code; /* and its largest code of non zero frequency */\n ) {\n var n;\n /* iterates over all tree elements */\n var prevlen = -1;\n /* last emitted length */\n var curlen;\n /* length of current code */\n var nextlen = tree[0 * 2 + 1];\n /* .Len */\n /* length of next code */\n var count = 0;\n /* repeat count of the current code */\n var max_count = 7;\n /* max repeat count */\n var min_count = 4;\n /* min repeat count */\n /* tree[max_code+1].Len = -1; */\n /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1];\n /* .Len */\n if (++count < max_count && curlen === nextlen) {\n continue;\n }\n else if (count < min_count) {\n do {\n send_code(s, curlen, s.bl_tree);\n } while (--count !== 0);\n }\n else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n } // Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n }\n else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n }\n else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n }\n else {\n max_count = 7;\n min_count = 4;\n }\n }\n };\n /* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\n var build_bl_tree = function build_bl_tree(s) {\n var max_blindex;\n /* index of last bit length code of non zero freq */\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !==\n /* .Len */\n 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; // Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n return max_blindex;\n };\n /* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\n var send_all_trees = function send_all_trees(s, lcodes, dcodes, blcodes // deflate_state *s; // int lcodes, dcodes, blcodes; /* number of codes for each tree */\n ) {\n var rank;\n /* index in bl_order */\n // Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n // Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n // Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5);\n /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4);\n /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n // Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], \n /* .Len */\n 3);\n } // Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n send_tree(s, s.dyn_ltree, lcodes - 1);\n /* literal tree */\n // Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n send_tree(s, s.dyn_dtree, dcodes - 1);\n /* distance tree */\n // Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n };\n /* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\n var detect_data_type = function detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if (black_mask & 1 &&\n s.dyn_ltree[n * 2] !==\n /* .Freq */\n 0) {\n return Z_BINARY;\n }\n }\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2] !==\n /* .Freq */\n 0 ||\n s.dyn_ltree[10 * 2] !==\n /* .Freq */\n 0 ||\n s.dyn_ltree[13 * 2] !==\n /* .Freq */\n 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2] !==\n /* .Freq */\n 0) {\n return Z_TEXT;\n }\n }\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n };\n var static_init_done = false;\n /* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\n var _tr_init = function _tr_init(s) {\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n s.bi_buf = 0;\n s.bi_valid = 0;\n /* Initialize the first block of the first file: */\n init_block(s);\n };\n /* ===========================================================================\n * Send a stored block\n */\n var _tr_stored_block = function _tr_stored_block(s, buf, stored_len, last\n // DeflateState *s;\n // charf *buf; /* input block */\n // ulg stored_len; /* length of input block */\n // int last; /* one if this is the last block for a file */\n ) {\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);\n /* send block type */\n copy_block(s, buf, stored_len, true);\n /* with header */\n };\n /* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\n var _tr_align = function _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n };\n /* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\n var _tr_flush_block = function _tr_flush_block(s, buf, stored_len, last\n // DeflateState *s;\n // charf *buf; /* input block, or NULL if too old */\n // ulg stored_len; /* length of input block */\n // int last; /* one if this is the last block for a file */\n ) {\n var opt_lenb;\n var static_lenb;\n /* opt_len and static_len in bytes */\n var max_blindex = 0;\n /* index of last bit length code of non zero freq */\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc); // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n build_tree(s, s.d_desc); // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3; // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n if (static_lenb <= opt_lenb) {\n opt_lenb = static_lenb;\n }\n }\n else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5;\n /* force a stored block */\n }\n if (stored_len + 4 <= opt_lenb && buf !== -1) {\n /* 4: two words for the lengths */\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n }\n else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n }\n else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n } // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n if (last) {\n bi_windup(s);\n } // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n };\n /* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\n var _tr_tally = function _tr_tally(s, dist, lc\n // deflate_state *s;\n // unsigned dist; /* distance of matched string */\n // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n ) {\n // let out_length, in_length, dcode;\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2] /* .Freq */++;\n }\n else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--;\n /* dist = match distance - 1 */\n // Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2] /* .Freq */++;\n s.dyn_dtree[d_code(dist) * 2] /* .Freq */++;\n } // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n // #ifdef TRUNCATE_BLOCK\n // /* Try to guess if it is profitable to stop the current block here */\n // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n // /* Compute an upper bound for the compressed length */\n // out_length = s.last_lit*8;\n // in_length = s.strstart - s.block_start;\n //\n // for (dcode = 0; dcode < D_CODES; dcode++) {\n // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n // }\n // out_length >>>= 3;\n // //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n // // s->last_lit, in_length, out_length,\n // // 100L - out_length*100L/in_length));\n // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n // return true;\n // }\n // }\n // #endif\n return s.last_lit === s.lit_bufsize - 1;\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n };\n var _tr_init_1 = _tr_init;\n var _tr_stored_block_1 = _tr_stored_block;\n var _tr_flush_block_1 = _tr_flush_block;\n var _tr_tally_1 = _tr_tally;\n var _tr_align_1 = _tr_align;\n var trees = {\n _tr_init: _tr_init_1,\n _tr_stored_block: _tr_stored_block_1,\n _tr_flush_block: _tr_flush_block_1,\n _tr_tally: _tr_tally_1,\n _tr_align: _tr_align_1,\n };\n // It isn't worth it to make additional optimizations as in original.\n // Small size is preferable.\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n var adler32 = function adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) | 0;\n var s2 = ((adler >>> 16) & 0xffff) | 0;\n var n = 0;\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n do {\n s1 = (s1 + buf[pos++]) | 0;\n s2 = (s2 + s1) | 0;\n } while (--n);\n s1 %= 65521;\n s2 %= 65521;\n }\n return s1 | (s2 << 16) | 0;\n };\n var adler32_1 = adler32;\n // So write code to minimize size - no pregenerated tables\n // and array tools dependencies.\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n // Use ordinary array, since untyped makes no boost here\n var makeTable = function makeTable() {\n var c;\n var table = [];\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;\n }\n table[n] = c;\n }\n return table;\n }; // Create table on load. Just 255 signed longs. Not a problem.\n var crcTable = new Uint32Array(makeTable());\n var crc32 = function crc32(crc, buf, len, pos) {\n var t = crcTable;\n var end = pos + len;\n crc ^= -1;\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xff];\n }\n return crc ^ -1; // >>> 0;\n };\n var crc32_1 = crc32;\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n var messages = {\n 2: 'need dictionary',\n /* Z_NEED_DICT 2 */\n 1: 'stream end',\n /* Z_STREAM_END 1 */\n 0: '',\n /* Z_OK 0 */\n '-1': 'file error',\n /* Z_ERRNO (-1) */\n '-2': 'stream error',\n /* Z_STREAM_ERROR (-2) */\n '-3': 'data error',\n /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory',\n /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error',\n /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version',\n /* Z_VERSION_ERROR (-6) */\n };\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n var constants = {\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n // Z_VERSION_ERROR: -6,\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n // Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n /* The deflate compression method */\n Z_DEFLATED: 8, // Z_NULL: null // Use -1 or null inline, depending on var type\n };\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n var _tr_init$1 = trees._tr_init;\n var _tr_stored_block$1 = trees._tr_stored_block;\n var _tr_flush_block$1 = trees._tr_flush_block;\n var _tr_tally$1 = trees._tr_tally;\n var _tr_align$1 = trees._tr_align;\n /* Public constants ========================================================== */\n /* =========================================================================== */\n var Z_NO_FLUSH = constants.Z_NO_FLUSH;\n var Z_PARTIAL_FLUSH = constants.Z_PARTIAL_FLUSH;\n var Z_FULL_FLUSH = constants.Z_FULL_FLUSH;\n var Z_FINISH = constants.Z_FINISH;\n var Z_BLOCK = constants.Z_BLOCK;\n var Z_OK = constants.Z_OK;\n var Z_STREAM_END = constants.Z_STREAM_END;\n var Z_STREAM_ERROR = constants.Z_STREAM_ERROR;\n var Z_DATA_ERROR = constants.Z_DATA_ERROR;\n var Z_BUF_ERROR = constants.Z_BUF_ERROR;\n var Z_DEFAULT_COMPRESSION = constants.Z_DEFAULT_COMPRESSION;\n var Z_FILTERED = constants.Z_FILTERED;\n var Z_HUFFMAN_ONLY = constants.Z_HUFFMAN_ONLY;\n var Z_RLE = constants.Z_RLE;\n var Z_FIXED$1 = constants.Z_FIXED;\n var Z_DEFAULT_STRATEGY = constants.Z_DEFAULT_STRATEGY;\n var Z_UNKNOWN$1 = constants.Z_UNKNOWN;\n var Z_DEFLATED = constants.Z_DEFLATED;\n /* ============================================================================ */\n var MAX_MEM_LEVEL = 9;\n /* Maximum value for memLevel in deflateInit2 */\n var MAX_WBITS = 15;\n /* 32K LZ77 window */\n var DEF_MEM_LEVEL = 8;\n var LENGTH_CODES$1 = 29;\n /* number of length codes, not counting the special END_BLOCK code */\n var LITERALS$1 = 256;\n /* number of literal bytes 0..255 */\n var L_CODES$1 = LITERALS$1 + 1 + LENGTH_CODES$1;\n /* number of Literal or Length codes, including the END_BLOCK code */\n var D_CODES$1 = 30;\n /* number of distance codes */\n var BL_CODES$1 = 19;\n /* number of codes used to transfer the bit lengths */\n var HEAP_SIZE$1 = 2 * L_CODES$1 + 1;\n /* maximum heap size */\n var MAX_BITS$1 = 15;\n /* All codes must not exceed MAX_BITS bits */\n var MIN_MATCH$1 = 3;\n var MAX_MATCH$1 = 258;\n var MIN_LOOKAHEAD = MAX_MATCH$1 + MIN_MATCH$1 + 1;\n var PRESET_DICT = 0x20;\n var INIT_STATE = 42;\n var EXTRA_STATE = 69;\n var NAME_STATE = 73;\n var COMMENT_STATE = 91;\n var HCRC_STATE = 103;\n var BUSY_STATE = 113;\n var FINISH_STATE = 666;\n var BS_NEED_MORE = 1;\n /* block not completed, need more input or more output */\n var BS_BLOCK_DONE = 2;\n /* block flush performed */\n var BS_FINISH_STARTED = 3;\n /* finish started, need only more output at next deflate */\n var BS_FINISH_DONE = 4;\n /* finish done, accept no more input or output */\n var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n var err = function err(strm, errorCode) {\n strm.msg = messages[errorCode];\n return errorCode;\n };\n var rank = function rank(f) {\n return (f << 1) - (f > 4 ? 9 : 0);\n };\n var zero$1 = function zero(buf) {\n var len = buf.length;\n while (--len >= 0) {\n buf[len] = 0;\n }\n };\n var HASH_ZLIB = function HASH_ZLIB(s, prev, data) {\n return ((prev << s.hash_shift) ^ data) & s.hash_mask;\n }; // This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n // But breaks binary compatibility\n // let HASH_FAST = (s, prev, data) => ((prev << 8) + (prev >> 8) + (data << 4)) & s.hash_mask;\n var HASH = HASH_ZLIB;\n /* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\n var flush_pending = function flush_pending(strm) {\n var s = strm.state; // _tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) {\n return;\n }\n strm.output.set(s.pending_buf.subarray(s.pending_out, s.pending_out + len), strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n };\n var flush_block_only = function flush_block_only(s, last) {\n _tr_flush_block$1(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n };\n var put_byte = function put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n };\n /* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\n var putShortMSB = function putShortMSB(s, b) {\n // put_byte(s, (Byte)(b >> 8));\n // put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n };\n /* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\n var read_buf = function read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n if (len > size) {\n len = size;\n }\n if (len === 0) {\n return 0;\n }\n strm.avail_in -= len; // zmemcpy(buf, strm->next_in, len);\n buf.set(strm.input.subarray(strm.next_in, strm.next_in + len), start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32_1(strm.adler, buf, len, start);\n }\n else if (strm.state.wrap === 2) {\n strm.adler = crc32_1(strm.adler, buf, len, start);\n }\n strm.next_in += len;\n strm.total_in += len;\n return len;\n };\n /* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\n var longest_match = function longest_match(s, cur_match) {\n var chain_length = s.max_chain_length;\n /* max hash chain length */\n var scan = s.strstart;\n /* current string */\n var match;\n /* matched string */\n var len;\n /* length of current match */\n var best_len = s.prev_length;\n /* best match length so far */\n var nice_match = s.nice_match;\n /* stop if match long enough */\n var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;\n /* NIL */\n var _win = s.window; // shortcut\n var wmask = s.w_mask;\n var prev = s.prev;\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n var strend = s.strstart + MAX_MATCH$1;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) {\n nice_match = s.lookahead;\n } // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++; // Assert(*scan == *match, \"match[2]?\");\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /* jshint noempty:false */\n } while (_win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] &&\n scan < strend); // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n len = MAX_MATCH$1 - (strend - scan);\n scan = strend - MAX_MATCH$1;\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n };\n /* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\n var fill_window = function fill_window(s) {\n var _w_size = s.w_size;\n var p;\n var n;\n var m;\n var more;\n var str; // Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n do {\n more = s.window_size - s.lookahead - s.strstart; // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n // if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n // }\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n s.window.set(s.window.subarray(_w_size, _w_size + _w_size), 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = m >= _w_size ? m - _w_size : 0;\n } while (--n);\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = m >= _w_size ? m - _w_size : 0;\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n // Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH$1) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + 1]); // #if MIN_MATCH != 3\n // Call update_hash() MIN_MATCH-3 more times\n // #endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]);\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH$1) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n // if (s.high_water < s.window_size) {\n // const curr = s.strstart + s.lookahead;\n // let init = 0;\n //\n // if (s.high_water < curr) {\n // /* Previous high water mark below current data -- zero WIN_INIT\n // * bytes or up to end of window, whichever is less.\n // */\n // init = s.window_size - curr;\n // if (init > WIN_INIT)\n // init = WIN_INIT;\n // zmemzero(s->window + curr, (unsigned)init);\n // s->high_water = curr + init;\n // }\n // else if (s->high_water < (ulg)curr + WIN_INIT) {\n // /* High water mark at or above current data, but below current data\n // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n // * to end of window, whichever is less.\n // */\n // init = (ulg)curr + WIN_INIT - s->high_water;\n // if (init > s->window_size - s->high_water)\n // init = s->window_size - s->high_water;\n // zmemzero(s->window + s->high_water, (unsigned)init);\n // s->high_water += init;\n // }\n // }\n //\n // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n // \"not enough room for search\");\n };\n /* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\n var deflate_stored = function deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n // Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n // s.block_start >= s.w_size)) {\n // throw new Error(\"slide too late\");\n // }\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n } // Assert(s->block_start >= 0L, \"block gone\");\n // if (s.block_start < 0) throw new Error(\"block gone\");\n s.strstart += s.lookahead;\n s.lookahead = 0;\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /** * FLUSH_BLOCK(s, 1); ** */\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.strstart > s.block_start) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_NEED_MORE;\n };\n /* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\n var deflate_fast = function deflate_fast(s, flush) {\n var hash_head;\n /* head of the hash chain */\n var bflush;\n /* set if current block must be flushed */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n /* flush the current block */\n }\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0;\n /* NIL */\n if (s.lookahead >= MIN_MATCH$1) {\n /** * INSERT_STRING(s, s.strstart, hash_head); ** */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0 &&\n /* NIL */\n s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH$1) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n /** * _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ** */\n bflush = _tr_tally$1(s, s.strstart - s.match_start, s.match_length - MIN_MATCH$1);\n s.lookahead -= s.match_length;\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match &&\n /* max_insert_length */\n s.lookahead >= MIN_MATCH$1) {\n s.match_length--;\n /* string at strstart already in table */\n do {\n s.strstart++;\n /** * INSERT_STRING(s, s.strstart, hash_head); ** */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n }\n else {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + 1]); // #if MIN_MATCH != 3\n // Call UPDATE_HASH() MIN_MATCH-3 more times\n // #endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n }\n else {\n /* No match, output a literal byte */\n // Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ** */\n bflush = _tr_tally$1(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n if (flush === Z_FINISH) {\n /** * FLUSH_BLOCK(s, 1); ** */\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n };\n /* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\n var deflate_slow = function deflate_slow(s, flush) {\n var hash_head;\n /* head of hash chain */\n var bflush;\n /* set if current block must be flushed */\n var max_insert;\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0;\n /* NIL */\n if (s.lookahead >= MIN_MATCH$1) {\n /** * INSERT_STRING(s, s.strstart, hash_head); ** */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH$1 - 1;\n if (hash_head !== 0 &&\n /* NIL */\n s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD\n /* MAX_DIST(s) */\n ) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH$1 && s.strstart - s.match_start > 4096))\n /* TOO_FAR */\n ) {\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH$1 - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH$1 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH$1;\n /* Do not insert strings in hash table beyond this. */\n // check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n /** *_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);** */\n bflush = _tr_tally$1(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH$1);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /** * INSERT_STRING(s, s.strstart, hash_head); ** */\n s.ins_h = HASH(s, s.ins_h, s.window[s.strstart + MIN_MATCH$1 - 1]);\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH$1 - 1;\n s.strstart++;\n if (bflush) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n // Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ** */\n bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]);\n if (bflush) {\n /** * FLUSH_BLOCK_ONLY(s, 0) ** */\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n }\n else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n } // Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n // Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ** */\n bflush = _tr_tally$1(s, 0, s.window[s.strstart - 1]);\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH$1 - 1 ? s.strstart : MIN_MATCH$1 - 1;\n if (flush === Z_FINISH) {\n /** * FLUSH_BLOCK(s, 1); ** */\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n };\n /* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\n var deflate_rle = function deflate_rle(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n var prev;\n /* byte at distance one to match */\n var scan;\n var strend;\n /* scan goes up to strend for length of run */\n var _win = s.window;\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH$1) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH$1 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH$1 && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH$1;\n do {\n /* jshint noempty:false */\n } while (prev === _win[++scan] &&\n prev === _win[++scan] &&\n prev === _win[++scan] &&\n prev === _win[++scan] &&\n prev === _win[++scan] &&\n prev === _win[++scan] &&\n prev === _win[++scan] &&\n prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH$1 - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n } // Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH$1) {\n // check_match(s, s.strstart, s.strstart - 1, s.match_length);\n /** * _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ** */\n bflush = _tr_tally$1(s, 1, s.match_length - MIN_MATCH$1);\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n }\n else {\n /* No match, output a literal byte */\n // Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ** */\n bflush = _tr_tally$1(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /** * FLUSH_BLOCK(s, 1); ** */\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n };\n /* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\n var deflate_huff = function deflate_huff(s, flush) {\n var bflush;\n /* set if current block must be flushed */\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break;\n /* flush the current block */\n }\n }\n /* Output a literal byte */\n s.match_length = 0; // Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ** */\n bflush = _tr_tally$1(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /** * FLUSH_BLOCK(s, 1); ** */\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /** * FLUSH_BLOCK(s, 0); ** */\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n };\n /* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\n function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n }\n var configuration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored),\n /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast),\n /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast),\n /* 2 */\n new Config(4, 6, 32, 32, deflate_fast),\n /* 3 */\n new Config(4, 4, 16, 16, deflate_slow),\n /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow),\n /* 5 */\n new Config(8, 16, 128, 128, deflate_slow),\n /* 6 */\n new Config(8, 32, 128, 256, deflate_slow),\n /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow),\n /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow),\n /* 9 max compression */\n ];\n /* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\n var lm_init = function lm_init(s) {\n s.window_size = 2 * s.w_size;\n /** * CLEAR_HASH(s); ** */\n zero$1(s.head); // Fill with NIL (= 0);\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH$1 - 1;\n s.match_available = 0;\n s.ins_h = 0;\n };\n function DeflateState() {\n this.strm = null;\n /* pointer back to this zlib stream */\n this.status = 0;\n /* as the name implies */\n this.pending_buf = null;\n /* output still pending */\n this.pending_buf_size = 0;\n /* size of pending_buf */\n this.pending_out = 0;\n /* next pending byte to output to the stream */\n this.pending = 0;\n /* nb of bytes in the pending buffer */\n this.wrap = 0;\n /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null;\n /* gzip header information to write */\n this.gzindex = 0;\n /* where in extra, name, or comment */\n this.method = Z_DEFLATED;\n /* can only be DEFLATED */\n this.last_flush = -1;\n /* value of flush param for previous deflate call */\n this.w_size = 0;\n /* LZ77 window size (32K by default) */\n this.w_bits = 0;\n /* log2(w_size) (8..16) */\n this.w_mask = 0;\n /* w_size - 1 */\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n this.head = null;\n /* Heads of the hash chains or NIL. */\n this.ins_h = 0;\n /* hash index of string to be inserted */\n this.hash_size = 0;\n /* number of elements in hash table */\n this.hash_bits = 0;\n /* log2(hash_size) */\n this.hash_mask = 0;\n /* hash_size-1 */\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n this.match_length = 0;\n /* length of best match */\n this.prev_match = 0;\n /* previous match */\n this.match_available = 0;\n /* set if previous match exists */\n this.strstart = 0;\n /* start of string to insert */\n this.match_start = 0;\n /* start of matching string */\n this.lookahead = 0;\n /* number of valid bytes ahead in window */\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n // this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n this.level = 0;\n /* compression level (1..9) */\n this.strategy = 0;\n /* favor or force Huffman coding */\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n this.nice_match = 0;\n /* Stop searching when current match exceeds this */\n /* used by trees.c: */\n /* Didn't use ct_data typedef below to suppress compiler warning */\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new Uint16Array(HEAP_SIZE$1 * 2);\n this.dyn_dtree = new Uint16Array((2 * D_CODES$1 + 1) * 2);\n this.bl_tree = new Uint16Array((2 * BL_CODES$1 + 1) * 2);\n zero$1(this.dyn_ltree);\n zero$1(this.dyn_dtree);\n zero$1(this.bl_tree);\n this.l_desc = null;\n /* desc. for literal tree */\n this.d_desc = null;\n /* desc. for distance tree */\n this.bl_desc = null;\n /* desc. for bit length tree */\n // ush bl_count[MAX_BITS+1];\n this.bl_count = new Uint16Array(MAX_BITS$1 + 1);\n /* number of codes at each bit length for an optimal tree */\n // int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new Uint16Array(2 * L_CODES$1 + 1);\n /* heap used to build the Huffman trees */\n zero$1(this.heap);\n this.heap_len = 0;\n /* number of elements in the heap */\n this.heap_max = 0;\n /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n this.depth = new Uint16Array(2 * L_CODES$1 + 1); // uch depth[2*L_CODES+1];\n zero$1(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n this.l_buf = 0;\n /* buffer index for literals or lengths */\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n this.last_lit = 0;\n /* running index in l_buf */\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n this.opt_len = 0;\n /* bit length of current block with optimal trees */\n this.static_len = 0;\n /* bit length of current block with static trees */\n this.matches = 0;\n /* number of string matches in current block */\n this.insert = 0;\n /* bytes at end of window left to insert */\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n // this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n }\n var deflateResetKeep = function deflateResetKeep(strm) {\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN$1;\n var s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = s.wrap ? INIT_STATE : BUSY_STATE;\n strm.adler =\n s.wrap === 2\n ? 0 // crc32(0, Z_NULL, 0)\n : 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n _tr_init$1(s);\n return Z_OK;\n };\n var deflateReset = function deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n };\n var deflateSetHeader = function deflateSetHeader(strm, head) {\n if (!strm || !strm.state) {\n return Z_STREAM_ERROR;\n }\n if (strm.state.wrap !== 2) {\n return Z_STREAM_ERROR;\n }\n strm.state.gzhead = head;\n return Z_OK;\n };\n var deflateInit2 = function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) {\n // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n if (windowBits < 0) {\n /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n else if (windowBits > 15) {\n wrap = 2;\n /* write gzip wrapper instead */\n windowBits -= 16;\n }\n if (memLevel < 1 ||\n memLevel > MAX_MEM_LEVEL ||\n method !== Z_DEFLATED ||\n windowBits < 8 ||\n windowBits > 15 ||\n level < 0 ||\n level > 9 ||\n strategy < 0 ||\n strategy > Z_FIXED$1) {\n return err(strm, Z_STREAM_ERROR);\n }\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n var s = new DeflateState();\n strm.state = s;\n s.strm = strm;\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH$1 - 1) / MIN_MATCH$1);\n s.window = new Uint8Array(s.w_size * 2);\n s.head = new Uint16Array(s.hash_size);\n s.prev = new Uint16Array(s.w_size); // Don't need mem init magic for JS.\n // s.high_water = 0; /* nothing written to s->window yet */\n s.lit_bufsize = 1 << (memLevel + 6);\n /* 16K elements by default */\n s.pending_buf_size = s.lit_bufsize * 4;\n // overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n // s->pending_buf = (uchf *) overlay;\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n s.pending_buf = new Uint8Array(s.pending_buf_size);\n // s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize; // s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n return deflateReset(strm);\n };\n var deflateInit = function deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n };\n var deflate = function deflate(strm, flush) {\n var beg;\n var val; // for gzip header write only\n if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n var s = strm.state;\n if (!strm.output || (!strm.input && strm.avail_in !== 0) || (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n s.strm = strm;\n /* just in case */\n var old_flush = s.last_flush;\n s.last_flush = flush;\n /* Write the header */\n if (s.status === INIT_STATE) {\n if (s.wrap === 2) {\n // GZIP header\n strm.adler = 0; // crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) {\n // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16));\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n } // DEFLATE header\n else {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n }\n else if (s.level < 6) {\n level_flags = 1;\n }\n else if (s.level === 6) {\n level_flags = 2;\n }\n else {\n level_flags = 3;\n }\n header |= level_flags << 6;\n if (s.strstart !== 0) {\n header |= PRESET_DICT;\n }\n header += 31 - (header % 31);\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n } // #ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra\n /* != Z_NULL */\n ) {\n beg = s.pending;\n /* start of bytes to update crc */\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name\n /* != Z_NULL */\n ) {\n beg = s.pending;\n /* start of bytes to update crc */\n // int val;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n } // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n }\n else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment\n /* != Z_NULL */\n ) {\n beg = s.pending;\n /* start of bytes to update crc */\n // int val;\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n } // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n }\n else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32_1(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; // crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n } // #endif\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n }\n else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 || (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = s.strategy === Z_HUFFMAN_ONLY\n ? deflate_huff(s, flush)\n : s.strategy === Z_RLE\n ? deflate_rle(s, flush)\n : configuration_table[s.level].func(s, flush);\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n _tr_align$1(s);\n }\n else if (flush !== Z_BLOCK) {\n /* FULL_FLUSH or SYNC_FLUSH */\n _tr_stored_block$1(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /** * CLEAR_HASH(s); ** */\n /* forget history */\n zero$1(s.head); // Fill with NIL (= 0);\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n } // Assert(strm->avail_out > 0, \"bug2\");\n // if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n if (flush !== Z_FINISH) {\n return Z_OK;\n }\n if (s.wrap <= 0) {\n return Z_STREAM_END;\n }\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) {\n s.wrap = -s.wrap;\n }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n };\n var deflateEnd = function deflateEnd(strm) {\n if (!strm ||\n /* == Z_NULL */\n !strm.state\n /* == Z_NULL */\n ) {\n return Z_STREAM_ERROR;\n }\n var status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE) {\n return err(strm, Z_STREAM_ERROR);\n }\n strm.state = null;\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n };\n /* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\n var deflateSetDictionary = function deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n if (!strm ||\n /* == Z_NULL */\n !strm.state\n /* == Z_NULL */\n ) {\n return Z_STREAM_ERROR;\n }\n var s = strm.state;\n var wrap = s.wrap;\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32_1(strm.adler, dictionary, dictLength, 0);\n }\n s.wrap = 0;\n /* avoid computing Adler-32 in read_buf */\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) {\n /* already empty otherwise */\n /** * CLEAR_HASH(s); ** */\n zero$1(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n var tmpDict = new Uint8Array(s.w_size);\n tmpDict.set(dictionary.subarray(dictLength - s.w_size, dictLength), 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n var avail = strm.avail_in;\n var next = strm.next_in;\n var input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH$1) {\n var str = s.strstart;\n var n = s.lookahead - (MIN_MATCH$1 - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = HASH(s, s.ins_h, s.window[str + MIN_MATCH$1 - 1]);\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH$1 - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH$1 - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n };\n var deflateInit_1 = deflateInit;\n var deflateInit2_1 = deflateInit2;\n var deflateReset_1 = deflateReset;\n var deflateResetKeep_1 = deflateResetKeep;\n var deflateSetHeader_1 = deflateSetHeader;\n var deflate_2 = deflate;\n var deflateEnd_1 = deflateEnd;\n var deflateSetDictionary_1 = deflateSetDictionary;\n var deflateInfo = 'pako deflate (from Nodeca project)';\n /* Not implemented\n module.exports.deflateBound = deflateBound;\n module.exports.deflateCopy = deflateCopy;\n module.exports.deflateParams = deflateParams;\n module.exports.deflatePending = deflatePending;\n module.exports.deflatePrime = deflatePrime;\n module.exports.deflateTune = deflateTune;\n */\n var deflate_1 = {\n deflateInit: deflateInit_1,\n deflateInit2: deflateInit2_1,\n deflateReset: deflateReset_1,\n deflateResetKeep: deflateResetKeep_1,\n deflateSetHeader: deflateSetHeader_1,\n deflate: deflate_2,\n deflateEnd: deflateEnd_1,\n deflateSetDictionary: deflateSetDictionary_1,\n deflateInfo: deflateInfo,\n };\n // Join array of chunks to single array.\n function flattenChunks(chunks) {\n // calculate data length\n var len = 0;\n for (var i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n } // join chunks\n var result = new Uint8Array(len);\n for (var _i = 0, pos = 0, _l = chunks.length; _i < _l; _i++) {\n var chunk = chunks[_i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n return result;\n }\n // String encode/decode helpers\n //\n // - apply(Array) can fail on Android 2.2\n // - apply(Uint8Array) can fail on iOS 5.1 Safari\n //\n // Table with utf8 lengths (calculated by first byte of sequence)\n // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n // because max possible codepoint is 0x10ffff\n var _utf8len = new Uint8Array(256);\n for (var q = 0; q < 256; q++) {\n _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1;\n }\n _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n // convert string to array (typed, when possible)\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n function ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = '';\n /* Z_NULL */\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2;\n /* Z_UNKNOWN */\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n }\n var zstream = ZStream;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n var toString = Object.prototype.toString;\n /* Public constants ========================================================== */\n /* =========================================================================== */\n var Z_NO_FLUSH$1 = constants.Z_NO_FLUSH;\n var Z_SYNC_FLUSH = constants.Z_SYNC_FLUSH;\n var Z_FULL_FLUSH$1 = constants.Z_FULL_FLUSH;\n var Z_FINISH$1 = constants.Z_FINISH;\n var Z_OK$1 = constants.Z_OK;\n var Z_STREAM_END$1 = constants.Z_STREAM_END;\n var Z_DEFAULT_COMPRESSION$1 = constants.Z_DEFAULT_COMPRESSION;\n var Z_DEFAULT_STRATEGY$1 = constants.Z_DEFAULT_STRATEGY;\n var Z_DEFLATED$1 = constants.Z_DEFLATED;\n /* =========================================================================== */\n /**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n * */\n /* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n * */\n /**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n * */\n /**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n * */\n /**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n * */\n /**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * * `chunkSize` - size of generated data chunks (16K by default)\n * * `raw` (Boolean) - do raw deflate\n * * `gzip` (Boolean) - create gzip wrapper\n * * `header` (Object) - custom header for gzip\n * ** `text` (Boolean) - true if compressed data believed to be text\n * ** `time` (Number) - modification time, unix timestamp\n * ** `os` (Number) - operation system code\n * ** `extra` (Array) - array of bytes with extra data (max 65536)\n * ** `name` (String) - file name (binary string)\n * ** `comment` (String) - comment (binary string)\n * ** `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n * */\n function Deflate() {\n this.options = {\n level: Z_DEFAULT_COMPRESSION$1,\n method: Z_DEFLATED$1,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY$1,\n };\n var opt = this.options;\n if (opt.raw && opt.windowBits > 0) {\n opt.windowBits = -opt.windowBits;\n }\n else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) {\n opt.windowBits += 16;\n }\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n this.strm = new zstream();\n this.strm.avail_out = 0;\n var status = deflate_1.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy);\n if (status !== Z_OK$1) {\n throw new Error(messages[status]);\n }\n if (opt.header) {\n deflate_1.deflateSetHeader(this.strm, opt.header);\n }\n if (opt.dictionary) {\n var dict; // Convert data if needed\n if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n }\n else {\n dict = opt.dictionary;\n }\n status = deflate_1.deflateSetDictionary(this.strm, dict);\n if (status !== Z_OK$1) {\n throw new Error(messages[status]);\n }\n this._dict_set = true;\n }\n }\n /**\n * Deflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must\n * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending\n * buffers and call [[Deflate#onEnd]].\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n * */\n Deflate.prototype.push = function (data, flush_mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status;\n var _flush_mode;\n if (this.ended) {\n return false;\n }\n if (flush_mode === ~~flush_mode) {\n _flush_mode = flush_mode;\n }\n else {\n _flush_mode = flush_mode === true ? Z_FINISH$1 : Z_NO_FLUSH$1;\n } // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n }\n else {\n strm.input = data;\n }\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n } // Make sure avail_out > 6 to avoid repeating markers\n if ((_flush_mode === Z_SYNC_FLUSH || _flush_mode === Z_FULL_FLUSH$1) && strm.avail_out <= 6) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n status = deflate_1.deflate(strm, _flush_mode); // Ended => flush and finish\n if (status === Z_STREAM_END$1) {\n if (strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n }\n status = deflate_1.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK$1;\n } // Flush if out buffer full\n if (strm.avail_out === 0) {\n this.onData(strm.output);\n continue;\n } // Flush if requested and has data\n if (_flush_mode > 0 && strm.next_out > 0) {\n this.onData(strm.output.subarray(0, strm.next_out));\n strm.avail_out = 0;\n continue;\n }\n if (strm.avail_in === 0) {\n break;\n }\n }\n return true;\n };\n /**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array): output data.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n * */\n Deflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n };\n /**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n * */\n Deflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK$1) {\n this.result = flattenChunks(this.chunks);\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n };\n // https://github.com/nodeca/pako/blob/26dff4fb3472c5532b3bd8856421146d35ab7592/lib/utils/strings.js#L26\n function string2buf(str) {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n var buf;\n var c;\n var c2;\n var m_pos;\n var i;\n var str_len = str.length;\n var buf_len = 0;\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n // allocate buffer\n buf = new Uint8Array(buf_len);\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && m_pos + 1 < str_len) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n }\n else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xc0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xe0 | (c >>> 12);\n buf[i++] = 0x80 | ((c >>> 6) & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | ((c >>> 12) & 0x3f);\n buf[i++] = 0x80 | ((c >>> 6) & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n return buf;\n }\n return { Deflate: Deflate, constants: constants, string2buf: string2buf };\n }\n}\n//# sourceMappingURL=deflateWorker.js.map"],"names":["workerURL","createDeflateWorker","URL","createObjectURL","Blob","concat","workerCodeFn","Worker","monitor","fn","apply","this","arguments","e","self","postMessage","type","error","_","_a","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","zero","buf","len","length","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH","MAX_MATCH","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","Uint8Array","extra_dbits","extra_blbits","bl_order","DIST_CODE_LEN","static_ltree","Array","static_dtree","_dist_code","_length_code","base_length","static_l_desc","static_d_desc","static_bl_desc","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","has_stree","TreeDesc","dyn_tree","stat_desc","max_code","d_code","dist","put_short","s","w","pending_buf","pending","send_bits","value","bi_valid","bi_buf","send_code","c","tree","bi_reverse","code","res","bi_flush","gen_bitlen","desc","h","n","m","bits","xbits","f","stree","extra","base","overflow","bl_count","heap","heap_max","opt_len","static_len","gen_codes","next_code","tr_static_init","init_block","dyn_ltree","dyn_dtree","bl_tree","last_lit","matches","bi_windup","copy_block","header","set","window","subarray","smaller","depth","_n2","_m2","pqdownheap","k","v","j","heap_len","compress_block","ltree","dtree","lc","lx","d_buf","l_buf","build_tree","node","scan_tree","curlen","prevlen","nextlen","count","max_count","min_count","send_tree","build_bl_tree","max_blindex","l_desc","d_desc","bl_desc","send_all_trees","lcodes","dcodes","blcodes","rank","detect_data_type","black_mask","static_init_done","_tr_stored_block","stored_len","last","_tr_flush_block","opt_lenb","static_lenb","level","strm","data_type","strategy","trees","_tr_init","_tr_tally","lit_bufsize","_tr_align","adler32_1","adler","pos","s1","s2","crcTable","Uint32Array","table","makeTable","crc32_1","crc","t","end","i","messages","constants","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_DEFAULT_STRATEGY","Z_DEFLATED","_tr_init$1","_tr_stored_block$1","_tr_flush_block$1","_tr_tally$1","_tr_align$1","Z_FIXED$1","Z_UNKNOWN$1","MAX_MEM_LEVEL","MAX_WBITS","DEF_MEM_LEVEL","L_CODES$1","LITERALS$1","D_CODES$1","BL_CODES$1","HEAP_SIZE$1","MAX_BITS$1","MIN_MATCH$1","MAX_MATCH$1","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","err","errorCode","msg","zero$1","HASH","prev","data","hash_shift","hash_mask","flush_pending","state","avail_out","output","pending_out","next_out","total_out","flush_block_only","block_start","strstart","put_byte","b","putShortMSB","read_buf","start","size","avail_in","input","next_in","wrap","total_in","longest_match","cur_match","match","chain_length","max_chain_length","scan","best_len","prev_length","nice_match","limit","w_size","_win","wmask","w_mask","strend","scan_end1","scan_end","good_match","lookahead","match_start","fill_window","p","more","str","_w_size","window_size","hash_size","head","insert","ins_h","deflate_fast","flush","hash_head","bflush","match_length","max_lazy_match","deflate_slow","max_insert","prev_match","match_available","deflate_rle","deflate_huff","Config","good_length","max_lazy","nice_length","max_chain","func","configuration_table","max_block_size","pending_buf_size","max_start","lm_init","DeflateState","status","gzhead","gzindex","method","last_flush","w_bits","hash_bits","Uint16Array","deflateResetKeep","deflateReset","ret","deflateInit2","windowBits","memLevel","deflate_1","deflateInit","deflateSetHeader","deflate","beg","val","old_flush","text","hcrc","name","comment","time","os","charCodeAt","bstate","deflateEnd","deflateSetDictionary","dictionary","dictLength","tmpDict","avail","next","deflateInfo","flattenChunks","chunks","l","result","_i","_l","chunk","_utf8len","q","ZStream","zstream","toString","Object","prototype","Z_NO_FLUSH$1","Z_FULL_FLUSH$1","Z_FINISH$1","Z_OK$1","Z_STREAM_END$1","Z_DEFAULT_COMPRESSION$1","Z_DEFAULT_STRATEGY$1","Z_DEFLATED$1","Deflate","options","chunkSize","opt","raw","gzip","ended","Error","dict","call","_dict_set","string2buf","TextEncoder","encode","c2","m_pos","str_len","buf_len","push","flush_mode","_flush_mode","onData","onEnd","makePakoDeflate","rawBytesCount","pushData","binaryData","addEventListener","event","action","additionalBytesCount","id","compressedBytesCount","reduce","total"],"sourceRoot":""}