{"version":3,"file":"pdf-lib.min.js","sources":["../node_modules/tslib/tslib.es6.js","../es/utils/base64.js","../es/utils/unicode.js","../es/utils/strings.js","../es/utils/arrays.js","../es/utils/async.js","../es/utils/numbers.js","../es/utils/errors.js","../node_modules/base64-arraybuffer/lib/base64-arraybuffer.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/utils/common.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/trees.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/adler32.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/crc32.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/deflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/messages.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/utils/strings.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/zstream.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/deflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/inffast.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/inftrees.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/inflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/constants.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/zlib/gzheader.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/lib/inflate.js","../node_modules/@pdf-lib/standard-fonts/node_modules/pako/index.js","../node_modules/@pdf-lib/standard-fonts/es/Font.js","../node_modules/@pdf-lib/standard-fonts/es/utils.js","../es/utils/pdfDocEncoding.js","../node_modules/@pdf-lib/standard-fonts/es/Encoding.js","../es/utils/objects.js","../es/utils/validators.js","../es/core/syntax/CharCodes.js","../es/utils/Cache.js","../es/core/errors.js","../node_modules/pako/lib/utils/common.js","../node_modules/pako/lib/zlib/trees.js","../node_modules/pako/lib/zlib/adler32.js","../node_modules/pako/lib/zlib/crc32.js","../node_modules/pako/lib/zlib/deflate.js","../node_modules/pako/lib/zlib/messages.js","../node_modules/pako/lib/utils/strings.js","../node_modules/pako/lib/zlib/zstream.js","../node_modules/pako/lib/deflate.js","../node_modules/pako/lib/zlib/inffast.js","../node_modules/pako/lib/zlib/inftrees.js","../node_modules/pako/lib/zlib/inflate.js","../node_modules/pako/lib/zlib/constants.js","../node_modules/pako/lib/zlib/gzheader.js","../node_modules/pako/lib/inflate.js","../node_modules/pako/index.js","../es/core/document/PDFHeader.js","../es/core/objects/PDFObject.js","../es/core/objects/PDFNumber.js","../es/core/objects/PDFArray.js","../es/core/objects/PDFBool.js","../es/core/objects/PDFDict.js","../es/core/syntax/Delimiters.js","../es/core/syntax/Whitespace.js","../es/core/syntax/Irregular.js","../es/core/objects/PDFName.js","../es/core/operators/PDFOperatorNames.js","../es/core/objects/PDFNull.js","../es/core/objects/PDFStream.js","../es/core/objects/PDFRawStream.js","../es/core/objects/PDFRef.js","../es/core/operators/PDFOperator.js","../es/core/structures/PDFCrossRefStream.js","../es/core/structures/PDFFlateStream.js","../es/core/structures/PDFContentStream.js","../es/core/PDFContext.js","../es/core/structures/PDFPageLeaf.js","../es/core/PDFObjectCopier.js","../es/core/document/PDFCrossRefSection.js","../es/core/document/PDFTrailer.js","../es/core/document/PDFTrailerDict.js","../es/core/structures/PDFObjectStream.js","../es/core/writers/PDFWriter.js","../es/core/objects/PDFInvalidObject.js","../es/core/embedders/JpegEmbedder.js","../es/core/writers/PDFStreamWriter.js","../es/core/objects/PDFHexString.js","../es/core/embedders/StandardFontEmbedder.js","../es/core/embedders/CMap.js","../es/core/objects/PDFString.js","../es/core/embedders/CustomFontEmbedder.js","../es/core/embedders/FontFlags.js","../es/core/embedders/CustomFontSubsetEmbedder.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/utils/common.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/trees.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/adler32.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/crc32.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/deflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/messages.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/utils/strings.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/zstream.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/deflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/inffast.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/inftrees.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/inflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/constants.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/zlib/gzheader.js","../node_modules/@pdf-lib/upng/node_modules/pako/lib/inflate.js","../node_modules/@pdf-lib/upng/node_modules/pako/index.js","../node_modules/@pdf-lib/upng/UPNG.js","../es/utils/png.js","../es/core/embedders/PngEmbedder.js","../es/core/streams/Stream.js","../es/core/streams/DecodeStream.js","../es/core/streams/Ascii85Stream.js","../es/core/streams/AsciiHexStream.js","../es/core/streams/FlateStream.js","../es/core/streams/LZWStream.js","../es/core/streams/RunLengthStream.js","../es/core/streams/decode.js","../es/core/embedders/PDFPageEmbedder.js","../es/core/structures/PDFCatalog.js","../es/core/structures/PDFPageTree.js","../es/core/syntax/Numeric.js","../es/core/parser/BaseParser.js","../es/api/rotations.js","../es/core/parser/ByteStream.js","../es/core/syntax/Keywords.js","../es/core/parser/PDFObjectParser.js","../es/core/parser/PDFObjectStreamParser.js","../es/core/parser/PDFXRefStreamParser.js","../es/core/parser/PDFParser.js","../es/api/objects.js","../es/api/operators.js","../es/api/colors.js","../es/api/StandardFonts.js","../es/api/errors.js","../es/api/svgPath.js","../es/api/operations.js","../es/api/sizes.js","../es/api/PDFEmbeddedPage.js","../es/api/PDFDocument.js","../es/api/PDFFont.js","../es/api/PDFImage.js","../es/api/PDFPage.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/*\n * The `chars`, `lookup`, `encode`, and `decode` members of this file are\n * licensed under the following:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n *\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport var encodeToBase64 = function (bytes) {\n var base64 = '';\n var len = bytes.length;\n for (var i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport var decodeFromBase64 = function (base64) {\n var bufferLength = base64.length * 0.75;\n var len = base64.length;\n var i;\n var p = 0;\n var encoded1;\n var encoded2;\n var encoded3;\n var encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var bytes = new Uint8Array(bufferLength);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return bytes;\n};\n// This regex is designed to be as flexible as possible. It will parse certain\n// invalid data URIs.\nvar DATA_URI_PREFIX_REGEX = /^(data)?:?([\\w\\/\\+]+)?;?(charset=[\\w-]+|base64)?.*,/i;\n/**\n * If the `dataUri` input is a data URI, then the data URI prefix must not be\n * longer than 100 characters, or this function will fail to decode it.\n *\n * @param dataUri a base64 data URI or plain base64 string\n * @returns a Uint8Array containing the decoded input\n */\nexport var decodeFromBase64DataUri = function (dataUri) {\n var trimmedUri = dataUri.trim();\n var prefix = trimmedUri.substring(0, 100);\n var res = prefix.match(DATA_URI_PREFIX_REGEX);\n // Assume it's not a data URI - just a plain base64 string\n if (!res)\n return decodeFromBase64(trimmedUri);\n // Remove the data URI prefix and parse the remainder as a base64 string\n var fullMatch = res[0];\n var data = trimmedUri.substring(fullMatch.length);\n return decodeFromBase64(data);\n};\n//# sourceMappingURL=base64.js.map","import { toHexString } from \"./strings\";\n/**\n * Encodes a string to UTF-8.\n *\n * @param input The string to be encoded.\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be added\n * to the start of the encoding. (default `true`)\n * @returns A Uint8Array containing the UTF-8 encoding of the input string.\n *\n * -----------------------------------------------------------------------------\n *\n * JavaScript strings are composed of Unicode code points. Code points are\n * integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,\n * it must be encoded as a sequence of words. A word is typically 8, 16, or 32\n * bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,\n * and UTF-32. These encoding forms are described in the Unicode standard [1].\n * This function implements the UTF-8 encoding form.\n *\n * -----------------------------------------------------------------------------\n *\n * In UTF-8, each code point is mapped to a sequence of 1, 2, 3, or 4 bytes.\n * Note that the logic which defines this mapping is slightly convoluted, and\n * not as straightforward as the mapping logic for UTF-16 or UTF-32. The UTF-8\n * mapping logic is as follows [2]:\n *\n * • If a code point is in the range U+0000..U+007F, then view it as a 7-bit\n * integer: 0bxxxxxxx. Map the code point to 1 byte with the first high order\n * bit set to 0:\n *\n * b1=0b0xxxxxxx\n *\n * • If a code point is in the range U+0080..U+07FF, then view it as an 11-bit\n * integer: 0byyyyyxxxxxx. Map the code point to 2 bytes with the first 5 bits\n * of the code point stored in the first byte, and the last 6 bits stored in\n * the second byte:\n *\n * b1=0b110yyyyy b2=0b10xxxxxx\n *\n * • If a code point is in the range U+0800..U+FFFF, then view it as a 16-bit\n * integer, 0bzzzzyyyyyyxxxxxx. Map the code point to 3 bytes with the first\n * 4 bits stored in the first byte, the next 6 bits stored in the second byte,\n * and the last 6 bits in the third byte:\n *\n * b1=0b1110zzzz b2=0b10yyyyyy b3=0b10xxxxxx\n *\n * • If a code point is in the range U+10000...U+10FFFF, then view it as a\n * 21-bit integer, 0bvvvzzzzzzyyyyyyxxxxxx. Map the code point to 4 bytes with\n * the first 3 bits stored in the first byte, the next 6 bits stored in the\n * second byte, the next 6 bits stored in the third byte, and the last 6 bits\n * stored in the fourth byte:\n *\n * b1=0b11110xxx b2=0b10zzzzzz b3=0b10yyyyyy b4=0b10xxxxxx\n *\n * -----------------------------------------------------------------------------\n *\n * It is important to note, when iterating through the code points of a string\n * in JavaScript, that if a character is encoded as a surrogate pair it will\n * increase the string's length by 2 instead of 1 [4]. For example:\n *\n * ```\n * > 'a'.length\n * 1\n * > '💩'.length\n * 2\n * > '語'.length\n * 1\n * > 'a💩語'.length\n * 4\n * ```\n *\n * The results of the above example are explained by the fact that the\n * characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.\n *\n * Because of this idiosyncrasy in JavaScript's string implementation and APIs,\n * we must \"jump\" an extra index after encoding a character as a surrogate\n * pair. In practice, this means we must increment the index of our for loop by\n * 2 if we encode a surrogate pair, and 1 in all other cases.\n *\n * -----------------------------------------------------------------------------\n *\n * References:\n * - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf\n * 3.9 Unicode Encoding Forms - UTF-8\n * - [2] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding.html\n * - [3] http://www.herongyang.com/Unicode/UTF-8-UTF-8-Encoding-Algorithm.html\n * - [4] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description\n *\n */\nexport var utf8Encode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) { byteOrderMark = true; }\n var encoded = [];\n if (byteOrderMark)\n encoded.push(0xef, 0xbb, 0xbf);\n for (var idx = 0, len = input.length; idx < len;) {\n var codePoint = input.codePointAt(idx);\n // One byte encoding\n if (codePoint < 0x80) {\n var byte1 = codePoint & 0x7f;\n encoded.push(byte1);\n idx += 1;\n }\n // Two byte encoding\n else if (codePoint < 0x0800) {\n var byte1 = ((codePoint >> 6) & 0x1f) | 0xc0;\n var byte2 = (codePoint & 0x3f) | 0x80;\n encoded.push(byte1, byte2);\n idx += 1;\n }\n // Three byte encoding\n else if (codePoint < 0x010000) {\n var byte1 = ((codePoint >> 12) & 0x0f) | 0xe0;\n var byte2 = ((codePoint >> 6) & 0x3f) | 0x80;\n var byte3 = (codePoint & 0x3f) | 0x80;\n encoded.push(byte1, byte2, byte3);\n idx += 1;\n }\n // Four byte encoding (surrogate pair)\n else if (codePoint < 0x110000) {\n var byte1 = ((codePoint >> 18) & 0x07) | 0xf0;\n var byte2 = ((codePoint >> 12) & 0x3f) | 0x80;\n var byte3 = ((codePoint >> 6) & 0x3f) | 0x80;\n var byte4 = ((codePoint >> 0) & 0x3f) | 0x80;\n encoded.push(byte1, byte2, byte3, byte4);\n idx += 2;\n }\n // Should never reach this case\n else\n throw new Error(\"Invalid code point: 0x\" + toHexString(codePoint));\n }\n return new Uint8Array(encoded);\n};\n/**\n * Encodes a string to UTF-16.\n *\n * @param input The string to be encoded.\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be added\n * to the start of the encoding. (default `true`)\n * @returns A Uint16Array containing the UTF-16 encoding of the input string.\n *\n * -----------------------------------------------------------------------------\n *\n * JavaScript strings are composed of Unicode code points. Code points are\n * integers in the range 0 to 1,114,111 (0x10FFFF). When serializing a string,\n * it must be encoded as a sequence of words. A word is typically 8, 16, or 32\n * bytes in size. As such, Unicode defines three encoding forms: UTF-8, UTF-16,\n * and UTF-32. These encoding forms are described in the Unicode standard [1].\n * This function implements the UTF-16 encoding form.\n *\n * -----------------------------------------------------------------------------\n *\n * In UTF-16, each code point is mapped to one or two 16-bit integers. The\n * UTF-16 mapping logic is as follows [2]:\n *\n * • If a code point is in the range U+0000..U+FFFF, then map the code point to\n * a 16-bit integer with the most significant byte first.\n *\n * • If a code point is in the range U+10000..U+10000, then map the code point\n * to two 16-bit integers. The first integer should contain the high surrogate\n * and the second integer should contain the low surrogate. Both surrogates\n * should be written with the most significant byte first.\n *\n * -----------------------------------------------------------------------------\n *\n * It is important to note, when iterating through the code points of a string\n * in JavaScript, that if a character is encoded as a surrogate pair it will\n * increase the string's length by 2 instead of 1 [4]. For example:\n *\n * ```\n * > 'a'.length\n * 1\n * > '💩'.length\n * 2\n * > '語'.length\n * 1\n * > 'a💩語'.length\n * 4\n * ```\n *\n * The results of the above example are explained by the fact that the\n * characters 'a' and '語' are not represented by surrogate pairs, but '💩' is.\n *\n * Because of this idiosyncrasy in JavaScript's string implementation and APIs,\n * we must \"jump\" an extra index after encoding a character as a surrogate\n * pair. In practice, this means we must increment the index of our for loop by\n * 2 if we encode a surrogate pair, and 1 in all other cases.\n *\n * -----------------------------------------------------------------------------\n *\n * References:\n * - [1] https://www.unicode.org/versions/Unicode12.0.0/UnicodeStandard-12.0.pdf\n * 3.9 Unicode Encoding Forms - UTF-8\n * - [2] http://www.herongyang.com/Unicode/UTF-16-UTF-16-Encoding.html\n * - [3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#Description\n *\n */\nexport var utf16Encode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) { byteOrderMark = true; }\n var encoded = [];\n if (byteOrderMark)\n encoded.push(0xfeff);\n for (var idx = 0, len = input.length; idx < len;) {\n var codePoint = input.codePointAt(idx);\n // Two byte encoding\n if (codePoint < 0x010000) {\n encoded.push(codePoint);\n idx += 1;\n }\n // Four byte encoding (surrogate pair)\n else if (codePoint < 0x110000) {\n encoded.push(highSurrogate(codePoint), lowSurrogate(codePoint));\n idx += 2;\n }\n // Should never reach this case\n else\n throw new Error(\"Invalid code point: 0x\" + toHexString(codePoint));\n }\n return new Uint16Array(encoded);\n};\n/**\n * Returns `true` if the `codePoint` is within the\n * Basic Multilingual Plane (BMP). Code points inside the BMP are not encoded\n * with surrogate pairs.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nexport var isWithinBMP = function (codePoint) {\n return codePoint >= 0 && codePoint <= 0xffff;\n};\n/**\n * Returns `true` if the given `codePoint` is valid and must be represented\n * with a surrogate pair when encoded.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nexport var hasSurrogates = function (codePoint) {\n return codePoint >= 0x010000 && codePoint <= 0x10ffff;\n};\n// From Unicode 3.0 spec, section 3.7:\n// http://unicode.org/versions/Unicode3.0.0/ch03.pdf\nexport var highSurrogate = function (codePoint) {\n return Math.floor((codePoint - 0x10000) / 0x400) + 0xd800;\n};\n// From Unicode 3.0 spec, section 3.7:\n// http://unicode.org/versions/Unicode3.0.0/ch03.pdf\nexport var lowSurrogate = function (codePoint) {\n return ((codePoint - 0x10000) % 0x400) + 0xdc00;\n};\nvar ByteOrder;\n(function (ByteOrder) {\n ByteOrder[\"BigEndian\"] = \"BigEndian\";\n ByteOrder[\"LittleEndian\"] = \"LittleEndian\";\n})(ByteOrder || (ByteOrder = {}));\nvar REPLACEMENT = '�'.codePointAt(0);\n/**\n * Decodes a Uint8Array of data to a string using UTF-16.\n *\n * Note that this function attempts to recover from erronous input by\n * inserting the replacement character (�) to mark invalid code points\n * and surrogate pairs.\n *\n * @param input A Uint8Array containing UTF-16 encoded data\n * @param byteOrderMark Whether or not a byte order marker (BOM) should be read\n * at the start of the encoding. (default `true`)\n * @returns The decoded string.\n */\nexport var utf16Decode = function (input, byteOrderMark) {\n if (byteOrderMark === void 0) { byteOrderMark = true; }\n // Need at least 2 bytes of data in UTF-16 encodings\n if (input.length <= 1)\n return String.fromCodePoint(REPLACEMENT);\n var byteOrder = byteOrderMark ? readBOM(input) : ByteOrder.BigEndian;\n // Skip byte order mark if needed\n var idx = byteOrderMark ? 2 : 0;\n var codePoints = [];\n while (input.length - idx >= 2) {\n var first = decodeValues(input[idx++], input[idx++], byteOrder);\n if (isHighSurrogate(first)) {\n if (input.length - idx < 2) {\n // Need at least 2 bytes left for the low surrogate that is required\n codePoints.push(REPLACEMENT);\n }\n else {\n var second = decodeValues(input[idx++], input[idx++], byteOrder);\n if (isLowSurrogate(second)) {\n codePoints.push(first, second);\n }\n else {\n // Low surrogates should always follow high surrogates\n codePoints.push(REPLACEMENT);\n }\n }\n }\n else if (isLowSurrogate(first)) {\n // High surrogates should always come first since `decodeValues()`\n // accounts for the byte ordering\n idx += 2;\n codePoints.push(REPLACEMENT);\n }\n else {\n codePoints.push(first);\n }\n }\n // There shouldn't be extra byte(s) left over\n if (idx < input.length)\n codePoints.push(REPLACEMENT);\n return String.fromCodePoint.apply(String, codePoints);\n};\n/**\n * Returns `true` if the given `codePoint` is a high surrogate.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nvar isHighSurrogate = function (codePoint) {\n return codePoint >= 0xd800 && codePoint <= 0xdbff;\n};\n/**\n * Returns `true` if the given `codePoint` is a low surrogate.\n * @param codePoint The code point to be evaluated.\n *\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Description\n */\nvar isLowSurrogate = function (codePoint) {\n return codePoint >= 0xdc00 && codePoint <= 0xdfff;\n};\n/**\n * Decodes the given utf-16 values first and second using the specified\n * byte order.\n * @param first The first byte of the encoding.\n * @param second The second byte of the encoding.\n * @param byteOrder The byte order of the encoding.\n * Reference: https://en.wikipedia.org/wiki/UTF-16#Examples\n */\nvar decodeValues = function (first, second, byteOrder) {\n // Append the binary representation of the preceding byte by shifting the\n // first one 8 to the left and than applying a bitwise or-operator to append\n // the second one.\n if (byteOrder === ByteOrder.LittleEndian)\n return (second << 8) | first;\n if (byteOrder === ByteOrder.BigEndian)\n return (first << 8) | second;\n throw new Error(\"Invalid byteOrder: \" + byteOrder);\n};\n/**\n * Returns whether the given array contains a byte order mark for the\n * UTF-16BE or UTF-16LE encoding. If it has neither, BigEndian is assumed.\n *\n * Reference: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-16\n *\n * @param bytes The byte array to be evaluated.\n */\n// prettier-ignore\nvar readBOM = function (bytes) { return (hasUtf16BigEndianBOM(bytes) ? ByteOrder.BigEndian\n : hasUtf16LittleEndianBOM(bytes) ? ByteOrder.LittleEndian\n : ByteOrder.BigEndian); };\nvar hasUtf16BigEndianBOM = function (bytes) {\n return bytes[0] === 0xfe && bytes[1] === 0xff;\n};\nvar hasUtf16LittleEndianBOM = function (bytes) {\n return bytes[0] === 0xff && bytes[1] === 0xfe;\n};\nexport var hasUtf16BOM = function (bytes) {\n return hasUtf16BigEndianBOM(bytes) || hasUtf16LittleEndianBOM(bytes);\n};\n//# sourceMappingURL=unicode.js.map","export var toCharCode = function (character) { return character.charCodeAt(0); };\nexport var toCodePoint = function (character) { return character.codePointAt(0); };\nexport var toHexStringOfMinLength = function (num, minLength) {\n return padStart(num.toString(16), minLength, '0').toUpperCase();\n};\nexport var toHexString = function (num) { return toHexStringOfMinLength(num, 2); };\nexport var charFromCode = function (code) { return String.fromCharCode(code); };\nexport var charFromHexCode = function (hex) { return charFromCode(parseInt(hex, 16)); };\nexport var padStart = function (value, length, padChar) {\n var padding = '';\n for (var idx = 0, len = length - value.length; idx < len; idx++) {\n padding += padChar;\n }\n return padding + value;\n};\nexport var copyStringIntoBuffer = function (str, buffer, offset) {\n var length = str.length;\n for (var idx = 0; idx < length; idx++) {\n buffer[offset++] = str.charCodeAt(idx);\n }\n return length;\n};\nexport var addRandomSuffix = function (prefix, suffixLength) {\n if (suffixLength === void 0) { suffixLength = 4; }\n return prefix + \"-\" + Math.floor(Math.random() * Math.pow(10, suffixLength));\n};\nexport var escapeRegExp = function (str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n};\nexport var cleanText = function (text) {\n return text.replace(/\\t/g, ' ').replace(/[\\b\\v]/g, '');\n};\nvar buildWordBreakRegex = function (wordBreaks) {\n var escapedRules = ['$'];\n for (var idx = 0, len = wordBreaks.length; idx < len; idx++) {\n var wordBreak = wordBreaks[idx];\n if (wordBreak.includes('\\n') || wordBreak.includes('\\r')) {\n throw new TypeError('`wordBreak` must not include \\\\n or \\\\r');\n }\n escapedRules.push(wordBreak === '' ? '.' : escapeRegExp(wordBreak));\n }\n var breakRules = escapedRules.join('|');\n return new RegExp(\"(\\\\n|\\\\r)|((.*?)(\" + breakRules + \"))\", 'gm');\n};\nexport var breakTextIntoLines = function (text, wordBreaks, maxWidth, computeWidthOfText) {\n var regex = buildWordBreakRegex(wordBreaks);\n var words = cleanText(text).match(regex);\n var currLine = '';\n var currWidth = 0;\n var lines = [];\n var pushCurrLine = function () {\n if (currLine !== '')\n lines.push(currLine);\n currLine = '';\n currWidth = 0;\n };\n for (var idx = 0, len = words.length; idx < len; idx++) {\n var word = words[idx];\n if (word === '\\n' || word === '\\r') {\n pushCurrLine();\n }\n else {\n var width = computeWidthOfText(word);\n if (currWidth + width > maxWidth)\n pushCurrLine();\n currLine += word;\n currWidth += width;\n }\n }\n pushCurrLine();\n return lines;\n};\n// See section \"7.9.4 Dates\" of the PDF specification\nvar dateRegex = /^D:(\\d\\d\\d\\d)(\\d\\d)?(\\d\\d)?(\\d\\d)?(\\d\\d)?(\\d\\d)?([+\\-Z])?(\\d\\d)?'?(\\d\\d)?'?$/;\nexport var parseDate = function (dateStr) {\n var match = dateStr.match(dateRegex);\n if (!match)\n return undefined;\n var year = match[1], _a = match[2], month = _a === void 0 ? '01' : _a, _b = match[3], day = _b === void 0 ? '01' : _b, _c = match[4], hours = _c === void 0 ? '00' : _c, _d = match[5], mins = _d === void 0 ? '00' : _d, _e = match[6], secs = _e === void 0 ? '00' : _e, _f = match[7], offsetSign = _f === void 0 ? 'Z' : _f, _g = match[8], offsetHours = _g === void 0 ? '00' : _g, _h = match[9], offsetMins = _h === void 0 ? '00' : _h;\n // http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15\n var tzOffset = offsetSign === 'Z' ? 'Z' : \"\" + offsetSign + offsetHours + \":\" + offsetMins;\n var date = new Date(year + \"-\" + month + \"-\" + day + \"T\" + hours + \":\" + mins + \":\" + secs + tzOffset);\n return date;\n};\n//# sourceMappingURL=strings.js.map","import { decodeFromBase64DataUri } from \"./base64\";\nimport { charFromCode } from \"./strings\";\nexport var last = function (array) { return array[array.length - 1]; };\nexport var typedArrayFor = function (value) {\n if (value instanceof Uint8Array)\n return value;\n var length = value.length;\n var typedArray = new Uint8Array(length);\n for (var idx = 0; idx < length; idx++) {\n typedArray[idx] = value.charCodeAt(idx);\n }\n return typedArray;\n};\nexport var mergeIntoTypedArray = function () {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n var arrayCount = arrays.length;\n var typedArrays = [];\n for (var idx = 0; idx < arrayCount; idx++) {\n var element = arrays[idx];\n typedArrays[idx] =\n element instanceof Uint8Array ? element : typedArrayFor(element);\n }\n var totalSize = 0;\n for (var idx = 0; idx < arrayCount; idx++) {\n totalSize += arrays[idx].length;\n }\n var merged = new Uint8Array(totalSize);\n var offset = 0;\n for (var arrIdx = 0; arrIdx < arrayCount; arrIdx++) {\n var arr = typedArrays[arrIdx];\n for (var byteIdx = 0, arrLen = arr.length; byteIdx < arrLen; byteIdx++) {\n merged[offset++] = arr[byteIdx];\n }\n }\n return merged;\n};\nexport var mergeUint8Arrays = function (arrays) {\n var totalSize = 0;\n for (var idx = 0, len = arrays.length; idx < len; idx++) {\n totalSize += arrays[idx].length;\n }\n var mergedBuffer = new Uint8Array(totalSize);\n var offset = 0;\n for (var idx = 0, len = arrays.length; idx < len; idx++) {\n var array = arrays[idx];\n mergedBuffer.set(array, offset);\n offset += array.length;\n }\n return mergedBuffer;\n};\nexport var arrayAsString = function (array) {\n var str = '';\n for (var idx = 0, len = array.length; idx < len; idx++) {\n str += charFromCode(array[idx]);\n }\n return str;\n};\nexport var byAscendingId = function (a, b) { return a.id - b.id; };\nexport var sortedUniq = function (array, indexer) {\n var uniq = [];\n for (var idx = 0, len = array.length; idx < len; idx++) {\n var curr = array[idx];\n var prev = array[idx - 1];\n if (idx === 0 || indexer(curr) !== indexer(prev)) {\n uniq.push(curr);\n }\n }\n return uniq;\n};\n// Arrays and TypedArrays in JS both have .reverse() methods, which would seem\n// to negate the need for this function. However, not all runtimes support this\n// method (e.g. React Native). This function compensates for that fact.\nexport var reverseArray = function (array) {\n var arrayLen = array.length;\n for (var idx = 0, len = Math.floor(arrayLen / 2); idx < len; idx++) {\n var leftIdx = idx;\n var rightIdx = arrayLen - idx - 1;\n var temp = array[idx];\n array[leftIdx] = array[rightIdx];\n array[rightIdx] = temp;\n }\n return array;\n};\nexport var sum = function (array) {\n var total = 0;\n for (var idx = 0, len = array.length; idx < len; idx++) {\n total += array[idx];\n }\n return total;\n};\nexport var range = function (start, end) {\n var arr = new Array(end - start);\n for (var idx = 0, len = arr.length; idx < len; idx++) {\n arr[idx] = start + idx;\n }\n return arr;\n};\nexport var pluckIndices = function (arr, indices) {\n var plucked = new Array(indices.length);\n for (var idx = 0, len = indices.length; idx < len; idx++) {\n plucked[idx] = arr[indices[idx]];\n }\n return plucked;\n};\nexport var canBeConvertedToUint8Array = function (input) {\n return input instanceof Uint8Array ||\n input instanceof ArrayBuffer ||\n typeof input === 'string';\n};\nexport var toUint8Array = function (input) {\n if (typeof input === 'string') {\n return decodeFromBase64DataUri(input);\n }\n else if (input instanceof ArrayBuffer) {\n return new Uint8Array(input);\n }\n else if (input instanceof Uint8Array) {\n return input;\n }\n else {\n throw new TypeError('`input` must be one of `string | ArrayBuffer | Uint8Array`');\n }\n};\n//# sourceMappingURL=arrays.js.map","/**\n * Returns a Promise that resolves after at least one tick of the\n * Macro Task Queue occurs.\n */\nexport var waitForTick = function () {\n return new Promise(function (resolve) {\n setTimeout(function () { return resolve(); }, 0);\n });\n};\n//# sourceMappingURL=async.js.map","// tslint:disable radix\n/**\n * Converts a number to its string representation in decimal. This function\n * differs from simply converting a number to a string with `.toString()`\n * because this function's output string will **not** contain exponential\n * notation.\n *\n * Credit: https://stackoverflow.com/a/46545519\n */\nexport var numberToString = function (num) {\n var numStr = String(num);\n if (Math.abs(num) < 1.0) {\n var e = parseInt(num.toString().split('e-')[1]);\n if (e) {\n var negative = num < 0;\n if (negative)\n num *= -1;\n num *= Math.pow(10, e - 1);\n numStr = '0.' + new Array(e).join('0') + num.toString().substring(2);\n if (negative)\n numStr = '-' + numStr;\n }\n }\n else {\n var e = parseInt(num.toString().split('+')[1]);\n if (e > 20) {\n e -= 20;\n num /= Math.pow(10, e);\n numStr = num.toString() + new Array(e + 1).join('0');\n }\n }\n return numStr;\n};\nexport var sizeInBytes = function (n) { return Math.ceil(n.toString(2).length / 8); };\n/**\n * Converts a number into its constituent bytes and returns them as\n * a number[].\n *\n * Returns most significant byte as first element in array. It may be necessary\n * to call .reverse() to get the bits in the desired order.\n *\n * Example:\n * bytesFor(0x02A41E) => [ 0b10, 0b10100100, 0b11110 ]\n *\n * Credit for algorithm: https://stackoverflow.com/a/1936865\n */\nexport var bytesFor = function (n) {\n var bytes = new Uint8Array(sizeInBytes(n));\n for (var i = 1; i <= bytes.length; i++) {\n bytes[i - 1] = n >> ((bytes.length - i) * 8);\n }\n return bytes;\n};\n//# sourceMappingURL=numbers.js.map","export var error = function (msg) {\n throw new Error(msg);\n};\n//# sourceMappingURL=errors.js.map","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n \"use strict\";\n\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n // Use a lookup table to find the index.\n var lookup = new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n\n exports.encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i, len = bytes.length, base64 = \"\";\n\n for (i = 0; i < len; i+=3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if ((len % 3) === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function(base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length, i, p = 0,\n encoded1, encoded2, encoded3, encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i+=4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i+1)];\n encoded3 = lookup[base64.charCodeAt(i+2)];\n encoded4 = lookup[base64.charCodeAt(i+3)];\n\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n\n return arraybuffer;\n };\n})();\n","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\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\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [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\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/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(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\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_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\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction 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\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction 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 } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\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 */\nfunction 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\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction 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\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 */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// 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; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\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]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* 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\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) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n 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 */\nfunction 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); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\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 }\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\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 }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* 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 }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\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 n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 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\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\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\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\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/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction 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); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\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 */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\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 */\nfunction 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; /* 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 &&\n 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)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction 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; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\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\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\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\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\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 */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// 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, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\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\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\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]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\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/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* 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/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\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\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\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction 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; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\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\n count = 0;\n prevlen = curlen;\n\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\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction 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; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\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\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\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 */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\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\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\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]/*.Len*/ !== 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;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\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 */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\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); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* 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]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\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 */\nfunction 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\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\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\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\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\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _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); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\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 */\nfunction _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\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 */\nfunction _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, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\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\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // 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\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\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;\n\n // 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\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\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\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 }\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\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _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 //var out_length, in_length, dcode;\n\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\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* 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\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\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\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\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\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\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\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\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\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\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\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\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\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\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\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 */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_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) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, 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\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(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\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\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 */\nfunction 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\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 */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\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 */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\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\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) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\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\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\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++;\n // Assert(*scan == *match, \"match[2]?\");\n\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] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\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\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\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 */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // 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\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\n utils.arraySet(s.window, s.window, _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\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 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 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\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\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\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#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 = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\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) {\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\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\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// var curr = s.strstart + s.lookahead;\n// var 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/* ===========================================================================\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 */\nfunction 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\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\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\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\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\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\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\n s.insert = 0;\n\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\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\n return BS_NEED_MORE;\n}\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 */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\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; /* flush the current block */\n }\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/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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\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/*NIL*/ && ((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) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\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/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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 } else\n {\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 = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#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 } 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 = trees._tr_tally(s, 0, s.window[s.strstart]);\n\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)) ? s.strstart : MIN_MATCH - 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/* ===========================================================================\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 */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\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) { break; } /* 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/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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\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;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\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 <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*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;\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 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\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 = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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;\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 } 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 = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\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 } 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 }\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 = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 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\n return BS_BLOCK_DONE;\n}\n\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 */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\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) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && 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;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\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 = trees._tr_tally(s, 0, s.window[s.strstart]);\n\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/* ===========================================================================\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 */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\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; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(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\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 */\nfunction 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\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\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\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;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\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\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\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\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\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\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\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\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\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\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\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\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\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* 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\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\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\n this.last_lit = 0; /* running index in l_buf */\n\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\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\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\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\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\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 = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\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\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) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // 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) { // 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 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 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 );\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 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 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(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\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 }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\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(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(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/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\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 } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\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 } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\n//#endif\n\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\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 } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\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\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\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 trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(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); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\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; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { 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 {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\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) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n 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 ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\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(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(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 tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n 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) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 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;\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\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\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\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\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\nvar _utf8len = new utils.Buf8(256);\nfor (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\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\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\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\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 } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\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 } 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\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\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\nfunction 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 = ''/*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/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\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\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\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) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\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/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\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 * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\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 * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var 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 **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\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\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - 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 have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\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 **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\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 **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\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) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\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 * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\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\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\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\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\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\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\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\nmodule.exports = {\n\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\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\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\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\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\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\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\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 inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\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\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - 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 inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\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 **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\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 **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","import { decompressJson } from './utils';\nimport CourierBoldCompressed from './Courier-Bold.compressed.json';\nimport CourierBoldObliqueCompressed from './Courier-BoldOblique.compressed.json';\nimport CourierObliqueCompressed from './Courier-Oblique.compressed.json';\nimport CourierCompressed from './Courier.compressed.json';\nimport HelveticaBoldCompressed from './Helvetica-Bold.compressed.json';\nimport HelveticaBoldObliqueCompressed from './Helvetica-BoldOblique.compressed.json';\nimport HelveticaObliqueCompressed from './Helvetica-Oblique.compressed.json';\nimport HelveticaCompressed from './Helvetica.compressed.json';\nimport TimesBoldCompressed from './Times-Bold.compressed.json';\nimport TimesBoldItalicCompressed from './Times-BoldItalic.compressed.json';\nimport TimesItalicCompressed from './Times-Italic.compressed.json';\nimport TimesRomanCompressed from './Times-Roman.compressed.json';\nimport SymbolCompressed from './Symbol.compressed.json';\nimport ZapfDingbatsCompressed from './ZapfDingbats.compressed.json';\n// prettier-ignore\nvar compressedJsonForFontName = {\n 'Courier': CourierCompressed,\n 'Courier-Bold': CourierBoldCompressed,\n 'Courier-Oblique': CourierObliqueCompressed,\n 'Courier-BoldOblique': CourierBoldObliqueCompressed,\n 'Helvetica': HelveticaCompressed,\n 'Helvetica-Bold': HelveticaBoldCompressed,\n 'Helvetica-Oblique': HelveticaObliqueCompressed,\n 'Helvetica-BoldOblique': HelveticaBoldObliqueCompressed,\n 'Times-Roman': TimesRomanCompressed,\n 'Times-Bold': TimesBoldCompressed,\n 'Times-Italic': TimesItalicCompressed,\n 'Times-BoldItalic': TimesBoldItalicCompressed,\n 'Symbol': SymbolCompressed,\n 'ZapfDingbats': ZapfDingbatsCompressed,\n};\nexport var FontNames;\n(function (FontNames) {\n FontNames[\"Courier\"] = \"Courier\";\n FontNames[\"CourierBold\"] = \"Courier-Bold\";\n FontNames[\"CourierOblique\"] = \"Courier-Oblique\";\n FontNames[\"CourierBoldOblique\"] = \"Courier-BoldOblique\";\n FontNames[\"Helvetica\"] = \"Helvetica\";\n FontNames[\"HelveticaBold\"] = \"Helvetica-Bold\";\n FontNames[\"HelveticaOblique\"] = \"Helvetica-Oblique\";\n FontNames[\"HelveticaBoldOblique\"] = \"Helvetica-BoldOblique\";\n FontNames[\"TimesRoman\"] = \"Times-Roman\";\n FontNames[\"TimesRomanBold\"] = \"Times-Bold\";\n FontNames[\"TimesRomanItalic\"] = \"Times-Italic\";\n FontNames[\"TimesRomanBoldItalic\"] = \"Times-BoldItalic\";\n FontNames[\"Symbol\"] = \"Symbol\";\n FontNames[\"ZapfDingbats\"] = \"ZapfDingbats\";\n})(FontNames || (FontNames = {}));\nvar fontCache = {};\nvar Font = /** @class */ (function () {\n function Font() {\n var _this = this;\n this.getWidthOfGlyph = function (glyphName) {\n return _this.CharWidths[glyphName];\n };\n this.getXAxisKerningForPair = function (leftGlyphName, rightGlyphName) {\n return (_this.KernPairXAmounts[leftGlyphName] || {})[rightGlyphName];\n };\n }\n Font.load = function (fontName) {\n var cachedFont = fontCache[fontName];\n if (cachedFont)\n return cachedFont;\n var json = decompressJson(compressedJsonForFontName[fontName]);\n var font = Object.assign(new Font(), JSON.parse(json));\n font.CharWidths = font.CharMetrics.reduce(function (acc, metric) {\n acc[metric.N] = metric.WX;\n return acc;\n }, {});\n font.KernPairXAmounts = font.KernPairs.reduce(function (acc, _a) {\n var name1 = _a[0], name2 = _a[1], width = _a[2];\n if (!acc[name1])\n acc[name1] = {};\n acc[name1][name2] = width;\n return acc;\n }, {});\n fontCache[fontName] = font;\n return font;\n };\n return Font;\n}());\nexport { Font };\n","import * as base64 from 'base64-arraybuffer';\nimport pako from 'pako';\nvar arrayToString = function (array) {\n var str = '';\n for (var i = 0; i < array.length; i++) {\n str += String.fromCharCode(array[i]);\n }\n return str;\n};\nexport var decompressJson = function (compressedJson) {\n return arrayToString(pako.inflate(base64.decode(compressedJson)));\n};\n","import { toCharCode } from \"./strings\";\n// Mapping from PDFDocEncoding to Unicode code point\nvar pdfDocEncodingToUnicode = new Uint16Array(256);\n// Initialize the code points which are the same\nfor (var idx = 0; idx < 256; idx++) {\n pdfDocEncodingToUnicode[idx] = idx;\n}\n// Set differences (see \"Table D.2 – PDFDocEncoding Character Set\" of the PDF spec)\npdfDocEncodingToUnicode[0x16] = toCharCode('\\u0017'); // SYNCRONOUS IDLE\npdfDocEncodingToUnicode[0x18] = toCharCode('\\u02D8'); // BREVE\npdfDocEncodingToUnicode[0x19] = toCharCode('\\u02C7'); // CARON\npdfDocEncodingToUnicode[0x1a] = toCharCode('\\u02C6'); // MODIFIER LETTER CIRCUMFLEX ACCENT\npdfDocEncodingToUnicode[0x1b] = toCharCode('\\u02D9'); // DOT ABOVE\npdfDocEncodingToUnicode[0x1c] = toCharCode('\\u02DD'); // DOUBLE ACUTE ACCENT\npdfDocEncodingToUnicode[0x1d] = toCharCode('\\u02DB'); // OGONEK\npdfDocEncodingToUnicode[0x1e] = toCharCode('\\u02DA'); // RING ABOVE\npdfDocEncodingToUnicode[0x1f] = toCharCode('\\u02DC'); // SMALL TILDE\npdfDocEncodingToUnicode[0x7f] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\npdfDocEncodingToUnicode[0x80] = toCharCode('\\u2022'); // BULLET\npdfDocEncodingToUnicode[0x81] = toCharCode('\\u2020'); // DAGGER\npdfDocEncodingToUnicode[0x82] = toCharCode('\\u2021'); // DOUBLE DAGGER\npdfDocEncodingToUnicode[0x83] = toCharCode('\\u2026'); // HORIZONTAL ELLIPSIS\npdfDocEncodingToUnicode[0x84] = toCharCode('\\u2014'); // EM DASH\npdfDocEncodingToUnicode[0x85] = toCharCode('\\u2013'); // EN DASH\npdfDocEncodingToUnicode[0x86] = toCharCode('\\u0192'); // LATIN SMALL LETTER SCRIPT F\npdfDocEncodingToUnicode[0x87] = toCharCode('\\u2044'); // FRACTION SLASH (solidus)\npdfDocEncodingToUnicode[0x88] = toCharCode('\\u2039'); // SINGLE LEFT-POINTING ANGLE QUOTATION MARK\npdfDocEncodingToUnicode[0x89] = toCharCode('\\u203A'); // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK\npdfDocEncodingToUnicode[0x8a] = toCharCode('\\u2212'); // MINUS SIGN\npdfDocEncodingToUnicode[0x8b] = toCharCode('\\u2030'); // PER MILLE SIGN\npdfDocEncodingToUnicode[0x8c] = toCharCode('\\u201E'); // DOUBLE LOW-9 QUOTATION MARK (quotedblbase)\npdfDocEncodingToUnicode[0x8d] = toCharCode('\\u201C'); // LEFT DOUBLE QUOTATION MARK (quotedblleft)\npdfDocEncodingToUnicode[0x8e] = toCharCode('\\u201D'); // RIGHT DOUBLE QUOTATION MARK (quotedblright)\npdfDocEncodingToUnicode[0x8f] = toCharCode('\\u2018'); // LEFT SINGLE QUOTATION MARK (quoteleft)\npdfDocEncodingToUnicode[0x90] = toCharCode('\\u2019'); // RIGHT SINGLE QUOTATION MARK (quoteright)\npdfDocEncodingToUnicode[0x91] = toCharCode('\\u201A'); // SINGLE LOW-9 QUOTATION MARK (quotesinglbase)\npdfDocEncodingToUnicode[0x92] = toCharCode('\\u2122'); // TRADE MARK SIGN\npdfDocEncodingToUnicode[0x93] = toCharCode('\\uFB01'); // LATIN SMALL LIGATURE FI\npdfDocEncodingToUnicode[0x94] = toCharCode('\\uFB02'); // LATIN SMALL LIGATURE FL\npdfDocEncodingToUnicode[0x95] = toCharCode('\\u0141'); // LATIN CAPITAL LETTER L WITH STROKE\npdfDocEncodingToUnicode[0x96] = toCharCode('\\u0152'); // LATIN CAPITAL LIGATURE OE\npdfDocEncodingToUnicode[0x97] = toCharCode('\\u0160'); // LATIN CAPITAL LETTER S WITH CARON\npdfDocEncodingToUnicode[0x98] = toCharCode('\\u0178'); // LATIN CAPITAL LETTER Y WITH DIAERESIS\npdfDocEncodingToUnicode[0x99] = toCharCode('\\u017D'); // LATIN CAPITAL LETTER Z WITH CARON\npdfDocEncodingToUnicode[0x9a] = toCharCode('\\u0131'); // LATIN SMALL LETTER DOTLESS I\npdfDocEncodingToUnicode[0x9b] = toCharCode('\\u0142'); // LATIN SMALL LETTER L WITH STROKE\npdfDocEncodingToUnicode[0x9c] = toCharCode('\\u0153'); // LATIN SMALL LIGATURE OE\npdfDocEncodingToUnicode[0x9d] = toCharCode('\\u0161'); // LATIN SMALL LETTER S WITH CARON\npdfDocEncodingToUnicode[0x9e] = toCharCode('\\u017E'); // LATIN SMALL LETTER Z WITH CARON\npdfDocEncodingToUnicode[0x9f] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\npdfDocEncodingToUnicode[0xa0] = toCharCode('\\u20AC'); // EURO SIGN\npdfDocEncodingToUnicode[0xad] = toCharCode('\\uFFFD'); // REPLACEMENT CHARACTER (box with questionmark)\n/**\n * Decode a byte array into a string using PDFDocEncoding.\n *\n * @param bytes a byte array (decimal representation) containing a string\n * encoded with PDFDocEncoding.\n */\nexport var pdfDocEncodingDecode = function (bytes) {\n var codePoints = new Array(bytes.length);\n for (var idx = 0, len = bytes.length; idx < len; idx++) {\n codePoints[idx] = pdfDocEncodingToUnicode[bytes[idx]];\n }\n return String.fromCodePoint.apply(String, codePoints);\n};\n//# sourceMappingURL=pdfDocEncoding.js.map","/* tslint:disable max-classes-per-file */\nimport { decompressJson } from './utils';\nimport AllEncodingsCompressed from './all-encodings.compressed.json';\nvar decompressedEncodings = decompressJson(AllEncodingsCompressed);\nvar allUnicodeMappings = JSON.parse(decompressedEncodings);\nvar Encoding = /** @class */ (function () {\n function Encoding(name, unicodeMappings) {\n var _this = this;\n this.canEncodeUnicodeCodePoint = function (codePoint) {\n return codePoint in _this.unicodeMappings;\n };\n this.encodeUnicodeCodePoint = function (codePoint) {\n var mapped = _this.unicodeMappings[codePoint];\n if (!mapped) {\n var str = String.fromCharCode(codePoint);\n var msg = _this.name + \" cannot encode \\\"\" + str + \"\\\"\";\n throw new Error(msg);\n }\n return { code: mapped[0], name: mapped[1] };\n };\n this.name = name;\n this.unicodeMappings = unicodeMappings;\n }\n return Encoding;\n}());\nexport var Encodings = {\n Symbol: new Encoding('Symbol', allUnicodeMappings.symbol),\n ZapfDingbats: new Encoding('ZapfDingbats', allUnicodeMappings.zapfdingbats),\n WinAnsi: new Encoding('WinAnsi', allUnicodeMappings.win1252),\n};\n","import { FontNames } from '@pdf-lib/standard-fonts';\nexport var values = function (obj) { return Object.keys(obj).map(function (k) { return obj[k]; }); };\nexport var StandardFontValues = values(FontNames);\nexport var isStandardFont = function (input) {\n return StandardFontValues.includes(input);\n};\nexport var rectanglesAreEqual = function (a, b) { return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; };\n//# sourceMappingURL=objects.js.map","/* tslint:disable:ban-types */\nexport var backtick = function (val) { return \"`\" + val + \"`\"; };\nexport var getType = function (val) {\n if (val === null)\n return 'null';\n if (val === undefined)\n return 'undefined';\n if (typeof val === 'string')\n return 'string';\n if (isNaN(val))\n return 'NaN';\n if (typeof val === 'number')\n return 'number';\n if (typeof val === 'boolean')\n return 'boolean';\n if (typeof val === 'symbol')\n return 'symbol';\n if (typeof val === 'bigint')\n return 'bigint';\n if (val.constructor && val.constructor.name)\n return val.constructor.name;\n if (val.name)\n return val.name;\n if (val.constructor)\n return String(val.constructor);\n return String(val);\n};\nexport var isType = function (value, type) {\n if (type === 'null')\n return value === null;\n if (type === 'undefined')\n return value === undefined;\n if (type === 'string')\n return typeof value === 'string';\n if (type === 'number')\n return typeof value === 'number' && !isNaN(value);\n if (type === 'boolean')\n return typeof value === 'boolean';\n if (type === 'symbol')\n return typeof value === 'symbol';\n if (type === 'bigint')\n return typeof value === 'bigint';\n if (type === Array)\n return value instanceof Array;\n if (type === Uint8Array)\n return value instanceof Uint8Array;\n if (type === ArrayBuffer)\n return value instanceof ArrayBuffer;\n return value instanceof type[0];\n};\nexport var createTypeErrorMsg = function (value, valueName, types) {\n var allowedTypes = new Array(types.length);\n for (var idx = 0, len = types.length; idx < len; idx++) {\n var type = types[idx];\n if (type === 'null')\n allowedTypes[idx] = backtick('null');\n if (type === 'undefined')\n allowedTypes[idx] = backtick('undefined');\n if (type === 'string')\n allowedTypes[idx] = backtick('string');\n else if (type === 'number')\n allowedTypes[idx] = backtick('number');\n else if (type === 'boolean')\n allowedTypes[idx] = backtick('boolean');\n else if (type === 'symbol')\n allowedTypes[idx] = backtick('symbol');\n else if (type === 'bigint')\n allowedTypes[idx] = backtick('bigint');\n else if (type === Array)\n allowedTypes[idx] = backtick('Array');\n else if (type === Uint8Array)\n allowedTypes[idx] = backtick('Uint8Array');\n else if (type === ArrayBuffer)\n allowedTypes[idx] = backtick('ArrayBuffer');\n else\n allowedTypes[idx] = backtick(type[1]);\n }\n var joinedTypes = allowedTypes.join(' or ');\n // prettier-ignore\n return backtick(valueName) + \" must be of type \" + joinedTypes + \", but was actually of type \" + backtick(getType(value));\n};\nexport var assertIs = function (value, valueName, types) {\n for (var idx = 0, len = types.length; idx < len; idx++) {\n if (isType(value, types[idx]))\n return;\n }\n throw new TypeError(createTypeErrorMsg(value, valueName, types));\n};\nexport var assertOrUndefined = function (value, valueName, types) {\n assertIs(value, valueName, types.concat('undefined'));\n};\nexport var assertEachIs = function (values, valueName, types) {\n for (var idx = 0, len = values.length; idx < len; idx++) {\n assertIs(values[idx], valueName, types);\n }\n};\nexport var assertRange = function (value, valueName, min, max) {\n assertIs(value, valueName, ['number']);\n assertIs(min, 'min', ['number']);\n assertIs(max, 'max', ['number']);\n max = Math.max(min, max);\n if (value < min || value > max) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be at least \" + min + \" and at most \" + max + \", but was actually \" + value);\n }\n};\nexport var assertMultiple = function (value, valueName, multiplier) {\n assertIs(value, valueName, ['number']);\n if (value % multiplier !== 0) {\n // prettier-ignore\n throw new Error(backtick(valueName) + \" must be a multiple of \" + multiplier + \", but was actually \" + value);\n }\n};\n//# sourceMappingURL=validators.js.map","var CharCodes;\n(function (CharCodes) {\n CharCodes[CharCodes[\"Null\"] = 0] = \"Null\";\n CharCodes[CharCodes[\"Backspace\"] = 8] = \"Backspace\";\n CharCodes[CharCodes[\"Tab\"] = 9] = \"Tab\";\n CharCodes[CharCodes[\"Newline\"] = 10] = \"Newline\";\n CharCodes[CharCodes[\"FormFeed\"] = 12] = \"FormFeed\";\n CharCodes[CharCodes[\"CarriageReturn\"] = 13] = \"CarriageReturn\";\n CharCodes[CharCodes[\"Space\"] = 32] = \"Space\";\n CharCodes[CharCodes[\"ExclamationPoint\"] = 33] = \"ExclamationPoint\";\n CharCodes[CharCodes[\"Hash\"] = 35] = \"Hash\";\n CharCodes[CharCodes[\"Percent\"] = 37] = \"Percent\";\n CharCodes[CharCodes[\"LeftParen\"] = 40] = \"LeftParen\";\n CharCodes[CharCodes[\"RightParen\"] = 41] = \"RightParen\";\n CharCodes[CharCodes[\"Plus\"] = 43] = \"Plus\";\n CharCodes[CharCodes[\"Minus\"] = 45] = \"Minus\";\n CharCodes[CharCodes[\"Dash\"] = 45] = \"Dash\";\n CharCodes[CharCodes[\"Period\"] = 46] = \"Period\";\n CharCodes[CharCodes[\"ForwardSlash\"] = 47] = \"ForwardSlash\";\n CharCodes[CharCodes[\"Zero\"] = 48] = \"Zero\";\n CharCodes[CharCodes[\"One\"] = 49] = \"One\";\n CharCodes[CharCodes[\"Two\"] = 50] = \"Two\";\n CharCodes[CharCodes[\"Three\"] = 51] = \"Three\";\n CharCodes[CharCodes[\"Four\"] = 52] = \"Four\";\n CharCodes[CharCodes[\"Five\"] = 53] = \"Five\";\n CharCodes[CharCodes[\"Six\"] = 54] = \"Six\";\n CharCodes[CharCodes[\"Seven\"] = 55] = \"Seven\";\n CharCodes[CharCodes[\"Eight\"] = 56] = \"Eight\";\n CharCodes[CharCodes[\"Nine\"] = 57] = \"Nine\";\n CharCodes[CharCodes[\"LessThan\"] = 60] = \"LessThan\";\n CharCodes[CharCodes[\"GreaterThan\"] = 62] = \"GreaterThan\";\n CharCodes[CharCodes[\"A\"] = 65] = \"A\";\n CharCodes[CharCodes[\"D\"] = 68] = \"D\";\n CharCodes[CharCodes[\"E\"] = 69] = \"E\";\n CharCodes[CharCodes[\"F\"] = 70] = \"F\";\n CharCodes[CharCodes[\"O\"] = 79] = \"O\";\n CharCodes[CharCodes[\"P\"] = 80] = \"P\";\n CharCodes[CharCodes[\"R\"] = 82] = \"R\";\n CharCodes[CharCodes[\"LeftSquareBracket\"] = 91] = \"LeftSquareBracket\";\n CharCodes[CharCodes[\"BackSlash\"] = 92] = \"BackSlash\";\n CharCodes[CharCodes[\"RightSquareBracket\"] = 93] = \"RightSquareBracket\";\n CharCodes[CharCodes[\"a\"] = 97] = \"a\";\n CharCodes[CharCodes[\"b\"] = 98] = \"b\";\n CharCodes[CharCodes[\"d\"] = 100] = \"d\";\n CharCodes[CharCodes[\"e\"] = 101] = \"e\";\n CharCodes[CharCodes[\"f\"] = 102] = \"f\";\n CharCodes[CharCodes[\"i\"] = 105] = \"i\";\n CharCodes[CharCodes[\"j\"] = 106] = \"j\";\n CharCodes[CharCodes[\"l\"] = 108] = \"l\";\n CharCodes[CharCodes[\"m\"] = 109] = \"m\";\n CharCodes[CharCodes[\"n\"] = 110] = \"n\";\n CharCodes[CharCodes[\"o\"] = 111] = \"o\";\n CharCodes[CharCodes[\"r\"] = 114] = \"r\";\n CharCodes[CharCodes[\"s\"] = 115] = \"s\";\n CharCodes[CharCodes[\"t\"] = 116] = \"t\";\n CharCodes[CharCodes[\"u\"] = 117] = \"u\";\n CharCodes[CharCodes[\"x\"] = 120] = \"x\";\n CharCodes[CharCodes[\"LeftCurly\"] = 123] = \"LeftCurly\";\n CharCodes[CharCodes[\"RightCurly\"] = 125] = \"RightCurly\";\n CharCodes[CharCodes[\"Tilde\"] = 126] = \"Tilde\";\n})(CharCodes || (CharCodes = {}));\nexport default CharCodes;\n//# sourceMappingURL=CharCodes.js.map","var Cache = /** @class */ (function () {\n function Cache(populate) {\n this.populate = populate;\n this.value = undefined;\n }\n Cache.prototype.access = function () {\n if (!this.value)\n this.value = this.populate();\n return this.value;\n };\n Cache.prototype.invalidate = function () {\n this.value = undefined;\n };\n Cache.populatedBy = function (populate) { return new Cache(populate); };\n return Cache;\n}());\nexport default Cache;\n//# sourceMappingURL=Cache.js.map","import { __extends } from \"tslib\";\nimport { arrayAsString } from \"../utils\";\nvar MethodNotImplementedError = /** @class */ (function (_super) {\n __extends(MethodNotImplementedError, _super);\n function MethodNotImplementedError(className, methodName) {\n var _this = this;\n var msg = \"Method \" + className + \".\" + methodName + \"() not implemented\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MethodNotImplementedError;\n}(Error));\nexport { MethodNotImplementedError };\nvar PrivateConstructorError = /** @class */ (function (_super) {\n __extends(PrivateConstructorError, _super);\n function PrivateConstructorError(className) {\n var _this = this;\n var msg = \"Cannot construct \" + className + \" - it has a private constructor\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PrivateConstructorError;\n}(Error));\nexport { PrivateConstructorError };\nvar UnexpectedObjectTypeError = /** @class */ (function (_super) {\n __extends(UnexpectedObjectTypeError, _super);\n function UnexpectedObjectTypeError(expected, actual) {\n var _this = this;\n var expectedTypes = Array.isArray(expected)\n ? expected.map(function (_a) {\n var name = _a.name;\n return name;\n })\n : [expected.name];\n var msg = \"Expected instance of \" + expectedTypes.join(' or ') + \", \" +\n (\"but got instance of \" + (actual ? actual.constructor.name : actual));\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnexpectedObjectTypeError;\n}(Error));\nexport { UnexpectedObjectTypeError };\nvar UnsupportedEncodingError = /** @class */ (function (_super) {\n __extends(UnsupportedEncodingError, _super);\n function UnsupportedEncodingError(encoding) {\n var _this = this;\n var msg = encoding + \" stream encoding not supported\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnsupportedEncodingError;\n}(Error));\nexport { UnsupportedEncodingError };\nvar ReparseError = /** @class */ (function (_super) {\n __extends(ReparseError, _super);\n function ReparseError(className, methodName) {\n var _this = this;\n var msg = \"Cannot call \" + className + \".\" + methodName + \"() more than once\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ReparseError;\n}(Error));\nexport { ReparseError };\nvar MissingCatalogError = /** @class */ (function (_super) {\n __extends(MissingCatalogError, _super);\n function MissingCatalogError(ref) {\n var _this = this;\n var msg = \"Missing catalog (ref=\" + ref + \")\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingCatalogError;\n}(Error));\nexport { MissingCatalogError };\nvar MissingPageContentsEmbeddingError = /** @class */ (function (_super) {\n __extends(MissingPageContentsEmbeddingError, _super);\n function MissingPageContentsEmbeddingError() {\n var _this = this;\n var msg = \"Can't embed page with missing Contents\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return MissingPageContentsEmbeddingError;\n}(Error));\nexport { MissingPageContentsEmbeddingError };\nvar UnrecognizedStreamTypeError = /** @class */ (function (_super) {\n __extends(UnrecognizedStreamTypeError, _super);\n function UnrecognizedStreamTypeError(stream) {\n var _a, _b, _c;\n var _this = this;\n var streamType = (_c = (_b = (_a = stream === null || stream === void 0 ? void 0 : stream.contructor) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : stream === null || stream === void 0 ? void 0 : stream.name) !== null && _c !== void 0 ? _c : stream;\n var msg = \"Unrecognized stream type: \" + streamType;\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return UnrecognizedStreamTypeError;\n}(Error));\nexport { UnrecognizedStreamTypeError };\nvar PageEmbeddingMismatchedContextError = /** @class */ (function (_super) {\n __extends(PageEmbeddingMismatchedContextError, _super);\n function PageEmbeddingMismatchedContextError() {\n var _this = this;\n var msg = \"Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PageEmbeddingMismatchedContextError;\n}(Error));\nexport { PageEmbeddingMismatchedContextError };\nvar PDFArrayIsNotRectangleError = /** @class */ (function (_super) {\n __extends(PDFArrayIsNotRectangleError, _super);\n function PDFArrayIsNotRectangleError(size) {\n var _this = this;\n var msg = \"Attempted to convert PDFArray with \" + size + \" elements to rectangle, but must have exactly 4 elements.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PDFArrayIsNotRectangleError;\n}(Error));\nexport { PDFArrayIsNotRectangleError };\nvar InvalidPDFDateStringError = /** @class */ (function (_super) {\n __extends(InvalidPDFDateStringError, _super);\n function InvalidPDFDateStringError(value) {\n var _this = this;\n var msg = \"Attempted to convert \\\"\" + value + \"\\\" to a date, but it does not match the PDF date string format.\";\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return InvalidPDFDateStringError;\n}(Error));\nexport { InvalidPDFDateStringError };\nvar NumberParsingError = /** @class */ (function (_super) {\n __extends(NumberParsingError, _super);\n function NumberParsingError(pos, value) {\n var _this = this;\n var msg = \"Failed to parse number \" +\n (\"(line:\" + pos.line + \" col:\" + pos.column + \" offset=\" + pos.offset + \"): \\\"\" + value + \"\\\"\");\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return NumberParsingError;\n}(Error));\nexport { NumberParsingError };\nvar PDFParsingError = /** @class */ (function (_super) {\n __extends(PDFParsingError, _super);\n function PDFParsingError(pos, details) {\n var _this = this;\n var msg = \"Failed to parse PDF document \" +\n (\"(line:\" + pos.line + \" col:\" + pos.column + \" offset=\" + pos.offset + \"): \" + details);\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return PDFParsingError;\n}(Error));\nexport { PDFParsingError };\nvar NextByteAssertionError = /** @class */ (function (_super) {\n __extends(NextByteAssertionError, _super);\n function NextByteAssertionError(pos, expectedByte, actualByte) {\n var _this = this;\n var msg = \"Expected next byte to be \" + expectedByte + \" but it was actually \" + actualByte;\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return NextByteAssertionError;\n}(PDFParsingError));\nexport { NextByteAssertionError };\nvar PDFObjectParsingError = /** @class */ (function (_super) {\n __extends(PDFObjectParsingError, _super);\n function PDFObjectParsingError(pos, byte) {\n var _this = this;\n var msg = \"Failed to parse PDF object starting with the following byte: \" + byte;\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFObjectParsingError;\n}(PDFParsingError));\nexport { PDFObjectParsingError };\nvar PDFInvalidObjectParsingError = /** @class */ (function (_super) {\n __extends(PDFInvalidObjectParsingError, _super);\n function PDFInvalidObjectParsingError(pos) {\n var _this = this;\n var msg = \"Failed to parse invalid PDF object\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFInvalidObjectParsingError;\n}(PDFParsingError));\nexport { PDFInvalidObjectParsingError };\nvar PDFStreamParsingError = /** @class */ (function (_super) {\n __extends(PDFStreamParsingError, _super);\n function PDFStreamParsingError(pos) {\n var _this = this;\n var msg = \"Failed to parse PDF stream\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return PDFStreamParsingError;\n}(PDFParsingError));\nexport { PDFStreamParsingError };\nvar UnbalancedParenthesisError = /** @class */ (function (_super) {\n __extends(UnbalancedParenthesisError, _super);\n function UnbalancedParenthesisError(pos) {\n var _this = this;\n var msg = \"Failed to parse PDF literal string due to unbalanced parenthesis\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return UnbalancedParenthesisError;\n}(PDFParsingError));\nexport { UnbalancedParenthesisError };\nvar StalledParserError = /** @class */ (function (_super) {\n __extends(StalledParserError, _super);\n function StalledParserError(pos) {\n var _this = this;\n var msg = \"Parser stalled\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return StalledParserError;\n}(PDFParsingError));\nexport { StalledParserError };\nvar MissingPDFHeaderError = /** @class */ (function (_super) {\n __extends(MissingPDFHeaderError, _super);\n function MissingPDFHeaderError(pos) {\n var _this = this;\n var msg = \"No PDF header found\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return MissingPDFHeaderError;\n}(PDFParsingError));\nexport { MissingPDFHeaderError };\nvar MissingKeywordError = /** @class */ (function (_super) {\n __extends(MissingKeywordError, _super);\n function MissingKeywordError(pos, keyword) {\n var _this = this;\n var msg = \"Did not find expected keyword '\" + arrayAsString(keyword) + \"'\";\n _this = _super.call(this, pos, msg) || this;\n return _this;\n }\n return MissingKeywordError;\n}(PDFParsingError));\nexport { MissingKeywordError };\n//# sourceMappingURL=errors.js.map","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\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\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [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\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/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(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\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_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\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction 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\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction 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 } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\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 */\nfunction 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\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction 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\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 */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// 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; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\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]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* 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\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) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n 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 */\nfunction 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); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\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 }\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\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 }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* 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 }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\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 n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 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\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\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\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\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/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction 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); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\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 */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\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 */\nfunction 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; /* 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 &&\n 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)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction 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; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\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\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\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\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\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 */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// 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, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\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\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\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]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\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/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* 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/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\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\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\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction 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; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\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\n count = 0;\n prevlen = curlen;\n\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\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction 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; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\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\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\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 */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\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\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\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]/*.Len*/ !== 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;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\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 */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\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); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* 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]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\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 */\nfunction 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\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\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\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\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\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _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); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\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 */\nfunction _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\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 */\nfunction _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, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\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\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // 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\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\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;\n\n // 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\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\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\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 }\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\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _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 //var out_length, in_length, dcode;\n\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\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* 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\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\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\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\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\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\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\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\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\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\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\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\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\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\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\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 */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_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) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, 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\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(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\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\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 */\nfunction 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\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 */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\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 */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\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\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) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\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\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\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++;\n // Assert(*scan == *match, \"match[2]?\");\n\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] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\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\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\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 */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // 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\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\n utils.arraySet(s.window, s.window, _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\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 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 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\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\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\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#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 = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\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) {\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\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\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// var curr = s.strstart + s.lookahead;\n// var 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/* ===========================================================================\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 */\nfunction 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\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\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\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\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\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\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\n s.insert = 0;\n\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\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\n return BS_NEED_MORE;\n}\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 */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\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; /* flush the current block */\n }\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/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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\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/*NIL*/ && ((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) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\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/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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 } else\n {\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 = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#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 } 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 = trees._tr_tally(s, 0, s.window[s.strstart]);\n\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)) ? s.strstart : MIN_MATCH - 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/* ===========================================================================\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 */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\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) { break; } /* 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/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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\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;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\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 <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*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;\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 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\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 = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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;\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 } 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 = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\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 } 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 }\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 = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 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\n return BS_BLOCK_DONE;\n}\n\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 */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\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) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && 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;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\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 = trees._tr_tally(s, 0, s.window[s.strstart]);\n\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/* ===========================================================================\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 */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\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; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(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\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 */\nfunction 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\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\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\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;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\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\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\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\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\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\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\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\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\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\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\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\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\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* 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\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\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\n this.last_lit = 0; /* running index in l_buf */\n\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\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\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\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\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\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 = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\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\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) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // 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) { // 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 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 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 );\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 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 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(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\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 }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\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(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(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/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\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 } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\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 } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\n//#endif\n\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\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 } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\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\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\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 trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(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); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\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; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { 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 {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\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) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n 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 ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\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(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(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 tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n 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) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 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;\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\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\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\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\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\nvar _utf8len = new utils.Buf8(256);\nfor (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\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\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\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\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 } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\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 } 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\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\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\nfunction 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 = ''/*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/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\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\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\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) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\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/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\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 * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\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 * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var 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 **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\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\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - 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 have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\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 **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\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 **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\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) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\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 * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\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\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\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\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\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\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\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\nmodule.exports = {\n\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\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\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\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\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\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\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\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 inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\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\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - 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 inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\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 **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\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 **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","import CharCodes from \"../syntax/CharCodes\";\nimport { charFromCode, copyStringIntoBuffer } from \"../../utils\";\nvar PDFHeader = /** @class */ (function () {\n function PDFHeader(major, minor) {\n this.major = String(major);\n this.minor = String(minor);\n }\n PDFHeader.prototype.toString = function () {\n var bc = charFromCode(129);\n return \"%PDF-\" + this.major + \".\" + this.minor + \"\\n%\" + bc + bc + bc + bc;\n };\n PDFHeader.prototype.sizeInBytes = function () {\n return 12 + this.major.length + this.minor.length;\n };\n PDFHeader.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.P;\n buffer[offset++] = CharCodes.D;\n buffer[offset++] = CharCodes.F;\n buffer[offset++] = CharCodes.Dash;\n offset += copyStringIntoBuffer(this.major, buffer, offset);\n buffer[offset++] = CharCodes.Period;\n offset += copyStringIntoBuffer(this.minor, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n buffer[offset++] = 129;\n return offset - initialOffset;\n };\n PDFHeader.forVersion = function (major, minor) {\n return new PDFHeader(major, minor);\n };\n return PDFHeader;\n}());\nexport default PDFHeader;\n//# sourceMappingURL=PDFHeader.js.map","import { MethodNotImplementedError } from \"../errors\";\nvar PDFObject = /** @class */ (function () {\n function PDFObject() {\n }\n PDFObject.prototype.clone = function (_context) {\n throw new MethodNotImplementedError(this.constructor.name, 'clone');\n };\n PDFObject.prototype.toString = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'toString');\n };\n PDFObject.prototype.sizeInBytes = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'sizeInBytes');\n };\n PDFObject.prototype.copyBytesInto = function (_buffer, _offset) {\n throw new MethodNotImplementedError(this.constructor.name, 'copyBytesInto');\n };\n return PDFObject;\n}());\nexport default PDFObject;\n//# sourceMappingURL=PDFObject.js.map","import { __extends } from \"tslib\";\nimport { copyStringIntoBuffer, numberToString } from \"../../utils/index\";\nimport PDFObject from \"./PDFObject\";\nvar PDFNumber = /** @class */ (function (_super) {\n __extends(PDFNumber, _super);\n function PDFNumber(value) {\n var _this = _super.call(this) || this;\n _this.numberValue = value;\n _this.stringValue = numberToString(value);\n return _this;\n }\n PDFNumber.prototype.asNumber = function () {\n return this.numberValue;\n };\n /** @deprecated in favor of [[PDFNumber.asNumber]] */\n PDFNumber.prototype.value = function () {\n return this.numberValue;\n };\n PDFNumber.prototype.clone = function () {\n return PDFNumber.of(this.numberValue);\n };\n PDFNumber.prototype.toString = function () {\n return this.stringValue;\n };\n PDFNumber.prototype.sizeInBytes = function () {\n return this.stringValue.length;\n };\n PDFNumber.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.stringValue, buffer, offset);\n return this.stringValue.length;\n };\n PDFNumber.of = function (value) { return new PDFNumber(value); };\n return PDFNumber;\n}(PDFObject));\nexport default PDFNumber;\n//# sourceMappingURL=PDFNumber.js.map","import { __extends } from \"tslib\";\nimport PDFNumber from \"./PDFNumber\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { PDFArrayIsNotRectangleError } from '../errors';\nvar PDFArray = /** @class */ (function (_super) {\n __extends(PDFArray, _super);\n function PDFArray(context) {\n var _this = _super.call(this) || this;\n _this.array = [];\n _this.context = context;\n return _this;\n }\n PDFArray.prototype.size = function () {\n return this.array.length;\n };\n PDFArray.prototype.push = function (object) {\n this.array.push(object);\n };\n PDFArray.prototype.insert = function (index, object) {\n this.array.splice(index, 0, object);\n };\n PDFArray.prototype.remove = function (index) {\n this.array.splice(index, 1);\n };\n PDFArray.prototype.set = function (idx, object) {\n this.array[idx] = object;\n };\n PDFArray.prototype.get = function (index) {\n return this.array[index];\n };\n PDFArray.prototype.lookupMaybe = function (index, type) {\n return this.context.lookupMaybe(this.get(index), type);\n };\n PDFArray.prototype.lookup = function (index, type) {\n return this.context.lookup(this.get(index), type);\n };\n PDFArray.prototype.asRectangle = function () {\n if (this.size() !== 4)\n throw new PDFArrayIsNotRectangleError(this.size());\n var lowerLeftX = this.lookup(0, PDFNumber).asNumber();\n var lowerLeftY = this.lookup(1, PDFNumber).asNumber();\n var upperRightX = this.lookup(2, PDFNumber).asNumber();\n var upperRightY = this.lookup(3, PDFNumber).asNumber();\n var x = lowerLeftX;\n var y = lowerLeftY;\n var width = upperRightX - lowerLeftX;\n var height = upperRightY - lowerLeftY;\n return { x: x, y: y, width: width, height: height };\n };\n PDFArray.prototype.asArray = function () {\n return this.array.slice();\n };\n PDFArray.prototype.clone = function (context) {\n var clone = PDFArray.withContext(context || this.context);\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n clone.push(this.array[idx]);\n }\n return clone;\n };\n PDFArray.prototype.toString = function () {\n var arrayString = '[ ';\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n arrayString += this.get(idx).toString();\n arrayString += ' ';\n }\n arrayString += ']';\n return arrayString;\n };\n PDFArray.prototype.sizeInBytes = function () {\n var size = 3;\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n size += this.get(idx).sizeInBytes() + 1;\n }\n return size;\n };\n PDFArray.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.LeftSquareBracket;\n buffer[offset++] = CharCodes.Space;\n for (var idx = 0, len = this.size(); idx < len; idx++) {\n offset += this.get(idx).copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Space;\n }\n buffer[offset++] = CharCodes.RightSquareBracket;\n return offset - initialOffset;\n };\n PDFArray.withContext = function (context) { return new PDFArray(context); };\n return PDFArray;\n}(PDFObject));\nexport default PDFArray;\n//# sourceMappingURL=PDFArray.js.map","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar ENFORCER = {};\nvar PDFBool = /** @class */ (function (_super) {\n __extends(PDFBool, _super);\n function PDFBool(enforcer, value) {\n var _this = this;\n if (enforcer !== ENFORCER)\n throw new PrivateConstructorError('PDFBool');\n _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFBool.prototype.asBoolean = function () {\n return this.value;\n };\n PDFBool.prototype.clone = function () {\n return this;\n };\n PDFBool.prototype.toString = function () {\n return String(this.value);\n };\n PDFBool.prototype.sizeInBytes = function () {\n return this.value ? 4 : 5;\n };\n PDFBool.prototype.copyBytesInto = function (buffer, offset) {\n if (this.value) {\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.u;\n buffer[offset++] = CharCodes.e;\n return 4;\n }\n else {\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.e;\n return 5;\n }\n };\n PDFBool.True = new PDFBool(ENFORCER, true);\n PDFBool.False = new PDFBool(ENFORCER, false);\n return PDFBool;\n}(PDFObject));\nexport default PDFBool;\n//# sourceMappingURL=PDFBool.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFDict = /** @class */ (function (_super) {\n __extends(PDFDict, _super);\n function PDFDict(map, context) {\n var _this = _super.call(this) || this;\n _this.dict = map;\n _this.context = context;\n return _this;\n }\n PDFDict.prototype.entries = function () {\n return Array.from(this.dict.entries());\n };\n PDFDict.prototype.set = function (key, value) {\n this.dict.set(key, value);\n };\n PDFDict.prototype.get = function (key) {\n return this.dict.get(key);\n };\n PDFDict.prototype.has = function (key) {\n return this.dict.has(key);\n };\n PDFDict.prototype.lookupMaybe = function (key, type) {\n return this.context.lookupMaybe(this.get(key), type);\n };\n PDFDict.prototype.lookup = function (key, type) {\n return this.context.lookup(this.get(key), type);\n };\n PDFDict.prototype.delete = function (key) {\n return this.dict.delete(key);\n };\n PDFDict.prototype.asMap = function () {\n return new Map(this.dict);\n };\n PDFDict.prototype.clone = function (context) {\n var clone = PDFDict.withContext(context || this.context);\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clone.set(key, value);\n }\n return clone;\n };\n PDFDict.prototype.toString = function () {\n var dictString = '<<\\n';\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n dictString += key.toString() + ' ' + value.toString() + '\\n';\n }\n dictString += '>>';\n return dictString;\n };\n PDFDict.prototype.sizeInBytes = function () {\n var size = 5;\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n size += key.sizeInBytes() + value.sizeInBytes() + 2;\n }\n return size;\n };\n PDFDict.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.LessThan;\n buffer[offset++] = CharCodes.LessThan;\n buffer[offset++] = CharCodes.Newline;\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n offset += key.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Space;\n offset += value.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n buffer[offset++] = CharCodes.GreaterThan;\n buffer[offset++] = CharCodes.GreaterThan;\n return offset - initialOffset;\n };\n PDFDict.withContext = function (context) { return new PDFDict(new Map(), context); };\n PDFDict.fromMapWithContext = function (map, context) {\n return new PDFDict(map, context);\n };\n return PDFDict;\n}(PDFObject));\nexport default PDFDict;\n//# sourceMappingURL=PDFDict.js.map","import CharCodes from \"./CharCodes\";\nexport var IsDelimiter = new Uint8Array(256);\nIsDelimiter[CharCodes.LeftParen] = 1;\nIsDelimiter[CharCodes.RightParen] = 1;\nIsDelimiter[CharCodes.LessThan] = 1;\nIsDelimiter[CharCodes.GreaterThan] = 1;\nIsDelimiter[CharCodes.LeftSquareBracket] = 1;\nIsDelimiter[CharCodes.RightSquareBracket] = 1;\nIsDelimiter[CharCodes.LeftCurly] = 1;\nIsDelimiter[CharCodes.RightCurly] = 1;\nIsDelimiter[CharCodes.ForwardSlash] = 1;\nIsDelimiter[CharCodes.Percent] = 1;\n//# sourceMappingURL=Delimiters.js.map","import CharCodes from \"./CharCodes\";\nexport var IsWhitespace = new Uint8Array(256);\nIsWhitespace[CharCodes.Null] = 1;\nIsWhitespace[CharCodes.Tab] = 1;\nIsWhitespace[CharCodes.Newline] = 1;\nIsWhitespace[CharCodes.FormFeed] = 1;\nIsWhitespace[CharCodes.CarriageReturn] = 1;\nIsWhitespace[CharCodes.Space] = 1;\n//# sourceMappingURL=Whitespace.js.map","import CharCodes from \"./CharCodes\";\nimport { IsDelimiter } from \"./Delimiters\";\nimport { IsWhitespace } from \"./Whitespace\";\nexport var IsIrregular = new Uint8Array(256);\nfor (var idx = 0, len = 256; idx < len; idx++) {\n IsIrregular[idx] = IsWhitespace[idx] || IsDelimiter[idx] ? 1 : 0;\n}\nIsIrregular[CharCodes.Hash] = 1;\n//# sourceMappingURL=Irregular.js.map","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsIrregular } from \"../syntax/Irregular\";\nimport { charFromHexCode, copyStringIntoBuffer, toCharCode, toHexString, } from \"../../utils\";\nvar decodeName = function (name) {\n return name.replace(/#([\\dABCDEF]{2})/g, function (_, hex) { return charFromHexCode(hex); });\n};\nvar isRegularChar = function (charCode) {\n return charCode >= CharCodes.ExclamationPoint &&\n charCode <= CharCodes.Tilde &&\n !IsIrregular[charCode];\n};\nvar ENFORCER = {};\nvar pool = new Map();\nvar PDFName = /** @class */ (function (_super) {\n __extends(PDFName, _super);\n function PDFName(enforcer, name) {\n var _this = this;\n if (enforcer !== ENFORCER)\n throw new PrivateConstructorError('PDFName');\n _this = _super.call(this) || this;\n var encodedName = '/';\n for (var idx = 0, len = name.length; idx < len; idx++) {\n var character = name[idx];\n var code = toCharCode(character);\n encodedName += isRegularChar(code) ? character : \"#\" + toHexString(code);\n }\n _this.encodedName = encodedName;\n return _this;\n }\n PDFName.prototype.asString = function () {\n return this.encodedName;\n };\n /** @deprecated in favor of [[PDFName.asString]] */\n PDFName.prototype.value = function () {\n return this.encodedName;\n };\n PDFName.prototype.clone = function () {\n return this;\n };\n PDFName.prototype.toString = function () {\n return this.encodedName;\n };\n PDFName.prototype.sizeInBytes = function () {\n return this.encodedName.length;\n };\n PDFName.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.encodedName, buffer, offset);\n return this.encodedName.length;\n };\n PDFName.of = function (name) {\n var decodedValue = decodeName(name);\n var instance = pool.get(decodedValue);\n if (!instance) {\n instance = new PDFName(ENFORCER, decodedValue);\n pool.set(decodedValue, instance);\n }\n return instance;\n };\n /* tslint:disable member-ordering */\n PDFName.Length = PDFName.of('Length');\n PDFName.FlateDecode = PDFName.of('FlateDecode');\n PDFName.Resources = PDFName.of('Resources');\n PDFName.Font = PDFName.of('Font');\n PDFName.XObject = PDFName.of('XObject');\n PDFName.Contents = PDFName.of('Contents');\n PDFName.Type = PDFName.of('Type');\n PDFName.Parent = PDFName.of('Parent');\n PDFName.MediaBox = PDFName.of('MediaBox');\n PDFName.Page = PDFName.of('Page');\n PDFName.Annots = PDFName.of('Annots');\n PDFName.TrimBox = PDFName.of('TrimBox');\n PDFName.ArtBox = PDFName.of('ArtBox');\n PDFName.BleedBox = PDFName.of('BleedBox');\n PDFName.CropBox = PDFName.of('CropBox');\n PDFName.Rotate = PDFName.of('Rotate');\n PDFName.Title = PDFName.of('Title');\n PDFName.Author = PDFName.of('Author');\n PDFName.Subject = PDFName.of('Subject');\n PDFName.Creator = PDFName.of('Creator');\n PDFName.Keywords = PDFName.of('Keywords');\n PDFName.Producer = PDFName.of('Producer');\n PDFName.CreationDate = PDFName.of('CreationDate');\n PDFName.ModDate = PDFName.of('ModDate');\n return PDFName;\n}(PDFObject));\nexport default PDFName;\n//# sourceMappingURL=PDFName.js.map","var PDFOperatorNames;\n(function (PDFOperatorNames) {\n // Non Stroking Color Operators\n PDFOperatorNames[\"NonStrokingColor\"] = \"sc\";\n PDFOperatorNames[\"NonStrokingColorN\"] = \"scn\";\n PDFOperatorNames[\"NonStrokingColorRgb\"] = \"rg\";\n PDFOperatorNames[\"NonStrokingColorGray\"] = \"g\";\n PDFOperatorNames[\"NonStrokingColorCmyk\"] = \"k\";\n PDFOperatorNames[\"NonStrokingColorspace\"] = \"cs\";\n // Stroking Color Operators\n PDFOperatorNames[\"StrokingColor\"] = \"SC\";\n PDFOperatorNames[\"StrokingColorN\"] = \"SCN\";\n PDFOperatorNames[\"StrokingColorRgb\"] = \"RG\";\n PDFOperatorNames[\"StrokingColorGray\"] = \"G\";\n PDFOperatorNames[\"StrokingColorCmyk\"] = \"K\";\n PDFOperatorNames[\"StrokingColorspace\"] = \"CS\";\n // Marked Content Operators\n PDFOperatorNames[\"BeginMarkedContentSequence\"] = \"BDC\";\n PDFOperatorNames[\"BeginMarkedContent\"] = \"BMC\";\n PDFOperatorNames[\"EndMarkedContent\"] = \"EMC\";\n PDFOperatorNames[\"MarkedContentPointWithProps\"] = \"DP\";\n PDFOperatorNames[\"MarkedContentPoint\"] = \"MP\";\n PDFOperatorNames[\"DrawObject\"] = \"Do\";\n // Graphics State Operators\n PDFOperatorNames[\"ConcatTransformationMatrix\"] = \"cm\";\n PDFOperatorNames[\"PopGraphicsState\"] = \"Q\";\n PDFOperatorNames[\"PushGraphicsState\"] = \"q\";\n PDFOperatorNames[\"SetFlatness\"] = \"i\";\n PDFOperatorNames[\"SetGraphicsStateParams\"] = \"gs\";\n PDFOperatorNames[\"SetLineCapStyle\"] = \"J\";\n PDFOperatorNames[\"SetLineDashPattern\"] = \"d\";\n PDFOperatorNames[\"SetLineJoinStyle\"] = \"j\";\n PDFOperatorNames[\"SetLineMiterLimit\"] = \"M\";\n PDFOperatorNames[\"SetLineWidth\"] = \"w\";\n PDFOperatorNames[\"SetTextMatrix\"] = \"Tm\";\n PDFOperatorNames[\"SetRenderingIntent\"] = \"ri\";\n // Graphics Operators\n PDFOperatorNames[\"AppendRectangle\"] = \"re\";\n PDFOperatorNames[\"BeginInlineImage\"] = \"BI\";\n PDFOperatorNames[\"BeginInlineImageData\"] = \"ID\";\n PDFOperatorNames[\"EndInlineImage\"] = \"EI\";\n PDFOperatorNames[\"ClipEvenOdd\"] = \"W*\";\n PDFOperatorNames[\"ClipNonZero\"] = \"W\";\n PDFOperatorNames[\"CloseAndStroke\"] = \"s\";\n PDFOperatorNames[\"CloseFillEvenOddAndStroke\"] = \"b*\";\n PDFOperatorNames[\"CloseFillNonZeroAndStroke\"] = \"b\";\n PDFOperatorNames[\"ClosePath\"] = \"h\";\n PDFOperatorNames[\"AppendBezierCurve\"] = \"c\";\n PDFOperatorNames[\"CurveToReplicateFinalPoint\"] = \"y\";\n PDFOperatorNames[\"CurveToReplicateInitialPoint\"] = \"v\";\n PDFOperatorNames[\"EndPath\"] = \"n\";\n PDFOperatorNames[\"FillEvenOddAndStroke\"] = \"B*\";\n PDFOperatorNames[\"FillEvenOdd\"] = \"f*\";\n PDFOperatorNames[\"FillNonZeroAndStroke\"] = \"B\";\n PDFOperatorNames[\"FillNonZero\"] = \"f\";\n PDFOperatorNames[\"LegacyFillNonZero\"] = \"F\";\n PDFOperatorNames[\"LineTo\"] = \"l\";\n PDFOperatorNames[\"MoveTo\"] = \"m\";\n PDFOperatorNames[\"ShadingFill\"] = \"sh\";\n PDFOperatorNames[\"StrokePath\"] = \"S\";\n // Text Operators\n PDFOperatorNames[\"BeginText\"] = \"BT\";\n PDFOperatorNames[\"EndText\"] = \"ET\";\n PDFOperatorNames[\"MoveText\"] = \"Td\";\n PDFOperatorNames[\"MoveTextSetLeading\"] = \"TD\";\n PDFOperatorNames[\"NextLine\"] = \"T*\";\n PDFOperatorNames[\"SetCharacterSpacing\"] = \"Tc\";\n PDFOperatorNames[\"SetFontAndSize\"] = \"Tf\";\n PDFOperatorNames[\"SetTextHorizontalScaling\"] = \"Tz\";\n PDFOperatorNames[\"SetTextLineHeight\"] = \"TL\";\n PDFOperatorNames[\"SetTextRenderingMode\"] = \"Tr\";\n PDFOperatorNames[\"SetTextRise\"] = \"Ts\";\n PDFOperatorNames[\"SetWordSpacing\"] = \"Tw\";\n PDFOperatorNames[\"ShowText\"] = \"Tj\";\n PDFOperatorNames[\"ShowTextAdjusted\"] = \"TJ\";\n PDFOperatorNames[\"ShowTextLine\"] = \"'\";\n PDFOperatorNames[\"ShowTextLineAndSpace\"] = \"\\\"\";\n // Type3 Font Operators\n PDFOperatorNames[\"Type3D0\"] = \"d0\";\n PDFOperatorNames[\"Type3D1\"] = \"d1\";\n // Compatibility Section Operators\n PDFOperatorNames[\"BeginCompatibilitySection\"] = \"BX\";\n PDFOperatorNames[\"EndCompatibilitySection\"] = \"EX\";\n})(PDFOperatorNames || (PDFOperatorNames = {}));\nexport default PDFOperatorNames;\n//# sourceMappingURL=PDFOperatorNames.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFNull = /** @class */ (function (_super) {\n __extends(PDFNull, _super);\n function PDFNull() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFNull.prototype.asNull = function () {\n return null;\n };\n PDFNull.prototype.clone = function () {\n return this;\n };\n PDFNull.prototype.toString = function () {\n return 'null';\n };\n PDFNull.prototype.sizeInBytes = function () {\n return 4;\n };\n PDFNull.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.u;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.l;\n return 4;\n };\n return PDFNull;\n}(PDFObject));\nexport default new PDFNull();\n//# sourceMappingURL=PDFNull.js.map","import { __extends } from \"tslib\";\nimport { MethodNotImplementedError } from \"../errors\";\nimport PDFName from \"./PDFName\";\nimport PDFNumber from \"./PDFNumber\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFStream = /** @class */ (function (_super) {\n __extends(PDFStream, _super);\n function PDFStream(dict) {\n var _this = _super.call(this) || this;\n _this.dict = dict;\n return _this;\n }\n PDFStream.prototype.clone = function (_context) {\n throw new MethodNotImplementedError(this.constructor.name, 'clone');\n };\n PDFStream.prototype.getContentsString = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContentsString');\n };\n PDFStream.prototype.getContents = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContents');\n };\n PDFStream.prototype.getContentsSize = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getContentsSize');\n };\n PDFStream.prototype.updateDict = function () {\n var contentsSize = this.getContentsSize();\n this.dict.set(PDFName.Length, PDFNumber.of(contentsSize));\n };\n PDFStream.prototype.sizeInBytes = function () {\n this.updateDict();\n return this.dict.sizeInBytes() + this.getContentsSize() + 18;\n };\n PDFStream.prototype.toString = function () {\n this.updateDict();\n var streamString = this.dict.toString();\n streamString += '\\nstream\\n';\n streamString += this.getContentsString();\n streamString += '\\nendstream';\n return streamString;\n };\n PDFStream.prototype.copyBytesInto = function (buffer, offset) {\n this.updateDict();\n var initialOffset = offset;\n offset += this.dict.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.m;\n buffer[offset++] = CharCodes.Newline;\n var contents = this.getContents();\n for (var idx = 0, len = contents.length; idx < len; idx++) {\n buffer[offset++] = contents[idx];\n }\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.d;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.m;\n return offset - initialOffset;\n };\n return PDFStream;\n}(PDFObject));\nexport default PDFStream;\n//# sourceMappingURL=PDFStream.js.map","import { __extends } from \"tslib\";\nimport PDFStream from \"./PDFStream\";\nimport { arrayAsString } from \"../../utils\";\nvar PDFRawStream = /** @class */ (function (_super) {\n __extends(PDFRawStream, _super);\n function PDFRawStream(dict, contents) {\n var _this = _super.call(this, dict) || this;\n _this.contents = contents;\n return _this;\n }\n PDFRawStream.prototype.asUint8Array = function () {\n return this.contents.slice();\n };\n PDFRawStream.prototype.clone = function (context) {\n return PDFRawStream.of(this.dict.clone(context), this.contents.slice());\n };\n PDFRawStream.prototype.getContentsString = function () {\n return arrayAsString(this.contents);\n };\n PDFRawStream.prototype.getContents = function () {\n return this.contents;\n };\n PDFRawStream.prototype.getContentsSize = function () {\n return this.contents.length;\n };\n PDFRawStream.of = function (dict, contents) {\n return new PDFRawStream(dict, contents);\n };\n return PDFRawStream;\n}(PDFStream));\nexport default PDFRawStream;\n//# sourceMappingURL=PDFRawStream.js.map","import { __extends } from \"tslib\";\nimport { PrivateConstructorError } from \"../errors\";\nimport PDFObject from \"./PDFObject\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar ENFORCER = {};\nvar pool = new Map();\nvar PDFRef = /** @class */ (function (_super) {\n __extends(PDFRef, _super);\n function PDFRef(enforcer, objectNumber, generationNumber) {\n var _this = this;\n if (enforcer !== ENFORCER)\n throw new PrivateConstructorError('PDFRef');\n _this = _super.call(this) || this;\n _this.objectNumber = objectNumber;\n _this.generationNumber = generationNumber;\n _this.tag = objectNumber + \" \" + generationNumber + \" R\";\n return _this;\n }\n PDFRef.prototype.clone = function () {\n return this;\n };\n PDFRef.prototype.toString = function () {\n return this.tag;\n };\n PDFRef.prototype.sizeInBytes = function () {\n return this.tag.length;\n };\n PDFRef.prototype.copyBytesInto = function (buffer, offset) {\n offset += copyStringIntoBuffer(this.tag, buffer, offset);\n return this.tag.length;\n };\n PDFRef.of = function (objectNumber, generationNumber) {\n if (generationNumber === void 0) { generationNumber = 0; }\n var tag = objectNumber + \" \" + generationNumber + \" R\";\n var instance = pool.get(tag);\n if (!instance) {\n instance = new PDFRef(ENFORCER, objectNumber, generationNumber);\n pool.set(tag, instance);\n }\n return instance;\n };\n return PDFRef;\n}(PDFObject));\nexport default PDFRef;\n//# sourceMappingURL=PDFRef.js.map","import PDFObject from \"../objects/PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar PDFOperator = /** @class */ (function () {\n function PDFOperator(name, args) {\n this.name = name;\n this.args = args || [];\n }\n PDFOperator.prototype.clone = function (context) {\n var args = new Array(this.args.length);\n for (var idx = 0, len = args.length; idx < len; idx++) {\n var arg = this.args[idx];\n args[idx] = arg instanceof PDFObject ? arg.clone(context) : arg;\n }\n return PDFOperator.of(this.name, args);\n };\n PDFOperator.prototype.toString = function () {\n var value = '';\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n value += String(this.args[idx]) + ' ';\n }\n value += this.name;\n return value;\n };\n PDFOperator.prototype.sizeInBytes = function () {\n var size = 0;\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n var arg = this.args[idx];\n size += (arg instanceof PDFObject ? arg.sizeInBytes() : arg.length) + 1;\n }\n size += this.name.length;\n return size;\n };\n PDFOperator.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n for (var idx = 0, len = this.args.length; idx < len; idx++) {\n var arg = this.args[idx];\n if (arg instanceof PDFObject) {\n offset += arg.copyBytesInto(buffer, offset);\n }\n else {\n offset += copyStringIntoBuffer(arg, buffer, offset);\n }\n buffer[offset++] = CharCodes.Space;\n }\n offset += copyStringIntoBuffer(this.name, buffer, offset);\n return offset - initialOffset;\n };\n PDFOperator.of = function (name, args) {\n return new PDFOperator(name, args);\n };\n return PDFOperator;\n}());\nexport default PDFOperator;\n//# sourceMappingURL=PDFOperator.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport { bytesFor, Cache, reverseArray, sizeInBytes, sum } from \"../../utils\";\nexport var EntryType;\n(function (EntryType) {\n EntryType[EntryType[\"Deleted\"] = 0] = \"Deleted\";\n EntryType[EntryType[\"Uncompressed\"] = 1] = \"Uncompressed\";\n EntryType[EntryType[\"Compressed\"] = 2] = \"Compressed\";\n})(EntryType || (EntryType = {}));\n/**\n * Entries should be added using the [[addDeletedEntry]],\n * [[addUncompressedEntry]], and [[addCompressedEntry]] methods\n * **in order of ascending object number**.\n */\nvar PDFCrossRefStream = /** @class */ (function (_super) {\n __extends(PDFCrossRefStream, _super);\n function PDFCrossRefStream(dict, entries, encode) {\n if (encode === void 0) { encode = true; }\n var _this = _super.call(this, dict, encode) || this;\n // Returns an array of integer pairs for each subsection of the cross ref\n // section, where each integer pair represents:\n // firstObjectNumber(OfSection), length(OfSection)\n _this.computeIndex = function () {\n var subsections = [];\n var subsectionLength = 0;\n for (var idx = 0, len = _this.entries.length; idx < len; idx++) {\n var currEntry = _this.entries[idx];\n var prevEntry = _this.entries[idx - 1];\n if (idx === 0) {\n subsections.push(currEntry.ref.objectNumber);\n }\n else if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {\n subsections.push(subsectionLength);\n subsections.push(currEntry.ref.objectNumber);\n subsectionLength = 0;\n }\n subsectionLength += 1;\n }\n subsections.push(subsectionLength);\n return subsections;\n };\n _this.computeEntryTuples = function () {\n var entryTuples = new Array(_this.entries.length);\n for (var idx = 0, len = _this.entries.length; idx < len; idx++) {\n var entry = _this.entries[idx];\n if (entry.type === EntryType.Deleted) {\n var type = entry.type, nextFreeObjectNumber = entry.nextFreeObjectNumber, ref = entry.ref;\n entryTuples[idx] = [type, nextFreeObjectNumber, ref.generationNumber];\n }\n if (entry.type === EntryType.Uncompressed) {\n var type = entry.type, offset = entry.offset, ref = entry.ref;\n entryTuples[idx] = [type, offset, ref.generationNumber];\n }\n if (entry.type === EntryType.Compressed) {\n var type = entry.type, objectStreamRef = entry.objectStreamRef, index = entry.index;\n entryTuples[idx] = [type, objectStreamRef.objectNumber, index];\n }\n }\n return entryTuples;\n };\n _this.computeMaxEntryByteWidths = function () {\n var entryTuples = _this.entryTuplesCache.access();\n var widths = [0, 0, 0];\n for (var idx = 0, len = entryTuples.length; idx < len; idx++) {\n var _a = entryTuples[idx], first = _a[0], second = _a[1], third = _a[2];\n var firstSize = sizeInBytes(first);\n var secondSize = sizeInBytes(second);\n var thirdSize = sizeInBytes(third);\n if (firstSize > widths[0])\n widths[0] = firstSize;\n if (secondSize > widths[1])\n widths[1] = secondSize;\n if (thirdSize > widths[2])\n widths[2] = thirdSize;\n }\n return widths;\n };\n _this.entries = entries || [];\n _this.entryTuplesCache = Cache.populatedBy(_this.computeEntryTuples);\n _this.maxByteWidthsCache = Cache.populatedBy(_this.computeMaxEntryByteWidths);\n _this.indexCache = Cache.populatedBy(_this.computeIndex);\n dict.set(PDFName.of('Type'), PDFName.of('XRef'));\n return _this;\n }\n PDFCrossRefStream.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {\n var type = EntryType.Deleted;\n this.entries.push({ type: type, ref: ref, nextFreeObjectNumber: nextFreeObjectNumber });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.addUncompressedEntry = function (ref, offset) {\n var type = EntryType.Uncompressed;\n this.entries.push({ type: type, ref: ref, offset: offset });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.addCompressedEntry = function (ref, objectStreamRef, index) {\n var type = EntryType.Compressed;\n this.entries.push({ type: type, ref: ref, objectStreamRef: objectStreamRef, index: index });\n this.entryTuplesCache.invalidate();\n this.maxByteWidthsCache.invalidate();\n this.indexCache.invalidate();\n this.contentsCache.invalidate();\n };\n PDFCrossRefStream.prototype.clone = function (context) {\n var _a = this, dict = _a.dict, entries = _a.entries, encode = _a.encode;\n return PDFCrossRefStream.of(dict.clone(context), entries.slice(), encode);\n };\n PDFCrossRefStream.prototype.getContentsString = function () {\n var entryTuples = this.entryTuplesCache.access();\n var byteWidths = this.maxByteWidthsCache.access();\n var value = '';\n for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {\n var _a = entryTuples[entryIdx], first = _a[0], second = _a[1], third = _a[2];\n var firstBytes = reverseArray(bytesFor(first));\n var secondBytes = reverseArray(bytesFor(second));\n var thirdBytes = reverseArray(bytesFor(third));\n for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {\n value += (firstBytes[idx] || 0).toString(2);\n }\n for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {\n value += (secondBytes[idx] || 0).toString(2);\n }\n for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {\n value += (thirdBytes[idx] || 0).toString(2);\n }\n }\n return value;\n };\n PDFCrossRefStream.prototype.getUnencodedContents = function () {\n var entryTuples = this.entryTuplesCache.access();\n var byteWidths = this.maxByteWidthsCache.access();\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = 0;\n for (var entryIdx = 0, entriesLen = entryTuples.length; entryIdx < entriesLen; entryIdx++) {\n var _a = entryTuples[entryIdx], first = _a[0], second = _a[1], third = _a[2];\n var firstBytes = reverseArray(bytesFor(first));\n var secondBytes = reverseArray(bytesFor(second));\n var thirdBytes = reverseArray(bytesFor(third));\n for (var idx = byteWidths[0] - 1; idx >= 0; idx--) {\n buffer[offset++] = firstBytes[idx] || 0;\n }\n for (var idx = byteWidths[1] - 1; idx >= 0; idx--) {\n buffer[offset++] = secondBytes[idx] || 0;\n }\n for (var idx = byteWidths[2] - 1; idx >= 0; idx--) {\n buffer[offset++] = thirdBytes[idx] || 0;\n }\n }\n return buffer;\n };\n PDFCrossRefStream.prototype.getUnencodedContentsSize = function () {\n var byteWidths = this.maxByteWidthsCache.access();\n var entryWidth = sum(byteWidths);\n return entryWidth * this.entries.length;\n };\n PDFCrossRefStream.prototype.updateDict = function () {\n _super.prototype.updateDict.call(this);\n var byteWidths = this.maxByteWidthsCache.access();\n var index = this.indexCache.access();\n var context = this.dict.context;\n this.dict.set(PDFName.of('W'), context.obj(byteWidths));\n this.dict.set(PDFName.of('Index'), context.obj(index));\n };\n PDFCrossRefStream.create = function (dict, encode) {\n if (encode === void 0) { encode = true; }\n var stream = new PDFCrossRefStream(dict, [], encode);\n stream.addDeletedEntry(PDFRef.of(0, 65535), 0);\n return stream;\n };\n PDFCrossRefStream.of = function (dict, entries, encode) {\n if (encode === void 0) { encode = true; }\n return new PDFCrossRefStream(dict, entries, encode);\n };\n return PDFCrossRefStream;\n}(PDFFlateStream));\nexport default PDFCrossRefStream;\n//# sourceMappingURL=PDFCrossRefStream.js.map","import { __extends } from \"tslib\";\nimport pako from 'pako';\nimport { MethodNotImplementedError } from \"../errors\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFStream from \"../objects/PDFStream\";\nimport { Cache } from \"../../utils\";\nvar PDFFlateStream = /** @class */ (function (_super) {\n __extends(PDFFlateStream, _super);\n function PDFFlateStream(dict, encode) {\n var _this = _super.call(this, dict) || this;\n _this.computeContents = function () {\n var unencodedContents = _this.getUnencodedContents();\n return _this.encode ? pako.deflate(unencodedContents) : unencodedContents;\n };\n _this.encode = encode;\n if (encode)\n dict.set(PDFName.of('Filter'), PDFName.of('FlateDecode'));\n _this.contentsCache = Cache.populatedBy(_this.computeContents);\n return _this;\n }\n PDFFlateStream.prototype.getContents = function () {\n return this.contentsCache.access();\n };\n PDFFlateStream.prototype.getContentsSize = function () {\n return this.contentsCache.access().length;\n };\n PDFFlateStream.prototype.getUnencodedContents = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'getUnencodedContents');\n };\n return PDFFlateStream;\n}(PDFStream));\nexport default PDFFlateStream;\n//# sourceMappingURL=PDFFlateStream.js.map","import { __extends } from \"tslib\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nvar PDFContentStream = /** @class */ (function (_super) {\n __extends(PDFContentStream, _super);\n function PDFContentStream(dict, operators, encode) {\n if (encode === void 0) { encode = true; }\n var _this = _super.call(this, dict, encode) || this;\n _this.operators = operators;\n return _this;\n }\n PDFContentStream.prototype.push = function () {\n var _a;\n var operators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators[_i] = arguments[_i];\n }\n (_a = this.operators).push.apply(_a, operators);\n };\n PDFContentStream.prototype.clone = function (context) {\n var operators = new Array(this.operators.length);\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n operators[idx] = this.operators[idx].clone(context);\n }\n var _a = this, dict = _a.dict, encode = _a.encode;\n return PDFContentStream.of(dict.clone(context), operators, encode);\n };\n PDFContentStream.prototype.getContentsString = function () {\n var value = '';\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n value += this.operators[idx] + \"\\n\";\n }\n return value;\n };\n PDFContentStream.prototype.getUnencodedContents = function () {\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = 0;\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n offset += this.operators[idx].copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n return buffer;\n };\n PDFContentStream.prototype.getUnencodedContentsSize = function () {\n var size = 0;\n for (var idx = 0, len = this.operators.length; idx < len; idx++) {\n size += this.operators[idx].sizeInBytes() + 1;\n }\n return size;\n };\n PDFContentStream.of = function (dict, operators, encode) {\n if (encode === void 0) { encode = true; }\n return new PDFContentStream(dict, operators, encode);\n };\n return PDFContentStream;\n}(PDFFlateStream));\nexport default PDFContentStream;\n//# sourceMappingURL=PDFContentStream.js.map","import { __assign } from \"tslib\";\nimport pako from 'pako';\nimport PDFHeader from \"./document/PDFHeader\";\nimport { UnexpectedObjectTypeError } from \"./errors\";\nimport PDFArray from \"./objects/PDFArray\";\nimport PDFBool from \"./objects/PDFBool\";\nimport PDFDict from \"./objects/PDFDict\";\nimport PDFName from \"./objects/PDFName\";\nimport PDFNull from \"./objects/PDFNull\";\nimport PDFNumber from \"./objects/PDFNumber\";\nimport PDFObject from \"./objects/PDFObject\";\nimport PDFRawStream from \"./objects/PDFRawStream\";\nimport PDFRef from \"./objects/PDFRef\";\nimport PDFOperator from \"./operators/PDFOperator\";\nimport Ops from \"./operators/PDFOperatorNames\";\nimport PDFContentStream from \"./structures/PDFContentStream\";\nimport { typedArrayFor } from \"../utils\";\nvar byAscendingObjectNumber = function (_a, _b) {\n var a = _a[0];\n var b = _b[0];\n return a.objectNumber - b.objectNumber;\n};\nvar PDFContext = /** @class */ (function () {\n function PDFContext() {\n this.largestObjectNumber = 0;\n this.header = PDFHeader.forVersion(1, 7);\n this.trailerInfo = {};\n this.indirectObjects = new Map();\n }\n PDFContext.prototype.assign = function (ref, object) {\n this.indirectObjects.set(ref, object);\n if (ref.objectNumber > this.largestObjectNumber) {\n this.largestObjectNumber = ref.objectNumber;\n }\n };\n PDFContext.prototype.nextRef = function () {\n this.largestObjectNumber += 1;\n return PDFRef.of(this.largestObjectNumber);\n };\n PDFContext.prototype.register = function (object) {\n var ref = this.nextRef();\n this.assign(ref, object);\n return ref;\n };\n PDFContext.prototype.delete = function (ref) {\n return this.indirectObjects.delete(ref);\n };\n PDFContext.prototype.lookupMaybe = function (ref, type) {\n var result = ref instanceof PDFRef ? this.indirectObjects.get(ref) : ref;\n if (result && !(result instanceof type)) {\n throw new UnexpectedObjectTypeError(type, result);\n }\n return result;\n };\n PDFContext.prototype.lookup = function (ref, type) {\n var result = ref instanceof PDFRef ? this.indirectObjects.get(ref) : ref;\n if (type && !(result instanceof type)) {\n throw new UnexpectedObjectTypeError(type, result);\n }\n return result;\n };\n PDFContext.prototype.enumerateIndirectObjects = function () {\n return Array.from(this.indirectObjects.entries()).sort(byAscendingObjectNumber);\n };\n PDFContext.prototype.obj = function (literal) {\n if (literal instanceof PDFObject) {\n return literal;\n }\n else if (literal === null || literal === undefined) {\n return PDFNull;\n }\n else if (typeof literal === 'string') {\n return PDFName.of(literal);\n }\n else if (typeof literal === 'number') {\n return PDFNumber.of(literal);\n }\n else if (typeof literal === 'boolean') {\n return literal ? PDFBool.True : PDFBool.False;\n }\n else if (Array.isArray(literal)) {\n var array = PDFArray.withContext(this);\n for (var idx = 0, len = literal.length; idx < len; idx++) {\n array.push(this.obj(literal[idx]));\n }\n return array;\n }\n else {\n var dict = PDFDict.withContext(this);\n var keys = Object.keys(literal);\n for (var idx = 0, len = keys.length; idx < len; idx++) {\n var key = keys[idx];\n var value = literal[key];\n if (value !== undefined)\n dict.set(PDFName.of(key), this.obj(value));\n }\n return dict;\n }\n };\n PDFContext.prototype.stream = function (contents, dict) {\n if (dict === void 0) { dict = {}; }\n return PDFRawStream.of(this.obj(dict), typedArrayFor(contents));\n };\n PDFContext.prototype.flateStream = function (contents, dict) {\n if (dict === void 0) { dict = {}; }\n return this.stream(pako.deflate(typedArrayFor(contents)), __assign(__assign({}, dict), { Filter: 'FlateDecode' }));\n };\n /*\n * Reference to PDFContentStream that contains a single PDFOperator: `q`.\n * Used by [[PDFPageLeaf]] instances to ensure that when content streams are\n * added to a modified PDF, they start in the default, unchanged graphics\n * state.\n */\n PDFContext.prototype.getPushGraphicsStateContentStream = function () {\n if (this.pushGraphicsStateContentStreamRef) {\n return this.pushGraphicsStateContentStreamRef;\n }\n var dict = this.obj({});\n var op = PDFOperator.of(Ops.PushGraphicsState);\n var stream = PDFContentStream.of(dict, [op]);\n this.pushGraphicsStateContentStreamRef = this.register(stream);\n return this.pushGraphicsStateContentStreamRef;\n };\n /*\n * Reference to PDFContentStream that contains a single PDFOperator: `Q`.\n * Used by [[PDFPageLeaf]] instances to ensure that when content streams are\n * added to a modified PDF, they start in the default, unchanged graphics\n * state.\n */\n PDFContext.prototype.getPopGraphicsStateContentStream = function () {\n if (this.popGraphicsStateContentStreamRef) {\n return this.popGraphicsStateContentStreamRef;\n }\n var dict = this.obj({});\n var op = PDFOperator.of(Ops.PopGraphicsState);\n var stream = PDFContentStream.of(dict, [op]);\n this.popGraphicsStateContentStreamRef = this.register(stream);\n return this.popGraphicsStateContentStreamRef;\n };\n PDFContext.create = function () { return new PDFContext(); };\n return PDFContext;\n}());\nexport default PDFContext;\n//# sourceMappingURL=PDFContext.js.map","import { __extends } from \"tslib\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFStream from \"../objects/PDFStream\";\nvar PDFPageLeaf = /** @class */ (function (_super) {\n __extends(PDFPageLeaf, _super);\n function PDFPageLeaf(map, context, autoNormalizeCTM) {\n if (autoNormalizeCTM === void 0) { autoNormalizeCTM = true; }\n var _this = _super.call(this, map, context) || this;\n _this.normalized = false;\n _this.autoNormalizeCTM = autoNormalizeCTM;\n return _this;\n }\n PDFPageLeaf.prototype.clone = function (context) {\n var clone = PDFPageLeaf.fromMapWithContext(new Map(), context || this.context, this.autoNormalizeCTM);\n var entries = this.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clone.set(key, value);\n }\n return clone;\n };\n PDFPageLeaf.prototype.Parent = function () {\n return this.lookupMaybe(PDFName.Parent, PDFDict);\n };\n PDFPageLeaf.prototype.Contents = function () {\n return this.lookup(PDFName.of('Contents'));\n };\n PDFPageLeaf.prototype.Annots = function () {\n return this.lookupMaybe(PDFName.Annots, PDFArray);\n };\n PDFPageLeaf.prototype.BleedBox = function () {\n return this.lookupMaybe(PDFName.BleedBox, PDFArray);\n };\n PDFPageLeaf.prototype.TrimBox = function () {\n return this.lookupMaybe(PDFName.TrimBox, PDFArray);\n };\n PDFPageLeaf.prototype.ArtBox = function () {\n return this.lookupMaybe(PDFName.ArtBox, PDFArray);\n };\n PDFPageLeaf.prototype.Resources = function () {\n var dictOrRef = this.getInheritableAttribute(PDFName.Resources);\n return this.context.lookupMaybe(dictOrRef, PDFDict);\n };\n PDFPageLeaf.prototype.MediaBox = function () {\n var arrayOrRef = this.getInheritableAttribute(PDFName.MediaBox);\n return this.context.lookup(arrayOrRef, PDFArray);\n };\n PDFPageLeaf.prototype.CropBox = function () {\n var arrayOrRef = this.getInheritableAttribute(PDFName.CropBox);\n return this.context.lookupMaybe(arrayOrRef, PDFArray);\n };\n PDFPageLeaf.prototype.Rotate = function () {\n var numberOrRef = this.getInheritableAttribute(PDFName.Rotate);\n return this.context.lookupMaybe(numberOrRef, PDFNumber);\n };\n PDFPageLeaf.prototype.getInheritableAttribute = function (name) {\n var attribute;\n this.ascend(function (node) {\n if (!attribute)\n attribute = node.get(name);\n });\n return attribute;\n };\n PDFPageLeaf.prototype.setParent = function (parentRef) {\n this.set(PDFName.Parent, parentRef);\n };\n PDFPageLeaf.prototype.addContentStream = function (contentStreamRef) {\n var Contents = this.normalizedEntries().Contents || this.context.obj([]);\n this.set(PDFName.Contents, Contents);\n Contents.push(contentStreamRef);\n };\n PDFPageLeaf.prototype.wrapContentStreams = function (startStream, endStream) {\n var Contents = this.Contents();\n if (Contents instanceof PDFArray) {\n Contents.insert(0, startStream);\n Contents.push(endStream);\n return true;\n }\n return false;\n };\n PDFPageLeaf.prototype.setFontDictionary = function (name, fontDictRef) {\n var Font = this.normalizedEntries().Font;\n Font.set(name, fontDictRef);\n };\n PDFPageLeaf.prototype.setXObject = function (name, xObjectRef) {\n var XObject = this.normalizedEntries().XObject;\n XObject.set(name, xObjectRef);\n };\n PDFPageLeaf.prototype.ascend = function (visitor) {\n visitor(this);\n var Parent = this.Parent();\n if (Parent)\n Parent.ascend(visitor);\n };\n PDFPageLeaf.prototype.normalize = function () {\n if (this.normalized)\n return;\n var context = this.context;\n var contentsRef = this.get(PDFName.Contents);\n var contents = this.context.lookup(contentsRef);\n if (contents instanceof PDFStream) {\n this.set(PDFName.Contents, context.obj([contentsRef]));\n }\n if (this.autoNormalizeCTM) {\n this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(), this.context.getPopGraphicsStateContentStream());\n }\n // TODO: Clone `Resources` if it is inherited\n var dictOrRef = this.getInheritableAttribute(PDFName.Resources);\n var Resources = context.lookupMaybe(dictOrRef, PDFDict) || context.obj({});\n this.set(PDFName.Resources, Resources);\n // TODO: Clone `Font` if it is inherited\n var Font = Resources.lookupMaybe(PDFName.Font, PDFDict) || context.obj({});\n Resources.set(PDFName.Font, Font);\n // TODO: Clone `XObject` if it is inherited\n var XObject = Resources.lookupMaybe(PDFName.XObject, PDFDict) || context.obj({});\n Resources.set(PDFName.XObject, XObject);\n this.normalized = true;\n };\n PDFPageLeaf.prototype.normalizedEntries = function () {\n this.normalize();\n var Resources = this.Resources();\n var Contents = this.Contents();\n return {\n Resources: Resources,\n Contents: Contents,\n Font: Resources.lookup(PDFName.Font, PDFDict),\n XObject: Resources.lookup(PDFName.XObject, PDFDict),\n };\n };\n PDFPageLeaf.InheritableEntries = [\n 'Resources',\n 'MediaBox',\n 'CropBox',\n 'Rotate',\n ];\n PDFPageLeaf.withContextAndParent = function (context, parent) {\n var dict = new Map();\n dict.set(PDFName.Type, PDFName.Page);\n dict.set(PDFName.Parent, parent);\n dict.set(PDFName.Resources, context.obj({}));\n dict.set(PDFName.MediaBox, context.obj([0, 0, 612, 792]));\n return new PDFPageLeaf(dict, context, false);\n };\n PDFPageLeaf.fromMapWithContext = function (map, context, autoNormalizeCTM) {\n if (autoNormalizeCTM === void 0) { autoNormalizeCTM = true; }\n return new PDFPageLeaf(map, context, autoNormalizeCTM);\n };\n return PDFPageLeaf;\n}(PDFDict));\nexport default PDFPageLeaf;\n//# sourceMappingURL=PDFPageLeaf.js.map","import PDFArray from \"./objects/PDFArray\";\nimport PDFDict from \"./objects/PDFDict\";\nimport PDFName from \"./objects/PDFName\";\nimport PDFRef from \"./objects/PDFRef\";\nimport PDFStream from \"./objects/PDFStream\";\nimport PDFPageLeaf from \"./structures/PDFPageLeaf\";\n/**\n * PDFObjectCopier copies PDFObjects from a src context to a dest context.\n * The primary use case for this is to copy pages between PDFs.\n *\n * _Copying_ an object with a PDFObjectCopier is different from _cloning_ an\n * object with its [[PDFObject.clone]] method:\n *\n * ```\n * const src: PDFContext = ...\n * const dest: PDFContext = ...\n * const originalObject: PDFObject = ...\n * const copiedObject = PDFObjectCopier.for(src, dest).copy(originalObject);\n * const clonedObject = originalObject.clone();\n * ```\n *\n * Copying an object is equivalent to cloning it and then copying over any other\n * objects that it references. Note that only dictionaries, arrays, and streams\n * (or structures build from them) can contain indirect references to other\n * objects. Copying a PDFObject that is not a dictionary, array, or stream is\n * supported, but is equivalent to cloning it.\n */\nvar PDFObjectCopier = /** @class */ (function () {\n function PDFObjectCopier(src, dest) {\n var _this = this;\n this.traversedObjects = new Map();\n // prettier-ignore\n this.copy = function (object) { return (object instanceof PDFPageLeaf ? _this.copyPDFPage(object)\n : object instanceof PDFDict ? _this.copyPDFDict(object)\n : object instanceof PDFArray ? _this.copyPDFArray(object)\n : object instanceof PDFStream ? _this.copyPDFStream(object)\n : object instanceof PDFRef ? _this.copyPDFIndirectObject(object)\n : object.clone()); };\n this.copyPDFPage = function (originalPage) {\n var clonedPage = originalPage.clone();\n // Move any entries that the originalPage is inheriting from its parent\n // tree nodes directly into originalPage so they are preserved during\n // the copy.\n var InheritableEntries = PDFPageLeaf.InheritableEntries;\n for (var idx = 0, len = InheritableEntries.length; idx < len; idx++) {\n var key = PDFName.of(InheritableEntries[idx]);\n var value = clonedPage.getInheritableAttribute(key);\n if (!clonedPage.get(key) && value)\n clonedPage.set(key, value);\n }\n // Remove the parent reference to prevent the whole donor document's page\n // tree from being copied when we only need a single page.\n clonedPage.delete(PDFName.of('Parent'));\n return _this.copyPDFDict(clonedPage);\n };\n this.copyPDFDict = function (originalDict) {\n if (_this.traversedObjects.has(originalDict)) {\n return _this.traversedObjects.get(originalDict);\n }\n var clonedDict = originalDict.clone(_this.dest);\n _this.traversedObjects.set(originalDict, clonedDict);\n var entries = originalDict.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clonedDict.set(key, _this.copy(value));\n }\n return clonedDict;\n };\n this.copyPDFArray = function (originalArray) {\n if (_this.traversedObjects.has(originalArray)) {\n return _this.traversedObjects.get(originalArray);\n }\n var clonedArray = originalArray.clone(_this.dest);\n _this.traversedObjects.set(originalArray, clonedArray);\n for (var idx = 0, len = originalArray.size(); idx < len; idx++) {\n var value = originalArray.get(idx);\n clonedArray.set(idx, _this.copy(value));\n }\n return clonedArray;\n };\n this.copyPDFStream = function (originalStream) {\n if (_this.traversedObjects.has(originalStream)) {\n return _this.traversedObjects.get(originalStream);\n }\n var clonedStream = originalStream.clone(_this.dest);\n _this.traversedObjects.set(originalStream, clonedStream);\n var entries = originalStream.dict.entries();\n for (var idx = 0, len = entries.length; idx < len; idx++) {\n var _a = entries[idx], key = _a[0], value = _a[1];\n clonedStream.dict.set(key, _this.copy(value));\n }\n return clonedStream;\n };\n this.copyPDFIndirectObject = function (ref) {\n var alreadyMapped = _this.traversedObjects.has(ref);\n if (!alreadyMapped) {\n var newRef = _this.dest.nextRef();\n _this.traversedObjects.set(ref, newRef);\n var dereferencedValue = _this.src.lookup(ref);\n if (dereferencedValue) {\n var cloned = _this.copy(dereferencedValue);\n _this.dest.assign(newRef, cloned);\n }\n }\n return _this.traversedObjects.get(ref);\n };\n this.src = src;\n this.dest = dest;\n }\n PDFObjectCopier.for = function (src, dest) {\n return new PDFObjectCopier(src, dest);\n };\n return PDFObjectCopier;\n}());\nexport default PDFObjectCopier;\n//# sourceMappingURL=PDFObjectCopier.js.map","import PDFRef from \"../objects/PDFRef\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, padStart } from \"../../utils\";\n/**\n * Entries should be added using the [[addEntry]] and [[addDeletedEntry]]\n * methods **in order of ascending object number**.\n */\nvar PDFCrossRefSection = /** @class */ (function () {\n function PDFCrossRefSection(firstEntry) {\n this.subsections = firstEntry ? [[firstEntry]] : [];\n this.chunkIdx = 0;\n this.chunkLength = firstEntry ? 1 : 0;\n }\n PDFCrossRefSection.prototype.addEntry = function (ref, offset) {\n this.append({ ref: ref, offset: offset, deleted: false });\n };\n PDFCrossRefSection.prototype.addDeletedEntry = function (ref, nextFreeObjectNumber) {\n this.append({ ref: ref, offset: nextFreeObjectNumber, deleted: true });\n };\n PDFCrossRefSection.prototype.toString = function () {\n var section = \"xref\\n\";\n for (var rangeIdx = 0, rangeLen = this.subsections.length; rangeIdx < rangeLen; rangeIdx++) {\n var range = this.subsections[rangeIdx];\n section += range[0].ref.objectNumber + \" \" + range.length + \"\\n\";\n for (var entryIdx = 0, entryLen = range.length; entryIdx < entryLen; entryIdx++) {\n var entry = range[entryIdx];\n section += padStart(String(entry.offset), 10, '0');\n section += ' ';\n section += padStart(String(entry.ref.generationNumber), 5, '0');\n section += ' ';\n section += entry.deleted ? 'f' : 'n';\n section += ' \\n';\n }\n }\n return section;\n };\n PDFCrossRefSection.prototype.sizeInBytes = function () {\n var size = 5;\n for (var idx = 0, len = this.subsections.length; idx < len; idx++) {\n var subsection = this.subsections[idx];\n var subsectionLength = subsection.length;\n var firstEntry = subsection[0];\n size += 2;\n size += String(firstEntry.ref.objectNumber).length;\n size += String(subsectionLength).length;\n size += 20 * subsectionLength;\n }\n return size;\n };\n PDFCrossRefSection.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.x;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.Newline;\n offset += this.copySubsectionsIntoBuffer(this.subsections, buffer, offset);\n return offset - initialOffset;\n };\n PDFCrossRefSection.prototype.copySubsectionsIntoBuffer = function (subsections, buffer, offset) {\n var initialOffset = offset;\n var length = subsections.length;\n for (var idx = 0; idx < length; idx++) {\n var subsection = this.subsections[idx];\n var firstObjectNumber = String(subsection[0].ref.objectNumber);\n offset += copyStringIntoBuffer(firstObjectNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n var rangeLength = String(subsection.length);\n offset += copyStringIntoBuffer(rangeLength, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n offset += this.copyEntriesIntoBuffer(subsection, buffer, offset);\n }\n return offset - initialOffset;\n };\n PDFCrossRefSection.prototype.copyEntriesIntoBuffer = function (entries, buffer, offset) {\n var length = entries.length;\n for (var idx = 0; idx < length; idx++) {\n var entry = entries[idx];\n var entryOffset = padStart(String(entry.offset), 10, '0');\n offset += copyStringIntoBuffer(entryOffset, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n var entryGen = padStart(String(entry.ref.generationNumber), 5, '0');\n offset += copyStringIntoBuffer(entryGen, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = entry.deleted ? CharCodes.f : CharCodes.n;\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = CharCodes.Newline;\n }\n return 20 * length;\n };\n PDFCrossRefSection.prototype.append = function (currEntry) {\n if (this.chunkLength === 0) {\n this.subsections.push([currEntry]);\n this.chunkIdx = 0;\n this.chunkLength = 1;\n return;\n }\n var chunk = this.subsections[this.chunkIdx];\n var prevEntry = chunk[this.chunkLength - 1];\n if (currEntry.ref.objectNumber - prevEntry.ref.objectNumber > 1) {\n this.subsections.push([currEntry]);\n this.chunkIdx += 1;\n this.chunkLength = 1;\n }\n else {\n chunk.push(currEntry);\n this.chunkLength += 1;\n }\n };\n PDFCrossRefSection.create = function () {\n return new PDFCrossRefSection({\n ref: PDFRef.of(0, 65535),\n offset: 0,\n deleted: true,\n });\n };\n PDFCrossRefSection.createEmpty = function () { return new PDFCrossRefSection(); };\n return PDFCrossRefSection;\n}());\nexport default PDFCrossRefSection;\n//# sourceMappingURL=PDFCrossRefSection.js.map","import CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer } from \"../../utils\";\nvar PDFTrailer = /** @class */ (function () {\n function PDFTrailer(lastXRefOffset) {\n this.lastXRefOffset = String(lastXRefOffset);\n }\n PDFTrailer.prototype.toString = function () {\n return \"startxref\\n\" + this.lastXRefOffset + \"\\n%%EOF\";\n };\n PDFTrailer.prototype.sizeInBytes = function () {\n return 16 + this.lastXRefOffset.length;\n };\n PDFTrailer.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.s;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.x;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.f;\n buffer[offset++] = CharCodes.Newline;\n offset += copyStringIntoBuffer(this.lastXRefOffset, buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.Percent;\n buffer[offset++] = CharCodes.E;\n buffer[offset++] = CharCodes.O;\n buffer[offset++] = CharCodes.F;\n return offset - initialOffset;\n };\n PDFTrailer.forLastCrossRefSectionOffset = function (offset) {\n return new PDFTrailer(offset);\n };\n return PDFTrailer;\n}());\nexport default PDFTrailer;\n//# sourceMappingURL=PDFTrailer.js.map","import CharCodes from \"../syntax/CharCodes\";\nvar PDFTrailerDict = /** @class */ (function () {\n function PDFTrailerDict(dict) {\n this.dict = dict;\n }\n PDFTrailerDict.prototype.toString = function () {\n return \"trailer\\n\" + this.dict.toString();\n };\n PDFTrailerDict.prototype.sizeInBytes = function () {\n return 8 + this.dict.sizeInBytes();\n };\n PDFTrailerDict.prototype.copyBytesInto = function (buffer, offset) {\n var initialOffset = offset;\n buffer[offset++] = CharCodes.t;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.a;\n buffer[offset++] = CharCodes.i;\n buffer[offset++] = CharCodes.l;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.r;\n buffer[offset++] = CharCodes.Newline;\n offset += this.dict.copyBytesInto(buffer, offset);\n return offset - initialOffset;\n };\n PDFTrailerDict.of = function (dict) { return new PDFTrailerDict(dict); };\n return PDFTrailerDict;\n}());\nexport default PDFTrailerDict;\n//# sourceMappingURL=PDFTrailerDict.js.map","import { __extends } from \"tslib\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFFlateStream from \"./PDFFlateStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, last } from \"../../utils\";\nvar PDFObjectStream = /** @class */ (function (_super) {\n __extends(PDFObjectStream, _super);\n function PDFObjectStream(context, objects, encode) {\n if (encode === void 0) { encode = true; }\n var _this = _super.call(this, context.obj({}), encode) || this;\n _this.objects = objects;\n _this.offsets = _this.computeObjectOffsets();\n _this.offsetsString = _this.computeOffsetsString();\n _this.dict.set(PDFName.of('Type'), PDFName.of('ObjStm'));\n _this.dict.set(PDFName.of('N'), PDFNumber.of(_this.objects.length));\n _this.dict.set(PDFName.of('First'), PDFNumber.of(_this.offsetsString.length));\n return _this;\n }\n PDFObjectStream.prototype.getObjectsCount = function () {\n return this.objects.length;\n };\n PDFObjectStream.prototype.clone = function (context) {\n return PDFObjectStream.withContextAndObjects(context || this.dict.context, this.objects.slice(), this.encode);\n };\n PDFObjectStream.prototype.getContentsString = function () {\n var value = this.offsetsString;\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx], object = _a[1];\n value += object + \"\\n\";\n }\n return value;\n };\n PDFObjectStream.prototype.getUnencodedContents = function () {\n var buffer = new Uint8Array(this.getUnencodedContentsSize());\n var offset = copyStringIntoBuffer(this.offsetsString, buffer, 0);\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx], object = _a[1];\n offset += object.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n return buffer;\n };\n PDFObjectStream.prototype.getUnencodedContentsSize = function () {\n return (this.offsetsString.length +\n last(this.offsets)[1] +\n last(this.objects)[1].sizeInBytes() +\n 1);\n };\n PDFObjectStream.prototype.computeOffsetsString = function () {\n var offsetsString = '';\n for (var idx = 0, len = this.offsets.length; idx < len; idx++) {\n var _a = this.offsets[idx], objectNumber = _a[0], offset = _a[1];\n offsetsString += objectNumber + \" \" + offset + \" \";\n }\n return offsetsString;\n };\n PDFObjectStream.prototype.computeObjectOffsets = function () {\n var offset = 0;\n var offsets = new Array(this.objects.length);\n for (var idx = 0, len = this.objects.length; idx < len; idx++) {\n var _a = this.objects[idx], ref = _a[0], object = _a[1];\n offsets[idx] = [ref.objectNumber, offset];\n offset += object.sizeInBytes() + 1; // '\\n'\n }\n return offsets;\n };\n PDFObjectStream.withContextAndObjects = function (context, objects, encode) {\n if (encode === void 0) { encode = true; }\n return new PDFObjectStream(context, objects, encode);\n };\n return PDFObjectStream;\n}(PDFFlateStream));\nexport default PDFObjectStream;\n//# sourceMappingURL=PDFObjectStream.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFCrossRefSection from \"../document/PDFCrossRefSection\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport PDFTrailerDict from \"../document/PDFTrailerDict\";\nimport PDFObjectStream from \"../structures/PDFObjectStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, waitForTick } from \"../../utils\";\nvar PDFWriter = /** @class */ (function () {\n function PDFWriter(context, objectsPerTick) {\n var _this = this;\n this.parsedObjects = 0;\n this.shouldWaitForTick = function (n) {\n _this.parsedObjects += n;\n return _this.parsedObjects % _this.objectsPerTick === 0;\n };\n this.context = context;\n this.objectsPerTick = objectsPerTick;\n }\n PDFWriter.prototype.serializeToBuffer = function () {\n return __awaiter(this, void 0, void 0, function () {\n var _a, size, header, indirectObjects, xref, trailerDict, trailer, offset, buffer, idx, len, _b, ref, object, objectNumber, generationNumber, n;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, this.computeBufferSize()];\n case 1:\n _a = _c.sent(), size = _a.size, header = _a.header, indirectObjects = _a.indirectObjects, xref = _a.xref, trailerDict = _a.trailerDict, trailer = _a.trailer;\n offset = 0;\n buffer = new Uint8Array(size);\n offset += header.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n idx = 0, len = indirectObjects.length;\n _c.label = 2;\n case 2:\n if (!(idx < len)) return [3 /*break*/, 5];\n _b = indirectObjects[idx], ref = _b[0], object = _b[1];\n objectNumber = String(ref.objectNumber);\n offset += copyStringIntoBuffer(objectNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n generationNumber = String(ref.generationNumber);\n offset += copyStringIntoBuffer(generationNumber, buffer, offset);\n buffer[offset++] = CharCodes.Space;\n buffer[offset++] = CharCodes.o;\n buffer[offset++] = CharCodes.b;\n buffer[offset++] = CharCodes.j;\n buffer[offset++] = CharCodes.Newline;\n offset += object.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.e;\n buffer[offset++] = CharCodes.n;\n buffer[offset++] = CharCodes.d;\n buffer[offset++] = CharCodes.o;\n buffer[offset++] = CharCodes.b;\n buffer[offset++] = CharCodes.j;\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n n = object instanceof PDFObjectStream ? object.getObjectsCount() : 1;\n if (!this.shouldWaitForTick(n)) return [3 /*break*/, 4];\n return [4 /*yield*/, waitForTick()];\n case 3:\n _c.sent();\n _c.label = 4;\n case 4:\n idx++;\n return [3 /*break*/, 2];\n case 5:\n if (xref) {\n offset += xref.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n }\n if (trailerDict) {\n offset += trailerDict.copyBytesInto(buffer, offset);\n buffer[offset++] = CharCodes.Newline;\n buffer[offset++] = CharCodes.Newline;\n }\n offset += trailer.copyBytesInto(buffer, offset);\n return [2 /*return*/, buffer];\n }\n });\n });\n };\n PDFWriter.prototype.computeIndirectObjectSize = function (_a) {\n var ref = _a[0], object = _a[1];\n var refSize = ref.sizeInBytes() + 3; // 'R' -> 'obj\\n'\n var objectSize = object.sizeInBytes() + 9; // '\\nendobj\\n\\n'\n return refSize + objectSize;\n };\n PDFWriter.prototype.createTrailerDict = function () {\n return this.context.obj({\n Size: this.context.largestObjectNumber + 1,\n Root: this.context.trailerInfo.Root,\n Encrypt: this.context.trailerInfo.Encrypt,\n Info: this.context.trailerInfo.Info,\n ID: this.context.trailerInfo.ID,\n });\n };\n PDFWriter.prototype.computeBufferSize = function () {\n return __awaiter(this, void 0, void 0, function () {\n var header, size, xref, indirectObjects, idx, len, indirectObject, ref, xrefOffset, trailerDict, trailer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n header = PDFHeader.forVersion(1, 7);\n size = header.sizeInBytes() + 2;\n xref = PDFCrossRefSection.create();\n indirectObjects = this.context.enumerateIndirectObjects();\n idx = 0, len = indirectObjects.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n indirectObject = indirectObjects[idx];\n ref = indirectObject[0];\n xref.addEntry(ref, size);\n size += this.computeIndirectObjectSize(indirectObject);\n if (!this.shouldWaitForTick(1)) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n xrefOffset = size;\n size += xref.sizeInBytes() + 1; // '\\n'\n trailerDict = PDFTrailerDict.of(this.createTrailerDict());\n size += trailerDict.sizeInBytes() + 2; // '\\n\\n'\n trailer = PDFTrailer.forLastCrossRefSectionOffset(xrefOffset);\n size += trailer.sizeInBytes();\n return [2 /*return*/, { size: size, header: header, indirectObjects: indirectObjects, xref: xref, trailerDict: trailerDict, trailer: trailer }];\n }\n });\n });\n };\n PDFWriter.forContext = function (context, objectsPerTick) {\n return new PDFWriter(context, objectsPerTick);\n };\n return PDFWriter;\n}());\nexport default PDFWriter;\n//# sourceMappingURL=PDFWriter.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nvar PDFInvalidObject = /** @class */ (function (_super) {\n __extends(PDFInvalidObject, _super);\n function PDFInvalidObject(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n PDFInvalidObject.prototype.clone = function () {\n return PDFInvalidObject.of(this.data.slice());\n };\n PDFInvalidObject.prototype.toString = function () {\n return \"PDFInvalidObject(\" + this.data.length + \" bytes)\";\n };\n PDFInvalidObject.prototype.sizeInBytes = function () {\n return this.data.length;\n };\n PDFInvalidObject.prototype.copyBytesInto = function (buffer, offset) {\n var length = this.data.length;\n for (var idx = 0; idx < length; idx++) {\n buffer[offset++] = this.data[idx];\n }\n return length;\n };\n PDFInvalidObject.of = function (data) { return new PDFInvalidObject(data); };\n return PDFInvalidObject;\n}(PDFObject));\nexport default PDFInvalidObject;\n//# sourceMappingURL=PDFInvalidObject.js.map","import { __awaiter, __generator } from \"tslib\";\n// prettier-ignore\nvar MARKERS = [\n 0xffc0, 0xffc1, 0xffc2,\n 0xffc3, 0xffc5, 0xffc6,\n 0xffc7, 0xffc8, 0xffc9,\n 0xffca, 0xffcb, 0xffcc,\n 0xffcd, 0xffce, 0xffcf,\n];\nvar ColorSpace;\n(function (ColorSpace) {\n ColorSpace[\"DeviceGray\"] = \"DeviceGray\";\n ColorSpace[\"DeviceRGB\"] = \"DeviceRGB\";\n ColorSpace[\"DeviceCMYK\"] = \"DeviceCMYK\";\n})(ColorSpace || (ColorSpace = {}));\nvar ChannelToColorSpace = {\n 1: ColorSpace.DeviceGray,\n 3: ColorSpace.DeviceRGB,\n 4: ColorSpace.DeviceCMYK,\n};\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/foliojs/pdfkit/blob/a6af76467ce06bd6a2af4aa7271ccac9ff152a7d/lib/image/jpeg.js\n */\nvar JpegEmbedder = /** @class */ (function () {\n function JpegEmbedder(imageData, bitsPerComponent, width, height, colorSpace) {\n this.imageData = imageData;\n this.bitsPerComponent = bitsPerComponent;\n this.width = width;\n this.height = height;\n this.colorSpace = colorSpace;\n }\n JpegEmbedder.for = function (imageData) {\n return __awaiter(this, void 0, void 0, function () {\n var dataView, soi, pos, marker, bitsPerComponent, height, width, channelByte, channelName, colorSpace;\n return __generator(this, function (_a) {\n dataView = new DataView(imageData.buffer);\n soi = dataView.getUint16(0);\n if (soi !== 0xffd8)\n throw new Error('SOI not found in JPEG');\n pos = 2;\n while (pos < dataView.byteLength) {\n marker = dataView.getUint16(pos);\n pos += 2;\n if (MARKERS.includes(marker))\n break;\n pos += dataView.getUint16(pos);\n }\n if (!MARKERS.includes(marker))\n throw new Error('Invalid JPEG');\n pos += 2;\n bitsPerComponent = dataView.getUint8(pos++);\n height = dataView.getUint16(pos);\n pos += 2;\n width = dataView.getUint16(pos);\n pos += 2;\n channelByte = dataView.getUint8(pos++);\n channelName = ChannelToColorSpace[channelByte];\n if (!channelName)\n throw new Error('Unknown JPEG channel.');\n colorSpace = channelName;\n return [2 /*return*/, new JpegEmbedder(imageData, bitsPerComponent, width, height, colorSpace)];\n });\n });\n };\n JpegEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var xObject;\n return __generator(this, function (_a) {\n xObject = context.stream(this.imageData, {\n Type: 'XObject',\n Subtype: 'Image',\n BitsPerComponent: this.bitsPerComponent,\n Width: this.width,\n Height: this.height,\n ColorSpace: this.colorSpace,\n Filter: 'DCTDecode',\n // CMYK JPEG streams in PDF are typically stored complemented,\n // with 1 as 'off' and 0 as 'on' (PDF 32000-1:2008, 8.6.4.4).\n //\n // Standalone CMYK JPEG (usually exported by Photoshop) are\n // stored inverse, with 0 as 'off' and 1 as 'on', like RGB.\n //\n // Applying a swap here as a hedge that most bytes passing\n // through this method will benefit from it.\n Decode: this.colorSpace === ColorSpace.DeviceCMYK\n ? [1, 0, 1, 0, 1, 0, 1, 0]\n : undefined,\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n return JpegEmbedder;\n}());\nexport default JpegEmbedder;\n//# sourceMappingURL=JpegEmbedder.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport PDFInvalidObject from \"../objects/PDFInvalidObject\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFStream from \"../objects/PDFStream\";\nimport PDFCrossRefStream from \"../structures/PDFCrossRefStream\";\nimport PDFObjectStream from \"../structures/PDFObjectStream\";\nimport PDFWriter from \"./PDFWriter\";\nimport { last, waitForTick } from \"../../utils\";\nvar PDFStreamWriter = /** @class */ (function (_super) {\n __extends(PDFStreamWriter, _super);\n function PDFStreamWriter(context, objectsPerTick, encodeStreams, objectsPerStream) {\n var _this = _super.call(this, context, objectsPerTick) || this;\n _this.encodeStreams = encodeStreams;\n _this.objectsPerStream = objectsPerStream;\n return _this;\n }\n PDFStreamWriter.prototype.computeBufferSize = function () {\n return __awaiter(this, void 0, void 0, function () {\n var objectNumber, header, size, xrefStream, uncompressedObjects, compressedObjects, objectStreamRefs, indirectObjects, idx, len, indirectObject, ref, object, shouldNotCompress, chunk, objectStreamRef, idx, len, chunk, ref, objectStream, xrefStreamRef, xrefOffset, trailer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n objectNumber = this.context.largestObjectNumber + 1;\n header = PDFHeader.forVersion(1, 7);\n size = header.sizeInBytes() + 2;\n xrefStream = PDFCrossRefStream.create(this.createTrailerDict(), this.encodeStreams);\n uncompressedObjects = [];\n compressedObjects = [];\n objectStreamRefs = [];\n indirectObjects = this.context.enumerateIndirectObjects();\n idx = 0, len = indirectObjects.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 6];\n indirectObject = indirectObjects[idx];\n ref = indirectObject[0], object = indirectObject[1];\n shouldNotCompress = ref === this.context.trailerInfo.Encrypt ||\n object instanceof PDFStream ||\n object instanceof PDFInvalidObject ||\n ref.generationNumber !== 0;\n if (!shouldNotCompress) return [3 /*break*/, 4];\n uncompressedObjects.push(indirectObject);\n xrefStream.addUncompressedEntry(ref, size);\n size += this.computeIndirectObjectSize(indirectObject);\n if (!this.shouldWaitForTick(1)) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [3 /*break*/, 5];\n case 4:\n chunk = last(compressedObjects);\n objectStreamRef = last(objectStreamRefs);\n if (!chunk || chunk.length % this.objectsPerStream === 0) {\n chunk = [];\n compressedObjects.push(chunk);\n objectStreamRef = PDFRef.of(objectNumber++);\n objectStreamRefs.push(objectStreamRef);\n }\n xrefStream.addCompressedEntry(ref, objectStreamRef, chunk.length);\n chunk.push(indirectObject);\n _a.label = 5;\n case 5:\n idx++;\n return [3 /*break*/, 1];\n case 6:\n idx = 0, len = compressedObjects.length;\n _a.label = 7;\n case 7:\n if (!(idx < len)) return [3 /*break*/, 10];\n chunk = compressedObjects[idx];\n ref = objectStreamRefs[idx];\n objectStream = PDFObjectStream.withContextAndObjects(this.context, chunk, this.encodeStreams);\n xrefStream.addUncompressedEntry(ref, size);\n size += this.computeIndirectObjectSize([ref, objectStream]);\n uncompressedObjects.push([ref, objectStream]);\n if (!this.shouldWaitForTick(chunk.length)) return [3 /*break*/, 9];\n return [4 /*yield*/, waitForTick()];\n case 8:\n _a.sent();\n _a.label = 9;\n case 9:\n idx++;\n return [3 /*break*/, 7];\n case 10:\n xrefStreamRef = PDFRef.of(objectNumber++);\n xrefStream.dict.set(PDFName.of('Size'), PDFNumber.of(objectNumber));\n xrefStream.addUncompressedEntry(xrefStreamRef, size);\n xrefOffset = size;\n size += this.computeIndirectObjectSize([xrefStreamRef, xrefStream]);\n uncompressedObjects.push([xrefStreamRef, xrefStream]);\n trailer = PDFTrailer.forLastCrossRefSectionOffset(xrefOffset);\n size += trailer.sizeInBytes();\n return [2 /*return*/, { size: size, header: header, indirectObjects: uncompressedObjects, trailer: trailer }];\n }\n });\n });\n };\n PDFStreamWriter.forContext = function (context, objectsPerTick, encodeStreams, objectsPerStream) {\n if (encodeStreams === void 0) { encodeStreams = true; }\n if (objectsPerStream === void 0) { objectsPerStream = 50; }\n return new PDFStreamWriter(context, objectsPerTick, encodeStreams, objectsPerStream);\n };\n return PDFStreamWriter;\n}(PDFWriter));\nexport default PDFStreamWriter;\n//# sourceMappingURL=PDFStreamWriter.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, toHexStringOfMinLength, utf16Decode, utf16Encode, pdfDocEncodingDecode, parseDate, hasUtf16BOM, } from \"../../utils\";\nimport { InvalidPDFDateStringError } from \"../errors\";\nvar PDFHexString = /** @class */ (function (_super) {\n __extends(PDFHexString, _super);\n function PDFHexString(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFHexString.prototype.asBytes = function () {\n // Append a zero if the number of digits is odd. See PDF spec 7.3.4.3\n var hex = this.value + (this.value.length % 2 === 1 ? '0' : '');\n var hexLength = hex.length;\n var bytes = new Uint8Array(hex.length / 2);\n var hexOffset = 0;\n var bytesOffset = 0;\n // Interpret each pair of hex digits as a single byte\n while (hexOffset < hexLength) {\n var byte = parseInt(hex.substring(hexOffset, hexOffset + 2), 16);\n bytes[bytesOffset] = byte;\n hexOffset += 2;\n bytesOffset += 1;\n }\n return bytes;\n };\n PDFHexString.prototype.decodeText = function () {\n var bytes = this.asBytes();\n if (hasUtf16BOM(bytes))\n return utf16Decode(bytes);\n return pdfDocEncodingDecode(bytes);\n };\n PDFHexString.prototype.decodeDate = function () {\n var text = this.decodeText();\n var date = parseDate(text);\n if (!date)\n throw new InvalidPDFDateStringError(text);\n return date;\n };\n PDFHexString.prototype.asString = function () {\n return this.value;\n };\n PDFHexString.prototype.clone = function () {\n return PDFHexString.of(this.value);\n };\n PDFHexString.prototype.toString = function () {\n return \"<\" + this.value + \">\";\n };\n PDFHexString.prototype.sizeInBytes = function () {\n return this.value.length + 2;\n };\n PDFHexString.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.LessThan;\n offset += copyStringIntoBuffer(this.value, buffer, offset);\n buffer[offset++] = CharCodes.GreaterThan;\n return this.value.length + 2;\n };\n PDFHexString.of = function (value) { return new PDFHexString(value); };\n PDFHexString.fromText = function (value) {\n var encoded = utf16Encode(value);\n var hex = '';\n for (var idx = 0, len = encoded.length; idx < len; idx++) {\n hex += toHexStringOfMinLength(encoded[idx], 4);\n }\n return new PDFHexString(hex);\n };\n return PDFHexString;\n}(PDFObject));\nexport default PDFHexString;\n//# sourceMappingURL=PDFHexString.js.map","import { Encodings, Font, FontNames, } from '@pdf-lib/standard-fonts';\nimport PDFHexString from \"../objects/PDFHexString\";\nimport { toCodePoint, toHexString } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/foliojs/pdfkit/blob/f91bdd61c164a72ea06be1a43dc0a412afc3925f/lib/font/afm.coffee\n */\nvar StandardFontEmbedder = /** @class */ (function () {\n function StandardFontEmbedder(fontName) {\n // prettier-ignore\n this.encoding = (fontName === FontNames.ZapfDingbats ? Encodings.ZapfDingbats\n : fontName === FontNames.Symbol ? Encodings.Symbol\n : Encodings.WinAnsi);\n this.font = Font.load(fontName);\n this.fontName = this.font.FontName;\n }\n /**\n * Encode the JavaScript string into this font. (JavaScript encodes strings in\n * Unicode, but standard fonts use either WinAnsi, ZapfDingbats, or Symbol\n * encodings)\n */\n StandardFontEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.encodeTextAsGlyphs(text);\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n hexCodes[idx] = toHexString(glyphs[idx].code);\n }\n return PDFHexString.of(hexCodes.join(''));\n };\n StandardFontEmbedder.prototype.widthOfTextAtSize = function (text, size) {\n var glyphs = this.encodeTextAsGlyphs(text);\n var totalWidth = 0;\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var left = glyphs[idx].name;\n var right = (glyphs[idx + 1] || {}).name;\n var kernAmount = this.font.getXAxisKerningForPair(left, right) || 0;\n totalWidth += this.widthOfGlyph(left) + kernAmount;\n }\n var scale = size / 1000;\n return totalWidth * scale;\n };\n StandardFontEmbedder.prototype.heightOfFontAtSize = function (size) {\n var _a = this.font, Ascender = _a.Ascender, Descender = _a.Descender, FontBBox = _a.FontBBox;\n var yTop = Ascender || FontBBox[3];\n var yBottom = Descender || FontBBox[1];\n return ((yTop - yBottom) / 1000) * size;\n };\n StandardFontEmbedder.prototype.sizeOfFontAtHeight = function (height) {\n var _a = this.font, Ascender = _a.Ascender, Descender = _a.Descender, FontBBox = _a.FontBBox;\n var yTop = Ascender || FontBBox[3];\n var yBottom = Descender || FontBBox[1];\n return (1000 * height) / (yTop - yBottom);\n };\n StandardFontEmbedder.prototype.embedIntoContext = function (context, ref) {\n var fontDict = context.obj({\n Type: 'Font',\n Subtype: 'Type1',\n BaseFont: this.font.FontName,\n Encoding: this.encoding === Encodings.WinAnsi ? 'WinAnsiEncoding' : undefined,\n });\n if (ref) {\n context.assign(ref, fontDict);\n return ref;\n }\n else {\n return context.register(fontDict);\n }\n };\n StandardFontEmbedder.prototype.widthOfGlyph = function (glyphName) {\n // Default to 250 if font doesn't specify a width\n return this.font.getWidthOfGlyph(glyphName) || 250;\n };\n StandardFontEmbedder.prototype.encodeTextAsGlyphs = function (text) {\n var codePoints = Array.from(text);\n var glyphs = new Array(codePoints.length);\n for (var idx = 0, len = codePoints.length; idx < len; idx++) {\n var codePoint = toCodePoint(codePoints[idx]);\n glyphs[idx] = this.encoding.encodeUnicodeCodePoint(codePoint);\n }\n return glyphs;\n };\n StandardFontEmbedder.for = function (fontName) { return new StandardFontEmbedder(fontName); };\n return StandardFontEmbedder;\n}());\nexport default StandardFontEmbedder;\n//# sourceMappingURL=StandardFontEmbedder.js.map","import { toHexString, toHexStringOfMinLength } from \"../../utils\";\nimport { hasSurrogates, highSurrogate, isWithinBMP, lowSurrogate, } from \"../../utils/unicode\";\n/** `glyphs` should be an array of unique glyphs */\nexport var createCmap = function (glyphs, glyphId) {\n var bfChars = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var glyph = glyphs[idx];\n var id = cmapHexFormat(cmapHexString(glyphId(glyph)));\n var unicode = cmapHexFormat.apply(void 0, glyph.codePoints.map(cmapCodePointFormat));\n bfChars[idx] = [id, unicode];\n }\n return fillCmapTemplate(bfChars);\n};\n/* =============================== Templates ================================ */\nvar fillCmapTemplate = function (bfChars) { return \"/CIDInit /ProcSet findresource begin\\n12 dict begin\\nbegincmap\\n/CIDSystemInfo <<\\n /Registry (Adobe)\\n /Ordering (UCS)\\n /Supplement 0\\n>> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000>\\nendcodespacerange\\n\" + bfChars.length + \" beginbfchar\\n\" + bfChars.map(function (_a) {\n var glyphId = _a[0], codePoint = _a[1];\n return glyphId + \" \" + codePoint;\n}).join('\\n') + \"\\nendbfchar\\nendcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\"; };\n/* =============================== Utilities ================================ */\nvar cmapHexFormat = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n return \"<\" + values.join('') + \">\";\n};\nvar cmapHexString = function (value) { return toHexStringOfMinLength(value, 4); };\nvar cmapCodePointFormat = function (codePoint) {\n if (isWithinBMP(codePoint))\n return cmapHexString(codePoint);\n if (hasSurrogates(codePoint)) {\n var hs = highSurrogate(codePoint);\n var ls = lowSurrogate(codePoint);\n return \"\" + cmapHexString(hs) + cmapHexString(ls);\n }\n var hex = toHexString(codePoint);\n var msg = \"0x\" + hex + \" is not a valid UTF-8 or UTF-16 codepoint.\";\n throw new Error(msg);\n};\n//# sourceMappingURL=CMap.js.map","import { __extends } from \"tslib\";\nimport PDFObject from \"./PDFObject\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { copyStringIntoBuffer, padStart, utf16Decode, pdfDocEncodingDecode, toCharCode, parseDate, hasUtf16BOM, } from \"../../utils\";\nimport { InvalidPDFDateStringError } from \"../errors\";\nvar PDFString = /** @class */ (function (_super) {\n __extends(PDFString, _super);\n function PDFString(value) {\n var _this = _super.call(this) || this;\n _this.value = value;\n return _this;\n }\n PDFString.prototype.asBytes = function () {\n var bytes = [];\n var octal = '';\n var escaped = false;\n var pushByte = function (byte) {\n if (byte !== undefined)\n bytes.push(byte);\n escaped = false;\n };\n for (var idx = 0, len = this.value.length; idx < len; idx++) {\n var char = this.value[idx];\n var byte = toCharCode(char);\n var nextChar = this.value[idx + 1];\n if (!escaped) {\n if (byte === CharCodes.BackSlash)\n escaped = true;\n else\n pushByte(byte);\n }\n else {\n if (byte === CharCodes.Newline)\n pushByte();\n else if (byte === CharCodes.CarriageReturn)\n pushByte();\n else if (byte === CharCodes.n)\n pushByte(CharCodes.Newline);\n else if (byte === CharCodes.r)\n pushByte(CharCodes.CarriageReturn);\n else if (byte === CharCodes.t)\n pushByte(CharCodes.Tab);\n else if (byte === CharCodes.b)\n pushByte(CharCodes.Backspace);\n else if (byte === CharCodes.f)\n pushByte(CharCodes.FormFeed);\n else if (byte === CharCodes.LeftParen)\n pushByte(CharCodes.LeftParen);\n else if (byte === CharCodes.RightParen)\n pushByte(CharCodes.RightParen);\n else if (byte === CharCodes.Backspace)\n pushByte(CharCodes.BackSlash);\n else if (byte >= CharCodes.Zero && byte <= CharCodes.Seven) {\n octal += char;\n if (octal.length === 3 || !(nextChar >= '0' && nextChar <= '7')) {\n pushByte(parseInt(octal, 8));\n octal = '';\n }\n }\n else {\n pushByte(byte);\n }\n }\n }\n return new Uint8Array(bytes);\n };\n PDFString.prototype.decodeText = function () {\n var bytes = this.asBytes();\n if (hasUtf16BOM(bytes))\n return utf16Decode(bytes);\n return pdfDocEncodingDecode(bytes);\n };\n PDFString.prototype.decodeDate = function () {\n var text = this.decodeText();\n var date = parseDate(text);\n if (!date)\n throw new InvalidPDFDateStringError(text);\n return date;\n };\n PDFString.prototype.asString = function () {\n return this.value;\n };\n PDFString.prototype.clone = function () {\n return PDFString.of(this.value);\n };\n PDFString.prototype.toString = function () {\n return \"(\" + this.value + \")\";\n };\n PDFString.prototype.sizeInBytes = function () {\n return this.value.length + 2;\n };\n PDFString.prototype.copyBytesInto = function (buffer, offset) {\n buffer[offset++] = CharCodes.LeftParen;\n offset += copyStringIntoBuffer(this.value, buffer, offset);\n buffer[offset++] = CharCodes.RightParen;\n return this.value.length + 2;\n };\n // The PDF spec allows newlines and parens to appear directly within a literal\n // string. These character _may_ be escaped. But they do not _have_ to be. So\n // for simplicity, we will not bother escaping them.\n PDFString.of = function (value) { return new PDFString(value); };\n PDFString.fromDate = function (date) {\n var year = padStart(String(date.getUTCFullYear()), 4, '0');\n var month = padStart(String(date.getUTCMonth() + 1), 2, '0');\n var day = padStart(String(date.getUTCDate()), 2, '0');\n var hours = padStart(String(date.getUTCHours()), 2, '0');\n var mins = padStart(String(date.getUTCMinutes()), 2, '0');\n var secs = padStart(String(date.getUTCSeconds()), 2, '0');\n return new PDFString(\"D:\" + year + month + day + hours + mins + secs + \"Z\");\n };\n return PDFString;\n}(PDFObject));\nexport default PDFString;\n//# sourceMappingURL=PDFString.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { createCmap } from \"./CMap\";\nimport { deriveFontFlags } from \"./FontFlags\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFString from \"../objects/PDFString\";\nimport { addRandomSuffix, byAscendingId, Cache, sortedUniq, toHexStringOfMinLength, } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/jpeg.coffee\n */\nvar CustomFontEmbedder = /** @class */ (function () {\n function CustomFontEmbedder(font, fontData) {\n var _this = this;\n this.allGlyphsInFontSortedById = function () {\n var glyphs = new Array(_this.font.characterSet.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var codePoint = _this.font.characterSet[idx];\n glyphs[idx] = _this.font.glyphForCodePoint(codePoint);\n }\n return sortedUniq(glyphs.sort(byAscendingId), function (g) { return g.id; });\n };\n this.font = font;\n this.scale = 1000 / this.font.unitsPerEm;\n this.fontData = fontData;\n this.fontName = this.font.postscriptName || 'Font';\n this.baseFontName = '';\n this.glyphCache = Cache.populatedBy(this.allGlyphsInFontSortedById);\n }\n CustomFontEmbedder.for = function (fontkit, fontData) {\n return __awaiter(this, void 0, void 0, function () {\n var font;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fontkit.create(fontData)];\n case 1:\n font = _a.sent();\n return [2 /*return*/, new CustomFontEmbedder(font, fontData)];\n }\n });\n });\n };\n /**\n * Encode the JavaScript string into this font. (JavaScript encodes strings in\n * Unicode, but embedded fonts use their own custom encodings)\n */\n CustomFontEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.font.layout(text).glyphs;\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n hexCodes[idx] = toHexStringOfMinLength(glyphs[idx].id, 4);\n }\n return PDFHexString.of(hexCodes.join(''));\n };\n // The advanceWidth takes into account kerning automatically, so we don't\n // have to do that manually like we do for the standard fonts.\n CustomFontEmbedder.prototype.widthOfTextAtSize = function (text, size) {\n var glyphs = this.font.layout(text).glyphs;\n var totalWidth = 0;\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n totalWidth += glyphs[idx].advanceWidth * this.scale;\n }\n var scale = size / 1000;\n return totalWidth * scale;\n };\n CustomFontEmbedder.prototype.heightOfFontAtSize = function (size) {\n var _a = this.font, ascent = _a.ascent, descent = _a.descent, bbox = _a.bbox;\n var yTop = (ascent || bbox.maxY) * this.scale;\n var yBottom = (descent || bbox.minY) * this.scale;\n return ((yTop - yBottom) / 1000) * size;\n };\n CustomFontEmbedder.prototype.sizeOfFontAtHeight = function (height) {\n var _a = this.font, ascent = _a.ascent, descent = _a.descent, bbox = _a.bbox;\n var yTop = (ascent || bbox.maxY) * this.scale;\n var yBottom = (descent || bbox.minY) * this.scale;\n return (1000 * height) / (yTop - yBottom);\n };\n CustomFontEmbedder.prototype.embedIntoContext = function (context, ref) {\n this.baseFontName = addRandomSuffix(this.fontName);\n return this.embedFontDict(context, ref);\n };\n CustomFontEmbedder.prototype.embedFontDict = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var cidFontDictRef, unicodeCMapRef, fontDict;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.embedCIDFontDict(context)];\n case 1:\n cidFontDictRef = _a.sent();\n unicodeCMapRef = this.embedUnicodeCmap(context);\n fontDict = context.obj({\n Type: 'Font',\n Subtype: 'Type0',\n BaseFont: this.baseFontName,\n Encoding: 'Identity-H',\n DescendantFonts: [cidFontDictRef],\n ToUnicode: unicodeCMapRef,\n });\n if (ref) {\n context.assign(ref, fontDict);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(fontDict)];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.isCFF = function () {\n return this.font.cff;\n };\n CustomFontEmbedder.prototype.embedCIDFontDict = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontDescriptorRef, cidFontDict;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.embedFontDescriptor(context)];\n case 1:\n fontDescriptorRef = _a.sent();\n cidFontDict = context.obj({\n Type: 'Font',\n Subtype: this.isCFF() ? 'CIDFontType0' : 'CIDFontType2',\n BaseFont: this.baseFontName,\n CIDSystemInfo: {\n Registry: PDFString.of('Adobe'),\n Ordering: PDFString.of('Identity'),\n Supplement: 0,\n },\n FontDescriptor: fontDescriptorRef,\n W: this.computeWidths(),\n });\n return [2 /*return*/, context.register(cidFontDict)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.embedFontDescriptor = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontStreamRef, scale, _a, italicAngle, ascent, descent, capHeight, xHeight, _b, minX, minY, maxX, maxY, fontDescriptor;\n var _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0: return [4 /*yield*/, this.embedFontStream(context)];\n case 1:\n fontStreamRef = _d.sent();\n scale = this.scale;\n _a = this.font, italicAngle = _a.italicAngle, ascent = _a.ascent, descent = _a.descent, capHeight = _a.capHeight, xHeight = _a.xHeight;\n _b = this.font.bbox, minX = _b.minX, minY = _b.minY, maxX = _b.maxX, maxY = _b.maxY;\n fontDescriptor = context.obj((_c = {\n Type: 'FontDescriptor',\n FontName: this.baseFontName,\n Flags: deriveFontFlags(this.font),\n FontBBox: [minX * scale, minY * scale, maxX * scale, maxY * scale],\n ItalicAngle: italicAngle,\n Ascent: ascent * scale,\n Descent: descent * scale,\n CapHeight: (capHeight || ascent) * scale,\n XHeight: (xHeight || 0) * scale,\n // Not sure how to compute/find this, nor is anybody else really:\n // https://stackoverflow.com/questions/35485179/stemv-value-of-the-truetype-font\n StemV: 0\n },\n _c[this.isCFF() ? 'FontFile3' : 'FontFile2'] = fontStreamRef,\n _c));\n return [2 /*return*/, context.register(fontDescriptor)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.serializeFont = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this.fontData];\n });\n });\n };\n CustomFontEmbedder.prototype.embedFontStream = function (context) {\n return __awaiter(this, void 0, void 0, function () {\n var fontStream, _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _b = (_a = context).flateStream;\n return [4 /*yield*/, this.serializeFont()];\n case 1:\n fontStream = _b.apply(_a, [_c.sent(), {\n Subtype: this.isCFF() ? 'CIDFontType0C' : undefined,\n }]);\n return [2 /*return*/, context.register(fontStream)];\n }\n });\n });\n };\n CustomFontEmbedder.prototype.embedUnicodeCmap = function (context) {\n var cmap = createCmap(this.glyphCache.access(), this.glyphId.bind(this));\n var cmapStream = context.flateStream(cmap);\n return context.register(cmapStream);\n };\n CustomFontEmbedder.prototype.glyphId = function (glyph) {\n return glyph ? glyph.id : -1;\n };\n CustomFontEmbedder.prototype.computeWidths = function () {\n var glyphs = this.glyphCache.access();\n var widths = [];\n var currSection = [];\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var currGlyph = glyphs[idx];\n var prevGlyph = glyphs[idx - 1];\n var currGlyphId = this.glyphId(currGlyph);\n var prevGlyphId = this.glyphId(prevGlyph);\n if (idx === 0) {\n widths.push(currGlyphId);\n }\n else if (currGlyphId - prevGlyphId !== 1) {\n widths.push(currSection);\n widths.push(currGlyphId);\n currSection = [];\n }\n currSection.push(currGlyph.advanceWidth * this.scale);\n }\n widths.push(currSection);\n return widths;\n };\n return CustomFontEmbedder;\n}());\nexport default CustomFontEmbedder;\n//# sourceMappingURL=CustomFontEmbedder.js.map","// prettier-ignore\nvar makeFontFlags = function (options) {\n var flags = 0;\n var flipBit = function (bit) { flags |= (1 << (bit - 1)); };\n if (options.fixedPitch)\n flipBit(1);\n if (options.serif)\n flipBit(2);\n if (options.symbolic)\n flipBit(3);\n if (options.script)\n flipBit(4);\n if (options.nonsymbolic)\n flipBit(6);\n if (options.italic)\n flipBit(7);\n if (options.allCap)\n flipBit(17);\n if (options.smallCap)\n flipBit(18);\n if (options.forceBold)\n flipBit(19);\n return flags;\n};\n// From: https://github.com/foliojs/pdfkit/blob/83f5f7243172a017adcf6a7faa5547c55982c57b/lib/font/embedded.js#L123-L129\nexport var deriveFontFlags = function (font) {\n var familyClass = font['OS/2'] ? font['OS/2'].sFamilyClass : 0;\n var flags = makeFontFlags({\n fixedPitch: font.post.isFixedPitch,\n serif: 1 <= familyClass && familyClass <= 7,\n symbolic: true,\n script: familyClass === 10,\n italic: font.head.macStyle.italic,\n });\n return flags;\n};\n//# sourceMappingURL=FontFlags.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport CustomFontEmbedder from \"./CustomFontEmbedder\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport { Cache, mergeUint8Arrays, toHexStringOfMinLength } from \"../../utils\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/jpeg.coffee\n */\nvar CustomFontSubsetEmbedder = /** @class */ (function (_super) {\n __extends(CustomFontSubsetEmbedder, _super);\n function CustomFontSubsetEmbedder(font, fontData) {\n var _this = _super.call(this, font, fontData) || this;\n _this.subset = _this.font.createSubset();\n _this.glyphs = [];\n _this.glyphCache = Cache.populatedBy(function () { return _this.glyphs; });\n _this.glyphIdMap = new Map();\n return _this;\n }\n CustomFontSubsetEmbedder.for = function (fontkit, fontData) {\n return __awaiter(this, void 0, void 0, function () {\n var font;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fontkit.create(fontData)];\n case 1:\n font = _a.sent();\n return [2 /*return*/, new CustomFontSubsetEmbedder(font, fontData)];\n }\n });\n });\n };\n CustomFontSubsetEmbedder.prototype.encodeText = function (text) {\n var glyphs = this.font.layout(text).glyphs;\n var hexCodes = new Array(glyphs.length);\n for (var idx = 0, len = glyphs.length; idx < len; idx++) {\n var glyph = glyphs[idx];\n var subsetGlyphId = this.subset.includeGlyph(glyph);\n this.glyphs[subsetGlyphId - 1] = glyph;\n this.glyphIdMap.set(glyph.id, subsetGlyphId);\n hexCodes[idx] = toHexStringOfMinLength(subsetGlyphId, 4);\n }\n this.glyphCache.invalidate();\n return PDFHexString.of(hexCodes.join(''));\n };\n CustomFontSubsetEmbedder.prototype.isCFF = function () {\n return this.subset.cff;\n };\n CustomFontSubsetEmbedder.prototype.glyphId = function (glyph) {\n return glyph ? this.glyphIdMap.get(glyph.id) : -1;\n };\n CustomFontSubsetEmbedder.prototype.serializeFont = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var parts = [];\n _this.subset\n .encodeStream()\n .on('data', function (bytes) { return parts.push(bytes); })\n .on('end', function () { return resolve(mergeUint8Arrays(parts)); })\n .on('error', function (err) { return reject(err); });\n });\n };\n return CustomFontSubsetEmbedder;\n}(CustomFontEmbedder));\nexport default CustomFontSubsetEmbedder;\n//# sourceMappingURL=CustomFontSubsetEmbedder.js.map","'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\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\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [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\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/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(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\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_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\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction 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\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction 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 } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\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 */\nfunction 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\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction 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\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 */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// 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; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\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]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* 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\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) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n 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 */\nfunction 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); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\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 }\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\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 }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* 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 }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\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 n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 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\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\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\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\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/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction 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); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\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 */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\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 */\nfunction 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; /* 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 &&\n 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)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction 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; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\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\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\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\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\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 */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// 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, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\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\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\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]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\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/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* 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/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\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\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\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction 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; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\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\n count = 0;\n prevlen = curlen;\n\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\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction 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; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\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\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\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 */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\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\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\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]/*.Len*/ !== 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;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\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 */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\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); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* 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]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\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 */\nfunction 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\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\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\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\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\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _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); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\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 */\nfunction _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\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 */\nfunction _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, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\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\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // 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\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\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;\n\n // 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\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\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\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 }\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\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _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 //var out_length, in_length, dcode;\n\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\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* 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\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\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\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\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\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\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\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\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\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\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\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\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\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\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\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 */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_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) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, 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\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(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\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\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 */\nfunction 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\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 */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\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 */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\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\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) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\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\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\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++;\n // Assert(*scan == *match, \"match[2]?\");\n\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] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\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\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\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 */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // 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\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\n utils.arraySet(s.window, s.window, _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\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 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 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\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\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\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#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 = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\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) {\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\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\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// var curr = s.strstart + s.lookahead;\n// var 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/* ===========================================================================\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 */\nfunction 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\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\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\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\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\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\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\n s.insert = 0;\n\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\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\n return BS_NEED_MORE;\n}\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 */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\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; /* flush the current block */\n }\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/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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\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/*NIL*/ && ((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) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\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/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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 } else\n {\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 = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#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 } 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 = trees._tr_tally(s, 0, s.window[s.strstart]);\n\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)) ? s.strstart : MIN_MATCH - 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/* ===========================================================================\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 */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\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) { break; } /* 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/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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\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;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\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 <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*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;\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 && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\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 = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\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;\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 } 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 = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\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 } 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 }\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 = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 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\n return BS_BLOCK_DONE;\n}\n\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 */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\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) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && 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;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\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 = trees._tr_tally(s, 0, s.window[s.strstart]);\n\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/* ===========================================================================\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 */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\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; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(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\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 */\nfunction 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\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\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\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;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\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\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\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\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\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\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\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\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\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\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\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\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\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* 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\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\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\n this.last_lit = 0; /* running index in l_buf */\n\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\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\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\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\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\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 = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\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\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) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // 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) { // 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 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 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 );\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 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 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(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\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 }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\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(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(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/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\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 } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\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 } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(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 }\n//#endif\n\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\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 } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\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\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\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 trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(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); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\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; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { 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 {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\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) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n 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 ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\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(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(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 tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n 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) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 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;\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\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","'use strict';\n\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\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\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\nvar _utf8len = new utils.Buf8(256);\nfor (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\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\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\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\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 } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\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 } 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\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\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\nfunction 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 = ''/*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/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\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\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\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) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\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/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\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 * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\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 * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var 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 **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\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\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - 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 have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\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 **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\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 **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\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) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\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 * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\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\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\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\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\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\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\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\nmodule.exports = {\n\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\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\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\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\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\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\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\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 inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\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\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - 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 inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\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 **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\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 **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","import pako from 'pako';\n\nvar UPNG = {};\n\n\t\n\nUPNG.toRGBA8 = function(out)\n{\n\tvar w = out.width, h = out.height;\n\tif(out.tabs.acTL==null) return [UPNG.toRGBA8.decodeImage(out.data, w, h, out).buffer];\n\t\n\tvar frms = [];\n\tif(out.frames[0].data==null) out.frames[0].data = out.data;\n\t\n\tvar len = w*h*4, img = new Uint8Array(len), empty = new Uint8Array(len), prev=new Uint8Array(len);\n\tfor(var i=0; i>3)]>>(7-((i&7)<<0)))& 1), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>2)]>>(6-((i&3)<<1)))& 3), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>1)]>>(4-((i&1)<<2)))&15), cj=3*j; bf[qi]=p[cj]; bf[qi+1]=p[cj+1]; bf[qi+2]=p[cj+2]; bf[qi+3]=(j>>3)]>>>(7 -((x&7) )))& 1), al=(gr==tr*255)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\n\t\t\telse if(depth== 2) for(var x=0; x>>2)]>>>(6 -((x&3)<<1)))& 3), al=(gr==tr* 85)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\n\t\t\telse if(depth== 4) for(var x=0; x>>1)]>>>(4 -((x&1)<<2)))&15), al=(gr==tr* 17)?0:255; bf32[to+x]=(al<<24)|(gr<<16)|(gr<<8)|gr; }\n\t\t\telse if(depth== 8) for(var x=0; x>>2<<3);while(i==0){i=n(N,d,1);m=n(N,d+1,2);d+=3;if(m==0){if((d&7)!=0)d+=8-(d&7);\nvar D=(d>>>3)+4,q=N[D-4]|N[D-3]<<8;if(Z)W=H.H.W(W,w+q);W.set(new R(N.buffer,N.byteOffset+D,q),w);d=D+q<<3;\nw+=q;continue}if(Z)W=H.H.W(W,w+(1<<17));if(m==1){v=b.J;C=b.h;X=(1<<9)-1;u=(1<<5)-1}if(m==2){J=A(N,d,5)+257;\nh=A(N,d+5,5)+1;Q=A(N,d+10,4)+4;d+=14;var E=d,j=1;for(var c=0;c<38;c+=2){b.Q[c]=0;b.Q[c+1]=0}for(var c=0;\ncj)j=K}d+=3*Q;M(b.Q,j);I(b.Q,j,b.u);v=b.w;C=b.d;\nd=l(b.u,(1<>>4;if(p>>>8==0){W[w++]=p}else if(p==256){break}else{var z=w+p-254;\nif(p>264){var _=b.q[p-257];z=w+(_>>>3)+A(N,d,_&7);d+=_&7}var $=C[e(N,d)&u];d+=$&15;var s=$>>>4,Y=b.c[s],a=(Y>>>4)+n(N,d,Y&15);\nd+=Y&15;while(w>>4;\nif(b<=15){A[I]=b;I++}else{var Z=0,m=0;if(b==16){m=3+l(V,n,2);n+=2;Z=A[I-1]}else if(b==17){m=3+l(V,n,3);\nn+=3}else if(b==18){m=11+l(V,n,7);n+=7}var J=I+m;while(I>>1;\nwhile(An)n=M;A++}while(A>1,I=N[l+1],e=M<<4|I,b=W-I,Z=N[l]<>>15-W;R[J]=e;Z++}}};H.H.l=function(N,W){var R=H.H.m.r,V=15-W;for(var n=0;n>>V}};H.H.M=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8};\nH.H.I=function(N,W,R){R=R<<(W&7);var V=W>>>3;N[V]|=R;N[V+1]|=R>>>8;N[V+2]|=R>>>16};H.H.e=function(N,W,R){return(N[W>>>3]|N[(W>>>3)+1]<<8)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)&(1<>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16)>>>(W&7)};\nH.H.i=function(N,W){return(N[W>>>3]|N[(W>>>3)+1]<<8|N[(W>>>3)+2]<<16|N[(W>>>3)+3]<<24)>>>(W&7)};H.H.m=function(){var N=Uint16Array,W=Uint32Array;\nreturn{K:new N(16),j:new N(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[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,0,0,0],q:new N(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[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,0,0],c:new W(32),J:new N(512),_:[],h:new N(32),$:[],w:new N(32768),C:[],v:[],d:new N(32768),D:[],u:new N(512),Q:[],r:new N(1<<15),s:new W(286),Y:new W(30),a:new W(19),t:new W(15e3),k:new N(1<<16),g:new N(1<<15)}}();\n(function(){var N=H.H.m,W=1<<15;for(var R=0;R>>1|(V&1431655765)<<1;\nV=(V&3435973836)>>>2|(V&858993459)<<2;V=(V&4042322160)>>>4|(V&252645135)<<4;V=(V&4278255360)>>>8|(V&16711935)<<8;\nN.r[R]=(V>>>16|V<<16)>>>17}function n(A,l,M){while(l--!=0)A.push(0,M)}for(var R=0;R<32;R++){N.q[R]=N.S[R]<<3|N.T[R];\nN.c[R]=N.p[R]<<4|N.z[R]}n(N._,144,8);n(N._,255-143,9);n(N._,279-255,7);n(N._,287-279,8);H.H.n(N._,9);\nH.H.A(N._,9,N.J);H.H.l(N._,9);n(N.$,32,5);H.H.n(N.$,5);H.H.A(N.$,5,N.h);H.H.l(N.$,5);n(N.Q,19,0);n(N.C,286,0);\nn(N.D,30,0);n(N.v,320,0)}());return H.H.N}()\n\n\nUPNG.decode._readInterlace = function(data, out)\n{\n\tvar w = out.width, h = out.height;\n\tvar bpp = UPNG.decode._getBPP(out), cbpp = bpp>>3, bpl = Math.ceil(w*bpp/8);\n\tvar img = new Uint8Array( h * bpl );\n\tvar di = 0;\n\n\tvar starting_row = [ 0, 0, 4, 0, 2, 0, 1 ];\n\tvar starting_col = [ 0, 4, 0, 2, 0, 1, 0 ];\n\tvar row_increment = [ 8, 8, 8, 4, 4, 2, 2 ];\n\tvar col_increment = [ 8, 8, 4, 4, 2, 2, 1 ];\n\n\tvar pass=0;\n\twhile(pass<7)\n\t{\n\t\tvar ri = row_increment[pass], ci = col_increment[pass];\n\t\tvar sw = 0, sh = 0;\n\t\tvar cr = starting_row[pass]; while(cr>3]; val = (val>>(7-(cdi&7)))&1;\n\t\t\t\t\timg[row*bpl + (col>>3)] |= (val << (7-((col&7)<<0)));\n\t\t\t\t}\n\t\t\t\tif(bpp==2) {\n\t\t\t\t\tvar val = data[cdi>>3]; val = (val>>(6-(cdi&7)))&3;\n\t\t\t\t\timg[row*bpl + (col>>2)] |= (val << (6-((col&3)<<1)));\n\t\t\t\t}\n\t\t\t\tif(bpp==4) {\n\t\t\t\t\tvar val = data[cdi>>3]; val = (val>>(4-(cdi&7)))&15;\n\t\t\t\t\timg[row*bpl + (col>>1)] |= (val << (4-((col&1)<<2)));\n\t\t\t\t}\n\t\t\t\tif(bpp>=8) {\n\t\t\t\t\tvar ii = row*bpl+col*cbpp;\n\t\t\t\t\tfor(var j=0; j>3)+j];\n\t\t\t\t}\n\t\t\t\tcdi+=bpp; col+=ci;\n\t\t\t}\n\t\t\ty++; row += ri;\n\t\t}\n\t\tif(sw*sh!=0) di += sh * (1 + bpll);\n\t\tpass = pass + 1;\n\t}\n\treturn img;\n}\n\nUPNG.decode._getBPP = function(out) {\n\tvar noc = [1,null,3,1,2,null,4][out.ctype];\n\treturn noc * out.depth;\n}\n\nUPNG.decode._filterZero = function(data, out, off, w, h)\n{\n\tvar bpp = UPNG.decode._getBPP(out), bpl = Math.ceil(w*bpp/8), paeth = UPNG.decode._paeth;\n\tbpp = Math.ceil(bpp/8);\n\t\n\tvar i=0, di=1, type=data[off], x=0;\n\t\n\tif(type>1) data[off]=[0,0,1][type-2]; \n\tif(type==3) for(x=bpp; x>>1) )&255;\n\n\tfor(var y=0; y>>1));\n\t\t\t for(; x>>1) ); }\n\t\telse { for(; x>8)&255; buff[p+1] = n&255; },\n\treadUint : function(buff,p) { return (buff[p]*(256*256*256)) + ((buff[p+1]<<16) | (buff[p+2]<< 8) | buff[p+3]); },\n\twriteUint : function(buff,p,n){ buff[p]=(n>>24)&255; buff[p+1]=(n>>16)&255; buff[p+2]=(n>>8)&255; buff[p+3]=n&255; },\n\treadASCII : function(buff,p,l){ var s = \"\"; for(var i=0; i=0 && yoff>=0) { si = (y*sw+x)<<2; ti = (( yoff+y)*tw+xoff+x)<<2; }\n\t\t\telse { si = ((-yoff+y)*sw-xoff+x)<<2; ti = (y*tw+x)<<2; }\n\t\t\t\n\t\t\tif (mode==0) { tb[ti] = sb[si]; tb[ti+1] = sb[si+1]; tb[ti+2] = sb[si+2]; tb[ti+3] = sb[si+3]; }\n\t\t\telse if(mode==1) {\n\t\t\t\tvar fa = sb[si+3]*(1/255), fr=sb[si]*fa, fg=sb[si+1]*fa, fb=sb[si+2]*fa; \n\t\t\t\tvar ba = tb[ti+3]*(1/255), br=tb[ti]*ba, bg=tb[ti+1]*ba, bb=tb[ti+2]*ba; \n\t\t\t\t\n\t\t\t\tvar ifa=1-fa, oa = fa+ba*ifa, ioa = (oa==0?0:1/oa);\n\t\t\t\ttb[ti+3] = 255*oa; \n\t\t\t\ttb[ti+0] = (fr+br*ifa)*ioa; \n\t\t\t\ttb[ti+1] = (fg+bg*ifa)*ioa; \n\t\t\t\ttb[ti+2] = (fb+bb*ifa)*ioa; \n\t\t\t}\n\t\t\telse if(mode==2){\t// copy only differences, otherwise zero\n\t\t\t\tvar fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2]; \n\t\t\t\tvar ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2]; \n\t\t\t\tif(fa==ba && fr==br && fg==bg && fb==bb) { tb[ti]=0; tb[ti+1]=0; tb[ti+2]=0; tb[ti+3]=0; }\n\t\t\t\telse { tb[ti]=fr; tb[ti+1]=fg; tb[ti+2]=fb; tb[ti+3]=fa; }\n\t\t\t}\n\t\t\telse if(mode==3){\t// check if can be blended\n\t\t\t\tvar fa = sb[si+3], fr=sb[si], fg=sb[si+1], fb=sb[si+2]; \n\t\t\t\tvar ba = tb[ti+3], br=tb[ti], bg=tb[ti+1], bb=tb[ti+2]; \n\t\t\t\tif(fa==ba && fr==br && fg==bg && fb==bb) continue;\n\t\t\t\t//if(fa!=255 && ba!=0) return false;\n\t\t\t\tif(fa<220 && ba>20) return false;\n\t\t\t}\n\t\t}\n\treturn true;\n}\n\n\n\n\nUPNG.encode = function(bufs, w, h, ps, dels, tabs, forbidPlte)\n{\n\tif(ps==null) ps=0;\n\tif(forbidPlte==null) forbidPlte = false;\n\n\tvar nimg = UPNG.encode.compress(bufs, w, h, ps, [false, false, false, 0, forbidPlte]);\n\tUPNG.encode.compressPNG(nimg, -1);\n\t\n\treturn UPNG.encode._main(nimg, w, h, dels, tabs);\n}\n\nUPNG.encodeLL = function(bufs, w, h, cc, ac, depth, dels, tabs) {\n\tvar nimg = { ctype: 0 + (cc==1 ? 0 : 2) + (ac==0 ? 0 : 4), depth: depth, frames: [] };\n\t\n\tvar time = Date.now();\n\tvar bipp = (cc+ac)*depth, bipl = bipp * w;\n\tfor(var i=0; i1, pltAlpha = false;\n\t\n\tvar leng = 8 + (16+5+4) /*+ (9+4)*/ + (anim ? 20 : 0);\n\tif(tabs[\"sRGB\"]!=null) leng += 8+1+4;\n\tif(tabs[\"pHYs\"]!=null) leng += 8+9+4;\n\tif(nimg.ctype==3) {\n\t\tvar dl = nimg.plte.length;\n\t\tfor(var i=0; i>>24)!=255) pltAlpha = true;\n\t\tleng += (8 + dl*3 + 4) + (pltAlpha ? (8 + dl*1 + 4) : 0);\n\t}\n\tfor(var j=0; j>>8)&255, b=(c>>>16)&255;\n\t\t\tdata[offset+ti+0]=r; data[offset+ti+1]=g; data[offset+ti+2]=b;\n\t\t}\n\t\toffset+=dl*3;\n\t\twUi(data,offset,crc(data,offset-dl*3-4,dl*3+4)); offset+=4; // crc\n\n\t\tif(pltAlpha) {\n\t\t\twUi(data,offset, dl); offset+=4;\n\t\t\twAs(data,offset,\"tRNS\"); offset+=4;\n\t\t\tfor(var i=0; i>>24)&255;\n\t\t\toffset+=dl;\n\t\t\twUi(data,offset,crc(data,offset-dl-4,dl+4)); offset+=4; // crc\n\t\t}\n\t}\n\t\n\tvar fi = 0;\n\tfor(var j=0; j>2, bln>>2));\n\t\t\tfor(var j=0; jnw && c==img32[i-nw]) ind[i]=ind[i-nw];\n\t\t\t\telse {\n\t\t\t\t\tvar cmc = cmap[c];\n\t\t\t\t\tif(cmc==null) { cmap[c]=cmc=plte.length; plte.push(c); if(plte.length>=300) break; }\n\t\t\t\t\tind[i]=cmc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//console.log(\"make palette\", Date.now()-time); time = Date.now();\n\t}\n\t\n\tvar cc=plte.length; //console.log(\"colors:\",cc);\n\tif(cc<=256 && forbidPlte==false) {\n\t\tif(cc<= 2) depth=1; else if(cc<= 4) depth=2; else if(cc<=16) depth=4; else depth=8;\n\t\tdepth = Math.max(depth, minBits);\n\t}\n\t\n\tfor(var j=0; j>1)] |= (inj[ii+x]<<(4-(x&1)*4));\n\t\t\t\telse if(depth==2) for(var x=0; x>2)] |= (inj[ii+x]<<(6-(x&3)*2));\n\t\t\t\telse if(depth==1) for(var x=0; x>3)] |= (inj[ii+x]<<(7-(x&7)*1));\n\t\t\t}\n\t\t\tcimg=nimg; ctype=3; bpp=1;\n\t\t}\n\t\telse if(gotAlpha==false && frms.length==1) {\t// some next \"reduced\" frames may contain alpha for blending\n\t\t\tvar nimg = new Uint8Array(nw*nh*3), area=nw*nh;\n\t\t\tfor(var i=0; i palette indices\", Date.now()-time); time = Date.now();\n\t\n\treturn {ctype:ctype, depth:depth, plte:plte, frames:frms };\n}\nUPNG.encode.framize = function(bufs,w,h,alwaysBlend,evenCrd,forbidPrev) {\n\t/* DISPOSE\n\t - 0 : no change\n\t\t- 1 : clear to transparent\n\t\t- 2 : retstore to content before rendering (previous frame disposed)\n\t\tBLEND\n\t\t- 0 : replace\n\t\t- 1 : blend\n\t*/\n\tvar frms = [];\n\tfor(var j=0; jmax) max=x;\n\t\t\t\t\t\tif(ymay) may=y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(max==-1) mix=miy=max=may=0;\n\t\t\t\tif(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\n\t\t\t\tvar sarea = (max-mix+1)*(may-miy+1);\n\t\t\t\tif(sareamax) max=cx;\n\t\t\tif(cymay) may=cy;\n\t\t}\n\t}\n\tif(max==-1) mix=miy=max=may=0;\n\tif(evenCrd) { if((mix&1)==1)mix--; if((miy&1)==1)miy--; }\n\tr = {x:mix, y:miy, width:max-mix+1, height:may-miy+1};\n\t\n\tvar fr = frms[i]; fr.rect = r; fr.blend = 1; fr.img = new Uint8Array(r.width*r.height*4);\n\tif(frms[i-1].dispose==0) {\n\t\tUPNG._copyTile(pimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\n\t\tUPNG.encode._prepareDiff(cimg,w,h,fr.img,r);\n\t\t//UPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 2);\n\t}\n\telse\n\t\tUPNG._copyTile(cimg,w,h, fr.img,r.width,r.height, -r.x,-r.y, 0);\n}\nUPNG.encode._prepareDiff = function(cimg, w,h, nimg, rec) {\n\tUPNG._copyTile(cimg,w,h, nimg,rec.width,rec.height, -rec.x,-rec.y, 2);\n\t/*\n\tvar n32 = new Uint32Array(nimg.buffer);\n\tvar og = new Uint8Array(rec.width*rec.height*4), o32 = new Uint32Array(og.buffer);\n\tUPNG._copyTile(cimg,w,h, og,rec.width,rec.height, -rec.x,-rec.y, 0);\n\tfor(var i=4; i>>2]==o32[(i>>>2)-1]) {\n\t\t\tn32[i>>>2]=o32[i>>>2];\n\t\t\t//var j = i, c=p32[(i>>>2)-1];\n\t\t\t//while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n\t\t}\n\t}\n\tfor(var i=nimg.length-8; i>0; i-=4) {\n\t\tif(nimg[i+7]!=0 && nimg[i+3]==0 && o32[i>>>2]==o32[(i>>>2)+1]) {\n\t\t\tn32[i>>>2]=o32[i>>>2];\n\t\t\t//var j = i, c=p32[(i>>>2)-1];\n\t\t\t//while(p32[j>>>2]==c) { n32[j>>>2]=c; j+=4; }\n\t\t}\n\t}*/\n}\n\nUPNG.encode._filterZero = function(img,h,bpp,bpl,data, filter, levelZero)\n{\n\tvar fls = [], ftry=[0,1,2,3,4];\n\tif (filter!=-1) ftry=[filter];\n\telse if(h*bpl>500000 || bpp==1) ftry=[0];\n\tvar opts; if(levelZero) opts={level:0};\n\t\n\tvar CMPR = (levelZero && UZIP!=null) ? UZIP : pako;\n\t\n\tfor(var i=0; i>1) +256)&255;\n\t\tif(type==4) for(var x=bpp; x>1))&255;\n\t\t\t\t\t for(var x=bpp; x>1))&255; }\n\t\tif(type==4) { for(var x= 0; x>> 1);\n\t\t\t\telse c = c >>> 1;\n\t\t\t}\n\t\t\ttab[n] = c; }\n\t\treturn tab; })(),\n\tupdate : function(c, buf, off, len) {\n\t\tfor (var i=0; i>> 8);\n\t\treturn c;\n\t},\n\tcrc : function(b,o,l) { return UPNG.crc.update(0xffffffff,b,o,l) ^ 0xffffffff; }\n}\n\n\nUPNG.quantize = function(abuf, ps)\n{\t\n\tvar oimg = new Uint8Array(abuf), nimg = oimg.slice(0), nimg32 = new Uint32Array(nimg.buffer);\n\t\n\tvar KD = UPNG.quantize.getKDtree(nimg, ps);\n\tvar root = KD[0], leafs = KD[1];\n\t\n\tvar planeDst = UPNG.quantize.planeDst;\n\tvar sb = oimg, tb = nimg32, len=sb.length;\n\t\t\n\tvar inds = new Uint8Array(oimg.length>>2);\n\tfor(var i=0; i>2] = nd.ind;\n\t\ttb[i>>2] = nd.est.rgba;\n\t}\n\treturn { abuf:nimg.buffer, inds:inds, plte:leafs };\n}\n\nUPNG.quantize.getKDtree = function(nimg, ps, err) {\n\tif(err==null) err = 0.0001;\n\tvar nimg32 = new Uint32Array(nimg.buffer);\n\t\n\tvar root = {i0:0, i1:nimg.length, bst:null, est:null, tdst:0, left:null, right:null }; // basic statistic, extra statistic\n\troot.bst = UPNG.quantize.stats( nimg,root.i0, root.i1 ); root.est = UPNG.quantize.estats( root.bst );\n\tvar leafs = [root];\n\t\n\twhile(leafs.length maxL) { maxL=leafs[i].est.L; mi=i; }\n\t\tif(maxL=s0 || node.i1<=s0);\n\t\t//console.log(maxL, leafs.length, mi);\n\t\tif(s0wrong) { node.est.L=0; continue; }\n\t\t\n\t\t\n\t\tvar ln = {i0:node.i0, i1:s0, bst:null, est:null, tdst:0, left:null, right:null }; ln.bst = UPNG.quantize.stats( nimg, ln.i0, ln.i1 ); \n\t\tln.est = UPNG.quantize.estats( ln.bst );\n\t\tvar rn = {i0:s0, i1:node.i1, bst:null, est:null, tdst:0, left:null, right:null }; rn.bst = {R:[], m:[], N:node.bst.N-ln.bst.N};\n\t\tfor(var i=0; i<16; i++) rn.bst.R[i] = node.bst.R[i]-ln.bst.R[i];\n\t\tfor(var i=0; i< 4; i++) rn.bst.m[i] = node.bst.m[i]-ln.bst.m[i];\n\t\trn.est = UPNG.quantize.estats( rn.bst );\n\t\t\n\t\tnode.left = ln; node.right = rn;\n\t\tleafs[mi]=ln; leafs.push(rn);\n\t}\n\tleafs.sort(function(a,b) { return b.bst.N-a.bst.N; });\n\tfor(var i=0; i0) { node0=nd.right; node1=nd.left; }\n\t\n\tvar ln = UPNG.quantize.getNearest(node0, r,g,b,a);\n\tif(ln.tdst<=planeDst*planeDst) return ln;\n\tvar rn = UPNG.quantize.getNearest(node1, r,g,b,a);\n\treturn rn.tdst eMq) i1-=4;\n\t\tif(i0>=i1) break;\n\t\t\n\t\tvar t = nimg32[i0>>2]; nimg32[i0>>2] = nimg32[i1>>2]; nimg32[i1>>2]=t;\n\t\t\n\t\ti0+=4; i1-=4;\n\t}\n\twhile(vecDot(nimg, i0, e)>eMq) i0-=4;\n\treturn i0+4;\n}\nUPNG.quantize.vecDot = function(nimg, i, e)\n{\n\treturn nimg[i]*e[0] + nimg[i+1]*e[1] + nimg[i+2]*e[2] + nimg[i+3]*e[3];\n}\nUPNG.quantize.stats = function(nimg, i0, i1){\n\tvar R = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0];\n\tvar m = [0,0,0,0];\n\tvar N = (i1-i0)>>2;\n\tfor(var i=i0; i>>0) };\n}\nUPNG.M4 = {\n\tmultVec : function(m,v) {\n\t\t\treturn [\n\t\t\t\tm[ 0]*v[0] + m[ 1]*v[1] + m[ 2]*v[2] + m[ 3]*v[3],\n\t\t\t\tm[ 4]*v[0] + m[ 5]*v[1] + m[ 6]*v[2] + m[ 7]*v[3],\n\t\t\t\tm[ 8]*v[0] + m[ 9]*v[1] + m[10]*v[2] + m[11]*v[3],\n\t\t\t\tm[12]*v[0] + m[13]*v[1] + m[14]*v[2] + m[15]*v[3]\n\t\t\t];\n\t},\n\tdot : function(x,y) { return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]+x[3]*y[3]; },\n\tsml : function(a,y) { return [a*y[0],a*y[1],a*y[2],a*y[3]]; }\n}\n\nUPNG.encode.concatRGBA = function(bufs) {\n\tvar tlen = 0;\n\tfor(var i=0; i 1)\n throw new Error(\"Animated PNGs are not supported\");\n var frame = new Uint8Array(frames[0]);\n var _a = splitAlphaChannel(frame), rgbChannel = _a.rgbChannel, alphaChannel = _a.alphaChannel;\n this.rgbChannel = rgbChannel;\n var hasAlphaValues = alphaChannel.some(function (a) { return a < 1; });\n if (hasAlphaValues)\n this.alphaChannel = alphaChannel;\n this.type = getImageType(upng.ctype);\n this.width = upng.width;\n this.height = upng.height;\n this.bitsPerComponent = 8;\n }\n PNG.load = function (pngData) { return new PNG(pngData); };\n return PNG;\n}());\nexport { PNG };\n//# sourceMappingURL=png.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { PNG } from \"../../utils/png\";\n/**\n * A note of thanks to the developers of https://github.com/foliojs/pdfkit, as\n * this class borrows from:\n * https://github.com/devongovett/pdfkit/blob/e71edab0dd4657b5a767804ba86c94c58d01fbca/lib/image/png.coffee\n */\nvar PngEmbedder = /** @class */ (function () {\n function PngEmbedder(png) {\n this.image = png;\n this.bitsPerComponent = png.bitsPerComponent;\n this.width = png.width;\n this.height = png.height;\n this.colorSpace = 'DeviceRGB';\n }\n PngEmbedder.for = function (imageData) {\n return __awaiter(this, void 0, void 0, function () {\n var png;\n return __generator(this, function (_a) {\n png = PNG.load(imageData);\n return [2 /*return*/, new PngEmbedder(png)];\n });\n });\n };\n PngEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var SMask, xObject;\n return __generator(this, function (_a) {\n SMask = this.embedAlphaChannel(context);\n xObject = context.flateStream(this.image.rgbChannel, {\n Type: 'XObject',\n Subtype: 'Image',\n BitsPerComponent: this.image.bitsPerComponent,\n Width: this.image.width,\n Height: this.image.height,\n ColorSpace: this.colorSpace,\n SMask: SMask,\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n PngEmbedder.prototype.embedAlphaChannel = function (context) {\n if (!this.image.alphaChannel)\n return undefined;\n var xObject = context.flateStream(this.image.alphaChannel, {\n Type: 'XObject',\n Subtype: 'Image',\n Height: this.image.height,\n Width: this.image.width,\n BitsPerComponent: this.image.bitsPerComponent,\n ColorSpace: 'DeviceGray',\n Decode: [0, 1],\n });\n return context.register(xObject);\n };\n return PngEmbedder;\n}());\nexport default PngEmbedder;\n//# sourceMappingURL=PngEmbedder.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The Stream class contained in this file is a TypeScript port of the\n * JavaScript Stream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nvar Stream = /** @class */ (function () {\n function Stream(buffer, start, length) {\n this.bytes = buffer;\n this.start = start || 0;\n this.pos = this.start;\n this.end = !!start && !!length ? start + length : this.bytes.length;\n }\n Object.defineProperty(Stream.prototype, \"length\", {\n get: function () {\n return this.end - this.start;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Stream.prototype, \"isEmpty\", {\n get: function () {\n return this.length === 0;\n },\n enumerable: true,\n configurable: true\n });\n Stream.prototype.getByte = function () {\n if (this.pos >= this.end) {\n return -1;\n }\n return this.bytes[this.pos++];\n };\n Stream.prototype.getUint16 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n };\n Stream.prototype.getInt32 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n var b2 = this.getByte();\n var b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n };\n // Returns subarray of original buffer, should only be read.\n Stream.prototype.getBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var bytes = this.bytes;\n var pos = this.pos;\n var strEnd = this.end;\n if (!length) {\n var subarray = bytes.subarray(pos, strEnd);\n // `this.bytes` is always a `Uint8Array` here.\n return forceClamped ? new Uint8ClampedArray(subarray) : subarray;\n }\n else {\n var end = pos + length;\n if (end > strEnd) {\n end = strEnd;\n }\n this.pos = end;\n var subarray = bytes.subarray(pos, end);\n // `this.bytes` is always a `Uint8Array` here.\n return forceClamped ? new Uint8ClampedArray(subarray) : subarray;\n }\n };\n Stream.prototype.peekByte = function () {\n var peekedByte = this.getByte();\n this.pos--;\n return peekedByte;\n };\n Stream.prototype.peekBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var bytes = this.getBytes(length, forceClamped);\n this.pos -= bytes.length;\n return bytes;\n };\n Stream.prototype.skip = function (n) {\n if (!n) {\n n = 1;\n }\n this.pos += n;\n };\n Stream.prototype.reset = function () {\n this.pos = this.start;\n };\n Stream.prototype.moveStart = function () {\n this.start = this.pos;\n };\n Stream.prototype.makeSubStream = function (start, length) {\n return new Stream(this.bytes, start, length);\n };\n Stream.prototype.decode = function () {\n return this.bytes;\n };\n return Stream;\n}());\nexport default Stream;\n//# sourceMappingURL=Stream.js.map","import { MethodNotImplementedError } from \"../errors\";\nimport Stream from \"./Stream\";\n/*\n * Copyright 2012 Mozilla Foundation\n *\n * The DecodeStream class contained in this file is a TypeScript port of the\n * JavaScript DecodeStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\n// Lots of DecodeStreams are created whose buffers are never used. For these\n// we share a single empty buffer. This is (a) space-efficient and (b) avoids\n// having special cases that would be required if we used |null| for an empty\n// buffer.\nvar emptyBuffer = new Uint8Array(0);\n/**\n * Super class for the decoding streams\n */\nvar DecodeStream = /** @class */ (function () {\n function DecodeStream(maybeMinBufferLength) {\n this.pos = 0;\n this.bufferLength = 0;\n this.eof = false;\n this.buffer = emptyBuffer;\n this.minBufferLength = 512;\n if (maybeMinBufferLength) {\n // Compute the first power of two that is as big as maybeMinBufferLength.\n while (this.minBufferLength < maybeMinBufferLength) {\n this.minBufferLength *= 2;\n }\n }\n }\n Object.defineProperty(DecodeStream.prototype, \"isEmpty\", {\n get: function () {\n while (!this.eof && this.bufferLength === 0) {\n this.readBlock();\n }\n return this.bufferLength === 0;\n },\n enumerable: true,\n configurable: true\n });\n DecodeStream.prototype.getByte = function () {\n var pos = this.pos;\n while (this.bufferLength <= pos) {\n if (this.eof) {\n return -1;\n }\n this.readBlock();\n }\n return this.buffer[this.pos++];\n };\n DecodeStream.prototype.getUint16 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n };\n DecodeStream.prototype.getInt32 = function () {\n var b0 = this.getByte();\n var b1 = this.getByte();\n var b2 = this.getByte();\n var b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n };\n DecodeStream.prototype.getBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var end;\n var pos = this.pos;\n if (length) {\n this.ensureBuffer(pos + length);\n end = pos + length;\n while (!this.eof && this.bufferLength < end) {\n this.readBlock();\n }\n var bufEnd = this.bufferLength;\n if (end > bufEnd) {\n end = bufEnd;\n }\n }\n else {\n while (!this.eof) {\n this.readBlock();\n }\n end = this.bufferLength;\n }\n this.pos = end;\n var subarray = this.buffer.subarray(pos, end);\n // `this.buffer` is either a `Uint8Array` or `Uint8ClampedArray` here.\n return forceClamped && !(subarray instanceof Uint8ClampedArray)\n ? new Uint8ClampedArray(subarray)\n : subarray;\n };\n DecodeStream.prototype.peekByte = function () {\n var peekedByte = this.getByte();\n this.pos--;\n return peekedByte;\n };\n DecodeStream.prototype.peekBytes = function (length, forceClamped) {\n if (forceClamped === void 0) { forceClamped = false; }\n var bytes = this.getBytes(length, forceClamped);\n this.pos -= bytes.length;\n return bytes;\n };\n DecodeStream.prototype.skip = function (n) {\n if (!n) {\n n = 1;\n }\n this.pos += n;\n };\n DecodeStream.prototype.reset = function () {\n this.pos = 0;\n };\n DecodeStream.prototype.makeSubStream = function (start, length /* dict */) {\n var end = start + length;\n while (this.bufferLength <= end && !this.eof) {\n this.readBlock();\n }\n return new Stream(this.buffer, start, length /* dict */);\n };\n DecodeStream.prototype.decode = function () {\n while (!this.eof)\n this.readBlock();\n return this.buffer.subarray(0, this.bufferLength);\n };\n DecodeStream.prototype.readBlock = function () {\n throw new MethodNotImplementedError(this.constructor.name, 'readBlock');\n };\n DecodeStream.prototype.ensureBuffer = function (requested) {\n var buffer = this.buffer;\n if (requested <= buffer.byteLength) {\n return buffer;\n }\n var size = this.minBufferLength;\n while (size < requested) {\n size *= 2;\n }\n var buffer2 = new Uint8Array(size);\n buffer2.set(buffer);\n return (this.buffer = buffer2);\n };\n return DecodeStream;\n}());\nexport default DecodeStream;\n//# sourceMappingURL=DecodeStream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The Ascii85Stream class contained in this file is a TypeScript port of the\n * JavaScript Ascii85Stream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar isSpace = function (ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;\n};\nvar Ascii85Stream = /** @class */ (function (_super) {\n __extends(Ascii85Stream, _super);\n function Ascii85Stream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.input = new Uint8Array(5);\n // Most streams increase in size when decoded, but Ascii85 streams\n // typically shrink by ~20%.\n if (maybeLength) {\n maybeLength = 0.8 * maybeLength;\n }\n return _this;\n }\n Ascii85Stream.prototype.readBlock = function () {\n var TILDA_CHAR = 0x7e; // '~'\n var Z_LOWER_CHAR = 0x7a; // 'z'\n var EOF = -1;\n var stream = this.stream;\n var c = stream.getByte();\n while (isSpace(c)) {\n c = stream.getByte();\n }\n if (c === EOF || c === TILDA_CHAR) {\n this.eof = true;\n return;\n }\n var bufferLength = this.bufferLength;\n var buffer;\n var i;\n // special code for z\n if (c === Z_LOWER_CHAR) {\n buffer = this.ensureBuffer(bufferLength + 4);\n for (i = 0; i < 4; ++i) {\n buffer[bufferLength + i] = 0;\n }\n this.bufferLength += 4;\n }\n else {\n var input = this.input;\n input[0] = c;\n for (i = 1; i < 5; ++i) {\n c = stream.getByte();\n while (isSpace(c)) {\n c = stream.getByte();\n }\n input[i] = c;\n if (c === EOF || c === TILDA_CHAR) {\n break;\n }\n }\n buffer = this.ensureBuffer(bufferLength + i - 1);\n this.bufferLength += i - 1;\n // partial ending;\n if (i < 5) {\n for (; i < 5; ++i) {\n input[i] = 0x21 + 84;\n }\n this.eof = true;\n }\n var t = 0;\n for (i = 0; i < 5; ++i) {\n t = t * 85 + (input[i] - 0x21);\n }\n for (i = 3; i >= 0; --i) {\n buffer[bufferLength + i] = t & 0xff;\n t >>= 8;\n }\n }\n };\n return Ascii85Stream;\n}(DecodeStream));\nexport default Ascii85Stream;\n//# sourceMappingURL=Ascii85Stream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The AsciiHexStream class contained in this file is a TypeScript port of the\n * JavaScript AsciiHexStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar AsciiHexStream = /** @class */ (function (_super) {\n __extends(AsciiHexStream, _super);\n function AsciiHexStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.firstDigit = -1;\n // Most streams increase in size when decoded, but AsciiHex streams shrink\n // by 50%.\n if (maybeLength) {\n maybeLength = 0.5 * maybeLength;\n }\n return _this;\n }\n AsciiHexStream.prototype.readBlock = function () {\n var UPSTREAM_BLOCK_SIZE = 8000;\n var bytes = this.stream.getBytes(UPSTREAM_BLOCK_SIZE);\n if (!bytes.length) {\n this.eof = true;\n return;\n }\n var maxDecodeLength = (bytes.length + 1) >> 1;\n var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);\n var bufferLength = this.bufferLength;\n var firstDigit = this.firstDigit;\n for (var i = 0, ii = bytes.length; i < ii; i++) {\n var ch = bytes[i];\n var digit = void 0;\n if (ch >= 0x30 && ch <= 0x39) {\n // '0'-'9'\n digit = ch & 0x0f;\n }\n else if ((ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)) {\n // 'A'-'Z', 'a'-'z'\n digit = (ch & 0x0f) + 9;\n }\n else if (ch === 0x3e) {\n // '>'\n this.eof = true;\n break;\n }\n else {\n // probably whitespace\n continue; // ignoring\n }\n if (firstDigit < 0) {\n firstDigit = digit;\n }\n else {\n buffer[bufferLength++] = (firstDigit << 4) | digit;\n firstDigit = -1;\n }\n }\n if (firstDigit >= 0 && this.eof) {\n // incomplete byte\n buffer[bufferLength++] = firstDigit << 4;\n firstDigit = -1;\n }\n this.firstDigit = firstDigit;\n this.bufferLength = bufferLength;\n };\n return AsciiHexStream;\n}(DecodeStream));\nexport default AsciiHexStream;\n//# sourceMappingURL=AsciiHexStream.js.map","/*\n * Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The flate stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\nimport { __extends } from \"tslib\";\n/*\n * Copyright 2012 Mozilla Foundation\n *\n * The FlateStream class contained in this file is a TypeScript port of the\n * JavaScript FlateStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\n/* tslint:disable no-conditional-assignment */\nimport DecodeStream from \"./DecodeStream\";\n// prettier-ignore\nvar codeLenCodeMap = new Int32Array([\n 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15\n]);\n// prettier-ignore\nvar lengthDecode = new Int32Array([\n 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a,\n 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f,\n 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073,\n 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102\n]);\n// prettier-ignore\nvar distDecode = new Int32Array([\n 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d,\n 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1,\n 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01,\n 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001\n]);\n// prettier-ignore\nvar fixedLitCodeTab = [new Int32Array([\n 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0,\n 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0,\n 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0,\n 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0,\n 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8,\n 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8,\n 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8,\n 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8,\n 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4,\n 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4,\n 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4,\n 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4,\n 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc,\n 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec,\n 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc,\n 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc,\n 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2,\n 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2,\n 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2,\n 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2,\n 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca,\n 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea,\n 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da,\n 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa,\n 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6,\n 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6,\n 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6,\n 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6,\n 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce,\n 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee,\n 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de,\n 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe,\n 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1,\n 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1,\n 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1,\n 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1,\n 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9,\n 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9,\n 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9,\n 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9,\n 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5,\n 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5,\n 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5,\n 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5,\n 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd,\n 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed,\n 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd,\n 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd,\n 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3,\n 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3,\n 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3,\n 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3,\n 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb,\n 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb,\n 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db,\n 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb,\n 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7,\n 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7,\n 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7,\n 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7,\n 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf,\n 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef,\n 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df,\n 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff\n ]), 9];\n// prettier-ignore\nvar fixedDistCodeTab = [new Int32Array([\n 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c,\n 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000,\n 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d,\n 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000\n ]), 5];\nvar FlateStream = /** @class */ (function (_super) {\n __extends(FlateStream, _super);\n function FlateStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n var cmf = stream.getByte();\n var flg = stream.getByte();\n if (cmf === -1 || flg === -1) {\n throw new Error(\"Invalid header in flate stream: \" + cmf + \", \" + flg);\n }\n if ((cmf & 0x0f) !== 0x08) {\n throw new Error(\"Unknown compression method in flate stream: \" + cmf + \", \" + flg);\n }\n if (((cmf << 8) + flg) % 31 !== 0) {\n throw new Error(\"Bad FCHECK in flate stream: \" + cmf + \", \" + flg);\n }\n if (flg & 0x20) {\n throw new Error(\"FDICT bit set in flate stream: \" + cmf + \", \" + flg);\n }\n _this.codeSize = 0;\n _this.codeBuf = 0;\n return _this;\n }\n FlateStream.prototype.readBlock = function () {\n var buffer;\n var len;\n var str = this.stream;\n // read block header\n var hdr = this.getBits(3);\n if (hdr & 1) {\n this.eof = true;\n }\n hdr >>= 1;\n if (hdr === 0) {\n // uncompressed block\n var b = void 0;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n var blockLen = b;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n blockLen |= b << 8;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n var check = b;\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad block header in flate stream');\n }\n check |= b << 8;\n if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {\n // Ignoring error for bad \"empty\" block (see issue 1277)\n throw new Error('Bad uncompressed block length in flate stream');\n }\n this.codeBuf = 0;\n this.codeSize = 0;\n var bufferLength = this.bufferLength;\n buffer = this.ensureBuffer(bufferLength + blockLen);\n var end = bufferLength + blockLen;\n this.bufferLength = end;\n if (blockLen === 0) {\n if (str.peekByte() === -1) {\n this.eof = true;\n }\n }\n else {\n for (var n = bufferLength; n < end; ++n) {\n if ((b = str.getByte()) === -1) {\n this.eof = true;\n break;\n }\n buffer[n] = b;\n }\n }\n return;\n }\n var litCodeTable;\n var distCodeTable;\n if (hdr === 1) {\n // compressed block, fixed codes\n litCodeTable = fixedLitCodeTab;\n distCodeTable = fixedDistCodeTab;\n }\n else if (hdr === 2) {\n // compressed block, dynamic codes\n var numLitCodes = this.getBits(5) + 257;\n var numDistCodes = this.getBits(5) + 1;\n var numCodeLenCodes = this.getBits(4) + 4;\n // build the code lengths code table\n var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);\n var i = void 0;\n for (i = 0; i < numCodeLenCodes; ++i) {\n codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);\n }\n var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);\n // build the literal and distance code tables\n len = 0;\n i = 0;\n var codes = numLitCodes + numDistCodes;\n var codeLengths = new Uint8Array(codes);\n var bitsLength = void 0;\n var bitsOffset = void 0;\n var what = void 0;\n while (i < codes) {\n var code = this.getCode(codeLenCodeTab);\n if (code === 16) {\n bitsLength = 2;\n bitsOffset = 3;\n what = len;\n }\n else if (code === 17) {\n bitsLength = 3;\n bitsOffset = 3;\n what = len = 0;\n }\n else if (code === 18) {\n bitsLength = 7;\n bitsOffset = 11;\n what = len = 0;\n }\n else {\n codeLengths[i++] = len = code;\n continue;\n }\n var repeatLength = this.getBits(bitsLength) + bitsOffset;\n while (repeatLength-- > 0) {\n codeLengths[i++] = what;\n }\n }\n litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes));\n distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes));\n }\n else {\n throw new Error('Unknown block type in flate stream');\n }\n buffer = this.buffer;\n var limit = buffer ? buffer.length : 0;\n var pos = this.bufferLength;\n while (true) {\n var code1 = this.getCode(litCodeTable);\n if (code1 < 256) {\n if (pos + 1 >= limit) {\n buffer = this.ensureBuffer(pos + 1);\n limit = buffer.length;\n }\n buffer[pos++] = code1;\n continue;\n }\n if (code1 === 256) {\n this.bufferLength = pos;\n return;\n }\n code1 -= 257;\n code1 = lengthDecode[code1];\n var code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n len = (code1 & 0xffff) + code2;\n code1 = this.getCode(distCodeTable);\n code1 = distDecode[code1];\n code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n var dist = (code1 & 0xffff) + code2;\n if (pos + len >= limit) {\n buffer = this.ensureBuffer(pos + len);\n limit = buffer.length;\n }\n for (var k = 0; k < len; ++k, ++pos) {\n buffer[pos] = buffer[pos - dist];\n }\n }\n };\n FlateStream.prototype.getBits = function (bits) {\n var str = this.stream;\n var codeSize = this.codeSize;\n var codeBuf = this.codeBuf;\n var b;\n while (codeSize < bits) {\n if ((b = str.getByte()) === -1) {\n throw new Error('Bad encoding in flate stream');\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n b = codeBuf & ((1 << bits) - 1);\n this.codeBuf = codeBuf >> bits;\n this.codeSize = codeSize -= bits;\n return b;\n };\n FlateStream.prototype.getCode = function (table) {\n var str = this.stream;\n var codes = table[0];\n var maxLen = table[1];\n var codeSize = this.codeSize;\n var codeBuf = this.codeBuf;\n var b;\n while (codeSize < maxLen) {\n if ((b = str.getByte()) === -1) {\n // premature end of stream. code might however still be valid.\n // codeSize < codeLen check below guards against incomplete codeVal.\n break;\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n var code = codes[codeBuf & ((1 << maxLen) - 1)];\n if (typeof codes === 'number') {\n console.log('FLATE:', code);\n }\n var codeLen = code >> 16;\n var codeVal = code & 0xffff;\n if (codeLen < 1 || codeSize < codeLen) {\n throw new Error('Bad encoding in flate stream');\n }\n this.codeBuf = codeBuf >> codeLen;\n this.codeSize = codeSize - codeLen;\n return codeVal;\n };\n FlateStream.prototype.generateHuffmanTable = function (lengths) {\n var n = lengths.length;\n // find max code length\n var maxLen = 0;\n var i;\n for (i = 0; i < n; ++i) {\n if (lengths[i] > maxLen) {\n maxLen = lengths[i];\n }\n }\n // build the table\n var size = 1 << maxLen;\n var codes = new Int32Array(size);\n for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) {\n for (var val = 0; val < n; ++val) {\n if (lengths[val] === len) {\n // bit-reverse the code\n var code2 = 0;\n var t = code;\n for (i = 0; i < len; ++i) {\n code2 = (code2 << 1) | (t & 1);\n t >>= 1;\n }\n // fill the table entries\n for (i = code2; i < size; i += skip) {\n codes[i] = (len << 16) | val;\n }\n ++code;\n }\n }\n }\n return [codes, maxLen];\n };\n return FlateStream;\n}(DecodeStream));\nexport default FlateStream;\n//# sourceMappingURL=FlateStream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The LZWStream class contained in this file is a TypeScript port of the\n * JavaScript LZWStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar LZWStream = /** @class */ (function (_super) {\n __extends(LZWStream, _super);\n function LZWStream(stream, maybeLength, earlyChange) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n _this.cachedData = 0;\n _this.bitsCached = 0;\n var maxLzwDictionarySize = 4096;\n var lzwState = {\n earlyChange: earlyChange,\n codeLength: 9,\n nextCode: 258,\n dictionaryValues: new Uint8Array(maxLzwDictionarySize),\n dictionaryLengths: new Uint16Array(maxLzwDictionarySize),\n dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),\n currentSequence: new Uint8Array(maxLzwDictionarySize),\n currentSequenceLength: 0,\n };\n for (var i = 0; i < 256; ++i) {\n lzwState.dictionaryValues[i] = i;\n lzwState.dictionaryLengths[i] = 1;\n }\n _this.lzwState = lzwState;\n return _this;\n }\n LZWStream.prototype.readBlock = function () {\n var blockSize = 512;\n var estimatedDecodedSize = blockSize * 2;\n var decodedSizeDelta = blockSize;\n var i;\n var j;\n var q;\n var lzwState = this.lzwState;\n if (!lzwState) {\n return; // eof was found\n }\n var earlyChange = lzwState.earlyChange;\n var nextCode = lzwState.nextCode;\n var dictionaryValues = lzwState.dictionaryValues;\n var dictionaryLengths = lzwState.dictionaryLengths;\n var dictionaryPrevCodes = lzwState.dictionaryPrevCodes;\n var codeLength = lzwState.codeLength;\n var prevCode = lzwState.prevCode;\n var currentSequence = lzwState.currentSequence;\n var currentSequenceLength = lzwState.currentSequenceLength;\n var decodedLength = 0;\n var currentBufferLength = this.bufferLength;\n var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n for (i = 0; i < blockSize; i++) {\n var code = this.readBits(codeLength);\n var hasPrev = currentSequenceLength > 0;\n if (!code || code < 256) {\n currentSequence[0] = code;\n currentSequenceLength = 1;\n }\n else if (code >= 258) {\n if (code < nextCode) {\n currentSequenceLength = dictionaryLengths[code];\n for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {\n currentSequence[j] = dictionaryValues[q];\n q = dictionaryPrevCodes[q];\n }\n }\n else {\n currentSequence[currentSequenceLength++] = currentSequence[0];\n }\n }\n else if (code === 256) {\n codeLength = 9;\n nextCode = 258;\n currentSequenceLength = 0;\n continue;\n }\n else {\n this.eof = true;\n delete this.lzwState;\n break;\n }\n if (hasPrev) {\n dictionaryPrevCodes[nextCode] = prevCode;\n dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;\n dictionaryValues[nextCode] = currentSequence[0];\n nextCode++;\n codeLength =\n (nextCode + earlyChange) & (nextCode + earlyChange - 1)\n ? codeLength\n : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0;\n }\n prevCode = code;\n decodedLength += currentSequenceLength;\n if (estimatedDecodedSize < decodedLength) {\n do {\n estimatedDecodedSize += decodedSizeDelta;\n } while (estimatedDecodedSize < decodedLength);\n buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n }\n for (j = 0; j < currentSequenceLength; j++) {\n buffer[currentBufferLength++] = currentSequence[j];\n }\n }\n lzwState.nextCode = nextCode;\n lzwState.codeLength = codeLength;\n lzwState.prevCode = prevCode;\n lzwState.currentSequenceLength = currentSequenceLength;\n this.bufferLength = currentBufferLength;\n };\n LZWStream.prototype.readBits = function (n) {\n var bitsCached = this.bitsCached;\n var cachedData = this.cachedData;\n while (bitsCached < n) {\n var c = this.stream.getByte();\n if (c === -1) {\n this.eof = true;\n return null;\n }\n cachedData = (cachedData << 8) | c;\n bitsCached += 8;\n }\n this.bitsCached = bitsCached -= n;\n this.cachedData = cachedData;\n return (cachedData >>> bitsCached) & ((1 << n) - 1);\n };\n return LZWStream;\n}(DecodeStream));\nexport default LZWStream;\n//# sourceMappingURL=LZWStream.js.map","/*\n * Copyright 2012 Mozilla Foundation\n *\n * The RunLengthStream class contained in this file is a TypeScript port of the\n * JavaScript RunLengthStream class in Mozilla's pdf.js project, made available\n * under the Apache 2.0 open source license.\n */\nimport { __extends } from \"tslib\";\nimport DecodeStream from \"./DecodeStream\";\nvar RunLengthStream = /** @class */ (function (_super) {\n __extends(RunLengthStream, _super);\n function RunLengthStream(stream, maybeLength) {\n var _this = _super.call(this, maybeLength) || this;\n _this.stream = stream;\n return _this;\n }\n RunLengthStream.prototype.readBlock = function () {\n // The repeatHeader has following format. The first byte defines type of run\n // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes\n // (in addition to the second byte from the header), n = 129 through 255 -\n // duplicate the second byte from the header (257 - n) times, n = 128 - end.\n var repeatHeader = this.stream.getBytes(2);\n if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {\n this.eof = true;\n return;\n }\n var buffer;\n var bufferLength = this.bufferLength;\n var n = repeatHeader[0];\n if (n < 128) {\n // copy n bytes\n buffer = this.ensureBuffer(bufferLength + n + 1);\n buffer[bufferLength++] = repeatHeader[1];\n if (n > 0) {\n var source = this.stream.getBytes(n);\n buffer.set(source, bufferLength);\n bufferLength += n;\n }\n }\n else {\n n = 257 - n;\n var b = repeatHeader[1];\n buffer = this.ensureBuffer(bufferLength + n + 1);\n for (var i = 0; i < n; i++) {\n buffer[bufferLength++] = b;\n }\n }\n this.bufferLength = bufferLength;\n };\n return RunLengthStream;\n}(DecodeStream));\nexport default RunLengthStream;\n//# sourceMappingURL=RunLengthStream.js.map","import { UnexpectedObjectTypeError, UnsupportedEncodingError, } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport Ascii85Stream from \"./Ascii85Stream\";\nimport AsciiHexStream from \"./AsciiHexStream\";\nimport FlateStream from \"./FlateStream\";\nimport LZWStream from \"./LZWStream\";\nimport RunLengthStream from \"./RunLengthStream\";\nimport Stream from \"./Stream\";\nvar decodeStream = function (stream, encoding, params) {\n if (encoding === PDFName.of('FlateDecode')) {\n return new FlateStream(stream);\n }\n if (encoding === PDFName.of('LZWDecode')) {\n var earlyChange = 1;\n if (params instanceof PDFDict) {\n var EarlyChange = params.lookup(PDFName.of('EarlyChange'));\n if (EarlyChange instanceof PDFNumber) {\n earlyChange = EarlyChange.asNumber();\n }\n }\n return new LZWStream(stream, undefined, earlyChange);\n }\n if (encoding === PDFName.of('ASCII85Decode')) {\n return new Ascii85Stream(stream);\n }\n if (encoding === PDFName.of('ASCIIHexDecode')) {\n return new AsciiHexStream(stream);\n }\n if (encoding === PDFName.of('RunLengthDecode')) {\n return new RunLengthStream(stream);\n }\n throw new UnsupportedEncodingError(encoding.asString());\n};\nexport var decodePDFRawStream = function (_a) {\n var dict = _a.dict, contents = _a.contents;\n var stream = new Stream(contents);\n var Filter = dict.lookup(PDFName.of('Filter'));\n var DecodeParms = dict.lookup(PDFName.of('DecodeParms'));\n if (Filter instanceof PDFName) {\n stream = decodeStream(stream, Filter, DecodeParms);\n }\n else if (Filter instanceof PDFArray) {\n for (var idx = 0, len = Filter.size(); idx < len; idx++) {\n stream = decodeStream(stream, Filter.lookup(idx, PDFName), DecodeParms && DecodeParms.lookupMaybe(idx, PDFDict));\n }\n }\n else if (!!Filter) {\n throw new UnexpectedObjectTypeError([PDFName, PDFArray], Filter);\n }\n return stream;\n};\n//# sourceMappingURL=decode.js.map","import { __awaiter, __generator } from \"tslib\";\nimport { MissingPageContentsEmbeddingError, UnrecognizedStreamTypeError, } from \"../errors\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFStream from \"../objects/PDFStream\";\nimport { decodePDFRawStream } from \"../streams/decode\";\nimport PDFContentStream from \"../structures/PDFContentStream\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { mergeIntoTypedArray } from \"../../utils\";\nvar fullPageBoundingBox = function (page) {\n var mediaBox = page.MediaBox();\n var width = mediaBox.lookup(2, PDFNumber).asNumber() -\n mediaBox.lookup(0, PDFNumber).asNumber();\n var height = mediaBox.lookup(3, PDFNumber).asNumber() -\n mediaBox.lookup(1, PDFNumber).asNumber();\n return { left: 0, bottom: 0, right: width, top: height };\n};\n// Returns the identity matrix, modified to position the content of the given\n// bounding box at (0, 0).\nvar boundingBoxAdjustedMatrix = function (bb) { return [1, 0, 0, 1, -bb.left, -bb.bottom]; };\nvar PDFPageEmbedder = /** @class */ (function () {\n function PDFPageEmbedder(page, boundingBox, transformationMatrix) {\n this.page = page;\n var bb = boundingBox !== null && boundingBox !== void 0 ? boundingBox : fullPageBoundingBox(page);\n this.width = bb.right - bb.left;\n this.height = bb.top - bb.bottom;\n this.boundingBox = bb;\n this.transformationMatrix = transformationMatrix !== null && transformationMatrix !== void 0 ? transformationMatrix : boundingBoxAdjustedMatrix(bb);\n }\n PDFPageEmbedder.for = function (page, boundingBox, transformationMatrix) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new PDFPageEmbedder(page, boundingBox, transformationMatrix)];\n });\n });\n };\n PDFPageEmbedder.prototype.embedIntoContext = function (context, ref) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, Contents, Resources, decodedContents, _b, left, bottom, right, top, xObject;\n return __generator(this, function (_c) {\n _a = this.page.normalizedEntries(), Contents = _a.Contents, Resources = _a.Resources;\n if (!Contents)\n throw new MissingPageContentsEmbeddingError();\n decodedContents = this.decodeContents(Contents);\n _b = this.boundingBox, left = _b.left, bottom = _b.bottom, right = _b.right, top = _b.top;\n xObject = context.stream(decodedContents, {\n Type: 'XObject',\n Subtype: 'Form',\n FormType: 1,\n BBox: [left, bottom, right, top],\n Matrix: this.transformationMatrix,\n Resources: Resources,\n });\n if (ref) {\n context.assign(ref, xObject);\n return [2 /*return*/, ref];\n }\n else {\n return [2 /*return*/, context.register(xObject)];\n }\n return [2 /*return*/];\n });\n });\n };\n // `contents` is an array of streams which are merged to include them in the XObject.\n // This methods extracts each stream and joins them with a newline character.\n PDFPageEmbedder.prototype.decodeContents = function (contents) {\n var newline = Uint8Array.of(CharCodes.Newline);\n var decodedContents = [];\n for (var idx = 0, len = contents.size(); idx < len; idx++) {\n var stream = contents.lookup(idx, PDFStream);\n var content = void 0;\n if (stream instanceof PDFRawStream) {\n content = decodePDFRawStream(stream).decode();\n }\n else if (stream instanceof PDFContentStream) {\n content = stream.getUnencodedContents();\n }\n else {\n throw new UnrecognizedStreamTypeError(stream);\n }\n decodedContents.push(content, newline);\n }\n return mergeIntoTypedArray.apply(void 0, decodedContents);\n };\n return PDFPageEmbedder;\n}());\nexport default PDFPageEmbedder;\n//# sourceMappingURL=PDFPageEmbedder.js.map","import { __extends } from \"tslib\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nvar PDFCatalog = /** @class */ (function (_super) {\n __extends(PDFCatalog, _super);\n function PDFCatalog() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFCatalog.prototype.Pages = function () {\n return this.lookup(PDFName.of('Pages'), PDFDict);\n };\n /**\n * Inserts the given ref as a leaf node of this catalog's page tree at the\n * specified index (zero-based). Also increments the `Count` of each node in\n * the page tree hierarchy to accomodate the new page.\n *\n * Returns the ref of the PDFPageTree node into which `leafRef` was inserted.\n */\n PDFCatalog.prototype.insertLeafNode = function (leafRef, index) {\n var pagesRef = this.get(PDFName.of('Pages'));\n var maybeParentRef = this.Pages().insertLeafNode(leafRef, index);\n return maybeParentRef || pagesRef;\n };\n PDFCatalog.prototype.removeLeafNode = function (index) {\n this.Pages().removeLeafNode(index);\n };\n PDFCatalog.withContextAndPages = function (context, pages) {\n var dict = new Map();\n dict.set(PDFName.of('Type'), PDFName.of('Catalog'));\n dict.set(PDFName.of('Pages'), pages);\n return new PDFCatalog(dict, context);\n };\n PDFCatalog.fromMapWithContext = function (map, context) {\n return new PDFCatalog(map, context);\n };\n return PDFCatalog;\n}(PDFDict));\nexport default PDFCatalog;\n//# sourceMappingURL=PDFCatalog.js.map","import { __extends } from \"tslib\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nvar PDFPageTree = /** @class */ (function (_super) {\n __extends(PDFPageTree, _super);\n function PDFPageTree() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PDFPageTree.prototype.Parent = function () {\n return this.lookup(PDFName.of('Parent'));\n };\n PDFPageTree.prototype.Kids = function () {\n return this.lookup(PDFName.of('Kids'), PDFArray);\n };\n PDFPageTree.prototype.Count = function () {\n return this.lookup(PDFName.of('Count'), PDFNumber);\n };\n PDFPageTree.prototype.pushTreeNode = function (treeRef) {\n var Kids = this.Kids();\n Kids.push(treeRef);\n };\n PDFPageTree.prototype.pushLeafNode = function (leafRef) {\n var Kids = this.Kids();\n Kids.push(leafRef);\n this.ascend(function (node) {\n var Count = node.Count();\n node.set(PDFName.of('Count'), PDFNumber.of(Count.asNumber() + 1));\n });\n };\n /**\n * Inserts the given ref as a leaf node of this page tree at the specified\n * index (zero-based). Also increments the `Count` of each page tree in the\n * hierarchy to accomodate the new page.\n *\n * Returns the ref of the PDFPageTree node into which `leafRef` was inserted,\n * or `undefined` if it was inserted into the root node (the PDFPageTree upon\n * which the method was first called).\n */\n PDFPageTree.prototype.insertLeafNode = function (leafRef, targetIndex) {\n var Kids = this.Kids();\n var kidSize = Kids.size();\n var kidIdx = 0;\n var pageIdx = 0;\n while (pageIdx < targetIndex) {\n if (kidIdx >= kidSize) {\n throw new Error(\"Index out of bounds: \" + kidIdx + \"/\" + kidSize);\n }\n var kidRef = Kids.get(kidIdx++);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) {\n var kidCount = kid.Count().asNumber();\n if (pageIdx + kidCount > targetIndex) {\n return kid.insertLeafNode(leafRef, targetIndex - pageIdx) || kidRef;\n }\n else {\n pageIdx += kidCount;\n }\n }\n else {\n pageIdx += 1;\n }\n }\n Kids.insert(kidIdx, leafRef);\n this.ascend(function (node) {\n var Count = node.Count();\n node.set(PDFName.of('Count'), PDFNumber.of(Count.asNumber() + 1));\n });\n return undefined;\n };\n /**\n * Removes the leaf node at the specified index (zero-based) from this page\n * tree. Also decrements the `Count` of each page tree in the hierarchy to\n * account for the removed page.\n */\n PDFPageTree.prototype.removeLeafNode = function (targetIndex) {\n var Kids = this.Kids();\n var kidSize = Kids.size();\n var kidIdx = 0;\n var pageIdx = 0;\n while (pageIdx < targetIndex) {\n if (kidIdx >= kidSize) {\n throw new Error(\"Index out of bounds: \" + kidIdx + \"/\" + (kidSize - 1) + \" (a)\");\n }\n var kidRef = Kids.get(kidIdx++);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree) {\n var kidCount = kid.Count().asNumber();\n if (pageIdx + kidCount > targetIndex) {\n kid.removeLeafNode(targetIndex - pageIdx);\n return;\n }\n else {\n pageIdx += kidCount;\n }\n }\n else {\n pageIdx += 1;\n }\n }\n if (kidIdx >= kidSize) {\n throw new Error(\"Index out of bounds: \" + kidIdx + \"/\" + (kidSize - 1) + \" (b)\");\n }\n var target = Kids.lookup(kidIdx);\n if (target instanceof PDFPageTree) {\n target.removeLeafNode(0);\n }\n else {\n Kids.remove(kidIdx);\n this.ascend(function (node) {\n var Count = node.Count();\n node.set(PDFName.of('Count'), PDFNumber.of(Count.asNumber() - 1));\n });\n }\n };\n PDFPageTree.prototype.ascend = function (visitor) {\n visitor(this);\n var Parent = this.Parent();\n if (Parent)\n Parent.ascend(visitor);\n };\n /** Performs a Post-Order traversal of this page tree */\n PDFPageTree.prototype.traverse = function (visitor) {\n var Kids = this.Kids();\n for (var idx = 0, len = Kids.size(); idx < len; idx++) {\n var kidRef = Kids.get(idx);\n var kid = this.context.lookup(kidRef);\n if (kid instanceof PDFPageTree)\n kid.traverse(visitor);\n visitor(kid, kidRef);\n }\n };\n PDFPageTree.withContext = function (context, parent) {\n var dict = new Map();\n dict.set(PDFName.of('Type'), PDFName.of('Pages'));\n dict.set(PDFName.of('Kids'), context.obj([]));\n dict.set(PDFName.of('Count'), context.obj(0));\n if (parent)\n dict.set(PDFName.of('Parent'), parent);\n return new PDFPageTree(dict, context);\n };\n PDFPageTree.fromMapWithContext = function (map, context) {\n return new PDFPageTree(map, context);\n };\n return PDFPageTree;\n}(PDFDict));\nexport default PDFPageTree;\n//# sourceMappingURL=PDFPageTree.js.map","import CharCodes from \"./CharCodes\";\nexport var IsDigit = new Uint8Array(256);\nIsDigit[CharCodes.Zero] = 1;\nIsDigit[CharCodes.One] = 1;\nIsDigit[CharCodes.Two] = 1;\nIsDigit[CharCodes.Three] = 1;\nIsDigit[CharCodes.Four] = 1;\nIsDigit[CharCodes.Five] = 1;\nIsDigit[CharCodes.Six] = 1;\nIsDigit[CharCodes.Seven] = 1;\nIsDigit[CharCodes.Eight] = 1;\nIsDigit[CharCodes.Nine] = 1;\nexport var IsNumericPrefix = new Uint8Array(256);\nIsNumericPrefix[CharCodes.Period] = 1;\nIsNumericPrefix[CharCodes.Plus] = 1;\nIsNumericPrefix[CharCodes.Minus] = 1;\nexport var IsNumeric = new Uint8Array(256);\nfor (var idx = 0, len = 256; idx < len; idx++) {\n IsNumeric[idx] = IsDigit[idx] || IsNumericPrefix[idx] ? 1 : 0;\n}\n//# sourceMappingURL=Numeric.js.map","import { NumberParsingError } from \"../errors\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsDigit, IsNumeric } from \"../syntax/Numeric\";\nimport { IsWhitespace } from \"../syntax/Whitespace\";\nimport { charFromCode } from \"../../utils\";\nvar Newline = CharCodes.Newline, CarriageReturn = CharCodes.CarriageReturn;\n// TODO: Throw error if eof is reached before finishing object parse...\nvar BaseParser = /** @class */ (function () {\n function BaseParser(bytes) {\n this.bytes = bytes;\n }\n BaseParser.prototype.parseRawInt = function () {\n var value = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsDigit[byte])\n break;\n value += charFromCode(this.bytes.next());\n }\n var numberValue = Number(value);\n if (!value || !isFinite(numberValue)) {\n throw new NumberParsingError(this.bytes.position(), value);\n }\n return numberValue;\n };\n // TODO: Maybe handle exponential format?\n // TODO: Compare performance of string concatenation to charFromCode(...bytes)\n BaseParser.prototype.parseRawNumber = function () {\n var value = '';\n // Parse integer-part, the leading (+ | - | . | 0-9)\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsNumeric[byte])\n break;\n value += charFromCode(this.bytes.next());\n if (byte === CharCodes.Period)\n break;\n }\n // Parse decimal-part, the trailing (0-9)\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (!IsDigit[byte])\n break;\n value += charFromCode(this.bytes.next());\n }\n var numberValue = Number(value);\n if (!value || !isFinite(numberValue)) {\n throw new NumberParsingError(this.bytes.position(), value);\n }\n return numberValue;\n };\n BaseParser.prototype.skipWhitespace = function () {\n while (!this.bytes.done() && IsWhitespace[this.bytes.peek()]) {\n this.bytes.next();\n }\n };\n BaseParser.prototype.skipLine = function () {\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (byte === Newline || byte === CarriageReturn)\n return;\n this.bytes.next();\n }\n };\n BaseParser.prototype.skipComment = function () {\n if (this.bytes.peek() !== CharCodes.Percent)\n return false;\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (byte === Newline || byte === CarriageReturn)\n return true;\n this.bytes.next();\n }\n return true;\n };\n BaseParser.prototype.skipWhitespaceAndComments = function () {\n this.skipWhitespace();\n while (this.skipComment())\n this.skipWhitespace();\n };\n BaseParser.prototype.matchKeyword = function (keyword) {\n var initialOffset = this.bytes.offset();\n for (var idx = 0, len = keyword.length; idx < len; idx++) {\n if (this.bytes.done() || this.bytes.next() !== keyword[idx]) {\n this.bytes.moveTo(initialOffset);\n return false;\n }\n }\n return true;\n };\n return BaseParser;\n}());\nexport default BaseParser;\n//# sourceMappingURL=BaseParser.js.map","import { assertIs, error } from \"../utils\";\nexport var RotationTypes;\n(function (RotationTypes) {\n RotationTypes[\"Degrees\"] = \"degrees\";\n RotationTypes[\"Radians\"] = \"radians\";\n})(RotationTypes || (RotationTypes = {}));\nexport var radians = function (radianAngle) {\n assertIs(radianAngle, 'radianAngle', ['number']);\n return { type: RotationTypes.Radians, angle: radianAngle };\n};\nexport var degrees = function (degreeAngle) {\n assertIs(degreeAngle, 'degreeAngle', ['number']);\n return { type: RotationTypes.Degrees, angle: degreeAngle };\n};\nvar Radians = RotationTypes.Radians, Degrees = RotationTypes.Degrees;\nexport var degreesToRadians = function (degree) { return (degree * Math.PI) / 180; };\nexport var radiansToDegrees = function (radian) { return (radian * 180) / Math.PI; };\n// prettier-ignore\nexport var toRadians = function (rotation) {\n return rotation.type === Radians ? rotation.angle\n : rotation.type === Degrees ? degreesToRadians(rotation.angle)\n : error(\"Invalid rotation: \" + JSON.stringify(rotation));\n};\n// prettier-ignore\nexport var toDegrees = function (rotation) {\n return rotation.type === Radians ? radiansToDegrees(rotation.angle)\n : rotation.type === Degrees ? rotation.angle\n : error(\"Invalid rotation: \" + JSON.stringify(rotation));\n};\n//# sourceMappingURL=rotations.js.map","import { NextByteAssertionError } from \"../errors\";\nimport { decodePDFRawStream } from \"../streams/decode\";\nimport CharCodes from \"../syntax/CharCodes\";\n// TODO: See how line/col tracking affects performance\nvar ByteStream = /** @class */ (function () {\n function ByteStream(bytes) {\n this.idx = 0;\n this.line = 0;\n this.column = 0;\n this.bytes = bytes;\n this.length = this.bytes.length;\n }\n ByteStream.prototype.moveTo = function (offset) {\n this.idx = offset;\n };\n ByteStream.prototype.next = function () {\n var byte = this.bytes[this.idx++];\n if (byte === CharCodes.Newline) {\n this.line += 1;\n this.column = 0;\n }\n else {\n this.column += 1;\n }\n return byte;\n };\n ByteStream.prototype.assertNext = function (expected) {\n if (this.peek() !== expected) {\n throw new NextByteAssertionError(this.position(), expected, this.peek());\n }\n return this.next();\n };\n ByteStream.prototype.peek = function () {\n return this.bytes[this.idx];\n };\n ByteStream.prototype.peekAhead = function (steps) {\n return this.bytes[this.idx + steps];\n };\n ByteStream.prototype.peekAt = function (offset) {\n return this.bytes[offset];\n };\n ByteStream.prototype.done = function () {\n return this.idx >= this.length;\n };\n ByteStream.prototype.offset = function () {\n return this.idx;\n };\n ByteStream.prototype.slice = function (start, end) {\n return this.bytes.slice(start, end);\n };\n ByteStream.prototype.position = function () {\n return { line: this.line, column: this.column, offset: this.idx };\n };\n ByteStream.of = function (bytes) { return new ByteStream(bytes); };\n ByteStream.fromPDFRawStream = function (rawStream) {\n return ByteStream.of(decodePDFRawStream(rawStream).decode());\n };\n return ByteStream;\n}());\nexport default ByteStream;\n//# sourceMappingURL=ByteStream.js.map","import { __spreadArrays } from \"tslib\";\nimport CharCodes from \"./CharCodes\";\nvar Space = CharCodes.Space, CarriageReturn = CharCodes.CarriageReturn, Newline = CharCodes.Newline;\nvar stream = [\n CharCodes.s,\n CharCodes.t,\n CharCodes.r,\n CharCodes.e,\n CharCodes.a,\n CharCodes.m,\n];\nvar endstream = [\n CharCodes.e,\n CharCodes.n,\n CharCodes.d,\n CharCodes.s,\n CharCodes.t,\n CharCodes.r,\n CharCodes.e,\n CharCodes.a,\n CharCodes.m,\n];\nexport var Keywords = {\n header: [\n CharCodes.Percent,\n CharCodes.P,\n CharCodes.D,\n CharCodes.F,\n CharCodes.Dash,\n ],\n eof: [\n CharCodes.Percent,\n CharCodes.Percent,\n CharCodes.E,\n CharCodes.O,\n CharCodes.F,\n ],\n obj: [CharCodes.o, CharCodes.b, CharCodes.j],\n endobj: [\n CharCodes.e,\n CharCodes.n,\n CharCodes.d,\n CharCodes.o,\n CharCodes.b,\n CharCodes.j,\n ],\n xref: [CharCodes.x, CharCodes.r, CharCodes.e, CharCodes.f],\n trailer: [\n CharCodes.t,\n CharCodes.r,\n CharCodes.a,\n CharCodes.i,\n CharCodes.l,\n CharCodes.e,\n CharCodes.r,\n ],\n startxref: [\n CharCodes.s,\n CharCodes.t,\n CharCodes.a,\n CharCodes.r,\n CharCodes.t,\n CharCodes.x,\n CharCodes.r,\n CharCodes.e,\n CharCodes.f,\n ],\n true: [CharCodes.t, CharCodes.r, CharCodes.u, CharCodes.e],\n false: [CharCodes.f, CharCodes.a, CharCodes.l, CharCodes.s, CharCodes.e],\n null: [CharCodes.n, CharCodes.u, CharCodes.l, CharCodes.l],\n stream: stream,\n streamEOF1: __spreadArrays(stream, [Space, CarriageReturn, Newline]),\n streamEOF2: __spreadArrays(stream, [CarriageReturn, Newline]),\n streamEOF3: __spreadArrays(stream, [CarriageReturn]),\n streamEOF4: __spreadArrays(stream, [Newline]),\n endstream: endstream,\n EOF1endstream: __spreadArrays([CarriageReturn, Newline], endstream),\n EOF2endstream: __spreadArrays([CarriageReturn], endstream),\n EOF3endstream: __spreadArrays([Newline], endstream),\n};\n//# sourceMappingURL=Keywords.js.map","import { __extends } from \"tslib\";\nimport { PDFObjectParsingError, PDFStreamParsingError, UnbalancedParenthesisError, } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFBool from \"../objects/PDFBool\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFHexString from \"../objects/PDFHexString\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNull from \"../objects/PDFNull\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFRef from \"../objects/PDFRef\";\nimport PDFString from \"../objects/PDFString\";\nimport BaseParser from \"./BaseParser\";\nimport ByteStream from \"./ByteStream\";\nimport PDFCatalog from \"../structures/PDFCatalog\";\nimport PDFPageLeaf from \"../structures/PDFPageLeaf\";\nimport PDFPageTree from \"../structures/PDFPageTree\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { IsDelimiter } from \"../syntax/Delimiters\";\nimport { Keywords } from \"../syntax/Keywords\";\nimport { IsDigit, IsNumeric } from \"../syntax/Numeric\";\nimport { IsWhitespace } from \"../syntax/Whitespace\";\nimport { charFromCode } from \"../../utils\";\n// TODO: Throw error if eof is reached before finishing object parse...\nvar PDFObjectParser = /** @class */ (function (_super) {\n __extends(PDFObjectParser, _super);\n function PDFObjectParser(byteStream, context) {\n var _this = _super.call(this, byteStream) || this;\n _this.context = context;\n return _this;\n }\n // TODO: Is it possible to reduce duplicate parsing for ref lookaheads?\n PDFObjectParser.prototype.parseObject = function () {\n this.skipWhitespaceAndComments();\n if (this.matchKeyword(Keywords.true))\n return PDFBool.True;\n if (this.matchKeyword(Keywords.false))\n return PDFBool.False;\n if (this.matchKeyword(Keywords.null))\n return PDFNull;\n var byte = this.bytes.peek();\n if (byte === CharCodes.LessThan &&\n this.bytes.peekAhead(1) === CharCodes.LessThan) {\n return this.parseDictOrStream();\n }\n if (byte === CharCodes.LessThan)\n return this.parseHexString();\n if (byte === CharCodes.LeftParen)\n return this.parseString();\n if (byte === CharCodes.ForwardSlash)\n return this.parseName();\n if (byte === CharCodes.LeftSquareBracket)\n return this.parseArray();\n if (IsNumeric[byte])\n return this.parseNumberOrRef();\n throw new PDFObjectParsingError(this.bytes.position(), byte);\n };\n PDFObjectParser.prototype.parseNumberOrRef = function () {\n var firstNum = this.parseRawNumber();\n this.skipWhitespaceAndComments();\n var lookaheadStart = this.bytes.offset();\n if (IsDigit[this.bytes.peek()]) {\n var secondNum = this.parseRawNumber();\n this.skipWhitespaceAndComments();\n if (this.bytes.peek() === CharCodes.R) {\n this.bytes.assertNext(CharCodes.R);\n return PDFRef.of(firstNum, secondNum);\n }\n }\n this.bytes.moveTo(lookaheadStart);\n return PDFNumber.of(firstNum);\n };\n // TODO: Maybe update PDFHexString.of() logic to remove whitespace and validate input?\n PDFObjectParser.prototype.parseHexString = function () {\n var value = '';\n this.bytes.assertNext(CharCodes.LessThan);\n while (!this.bytes.done() && this.bytes.peek() !== CharCodes.GreaterThan) {\n value += charFromCode(this.bytes.next());\n }\n this.bytes.assertNext(CharCodes.GreaterThan);\n return PDFHexString.of(value);\n };\n PDFObjectParser.prototype.parseString = function () {\n var nestingLvl = 0;\n var isEscaped = false;\n var value = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.next();\n value += charFromCode(byte);\n // Check for unescaped parenthesis\n if (!isEscaped) {\n if (byte === CharCodes.LeftParen)\n nestingLvl += 1;\n if (byte === CharCodes.RightParen)\n nestingLvl -= 1;\n }\n // Track whether current character is being escaped or not\n if (byte === CharCodes.BackSlash) {\n isEscaped = !isEscaped;\n }\n else if (isEscaped) {\n isEscaped = false;\n }\n // Once (if) the unescaped parenthesis balance out, return their contents\n if (nestingLvl === 0) {\n // Remove the outer parens so they aren't part of the contents\n return PDFString.of(value.substring(1, value.length - 1));\n }\n }\n throw new UnbalancedParenthesisError(this.bytes.position());\n };\n // TODO: Compare performance of string concatenation to charFromCode(...bytes)\n // TODO: Maybe preallocate small Uint8Array if can use charFromCode?\n PDFObjectParser.prototype.parseName = function () {\n this.bytes.assertNext(CharCodes.ForwardSlash);\n var name = '';\n while (!this.bytes.done()) {\n var byte = this.bytes.peek();\n if (IsWhitespace[byte] || IsDelimiter[byte])\n break;\n name += charFromCode(byte);\n this.bytes.next();\n }\n return PDFName.of(name);\n };\n PDFObjectParser.prototype.parseArray = function () {\n this.bytes.assertNext(CharCodes.LeftSquareBracket);\n this.skipWhitespaceAndComments();\n var pdfArray = PDFArray.withContext(this.context);\n while (this.bytes.peek() !== CharCodes.RightSquareBracket) {\n var element = this.parseObject();\n pdfArray.push(element);\n this.skipWhitespaceAndComments();\n }\n this.bytes.assertNext(CharCodes.RightSquareBracket);\n return pdfArray;\n };\n PDFObjectParser.prototype.parseDict = function () {\n this.bytes.assertNext(CharCodes.LessThan);\n this.bytes.assertNext(CharCodes.LessThan);\n this.skipWhitespaceAndComments();\n var dict = new Map();\n while (!this.bytes.done() &&\n this.bytes.peek() !== CharCodes.GreaterThan &&\n this.bytes.peekAhead(1) !== CharCodes.GreaterThan) {\n var key = this.parseName();\n var value = this.parseObject();\n dict.set(key, value);\n this.skipWhitespaceAndComments();\n }\n this.skipWhitespaceAndComments();\n this.bytes.assertNext(CharCodes.GreaterThan);\n this.bytes.assertNext(CharCodes.GreaterThan);\n var Type = dict.get(PDFName.of('Type'));\n if (Type === PDFName.of('Catalog')) {\n return PDFCatalog.fromMapWithContext(dict, this.context);\n }\n else if (Type === PDFName.of('Pages')) {\n return PDFPageTree.fromMapWithContext(dict, this.context);\n }\n else if (Type === PDFName.of('Page')) {\n return PDFPageLeaf.fromMapWithContext(dict, this.context);\n }\n else {\n return PDFDict.fromMapWithContext(dict, this.context);\n }\n };\n PDFObjectParser.prototype.parseDictOrStream = function () {\n var startPos = this.bytes.position();\n var dict = this.parseDict();\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.streamEOF1) &&\n !this.matchKeyword(Keywords.streamEOF2) &&\n !this.matchKeyword(Keywords.streamEOF3) &&\n !this.matchKeyword(Keywords.streamEOF4) &&\n !this.matchKeyword(Keywords.stream)) {\n return dict;\n }\n var start = this.bytes.offset();\n var end;\n var Length = dict.get(PDFName.of('Length'));\n if (Length instanceof PDFNumber) {\n end = start + Length.asNumber();\n this.bytes.moveTo(end);\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.endstream)) {\n this.bytes.moveTo(start);\n end = this.findEndOfStreamFallback(startPos);\n }\n }\n else {\n end = this.findEndOfStreamFallback(startPos);\n }\n var contents = this.bytes.slice(start, end);\n return PDFRawStream.of(dict, contents);\n };\n PDFObjectParser.prototype.findEndOfStreamFallback = function (startPos) {\n // Move to end of stream, while handling nested streams\n var nestingLvl = 1;\n var end = this.bytes.offset();\n while (!this.bytes.done()) {\n end = this.bytes.offset();\n if (this.matchKeyword(Keywords.stream)) {\n nestingLvl += 1;\n }\n else if (this.matchKeyword(Keywords.EOF1endstream) ||\n this.matchKeyword(Keywords.EOF2endstream) ||\n this.matchKeyword(Keywords.EOF3endstream) ||\n this.matchKeyword(Keywords.endstream)) {\n nestingLvl -= 1;\n }\n else {\n this.bytes.next();\n }\n if (nestingLvl === 0)\n break;\n }\n if (nestingLvl !== 0)\n throw new PDFStreamParsingError(startPos);\n return end;\n };\n PDFObjectParser.forBytes = function (bytes, context) {\n return new PDFObjectParser(ByteStream.of(bytes), context);\n };\n PDFObjectParser.forByteStream = function (byteStream, context) {\n return new PDFObjectParser(byteStream, context);\n };\n return PDFObjectParser;\n}(BaseParser));\nexport default PDFObjectParser;\n//# sourceMappingURL=PDFObjectParser.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport { ReparseError } from \"../errors\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nimport PDFObjectParser from \"./PDFObjectParser\";\nimport { waitForTick } from \"../../utils\";\nvar PDFObjectStreamParser = /** @class */ (function (_super) {\n __extends(PDFObjectStreamParser, _super);\n function PDFObjectStreamParser(rawStream, shouldWaitForTick) {\n var _this = _super.call(this, ByteStream.fromPDFRawStream(rawStream), rawStream.dict.context) || this;\n var dict = rawStream.dict;\n _this.alreadyParsed = false;\n _this.shouldWaitForTick = shouldWaitForTick || (function () { return false; });\n _this.firstOffset = dict.lookup(PDFName.of('First'), PDFNumber).asNumber();\n _this.objectCount = dict.lookup(PDFName.of('N'), PDFNumber).asNumber();\n return _this;\n }\n PDFObjectStreamParser.prototype.parseIntoContext = function () {\n return __awaiter(this, void 0, void 0, function () {\n var offsetsAndObjectNumbers, idx, len, _a, objectNumber, offset, object, ref;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (this.alreadyParsed) {\n throw new ReparseError('PDFObjectStreamParser', 'parseIntoContext');\n }\n this.alreadyParsed = true;\n offsetsAndObjectNumbers = this.parseOffsetsAndObjectNumbers();\n idx = 0, len = offsetsAndObjectNumbers.length;\n _b.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n _a = offsetsAndObjectNumbers[idx], objectNumber = _a.objectNumber, offset = _a.offset;\n this.bytes.moveTo(this.firstOffset + offset);\n object = this.parseObject();\n ref = PDFRef.of(objectNumber, 0);\n this.context.assign(ref, object);\n if (!this.shouldWaitForTick()) return [3 /*break*/, 3];\n return [4 /*yield*/, waitForTick()];\n case 2:\n _b.sent();\n _b.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n PDFObjectStreamParser.prototype.parseOffsetsAndObjectNumbers = function () {\n var offsetsAndObjectNumbers = [];\n for (var idx = 0, len = this.objectCount; idx < len; idx++) {\n this.skipWhitespaceAndComments();\n var objectNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var offset = this.parseRawInt();\n offsetsAndObjectNumbers.push({ objectNumber: objectNumber, offset: offset });\n }\n return offsetsAndObjectNumbers;\n };\n PDFObjectStreamParser.forStream = function (rawStream, shouldWaitForTick) { return new PDFObjectStreamParser(rawStream, shouldWaitForTick); };\n return PDFObjectStreamParser;\n}(PDFObjectParser));\nexport default PDFObjectStreamParser;\n//# sourceMappingURL=PDFObjectStreamParser.js.map","import { ReparseError } from \"../errors\";\nimport PDFArray from \"../objects/PDFArray\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFNumber from \"../objects/PDFNumber\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nvar PDFXRefStreamParser = /** @class */ (function () {\n function PDFXRefStreamParser(rawStream) {\n this.alreadyParsed = false;\n this.dict = rawStream.dict;\n this.bytes = ByteStream.fromPDFRawStream(rawStream);\n this.context = this.dict.context;\n var Size = this.dict.lookup(PDFName.of('Size'), PDFNumber);\n var Index = this.dict.lookup(PDFName.of('Index'));\n if (Index instanceof PDFArray) {\n this.subsections = [];\n for (var idx = 0, len = Index.size(); idx < len; idx += 2) {\n var firstObjectNumber = Index.lookup(idx + 0, PDFNumber).asNumber();\n var length_1 = Index.lookup(idx + 1, PDFNumber).asNumber();\n this.subsections.push({ firstObjectNumber: firstObjectNumber, length: length_1 });\n }\n }\n else {\n this.subsections = [{ firstObjectNumber: 0, length: Size.asNumber() }];\n }\n var W = this.dict.lookup(PDFName.of('W'), PDFArray);\n this.byteWidths = [-1, -1, -1];\n for (var idx = 0, len = W.size(); idx < len; idx++) {\n this.byteWidths[idx] = W.lookup(idx, PDFNumber).asNumber();\n }\n }\n PDFXRefStreamParser.prototype.parseIntoContext = function () {\n if (this.alreadyParsed) {\n throw new ReparseError('PDFXRefStreamParser', 'parseIntoContext');\n }\n this.alreadyParsed = true;\n this.context.trailerInfo = {\n Root: this.dict.get(PDFName.of('Root')),\n Encrypt: this.dict.get(PDFName.of('Encrypt')),\n Info: this.dict.get(PDFName.of('Info')),\n ID: this.dict.get(PDFName.of('ID')),\n };\n var entries = this.parseEntries();\n // for (let idx = 0, len = entries.length; idx < len; idx++) {\n // const entry = entries[idx];\n // if (entry.deleted) this.context.delete(entry.ref);\n // }\n return entries;\n };\n PDFXRefStreamParser.prototype.parseEntries = function () {\n var entries = [];\n var _a = this.byteWidths, typeFieldWidth = _a[0], offsetFieldWidth = _a[1], genFieldWidth = _a[2];\n for (var subsectionIdx = 0, subsectionLen = this.subsections.length; subsectionIdx < subsectionLen; subsectionIdx++) {\n var _b = this.subsections[subsectionIdx], firstObjectNumber = _b.firstObjectNumber, length_2 = _b.length;\n for (var objIdx = 0; objIdx < length_2; objIdx++) {\n var type = 0;\n for (var idx = 0, len = typeFieldWidth; idx < len; idx++) {\n type = (type << 8) | this.bytes.next();\n }\n var offset = 0;\n for (var idx = 0, len = offsetFieldWidth; idx < len; idx++) {\n offset = (offset << 8) | this.bytes.next();\n }\n var generationNumber = 0;\n for (var idx = 0, len = genFieldWidth; idx < len; idx++) {\n generationNumber = (generationNumber << 8) | this.bytes.next();\n }\n // When the `type` field is absent, it defaults to 1\n if (typeFieldWidth === 0)\n type = 1;\n var objectNumber = firstObjectNumber + objIdx;\n var entry = {\n ref: PDFRef.of(objectNumber, generationNumber),\n offset: offset,\n deleted: type === 0,\n inObjectStream: type === 2,\n };\n entries.push(entry);\n }\n }\n return entries;\n };\n PDFXRefStreamParser.forStream = function (rawStream) {\n return new PDFXRefStreamParser(rawStream);\n };\n return PDFXRefStreamParser;\n}());\nexport default PDFXRefStreamParser;\n//# sourceMappingURL=PDFXRefStreamParser.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport PDFCrossRefSection from \"../document/PDFCrossRefSection\";\nimport PDFHeader from \"../document/PDFHeader\";\nimport PDFTrailer from \"../document/PDFTrailer\";\nimport { MissingKeywordError, MissingPDFHeaderError, PDFInvalidObjectParsingError, ReparseError, StalledParserError, } from \"../errors\";\nimport PDFDict from \"../objects/PDFDict\";\nimport PDFInvalidObject from \"../objects/PDFInvalidObject\";\nimport PDFName from \"../objects/PDFName\";\nimport PDFRawStream from \"../objects/PDFRawStream\";\nimport PDFRef from \"../objects/PDFRef\";\nimport ByteStream from \"./ByteStream\";\nimport PDFObjectParser from \"./PDFObjectParser\";\nimport PDFObjectStreamParser from \"./PDFObjectStreamParser\";\nimport PDFXRefStreamParser from \"./PDFXRefStreamParser\";\nimport PDFContext from \"../PDFContext\";\nimport CharCodes from \"../syntax/CharCodes\";\nimport { Keywords } from \"../syntax/Keywords\";\nimport { IsDigit } from \"../syntax/Numeric\";\nimport { waitForTick } from \"../../utils\";\nvar PDFParser = /** @class */ (function (_super) {\n __extends(PDFParser, _super);\n function PDFParser(pdfBytes, objectsPerTick, throwOnInvalidObject) {\n if (objectsPerTick === void 0) { objectsPerTick = Infinity; }\n if (throwOnInvalidObject === void 0) { throwOnInvalidObject = false; }\n var _this = _super.call(this, ByteStream.of(pdfBytes), PDFContext.create()) || this;\n _this.alreadyParsed = false;\n _this.parsedObjects = 0;\n _this.shouldWaitForTick = function () {\n _this.parsedObjects += 1;\n return _this.parsedObjects % _this.objectsPerTick === 0;\n };\n _this.objectsPerTick = objectsPerTick;\n _this.throwOnInvalidObject = throwOnInvalidObject;\n return _this;\n }\n PDFParser.prototype.parseDocument = function () {\n return __awaiter(this, void 0, void 0, function () {\n var prevOffset, offset;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.alreadyParsed) {\n throw new ReparseError('PDFParser', 'parseDocument');\n }\n this.alreadyParsed = true;\n this.context.header = this.parseHeader();\n _a.label = 1;\n case 1:\n if (!!this.bytes.done()) return [3 /*break*/, 3];\n return [4 /*yield*/, this.parseDocumentSection()];\n case 2:\n _a.sent();\n offset = this.bytes.offset();\n if (offset === prevOffset) {\n throw new StalledParserError(this.bytes.position());\n }\n prevOffset = offset;\n return [3 /*break*/, 1];\n case 3:\n this.maybeRecoverRoot();\n return [2 /*return*/, this.context];\n }\n });\n });\n };\n PDFParser.prototype.maybeRecoverRoot = function () {\n var isValidCatalog = function (obj) {\n return obj instanceof PDFDict &&\n obj.lookup(PDFName.of('Type')) === PDFName.of('Catalog');\n };\n var catalog = this.context.lookup(this.context.trailerInfo.Root);\n if (!isValidCatalog(catalog)) {\n var indirectObjects = this.context.enumerateIndirectObjects();\n for (var idx = 0, len = indirectObjects.length; idx < len; idx++) {\n var _a = indirectObjects[idx], ref = _a[0], object = _a[1];\n if (isValidCatalog(object)) {\n this.context.trailerInfo.Root = ref;\n }\n }\n }\n };\n PDFParser.prototype.parseHeader = function () {\n while (!this.bytes.done()) {\n if (this.matchKeyword(Keywords.header)) {\n var major = this.parseRawInt();\n this.bytes.assertNext(CharCodes.Period);\n var minor = this.parseRawInt();\n var header = PDFHeader.forVersion(major, minor);\n this.skipBinaryHeaderComment();\n return header;\n }\n this.bytes.next();\n }\n throw new MissingPDFHeaderError(this.bytes.position());\n };\n PDFParser.prototype.parseIndirectObjectHeader = function () {\n this.skipWhitespaceAndComments();\n var objectNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var generationNumber = this.parseRawInt();\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.obj)) {\n throw new MissingKeywordError(this.bytes.position(), Keywords.obj);\n }\n return PDFRef.of(objectNumber, generationNumber);\n };\n PDFParser.prototype.matchIndirectObjectHeader = function () {\n var initialOffset = this.bytes.offset();\n try {\n this.parseIndirectObjectHeader();\n return true;\n }\n catch (e) {\n this.bytes.moveTo(initialOffset);\n return false;\n }\n };\n PDFParser.prototype.parseIndirectObject = function () {\n return __awaiter(this, void 0, void 0, function () {\n var ref, object;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n ref = this.parseIndirectObjectHeader();\n this.skipWhitespaceAndComments();\n object = this.parseObject();\n this.skipWhitespaceAndComments();\n // if (!this.matchKeyword(Keywords.endobj)) {\n // throw new MissingKeywordError(this.bytes.position(), Keywords.endobj);\n // }\n // TODO: Log a warning if this fails...\n this.matchKeyword(Keywords.endobj);\n if (!(object instanceof PDFRawStream &&\n object.dict.lookup(PDFName.of('Type')) === PDFName.of('ObjStm'))) return [3 /*break*/, 2];\n return [4 /*yield*/, PDFObjectStreamParser.forStream(object, this.shouldWaitForTick).parseIntoContext()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n if (object instanceof PDFRawStream &&\n object.dict.lookup(PDFName.of('Type')) === PDFName.of('XRef')) {\n PDFXRefStreamParser.forStream(object).parseIntoContext();\n }\n else {\n this.context.assign(ref, object);\n }\n _a.label = 3;\n case 3: return [2 /*return*/, ref];\n }\n });\n });\n };\n // TODO: Improve and clean this up\n PDFParser.prototype.tryToParseInvalidIndirectObject = function () {\n var startPos = this.bytes.position();\n var msg = \"Trying to parse invalid object: \" + JSON.stringify(startPos) + \")\";\n if (this.throwOnInvalidObject)\n throw new Error(msg);\n console.warn(msg);\n var ref = this.parseIndirectObjectHeader();\n console.warn(\"Invalid object ref: \" + ref);\n this.skipWhitespaceAndComments();\n var start = this.bytes.offset();\n var failed = true;\n while (!this.bytes.done()) {\n if (this.matchKeyword(Keywords.endobj)) {\n failed = false;\n }\n if (!failed)\n break;\n this.bytes.next();\n }\n if (failed)\n throw new PDFInvalidObjectParsingError(startPos);\n var end = this.bytes.offset() - Keywords.endobj.length;\n var object = PDFInvalidObject.of(this.bytes.slice(start, end));\n this.context.assign(ref, object);\n return ref;\n };\n PDFParser.prototype.parseIndirectObjects = function () {\n return __awaiter(this, void 0, void 0, function () {\n var initialOffset, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.skipWhitespaceAndComments();\n _a.label = 1;\n case 1:\n if (!(!this.bytes.done() && IsDigit[this.bytes.peek()])) return [3 /*break*/, 8];\n initialOffset = this.bytes.offset();\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4, , 5]);\n return [4 /*yield*/, this.parseIndirectObject()];\n case 3:\n _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n // TODO: Add tracing/logging mechanism to track when this happens!\n this.bytes.moveTo(initialOffset);\n this.tryToParseInvalidIndirectObject();\n return [3 /*break*/, 5];\n case 5:\n this.skipWhitespaceAndComments();\n // TODO: Can this be done only when needed, to avoid harming performance?\n this.skipJibberish();\n if (!this.shouldWaitForTick()) return [3 /*break*/, 7];\n return [4 /*yield*/, waitForTick()];\n case 6:\n _a.sent();\n _a.label = 7;\n case 7: return [3 /*break*/, 1];\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n PDFParser.prototype.maybeParseCrossRefSection = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.xref))\n return;\n this.skipWhitespaceAndComments();\n var objectNumber = -1;\n var xref = PDFCrossRefSection.createEmpty();\n while (!this.bytes.done() && IsDigit[this.bytes.peek()]) {\n var firstInt = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var secondInt = this.parseRawInt();\n this.skipWhitespaceAndComments();\n var byte = this.bytes.peek();\n if (byte === CharCodes.n || byte === CharCodes.f) {\n var ref = PDFRef.of(objectNumber, secondInt);\n if (this.bytes.next() === CharCodes.n) {\n xref.addEntry(ref, firstInt);\n }\n else {\n // this.context.delete(ref);\n xref.addDeletedEntry(ref, firstInt);\n }\n objectNumber += 1;\n }\n else {\n objectNumber = firstInt;\n }\n this.skipWhitespaceAndComments();\n }\n return xref;\n };\n PDFParser.prototype.maybeParseTrailerDict = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.trailer))\n return;\n this.skipWhitespaceAndComments();\n var dict = this.parseDict();\n var context = this.context;\n context.trailerInfo = {\n Root: dict.get(PDFName.of('Root')) || context.trailerInfo.Root,\n Encrypt: dict.get(PDFName.of('Encrypt')) || context.trailerInfo.Encrypt,\n Info: dict.get(PDFName.of('Info')) || context.trailerInfo.Info,\n ID: dict.get(PDFName.of('ID')) || context.trailerInfo.ID,\n };\n };\n PDFParser.prototype.maybeParseTrailer = function () {\n this.skipWhitespaceAndComments();\n if (!this.matchKeyword(Keywords.startxref))\n return;\n this.skipWhitespaceAndComments();\n var offset = this.parseRawInt();\n this.skipWhitespace();\n this.matchKeyword(Keywords.eof);\n this.skipWhitespaceAndComments();\n this.matchKeyword(Keywords.eof);\n this.skipWhitespaceAndComments();\n return PDFTrailer.forLastCrossRefSectionOffset(offset);\n };\n PDFParser.prototype.parseDocumentSection = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.parseIndirectObjects()];\n case 1:\n _a.sent();\n this.maybeParseCrossRefSection();\n this.maybeParseTrailerDict();\n this.maybeParseTrailer();\n // TODO: Can this be done only when needed, to avoid harming performance?\n this.skipJibberish();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * This operation is not necessary for valid PDF files. But some invalid PDFs\n * contain jibberish in between indirect objects. This method is designed to\n * skip past that jibberish, should it exist, until it reaches the next\n * indirect object header, an xref table section, or the file trailer.\n */\n PDFParser.prototype.skipJibberish = function () {\n this.skipWhitespaceAndComments();\n while (!this.bytes.done()) {\n var initialOffset = this.bytes.offset();\n var byte = this.bytes.peek();\n var isAlphaNumeric = byte >= CharCodes.Space && byte <= CharCodes.Tilde;\n if (isAlphaNumeric) {\n if (this.matchKeyword(Keywords.xref) ||\n this.matchKeyword(Keywords.trailer) ||\n this.matchKeyword(Keywords.startxref) ||\n this.matchIndirectObjectHeader()) {\n this.bytes.moveTo(initialOffset);\n break;\n }\n }\n this.bytes.next();\n }\n };\n /**\n * Skips the binary comment following a PDF header. The specification\n * defines this binary comment (section 7.5.2 File Header) as a sequence of 4\n * or more bytes that are 128 or greater, and which are preceded by a \"%\".\n *\n * This would imply that to strip out this binary comment, we could check for\n * a sequence of bytes starting with \"%\", and remove all subsequent bytes that\n * are 128 or greater. This works for many documents that properly comply with\n * the spec. But in the wild, there are PDFs that omit the leading \"%\", and\n * include bytes that are less than 128 (e.g. 0 or 1). So in order to parse\n * these headers correctly, we just throw out all bytes leading up to the\n * first indirect object header.\n */\n PDFParser.prototype.skipBinaryHeaderComment = function () {\n this.skipWhitespaceAndComments();\n try {\n var initialOffset = this.bytes.offset();\n this.parseIndirectObjectHeader();\n this.bytes.moveTo(initialOffset);\n }\n catch (e) {\n this.bytes.next();\n this.skipWhitespaceAndComments();\n }\n };\n PDFParser.forBytesWithOptions = function (pdfBytes, objectsPerTick, throwOnInvalidObject) { return new PDFParser(pdfBytes, objectsPerTick, throwOnInvalidObject); };\n return PDFParser;\n}(PDFObjectParser));\nexport default PDFParser;\n//# sourceMappingURL=PDFParser.js.map","import { PDFName, PDFNumber } from \"../core\";\nexport var asPDFName = function (name) {\n return name instanceof PDFName ? name : PDFName.of(name);\n};\nexport var asPDFNumber = function (num) {\n return num instanceof PDFNumber ? num : PDFNumber.of(num);\n};\nexport var asNumber = function (num) {\n return num instanceof PDFNumber ? num.asNumber() : num;\n};\n//# sourceMappingURL=objects.js.map","import { asNumber, asPDFName, asPDFNumber } from \"./objects\";\nimport { degreesToRadians } from \"./rotations\";\nimport { PDFOperator, PDFOperatorNames as Ops, } from \"../core\";\n/* ==================== Clipping Path Operators ==================== */\nexport var clip = function () { return PDFOperator.of(Ops.ClipNonZero); };\nexport var clipEvenOdd = function () { return PDFOperator.of(Ops.ClipEvenOdd); };\n/* ==================== Graphics State Operators ==================== */\nvar cos = Math.cos, sin = Math.sin, tan = Math.tan;\nexport var concatTransformationMatrix = function (a, b, c, d, e, f) {\n return PDFOperator.of(Ops.ConcatTransformationMatrix, [\n asPDFNumber(a),\n asPDFNumber(b),\n asPDFNumber(c),\n asPDFNumber(d),\n asPDFNumber(e),\n asPDFNumber(f),\n ]);\n};\nexport var translate = function (xPos, yPos) {\n return concatTransformationMatrix(1, 0, 0, 1, xPos, yPos);\n};\nexport var scale = function (xPos, yPos) {\n return concatTransformationMatrix(xPos, 0, 0, yPos, 0, 0);\n};\nexport var rotateRadians = function (angle) {\n return concatTransformationMatrix(cos(asNumber(angle)), sin(asNumber(angle)), -sin(asNumber(angle)), cos(asNumber(angle)), 0, 0);\n};\nexport var rotateDegrees = function (angle) {\n return rotateRadians(degreesToRadians(asNumber(angle)));\n};\nexport var skewRadians = function (xSkewAngle, ySkewAngle) {\n return concatTransformationMatrix(1, tan(asNumber(xSkewAngle)), tan(asNumber(ySkewAngle)), 1, 0, 0);\n};\nexport var skewDegrees = function (xSkewAngle, ySkewAngle) {\n return skewRadians(degreesToRadians(asNumber(xSkewAngle)), degreesToRadians(asNumber(ySkewAngle)));\n};\nexport var setDashPattern = function (dashArray, dashPhase) {\n return PDFOperator.of(Ops.SetLineDashPattern, [\n \"[\" + dashArray.map(asPDFNumber).join(' ') + \"]\",\n asPDFNumber(dashPhase),\n ]);\n};\nexport var restoreDashPattern = function () { return setDashPattern([], 0); };\nexport var LineCapStyle;\n(function (LineCapStyle) {\n LineCapStyle[LineCapStyle[\"Butt\"] = 0] = \"Butt\";\n LineCapStyle[LineCapStyle[\"Round\"] = 1] = \"Round\";\n LineCapStyle[LineCapStyle[\"Projecting\"] = 2] = \"Projecting\";\n})(LineCapStyle || (LineCapStyle = {}));\nexport var setLineCap = function (style) {\n return PDFOperator.of(Ops.SetLineCapStyle, [asPDFNumber(style)]);\n};\nexport var LineJoinStyle;\n(function (LineJoinStyle) {\n LineJoinStyle[LineJoinStyle[\"Miter\"] = 0] = \"Miter\";\n LineJoinStyle[LineJoinStyle[\"Round\"] = 1] = \"Round\";\n LineJoinStyle[LineJoinStyle[\"Bevel\"] = 2] = \"Bevel\";\n})(LineJoinStyle || (LineJoinStyle = {}));\nexport var setLineJoin = function (style) {\n return PDFOperator.of(Ops.SetLineJoinStyle, [asPDFNumber(style)]);\n};\nexport var pushGraphicsState = function () { return PDFOperator.of(Ops.PushGraphicsState); };\nexport var popGraphicsState = function () { return PDFOperator.of(Ops.PopGraphicsState); };\nexport var setLineWidth = function (width) {\n return PDFOperator.of(Ops.SetLineWidth, [asPDFNumber(width)]);\n};\n/* ==================== Path Construction Operators ==================== */\nexport var appendBezierCurve = function (x1, y1, x2, y2, x3, y3) {\n return PDFOperator.of(Ops.AppendBezierCurve, [\n asPDFNumber(x1),\n asPDFNumber(y1),\n asPDFNumber(x2),\n asPDFNumber(y2),\n asPDFNumber(x3),\n asPDFNumber(y3),\n ]);\n};\nexport var appendQuadraticCurve = function (x1, y1, x2, y2) {\n return PDFOperator.of(Ops.CurveToReplicateInitialPoint, [\n asPDFNumber(x1),\n asPDFNumber(y1),\n asPDFNumber(x2),\n asPDFNumber(y2),\n ]);\n};\nexport var closePath = function () { return PDFOperator.of(Ops.ClosePath); };\nexport var moveTo = function (xPos, yPos) {\n return PDFOperator.of(Ops.MoveTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);\n};\nexport var lineTo = function (xPos, yPos) {\n return PDFOperator.of(Ops.LineTo, [asPDFNumber(xPos), asPDFNumber(yPos)]);\n};\n/**\n * @param xPos x coordinate for the lower left corner of the rectangle\n * @param yPos y coordinate for the lower left corner of the rectangle\n * @param width width of the rectangle\n * @param height height of the rectangle\n */\nexport var rectangle = function (xPos, yPos, width, height) {\n return PDFOperator.of(Ops.AppendRectangle, [\n asPDFNumber(xPos),\n asPDFNumber(yPos),\n asPDFNumber(width),\n asPDFNumber(height),\n ]);\n};\n/**\n * @param xPos x coordinate for the lower left corner of the square\n * @param yPos y coordinate for the lower left corner of the square\n * @param size width and height of the square\n */\nexport var square = function (xPos, yPos, size) {\n return rectangle(xPos, yPos, size, size);\n};\n/* ==================== Path Painting Operators ==================== */\nexport var stroke = function () { return PDFOperator.of(Ops.StrokePath); };\nexport var fill = function () { return PDFOperator.of(Ops.FillNonZero); };\nexport var fillAndStroke = function () { return PDFOperator.of(Ops.FillNonZeroAndStroke); };\nexport var endPath = function () { return PDFOperator.of(Ops.EndPath); };\n/* ==================== Text Positioning Operators ==================== */\nexport var nextLine = function () { return PDFOperator.of(Ops.NextLine); };\nexport var moveText = function (x, y) {\n return PDFOperator.of(Ops.MoveText, [asPDFNumber(x), asPDFNumber(y)]);\n};\n/* ==================== Text Showing Operators ==================== */\nexport var showText = function (text) {\n return PDFOperator.of(Ops.ShowText, [text]);\n};\n/* ==================== Text State Operators ==================== */\nexport var beginText = function () { return PDFOperator.of(Ops.BeginText); };\nexport var endText = function () { return PDFOperator.of(Ops.EndText); };\nexport var setFontAndSize = function (name, size) { return PDFOperator.of(Ops.SetFontAndSize, [asPDFName(name), asPDFNumber(size)]); };\nexport var setCharacterSpacing = function (spacing) {\n return PDFOperator.of(Ops.SetCharacterSpacing, [asPDFNumber(spacing)]);\n};\nexport var setWordSpacing = function (spacing) {\n return PDFOperator.of(Ops.SetWordSpacing, [asPDFNumber(spacing)]);\n};\n/** @param squeeze horizontal character spacing */\nexport var setCharacterSqueeze = function (squeeze) {\n return PDFOperator.of(Ops.SetTextHorizontalScaling, [asPDFNumber(squeeze)]);\n};\nexport var setLineHeight = function (lineHeight) {\n return PDFOperator.of(Ops.SetTextLineHeight, [asPDFNumber(lineHeight)]);\n};\nexport var setTextRise = function (rise) {\n return PDFOperator.of(Ops.SetTextRise, [asPDFNumber(rise)]);\n};\nexport var TextRenderingMode;\n(function (TextRenderingMode) {\n TextRenderingMode[TextRenderingMode[\"Fill\"] = 0] = \"Fill\";\n TextRenderingMode[TextRenderingMode[\"Outline\"] = 1] = \"Outline\";\n TextRenderingMode[TextRenderingMode[\"FillAndOutline\"] = 2] = \"FillAndOutline\";\n TextRenderingMode[TextRenderingMode[\"Invisible\"] = 3] = \"Invisible\";\n TextRenderingMode[TextRenderingMode[\"FillAndClip\"] = 4] = \"FillAndClip\";\n TextRenderingMode[TextRenderingMode[\"OutlineAndClip\"] = 5] = \"OutlineAndClip\";\n TextRenderingMode[TextRenderingMode[\"FillAndOutlineAndClip\"] = 6] = \"FillAndOutlineAndClip\";\n TextRenderingMode[TextRenderingMode[\"Clip\"] = 7] = \"Clip\";\n})(TextRenderingMode || (TextRenderingMode = {}));\nexport var setTextRenderingMode = function (mode) {\n return PDFOperator.of(Ops.SetTextRenderingMode, [asPDFNumber(mode)]);\n};\nexport var setTextMatrix = function (a, b, c, d, e, f) {\n return PDFOperator.of(Ops.SetTextMatrix, [\n asPDFNumber(a),\n asPDFNumber(b),\n asPDFNumber(c),\n asPDFNumber(d),\n asPDFNumber(e),\n asPDFNumber(f),\n ]);\n};\nexport var rotateAndSkewTextRadiansAndTranslate = function (rotationAngle, xSkewAngle, ySkewAngle, x, y) {\n return setTextMatrix(cos(asNumber(rotationAngle)), sin(asNumber(rotationAngle)) + tan(asNumber(xSkewAngle)), -sin(asNumber(rotationAngle)) + tan(asNumber(ySkewAngle)), cos(asNumber(rotationAngle)), x, y);\n};\nexport var rotateAndSkewTextDegreesAndTranslate = function (rotationAngle, xSkewAngle, ySkewAngle, x, y) {\n return rotateAndSkewTextRadiansAndTranslate(degreesToRadians(asNumber(rotationAngle)), degreesToRadians(asNumber(xSkewAngle)), degreesToRadians(asNumber(ySkewAngle)), x, y);\n};\n/* ==================== XObject Operator ==================== */\nexport var drawObject = function (name) {\n return PDFOperator.of(Ops.DrawObject, [asPDFName(name)]);\n};\n/* ==================== Color Operators ==================== */\nexport var setFillingGrayscaleColor = function (gray) {\n return PDFOperator.of(Ops.NonStrokingColorGray, [asPDFNumber(gray)]);\n};\nexport var setStrokingGrayscaleColor = function (gray) {\n return PDFOperator.of(Ops.StrokingColorGray, [asPDFNumber(gray)]);\n};\nexport var setFillingRgbColor = function (red, green, blue) {\n return PDFOperator.of(Ops.NonStrokingColorRgb, [\n asPDFNumber(red),\n asPDFNumber(green),\n asPDFNumber(blue),\n ]);\n};\nexport var setStrokingRgbColor = function (red, green, blue) {\n return PDFOperator.of(Ops.StrokingColorRgb, [\n asPDFNumber(red),\n asPDFNumber(green),\n asPDFNumber(blue),\n ]);\n};\nexport var setFillingCmykColor = function (cyan, magenta, yellow, key) {\n return PDFOperator.of(Ops.NonStrokingColorCmyk, [\n asPDFNumber(cyan),\n asPDFNumber(magenta),\n asPDFNumber(yellow),\n asPDFNumber(key),\n ]);\n};\nexport var setStrokingCmykColor = function (cyan, magenta, yellow, key) {\n return PDFOperator.of(Ops.StrokingColorCmyk, [\n asPDFNumber(cyan),\n asPDFNumber(magenta),\n asPDFNumber(yellow),\n asPDFNumber(key),\n ]);\n};\n//# sourceMappingURL=operators.js.map","import { setFillingCmykColor, setFillingGrayscaleColor, setFillingRgbColor, setStrokingCmykColor, setStrokingGrayscaleColor, setStrokingRgbColor, } from \"./operators\";\nimport { assertRange, error } from \"../utils\";\nexport var ColorTypes;\n(function (ColorTypes) {\n ColorTypes[\"Grayscale\"] = \"Grayscale\";\n ColorTypes[\"RGB\"] = \"RGB\";\n ColorTypes[\"CMYK\"] = \"CMYK\";\n})(ColorTypes || (ColorTypes = {}));\nexport var grayscale = function (gray) {\n assertRange(gray, 'gray', 0.0, 1.0);\n return { type: ColorTypes.Grayscale, gray: gray };\n};\nexport var rgb = function (red, green, blue) {\n assertRange(red, 'red', 0, 1);\n assertRange(green, 'green', 0, 1);\n assertRange(blue, 'blue', 0, 1);\n return { type: ColorTypes.RGB, red: red, green: green, blue: blue };\n};\nexport var cmyk = function (cyan, magenta, yellow, key) {\n assertRange(cyan, 'cyan', 0, 1);\n assertRange(magenta, 'magenta', 0, 1);\n assertRange(yellow, 'yellow', 0, 1);\n assertRange(key, 'key', 0, 1);\n return { type: ColorTypes.CMYK, cyan: cyan, magenta: magenta, yellow: yellow, key: key };\n};\nvar Grayscale = ColorTypes.Grayscale, RGB = ColorTypes.RGB, CMYK = ColorTypes.CMYK;\n// prettier-ignore\nexport var setFillingColor = function (color) {\n return color.type === Grayscale ? setFillingGrayscaleColor(color.gray)\n : color.type === RGB ? setFillingRgbColor(color.red, color.green, color.blue)\n : color.type === CMYK ? setFillingCmykColor(color.cyan, color.magenta, color.yellow, color.key)\n : error(\"Invalid color: \" + JSON.stringify(color));\n};\n// prettier-ignore\nexport var setStrokingColor = function (color) {\n return color.type === Grayscale ? setStrokingGrayscaleColor(color.gray)\n : color.type === RGB ? setStrokingRgbColor(color.red, color.green, color.blue)\n : color.type === CMYK ? setStrokingCmykColor(color.cyan, color.magenta, color.yellow, color.key)\n : error(\"Invalid color: \" + JSON.stringify(color));\n};\n//# sourceMappingURL=colors.js.map","export var StandardFonts;\n(function (StandardFonts) {\n StandardFonts[\"Courier\"] = \"Courier\";\n StandardFonts[\"CourierBold\"] = \"Courier-Bold\";\n StandardFonts[\"CourierOblique\"] = \"Courier-Oblique\";\n StandardFonts[\"CourierBoldOblique\"] = \"Courier-BoldOblique\";\n StandardFonts[\"Helvetica\"] = \"Helvetica\";\n StandardFonts[\"HelveticaBold\"] = \"Helvetica-Bold\";\n StandardFonts[\"HelveticaOblique\"] = \"Helvetica-Oblique\";\n StandardFonts[\"HelveticaBoldOblique\"] = \"Helvetica-BoldOblique\";\n StandardFonts[\"TimesRoman\"] = \"Times-Roman\";\n StandardFonts[\"TimesRomanBold\"] = \"Times-Bold\";\n StandardFonts[\"TimesRomanItalic\"] = \"Times-Italic\";\n StandardFonts[\"TimesRomanBoldItalic\"] = \"Times-BoldItalic\";\n StandardFonts[\"Symbol\"] = \"Symbol\";\n StandardFonts[\"ZapfDingbats\"] = \"ZapfDingbats\";\n})(StandardFonts || (StandardFonts = {}));\n//# sourceMappingURL=StandardFonts.js.map","// tslint:disable: max-classes-per-file\nimport { __extends } from \"tslib\";\n// TODO: Include link to documentation with example\nvar EncryptedPDFError = /** @class */ (function (_super) {\n __extends(EncryptedPDFError, _super);\n function EncryptedPDFError() {\n var _this = this;\n var msg = 'Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return EncryptedPDFError;\n}(Error));\nexport { EncryptedPDFError };\n// TODO: Include link to documentation with example\nvar FontkitNotRegisteredError = /** @class */ (function (_super) {\n __extends(FontkitNotRegisteredError, _super);\n function FontkitNotRegisteredError() {\n var _this = this;\n var msg = 'Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return FontkitNotRegisteredError;\n}(Error));\nexport { FontkitNotRegisteredError };\n// TODO: Include link to documentation with example\nvar ForeignPageError = /** @class */ (function (_super) {\n __extends(ForeignPageError, _super);\n function ForeignPageError() {\n var _this = this;\n var msg = 'A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return ForeignPageError;\n}(Error));\nexport { ForeignPageError };\n// TODO: Include link to documentation with example\nvar RemovePageFromEmptyDocumentError = /** @class */ (function (_super) {\n __extends(RemovePageFromEmptyDocumentError, _super);\n function RemovePageFromEmptyDocumentError() {\n var _this = this;\n var msg = 'PDFDocument has no pages so `PDFDocument.removePage` cannot be called';\n _this = _super.call(this, msg) || this;\n return _this;\n }\n return RemovePageFromEmptyDocumentError;\n}(Error));\nexport { RemovePageFromEmptyDocumentError };\n//# sourceMappingURL=errors.js.map","// Originated from pdfkit Copyright (c) 2014 Devon Govett\n// https://github.com/foliojs/pdfkit/blob/1e62e6ffe24b378eb890df507a47610f4c4a7b24/lib/path.js\n// MIT LICENSE\n// Updated for pdf-lib & TypeScript by Jeremy Messenger\nimport { appendBezierCurve, appendQuadraticCurve, closePath, lineTo, moveTo, } from \"./operators\";\nvar cx = 0;\nvar cy = 0;\nvar px = 0;\nvar py = 0;\nvar sx = 0;\nvar sy = 0;\nvar parameters = new Map([\n ['A', 7],\n ['a', 7],\n ['C', 6],\n ['c', 6],\n ['H', 1],\n ['h', 1],\n ['L', 2],\n ['l', 2],\n ['M', 2],\n ['m', 2],\n ['Q', 4],\n ['q', 4],\n ['S', 4],\n ['s', 4],\n ['T', 2],\n ['t', 2],\n ['V', 1],\n ['v', 1],\n ['Z', 0],\n ['z', 0],\n]);\nvar parse = function (path) {\n var cmd;\n var ret = [];\n var args = [];\n var curArg = '';\n var foundDecimal = false;\n var params = 0;\n for (var _i = 0, path_1 = path; _i < path_1.length; _i++) {\n var c = path_1[_i];\n if (parameters.has(c)) {\n params = parameters.get(c);\n if (cmd) {\n // save existing command\n if (curArg.length > 0) {\n args[args.length] = +curArg;\n }\n ret[ret.length] = { cmd: cmd, args: args };\n args = [];\n curArg = '';\n foundDecimal = false;\n }\n cmd = c;\n }\n else if ([' ', ','].includes(c) ||\n (c === '-' && curArg.length > 0 && curArg[curArg.length - 1] !== 'e') ||\n (c === '.' && foundDecimal)) {\n if (curArg.length === 0) {\n continue;\n }\n if (args.length === params) {\n // handle reused commands\n ret[ret.length] = { cmd: cmd, args: args };\n args = [+curArg];\n // handle assumed commands\n if (cmd === 'M') {\n cmd = 'L';\n }\n if (cmd === 'm') {\n cmd = 'l';\n }\n }\n else {\n args[args.length] = +curArg;\n }\n foundDecimal = c === '.';\n // fix for negative numbers or repeated decimals with no delimeter between commands\n curArg = ['-', '.'].includes(c) ? c : '';\n }\n else {\n curArg += c;\n if (c === '.') {\n foundDecimal = true;\n }\n }\n }\n // add the last command\n if (curArg.length > 0) {\n if (args.length === params) {\n // handle reused commands\n ret[ret.length] = { cmd: cmd, args: args };\n args = [+curArg];\n // handle assumed commands\n if (cmd === 'M') {\n cmd = 'L';\n }\n if (cmd === 'm') {\n cmd = 'l';\n }\n }\n else {\n args[args.length] = +curArg;\n }\n }\n ret[ret.length] = { cmd: cmd, args: args };\n return ret;\n};\nvar apply = function (commands) {\n // current point, control point, and subpath starting point\n cx = cy = px = py = sx = sy = 0;\n // run the commands\n var cmds = [];\n for (var i = 0; i < commands.length; i++) {\n var c = commands[i];\n if (c.cmd && typeof runners[c.cmd] === 'function') {\n var cmd = runners[c.cmd](c.args);\n if (Array.isArray(cmd)) {\n cmds = cmds.concat(cmd);\n }\n else {\n cmds.push(cmd);\n }\n }\n }\n return cmds;\n};\nvar runners = {\n M: function (a) {\n cx = a[0];\n cy = a[1];\n px = py = null;\n sx = cx;\n sy = cy;\n return moveTo(cx, cy);\n },\n m: function (a) {\n cx += a[0];\n cy += a[1];\n px = py = null;\n sx = cx;\n sy = cy;\n return moveTo(cx, cy);\n },\n C: function (a) {\n cx = a[4];\n cy = a[5];\n px = a[2];\n py = a[3];\n return appendBezierCurve(a[0], a[1], a[2], a[3], a[4], a[5]);\n },\n c: function (a) {\n var cmd = appendBezierCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy);\n px = cx + a[2];\n py = cy + a[3];\n cx += a[4];\n cy += a[5];\n return cmd;\n },\n S: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]);\n px = a[0];\n py = a[1];\n cx = a[2];\n cy = a[3];\n return cmd;\n },\n s: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n var cmd = appendBezierCurve(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]);\n px = cx + a[0];\n py = cy + a[1];\n cx += a[2];\n cy += a[3];\n return cmd;\n },\n Q: function (a) {\n px = a[0];\n py = a[1];\n cx = a[2];\n cy = a[3];\n return appendQuadraticCurve(a[0], a[1], cx, cy);\n },\n q: function (a) {\n var cmd = appendQuadraticCurve(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy);\n px = cx + a[0];\n py = cy + a[1];\n cx += a[2];\n cy += a[3];\n return cmd;\n },\n T: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n else {\n px = cx - (px - cx);\n py = cy - (py - cy);\n }\n var cmd = appendQuadraticCurve(px, py, a[0], a[1]);\n px = cx - (px - cx);\n py = cy - (py - cy);\n cx = a[0];\n cy = a[1];\n return cmd;\n },\n t: function (a) {\n if (px === null || py === null) {\n px = cx;\n py = cy;\n }\n else {\n px = cx - (px - cx);\n py = cy - (py - cy);\n }\n var cmd = appendQuadraticCurve(px, py, cx + a[0], cy + a[1]);\n cx += a[0];\n cy += a[1];\n return cmd;\n },\n A: function (a) {\n var cmds = solveArc(cx, cy, a);\n cx = a[5];\n cy = a[6];\n return cmds;\n },\n a: function (a) {\n a[5] += cx;\n a[6] += cy;\n var cmds = solveArc(cx, cy, a);\n cx = a[5];\n cy = a[6];\n return cmds;\n },\n L: function (a) {\n cx = a[0];\n cy = a[1];\n px = py = null;\n return lineTo(cx, cy);\n },\n l: function (a) {\n cx += a[0];\n cy += a[1];\n px = py = null;\n return lineTo(cx, cy);\n },\n H: function (a) {\n cx = a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n h: function (a) {\n cx += a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n V: function (a) {\n cy = a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n v: function (a) {\n cy += a[0];\n px = py = null;\n return lineTo(cx, cy);\n },\n Z: function () {\n var cmd = closePath();\n cx = sx;\n cy = sy;\n return cmd;\n },\n z: function () {\n var cmd = closePath();\n cx = sx;\n cy = sy;\n return cmd;\n },\n};\nvar solveArc = function (x, y, coords) {\n var rx = coords[0], ry = coords[1], rot = coords[2], large = coords[3], sweep = coords[4], ex = coords[5], ey = coords[6];\n var segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y);\n var cmds = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var bez = segmentToBezier.apply(void 0, seg);\n cmds.push(appendBezierCurve.apply(void 0, bez));\n }\n return cmds;\n};\n// from Inkscape svgtopdf, thanks!\nvar arcToSegments = function (x, y, rx, ry, large, sweep, rotateX, ox, oy) {\n var th = rotateX * (Math.PI / 180);\n var sinTh = Math.sin(th);\n var cosTh = Math.cos(th);\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n px = cosTh * (ox - x) * 0.5 + sinTh * (oy - y) * 0.5;\n py = cosTh * (oy - y) * 0.5 - sinTh * (ox - x) * 0.5;\n var pl = (px * px) / (rx * rx) + (py * py) / (ry * ry);\n if (pl > 1) {\n pl = Math.sqrt(pl);\n rx *= pl;\n ry *= pl;\n }\n var a00 = cosTh / rx;\n var a01 = sinTh / rx;\n var a10 = -sinTh / ry;\n var a11 = cosTh / ry;\n var x0 = a00 * ox + a01 * oy;\n var y0 = a10 * ox + a11 * oy;\n var x1 = a00 * x + a01 * y;\n var y1 = a10 * x + a11 * y;\n var d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);\n var sfactorSq = 1 / d - 0.25;\n if (sfactorSq < 0) {\n sfactorSq = 0;\n }\n var sfactor = Math.sqrt(sfactorSq);\n if (sweep === large) {\n sfactor = -sfactor;\n }\n var xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);\n var yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);\n var th0 = Math.atan2(y0 - yc, x0 - xc);\n var th1 = Math.atan2(y1 - yc, x1 - xc);\n var thArc = th1 - th0;\n if (thArc < 0 && sweep === 1) {\n thArc += 2 * Math.PI;\n }\n else if (thArc > 0 && sweep === 0) {\n thArc -= 2 * Math.PI;\n }\n var segments = Math.ceil(Math.abs(thArc / (Math.PI * 0.5 + 0.001)));\n var result = [];\n for (var i = 0; i < segments; i++) {\n var th2 = th0 + (i * thArc) / segments;\n var th3 = th0 + ((i + 1) * thArc) / segments;\n result[i] = [xc, yc, th2, th3, rx, ry, sinTh, cosTh];\n }\n return result;\n};\nvar segmentToBezier = function (cx1, cy1, th0, th1, rx, ry, sinTh, cosTh) {\n var a00 = cosTh * rx;\n var a01 = -sinTh * ry;\n var a10 = sinTh * rx;\n var a11 = cosTh * ry;\n var thHalf = 0.5 * (th1 - th0);\n var t = ((8 / 3) * Math.sin(thHalf * 0.5) * Math.sin(thHalf * 0.5)) /\n Math.sin(thHalf);\n var x1 = cx1 + Math.cos(th0) - t * Math.sin(th0);\n var y1 = cy1 + Math.sin(th0) + t * Math.cos(th0);\n var x3 = cx1 + Math.cos(th1);\n var y3 = cy1 + Math.sin(th1);\n var x2 = x3 + t * Math.sin(th1);\n var y2 = y3 - t * Math.cos(th1);\n var result = [\n a00 * x1 + a01 * y1,\n a10 * x1 + a11 * y1,\n a00 * x2 + a01 * y2,\n a10 * x2 + a11 * y2,\n a00 * x3 + a01 * y3,\n a10 * x3 + a11 * y3,\n ];\n return result;\n};\nexport var svgPathToOperators = function (path) { return apply(parse(path)); };\n//# sourceMappingURL=svgPath.js.map","import { __spreadArrays } from \"tslib\";\nimport { setFillingColor, setStrokingColor } from \"./colors\";\nimport { asNumber } from \"./objects\";\nimport { appendBezierCurve, beginText, closePath, drawObject, endText, fill, fillAndStroke, lineTo, moveTo, nextLine, popGraphicsState, pushGraphicsState, rotateAndSkewTextRadiansAndTranslate, rotateRadians, scale, setFontAndSize, setLineHeight, setLineWidth, showText, skewRadians, stroke, translate, } from \"./operators\";\nimport { toRadians } from \"./rotations\";\nimport { svgPathToOperators } from \"./svgPath\";\nexport var drawText = function (line, options) { return [\n beginText(),\n setFillingColor(options.color),\n setFontAndSize(options.font, options.size),\n rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y),\n showText(line),\n endText(),\n]; };\nexport var drawLinesOfText = function (lines, options) {\n var operators = [\n beginText(),\n setFillingColor(options.color),\n setFontAndSize(options.font, options.size),\n setLineHeight(options.lineHeight),\n rotateAndSkewTextRadiansAndTranslate(toRadians(options.rotate), toRadians(options.xSkew), toRadians(options.ySkew), options.x, options.y),\n ];\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n operators.push(showText(lines[idx]), nextLine());\n }\n operators.push(endText());\n return operators;\n};\nexport var drawImage = function (name, options) { return [\n pushGraphicsState(),\n translate(options.x, options.y),\n rotateRadians(toRadians(options.rotate)),\n scale(options.width, options.height),\n skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),\n drawObject(name),\n popGraphicsState(),\n]; };\nexport var drawPage = function (name, options) { return [\n pushGraphicsState(),\n translate(options.x, options.y),\n rotateRadians(toRadians(options.rotate)),\n scale(options.xScale, options.yScale),\n skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),\n drawObject(name),\n popGraphicsState(),\n]; };\nexport var drawLine = function (options) {\n return [\n pushGraphicsState(),\n options.color && setStrokingColor(options.color),\n setLineWidth(options.thickness),\n moveTo(options.start.x, options.start.y),\n lineTo(options.end.x, options.end.y),\n stroke(),\n popGraphicsState(),\n ].filter(Boolean);\n};\nexport var drawRectangle = function (options) {\n return [\n pushGraphicsState(),\n options.color && setFillingColor(options.color),\n options.borderColor && setStrokingColor(options.borderColor),\n setLineWidth(options.borderWidth),\n translate(options.x, options.y),\n rotateRadians(toRadians(options.rotate)),\n skewRadians(toRadians(options.xSkew), toRadians(options.ySkew)),\n moveTo(0, 0),\n lineTo(0, options.height),\n lineTo(options.width, options.height),\n lineTo(options.width, 0),\n closePath(),\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke()\n : options.color ? fill()\n : options.borderColor ? stroke()\n : closePath(),\n popGraphicsState(),\n ].filter(Boolean);\n};\nvar KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0);\nexport var drawEllipsePath = function (config) {\n var x = asNumber(config.x);\n var y = asNumber(config.y);\n var xScale = asNumber(config.xScale);\n var yScale = asNumber(config.yScale);\n x -= xScale;\n y -= yScale;\n var ox = xScale * KAPPA;\n var oy = yScale * KAPPA;\n var xe = x + xScale * 2;\n var ye = y + yScale * 2;\n var xm = x + xScale;\n var ym = y + yScale;\n return [\n pushGraphicsState(),\n moveTo(x, ym),\n appendBezierCurve(x, ym - oy, xm - ox, y, xm, y),\n appendBezierCurve(xm + ox, y, xe, ym - oy, xe, ym),\n appendBezierCurve(xe, ym + oy, xm + ox, ye, xm, ye),\n appendBezierCurve(xm - ox, ye, x, ym + oy, x, ym),\n popGraphicsState(),\n ];\n};\nexport var drawEllipse = function (options) {\n return __spreadArrays([\n pushGraphicsState(),\n options.color && setFillingColor(options.color),\n options.borderColor && setStrokingColor(options.borderColor),\n setLineWidth(options.borderWidth)\n ], drawEllipsePath({\n x: options.x,\n y: options.y,\n xScale: options.xScale,\n yScale: options.yScale,\n }), [\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke()\n : options.color ? fill()\n : options.borderColor ? stroke()\n : closePath(),\n popGraphicsState(),\n ]).filter(Boolean);\n};\nexport var drawSvgPath = function (path, options) {\n return __spreadArrays([\n pushGraphicsState(),\n translate(options.x, options.y),\n // SVG path Y axis is opposite pdf-lib's\n options.scale ? scale(options.scale, -options.scale) : scale(1, -1),\n options.color && setFillingColor(options.color),\n options.borderColor && setStrokingColor(options.borderColor),\n options.borderWidth && setLineWidth(options.borderWidth)\n ], svgPathToOperators(path), [\n // prettier-ignore\n options.color && options.borderWidth ? fillAndStroke()\n : options.color ? fill()\n : options.borderColor ? stroke()\n : closePath(),\n popGraphicsState(),\n ]).filter(Boolean);\n};\n//# sourceMappingURL=operations.js.map","export var PageSizes = {\n '4A0': [4767.87, 6740.79],\n '2A0': [3370.39, 4767.87],\n A0: [2383.94, 3370.39],\n A1: [1683.78, 2383.94],\n A2: [1190.55, 1683.78],\n A3: [841.89, 1190.55],\n A4: [595.28, 841.89],\n A5: [419.53, 595.28],\n A6: [297.64, 419.53],\n A7: [209.76, 297.64],\n A8: [147.4, 209.76],\n A9: [104.88, 147.4],\n A10: [73.7, 104.88],\n B0: [2834.65, 4008.19],\n B1: [2004.09, 2834.65],\n B2: [1417.32, 2004.09],\n B3: [1000.63, 1417.32],\n B4: [708.66, 1000.63],\n B5: [498.9, 708.66],\n B6: [354.33, 498.9],\n B7: [249.45, 354.33],\n B8: [175.75, 249.45],\n B9: [124.72, 175.75],\n B10: [87.87, 124.72],\n C0: [2599.37, 3676.54],\n C1: [1836.85, 2599.37],\n C2: [1298.27, 1836.85],\n C3: [918.43, 1298.27],\n C4: [649.13, 918.43],\n C5: [459.21, 649.13],\n C6: [323.15, 459.21],\n C7: [229.61, 323.15],\n C8: [161.57, 229.61],\n C9: [113.39, 161.57],\n C10: [79.37, 113.39],\n RA0: [2437.8, 3458.27],\n RA1: [1729.13, 2437.8],\n RA2: [1218.9, 1729.13],\n RA3: [864.57, 1218.9],\n RA4: [609.45, 864.57],\n SRA0: [2551.18, 3628.35],\n SRA1: [1814.17, 2551.18],\n SRA2: [1275.59, 1814.17],\n SRA3: [907.09, 1275.59],\n SRA4: [637.8, 907.09],\n Executive: [521.86, 756.0],\n Folio: [612.0, 936.0],\n Legal: [612.0, 1008.0],\n Letter: [612.0, 792.0],\n Tabloid: [792.0, 1224.0],\n};\n//# sourceMappingURL=sizes.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { PDFPageEmbedder, PDFRef } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents a PDF page that has been embedded in a [[PDFDocument]].\n */\nvar PDFEmbeddedPage = /** @class */ (function () {\n function PDFEmbeddedPage(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [[PDFPageEmbedder, 'PDFPageEmbedder']]);\n this.ref = ref;\n this.doc = doc;\n this.width = embedder.width;\n this.height = embedder.height;\n this.embedder = embedder;\n }\n /**\n * Compute the width and height of this page after being scaled by the\n * given `factor`. For example:\n * ```js\n * embeddedPage.width // => 500\n * embeddedPage.height // => 250\n *\n * const scaled = embeddedPage.scale(0.5)\n * scaled.width // => 250\n * scaled.height // => 125\n * ```\n * This operation is often useful before drawing a page with\n * [[PDFPage.drawPage]] to compute the `width` and `height` options.\n * @param factor The factor by which this page should be scaled.\n * @returns The width and height of the page after being scaled.\n */\n PDFEmbeddedPage.prototype.scale = function (factor) {\n assertIs(factor, 'factor', ['number']);\n return { width: this.width * factor, height: this.height * factor };\n };\n /**\n * Get the width and height of this page. For example:\n * ```js\n * const { width, height } = embeddedPage.size()\n * ```\n * @returns The width and height of the page.\n */\n PDFEmbeddedPage.prototype.size = function () {\n return this.scale(1);\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all embeddable pages get embedded.\n *\n * Embed this embeddable page in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFEmbeddedPage.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedPdf]] and\n * > [[PDFDocument.embedPage]] methods, which will create instances of\n * > [[PDFEmbeddedPage]] for you.\n *\n * Create an instance of [[PDFEmbeddedPage]] from an existing ref and embedder\n *\n * @param ref The unique reference for this embedded page.\n * @param doc The document to which the embedded page will belong.\n * @param embedder The embedder that will be used to embed the page.\n */\n PDFEmbeddedPage.of = function (ref, doc, embedder) {\n return new PDFEmbeddedPage(ref, doc, embedder);\n };\n return PDFEmbeddedPage;\n}());\nexport default PDFEmbeddedPage;\n//# sourceMappingURL=PDFEmbeddedPage.js.map","import { __awaiter, __generator, __rest } from \"tslib\";\nimport { EncryptedPDFError, FontkitNotRegisteredError, ForeignPageError, RemovePageFromEmptyDocumentError, } from \"./errors\";\nimport PDFEmbeddedPage from \"./PDFEmbeddedPage\";\nimport PDFFont from \"./PDFFont\";\nimport PDFImage from \"./PDFImage\";\nimport PDFPage from \"./PDFPage\";\nimport { PageSizes } from \"./sizes\";\nimport { CustomFontEmbedder, CustomFontSubsetEmbedder, JpegEmbedder, PageEmbeddingMismatchedContextError, PDFCatalog, PDFContext, PDFDict, PDFHexString, PDFName, PDFObjectCopier, PDFPageEmbedder, PDFPageLeaf, PDFPageTree, PDFParser, PDFStreamWriter, PDFString, PDFWriter, PngEmbedder, StandardFontEmbedder, UnexpectedObjectTypeError, } from \"../core\";\nimport { assertIs, assertRange, Cache, canBeConvertedToUint8Array, encodeToBase64, isStandardFont, pluckIndices, range, toUint8Array, } from \"../utils\";\nexport var ParseSpeeds;\n(function (ParseSpeeds) {\n ParseSpeeds[ParseSpeeds[\"Fastest\"] = Infinity] = \"Fastest\";\n ParseSpeeds[ParseSpeeds[\"Fast\"] = 1500] = \"Fast\";\n ParseSpeeds[ParseSpeeds[\"Medium\"] = 500] = \"Medium\";\n ParseSpeeds[ParseSpeeds[\"Slow\"] = 100] = \"Slow\";\n})(ParseSpeeds || (ParseSpeeds = {}));\n/**\n * Represents a PDF document.\n */\nvar PDFDocument = /** @class */ (function () {\n function PDFDocument(context, ignoreEncryption, updateMetadata) {\n var _this = this;\n /** The default word breaks used in PDFPage.drawText */\n this.defaultWordBreaks = [' '];\n this.computePages = function () {\n var pages = [];\n _this.catalog.Pages().traverse(function (node, ref) {\n if (node instanceof PDFPageLeaf) {\n var page = _this.pageMap.get(node);\n if (!page) {\n page = PDFPage.of(node, ref, _this);\n _this.pageMap.set(node, page);\n }\n pages.push(page);\n }\n });\n return pages;\n };\n assertIs(context, 'context', [[PDFContext, 'PDFContext']]);\n assertIs(ignoreEncryption, 'ignoreEncryption', ['boolean']);\n this.context = context;\n this.catalog = context.lookup(context.trailerInfo.Root);\n this.isEncrypted = !!context.lookup(context.trailerInfo.Encrypt);\n this.pageCache = Cache.populatedBy(this.computePages);\n this.pageMap = new Map();\n this.fonts = [];\n this.images = [];\n this.embeddedPages = [];\n if (!ignoreEncryption && this.isEncrypted)\n throw new EncryptedPDFError();\n if (updateMetadata)\n this.updateInfoDict();\n }\n /**\n * Load an existing [[PDFDocument]]. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------ |\n * | `string` | A base64 encoded string (or data URI) containing a PDF |\n * | `Uint8Array` | The raw bytes of a PDF |\n * | `ArrayBuffer` | The raw bytes of a PDF |\n *\n * For example:\n * ```js\n * import { PDFD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EwCiUlRU9G'\n *\n * const dataUri = 'data:application/pdf;base64,' + base64\n *\n * const pdfDoc1 = await PDFDocument.load(base64)\n * const pdfDoc2 = await PDFDocument.load(dataUri)\n *\n * // pdf=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('with_update_sections.pdf')\n * const pdfDoc3 = await PDFDocument.load(uint8Array)\n *\n * // pdf=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/with_update_sections.pdf'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const pdfDoc4 = await PDFDocument.load(arrayBuffer)\n *\n * ```\n *\n * @param pdf The input data containing a PDF document.\n * @param options The options to be used when loading the document.\n * @returns Resolves with a document loaded from the input.\n */\n PDFDocument.load = function (pdf, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, ignoreEncryption, _b, parseSpeed, _c, throwOnInvalidObject, _d, updateMetadata, bytes, context;\n return __generator(this, function (_e) {\n switch (_e.label) {\n case 0:\n _a = options.ignoreEncryption, ignoreEncryption = _a === void 0 ? false : _a, _b = options.parseSpeed, parseSpeed = _b === void 0 ? ParseSpeeds.Slow : _b, _c = options.throwOnInvalidObject, throwOnInvalidObject = _c === void 0 ? false : _c, _d = options.updateMetadata, updateMetadata = _d === void 0 ? true : _d;\n assertIs(pdf, 'pdf', ['string', Uint8Array, ArrayBuffer]);\n assertIs(ignoreEncryption, 'ignoreEncryption', ['boolean']);\n assertIs(parseSpeed, 'parseSpeed', ['number']);\n assertIs(throwOnInvalidObject, 'throwOnInvalidObject', ['boolean']);\n bytes = toUint8Array(pdf);\n return [4 /*yield*/, PDFParser.forBytesWithOptions(bytes, parseSpeed, throwOnInvalidObject).parseDocument()];\n case 1:\n context = _e.sent();\n return [2 /*return*/, new PDFDocument(context, ignoreEncryption, updateMetadata)];\n }\n });\n });\n };\n /**\n * Create a new [[PDFDocument]].\n * @returns Resolves with the newly created document.\n */\n PDFDocument.create = function (options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, updateMetadata, context, pageTree, pageTreeRef, catalog;\n return __generator(this, function (_b) {\n _a = options.updateMetadata, updateMetadata = _a === void 0 ? true : _a;\n context = PDFContext.create();\n pageTree = PDFPageTree.withContext(context);\n pageTreeRef = context.register(pageTree);\n catalog = PDFCatalog.withContextAndPages(context, pageTreeRef);\n context.trailerInfo.Root = context.register(catalog);\n return [2 /*return*/, new PDFDocument(context, false, updateMetadata)];\n });\n });\n };\n /**\n * Register a fontkit instance. This must be done before custom fonts can\n * be embedded. See [here](https://github.com/Hopding/pdf-lib/tree/Rewrite#fontkit-installation)\n * for instructions on how to install and register a fontkit instance.\n *\n * > You do **not** need to call this method to embed standard fonts.\n *\n * @param fontkit The fontkit instance to be registered.\n */\n PDFDocument.prototype.registerFontkit = function (fontkit) {\n this.fontkit = fontkit;\n };\n /**\n * Get this document's title metadata. The title appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const title = pdfDoc.getTitle()\n * ```\n * @returns A string containing the title of this document, if it has one.\n */\n PDFDocument.prototype.getTitle = function () {\n var title = this.getInfoDict().lookup(PDFName.Title);\n if (!title)\n return undefined;\n assertIsLiteralOrHexString(title);\n return title.decodeText();\n };\n /**\n * Get this document's author metadata. The author appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const author = pdfDoc.getAuthor()\n * ```\n * @returns A string containing the author of this document, if it has one.\n */\n PDFDocument.prototype.getAuthor = function () {\n var author = this.getInfoDict().lookup(PDFName.Author);\n if (!author)\n return undefined;\n assertIsLiteralOrHexString(author);\n return author.decodeText();\n };\n /**\n * Get this document's subject metadata. The subject appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const subject = pdfDoc.getSubject()\n * ```\n * @returns A string containing the subject of this document, if it has one.\n */\n PDFDocument.prototype.getSubject = function () {\n var subject = this.getInfoDict().lookup(PDFName.Subject);\n if (!subject)\n return undefined;\n assertIsLiteralOrHexString(subject);\n return subject.decodeText();\n };\n /**\n * Get this document's keywords metadata. The keywords appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const keywords = pdfDoc.getKeywords()\n * ```\n * @returns A string containing the keywords of this document, if it has any.\n */\n PDFDocument.prototype.getKeywords = function () {\n var keywords = this.getInfoDict().lookup(PDFName.Keywords);\n if (!keywords)\n return undefined;\n assertIsLiteralOrHexString(keywords);\n return keywords.decodeText();\n };\n /**\n * Get this document's creator metadata. The creator appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const creator = pdfDoc.getCreator()\n * ```\n * @returns A string containing the creator of this document, if it has one.\n */\n PDFDocument.prototype.getCreator = function () {\n var creator = this.getInfoDict().lookup(PDFName.Creator);\n if (!creator)\n return undefined;\n assertIsLiteralOrHexString(creator);\n return creator.decodeText();\n };\n /**\n * Get this document's producer metadata. The producer appears in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const producer = pdfDoc.getProducer()\n * ```\n * @returns A string containing the producer of this document, if it has one.\n */\n PDFDocument.prototype.getProducer = function () {\n var producer = this.getInfoDict().lookup(PDFName.Producer);\n if (!producer)\n return undefined;\n assertIsLiteralOrHexString(producer);\n return producer.decodeText();\n };\n /**\n * Get this document's creation date metadata. The creation date appears in\n * the \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * const creationDate = pdfDoc.getCreationDate()\n * ```\n * @returns A Date containing the creation date of this document,\n * if it has one.\n */\n PDFDocument.prototype.getCreationDate = function () {\n var creationDate = this.getInfoDict().lookup(PDFName.CreationDate);\n if (!creationDate)\n return undefined;\n assertIsLiteralOrHexString(creationDate);\n return creationDate.decodeDate();\n };\n /**\n * Get this document's modification date metadata. The modification date\n * appears in the \"Document Properties\" section of most PDF readers.\n * For example:\n * ```js\n * const modification = pdfDoc.getModificationDate()\n * ```\n * @returns A Date containing the modification date of this document,\n * if it has one.\n */\n PDFDocument.prototype.getModificationDate = function () {\n var modificationDate = this.getInfoDict().lookup(PDFName.ModDate);\n if (!modificationDate)\n return undefined;\n assertIsLiteralOrHexString(modificationDate);\n return modificationDate.decodeDate();\n };\n /**\n * Set this document's title metadata. The title will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setTitle('🥚 The Life of an Egg 🍳')\n * ```\n * @param title The title of this document.\n */\n PDFDocument.prototype.setTitle = function (title) {\n assertIs(title, 'title', ['string']);\n var key = PDFName.of('Title');\n this.getInfoDict().set(key, PDFHexString.fromText(title));\n };\n /**\n * Set this document's author metadata. The author will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setAuthor('Humpty Dumpty')\n * ```\n * @param author The author of this document.\n */\n PDFDocument.prototype.setAuthor = function (author) {\n assertIs(author, 'author', ['string']);\n var key = PDFName.of('Author');\n this.getInfoDict().set(key, PDFHexString.fromText(author));\n };\n /**\n * Set this document's subject metadata. The subject will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setSubject('📘 An Epic Tale of Woe 📖')\n * ```\n * @param subject The subject of this document.\n */\n PDFDocument.prototype.setSubject = function (subject) {\n assertIs(subject, 'author', ['string']);\n var key = PDFName.of('Subject');\n this.getInfoDict().set(key, PDFHexString.fromText(subject));\n };\n /**\n * Set this document's keyword metadata. These keywords will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setKeywords(['eggs', 'wall', 'fall', 'king', 'horses', 'men'])\n * ```\n * @param keywords An array of keywords associated with this document.\n */\n PDFDocument.prototype.setKeywords = function (keywords) {\n assertIs(keywords, 'keywords', [Array]);\n var key = PDFName.of('Keywords');\n this.getInfoDict().set(key, PDFHexString.fromText(keywords.join(' ')));\n };\n /**\n * Set this document's creator metadata. The creator will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setCreator('PDF App 9000 🤖')\n * ```\n * @param creator The creator of this document.\n */\n PDFDocument.prototype.setCreator = function (creator) {\n assertIs(creator, 'creator', ['string']);\n var key = PDFName.of('Creator');\n this.getInfoDict().set(key, PDFHexString.fromText(creator));\n };\n /**\n * Set this document's producer metadata. The producer will appear in the\n * \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setProducer('PDF App 9000 🤖')\n * ```\n * @param producer The producer of this document.\n */\n PDFDocument.prototype.setProducer = function (producer) {\n assertIs(producer, 'creator', ['string']);\n var key = PDFName.of('Producer');\n this.getInfoDict().set(key, PDFHexString.fromText(producer));\n };\n /**\n * Set this document's language metadata. The language will appear in the\n * \"Document Properties\" section of some PDF readers. For example:\n * ```js\n * pdfDoc.setLanguage('en-us')\n * ```\n *\n * @param language An RFC 3066 _Language-Tag_ denoting the language of this\n * document, or an empty string if the language is unknown.\n */\n PDFDocument.prototype.setLanguage = function (language) {\n assertIs(language, 'language', ['string']);\n var key = PDFName.of('Lang');\n this.catalog.set(key, PDFString.of(language));\n };\n /**\n * Set this document's creation date metadata. The creation date will appear\n * in the \"Document Properties\" section of most PDF readers. For example:\n * ```js\n * pdfDoc.setCreationDate(new Date())\n * ```\n * @param creationDate The date this document was created.\n */\n PDFDocument.prototype.setCreationDate = function (creationDate) {\n assertIs(creationDate, 'creationDate', [[Date, 'Date']]);\n var key = PDFName.of('CreationDate');\n this.getInfoDict().set(key, PDFString.fromDate(creationDate));\n };\n /**\n * Set this document's modification date metadata. The modification date will\n * appear in the \"Document Properties\" section of most PDF readers. For\n * example:\n * ```js\n * pdfDoc.setModificationDate(new Date())\n * ```\n * @param modificationDate The date this document was last modified.\n */\n PDFDocument.prototype.setModificationDate = function (modificationDate) {\n assertIs(modificationDate, 'modificationDate', [[Date, 'Date']]);\n var key = PDFName.of('ModDate');\n this.getInfoDict().set(key, PDFString.fromDate(modificationDate));\n };\n /**\n * Get the number of pages contained in this document. For example:\n * ```js\n * const totalPages = pdfDoc.getPageCount()\n * ```\n * @returns The number of pages in this document.\n */\n PDFDocument.prototype.getPageCount = function () {\n if (this.pageCount === undefined)\n this.pageCount = this.getPages().length;\n return this.pageCount;\n };\n /**\n * Get an array of all the pages contained in this document. The pages are\n * stored in the array in the same order that they are rendered in the\n * document. For example:\n * ```js\n * const pages = pdfDoc.getPages()\n * pages[0] // The first page of the document\n * pages[2] // The third page of the document\n * pages[197] // The 198th page of the document\n * ```\n * @returns An array of all the pages contained in this document.\n */\n PDFDocument.prototype.getPages = function () {\n return this.pageCache.access();\n };\n /**\n * Get the page rendered at a particular `index` of the document. For example:\n * ```js\n * pdfDoc.getPage(0) // The first page of the document\n * pdfDoc.getPage(2) // The third page of the document\n * pdfDoc.getPage(197) // The 198th page of the document\n * ```\n * @returns The [[PDFPage]] rendered at the given `index` of the document.\n */\n PDFDocument.prototype.getPage = function (index) {\n var pages = this.getPages();\n assertRange(index, 'index', 0, pages.length - 1);\n return pages[index];\n };\n /**\n * Get an array of indices for all the pages contained in this document. The\n * array will contain a range of integers from\n * `0..pdfDoc.getPageCount() - 1`. For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n * pdfDoc.addPage()\n * pdfDoc.addPage()\n * pdfDoc.addPage()\n *\n * const indices = pdfDoc.getPageIndices()\n * indices // => [0, 1, 2]\n * ```\n * @returns An array of indices for all pages contained in this document.\n */\n PDFDocument.prototype.getPageIndices = function () {\n return range(0, this.getPageCount());\n };\n /**\n * Remove the page at a given index from this document. For example:\n * ```js\n * pdfDoc.removePage(0) // Remove the first page of the document\n * pdfDoc.removePage(2) // Remove the third page of the document\n * pdfDoc.removePage(197) // Remove the 198th page of the document\n * ```\n * Once a page has been removed, it will no longer be rendered at that index\n * in the document.\n * @param index The index of the page to be removed.\n */\n PDFDocument.prototype.removePage = function (index) {\n var pageCount = this.getPageCount();\n if (this.pageCount === 0)\n throw new RemovePageFromEmptyDocumentError();\n assertRange(index, 'index', 0, pageCount - 1);\n this.catalog.removeLeafNode(index);\n this.pageCount = pageCount - 1;\n };\n /**\n * Add a page to the end of this document. This method accepts three\n * different value types for the `page` parameter:\n *\n * | Type | Behavior |\n * | ------------------ | ----------------------------------------------------------------------------------- |\n * | `undefined` | Create a new page and add it to the end of this document |\n * | `[number, number]` | Create a new page with the given dimensions and add it to the end of this document |\n * | `PDFPage` | Add the existing page to the end of this document |\n *\n * For example:\n * ```js\n * // page=undefined\n * const newPage = pdfDoc.addPage()\n *\n * // page=[number, number]\n * import { PageSizes } from 'pdf-lib'\n * const newPage1 = pdfDoc.addPage(PageSizes.A7)\n * const newPage2 = pdfDoc.addPage(PageSizes.Letter)\n * const newPage3 = pdfDoc.addPage([500, 750])\n *\n * // page=PDFPage\n * const pdfDoc1 = await PDFDocument.create()\n * const pdfDoc2 = await PDFDocument.load(...)\n * const [existingPage] = await pdfDoc1.copyPages(pdfDoc2, [0])\n * pdfDoc1.addPage(existingPage)\n * ```\n *\n * @param page Optionally, the desired dimensions or existing page.\n * @returns The newly created (or existing) page.\n */\n PDFDocument.prototype.addPage = function (page) {\n assertIs(page, 'page', ['undefined', [PDFPage, 'PDFPage'], Array]);\n return this.insertPage(this.getPageCount(), page);\n };\n /**\n * Insert a page at a given index within this document. This method accepts\n * three different value types for the `page` parameter:\n *\n * | Type | Behavior |\n * | ------------------ | ------------------------------------------------------------------------------ |\n * | `undefined` | Create a new page and insert it into this document |\n * | `[number, number]` | Create a new page with the given dimensions and insert it into this document |\n * | `PDFPage` | Insert the existing page into this document |\n *\n * For example:\n * ```js\n * // page=undefined\n * const newPage = pdfDoc.insertPage(2)\n *\n * // page=[number, number]\n * import { PageSizes } from 'pdf-lib'\n * const newPage1 = pdfDoc.insertPage(2, PageSizes.A7)\n * const newPage2 = pdfDoc.insertPage(0, PageSizes.Letter)\n * const newPage3 = pdfDoc.insertPage(198, [500, 750])\n *\n * // page=PDFPage\n * const pdfDoc1 = await PDFDocument.create()\n * const pdfDoc2 = await PDFDocument.load(...)\n * const [existingPage] = await pdfDoc1.copyPages(pdfDoc2, [0])\n * pdfDoc1.insertPage(0, existingPage)\n * ```\n *\n * @param index The index at which the page should be inserted (zero-based).\n * @param page Optionally, the desired dimensions or existing page.\n * @returns The newly created (or existing) page.\n */\n PDFDocument.prototype.insertPage = function (index, page) {\n var pageCount = this.getPageCount();\n assertRange(index, 'index', 0, pageCount);\n assertIs(page, 'page', ['undefined', [PDFPage, 'PDFPage'], Array]);\n if (!page || Array.isArray(page)) {\n var dims = Array.isArray(page) ? page : PageSizes.A4;\n page = PDFPage.create(this);\n page.setSize.apply(page, dims);\n }\n else if (page.doc !== this) {\n throw new ForeignPageError();\n }\n var parentRef = this.catalog.insertLeafNode(page.ref, index);\n page.node.setParent(parentRef);\n this.pageMap.set(page.node, page);\n this.pageCache.invalidate();\n this.pageCount = pageCount + 1;\n return page;\n };\n /**\n * Copy pages from a source document into this document. Allows pages to be\n * copied between different [[PDFDocument]] instances. For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n * const srcDoc = await PDFDocument.load(...)\n *\n * const copiedPages = await pdfDoc.copyPages(srcDoc, [0, 3, 89])\n * const [firstPage, fourthPage, ninetiethPage] = copiedPages;\n *\n * pdfDoc.addPage(fourthPage)\n * pdfDoc.insertPage(0, ninetiethPage)\n * pdfDoc.addPage(firstPage)\n * ```\n * @param srcDoc The document from which pages should be copied.\n * @param indices The indices of the pages that should be copied.\n * @returns Resolves with an array of pages copied into this document.\n */\n PDFDocument.prototype.copyPages = function (srcDoc, indices) {\n return __awaiter(this, void 0, void 0, function () {\n var copier, srcPages, copiedPages, idx, len, srcPage, copiedPage, ref;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(srcDoc, 'srcDoc', [[PDFDocument, 'PDFDocument']]);\n assertIs(indices, 'indices', [Array]);\n return [4 /*yield*/, srcDoc.flush()];\n case 1:\n _a.sent();\n copier = PDFObjectCopier.for(srcDoc.context, this.context);\n srcPages = srcDoc.getPages();\n copiedPages = new Array(indices.length);\n for (idx = 0, len = indices.length; idx < len; idx++) {\n srcPage = srcPages[indices[idx]];\n copiedPage = copier.copy(srcPage.node);\n ref = this.context.register(copiedPage);\n copiedPages[idx] = PDFPage.of(copiedPage, ref, this);\n }\n return [2 /*return*/, copiedPages];\n }\n });\n });\n };\n /**\n * Embed a font into this document. The input data can be provided in multiple\n * formats:\n *\n * | Type | Contents |\n * | --------------- | ------------------------------------------------------- |\n * | `StandardFonts` | One of the standard 14 fonts |\n * | `string` | A base64 encoded string (or data URI) containing a font |\n * | `Uint8Array` | The raw bytes of a font |\n * | `ArrayBuffer` | The raw bytes of a font |\n *\n * For example:\n * ```js\n * // font=StandardFonts\n * import { StandardFonts } from 'pdf-lib'\n * const font1 = await pdfDoc.embedFont(StandardFonts.Helvetica)\n *\n * // font=string\n * const font2 = await pdfDoc.embedFont('AAEAAAAVAQAABABQRFNJRx/upe...')\n * const font3 = await pdfDoc.embedFont('data:font/opentype;base64,AAEAAA...')\n *\n * // font=Uint8Array\n * import fs from 'fs'\n * const font4 = await pdfDoc.embedFont(fs.readFileSync('Ubuntu-R.ttf'))\n *\n * // font=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/ubuntu/Ubuntu-R.ttf'\n * const ubuntuBytes = await fetch(url).then(res => res.arrayBuffer())\n * const font5 = await pdfDoc.embedFont(ubuntuBytes)\n * ```\n * See also: [[registerFontkit]]\n * @param font The input data for a font.\n * @param options The options to be used when embedding the font.\n * @returns Resolves with the embedded font.\n */\n PDFDocument.prototype.embedFont = function (font, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, subset, embedder, bytes, fontkit, _b, ref, pdfFont;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = options.subset, subset = _a === void 0 ? false : _a;\n assertIs(font, 'font', ['string', Uint8Array, ArrayBuffer]);\n assertIs(subset, 'subset', ['boolean']);\n if (!isStandardFont(font)) return [3 /*break*/, 1];\n embedder = StandardFontEmbedder.for(font);\n return [3 /*break*/, 7];\n case 1:\n if (!canBeConvertedToUint8Array(font)) return [3 /*break*/, 6];\n bytes = toUint8Array(font);\n fontkit = this.assertFontkit();\n if (!subset) return [3 /*break*/, 3];\n return [4 /*yield*/, CustomFontSubsetEmbedder.for(fontkit, bytes)];\n case 2:\n _b = _c.sent();\n return [3 /*break*/, 5];\n case 3: return [4 /*yield*/, CustomFontEmbedder.for(fontkit, bytes)];\n case 4:\n _b = _c.sent();\n _c.label = 5;\n case 5:\n embedder = _b;\n return [3 /*break*/, 7];\n case 6: throw new TypeError('`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`');\n case 7:\n ref = this.context.nextRef();\n pdfFont = PDFFont.of(ref, this, embedder);\n this.fonts.push(pdfFont);\n return [2 /*return*/, pdfFont];\n }\n });\n });\n };\n /**\n * Embed a standard font into this document.\n * For example:\n * ```js\n * import { StandardFonts } from 'pdf-lib'\n * const helveticaFont = pdfDoc.embedFont(StandardFonts.Helvetica)\n * ```\n * @param font The standard font to be embedded.\n * @returns The embedded font.\n */\n PDFDocument.prototype.embedStandardFont = function (font) {\n assertIs(font, 'font', ['string']);\n if (!isStandardFont(font)) {\n throw new TypeError('`font` must be one of type `StandardFontsr`');\n }\n var embedder = StandardFontEmbedder.for(font);\n var ref = this.context.nextRef();\n var pdfFont = PDFFont.of(ref, this, embedder);\n this.fonts.push(pdfFont);\n return pdfFont;\n };\n /**\n * Embed a JPEG image into this document. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------------- |\n * | `string` | A base64 encoded string (or data URI) containing a JPEG image |\n * | `Uint8Array` | The raw bytes of a JPEG image |\n * | `ArrayBuffer` | The raw bytes of a JPEG image |\n *\n * For example:\n * ```js\n * // jpg=string\n * const image1 = await pdfDoc.embedJpg('/9j/4AAQSkZJRgABAQAAAQABAAD/2wBD...')\n * const image2 = await pdfDoc.embedJpg('data:image/jpeg;base64,/9j/4AAQ...')\n *\n * // jpg=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('cat_riding_unicorn.jpg')\n * const image3 = await pdfDoc.embedJpg(uint8Array)\n *\n * // jpg=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const image4 = await pdfDoc.embedJpg(arrayBuffer)\n * ```\n *\n * @param jpg The input data for a JPEG image.\n * @returns Resolves with the embedded image.\n */\n PDFDocument.prototype.embedJpg = function (jpg) {\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, pdfImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(jpg, 'jpg', ['string', Uint8Array, ArrayBuffer]);\n bytes = toUint8Array(jpg);\n return [4 /*yield*/, JpegEmbedder.for(bytes)];\n case 1:\n embedder = _a.sent();\n ref = this.context.nextRef();\n pdfImage = PDFImage.of(ref, this, embedder);\n this.images.push(pdfImage);\n return [2 /*return*/, pdfImage];\n }\n });\n });\n };\n /**\n * Embed a PNG image into this document. The input data can be provided in\n * multiple formats:\n *\n * | Type | Contents |\n * | ------------- | ------------------------------------------------------------ |\n * | `string` | A base64 encoded string (or data URI) containing a PNG image |\n * | `Uint8Array` | The raw bytes of a PNG image |\n * | `ArrayBuffer` | The raw bytes of a PNG image |\n *\n * For example:\n * ```js\n * // png=string\n * const image1 = await pdfDoc.embedPng('iVBORw0KGgoAAAANSUhEUgAAAlgAAAF3...')\n * const image2 = await pdfDoc.embedPng('data:image/png;base64,iVBORw0KGg...')\n *\n * // png=Uint8Array\n * import fs from 'fs'\n * const uint8Array = fs.readFileSync('small_mario.png')\n * const image3 = await pdfDoc.embedPng(uint8Array)\n *\n * // png=ArrayBuffer\n * const url = 'https://pdf-lib.js.org/assets/small_mario.png'\n * const arrayBuffer = await fetch(url).then(res => res.arrayBuffer())\n * const image4 = await pdfDoc.embedPng(arrayBuffer)\n * ```\n *\n * @param png The input data for a PNG image.\n * @returns Resolves with the embedded image.\n */\n PDFDocument.prototype.embedPng = function (png) {\n return __awaiter(this, void 0, void 0, function () {\n var bytes, embedder, ref, pdfImage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(png, 'png', ['string', Uint8Array, ArrayBuffer]);\n bytes = toUint8Array(png);\n return [4 /*yield*/, PngEmbedder.for(bytes)];\n case 1:\n embedder = _a.sent();\n ref = this.context.nextRef();\n pdfImage = PDFImage.of(ref, this, embedder);\n this.images.push(pdfImage);\n return [2 /*return*/, pdfImage];\n }\n });\n });\n };\n /**\n * Embed one or more PDF pages into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourcePdf = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n *\n * // Embed page 74 of `sourcePdf` into `pdfDoc`\n * const [embeddedPage] = await pdfDoc.embedPdf(sourcePdf, [73])\n * ```\n *\n * See [[PDFDocument.load]] for examples of the allowed input data formats.\n *\n * @param pdf The input data containing a PDF document.\n * @param indices The indices of the pages that should be embedded.\n * @returns Resolves with an array of the embedded pages.\n */\n PDFDocument.prototype.embedPdf = function (pdf, indices) {\n if (indices === void 0) { indices = [0]; }\n return __awaiter(this, void 0, void 0, function () {\n var srcDoc, _a, srcPages;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n assertIs(pdf, 'pdf', [\n 'string',\n Uint8Array,\n ArrayBuffer,\n [PDFDocument, 'PDFDocument'],\n ]);\n assertIs(indices, 'indices', [Array]);\n if (!(pdf instanceof PDFDocument)) return [3 /*break*/, 1];\n _a = pdf;\n return [3 /*break*/, 3];\n case 1: return [4 /*yield*/, PDFDocument.load(pdf)];\n case 2:\n _a = _b.sent();\n _b.label = 3;\n case 3:\n srcDoc = _a;\n srcPages = pluckIndices(srcDoc.getPages(), indices);\n return [2 /*return*/, this.embedPages(srcPages)];\n }\n });\n });\n };\n /**\n * Embed a single PDF page into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourceBuffer = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n * const sourcePdfDoc = await PDFDocument.load(sourceBuffer)\n * const sourcePdfPage = sourcePdfDoc.getPages()[73]\n *\n * const embeddedPage = await pdfDoc.embedPage(\n * sourcePdfPage,\n *\n * // Clip a section of the source page so that we only embed part of it\n * { left: 100, right: 450, bottom: 330, top: 570 },\n *\n * // Translate all drawings of the embedded page by (10, 200) units\n * [1, 0, 0, 1, 10, 200],\n * )\n * ```\n *\n * @param page The page to be embedded.\n * @param boundingBox\n * Optionally, an area of the source page that should be embedded\n * (defaults to entire page).\n * @param transformationMatrix\n * Optionally, a transformation matrix that is always applied to the embedded\n * page anywhere it is drawn.\n * @returns Resolves with the embedded pdf page.\n */\n PDFDocument.prototype.embedPage = function (page, boundingBox, transformationMatrix) {\n return __awaiter(this, void 0, void 0, function () {\n var embeddedPage;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n assertIs(page, 'page', [[PDFPage, 'PDFPage']]);\n return [4 /*yield*/, this.embedPages([page], [boundingBox], [transformationMatrix])];\n case 1:\n embeddedPage = (_a.sent())[0];\n return [2 /*return*/, embeddedPage];\n }\n });\n });\n };\n /**\n * Embed one or more PDF pages into this document.\n *\n * For example:\n * ```js\n * const pdfDoc = await PDFDocument.create()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourceBuffer = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n * const sourcePdfDoc = await PDFDocument.load(sourceBuffer)\n *\n * const page1 = sourcePdfDoc.getPages()[0]\n * const page2 = sourcePdfDoc.getPages()[52]\n * const page3 = sourcePdfDoc.getPages()[73]\n *\n * const embeddedPages = await pdfDoc.embedPages([page1, page2, page3])\n * ```\n *\n * @param page\n * The pages to be embedded (they must all share the same context).\n * @param boundingBoxes\n * Optionally, an array of clipping boundaries - one for each page\n * (defaults to entirety of each page).\n * @param transformationMatrices\n * Optionally, an array of transformation matrices - one for each page\n * (each page's transformation will apply anywhere it is drawn).\n * @returns Resolves with an array of the embedded pdf pages.\n */\n PDFDocument.prototype.embedPages = function (pages, boundingBoxes, transformationMatrices) {\n if (boundingBoxes === void 0) { boundingBoxes = []; }\n if (transformationMatrices === void 0) { transformationMatrices = []; }\n return __awaiter(this, void 0, void 0, function () {\n var idx, len, currPage, nextPage, context, maybeCopyPage, embeddedPages, idx, len, page, box, matrix, embedder, ref;\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (pages.length === 0)\n return [2 /*return*/, []];\n // Assert all pages have the same context\n for (idx = 0, len = pages.length - 1; idx < len; idx++) {\n currPage = pages[idx];\n nextPage = pages[idx + 1];\n if (currPage.node.context !== nextPage.node.context) {\n throw new PageEmbeddingMismatchedContextError();\n }\n }\n context = pages[0].node.context;\n maybeCopyPage = context === this.context\n ? function (p) { return p; }\n : PDFObjectCopier.for(context, this.context).copy;\n embeddedPages = new Array(pages.length);\n idx = 0, len = pages.length;\n _b.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n page = maybeCopyPage(pages[idx].node);\n box = boundingBoxes[idx];\n matrix = transformationMatrices[idx];\n return [4 /*yield*/, PDFPageEmbedder.for(page, box, matrix)];\n case 2:\n embedder = _b.sent();\n ref = this.context.nextRef();\n embeddedPages[idx] = PDFEmbeddedPage.of(ref, this, embedder);\n _b.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4:\n (_a = this.embeddedPages).push.apply(_a, embeddedPages);\n return [2 /*return*/, embeddedPages];\n }\n });\n });\n };\n /**\n * > **NOTE:** You shouldn't need to call this method directly. The [[save]]\n * > and [[saveAsBase64]] methods will automatically ensure that all embedded\n * > assets are flushed before serializing the document.\n *\n * Flush all embedded fonts, PDF pages, and images to this document's\n * [[context]].\n *\n * @returns Resolves when the flush is complete.\n */\n PDFDocument.prototype.flush = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.embedAll(this.fonts)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.images)];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.embedAll(this.embeddedPages)];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Serialize this document to an array of bytes making up a PDF file.\n * For example:\n * ```js\n * const pdfBytes = await pdfDoc.save()\n * ```\n *\n * There are a number of things you can do with the serialized document,\n * depending on the JavaScript environment you're running in:\n * * Write it to a file in Node or React Native\n * * Download it as a Blob in the browser\n * * Render it in an `iframe`\n *\n * @param options The options to be used when saving the document.\n * @returns Resolves with the bytes of the serialized document.\n */\n PDFDocument.prototype.save = function (options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, useObjectStreams, _b, addDefaultPage, _c, objectsPerTick, Writer;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n _a = options.useObjectStreams, useObjectStreams = _a === void 0 ? true : _a, _b = options.addDefaultPage, addDefaultPage = _b === void 0 ? true : _b, _c = options.objectsPerTick, objectsPerTick = _c === void 0 ? 50 : _c;\n assertIs(useObjectStreams, 'useObjectStreams', ['boolean']);\n assertIs(addDefaultPage, 'addDefaultPage', ['boolean']);\n assertIs(objectsPerTick, 'objectsPerTick', ['number']);\n if (addDefaultPage && this.getPageCount() === 0)\n this.addPage();\n return [4 /*yield*/, this.flush()];\n case 1:\n _d.sent();\n Writer = useObjectStreams ? PDFStreamWriter : PDFWriter;\n return [2 /*return*/, Writer.forContext(this.context, objectsPerTick).serializeToBuffer()];\n }\n });\n });\n };\n /**\n * Serialize this document to a base64 encoded string or data URI making up a\n * PDF file. For example:\n * ```js\n * const base64String = await pdfDoc.saveAsBase64()\n * base64String // => 'JVBERi0xLjcKJYGBgYEKC...'\n *\n * const base64DataUri = await pdfDoc.saveAsBase64({ dataUri: true })\n * base64DataUri // => 'data:application/pdf;base64,JVBERi0xLjcKJYGBgYEKC...'\n * ```\n *\n * @param options The options to be used when saving the document.\n * @returns Resolves with a base64 encoded string or data URI of the\n * serialized document.\n */\n PDFDocument.prototype.saveAsBase64 = function (options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, dataUri, otherOptions, bytes, base64;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = options.dataUri, dataUri = _a === void 0 ? false : _a, otherOptions = __rest(options, [\"dataUri\"]);\n assertIs(dataUri, 'dataUri', ['boolean']);\n return [4 /*yield*/, this.save(otherOptions)];\n case 1:\n bytes = _b.sent();\n base64 = encodeToBase64(bytes);\n return [2 /*return*/, dataUri ? \"data:application/pdf;base64,\" + base64 : base64];\n }\n });\n });\n };\n PDFDocument.prototype.embedAll = function (embeddables) {\n return __awaiter(this, void 0, void 0, function () {\n var idx, len;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n idx = 0, len = embeddables.length;\n _a.label = 1;\n case 1:\n if (!(idx < len)) return [3 /*break*/, 4];\n return [4 /*yield*/, embeddables[idx].embed()];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n idx++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n PDFDocument.prototype.updateInfoDict = function () {\n var pdfLib = \"pdf-lib (https://github.com/Hopding/pdf-lib)\";\n var now = new Date();\n var info = this.getInfoDict();\n this.setProducer(pdfLib);\n this.setModificationDate(now);\n if (!info.get(PDFName.of('Creator')))\n this.setCreator(pdfLib);\n if (!info.get(PDFName.of('CreationDate')))\n this.setCreationDate(now);\n };\n PDFDocument.prototype.getInfoDict = function () {\n var existingInfo = this.context.lookup(this.context.trailerInfo.Info);\n if (existingInfo instanceof PDFDict)\n return existingInfo;\n var newInfo = this.context.obj({});\n this.context.trailerInfo.Info = this.context.register(newInfo);\n return newInfo;\n };\n PDFDocument.prototype.assertFontkit = function () {\n if (!this.fontkit)\n throw new FontkitNotRegisteredError();\n return this.fontkit;\n };\n return PDFDocument;\n}());\nexport default PDFDocument;\n/* tslint:disable-next-line only-arrow-functions */\nfunction assertIsLiteralOrHexString(pdfObject) {\n if (!(pdfObject instanceof PDFHexString) &&\n !(pdfObject instanceof PDFString)) {\n throw new UnexpectedObjectTypeError([PDFHexString, PDFString], pdfObject);\n }\n}\n//# sourceMappingURL=PDFDocument.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { CustomFontEmbedder, PDFRef, StandardFontEmbedder, } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents a font that has been embedded in a [[PDFDocument]].\n */\nvar PDFFont = /** @class */ (function () {\n function PDFFont(ref, doc, embedder) {\n this.modified = true;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [\n [CustomFontEmbedder, 'CustomFontEmbedder'],\n [StandardFontEmbedder, 'StandardFontEmbedder'],\n ]);\n this.ref = ref;\n this.doc = doc;\n this.name = embedder.fontName;\n this.embedder = embedder;\n }\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFPage.drawText]] method will automatically encode the text it is\n * > given.\n *\n * Encodes a string of text in this font.\n *\n * @param text The text to be encoded.\n * @returns The encoded text as a hex string.\n */\n PDFFont.prototype.encodeText = function (text) {\n assertIs(text, 'text', ['string']);\n this.modified = true;\n return this.embedder.encodeText(text);\n };\n /**\n * Measure the width of a string of text drawn in this font at a given size.\n * For example:\n * ```js\n * const width = font.widthOfTextAtSize('Foo Bar Qux Baz', 36)\n * ```\n * @param text The string of text to be measured.\n * @param size The font size to be used for this measurement.\n * @returns The width of the string of text when drawn in this font at the\n * given size.\n */\n PDFFont.prototype.widthOfTextAtSize = function (text, size) {\n assertIs(text, 'text', ['string']);\n assertIs(size, 'size', ['number']);\n return this.embedder.widthOfTextAtSize(text, size);\n };\n /**\n * Measure the height of this font at a given size. For example:\n * ```js\n * const height = font.heightAtSize(24)\n * ```\n * @param size The font size to be used for this measurement.\n * @returns The height of this font at the given size.\n */\n PDFFont.prototype.heightAtSize = function (size) {\n assertIs(size, 'size', ['number']);\n return this.embedder.heightOfFontAtSize(size);\n };\n /**\n * Compute the font size at which this font is a given height. For example:\n * ```js\n * const fontSize = font.sizeAtHeight(12)\n * ```\n * @param height The height to be used for this calculation.\n * @returns The font size at which this font is the given height.\n */\n PDFFont.prototype.sizeAtHeight = function (height) {\n assertIs(height, 'height', ['number']);\n return this.embedder.sizeOfFontAtHeight(height);\n };\n /**\n * Get the set of unicode code points that can be represented by this font.\n * @returns The set of unicode code points supported by this font.\n */\n PDFFont.prototype.getCharacterSet = function () {\n if (this.embedder instanceof StandardFontEmbedder) {\n // TODO: Update @pdf-lib/standard fonts to export encoding.characterSet\n return Object.keys(this.embedder.encoding.unicodeMappings)\n .map(Number)\n .sort(function (a, b) { return a - b; });\n }\n else {\n return this.embedder.font.characterSet;\n }\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all fonts get embedded.\n *\n * Embed this font in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFFont.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.modified) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.modified = false;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedFont]] and\n * > [[PDFDocument.embedStandardFont]] methods, which will create instances\n * > of [[PDFFont]] for you.\n *\n * Create an instance of [[PDFFont]] from an existing ref and embedder\n *\n * @param ref The unique reference for this font.\n * @param doc The document to which the font will belong.\n * @param embedder The embedder that will be used to embed the font.\n */\n PDFFont.of = function (ref, doc, embedder) {\n return new PDFFont(ref, doc, embedder);\n };\n return PDFFont;\n}());\nexport default PDFFont;\n//# sourceMappingURL=PDFFont.js.map","import { __awaiter, __generator } from \"tslib\";\nimport PDFDocument from \"./PDFDocument\";\nimport { JpegEmbedder, PDFRef, PngEmbedder } from \"../core\";\nimport { assertIs } from \"../utils\";\n/**\n * Represents an image that has been embedded in a [[PDFDocument]].\n */\nvar PDFImage = /** @class */ (function () {\n function PDFImage(ref, doc, embedder) {\n this.alreadyEmbedded = false;\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n assertIs(embedder, 'embedder', [\n [JpegEmbedder, 'JpegEmbedder'],\n [PngEmbedder, 'PngEmbedder'],\n ]);\n this.ref = ref;\n this.doc = doc;\n this.width = embedder.width;\n this.height = embedder.height;\n this.embedder = embedder;\n }\n /**\n * Compute the width and height of this image after being scaled by the\n * given `factor`. For example:\n * ```js\n * image.width // => 500\n * image.height // => 250\n *\n * const scaled = image.scale(0.5)\n * scaled.width // => 250\n * scaled.height // => 125\n * ```\n * This operation is often useful before drawing an image with\n * [[PDFPage.drawImage]] to compute the `width` and `height` options.\n * @param factor The factor by which this image should be scaled.\n * @returns The width and height of the image after being scaled.\n */\n PDFImage.prototype.scale = function (factor) {\n assertIs(factor, 'factor', ['number']);\n return { width: this.width * factor, height: this.height * factor };\n };\n /**\n * Get the width and height of this image. For example:\n * ```js\n * const { width, height } = image.size()\n * ```\n * @returns The width and height of the image.\n */\n PDFImage.prototype.size = function () {\n return this.scale(1);\n };\n /**\n * > **NOTE:** You probably don't need to call this method directly. The\n * > [[PDFDocument.save]] and [[PDFDocument.saveAsBase64]] methods will\n * > automatically ensure all images get embedded.\n *\n * Embed this image in its document.\n *\n * @returns Resolves when the embedding is complete.\n */\n PDFImage.prototype.embed = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.alreadyEmbedded) return [3 /*break*/, 2];\n return [4 /*yield*/, this.embedder.embedIntoContext(this.doc.context, this.ref)];\n case 1:\n _a.sent();\n this.alreadyEmbedded = true;\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.embedPng]] and [[PDFDocument.embedJpg]]\n * > methods, which will create instances of [[PDFImage]] for you.\n *\n * Create an instance of [[PDFImage]] from an existing ref and embedder\n *\n * @param ref The unique reference for this image.\n * @param doc The document to which the image will belong.\n * @param embedder The embedder that will be used to embed the image.\n */\n PDFImage.of = function (ref, doc, embedder) {\n return new PDFImage(ref, doc, embedder);\n };\n return PDFImage;\n}());\nexport default PDFImage;\n//# sourceMappingURL=PDFImage.js.map","import { __assign } from \"tslib\";\nimport { rgb } from \"./colors\";\nimport { drawEllipse, drawImage, drawLine, drawLinesOfText, drawPage, drawRectangle, drawSvgPath, } from \"./operations\";\nimport { popGraphicsState, pushGraphicsState, translate, } from \"./operators\";\nimport PDFDocument from \"./PDFDocument\";\nimport PDFEmbeddedPage from \"./PDFEmbeddedPage\";\nimport PDFFont from \"./PDFFont\";\nimport PDFImage from \"./PDFImage\";\nimport { degrees, toDegrees } from \"./rotations\";\nimport { StandardFonts } from \"./StandardFonts\";\nimport { PDFContentStream, PDFName, PDFOperator, PDFPageLeaf, PDFRef, } from \"../core\";\nimport { addRandomSuffix, assertEachIs, assertIs, assertMultiple, assertOrUndefined, breakTextIntoLines, cleanText, rectanglesAreEqual, } from \"../utils\";\n/**\n * Represents a single page of a [[PDFDocument]].\n */\nvar PDFPage = /** @class */ (function () {\n function PDFPage(leafNode, ref, doc) {\n this.fontSize = 24;\n this.fontColor = rgb(0, 0, 0);\n this.lineHeight = 24;\n this.x = 0;\n this.y = 0;\n assertIs(leafNode, 'leafNode', [[PDFPageLeaf, 'PDFPageLeaf']]);\n assertIs(ref, 'ref', [[PDFRef, 'PDFRef']]);\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n this.node = leafNode;\n this.ref = ref;\n this.doc = doc;\n }\n /**\n * Rotate this page by a multiple of 90 degrees. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * page.setRotation(degrees(-90))\n * page.setRotation(degrees(0))\n * page.setRotation(degrees(90))\n * page.setRotation(degrees(180))\n * page.setRotation(degrees(270))\n * ```\n * @param angle The angle to rotate this page.\n */\n PDFPage.prototype.setRotation = function (angle) {\n var degreesAngle = toDegrees(angle);\n assertMultiple(degreesAngle, 'degreesAngle', 90);\n this.node.set(PDFName.of('Rotate'), this.doc.context.obj(degreesAngle));\n };\n /**\n * Get this page's rotation angle in degrees. For example:\n * ```js\n * const rotationAngle = page.getRotation().angle;\n * ```\n * @returns The rotation angle of the page in degrees (always a multiple of\n * 90 degrees).\n */\n PDFPage.prototype.getRotation = function () {\n var Rotate = this.node.Rotate();\n return degrees(Rotate ? Rotate.asNumber() : 0);\n };\n /**\n * Resize this page by increasing or decreasing its width and height. For\n * example:\n * ```js\n * page.setSize(250, 500)\n * page.setSize(page.getWidth() + 50, page.getHeight() + 100)\n * page.setSize(page.getWidth() - 50, page.getHeight() - 100)\n * ```\n *\n * Note that the PDF specification does not allow for pages to have explicit\n * widths and heights. Instead it defines the \"size\" of a page in terms of\n * five rectangles: the MediaBox, CropBox, BleedBox, TrimBox, and ArtBox. As a\n * result, this method cannot directly change the width and height of a page.\n * Instead, it works by adjusting these five boxes.\n *\n * This method performs the following steps:\n * 1. Set width & height of MediaBox.\n * 2. Set width & height of CropBox, if it has same dimensions as MediaBox.\n * 3. Set width & height of BleedBox, if it has same dimensions as MediaBox.\n * 4. Set width & height of TrimBox, if it has same dimensions as MediaBox.\n * 5. Set width & height of ArtBox, if it has same dimensions as MediaBox.\n *\n * This approach works well for most PDF documents as all PDF pages must\n * have a MediaBox, but relatively few have a CropBox, BleedBox, TrimBox, or\n * ArtBox. And when they do have these additional boxes, they often have the\n * same dimensions as the MediaBox. However, if you find this method does not\n * work for your document, consider setting the boxes directly:\n * * [[PDFPage.setMediaBox]]\n * * [[PDFPage.setCropBox]]\n * * [[PDFPage.setBleedBox]]\n * * [[PDFPage.setTrimBox]]\n * * [[PDFPage.setArtBox]]\n *\n * @param width The new width of the page.\n * @param height The new height of the page.\n */\n PDFPage.prototype.setSize = function (width, height) {\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var mediaBox = this.getMediaBox();\n this.setMediaBox(mediaBox.x, mediaBox.y, width, height);\n var cropBox = this.getCropBox();\n var bleedBox = this.getBleedBox();\n var trimBox = this.getTrimBox();\n var artBox = this.getArtBox();\n var hasCropBox = this.node.CropBox();\n var hasBleedBox = this.node.BleedBox();\n var hasTrimBox = this.node.TrimBox();\n var hasArtBox = this.node.ArtBox();\n if (hasCropBox && rectanglesAreEqual(cropBox, mediaBox)) {\n this.setCropBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasBleedBox && rectanglesAreEqual(bleedBox, mediaBox)) {\n this.setBleedBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasTrimBox && rectanglesAreEqual(trimBox, mediaBox)) {\n this.setTrimBox(mediaBox.x, mediaBox.y, width, height);\n }\n if (hasArtBox && rectanglesAreEqual(artBox, mediaBox)) {\n this.setArtBox(mediaBox.x, mediaBox.y, width, height);\n }\n };\n /**\n * Resize this page by increasing or decreasing its width. For example:\n * ```js\n * page.setWidth(250)\n * page.setWidth(page.getWidth() + 50)\n * page.setWidth(page.getWidth() - 50)\n * ```\n *\n * This method uses [[PDFPage.setSize]] to set the page's width.\n *\n * @param width The new width of the page.\n */\n PDFPage.prototype.setWidth = function (width) {\n assertIs(width, 'width', ['number']);\n this.setSize(width, this.getSize().height);\n };\n /**\n * Resize this page by increasing or decreasing its height. For example:\n * ```js\n * page.setHeight(500)\n * page.setHeight(page.getWidth() + 100)\n * page.setHeight(page.getWidth() - 100)\n * ```\n *\n * This method uses [[PDFPage.setSize]] to set the page's height.\n *\n * @param height The new height of the page.\n */\n PDFPage.prototype.setHeight = function (height) {\n assertIs(height, 'height', ['number']);\n this.setSize(this.getSize().width, height);\n };\n /**\n * Set the MediaBox of this page. For example:\n * ```js\n * const mediaBox = page.getMediaBox()\n *\n * page.setMediaBox(0, 0, 250, 500)\n * page.setMediaBox(mediaBox.x, mediaBox.y, 50, 100)\n * page.setMediaBox(15, 5, mediaBox.width - 50, mediaBox.height - 100)\n * ```\n *\n * See [[PDFPage.getMediaBox]] for details about what the MediaBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new MediaBox.\n * @param y The y coordinate of the lower left corner of the new MediaBox.\n * @param width The width of the new MediaBox.\n * @param height The height of the new MediaBox.\n */\n PDFPage.prototype.setMediaBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var mediaBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.MediaBox, mediaBox);\n };\n /**\n * Set the CropBox of this page. For example:\n * ```js\n * const cropBox = page.getCropBox()\n *\n * page.setCropBox(0, 0, 250, 500)\n * page.setCropBox(cropBox.x, cropBox.y, 50, 100)\n * page.setCropBox(15, 5, cropBox.width - 50, cropBox.height - 100)\n * ```\n *\n * See [[PDFPage.getCropBox]] for details about what the CropBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new CropBox.\n * @param y The y coordinate of the lower left corner of the new CropBox.\n * @param width The width of the new CropBox.\n * @param height The height of the new CropBox.\n */\n PDFPage.prototype.setCropBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var cropBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.CropBox, cropBox);\n };\n /**\n * Set the BleedBox of this page. For example:\n * ```js\n * const bleedBox = page.getBleedBox()\n *\n * page.setBleedBox(0, 0, 250, 500)\n * page.setBleedBox(bleedBox.x, bleedBox.y, 50, 100)\n * page.setBleedBox(15, 5, bleedBox.width - 50, bleedBox.height - 100)\n * ```\n *\n * See [[PDFPage.getBleedBox]] for details about what the BleedBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new BleedBox.\n * @param y The y coordinate of the lower left corner of the new BleedBox.\n * @param width The width of the new BleedBox.\n * @param height The height of the new BleedBox.\n */\n PDFPage.prototype.setBleedBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var bleedBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.BleedBox, bleedBox);\n };\n /**\n * Set the TrimBox of this page. For example:\n * ```js\n * const trimBox = page.getTrimBox()\n *\n * page.setTrimBox(0, 0, 250, 500)\n * page.setTrimBox(trimBox.x, trimBox.y, 50, 100)\n * page.setTrimBox(15, 5, trimBox.width - 50, trimBox.height - 100)\n * ```\n *\n * See [[PDFPage.getTrimBox]] for details about what the TrimBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new TrimBox.\n * @param y The y coordinate of the lower left corner of the new TrimBox.\n * @param width The width of the new TrimBox.\n * @param height The height of the new TrimBox.\n */\n PDFPage.prototype.setTrimBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var trimBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.TrimBox, trimBox);\n };\n /**\n * Set the ArtBox of this page. For example:\n * ```js\n * const artBox = page.getArtBox()\n *\n * page.setArtBox(0, 0, 250, 500)\n * page.setArtBox(artBox.x, artBox.y, 50, 100)\n * page.setArtBox(15, 5, artBox.width - 50, artBox.height - 100)\n * ```\n *\n * See [[PDFPage.getArtBox]] for details about what the ArtBox represents.\n *\n * @param x The x coordinate of the lower left corner of the new ArtBox.\n * @param y The y coordinate of the lower left corner of the new ArtBox.\n * @param width The width of the new ArtBox.\n * @param height The height of the new ArtBox.\n */\n PDFPage.prototype.setArtBox = function (x, y, width, height) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n assertIs(width, 'width', ['number']);\n assertIs(height, 'height', ['number']);\n var artBox = this.doc.context.obj([x, y, x + width, y + height]);\n this.node.set(PDFName.ArtBox, artBox);\n };\n /**\n * Get this page's width and height. For example:\n * ```js\n * const { width, height } = page.getSize()\n * ```\n *\n * This method uses [[PDFPage.getMediaBox]] to obtain the page's\n * width and height.\n *\n * @returns The width and height of the page.\n */\n PDFPage.prototype.getSize = function () {\n var _a = this.getMediaBox(), width = _a.width, height = _a.height;\n return { width: width, height: height };\n };\n /**\n * Get this page's width. For example:\n * ```js\n * const width = page.getWidth()\n * ```\n *\n * This method uses [[PDFPage.getSize]] to obtain the page's size.\n *\n * @returns The width of the page.\n */\n PDFPage.prototype.getWidth = function () {\n return this.getSize().width;\n };\n /**\n * Get this page's height. For example:\n * ```js\n * const height = page.getHeight()\n * ```\n *\n * This method uses [[PDFPage.getSize]] to obtain the page's size.\n *\n * @returns The height of the page.\n */\n PDFPage.prototype.getHeight = function () {\n return this.getSize().height;\n };\n /**\n * Get the rectangle defining this page's MediaBox. For example:\n * ```js\n * const { x, y, width, height } = page.getMediaBox()\n * ```\n *\n * The MediaBox of a page defines the boundaries of the physical medium on\n * which the page is to be displayed/printed. It may include extended area\n * surrounding the page content for bleed marks, printing marks, etc...\n * It may also include areas close to the edges of the medium that cannot be\n * marked because of physical limitations of the output device. Content\n * falling outside this boundary may safely be discarded without affecting\n * the meaning of the PDF file.\n *\n * @returns An object defining the lower left corner of the MediaBox and its\n * width & height.\n */\n PDFPage.prototype.getMediaBox = function () {\n var mediaBox = this.node.MediaBox();\n return mediaBox.asRectangle();\n };\n /**\n * Get the rectangle defining this page's CropBox. For example:\n * ```js\n * const { x, y, width, height } = page.getCropBox()\n * ```\n *\n * The CropBox of a page defines the region to which the contents of the page\n * shall be clipped when displayed or printed. Unlike the other boxes, the\n * CropBox does not necessarily represent the physical page geometry. It\n * merely imposes clipping on the page contents.\n *\n * The CropBox's default value is the page's MediaBox.\n *\n * @returns An object defining the lower left corner of the CropBox and its\n * width & height.\n */\n PDFPage.prototype.getCropBox = function () {\n var _a;\n var cropBox = this.node.CropBox();\n return (_a = cropBox === null || cropBox === void 0 ? void 0 : cropBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getMediaBox();\n };\n /**\n * Get the rectangle defining this page's BleedBox. For example:\n * ```js\n * const { x, y, width, height } = page.getBleedBox()\n * ```\n *\n * The BleedBox of a page defines the region to which the contents of the\n * page shall be clipped when output in a production environment. This may\n * include any extra bleed area needed to accommodate the physical\n * limitations of cutting, folding, and trimming equipment. The actual\n * printed page may include printing marks that fall outside the BleedBox.\n *\n * The BleedBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the BleedBox and its\n * width & height.\n */\n PDFPage.prototype.getBleedBox = function () {\n var _a;\n var bleedBox = this.node.BleedBox();\n return (_a = bleedBox === null || bleedBox === void 0 ? void 0 : bleedBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Get the rectangle defining this page's TrimBox. For example:\n * ```js\n * const { x, y, width, height } = page.getTrimBox()\n * ```\n *\n * The TrimBox of a page defines the intended dimensions of the finished\n * page after trimming. It may be smaller than the MediaBox to allow for\n * production-related content, such as printing instructions, cut marks, or\n * color bars.\n *\n * The TrimBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the TrimBox and its\n * width & height.\n */\n PDFPage.prototype.getTrimBox = function () {\n var _a;\n var trimBox = this.node.TrimBox();\n return (_a = trimBox === null || trimBox === void 0 ? void 0 : trimBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Get the rectangle defining this page's ArtBox. For example:\n * ```js\n * const { x, y, width, height } = page.getArtBox()\n * ```\n *\n * The ArtBox of a page defines the extent of the page's meaningful content\n * (including potential white space).\n *\n * The ArtBox's default value is the page's CropBox.\n *\n * @returns An object defining the lower left corner of the ArtBox and its\n * width & height.\n */\n PDFPage.prototype.getArtBox = function () {\n var _a;\n var artBox = this.node.ArtBox();\n return (_a = artBox === null || artBox === void 0 ? void 0 : artBox.asRectangle()) !== null && _a !== void 0 ? _a : this.getCropBox();\n };\n /**\n * Translate this page's content to a new location on the page. This operation\n * is often useful after resizing the page with [[setSize]]. For example:\n * ```js\n * // Add 50 units of whitespace to the top and right of the page\n * page.setSize(page.getWidth() + 50, page.getHeight() + 50)\n *\n * // Move the page's content from the lower-left corner of the page\n * // to the top-right corner.\n * page.translateContent(50, 50)\n *\n * // Now there are 50 units of whitespace to the left and bottom of the page\n * ```\n * See also: [[resetPosition]]\n * @param x The new position on the x-axis for this page's content.\n * @param y The new position on the y-axis for this page's content.\n */\n PDFPage.prototype.translateContent = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.node.normalize();\n this.getContentStream();\n var start = this.createContentStream(pushGraphicsState(), translate(x, y));\n var startRef = this.doc.context.register(start);\n var end = this.createContentStream(popGraphicsState());\n var endRef = this.doc.context.register(end);\n this.node.wrapContentStreams(startRef, endRef);\n };\n /**\n * Reset the x and y coordinates of this page to `(0, 0)`. This operation is\n * often useful after calling [[translateContent]]. For example:\n * ```js\n * // Shift the page's contents up and to the right by 50 units\n * page.translateContent(50, 50)\n *\n * // This text will shifted - it will be drawn at (50, 50)\n * page.drawText('I am shifted')\n *\n * // Move back to (0, 0)\n * page.resetPosition()\n *\n * // This text will not be shifted - it will be drawn at (0, 0)\n * page.drawText('I am not shifted')\n * ```\n */\n PDFPage.prototype.resetPosition = function () {\n this.getContentStream(false);\n this.x = 0;\n this.y = 0;\n };\n /**\n * Choose a default font for this page. The default font will be used whenever\n * text is drawn on this page and no font is specified. For example:\n * ```js\n * import { StandardFonts } from 'pdf-lib'\n *\n * const timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman)\n * const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const courierFont = await pdfDoc.embedFont(StandardFonts.Courier)\n *\n * const page = pdfDoc.addPage()\n *\n * page.setFont(helveticaFont)\n * page.drawText('I will be drawn in Helvetica')\n *\n * page.setFont(timesRomanFont)\n * page.drawText('I will be drawn in Courier', { font: courierFont })\n * ```\n * @param font The default font to be used when drawing text on this page.\n */\n PDFPage.prototype.setFont = function (font) {\n // TODO: Reuse image Font name if we've already added this image to Resources.Fonts\n assertIs(font, 'font', [[PDFFont, 'PDFFont']]);\n this.font = font;\n this.fontKey = addRandomSuffix(this.font.name);\n this.node.setFontDictionary(PDFName.of(this.fontKey), this.font.ref);\n };\n /**\n * Choose a default font size for this page. The default font size will be\n * used whenever text is drawn on this page and no font size is specified.\n * For example:\n * ```js\n * page.setFontSize(12)\n * page.drawText('I will be drawn in size 12')\n *\n * page.setFontSize(36)\n * page.drawText('I will be drawn in size 24', { fontSize: 24 })\n * ```\n * @param fontSize The default font size to be used when drawing text on this\n * page.\n */\n PDFPage.prototype.setFontSize = function (fontSize) {\n assertIs(fontSize, 'fontSize', ['number']);\n this.fontSize = fontSize;\n };\n /**\n * Choose a default font color for this page. The default font color will be\n * used whenever text is drawn on this page and no font color is specified.\n * For example:\n * ```js\n * import { rgb, cmyk, grayscale } from 'pdf-lib'\n *\n * page.setFontColor(rgb(0.97, 0.02, 0.97))\n * page.drawText('I will be drawn in pink')\n *\n * page.setFontColor(cmyk(0.4, 0.7, 0.39, 0.15))\n * page.drawText('I will be drawn in gray', { color: grayscale(0.5) })\n * ```\n * @param fontColor The default font color to be used when drawing text on\n * this page.\n */\n PDFPage.prototype.setFontColor = function (fontColor) {\n assertIs(fontColor, 'fontColor', [[Object, 'Color']]);\n this.fontColor = fontColor;\n };\n /**\n * Choose a default line height for this page. The default line height will be\n * used whenever text is drawn on this page and no line height is specified.\n * For example:\n * ```js\n * page.setLineHeight(12);\n * page.drawText('These lines will be vertically \\n separated by 12 units')\n *\n * page.setLineHeight(36);\n * page.drawText('These lines will be vertically \\n separated by 24 units', {\n * lineHeight: 24\n * })\n * ```\n * @param lineHeight The default line height to be used when drawing text on\n * this page.\n */\n PDFPage.prototype.setLineHeight = function (lineHeight) {\n assertIs(lineHeight, 'lineHeight', ['number']);\n this.lineHeight = lineHeight;\n };\n /**\n * Get the default position of this page. For example:\n * ```js\n * const { x, y } = page.getPosition()\n * ```\n * @returns The default position of the page.\n */\n PDFPage.prototype.getPosition = function () {\n return { x: this.x, y: this.y };\n };\n /**\n * Get the default x coordinate of this page. For example:\n * ```js\n * const x = page.getX()\n * ```\n * @returns The default x coordinate of the page.\n */\n PDFPage.prototype.getX = function () {\n return this.x;\n };\n /**\n * Get the default y coordinate of this page. For example:\n * ```js\n * const y = page.getY()\n * ```\n * @returns The default y coordinate of the page.\n */\n PDFPage.prototype.getY = function () {\n return this.y;\n };\n /**\n * Change the default position of this page. For example:\n * ```js\n * page.moveTo(0, 0)\n * page.drawText('I will be drawn at the origin')\n *\n * page.moveTo(0, 25)\n * page.drawText('I will be drawn 25 units up')\n *\n * page.moveTo(25, 25)\n * page.drawText('I will be drawn 25 units up and 25 units to the right')\n * ```\n * @param x The new default position on the x-axis for this page.\n * @param y The new default position on the y-axis for this page.\n */\n PDFPage.prototype.moveTo = function (x, y) {\n assertIs(x, 'x', ['number']);\n assertIs(y, 'y', ['number']);\n this.x = x;\n this.y = y;\n };\n /**\n * Change the default position of this page to be further down the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveDown(10)\n * page.drawText('I will be drawn at (50, 40)')\n * ```\n * @param yDecrease The amount by which the page's default position along the\n * y-axis should be decreased.\n */\n PDFPage.prototype.moveDown = function (yDecrease) {\n assertIs(yDecrease, 'yDecrease', ['number']);\n this.y -= yDecrease;\n };\n /**\n * Change the default position of this page to be further up the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveUp(10)\n * page.drawText('I will be drawn at (50, 60)')\n * ```\n * @param yIncrease The amount by which the page's default position along the\n * y-axis should be increased.\n */\n PDFPage.prototype.moveUp = function (yIncrease) {\n assertIs(yIncrease, 'yIncrease', ['number']);\n this.y += yIncrease;\n };\n /**\n * Change the default position of this page to be further left on the x-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveLeft(10)\n * page.drawText('I will be drawn at (40, 50)')\n * ```\n * @param xDecrease The amount by which the page's default position along the\n * x-axis should be decreased.\n */\n PDFPage.prototype.moveLeft = function (xDecrease) {\n assertIs(xDecrease, 'xDecrease', ['number']);\n this.x -= xDecrease;\n };\n /**\n * Change the default position of this page to be further right on the y-axis.\n * For example:\n * ```js\n * page.moveTo(50, 50)\n * page.drawText('I will be drawn at (50, 50)')\n *\n * page.moveRight(10)\n * page.drawText('I will be drawn at (60, 50)')\n * ```\n * @param xIncrease The amount by which the page's default position along the\n * x-axis should be increased.\n */\n PDFPage.prototype.moveRight = function (xIncrease) {\n assertIs(xIncrease, 'xIncrease', ['number']);\n this.x += xIncrease;\n };\n /**\n * Push one or more operators to the end of this page's current content\n * stream. For example:\n * ```js\n * import {\n * pushGraphicsState,\n * moveTo,\n * lineTo,\n * closePath,\n * setFillingColor,\n * rgb,\n * fill,\n * popGraphicsState,\n * } from 'pdf-lib'\n *\n * // Draw a green triangle in the lower-left corner of the page\n * page.pushOperators(\n * pushGraphicsState(),\n * moveTo(0, 0),\n * lineTo(100, 0),\n * lineTo(50, 100),\n * closePath(),\n * setFillingColor(rgb(0.0, 1.0, 0.0)),\n * fill(),\n * popGraphicsState(),\n * )\n * ```\n * @param operator The operators to be pushed.\n */\n PDFPage.prototype.pushOperators = function () {\n var operator = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operator[_i] = arguments[_i];\n }\n assertEachIs(operator, 'operator', [[PDFOperator, 'PDFOperator']]);\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, operator);\n };\n /**\n * Draw one or more lines of text on this page. For example:\n * ```js\n * import { StandardFonts, rgb } from 'pdf-lib'\n *\n * const helveticaFont = await pdfDoc.embedFont(StandardFonts.Helvetica)\n * const timesRomanFont = await pdfDoc.embedFont(StandardFonts.TimesRoman)\n *\n * const page = pdfDoc.addPage()\n *\n * page.setFont(helveticaFont)\n *\n * page.moveTo(5, 200)\n * page.drawText('The Life of an Egg', { size: 36 })\n *\n * page.moveDown(36)\n * page.drawText('An Epic Tale of Woe', { size: 30 })\n *\n * page.drawText(\n * `Humpty Dumpty sat on a wall \\n` +\n * `Humpty Dumpty had a great fall; \\n` +\n * `All the king's horses and all the king's men \\n` +\n * `Couldn't put Humpty together again. \\n`,\n * {\n * x: 25,\n * y: 100,\n * font: timesRomanFont,\n * size: 24,\n * color: rgb(1, 0, 0),\n * lineHeight: 24,\n * },\n * )\n * ```\n * @param text The text to be drawn.\n * @param options The options to be used when drawing the text.\n */\n PDFPage.prototype.drawText = function (text, options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e, _f, _g;\n assertIs(text, 'text', ['string']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertOrUndefined(options.font, 'options.font', [[PDFFont, 'PDFFont']]);\n assertOrUndefined(options.size, 'options.size', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.lineHeight, 'options.lineHeight', ['number']);\n assertOrUndefined(options.maxWidth, 'options.maxWidth', ['number']);\n assertOrUndefined(options.wordBreaks, 'options.wordBreaks', [Array]);\n var originalFont = this.getFont()[0];\n if (options.font)\n this.setFont(options.font);\n var _h = this.getFont(), font = _h[0], fontKey = _h[1];\n var fontSize = options.size || this.fontSize;\n var wordBreaks = options.wordBreaks || this.doc.defaultWordBreaks;\n var textWidth = function (t) { return font.widthOfTextAtSize(t, fontSize); };\n var lines = options.maxWidth === undefined\n ? cleanText(text).split(/[\\r\\n\\f]/)\n : breakTextIntoLines(text, wordBreaks, options.maxWidth, textWidth);\n var encodedLines = new Array(lines.length);\n for (var idx = 0, len = lines.length; idx < len; idx++) {\n encodedLines[idx] = font.encodeText(lines[idx]);\n }\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawLinesOfText(encodedLines, {\n color: (_a = options.color) !== null && _a !== void 0 ? _a : this.fontColor,\n font: fontKey,\n size: fontSize,\n rotate: (_b = options.rotate) !== null && _b !== void 0 ? _b : degrees(0),\n xSkew: (_c = options.xSkew) !== null && _c !== void 0 ? _c : degrees(0),\n ySkew: (_d = options.ySkew) !== null && _d !== void 0 ? _d : degrees(0),\n x: (_e = options.x) !== null && _e !== void 0 ? _e : this.x,\n y: (_f = options.y) !== null && _f !== void 0 ? _f : this.y,\n lineHeight: (_g = options.lineHeight) !== null && _g !== void 0 ? _g : this.lineHeight,\n }));\n if (options.font)\n this.setFont(originalFont);\n };\n /**\n * Draw an image on this page. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * const jpgUrl = 'https://pdf-lib.js.org/assets/cat_riding_unicorn.jpg'\n * const jpgImageBytes = await fetch(jpgUrl).then((res) => res.arrayBuffer())\n *\n * const jpgImage = await pdfDoc.embedJpg(jpgImageBytes)\n * const jpgDims = jpgImage.scale(0.5)\n *\n * const page = pdfDoc.addPage()\n *\n * page.drawImage(jpgImage, {\n * x: 25,\n * y: 25,\n * width: jpgDims.width,\n * height: jpgDims.height,\n * rotate: degrees(30)\n * })\n * ```\n * @param image The image to be drawn.\n * @param options The options to be used when drawing the image.\n */\n PDFPage.prototype.drawImage = function (image, options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e, _f, _g;\n // TODO: Reuse image XObject name if we've already added this image to Resources.XObjects\n assertIs(image, 'image', [[PDFImage, 'PDFImage']]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n var xObjectKey = addRandomSuffix('Image', 10);\n this.node.setXObject(PDFName.of(xObjectKey), image.ref);\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawImage(xObjectKey, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : image.size().width,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : image.size().height,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),\n xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),\n ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),\n }));\n };\n /**\n * Draw an embedded PDF page on this page. For example:\n * ```js\n * import { degrees } from 'pdf-lib'\n *\n * const pdfDoc = await PDFDocument.create()\n * const page = pdfDoc.addPage()\n *\n * const sourcePdfUrl = 'https://pdf-lib.js.org/assets/with_large_page_count.pdf'\n * const sourcePdf = await fetch(sourcePdfUrl).then((res) => res.arrayBuffer())\n *\n * // Embed page 74 from the PDF\n * const [embeddedPage] = await pdfDoc.embedPdf(sourcePdf, 73)\n *\n * page.drawPage(embeddedPage, {\n * x: 250,\n * y: 200,\n * xScale: 0.5,\n * yScale: 0.5,\n * rotate: degrees(30),\n * })\n * ```\n *\n * The `options` argument accepts both `width`/`height` and `xScale`/`yScale`\n * as options. Since each of these options defines the size of the drawn page,\n * if both options are given, `width` and `height` take precedence and the\n * corresponding scale variants are ignored.\n *\n * @param embeddedPage The embedded page to be drawn.\n * @param options The options to be used when drawing the embedded page.\n */\n PDFPage.prototype.drawPage = function (embeddedPage, options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e;\n // TODO: Reuse embeddedPage XObject name if we've already added this embeddedPage to Resources.XObjects\n assertIs(embeddedPage, 'embeddedPage', [\n [PDFEmbeddedPage, 'PDFEmbeddedPage'],\n ]);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.xScale, 'options.xScale', ['number']);\n assertOrUndefined(options.yScale, 'options.yScale', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n var xObjectKey = addRandomSuffix('EmbeddedPdfPage', 10);\n this.node.setXObject(PDFName.of(xObjectKey), embeddedPage.ref);\n // prettier-ignore\n var xScale = (options.width !== undefined ? options.width / embeddedPage.width\n : options.xScale !== undefined ? options.xScale\n : 1);\n // prettier-ignore\n var yScale = (options.height !== undefined ? options.height / embeddedPage.height\n : options.yScale !== undefined ? options.yScale\n : 1);\n var contentStream = this.getContentStream();\n contentStream.push.apply(contentStream, drawPage(xObjectKey, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n xScale: xScale,\n yScale: yScale,\n rotate: (_c = options.rotate) !== null && _c !== void 0 ? _c : degrees(0),\n xSkew: (_d = options.xSkew) !== null && _d !== void 0 ? _d : degrees(0),\n ySkew: (_e = options.ySkew) !== null && _e !== void 0 ? _e : degrees(0),\n }));\n };\n /**\n * Draw an SVG path on this page. For example:\n * ```js\n * import { rgb } from 'pdf-lib'\n *\n * const svgPath = 'M 0,20 L 100,160 Q 130,200 150,120 C 190,-40 200,200 300,150 L 400,90'\n *\n * // Draw path as black line\n * page.drawSvgPath(svgPath, { x: 25, y: 75 })\n *\n * // Change border style\n * page.drawSvgPath(svgPath, {\n * x: 25,\n * y: 275,\n * borderColor: rgb(0.5, 0.5, 0.5),\n * borderWidth: 2,\n * })\n *\n * // Set fill color\n * page.drawSvgPath(svgPath, {\n * \t x: 25,\n * \t y: 475,\n * \t color: rgb(1.0, 0, 0),\n * })\n *\n * // Draw 50% of original size\n * page.drawSvgPath(svgPath, {\n * \t x: 25,\n * \t y: 675,\n * \t scale: 0.5,\n * })\n * ```\n * @param path The SVG path to be drawn.\n * @param options The options to be used when drawing the SVG path.\n */\n PDFPage.prototype.drawSvgPath = function (path, options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e;\n assertIs(path, 'path', ['string']);\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.scale, 'options.scale', ['number']);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertOrUndefined(options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n var contentStream = this.getContentStream();\n if (!('color' in options) && !('borderColor' in options)) {\n options.borderColor = rgb(0, 0, 0);\n }\n contentStream.push.apply(contentStream, drawSvgPath(path, {\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n scale: options.scale,\n color: (_c = options.color) !== null && _c !== void 0 ? _c : undefined,\n borderColor: (_d = options.borderColor) !== null && _d !== void 0 ? _d : undefined,\n borderWidth: (_e = options.borderWidth) !== null && _e !== void 0 ? _e : 0,\n }));\n };\n /**\n * Draw a line on this page. For example:\n * ```js\n * import { rgb } from 'pdf-lib'\n *\n * page.drawLine({\n * start: { x: 25, y: 75 },\n * end: { x: 125, y: 175 },\n * thickness: 2,\n * color: rgb(0.75, 0.2, 0.2)\n * })\n * ```\n * @param options The options to be used when drawing the line.\n */\n PDFPage.prototype.drawLine = function (options) {\n var _a, _b;\n assertIs(options.start, 'options.start', [\n [Object, '{ x: number, y: number }'],\n ]);\n assertIs(options.end, 'options.end', [\n [Object, '{ x: number, y: number }'],\n ]);\n assertIs(options.start.x, 'options.start.x', ['number']);\n assertIs(options.start.y, 'options.start.y', ['number']);\n assertIs(options.end.x, 'options.end.x', ['number']);\n assertIs(options.end.y, 'options.end.y', ['number']);\n assertOrUndefined(options.thickness, 'options.thickness', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n var contentStream = this.getContentStream();\n if (!('color' in options)) {\n options.color = rgb(0, 0, 0);\n }\n contentStream.push.apply(contentStream, drawLine({\n start: options.start,\n end: options.end,\n thickness: (_a = options.thickness) !== null && _a !== void 0 ? _a : 1,\n color: (_b = options.color) !== null && _b !== void 0 ? _b : undefined,\n }));\n };\n /**\n * Draw a rectangle on this page. For example:\n * ```js\n * import { degrees, grayscale, rgb } from 'pdf-lib'\n *\n * page.drawRectangle({\n * x: 25,\n * y: 75,\n * width: 250,\n * height: 75,\n * rotate: degrees(-15),\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2)\n * })\n * ```\n * @param options The options to be used when drawing the rectangle.\n */\n PDFPage.prototype.drawRectangle = function (options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.width, 'options.width', ['number']);\n assertOrUndefined(options.height, 'options.height', ['number']);\n assertOrUndefined(options.rotate, 'options.rotate', [[Object, 'Rotation']]);\n assertOrUndefined(options.xSkew, 'options.xSkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.ySkew, 'options.ySkew', [[Object, 'Rotation']]);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertOrUndefined(options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n var contentStream = this.getContentStream();\n if (!('color' in options) && !('borderColor' in options)) {\n options.color = rgb(0, 0, 0);\n }\n contentStream.push.apply(contentStream, drawRectangle({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n width: (_c = options.width) !== null && _c !== void 0 ? _c : 150,\n height: (_d = options.height) !== null && _d !== void 0 ? _d : 100,\n rotate: (_e = options.rotate) !== null && _e !== void 0 ? _e : degrees(0),\n xSkew: (_f = options.xSkew) !== null && _f !== void 0 ? _f : degrees(0),\n ySkew: (_g = options.ySkew) !== null && _g !== void 0 ? _g : degrees(0),\n borderWidth: (_h = options.borderWidth) !== null && _h !== void 0 ? _h : 0,\n color: (_j = options.color) !== null && _j !== void 0 ? _j : undefined,\n borderColor: (_k = options.borderColor) !== null && _k !== void 0 ? _k : undefined,\n }));\n };\n /**\n * Draw a square on this page. For example:\n * ```js\n * import { degrees, grayscale, rgb } from 'pdf-lib'\n *\n * page.drawSquare({\n * x: 25,\n * y: 75,\n * size: 100,\n * rotate: degrees(-15),\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2)\n * })\n * ```\n * @param options The options to be used when drawing the square.\n */\n PDFPage.prototype.drawSquare = function (options) {\n if (options === void 0) { options = {}; }\n var size = options.size;\n assertOrUndefined(size, 'size', ['number']);\n this.drawRectangle(__assign(__assign({}, options), { width: size, height: size }));\n };\n /**\n * Draw an ellipse on this page. For example:\n * ```js\n * import { grayscale, rgb } from 'pdf-lib'\n *\n * page.drawEllipse({\n * x: 200,\n * y: 75,\n * xScale: 100,\n * yScale: 50,\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2)\n * })\n * ```\n * @param options The options to be used when drawing the ellipse.\n */\n PDFPage.prototype.drawEllipse = function (options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e, _f, _g;\n assertOrUndefined(options.x, 'options.x', ['number']);\n assertOrUndefined(options.y, 'options.y', ['number']);\n assertOrUndefined(options.xScale, 'options.xScale', ['number']);\n assertOrUndefined(options.yScale, 'options.yScale', ['number']);\n assertOrUndefined(options.color, 'options.color', [[Object, 'Color']]);\n assertOrUndefined(options.borderColor, 'options.borderColor', [\n [Object, 'Color'],\n ]);\n assertOrUndefined(options.borderWidth, 'options.borderWidth', ['number']);\n var contentStream = this.getContentStream();\n if (!('color' in options) && !('borderColor' in options)) {\n options.color = rgb(0, 0, 0);\n }\n contentStream.push.apply(contentStream, drawEllipse({\n x: (_a = options.x) !== null && _a !== void 0 ? _a : this.x,\n y: (_b = options.y) !== null && _b !== void 0 ? _b : this.y,\n xScale: (_c = options.xScale) !== null && _c !== void 0 ? _c : 100,\n yScale: (_d = options.yScale) !== null && _d !== void 0 ? _d : 100,\n color: (_e = options.color) !== null && _e !== void 0 ? _e : undefined,\n borderColor: (_f = options.borderColor) !== null && _f !== void 0 ? _f : undefined,\n borderWidth: (_g = options.borderWidth) !== null && _g !== void 0 ? _g : 0,\n }));\n };\n /**\n * Draw a circle on this page. For example:\n * ```js\n * import { grayscale, rgb } from 'pdf-lib'\n *\n * page.drawCircle({\n * x: 200,\n * y: 150,\n * size: 100,\n * borderWidth: 5,\n * borderColor: grayscale(0.5),\n * color: rgb(0.75, 0.2, 0.2)\n * })\n * ```\n * @param options The options to be used when drawing the ellipse.\n */\n PDFPage.prototype.drawCircle = function (options) {\n if (options === void 0) { options = {}; }\n var size = options.size;\n assertOrUndefined(size, 'size', ['number']);\n this.drawEllipse(__assign(__assign({}, options), { xScale: size, yScale: size }));\n };\n PDFPage.prototype.getFont = function () {\n if (!this.font || !this.fontKey) {\n var font = this.doc.embedStandardFont(StandardFonts.Helvetica);\n this.setFont(font);\n }\n return [this.font, this.fontKey];\n };\n PDFPage.prototype.getContentStream = function (useExisting) {\n if (useExisting === void 0) { useExisting = true; }\n if (useExisting && this.contentStream)\n return this.contentStream;\n this.contentStream = this.createContentStream();\n this.contentStreamRef = this.doc.context.register(this.contentStream);\n this.node.addContentStream(this.contentStreamRef);\n return this.contentStream;\n };\n PDFPage.prototype.createContentStream = function () {\n var operators = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operators[_i] = arguments[_i];\n }\n var dict = this.doc.context.obj({});\n var contentStream = PDFContentStream.of(dict, operators);\n return contentStream;\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addPage]] and [[PDFDocument.insertPage]]\n * > methods, which can create instances of [[PDFPage]] for you.\n *\n * Create an instance of [[PDFPage]] from an existing leaf node.\n *\n * @param leafNode The leaf node to be wrapped.\n * @param ref The unique reference for the page.\n * @param doc The document to which the page will belong.\n */\n PDFPage.of = function (leafNode, ref, doc) {\n return new PDFPage(leafNode, ref, doc);\n };\n /**\n * > **NOTE:** You probably don't want to call this method directly. Instead,\n * > consider using the [[PDFDocument.addPage]] and [[PDFDocument.insertPage]]\n * > methods, which can create instances of [[PDFPage]] for you.\n *\n * Create an instance of [[PDFPage]].\n *\n * @param doc The document to which the page will belong.\n */\n PDFPage.create = function (doc) {\n assertIs(doc, 'doc', [[PDFDocument, 'PDFDocument']]);\n var dummyRef = PDFRef.of(-1);\n var pageLeaf = PDFPageLeaf.withContextAndParent(doc.context, dummyRef);\n var pageRef = doc.context.register(pageLeaf);\n return new PDFPage(pageLeaf, pageRef, doc);\n };\n return PDFPage;\n}());\nexport default PDFPage;\n//# sourceMappingURL=PDFPage.js.map"],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","this","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","v","op","TypeError","pop","push","__spreadArrays","il","r","k","a","j","jl","chars","lookup","Uint8Array","charCodeAt","ByteOrder","encodeToBase64","bytes","base64","len","substring","decodeFromBase64","encoded1","encoded2","encoded3","encoded4","bufferLength","DATA_URI_PREFIX_REGEX","decodeFromBase64DataUri","dataUri","trimmedUri","trim","res","match","fullMatch","data","toCharCode","character","toCodePoint","codePointAt","toHexStringOfMinLength","num","minLength","padStart","toString","toUpperCase","toHexString","charFromCode","code","String","fromCharCode","charFromHexCode","hex","parseInt","padChar","padding","idx","copyStringIntoBuffer","str","buffer","offset","addRandomSuffix","prefix","suffixLength","Math","floor","random","pow","escapeRegExp","replace","cleanText","text","breakTextIntoLines","wordBreaks","maxWidth","computeWidthOfText","regex","escapedRules","wordBreak","includes","breakRules","join","RegExp","buildWordBreakRegex","words","currLine","currWidth","lines","pushCurrLine","word","width","dateRegex","parseDate","dateStr","year","_a","month","_b","day","_c","hours","_d","mins","_e","secs","_f","offsetSign","_g","offsetHours","_h","Date","last","array","typedArrayFor","typedArray","mergeIntoTypedArray","arrays","_i","arrayCount","typedArrays","element","totalSize","merged","arrIdx","arr","byteIdx","arrLen","mergeUint8Arrays","mergedBuffer","set","arrayAsString","byAscendingId","id","sortedUniq","indexer","uniq","curr","prev","reverseArray","arrayLen","leftIdx","rightIdx","temp","sum","total","range","start","end","pluckIndices","indices","plucked","canBeConvertedToUint8Array","input","ArrayBuffer","toUint8Array","waitForTick","setTimeout","utf16Encode","byteOrderMark","encoded","codePoint","Error","highSurrogate","lowSurrogate","Uint16Array","isWithinBMP","hasSurrogates","REPLACEMENT","utf16Decode","fromCodePoint","byteOrder","readBOM","BigEndian","codePoints","first","decodeValues","isHighSurrogate","second","isLowSurrogate","LittleEndian","hasUtf16BigEndianBOM","hasUtf16LittleEndianBOM","hasUtf16BOM","numberToString","numStr","abs","split","negative","sizeInBytes","ceil","bytesFor","error","msg","exports","arraybuffer","TYPED_OK","Int32Array","_has","obj","key","sources","slice","source","shift","buf","size","subarray","fnTyped","arraySet","dest","src","src_offs","dest_offs","flattenChunks","chunks","l","pos","chunk","fnUntyped","concat","on","setTyped","zero","extra_lbits","extra_dbits","extra_blbits","bl_order","static_ltree","static_dtree","D_CODES","_dist_code","_length_code","MAX_MATCH","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","w","pending_buf","pending","send_bits","bi_valid","bi_buf","send_code","c","tree","bi_reverse","gen_codes","bl_count","bits","next_code","MAX_BITS","init_block","LITERALS","dyn_ltree","dyn_dtree","bl_tree","END_BLOCK","opt_len","static_len","last_lit","matches","bi_windup","smaller","m","depth","_n2","_m2","pqdownheap","heap","heap_len","compress_block","ltree","dtree","lc","extra","lx","d_buf","l_buf","build_tree","desc","node","stree","heap_max","h","xbits","base","overflow","gen_bitlen","scan_tree","curlen","prevlen","nextlen","count","max_count","min_count","REP_3_6","REPZ_3_10","REPZ_11_138","send_tree","static_init_done","_tr_stored_block","stored_len","header","utils","window","copy_block","LENGTH_CODES","L_CODES","tr_static_init","l_desc","d_desc","bl_desc","opt_lenb","static_lenb","max_blindex","level","strm","data_type","black_mask","detect_data_type","BL_CODES","build_bl_tree","strategy","lcodes","dcodes","blcodes","rank","send_all_trees","lit_bufsize","STATIC_TREES","bi_flush","adler","s1","s2","crcTable","table","makeTable","configuration_table","crc","2","1","0","-1","-2","-3","-4","-5","-6","err","errorCode","flush_pending","state","avail_out","output","pending_out","next_out","total_out","flush_block_only","trees","_tr_flush_block","block_start","strstart","put_byte","putShortMSB","read_buf","avail_in","next_in","wrap","adler32","crc32","total_in","longest_match","cur_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","more","_w_size","window_size","hash_size","head","insert","ins_h","hash_shift","hash_mask","deflate_fast","flush","hash_head","bflush","match_length","_tr_tally","max_lazy_match","MIN_MATCH","deflate_slow","max_insert","prev_match","match_available","Config","good_length","max_lazy","nice_length","max_chain","func","DeflateState","status","pending_buf_size","gzhead","gzindex","method","last_flush","w_bits","hash_bits","Buf16","HEAP_SIZE","deflateResetKeep","_tr_init","deflateReset","ret","deflateInit2","windowBits","memLevel","Buf8","max_block_size","max_start","old_flush","beg","val","hcrc","name","comment","time","os","bstate","deflate_huff","deflate_rle","_tr_align","dictionary","avail","tmpDict","dictLength","STR_APPLY_OK","STR_APPLY_UIA_OK","_utf8len","q","buf2binstring","shrinkBuf","c2","m_pos","str_len","buf_len","max","out","c_len","utf16buf","Deflate","options","chunkSize","to","opt","raw","gzip","ended","ZStream","zlib_deflate","deflateSetHeader","dict","strings","deflateSetDictionary","_dict_set","deflate","deflator","mode","_mode","onEnd","onData","deflateEnd","_in","_out","dmax","wsize","whave","wnext","s_window","hold","lcode","dcode","lmask","dmask","here","from","from_source","lencode","distcode","lenbits","distbits","top","dolen","dodist","sane","lbase","lext","dbase","dext","type","lens","lens_index","codes","table_index","work","opts","incr","fill","low","mask","here_bits","here_op","here_val","sym","min","root","drop","left","used","huff","base_index","MAXBITS","offs","extra_index","zswap32","InflateState","havedict","flags","check","wbits","ncode","nlen","ndist","have","lendyn","distdyn","back","was","inflateResetKeep","Buf32","inflateReset","inflateReset2","inflateInit2","lenfix","distfix","virgin","fixedtables","inflate_table","updatewindow","copy","put","last_bits","last_op","last_val","hbuf","order","inf_leave","xflags","extra_len","inflate_fast","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_BUF_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_BINARY","Z_TEXT","Z_UNKNOWN","Z_DEFLATED","Inflate","zlib_inflate","GZheader","inflateGetHeader","inflateSetDictionary","inflate","inflator","next_out_utf8","tail","utf8str","allowBufError","inflateEnd","pako","require$$0","constants","FontNames","decompressJson","compressedJson","arrayToString","base64.decode","compressedJsonForFontName","Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique","Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique","Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic","ZapfDingbats","fontCache","Font","_this","getWidthOfGlyph","glyphName","CharWidths","getXAxisKerningForPair","leftGlyphName","rightGlyphName","KernPairXAmounts","load","fontName","cachedFont","json","font","JSON","parse","CharMetrics","reduce","acc","metric","N","WX","KernPairs","name1","name2","decompressedEncodings","allUnicodeMappings","Encoding","unicodeMappings","canEncodeUnicodeCodePoint","encodeUnicodeCodePoint","mapped","Encodings","symbol","zapfdingbats","WinAnsi","win1252","values","keys","map","StandardFontValues","isStandardFont","rectanglesAreEqual","x","height","backtick","getType","undefined","isNaN","isType","createTypeErrorMsg","valueName","types","allowedTypes","joinedTypes","assertIs","assertOrUndefined","assertEachIs","assertRange","assertMultiple","multiplier","pdfDocEncodingToUnicode","CharCodes","pdfDocEncodingDecode","Cache","populate","access","invalidate","populatedBy","MethodNotImplementedError","_super","className","methodName","PrivateConstructorError","UnexpectedObjectTypeError","expected","actual","isArray","UnsupportedEncodingError","encoding","ReparseError","MissingCatalogError","ref","MissingPageContentsEmbeddingError","UnrecognizedStreamTypeError","stream","contructor","PageEmbeddingMismatchedContextError","PDFArrayIsNotRectangleError","InvalidPDFDateStringError","NumberParsingError","line","column","PDFParsingError","details","NextByteAssertionError","expectedByte","actualByte","PDFObjectParsingError","byte","PDFInvalidObjectParsingError","PDFStreamParsingError","UnbalancedParenthesisError","StalledParserError","MissingPDFHeaderError","MissingKeywordError","keyword","PDFHeader","major","minor","bc","copyBytesInto","initialOffset","Percent","D","F","Dash","Period","Newline","forVersion","PDFObject","clone","_context","_buffer","_offset","PDFNumber","numberValue","stringValue","asNumber","of","PDFArray","context","object","index","splice","remove","get","lookupMaybe","asRectangle","lowerLeftX","lowerLeftY","asArray","withContext","arrayString","LeftSquareBracket","Space","RightSquareBracket","ENFORCER","PDFBool","enforcer","asBoolean","u","True","False","PDFDict","entries","has","delete","asMap","Map","dictString","LessThan","GreaterThan","fromMapWithContext","IsDelimiter","LeftParen","RightParen","LeftCurly","RightCurly","ForwardSlash","IsWhitespace","Null","Tab","FormFeed","CarriageReturn","IsIrregular","Hash","PDFOperatorNames","pool","PDFName","charCode","encodedName","ExclamationPoint","Tilde","asString","decodedValue","decodeName","instance","Length","FlateDecode","Resources","XObject","Contents","Type","Parent","MediaBox","Page","Annots","TrimBox","ArtBox","BleedBox","CropBox","Rotate","Title","Author","Subject","Creator","Keywords","Producer","CreationDate","ModDate","PDFNull","asNull","PDFStream","getContentsString","getContents","getContentsSize","updateDict","contentsSize","streamString","contents","PDFRawStream","asUint8Array","PDFRef","objectNumber","generationNumber","tag","PDFOperator","args","arg","EntryType","PDFFlateStream","encode","computeContents","unencodedContents","getUnencodedContents","contentsCache","PDFContentStream","operators","getUnencodedContentsSize","byAscendingObjectNumber","PDFContext","largestObjectNumber","trailerInfo","indirectObjects","nextRef","register","enumerateIndirectObjects","sort","literal","flateStream","Filter","getPushGraphicsStateContentStream","pushGraphicsStateContentStreamRef","Ops","PushGraphicsState","getPopGraphicsStateContentStream","popGraphicsStateContentStreamRef","PopGraphicsState","PDFPageLeaf","autoNormalizeCTM","normalized","dictOrRef","getInheritableAttribute","arrayOrRef","numberOrRef","attribute","ascend","setParent","parentRef","addContentStream","contentStreamRef","normalizedEntries","wrapContentStreams","startStream","endStream","setFontDictionary","fontDictRef","setXObject","xObjectRef","visitor","normalize","contentsRef","InheritableEntries","withContextAndParent","parent","PDFObjectCopier","traversedObjects","copyPDFPage","copyPDFDict","copyPDFArray","copyPDFStream","copyPDFIndirectObject","originalPage","clonedPage","originalDict","clonedDict","originalArray","clonedArray","originalStream","clonedStream","newRef","dereferencedValue","cloned","for","PDFCrossRefSection","firstEntry","subsections","chunkIdx","chunkLength","addEntry","append","deleted","addDeletedEntry","nextFreeObjectNumber","section","rangeIdx","rangeLen","entryIdx","entryLen","entry","subsection","subsectionLength","copySubsectionsIntoBuffer","firstObjectNumber","rangeLength","copyEntriesIntoBuffer","entryOffset","entryGen","currEntry","prevEntry","createEmpty","PDFTrailer","lastXRefOffset","E","O","forLastCrossRefSectionOffset","PDFTrailerDict","PDFObjectStream","objects","offsets","computeObjectOffsets","offsetsString","computeOffsetsString","getObjectsCount","withContextAndObjects","PDFWriter","objectsPerTick","parsedObjects","shouldWaitForTick","serializeToBuffer","xref","trailerDict","trailer","computeBufferSize","o","computeIndirectObjectSize","createTrailerDict","Size","Root","Encrypt","Info","ID","indirectObject","xrefOffset","forContext","PDFInvalidObject","ColorSpace","PDFCrossRefStream","computeIndex","computeEntryTuples","entryTuples","Deleted","Uncompressed","Compressed","objectStreamRef","computeMaxEntryByteWidths","entryTuplesCache","widths","third","firstSize","secondSize","thirdSize","maxByteWidthsCache","indexCache","addUncompressedEntry","addCompressedEntry","byteWidths","entriesLen","firstBytes","secondBytes","thirdBytes","PDFStreamWriter","encodeStreams","objectsPerStream","xrefStream","uncompressedObjects","compressedObjects","objectStreamRefs","objectStream","xrefStreamRef","PDFHexString","asBytes","hexLength","hexOffset","bytesOffset","decodeText","decodeDate","date","fromText","StandardFontEmbedder","FontName","encodeText","glyphs","encodeTextAsGlyphs","hexCodes","widthOfTextAtSize","totalWidth","right","kernAmount","widthOfGlyph","heightOfFontAtSize","Ascender","Descender","FontBBox","sizeOfFontAtHeight","embedIntoContext","fontDict","Subtype","BaseFont","fillCmapTemplate","bfChars","cmapHexFormat","cmapHexString","cmapCodePointFormat","hs","ls","PDFString","octal","escaped","pushByte","char","nextChar","Backspace","BackSlash","Zero","Seven","fromDate","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","CustomFontEmbedder","fontData","allGlyphsInFontSortedById","characterSet","glyphForCodePoint","scale","unitsPerEm","postscriptName","baseFontName","glyphCache","fontkit","layout","advanceWidth","ascent","descent","bbox","maxY","minY","embedFontDict","cidFontDictRef","unicodeCMapRef","embedCIDFontDict","embedUnicodeCmap","DescendantFonts","ToUnicode","isCFF","cff","fontDescriptorRef","cidFontDict","embedFontDescriptor","CIDSystemInfo","Registry","Ordering","Supplement","FontDescriptor","W","computeWidths","fontStreamRef","italicAngle","capHeight","xHeight","minX","maxX","fontDescriptor","embedFontStream","Flags","familyClass","sFamilyClass","fixedPitch","post","isFixedPitch","serif","symbolic","script","italic","macStyle","flipBit","bit","nonsymbolic","allCap","smallCap","forceBold","ItalicAngle","Ascent","Descent","CapHeight","XHeight","StemV","serializeFont","fontStream","cmap","glyphId","glyph","unicode","createCmap","bind","cmapStream","currSection","currGlyph","prevGlyph","currGlyphId","prevGlyphId","CustomFontSubsetEmbedder","subset","createSubset","glyphIdMap","subsetGlyphId","includeGlyph","parts","encodeStream","MARKERS","ChannelToColorSpace","DeviceGray","3","DeviceRGB","4","DeviceCMYK","JpegEmbedder","imageData","bitsPerComponent","colorSpace","dataView","marker","channelByte","channelName","DataView","getUint16","byteLength","getUint8","xObject","BitsPerComponent","Width","Height","Decode","H","UPNG","toRGBA8","tabs","acTL","decodeImage","frms","frames","img","empty","frm","fx","rect","fy","fw","fh","fdata","blend","_copyTile","dispose","area","bpp","decode","_getBPP","bpl","bf","bf32","Uint32Array","ctype","rs","_bin","readUshort","qarea","ts","ti","tr","tg","tb","qi","ap","tl","s0","t0","cj","gr","di","off","al","buff","fd","bin","rUs","rUi","readUint","dd","doff","foff","mgck","readASCII","_IHDR","num_frames","num_plays","fr","_decompress","rct","del","delay","round","nz","nextZero","keyw","readUTF8","readBytes","pl","compress","interlace","filter","_inflate","_filterZero","_readInterlace","inflateRaw","C","R","J","Q","X","V","A","M","I","Z","K","S","T","z","$","Y","byteOffset","cbpp","starting_row","starting_col","row_increment","col_increment","pass","ri","ci","sw","sh","cr","cc","bpll","row","col","cdi","ii","paeth","_paeth","pa","pb","pc","writeUshort","writeUint","writeASCII","pad","ns","decodeURIComponent","sb","tw","th","xoff","yoff","si","fa","fg","fb","ba","br","bg","bb","ifa","oa","ioa","bufs","ps","dels","forbidPlte","nimg","compressPNG","_main","encodeLL","ac","bipp","bipl","wUi","wUs","wAs","anim","pltAlpha","leng","dl","plte","cimg","wr","fi","imgd","ioff","levelZero","nh","prms","onlyBlend","evenCrd","forbidPrev","minBits","alphaAnd","ilen","gotAlpha","framize","inds","nbufs","abuf","concatRGBA","qres","quantize","cof","bln","est","rgba","img32","nw","ind","cmc","inj","alwaysBlend","cimg32","nx","ny","tlim","tstp","tarea","it","pimg","p32","mix","miy","may","sarea","_prepareDiff","r0","r1","miX","miY","_updateFrame","U8","U32","pimg32","cx","cy","rec","fls","ftry","CMPR","UZIP","_filterLine","tsize","tab","update","oimg","nimg32","KD","getKDtree","leafs","planeDst","nd","getNearest","i0","i1","bst","tdst","stats","estats","maxL","mi","L","splitPixels","eMq255","ln","rn","node0","node1","eMq","d0","d1","d2","d3","vecDot","m0","m1","m2","m3","iN","Rj","M4","tmi","multVec","sqrt","dot","sml","Cov","tlen","noff","PngType","PNG","pngData","upng","rgbaChannel","pixelCount","rgbChannel","alphaChannel","rgbaOffset","rgbOffset","alphaOffset","splitAlphaChannel","some","Greyscale","Truecolour","IndexedColour","GreyscaleWithAlpha","TruecolourWithAlpha","getImageType","PngEmbedder","png","image","SMask","embedAlphaChannel","Stream","defineProperty","enumerable","configurable","getByte","b0","b1","getInt32","getBytes","forceClamped","strEnd","Uint8ClampedArray","peekByte","peekedByte","peekBytes","skip","reset","moveStart","makeSubStream","emptyBuffer","DecodeStream","maybeMinBufferLength","eof","minBufferLength","readBlock","ensureBuffer","bufEnd","requested","buffer2","isSpace","ch","Ascii85Stream","maybeLength","AsciiHexStream","firstDigit","maxDecodeLength","digit","codeLenCodeMap","lengthDecode","distDecode","fixedLitCodeTab","fixedDistCodeTab","FlateStream","cmf","flg","codeSize","codeBuf","hdr","getBits","litCodeTable","distCodeTable","numLitCodes","numDistCodes","numCodeLenCodes","codeLenCodeLengths","codeLenCodeTab","generateHuffmanTable","codeLengths","bitsLength","bitsOffset","what","getCode","repeatLength","code1","code2","blockLen","maxLen","console","log","codeLen","codeVal","lengths","LZWStream","earlyChange","cachedData","bitsCached","lzwState","codeLength","nextCode","dictionaryValues","dictionaryLengths","dictionaryPrevCodes","currentSequence","currentSequenceLength","estimatedDecodedSize","blockSize","prevCode","decodedLength","currentBufferLength","readBits","hasPrev","RunLengthStream","repeatHeader","decodeStream","params","EarlyChange","decodePDFRawStream","DecodeParms","PDFPageEmbedder","page","boundingBox","transformationMatrix","mediaBox","bottom","fullPageBoundingBox","boundingBoxAdjustedMatrix","decodedContents","decodeContents","FormType","BBox","Matrix","newline","content","PDFCatalog","Pages","insertLeafNode","leafRef","pagesRef","removeLeafNode","withContextAndPages","pages","PDFPageTree","Kids","Count","pushTreeNode","treeRef","pushLeafNode","targetIndex","kidSize","kidIdx","pageIdx","kidRef","kid","kidCount","target","traverse","IsDigit","One","Two","Three","Four","Five","Six","Eight","Nine","IsNumericPrefix","Plus","Minus","IsNumeric","RotationTypes","BaseParser","parseRawInt","peek","Number","isFinite","position","parseRawNumber","skipWhitespace","skipLine","skipComment","skipWhitespaceAndComments","matchKeyword","moveTo","ByteStream","assertNext","peekAhead","steps","peekAt","fromPDFRawStream","rawStream","endstream","endobj","startxref","true","false","null","streamEOF1","streamEOF2","streamEOF3","streamEOF4","EOF1endstream","EOF2endstream","EOF3endstream","PDFObjectParser","byteStream","parseObject","parseDictOrStream","parseHexString","parseString","parseName","parseArray","parseNumberOrRef","firstNum","lookaheadStart","secondNum","nestingLvl","isEscaped","pdfArray","parseDict","startPos","findEndOfStreamFallback","forBytes","forByteStream","PDFObjectStreamParser","alreadyParsed","firstOffset","objectCount","parseIntoContext","offsetsAndObjectNumbers","parseOffsetsAndObjectNumbers","forStream","PDFXRefStreamParser","Index","length_1","parseEntries","typeFieldWidth","offsetFieldWidth","genFieldWidth","subsectionIdx","subsectionLen","length_2","objIdx","inObjectStream","PDFParser","pdfBytes","throwOnInvalidObject","Infinity","parseDocument","prevOffset","parseHeader","parseDocumentSection","maybeRecoverRoot","isValidCatalog","skipBinaryHeaderComment","parseIndirectObjectHeader","matchIndirectObjectHeader","parseIndirectObject","tryToParseInvalidIndirectObject","stringify","warn","failed","parseIndirectObjects","skipJibberish","maybeParseCrossRefSection","firstInt","secondInt","maybeParseTrailerDict","maybeParseTrailer","forBytesWithOptions","asPDFName","asPDFNumber","LineCapStyle","degrees","degreeAngle","Degrees","angle","Radians","degreesToRadians","degree","PI","radiansToDegrees","radian","toRadians","rotation","toDegrees","cos","sin","tan","concatTransformationMatrix","ConcatTransformationMatrix","translate","xPos","yPos","rotateRadians","skewRadians","xSkewAngle","ySkewAngle","setDashPattern","dashArray","dashPhase","SetLineDashPattern","LineJoinStyle","TextRenderingMode","pushGraphicsState","popGraphicsState","setLineWidth","SetLineWidth","appendBezierCurve","x1","y1","x2","y2","x3","y3","AppendBezierCurve","appendQuadraticCurve","CurveToReplicateInitialPoint","closePath","ClosePath","MoveTo","lineTo","LineTo","rectangle","AppendRectangle","stroke","StrokePath","FillNonZero","fillAndStroke","FillNonZeroAndStroke","nextLine","NextLine","showText","ShowText","beginText","BeginText","endText","EndText","setFontAndSize","SetFontAndSize","setLineHeight","lineHeight","SetTextLineHeight","ColorTypes","setTextMatrix","SetTextMatrix","rotateAndSkewTextRadiansAndTranslate","rotationAngle","drawObject","DrawObject","setFillingGrayscaleColor","gray","NonStrokingColorGray","setStrokingGrayscaleColor","StrokingColorGray","setFillingRgbColor","red","green","blue","NonStrokingColorRgb","setStrokingRgbColor","StrokingColorRgb","setFillingCmykColor","cyan","magenta","yellow","NonStrokingColorCmyk","setStrokingCmykColor","StrokingColorCmyk","StandardFonts","rgb","RGB","Grayscale","CMYK","setFillingColor","color","setStrokingColor","EncryptedPDFError","FontkitNotRegisteredError","ForeignPageError","RemovePageFromEmptyDocumentError","px","py","sx","sy","parameters","runners","cmd","cmds","solveArc","coords","rx","ry","rot","large","sweep","ex","ey","segs_1","arcToSegments","seg","bez","segmentToBezier","rotateX","ox","oy","sinTh","cosTh","a00","a01","a10","a11","x0","y0","sfactorSq","sfactor","xc","yc","th0","atan2","thArc","segments","th2","th3","cx1","cy1","th1","thHalf","svgPathToOperators","path","commands","curArg","foundDecimal","path_1","drawLinesOfText","rotate","xSkew","ySkew","drawImage","drawPage","xScale","yScale","drawLine","thickness","Boolean","drawRectangle","borderColor","borderWidth","KAPPA","drawEllipsePath","config","xe","ye","xm","ym","drawEllipse","drawSvgPath","PageSizes","4A0","2A0","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","A10","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","B10","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","RA0","RA1","RA2","RA3","RA4","SRA0","SRA1","SRA2","SRA3","SRA4","Executive","Folio","Legal","Letter","Tabloid","ParseSpeeds","PDFEmbeddedPage","doc","embedder","alreadyEmbedded","PDFDocument","factor","embed","PDFFont","modified","heightAtSize","sizeAtHeight","getCharacterSet","PDFImage","PDFPage","leafNode","fontSize","fontColor","setRotation","degreesAngle","getRotation","setSize","getMediaBox","setMediaBox","cropBox","getCropBox","bleedBox","getBleedBox","trimBox","getTrimBox","artBox","getArtBox","hasCropBox","hasBleedBox","hasTrimBox","hasArtBox","setCropBox","setBleedBox","setTrimBox","setArtBox","setWidth","getSize","setHeight","getWidth","getHeight","translateContent","getContentStream","createContentStream","startRef","endRef","resetPosition","setFont","fontKey","setFontSize","setFontColor","getPosition","getX","getY","moveDown","yDecrease","moveUp","yIncrease","moveLeft","xDecrease","moveRight","xIncrease","pushOperators","operator","contentStream","drawText","originalFont","getFont","defaultWordBreaks","encodedLines","xObjectKey","embeddedPage","_j","_k","drawSquare","drawCircle","embedStandardFont","useExisting","dummyRef","pageLeaf","ignoreEncryption","updateMetadata","computePages","catalog","pageMap","isEncrypted","pageCache","fonts","images","embeddedPages","updateInfoDict","pdf","parseSpeed","Slow","pageTree","pageTreeRef","registerFontkit","getTitle","title","getInfoDict","assertIsLiteralOrHexString","getAuthor","author","getSubject","subject","getKeywords","keywords","getCreator","creator","getProducer","producer","getCreationDate","creationDate","getModificationDate","modificationDate","setTitle","setAuthor","setSubject","setKeywords","setCreator","setProducer","setLanguage","language","setCreationDate","setModificationDate","getPageCount","pageCount","getPages","getPage","getPageIndices","removePage","addPage","insertPage","dims","copyPages","srcDoc","copier","srcPages","copiedPages","srcPage","copiedPage","embedFont","pdfFont","assertFontkit","embedJpg","jpg","pdfImage","embedPng","embedPdf","embedPages","embedPage","boundingBoxes","transformationMatrices","currPage","nextPage","maybeCopyPage","box","matrix","embedAll","save","useObjectStreams","addDefaultPage","saveAsBase64","otherOptions","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__rest","embeddables","pdfLib","now","info","existingInfo","newInfo","pdfObject","ClipNonZero","ClipEvenOdd","EndPath","MoveText","radianAngle","spacing","SetCharacterSpacing","squeeze","SetTextHorizontalScaling","style","SetLineCapStyle","SetLineJoinStyle","SetTextRenderingMode","rise","SetTextRise","SetWordSpacing","byte1","byte2","byte3","byte4"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOA,EAAEM,eAAeD,KAAIN,EAAEM,GAAKL,EAAEK,MACpDN,EAAGC,IAGrB,SAASO,EAAUR,EAAGC,GAEzB,SAASQ,IAAOC,KAAKC,YAAcX,EADnCD,EAAcC,EAAGC,GAEjBD,EAAEY,UAAkB,OAANX,EAAa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