/*! pdfmake v0.2.4, @license MIT, @link http://pdfmake.org */ (function webpackUniversalModuleDefinition (root, factory) { if (typeof exports === 'object' && typeof module === 'object') { module.exports = factory() } else if (typeof define === 'function' && define.amd) { define([], factory) } else { const a = factory() for (const i in a) (typeof exports === 'object' ? exports : root)[i] = a[i] } })(typeof self !== 'undefined' ? self : this, function () { return /******/ (function () { // webpackBootstrap /******/ const __webpack_modules__ = ({ /***/ 9282: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const process = __webpack_require__(4155) // Currently in sync with Node.js lib/assert.js // https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b // Originally from narwhal.js (http://narwhaljs.org) // Copyright (c) 2009 Thomas Robinson <280north.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the 'Software'), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. function _typeof (obj) { if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { _typeof = function _typeof (obj) { return typeof obj } } else { _typeof = function _typeof (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj } } return _typeof(obj) } function _classCallCheck (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function') } } const _require = __webpack_require__(2136) const _require$codes = _require.codes const ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT const ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE const ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE const ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE const ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS const AssertionError = __webpack_require__(5961) const _require2 = __webpack_require__(9539) const inspect = _require2.inspect const _require$types = (__webpack_require__(9539).types) const isPromise = _require$types.isPromise const isRegExp = _require$types.isRegExp const objectAssign = Object.assign ? Object.assign : (__webpack_require__(8091).assign) const objectIs = Object.is ? Object.is : __webpack_require__(609) const errorCache = new Map() let isDeepEqual let isDeepStrictEqual let parseExpressionAt let findNodeAround let decoder function lazyLoadComparison () { const comparison = __webpack_require__(9158) isDeepEqual = comparison.isDeepEqual isDeepStrictEqual = comparison.isDeepStrictEqual } // Escape control characters but not \n and \t to keep the line breaks and // indentation intact. // eslint-disable-next-line no-control-regex const escapeSequencesRegExp = /[\x00-\x08\x0b\x0c\x0e-\x1f]/g const meta = (/* unused pure expression or super */ null && (['\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', '\\b', '', '', '\\u000b', '\\f', '', '\\u000e', '\\u000f', '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018', '\\u0019', '\\u001a', '\\u001b', '\\u001c', '\\u001d', '\\u001e', '\\u001f'])) const escapeFn = function escapeFn (str) { return meta[str.charCodeAt(0)] } let warned = false // The assert module provides functions that throw // AssertionError's when particular conditions are not met. The // assert module must conform to the following interface. const assert = module.exports = ok const NO_EXCEPTION_SENTINEL = {} // All of the following functions must throw an AssertionError // when a corresponding condition is not met, with a message that // may be undefined if not provided. All assertion methods provide // both the actual and expected values to the assertion error for // display purposes. function innerFail (obj) { if (obj.message instanceof Error) throw obj.message throw new AssertionError(obj) } function fail (actual, expected, message, operator, stackStartFn) { const argsLen = arguments.length let internalMessage if (argsLen === 0) { internalMessage = 'Failed' } else if (argsLen === 1) { message = actual actual = undefined } else { if (warned === false) { warned = true const warn = process.emitWarning ? process.emitWarning : console.warn.bind(console) warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094') } if (argsLen === 2) operator = '!=' } if (message instanceof Error) throw message const errArgs = { actual, expected, operator: operator === undefined ? 'fail' : operator, stackStartFn: stackStartFn || fail } if (message !== undefined) { errArgs.message = message } const err = new AssertionError(errArgs) if (internalMessage) { err.message = internalMessage err.generatedMessage = true } throw err } assert.fail = fail // The AssertionError is defined in internal/error. assert.AssertionError = AssertionError function innerOk (fn, argLen, value, message) { if (!value) { let generatedMessage = false if (argLen === 0) { generatedMessage = true message = 'No value argument passed to `assert.ok()`' } else if (message instanceof Error) { throw message } const err = new AssertionError({ actual: value, expected: true, message, operator: '==', stackStartFn: fn }) err.generatedMessage = generatedMessage throw err } } // Pure assertion tests whether a value is truthy, as determined // by !!value. function ok () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } innerOk.apply(void 0, [ok, args.length].concat(args)) } assert.ok = ok // The equality assertion tests shallow, coercive equality with ==. /* eslint-disable no-restricted-properties */ assert.equal = function equal (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } // eslint-disable-next-line eqeqeq if (actual != expected) { innerFail({ actual, expected, message, operator: '==', stackStartFn: equal }) } } // The non-equality assertion tests for whether two objects are not // equal with !=. assert.notEqual = function notEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } // eslint-disable-next-line eqeqeq if (actual == expected) { innerFail({ actual, expected, message, operator: '!=', stackStartFn: notEqual }) } } // The equivalence assertion tests a deep equality relation. assert.deepEqual = function deepEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } if (isDeepEqual === undefined) lazyLoadComparison() if (!isDeepEqual(actual, expected)) { innerFail({ actual, expected, message, operator: 'deepEqual', stackStartFn: deepEqual }) } } // The non-equivalence assertion tests for any deep inequality. assert.notDeepEqual = function notDeepEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } if (isDeepEqual === undefined) lazyLoadComparison() if (isDeepEqual(actual, expected)) { innerFail({ actual, expected, message, operator: 'notDeepEqual', stackStartFn: notDeepEqual }) } } /* eslint-enable */ assert.deepStrictEqual = function deepStrictEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } if (isDeepEqual === undefined) lazyLoadComparison() if (!isDeepStrictEqual(actual, expected)) { innerFail({ actual, expected, message, operator: 'deepStrictEqual', stackStartFn: deepStrictEqual }) } } assert.notDeepStrictEqual = notDeepStrictEqual function notDeepStrictEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } if (isDeepEqual === undefined) lazyLoadComparison() if (isDeepStrictEqual(actual, expected)) { innerFail({ actual, expected, message, operator: 'notDeepStrictEqual', stackStartFn: notDeepStrictEqual }) } } assert.strictEqual = function strictEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } if (!objectIs(actual, expected)) { innerFail({ actual, expected, message, operator: 'strictEqual', stackStartFn: strictEqual }) } } assert.notStrictEqual = function notStrictEqual (actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected') } if (objectIs(actual, expected)) { innerFail({ actual, expected, message, operator: 'notStrictEqual', stackStartFn: notStrictEqual }) } } const Comparison = function Comparison (obj, keys, actual) { const _this = this _classCallCheck(this, Comparison) keys.forEach(function (key) { if (key in obj) { if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && obj[key].test(actual[key])) { _this[key] = actual[key] } else { _this[key] = obj[key] } } }) } function compareExceptionKey (actual, expected, key, message, keys, fn) { if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) { if (!message) { // Create placeholder objects to create a nice output. const a = new Comparison(actual, keys) const b = new Comparison(expected, keys, actual) const err = new AssertionError({ actual: a, expected: b, operator: 'deepStrictEqual', stackStartFn: fn }) err.actual = actual err.expected = expected err.operator = fn.name throw err } innerFail({ actual, expected, message, operator: fn.name, stackStartFn: fn }) } } function expectedException (actual, expected, msg, fn) { if (typeof expected !== 'function') { if (isRegExp(expected)) return expected.test(actual) // assert.doesNotThrow does not accept objects. if (arguments.length === 2) { throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected) } // Handle primitives properly. if (_typeof(actual) !== 'object' || actual === null) { const err = new AssertionError({ actual, expected, message: msg, operator: 'deepStrictEqual', stackStartFn: fn }) err.operator = fn.name throw err } const keys = Object.keys(expected) // Special handle errors to make sure the name and the message are compared // as well. if (expected instanceof Error) { keys.push('name', 'message') } else if (keys.length === 0) { throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object') } if (isDeepEqual === undefined) lazyLoadComparison() keys.forEach(function (key) { if (typeof actual[key] === 'string' && isRegExp(expected[key]) && expected[key].test(actual[key])) { return } compareExceptionKey(actual, expected, key, msg, keys, fn) }) return true } // Guard instanceof against arrow functions as they don't have a prototype. if (expected.prototype !== undefined && actual instanceof expected) { return true } if (Error.isPrototypeOf(expected)) { return false } return expected.call({}, actual) === true } function getActual (fn) { if (typeof fn !== 'function') { throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn) } try { fn() } catch (e) { return e } return NO_EXCEPTION_SENTINEL } function checkIsPromise (obj) { // Accept native ES6 promises and promises that are implemented in a similar // way. Do not accept thenables that use a function as `obj` and that have no // `catch` handler. // TODO: thenables are checked up until they have the correct methods, // but according to documentation, the `then` method should receive // the `fulfill` and `reject` arguments as well or it may be never resolved. return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function' } function waitForActual (promiseFn) { return Promise.resolve().then(function () { let resultPromise if (typeof promiseFn === 'function') { // Return a rejected promise if `promiseFn` throws synchronously. resultPromise = promiseFn() // Fail in case no promise is returned. if (!checkIsPromise(resultPromise)) { throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise) } } else if (checkIsPromise(promiseFn)) { resultPromise = promiseFn } else { throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn) } return Promise.resolve().then(function () { return resultPromise }).then(function () { return NO_EXCEPTION_SENTINEL }).catch(function (e) { return e }) }) } function expectsError (stackStartFn, actual, error, message) { if (typeof error === 'string') { if (arguments.length === 4) { throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error) } if (_typeof(actual) === 'object' && actual !== null) { if (actual.message === error) { throw new ERR_AMBIGUOUS_ARGUMENT('error/message', 'The error message "'.concat(actual.message, '" is identical to the message.')) } } else if (actual === error) { throw new ERR_AMBIGUOUS_ARGUMENT('error/message', 'The error "'.concat(actual, '" is identical to the message.')) } message = error error = undefined } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') { throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error) } if (actual === NO_EXCEPTION_SENTINEL) { let details = '' if (error && error.name) { details += ' ('.concat(error.name, ')') } details += message ? ': '.concat(message) : '.' const fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception' innerFail({ actual: undefined, expected: error, operator: stackStartFn.name, message: 'Missing expected '.concat(fnType).concat(details), stackStartFn }) } if (error && !expectedException(actual, error, message, stackStartFn)) { throw actual } } function expectsNoError (stackStartFn, actual, error, message) { if (actual === NO_EXCEPTION_SENTINEL) return if (typeof error === 'string') { message = error error = undefined } if (!error || expectedException(actual, error)) { const details = message ? ': '.concat(message) : '.' const fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception' innerFail({ actual, expected: error, operator: stackStartFn.name, message: 'Got unwanted '.concat(fnType).concat(details, '\n') + 'Actual message: "'.concat(actual && actual.message, '"'), stackStartFn }) } throw actual } assert.throws = function throws (promiseFn) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2] } expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args)) } assert.rejects = function rejects (promiseFn) { for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { args[_key3 - 1] = arguments[_key3] } return waitForActual(promiseFn).then(function (result) { return expectsError.apply(void 0, [rejects, result].concat(args)) }) } assert.doesNotThrow = function doesNotThrow (fn) { for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { args[_key4 - 1] = arguments[_key4] } expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args)) } assert.doesNotReject = function doesNotReject (fn) { for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { args[_key5 - 1] = arguments[_key5] } return waitForActual(fn).then(function (result) { return expectsNoError.apply(void 0, [doesNotReject, result].concat(args)) }) } assert.ifError = function ifError (err) { if (err !== null && err !== undefined) { let message = 'ifError got unwanted exception: ' if (_typeof(err) === 'object' && typeof err.message === 'string') { if (err.message.length === 0 && err.constructor) { message += err.constructor.name } else { message += err.message } } else { message += inspect(err) } const newErr = new AssertionError({ actual: err, expected: null, operator: 'ifError', message, stackStartFn: ifError }) // Make sure we actually have a stack trace! const origStack = err.stack if (typeof origStack === 'string') { // This will remove any duplicated frames from the error frames taken // from within `ifError` and add the original error frames to the newly // created ones. const tmp2 = origStack.split('\n') tmp2.shift() // Filter all frames existing in err.stack. let tmp1 = newErr.stack.split('\n') for (let i = 0; i < tmp2.length; i++) { // Find the first occurrence of the frame. const pos = tmp1.indexOf(tmp2[i]) if (pos !== -1) { // Only keep new frames. tmp1 = tmp1.slice(0, pos) break } } newErr.stack = ''.concat(tmp1.join('\n'), '\n').concat(tmp2.join('\n')) } throw newErr } } // Expose a strict only variant of assert function strict () { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6] } innerOk.apply(void 0, [strict, args.length].concat(args)) } assert.strict = objectAssign(strict, assert, { equal: assert.strictEqual, deepEqual: assert.deepStrictEqual, notEqual: assert.notStrictEqual, notDeepEqual: assert.notDeepStrictEqual }) assert.strict.strict = assert.strict /***/ }, /***/ 5961: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const process = __webpack_require__(4155) // Currently in sync with Node.js lib/internal/assert/assertion_error.js // https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c function _objectSpread (target) { for (let i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; let ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable })) } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]) }) } return target } function _defineProperty (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } function _classCallCheck (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function') } } function _defineProperties (target, props) { for (let i = 0; i < props.length; i++) { const descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass (Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor } function _possibleConstructorReturn (self, call) { if (call && (_typeof(call) === 'object' || typeof call === 'function')) { return call } return _assertThisInitialized(self) } function _assertThisInitialized (self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _inherits (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function') } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass) } function _wrapNativeSuper (Class) { const _cache = typeof Map === 'function' ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper (Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== 'function') { throw new TypeError('Super expression must either be null or a function') } if (typeof _cache !== 'undefined') { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper) } function Wrapper () { return _construct(Class, arguments, _getPrototypeOf(this).constructor) } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class) }; return _wrapNativeSuper(Class) } function isNativeReflectConstruct () { if (typeof Reflect === 'undefined' || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === 'function') return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true } catch (e) { return false } } function _construct (Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct } else { _construct = function _construct (Parent, args, Class) { const a = [null]; a.push.apply(a, args); const Constructor = Function.bind.apply(Parent, a); const instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance } } return _construct.apply(null, arguments) } function _isNativeFunction (fn) { return Function.toString.call(fn).indexOf('[native code]') !== -1 } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } function _getPrototypeOf (o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf (o) { return o.__proto__ || Object.getPrototypeOf(o) }; return _getPrototypeOf(o) } function _typeof (obj) { if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { _typeof = function _typeof (obj) { return typeof obj } } else { _typeof = function _typeof (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj } } return _typeof(obj) } const _require = __webpack_require__(9539) const inspect = _require.inspect const _require2 = __webpack_require__(2136) const ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith (str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length } return str.substring(this_len - search.length, this_len) === search } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat function repeat (str, count) { count = Math.floor(count) if (str.length == 0 || count == 0) return '' const maxCount = str.length * count count = Math.floor(Math.log(count) / Math.log(2)) while (count) { str += str count-- } str += str.substring(0, maxCount - str.length) return str } let blue = '' let green = '' let red = '' let white = '' const kReadableOperator = { deepStrictEqual: 'Expected values to be strictly deep-equal:', strictEqual: 'Expected values to be strictly equal:', strictEqualObject: 'Expected "actual" to be reference-equal to "expected":', deepEqual: 'Expected values to be loosely deep-equal:', equal: 'Expected values to be loosely equal:', notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:', notStrictEqual: 'Expected "actual" to be strictly unequal to:', notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":', notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:', notEqual: 'Expected "actual" to be loosely unequal to:', notIdentical: 'Values identical but not reference-equal:' } // Comparing short primitives should just show === / !== instead of using the // diff. const kMaxShortLength = 10 function copyError (source) { const keys = Object.keys(source) const target = Object.create(Object.getPrototypeOf(source)) keys.forEach(function (key) { target[key] = source[key] }) Object.defineProperty(target, 'message', { value: source.message }) return target } function inspectValue (val) { // The util.inspect default values could be changed. This makes sure the // error messages contain the necessary information nevertheless. return inspect(val, { compact: false, customInspect: false, depth: 1000, maxArrayLength: Infinity, // Assert compares only enumerable properties (with a few exceptions). showHidden: false, // Having a long line as error is better than wrapping the line for // comparison for now. // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we // have meta information about the inspected properties (i.e., know where // in what line the property starts and ends). breakLength: Infinity, // Assert does not detect proxies currently. showProxy: false, sorted: true, // Inspect getters as we also check them when comparing entries. getters: true }) } function createErrDiff (actual, expected, operator) { let other = '' let res = '' let lastPos = 0 let end = '' let skipped = false const actualInspected = inspectValue(actual) const actualLines = actualInspected.split('\n') const expectedLines = inspectValue(expected).split('\n') let i = 0 let indicator = '' // In case both values are objects explicitly mark them as not reference equal // for the `strictEqual` operator. if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) { operator = 'strictEqualObject' } // If "actual" and "expected" fit on a single line and they are not strictly // equal, check further special handling. if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) { const inputLength = actualLines[0].length + expectedLines[0].length // If the character length of "actual" and "expected" together is less than // kMaxShortLength and if neither is an object and at least one of them is // not `zero`, use the strict equal comparison to visualize the output. if (inputLength <= kMaxShortLength) { if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) { // -0 === +0 return ''.concat(kReadableOperator[operator], '\n\n') + ''.concat(actualLines[0], ' !== ').concat(expectedLines[0], '\n') } } else if (operator !== 'strictEqualObject') { // If the stderr is a tty and the input length is lower than the current // columns per line, add a mismatch indicator below the output. If it is // not a tty, use a default value of 80 characters. const maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80 if (inputLength < maxLength) { while (actualLines[0][i] === expectedLines[0][i]) { i++ } // Ignore the first characters. if (i > 2) { // Add position indicator for the first mismatch in case it is a // single line and the input length is less than the column length. indicator = '\n '.concat(repeat(' ', i), '^') i = 0 } } } } // Remove all ending lines that match (this optimizes the output for // readability by reducing the number of total changed lines). let a = actualLines[actualLines.length - 1] let b = expectedLines[expectedLines.length - 1] while (a === b) { if (i++ < 2) { end = '\n '.concat(a).concat(end) } else { other = a } actualLines.pop() expectedLines.pop() if (actualLines.length === 0 || expectedLines.length === 0) break a = actualLines[actualLines.length - 1] b = expectedLines[expectedLines.length - 1] } const maxLines = Math.max(actualLines.length, expectedLines.length) // Strict equal with identical objects that are not identical by reference. // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() }) if (maxLines === 0) { // We have to get the result again. The lines were all removed before. const _actualLines = actualInspected.split('\n') // Only remove lines in case it makes sense to collapse those. // TODO: Accept env to always show the full error. if (_actualLines.length > 30) { _actualLines[26] = ''.concat(blue, '...').concat(white) while (_actualLines.length > 27) { _actualLines.pop() } } return ''.concat(kReadableOperator.notIdentical, '\n\n').concat(_actualLines.join('\n'), '\n') } if (i > 3) { end = '\n'.concat(blue, '...').concat(white).concat(end) skipped = true } if (other !== '') { end = '\n '.concat(other).concat(end) other = '' } let printedLines = 0 const msg = kReadableOperator[operator] + '\n'.concat(green, '+ actual').concat(white, ' ').concat(red, '- expected').concat(white) const skippedMsg = ' '.concat(blue, '...').concat(white, ' Lines skipped') for (i = 0; i < maxLines; i++) { // Only extra expected lines exist const cur = i - lastPos if (actualLines.length < i + 1) { // If the last diverging line is more than one line above and the // current line is at least line three, add some of the former lines and // also add dots to indicate skipped entries. if (cur > 1 && i > 2) { if (cur > 4) { res += '\n'.concat(blue, '...').concat(white) skipped = true } else if (cur > 3) { res += '\n '.concat(expectedLines[i - 2]) printedLines++ } res += '\n '.concat(expectedLines[i - 1]) printedLines++ } // Mark the current line as the last diverging one. lastPos = i // Add the expected line to the cache. other += '\n'.concat(red, '-').concat(white, ' ').concat(expectedLines[i]) printedLines++ // Only extra actual lines exist } else if (expectedLines.length < i + 1) { // If the last diverging line is more than one line above and the // current line is at least line three, add some of the former lines and // also add dots to indicate skipped entries. if (cur > 1 && i > 2) { if (cur > 4) { res += '\n'.concat(blue, '...').concat(white) skipped = true } else if (cur > 3) { res += '\n '.concat(actualLines[i - 2]) printedLines++ } res += '\n '.concat(actualLines[i - 1]) printedLines++ } // Mark the current line as the last diverging one. lastPos = i // Add the actual line to the result. res += '\n'.concat(green, '+').concat(white, ' ').concat(actualLines[i]) printedLines++ // Lines diverge } else { const expectedLine = expectedLines[i] let actualLine = actualLines[i] // If the lines diverge, specifically check for lines that only diverge by // a trailing comma. In that case it is actually identical and we should // mark it as such. let divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine) // If the expected line has a trailing comma but is otherwise identical, // add a comma at the end of the actual line. Otherwise the output could // look weird as in: // // [ // 1 // No comma at the end! // + 2 // ] // if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) { divergingLines = false actualLine += ',' } if (divergingLines) { // If the last diverging line is more than one line above and the // current line is at least line three, add some of the former lines and // also add dots to indicate skipped entries. if (cur > 1 && i > 2) { if (cur > 4) { res += '\n'.concat(blue, '...').concat(white) skipped = true } else if (cur > 3) { res += '\n '.concat(actualLines[i - 2]) printedLines++ } res += '\n '.concat(actualLines[i - 1]) printedLines++ } // Mark the current line as the last diverging one. lastPos = i // Add the actual line to the result and cache the expected diverging // line so consecutive diverging lines show up as +++--- and not +-+-+-. res += '\n'.concat(green, '+').concat(white, ' ').concat(actualLine) other += '\n'.concat(red, '-').concat(white, ' ').concat(expectedLine) printedLines += 2 // Lines are identical } else { // Add all cached information to the result before adding other things // and reset the cache. res += other other = '' // If the last diverging line is exactly one line above or if it is the // very first line, add the line to the result. if (cur === 1 || i === 0) { res += '\n '.concat(actualLine) printedLines++ } } } // Inspected object to big (Show ~20 rows max) if (printedLines > 20 && i < maxLines - 2) { return ''.concat(msg).concat(skippedMsg, '\n').concat(res, '\n').concat(blue, '...').concat(white).concat(other, '\n') + ''.concat(blue, '...').concat(white) } } return ''.concat(msg).concat(skipped ? skippedMsg : '', '\n').concat(res).concat(other).concat(end).concat(indicator) } const AssertionError = /* #__PURE__ */ (function (_Error) { _inherits(AssertionError, _Error) function AssertionError (options) { let _this _classCallCheck(this, AssertionError) if (_typeof(options) !== 'object' || options === null) { throw new ERR_INVALID_ARG_TYPE('options', 'Object', options) } const message = options.message const operator = options.operator const stackStartFn = options.stackStartFn let actual = options.actual let expected = options.expected const limit = Error.stackTraceLimit Error.stackTraceLimit = 0 if (message != null) { _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, String(message))) } else { if (process.stderr && process.stderr.isTTY) { // Reset on each call to make sure we handle dynamically set environment // variables correct. if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) { blue = '\x1B[34m' green = '\x1B[32m' white = '\x1B[39m' red = '\x1B[31m' } else { blue = '' green = '' white = '' red = '' } } // Prevent the error stack from being visible by duplicating the error // in a very close way to the original in case both sides are actually // instances of Error. if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) { actual = copyError(actual) expected = copyError(expected) } if (operator === 'deepStrictEqual' || operator === 'strictEqual') { _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, createErrDiff(actual, expected, operator))) } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') { // In case the objects are equal but the operator requires unequal, show // the first object and say A equals B let base = kReadableOperator[operator] const res = inspectValue(actual).split('\n') // In case "actual" is an object, it should not be reference equal. if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) { base = kReadableOperator.notStrictEqualObject } // Only remove lines in case it makes sense to collapse those. // TODO: Accept env to always show the full error. if (res.length > 30) { res[26] = ''.concat(blue, '...').concat(white) while (res.length > 27) { res.pop() } } // Only print a single input. if (res.length === 1) { _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, ''.concat(base, ' ').concat(res[0]))) } else { _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, ''.concat(base, '\n\n').concat(res.join('\n'), '\n'))) } } else { let _res = inspectValue(actual) let other = '' const knownOperators = kReadableOperator[operator] if (operator === 'notDeepEqual' || operator === 'notEqual') { _res = ''.concat(kReadableOperator[operator], '\n\n').concat(_res) if (_res.length > 1024) { _res = ''.concat(_res.slice(0, 1021), '...') } } else { other = ''.concat(inspectValue(expected)) if (_res.length > 512) { _res = ''.concat(_res.slice(0, 509), '...') } if (other.length > 512) { other = ''.concat(other.slice(0, 509), '...') } if (operator === 'deepEqual' || operator === 'equal') { _res = ''.concat(knownOperators, '\n\n').concat(_res, '\n\nshould equal\n\n') } else { other = ' '.concat(operator, ' ').concat(other) } } _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError).call(this, ''.concat(_res).concat(other))) } } Error.stackTraceLimit = limit _this.generatedMessage = !message Object.defineProperty(_assertThisInitialized(_this), 'name', { value: 'AssertionError [ERR_ASSERTION]', enumerable: false, writable: true, configurable: true }) _this.code = 'ERR_ASSERTION' _this.actual = actual _this.expected = expected _this.operator = operator if (Error.captureStackTrace) { // eslint-disable-next-line no-restricted-syntax Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn) } // Create error message including the error code in the name. _this.stack // Reset the name. _this.name = 'AssertionError' return _possibleConstructorReturn(_this) } _createClass(AssertionError, [{ key: 'toString', value: function toString () { return ''.concat(this.name, ' [').concat(this.code, ']: ').concat(this.message) } }, { key: inspect.custom, value: function value (recurseTimes, ctx) { // This limits the `actual` and `expected` property default inspection to // the minimum depth. Otherwise those values would be too verbose compared // to the actual error message which contains a combined view of these two // input values. return inspect(this, _objectSpread({}, ctx, { customInspect: false, depth: 0 })) } }]) return AssertionError }(_wrapNativeSuper(Error))) module.exports = AssertionError /***/ }, /***/ 2136: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' // Currently in sync with Node.js lib/internal/errors.js // https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f /* eslint node-core/documented-errors: "error" */ /* eslint node-core/alphabetize-errors: "error" */ /* eslint node-core/prefer-util-format-errors: "error" */ // The whole point behind this internal module is to allow Node.js to no // longer be forced to treat every error message change as a semver-major // change. The NodeError classes here all expose a `code` property whose // value statically and permanently identifies the error. While the error // message may change, the code should not. function _typeof (obj) { if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { _typeof = function _typeof (obj) { return typeof obj } } else { _typeof = function _typeof (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj } } return _typeof(obj) } function _classCallCheck (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function') } } function _possibleConstructorReturn (self, call) { if (call && (_typeof(call) === 'object' || typeof call === 'function')) { return call } return _assertThisInitialized(self) } function _assertThisInitialized (self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _getPrototypeOf (o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf (o) { return o.__proto__ || Object.getPrototypeOf(o) }; return _getPrototypeOf(o) } function _inherits (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function') } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } const codes = {} // Lazy loaded let assert let util function createErrorType (code, message, Base) { if (!Base) { Base = Error } function getMessage (arg1, arg2, arg3) { if (typeof message === 'string') { return message } else { return message(arg1, arg2, arg3) } } const NodeError = /* #__PURE__ */ (function (_Base) { _inherits(NodeError, _Base) function NodeError (arg1, arg2, arg3) { let _this _classCallCheck(this, NodeError) _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError).call(this, getMessage(arg1, arg2, arg3))) _this.code = code return _this } return NodeError }(Base)) codes[code] = NodeError } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf (expected, thing) { if (Array.isArray(expected)) { const len = expected.length expected = expected.map(function (i) { return String(i) }) if (len > 2) { return 'one of '.concat(thing, ' ').concat(expected.slice(0, len - 1).join(', '), ', or ') + expected[len - 1] } else if (len === 2) { return 'one of '.concat(thing, ' ').concat(expected[0], ' or ').concat(expected[1]) } else { return 'of '.concat(thing, ' ').concat(expected[0]) } } else { return 'of '.concat(thing, ' ').concat(String(expected)) } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith (str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith (str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length } return str.substring(this_len - search.length, this_len) === search } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes (str, search, start) { if (typeof start !== 'number') { start = 0 } if (start + search.length > str.length) { return false } else { return str.indexOf(search, start) !== -1 } } createErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The "%s" argument is ambiguous. %s', TypeError) createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { if (assert === undefined) assert = __webpack_require__(9282) assert(typeof name === 'string', "'name' must be a string") // determiner: 'must be' or 'must not be' let determiner if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be' expected = expected.replace(/^not /, '') } else { determiner = 'must be' } let msg if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = 'The '.concat(name, ' ').concat(determiner, ' ').concat(oneOf(expected, 'type')) } else { const type = includes(name, '.') ? 'property' : 'argument' msg = 'The "'.concat(name, '" ').concat(type, ' ').concat(determiner, ' ').concat(oneOf(expected, 'type')) } // TODO(BridgeAR): Improve the output by showing `null` and similar. msg += '. Received type '.concat(_typeof(actual)) return msg }, TypeError) createErrorType('ERR_INVALID_ARG_VALUE', function (name, value) { const reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid' if (util === undefined) util = __webpack_require__(9539) let inspected = util.inspect(value) if (inspected.length > 128) { inspected = ''.concat(inspected.slice(0, 128), '...') } return "The argument '".concat(name, "' ").concat(reason, '. Received ').concat(inspected) }, TypeError, RangeError) createErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) { let type if (value && value.constructor && value.constructor.name) { type = 'instance of '.concat(value.constructor.name) } else { type = 'type '.concat(_typeof(value)) } return 'Expected '.concat(input, ' to be returned from the "').concat(name, '"') + ' function but got '.concat(type, '.') }, TypeError) createErrorType('ERR_MISSING_ARGS', function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key] } if (assert === undefined) assert = __webpack_require__(9282) assert(args.length > 0, 'At least one arg needs to be specified') let msg = 'The ' const len = args.length args = args.map(function (a) { return '"'.concat(a, '"') }) switch (len) { case 1: msg += ''.concat(args[0], ' argument') break case 2: msg += ''.concat(args[0], ' and ').concat(args[1], ' arguments') break default: msg += args.slice(0, len - 1).join(', ') msg += ', and '.concat(args[len - 1], ' arguments') break } return ''.concat(msg, ' must be specified') }, TypeError) module.exports.codes = codes /***/ }, /***/ 9158: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' // Currently in sync with Node.js lib/internal/util/comparisons.js // https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 function _slicedToArray (arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest() } function _nonIterableRest () { throw new TypeError('Invalid attempt to destructure non-iterable instance') } function _iterableToArrayLimit (arr, i) { const _arr = []; let _n = true; let _d = false; let _e; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break } } catch (err) { _d = true; _e = err } finally { try { if (!_n && _i.return != null) _i.return() } finally { if (_d) throw _e } } return _arr } function _arrayWithHoles (arr) { if (Array.isArray(arr)) return arr } function _typeof (obj) { if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') { _typeof = function _typeof (obj) { return typeof obj } } else { _typeof = function _typeof (obj) { return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj } } return _typeof(obj) } const regexFlagsSupported = /a/g.flags !== undefined const arrayFromSet = function arrayFromSet (set) { const array = [] set.forEach(function (value) { return array.push(value) }) return array } const arrayFromMap = function arrayFromMap (map) { const array = [] map.forEach(function (value, key) { return array.push([key, value]) }) return array } const objectIs = Object.is ? Object.is : __webpack_require__(609) const objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () { return [] } const numberIsNaN = Number.isNaN ? Number.isNaN : __webpack_require__(360) function uncurryThis (f) { return f.call.bind(f) } const hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty) const propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable) const objectToString = uncurryThis(Object.prototype.toString) const _require$types = (__webpack_require__(9539).types) const isAnyArrayBuffer = _require$types.isAnyArrayBuffer const isArrayBufferView = _require$types.isArrayBufferView const isDate = _require$types.isDate const isMap = _require$types.isMap const isRegExp = _require$types.isRegExp const isSet = _require$types.isSet const isNativeError = _require$types.isNativeError const isBoxedPrimitive = _require$types.isBoxedPrimitive const isNumberObject = _require$types.isNumberObject const isStringObject = _require$types.isStringObject const isBooleanObject = _require$types.isBooleanObject const isBigIntObject = _require$types.isBigIntObject const isSymbolObject = _require$types.isSymbolObject const isFloat32Array = _require$types.isFloat32Array const isFloat64Array = _require$types.isFloat64Array function isNonIndex (key) { if (key.length === 0 || key.length > 10) return true for (let i = 0; i < key.length; i++) { const code = key.charCodeAt(i) if (code < 48 || code > 57) return true } // The maximum size for an array is 2 ** 32 -1. return key.length === 10 && key >= Math.pow(2, 32) } function getOwnNonIndexProperties (value) { return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value))) } // Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ function compare (a, b) { if (a === b) { return 0 } let x = a.length let y = b.length for (let i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) { return -1 } if (y < x) { return 1 } return 0 } const ONLY_ENUMERABLE = undefined const kStrict = true const kLoose = false const kNoIterator = 0 const kIsArray = 1 const kIsSet = 2 const kIsMap = 3 // Check if they have the same source and flags function areSimilarRegExps (a, b) { return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b) } function areSimilarFloatArrays (a, b) { if (a.byteLength !== b.byteLength) { return false } for (let offset = 0; offset < a.byteLength; offset++) { if (a[offset] !== b[offset]) { return false } } return true } function areSimilarTypedArrays (a, b) { if (a.byteLength !== b.byteLength) { return false } return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0 } function areEqualArrayBuffers (buf1, buf2) { return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0 } function isEqualBoxedPrimitive (val1, val2) { if (isNumberObject(val1)) { return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2)) } if (isStringObject(val1)) { return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2) } if (isBooleanObject(val1)) { return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2) } if (isBigIntObject(val1)) { return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2) } return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2) } // Notes: Type tags are historical [[Class]] properties that can be set by // FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS // and retrieved using Object.prototype.toString.call(obj) in JS // See https://tc39.github.io/ecma262/#sec-object.prototype.tostring // for a list of tags pre-defined in the spec. // There are some unspecified tags in the wild too (e.g. typed array tags). // Since tags can be altered, they only serve fast failures // // Typed arrays and buffers are checked by comparing the content in their // underlying ArrayBuffer. This optimization requires that it's // reasonable to interpret their underlying memory in the same way, // which is checked by comparing their type tags. // (e.g. a Uint8Array and a Uint16Array with the same memory content // could still be different because they will be interpreted differently). // // For strict comparison, objects should have // a) The same built-in type tags // b) The same prototypes. function innerDeepEqual (val1, val2, strict, memos) { // All identical values are equivalent, as determined by ===. if (val1 === val2) { if (val1 !== 0) return true return strict ? objectIs(val1, val2) : true } // Check more closely if val1 and val2 are equal. if (strict) { if (_typeof(val1) !== 'object') { return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2) } if (_typeof(val2) !== 'object' || val1 === null || val2 === null) { return false } if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) { return false } } else { if (val1 === null || _typeof(val1) !== 'object') { if (val2 === null || _typeof(val2) !== 'object') { // eslint-disable-next-line eqeqeq return val1 == val2 } return false } if (val2 === null || _typeof(val2) !== 'object') { return false } } const val1Tag = objectToString(val1) const val2Tag = objectToString(val2) if (val1Tag !== val2Tag) { return false } if (Array.isArray(val1)) { // Check for sparse arrays and general fast path if (val1.length !== val2.length) { return false } const keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE) const keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE) if (keys1.length !== keys2.length) { return false } return keyCheck(val1, val2, strict, memos, kIsArray, keys1) } // [browserify] This triggers on certain types in IE (Map/Set) so we don't // wan't to early return out of the rest of the checks. However we can check // if the second value is one of these values and the first isn't. if (val1Tag === '[object Object]') { // return keyCheck(val1, val2, strict, memos, kNoIterator); if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) { return false } } if (isDate(val1)) { if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) { return false } } else if (isRegExp(val1)) { if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) { return false } } else if (isNativeError(val1) || val1 instanceof Error) { // Do not compare the stack as it might differ even though the error itself // is otherwise identical. if (val1.message !== val2.message || val1.name !== val2.name) { return false } } else if (isArrayBufferView(val1)) { if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) { if (!areSimilarFloatArrays(val1, val2)) { return false } } else if (!areSimilarTypedArrays(val1, val2)) { return false } // Buffer.compare returns true, so val1.length === val2.length. If they both // only contain numeric keys, we don't need to exam further than checking // the symbols. const _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE) const _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE) if (_keys.length !== _keys2.length) { return false } return keyCheck(val1, val2, strict, memos, kNoIterator, _keys) } else if (isSet(val1)) { if (!isSet(val2) || val1.size !== val2.size) { return false } return keyCheck(val1, val2, strict, memos, kIsSet) } else if (isMap(val1)) { if (!isMap(val2) || val1.size !== val2.size) { return false } return keyCheck(val1, val2, strict, memos, kIsMap) } else if (isAnyArrayBuffer(val1)) { if (!areEqualArrayBuffers(val1, val2)) { return false } } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) { return false } return keyCheck(val1, val2, strict, memos, kNoIterator) } function getEnumerables (val, keys) { return keys.filter(function (k) { return propertyIsEnumerable(val, k) }) } function keyCheck (val1, val2, strict, memos, iterationType, aKeys) { // For all remaining Object pairs, including Array, objects and Maps, // equivalence is determined by having: // a) The same number of owned enumerable properties // b) The same set of keys/indexes (although not necessarily the same order) // c) Equivalent values for every corresponding key/index // d) For Sets and Maps, equal contents // Note: this accounts for both named and indexed properties on Arrays. if (arguments.length === 5) { aKeys = Object.keys(val1) const bKeys = Object.keys(val2) // The pair must have the same number of owned properties. if (aKeys.length !== bKeys.length) { return false } } // Cheap key test let i = 0 for (; i < aKeys.length; i++) { if (!hasOwnProperty(val2, aKeys[i])) { return false } } if (strict && arguments.length === 5) { const symbolKeysA = objectGetOwnPropertySymbols(val1) if (symbolKeysA.length !== 0) { let count = 0 for (i = 0; i < symbolKeysA.length; i++) { const key = symbolKeysA[i] if (propertyIsEnumerable(val1, key)) { if (!propertyIsEnumerable(val2, key)) { return false } aKeys.push(key) count++ } else if (propertyIsEnumerable(val2, key)) { return false } } const symbolKeysB = objectGetOwnPropertySymbols(val2) if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) { return false } } else { const _symbolKeysB = objectGetOwnPropertySymbols(val2) if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) { return false } } } if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) { return true } // Use memos to handle cycles. if (memos === undefined) { memos = { val1: new Map(), val2: new Map(), position: 0 } } else { // We prevent up to two map.has(x) calls by directly retrieving the value // and checking for undefined. The map can only contain numbers, so it is // safe to check for undefined only. const val2MemoA = memos.val1.get(val1) if (val2MemoA !== undefined) { const val2MemoB = memos.val2.get(val2) if (val2MemoB !== undefined) { return val2MemoA === val2MemoB } } memos.position++ } memos.val1.set(val1, memos.position) memos.val2.set(val2, memos.position) const areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType) memos.val1.delete(val1) memos.val2.delete(val2) return areEq } function setHasEqualElement (set, val1, strict, memo) { // Go looking. const setValues = arrayFromSet(set) for (let i = 0; i < setValues.length; i++) { const val2 = setValues[i] if (innerDeepEqual(val1, val2, strict, memo)) { // Remove the matching element to make sure we do not check that again. set.delete(val2) return true } } return false } // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using // Sadly it is not possible to detect corresponding values properly in case the // type is a string, number, bigint or boolean. The reason is that those values // can match lots of different string values (e.g., 1n == '+00001'). function findLooseMatchingPrimitives (prim) { switch (_typeof(prim)) { case 'undefined': return null case 'object': // Only pass in null as object! return undefined case 'symbol': return false case 'string': prim = +prim // Loose equal entries exist only if the string is possible to convert to // a regular number and not NaN. // Fall through case 'number': if (numberIsNaN(prim)) { return false } } return true } function setMightHaveLoosePrim (a, b, prim) { const altValue = findLooseMatchingPrimitives(prim) if (altValue != null) return altValue return b.has(altValue) && !a.has(altValue) } function mapMightHaveLoosePrim (a, b, prim, item, memo) { const altValue = findLooseMatchingPrimitives(prim) if (altValue != null) { return altValue } const curB = b.get(altValue) if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) { return false } return !a.has(altValue) && innerDeepEqual(item, curB, false, memo) } function setEquiv (a, b, strict, memo) { // This is a lazily initiated Set of entries which have to be compared // pairwise. let set = null const aValues = arrayFromSet(a) for (let i = 0; i < aValues.length; i++) { const val = aValues[i] // Note: Checking for the objects first improves the performance for object // heavy sets but it is a minor slow down for primitives. As they are fast // to check this improves the worst case scenario instead. if (_typeof(val) === 'object' && val !== null) { if (set === null) { set = new Set() } // If the specified value doesn't exist in the second set its an not null // object (or non strict only: a not matching primitive) we'll need to go // hunting for something thats deep-(strict-)equal to it. To make this // O(n log n) complexity we have to copy these values in a new set first. set.add(val) } else if (!b.has(val)) { if (strict) return false // Fast path to detect missing string, symbol, undefined and null values. if (!setMightHaveLoosePrim(a, b, val)) { return false } if (set === null) { set = new Set() } set.add(val) } } if (set !== null) { const bValues = arrayFromSet(b) for (let _i = 0; _i < bValues.length; _i++) { const _val = bValues[_i] // We have to check if a primitive value is already // matching and only if it's not, go hunting for it. if (_typeof(_val) === 'object' && _val !== null) { if (!setHasEqualElement(set, _val, strict, memo)) return false } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) { return false } } return set.size === 0 } return true } function mapHasEqualEntry (set, map, key1, item1, strict, memo) { // To be able to handle cases like: // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']]) // ... we need to consider *all* matching keys, not just the first we find. const setValues = arrayFromSet(set) for (let i = 0; i < setValues.length; i++) { const key2 = setValues[i] if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) { set.delete(key2) return true } } return false } function mapEquiv (a, b, strict, memo) { let set = null const aEntries = arrayFromMap(a) for (let i = 0; i < aEntries.length; i++) { const _aEntries$i = _slicedToArray(aEntries[i], 2) var key = _aEntries$i[0] const item1 = _aEntries$i[1] if (_typeof(key) === 'object' && key !== null) { if (set === null) { set = new Set() } set.add(key) } else { // By directly retrieving the value we prevent another b.has(key) check in // almost all possible cases. const item2 = b.get(key) if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) { if (strict) return false // Fast path to detect missing string, symbol, undefined and null // keys. if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false if (set === null) { set = new Set() } set.add(key) } } } if (set !== null) { const bEntries = arrayFromMap(b) for (let _i2 = 0; _i2 < bEntries.length; _i2++) { const _bEntries$_i = _slicedToArray(bEntries[_i2], 2) var key = _bEntries$_i[0] const item = _bEntries$_i[1] if (_typeof(key) === 'object' && key !== null) { if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return false } else if (!strict && (!a.has(key) || !innerDeepEqual(a.get(key), item, false, memo)) && !mapHasEqualEntry(set, a, key, item, false, memo)) { return false } } return set.size === 0 } return true } function objEquiv (a, b, strict, keys, memos, iterationType) { // Sets and maps don't have their entries accessible via normal object // properties. let i = 0 if (iterationType === kIsSet) { if (!setEquiv(a, b, strict, memos)) { return false } } else if (iterationType === kIsMap) { if (!mapEquiv(a, b, strict, memos)) { return false } } else if (iterationType === kIsArray) { for (; i < a.length; i++) { if (hasOwnProperty(a, i)) { if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) { return false } } else if (hasOwnProperty(b, i)) { return false } else { // Array is sparse. const keysA = Object.keys(a) for (; i < keysA.length; i++) { const key = keysA[i] if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) { return false } } if (keysA.length !== Object.keys(b).length) { return false } return true } } } // The pair must have equivalent values for every corresponding key. // Possibly expensive deep test: for (i = 0; i < keys.length; i++) { const _key = keys[i] if (!innerDeepEqual(a[_key], b[_key], strict, memos)) { return false } } return true } function isDeepEqual (val1, val2) { return innerDeepEqual(val1, val2, kLoose) } function isDeepStrictEqual (val1, val2) { return innerDeepEqual(val1, val2, kStrict) } module.exports = { isDeepEqual, isDeepStrictEqual } /***/ }, /***/ 2055: /***/ function (__unused_webpack_module, exports) { 'use strict' // The following break classes are handled by the pair table exports.OP = 0 // Opening punctuation exports.CL = 1 // Closing punctuation exports.CP = 2 // Closing parenthesis exports.QU = 3 // Ambiguous quotation exports.GL = 4 // Glue exports.NS = 5 // Non-starters exports.EX = 6 // Exclamation/Interrogation exports.SY = 7 // Symbols allowing break after exports.IS = 8 // Infix separator exports.PR = 9 // Prefix exports.PO = 10 // Postfix exports.NU = 11 // Numeric exports.AL = 12 // Alphabetic exports.HL = 13 // Hebrew Letter exports.ID = 14 // Ideographic exports.IN = 15 // Inseparable characters exports.HY = 16 // Hyphen exports.BA = 17 // Break after exports.BB = 18 // Break before exports.B2 = 19 // Break on either side (but not pair) exports.ZW = 20 // Zero-width space exports.CM = 21 // Combining marks exports.WJ = 22 // Word joiner exports.H2 = 23 // Hangul LV exports.H3 = 24 // Hangul LVT exports.JL = 25 // Hangul L Jamo exports.JV = 26 // Hangul V Jamo exports.JT = 27 // Hangul T Jamo exports.RI = 28 // Regional Indicator exports.EB = 29 // Emoji Base exports.EM = 30 // Emoji Modifier exports.ZWJ = 31 // Zero Width Joiner exports.CB = 32 // Contingent break // The following break classes are not handled by the pair table exports.AI = 33 // Ambiguous (Alphabetic or Ideograph) exports.BK = 34 // Break (mandatory) exports.CJ = 35 // Conditional Japanese Starter exports.CR = 36 // Carriage return exports.LF = 37 // Line feed exports.NL = 38 // Next line exports.SA = 39 // South-East Asian exports.SG = 40 // Surrogates exports.SP = 41 // Space exports.XX = 42 // Unknown /***/ }, /***/ 8383: /***/ function (__unused_webpack_module, exports) { 'use strict' let CI_BRK, CP_BRK, DI_BRK, IN_BRK, PR_BRK exports.DI_BRK = DI_BRK = 0 // Direct break opportunity exports.IN_BRK = IN_BRK = 1 // Indirect break opportunity exports.CI_BRK = CI_BRK = 2 // Indirect break opportunity for combining marks exports.CP_BRK = CP_BRK = 3 // Prohibited break for combining marks exports.PR_BRK = PR_BRK = 4 // Prohibited break // Based on example pair table from https://www.unicode.org/reports/tr14/tr14-37.html#Table2 // - ZWJ special processing for LB8a of Revision 41 // - CB manually added as per Rule LB20 // - CL, CP, NS, SY, IS, PR, PO, HY, BA, B2 and RI manually adjusted as per LB22 of Revision 45 exports.pairTable = [// OP , CL , CP , QU , GL , NS , EX , SY , IS , PR , PO , NU , AL , HL , ID , IN , HY , BA , BB , B2 , ZW , CM , WJ , H2 , H3 , JL , JV , JT , RI , EB , EM , ZWJ , CB [PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, CP_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK], // OP [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // CL [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // CP [PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], // QU [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], // GL [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // NS [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // EX [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // SY [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // IS [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK], // PR [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // PO [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // NU [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // AL [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // HL [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // ID [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // IN [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // HY [DI_BRK, PR_BRK, PR_BRK, IN_BRK, DI_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // BA [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK], // BB [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, PR_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // B2 [DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK], // ZW [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // CM [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK], // WJ [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // H2 [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // H3 [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // JL [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // JV [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // JT [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // RI [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, DI_BRK], // EB [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // EM [IN_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, IN_BRK, IN_BRK, IN_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK], // ZWJ [DI_BRK, PR_BRK, PR_BRK, IN_BRK, IN_BRK, DI_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, PR_BRK, CI_BRK, PR_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK] // CB ] /***/ }, /***/ 5106: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' __webpack_require__(9601) exports.EncodeStream = __webpack_require__(9126) exports.DecodeStream = __webpack_require__(3030) exports.Array = __webpack_require__(1988) exports.LazyArray = __webpack_require__(6768) exports.Bitfield = __webpack_require__(3425) exports.Boolean = __webpack_require__(9024) exports.Buffer = __webpack_require__(5250) exports.Enum = __webpack_require__(3100) exports.Optional = __webpack_require__(9541) exports.Reserved = __webpack_require__(7468) exports.String = __webpack_require__(1466) exports.Struct = __webpack_require__(1219) exports.VersionedStruct = __webpack_require__(3585) const utils = __webpack_require__(6610) const NumberT = __webpack_require__(6462) const Pointer = __webpack_require__(8011) Object.assign(exports, utils, NumberT, Pointer) /***/ }, /***/ 1988: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(7042) __webpack_require__(1539) __webpack_require__(8309) __webpack_require__(1038) __webpack_require__(8783) __webpack_require__(4916) __webpack_require__(2526) __webpack_require__(1817) __webpack_require__(2165) __webpack_require__(6992) __webpack_require__(3948) function _createForOfIteratorHelperLoose (o, allowArrayLike) { let it = typeof Symbol !== 'undefined' && o[Symbol.iterator] || o['@@iterator']; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === 'number') { if (it) o = it; let i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] } } } throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.') } function _unsupportedIterableToArray (o, minLen) { if (!o) return; if (typeof o === 'string') return _arrayLikeToArray(o, minLen); let n = Object.prototype.toString.call(o).slice(8, -1); if (n === 'Object' && o.constructor) n = o.constructor.name; if (n === 'Map' || n === 'Set') return Array.from(o); if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen) } function _arrayLikeToArray (arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } const _require = __webpack_require__(6462) const NumberT = _require.Number const utils = __webpack_require__(6610) const ArrayT = /* #__PURE__ */(function () { function ArrayT (type, length, lengthType) { if (lengthType === void 0) { lengthType = 'count' } this.type = type this.length = length this.lengthType = lengthType } const _proto = ArrayT.prototype _proto.decode = function decode (stream, parent) { let length const pos = stream.pos const res = [] let ctx = parent if (this.length != null) { length = utils.resolveLength(this.length, stream, parent) } if (this.length instanceof NumberT) { // define hidden properties Object.defineProperties(res, { parent: { value: parent }, _startOffset: { value: pos }, _currentOffset: { value: 0, writable: true }, _length: { value: length } }) ctx = res } if (length == null || this.lengthType === 'bytes') { const target = length != null ? stream.pos + length : (parent != null ? parent._length : undefined) ? parent._startOffset + parent._length : stream.length while (stream.pos < target) { res.push(this.type.decode(stream, ctx)) } } else { for (let i = 0, end = length; i < end; i++) { res.push(this.type.decode(stream, ctx)) } } return res } _proto.size = function size (array, ctx) { if (!array) { return this.type.size(null, ctx) * utils.resolveLength(this.length, null, ctx) } let size = 0 if (this.length instanceof NumberT) { size += this.length.size() ctx = { parent: ctx } } for (var _iterator = _createForOfIteratorHelperLoose(array), _step; !(_step = _iterator()).done;) { const item = _step.value size += this.type.size(item, ctx) } return size } _proto.encode = function encode (stream, array, parent) { let ctx = parent if (this.length instanceof NumberT) { ctx = { pointers: [], startOffset: stream.pos, parent } ctx.pointerOffset = stream.pos + this.size(array, ctx) this.length.encode(stream, array.length) } for (var _iterator2 = _createForOfIteratorHelperLoose(array), _step2; !(_step2 = _iterator2()).done;) { const item = _step2.value this.type.encode(stream, item, ctx) } if (this.length instanceof NumberT) { let i = 0 while (i < ctx.pointers.length) { const ptr = ctx.pointers[i++] ptr.type.encode(stream, ptr.val) } } } return ArrayT }()) module.exports = ArrayT /***/ }, /***/ 3425: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(2087) const Bitfield = /* #__PURE__ */(function () { function Bitfield (type, flags) { if (flags === void 0) { flags = [] } this.type = type this.flags = flags } const _proto = Bitfield.prototype _proto.decode = function decode (stream) { const val = this.type.decode(stream) const res = {} for (let i = 0; i < this.flags.length; i++) { const flag = this.flags[i] if (flag != null) { res[flag] = !!(val & 1 << i) } } return res } _proto.size = function size () { return this.type.size() } _proto.encode = function encode (stream, keys) { let val = 0 for (let i = 0; i < this.flags.length; i++) { const flag = this.flags[i] if (flag != null) { if (keys[flag]) { val |= 1 << i } } } return this.type.encode(stream, val) } return Bitfield }()) module.exports = Bitfield /***/ }, /***/ 9024: /***/ function (module) { 'use strict' const BooleanT = /* #__PURE__ */(function () { function BooleanT (type) { this.type = type } const _proto = BooleanT.prototype _proto.decode = function decode (stream, parent) { return !!this.type.decode(stream, parent) } _proto.size = function size (val, parent) { return this.type.size(val, parent) } _proto.encode = function encode (stream, val, parent) { return this.type.encode(stream, +val, parent) } return BooleanT }()) module.exports = BooleanT /***/ }, /***/ 5250: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const utils = __webpack_require__(6610) const _require = __webpack_require__(6462) const NumberT = _require.Number const BufferT = /* #__PURE__ */(function () { function BufferT (length) { this.length = length } const _proto = BufferT.prototype _proto.decode = function decode (stream, parent) { const length = utils.resolveLength(this.length, stream, parent) return stream.readBuffer(length) } _proto.size = function size (val, parent) { if (!val) { return utils.resolveLength(this.length, null, parent) } return val.length } _proto.encode = function encode (stream, buf, parent) { if (this.length instanceof NumberT) { this.length.encode(stream, buf.length) } return stream.writeBuffer(buf) } return BufferT }()) module.exports = BufferT /***/ }, /***/ 3030: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer __webpack_require__(1539) __webpack_require__(9714) __webpack_require__(7042) __webpack_require__(4916) __webpack_require__(5306) let iconv try { iconv = __webpack_require__(4914) } catch (error) {} const DecodeStream = /* #__PURE__ */(function () { function DecodeStream (buffer) { this.buffer = buffer this.pos = 0 this.length = this.buffer.length } const _proto = DecodeStream.prototype _proto.readString = function readString (length, encoding) { if (encoding === void 0) { encoding = 'ascii' } switch (encoding) { case 'utf16le': case 'ucs2': case 'utf8': case 'ascii': return this.buffer.toString(encoding, this.pos, this.pos += length) case 'utf16be': var buf = Buffer.from(this.readBuffer(length)) // swap the bytes for (let i = 0, end = buf.length - 1; i < end; i += 2) { const byte = buf[i] buf[i] = buf[i + 1] buf[i + 1] = byte } return buf.toString('utf16le') default: buf = this.readBuffer(length) if (iconv) { try { return iconv.decode(buf, encoding) } catch (error1) {} } return buf } } _proto.readBuffer = function readBuffer (length) { return this.buffer.slice(this.pos, this.pos += length) } _proto.readUInt24BE = function readUInt24BE () { return (this.readUInt16BE() << 8) + this.readUInt8() } _proto.readUInt24LE = function readUInt24LE () { return this.readUInt16LE() + (this.readUInt8() << 16) } _proto.readInt24BE = function readInt24BE () { return (this.readInt16BE() << 8) + this.readUInt8() } _proto.readInt24LE = function readInt24LE () { return this.readUInt16LE() + (this.readInt8() << 16) } return DecodeStream }()) DecodeStream.TYPES = { UInt8: 1, UInt16: 2, UInt24: 3, UInt32: 4, Int8: 1, Int16: 2, Int24: 3, Int32: 4, Float: 4, Double: 8 } const _loop = function _loop (key) { if (key.slice(0, 4) === 'read') { const bytes = DecodeStream.TYPES[key.replace(/read|[BL]E/g, '')] DecodeStream.prototype[key] = function () { const ret = this.buffer[key](this.pos) this.pos += bytes return ret } } } for (const key in Buffer.prototype) { _loop(key) } module.exports = DecodeStream /***/ }, /***/ 9126: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer __webpack_require__(7042) __webpack_require__(3290) __webpack_require__(4916) __webpack_require__(5306) function _inheritsLoose (subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } let iconv const stream = __webpack_require__(2830) const DecodeStream = __webpack_require__(3030) try { iconv = __webpack_require__(4914) } catch (error) {} const EncodeStream = /* #__PURE__ */(function (_stream$Readable) { _inheritsLoose(EncodeStream, _stream$Readable) function EncodeStream (bufferSize) { let _this if (bufferSize === void 0) { bufferSize = 65536 } _this = _stream$Readable.apply(this, arguments) || this _this.buffer = Buffer.alloc(bufferSize) _this.bufferOffset = 0 _this.pos = 0 return _this } // do nothing, required by node const _proto = EncodeStream.prototype _proto._read = function _read () {} _proto.ensure = function ensure (bytes) { if (this.bufferOffset + bytes > this.buffer.length) { return this.flush() } } _proto.flush = function flush () { if (this.bufferOffset > 0) { this.push(Buffer.from(this.buffer.slice(0, this.bufferOffset))) return this.bufferOffset = 0 } } _proto.writeBuffer = function writeBuffer (buffer) { this.flush() this.push(buffer) return this.pos += buffer.length } _proto.writeString = function writeString (string, encoding) { if (encoding === void 0) { encoding = 'ascii' } switch (encoding) { case 'utf16le': case 'ucs2': case 'utf8': case 'ascii': return this.writeBuffer(Buffer.from(string, encoding)) case 'utf16be': var buf = Buffer.from(string, 'utf16le') // swap the bytes for (let i = 0, end = buf.length - 1; i < end; i += 2) { const byte = buf[i] buf[i] = buf[i + 1] buf[i + 1] = byte } return this.writeBuffer(buf) default: if (iconv) { return this.writeBuffer(iconv.encode(string, encoding)) } else { throw new Error('Install iconv-lite to enable additional string encodings.') } } } _proto.writeUInt24BE = function writeUInt24BE (val) { this.ensure(3) this.buffer[this.bufferOffset++] = val >>> 16 & 0xff this.buffer[this.bufferOffset++] = val >>> 8 & 0xff this.buffer[this.bufferOffset++] = val & 0xff return this.pos += 3 } _proto.writeUInt24LE = function writeUInt24LE (val) { this.ensure(3) this.buffer[this.bufferOffset++] = val & 0xff this.buffer[this.bufferOffset++] = val >>> 8 & 0xff this.buffer[this.bufferOffset++] = val >>> 16 & 0xff return this.pos += 3 } _proto.writeInt24BE = function writeInt24BE (val) { if (val >= 0) { return this.writeUInt24BE(val) } else { return this.writeUInt24BE(val + 0xffffff + 1) } } _proto.writeInt24LE = function writeInt24LE (val) { if (val >= 0) { return this.writeUInt24LE(val) } else { return this.writeUInt24LE(val + 0xffffff + 1) } } _proto.fill = function fill (val, length) { if (length < this.buffer.length) { this.ensure(length) this.buffer.fill(val, this.bufferOffset, this.bufferOffset + length) this.bufferOffset += length return this.pos += length } else { const buf = Buffer.alloc(length) buf.fill(val) return this.writeBuffer(buf) } } _proto.end = function end () { this.flush() return this.push(null) } return EncodeStream }(stream.Readable)) const _loop = function _loop (key) { if (key.slice(0, 5) === 'write') { const bytes = +DecodeStream.TYPES[key.replace(/write|[BL]E/g, '')] EncodeStream.prototype[key] = function (value) { this.ensure(bytes) this.buffer[key](value, this.bufferOffset) this.bufferOffset += bytes return this.pos += bytes } } } for (const key in Buffer.prototype) { _loop(key) } module.exports = EncodeStream /***/ }, /***/ 3100: /***/ function (module) { 'use strict' const Enum = /* #__PURE__ */(function () { function Enum (type, options) { if (options === void 0) { options = [] } this.type = type this.options = options } const _proto = Enum.prototype _proto.decode = function decode (stream) { const index = this.type.decode(stream) return this.options[index] || index } _proto.size = function size () { return this.type.size() } _proto.encode = function encode (stream, val) { const index = this.options.indexOf(val) if (index === -1) { throw new Error('Unknown option in enum: ' + val) } return this.type.encode(stream, index) } return Enum }()) module.exports = Enum /***/ }, /***/ 6768: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(1539) __webpack_require__(8674) function _inheritsLoose (subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } const ArrayT = __webpack_require__(1988) const _require = __webpack_require__(6462) const NumberT = _require.Number const utils = __webpack_require__(6610) const _require2 = __webpack_require__(9539) const _inspect = _require2.inspect const LazyArrayT = /* #__PURE__ */(function (_ArrayT) { _inheritsLoose(LazyArrayT, _ArrayT) function LazyArrayT () { return _ArrayT.apply(this, arguments) || this } const _proto = LazyArrayT.prototype _proto.decode = function decode (stream, parent) { const pos = stream.pos const length = utils.resolveLength(this.length, stream, parent) if (this.length instanceof NumberT) { parent = { parent, _startOffset: pos, _currentOffset: 0, _length: length } } const res = new LazyArray(this.type, length, stream, parent) stream.pos += length * this.type.size(null, parent) return res } _proto.size = function size (val, ctx) { if (val instanceof LazyArray) { val = val.toArray() } return _ArrayT.prototype.size.call(this, val, ctx) } _proto.encode = function encode (stream, val, ctx) { if (val instanceof LazyArray) { val = val.toArray() } return _ArrayT.prototype.encode.call(this, stream, val, ctx) } return LazyArrayT }(ArrayT)) var LazyArray = /* #__PURE__ */(function () { function LazyArray (type, length, stream, ctx) { this.type = type this.length = length this.stream = stream this.ctx = ctx this.base = this.stream.pos this.items = [] } const _proto2 = LazyArray.prototype _proto2.get = function get (index) { if (index < 0 || index >= this.length) { return undefined } if (this.items[index] == null) { const pos = this.stream.pos this.stream.pos = this.base + this.type.size(null, this.ctx) * index this.items[index] = this.type.decode(this.stream, this.ctx) this.stream.pos = pos } return this.items[index] } _proto2.toArray = function toArray () { const result = [] for (let i = 0, end = this.length; i < end; i++) { result.push(this.get(i)) } return result } _proto2.inspect = function inspect () { return _inspect(this.toArray()) } return LazyArray }()) module.exports = LazyArrayT /***/ }, /***/ 6462: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' function _inheritsLoose (subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } const DecodeStream = __webpack_require__(3030) const NumberT = /* #__PURE__ */(function () { function NumberT (type, endian) { if (endian === void 0) { endian = 'BE' } this.type = type this.endian = endian this.fn = this.type if (this.type[this.type.length - 1] !== '8') { this.fn += this.endian } } const _proto = NumberT.prototype _proto.size = function size () { return DecodeStream.TYPES[this.type] } _proto.decode = function decode (stream) { return stream['read' + this.fn]() } _proto.encode = function encode (stream, val) { return stream['write' + this.fn](val) } return NumberT }()) exports.Number = NumberT exports.uint8 = new NumberT('UInt8') exports.uint16be = exports.uint16 = new NumberT('UInt16', 'BE') exports.uint16le = new NumberT('UInt16', 'LE') exports.uint24be = exports.uint24 = new NumberT('UInt24', 'BE') exports.uint24le = new NumberT('UInt24', 'LE') exports.uint32be = exports.uint32 = new NumberT('UInt32', 'BE') exports.uint32le = new NumberT('UInt32', 'LE') exports.int8 = new NumberT('Int8') exports.int16be = exports.int16 = new NumberT('Int16', 'BE') exports.int16le = new NumberT('Int16', 'LE') exports.int24be = exports.int24 = new NumberT('Int24', 'BE') exports.int24le = new NumberT('Int24', 'LE') exports.int32be = exports.int32 = new NumberT('Int32', 'BE') exports.int32le = new NumberT('Int32', 'LE') exports.floatbe = exports.float = new NumberT('Float', 'BE') exports.floatle = new NumberT('Float', 'LE') exports.doublebe = exports.double = new NumberT('Double', 'BE') exports.doublele = new NumberT('Double', 'LE') const Fixed = /* #__PURE__ */(function (_NumberT) { _inheritsLoose(Fixed, _NumberT) function Fixed (size, endian, fracBits) { let _this if (fracBits === void 0) { fracBits = size >> 1 } _this = _NumberT.call(this, 'Int' + size, endian) || this _this._point = 1 << fracBits return _this } const _proto2 = Fixed.prototype _proto2.decode = function decode (stream) { return _NumberT.prototype.decode.call(this, stream) / this._point } _proto2.encode = function encode (stream, val) { return _NumberT.prototype.encode.call(this, stream, val * this._point | 0) } return Fixed }(NumberT)) exports.Fixed = Fixed exports.fixed16be = exports.fixed16 = new Fixed(16, 'BE') exports.fixed16le = new Fixed(16, 'LE') exports.fixed32be = exports.fixed32 = new Fixed(32, 'BE') exports.fixed32le = new Fixed(32, 'LE') /***/ }, /***/ 9541: /***/ function (module) { 'use strict' const Optional = /* #__PURE__ */(function () { function Optional (type, condition) { if (condition === void 0) { condition = true } this.type = type this.condition = condition } const _proto = Optional.prototype _proto.decode = function decode (stream, parent) { let condition = this.condition if (typeof condition === 'function') { condition = condition.call(parent, parent) } if (condition) { return this.type.decode(stream, parent) } } _proto.size = function size (val, parent) { let condition = this.condition if (typeof condition === 'function') { condition = condition.call(parent, parent) } if (condition) { return this.type.size(val, parent) } else { return 0 } } _proto.encode = function encode (stream, val, parent) { let condition = this.condition if (typeof condition === 'function') { condition = condition.call(parent, parent) } if (condition) { return this.type.encode(stream, val, parent) } } return Optional }()) module.exports = Optional /***/ }, /***/ 8011: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const utils = __webpack_require__(6610) const Pointer = /* #__PURE__ */(function () { function Pointer (offsetType, type, options) { if (options === void 0) { options = {} } this.offsetType = offsetType this.type = type this.options = options if (this.type === 'void') { this.type = null } if (this.options.type == null) { this.options.type = 'local' } if (this.options.allowNull == null) { this.options.allowNull = true } if (this.options.nullValue == null) { this.options.nullValue = 0 } if (this.options.lazy == null) { this.options.lazy = false } if (this.options.relativeTo) { if (typeof this.options.relativeTo !== 'function') { throw new Error('relativeTo option must be a function') } this.relativeToGetter = options.relativeTo } } const _proto = Pointer.prototype _proto.decode = function decode (stream, ctx) { const _this = this const offset = this.offsetType.decode(stream, ctx) // handle NULL pointers if (offset === this.options.nullValue && this.options.allowNull) { return null } let relative switch (this.options.type) { case 'local': relative = ctx._startOffset break case 'immediate': relative = stream.pos - this.offsetType.size() break case 'parent': relative = ctx.parent._startOffset break default: var c = ctx while (c.parent) { c = c.parent } relative = c._startOffset || 0 } if (this.options.relativeTo) { relative += this.relativeToGetter(ctx) } const ptr = offset + relative if (this.type != null) { let val = null const decodeValue = function decodeValue () { if (val != null) { return val } const pos = stream.pos stream.pos = ptr val = _this.type.decode(stream, ctx) stream.pos = pos return val } // If this is a lazy pointer, define a getter to decode only when needed. // This obviously only works when the pointer is contained by a Struct. if (this.options.lazy) { return new utils.PropertyDescriptor({ get: decodeValue }) } return decodeValue() } else { return ptr } } _proto.size = function size (val, ctx) { const parent = ctx switch (this.options.type) { case 'local': case 'immediate': break case 'parent': ctx = ctx.parent break default: // global while (ctx.parent) { ctx = ctx.parent } } let type = this.type if (type == null) { if (!(val instanceof VoidPointer)) { throw new Error('Must be a VoidPointer') } const _val = val type = _val.type val = val.value } if (val && ctx) { ctx.pointerSize += type.size(val, parent) } return this.offsetType.size() } _proto.encode = function encode (stream, val, ctx) { let relative const parent = ctx if (val == null) { this.offsetType.encode(stream, this.options.nullValue) return } switch (this.options.type) { case 'local': relative = ctx.startOffset break case 'immediate': relative = stream.pos + this.offsetType.size(val, parent) break case 'parent': ctx = ctx.parent relative = ctx.startOffset break default: // global relative = 0 while (ctx.parent) { ctx = ctx.parent } } if (this.options.relativeTo) { relative += this.relativeToGetter(parent.val) } this.offsetType.encode(stream, ctx.pointerOffset - relative) let type = this.type if (type == null) { if (!(val instanceof VoidPointer)) { throw new Error('Must be a VoidPointer') } const _val2 = val type = _val2.type val = val.value } ctx.pointers.push({ type, val, parent }) return ctx.pointerOffset += type.size(val, parent) } return Pointer }()) // A pointer whose type is determined at decode time var VoidPointer = function VoidPointer (type, value) { this.type = type this.value = value } exports.Pointer = Pointer exports.VoidPointer = VoidPointer /***/ }, /***/ 7468: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(3290) const utils = __webpack_require__(6610) const Reserved = /* #__PURE__ */(function () { function Reserved (type, count) { if (count === void 0) { count = 1 } this.type = type this.count = count } const _proto = Reserved.prototype _proto.decode = function decode (stream, parent) { stream.pos += this.size(null, parent) return undefined } _proto.size = function size (data, parent) { const count = utils.resolveLength(this.count, null, parent) return this.type.size() * count } _proto.encode = function encode (stream, val, parent) { return stream.fill(0, this.size(val, parent)) } return Reserved }()) module.exports = Reserved /***/ }, /***/ 1466: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer const _require = __webpack_require__(6462) const NumberT = _require.Number const utils = __webpack_require__(6610) const StringT = /* #__PURE__ */(function () { function StringT (length, encoding) { if (encoding === void 0) { encoding = 'ascii' } this.length = length this.encoding = encoding } const _proto = StringT.prototype _proto.decode = function decode (stream, parent) { let length, pos if (this.length != null) { length = utils.resolveLength(this.length, stream, parent) } else { let buffer buffer = stream.buffer length = stream.length pos = stream.pos while (pos < length && buffer[pos] !== 0x00) { ++pos } length = pos - stream.pos } let encoding = this.encoding if (typeof encoding === 'function') { encoding = encoding.call(parent, parent) || 'ascii' } const string = stream.readString(length, encoding) if (this.length == null && stream.pos < stream.length) { stream.pos++ } return string } _proto.size = function size (val, parent) { // Use the defined value if no value was given if (!val) { return utils.resolveLength(this.length, null, parent) } let encoding = this.encoding if (typeof encoding === 'function') { encoding = encoding.call(parent != null ? parent.val : undefined, parent != null ? parent.val : undefined) || 'ascii' } if (encoding === 'utf16be') { encoding = 'utf16le' } let size = Buffer.byteLength(val, encoding) if (this.length instanceof NumberT) { size += this.length.size() } if (this.length == null) { size++ } return size } _proto.encode = function encode (stream, val, parent) { let encoding = this.encoding if (typeof encoding === 'function') { encoding = encoding.call(parent != null ? parent.val : undefined, parent != null ? parent.val : undefined) || 'ascii' } if (this.length instanceof NumberT) { this.length.encode(stream, Buffer.byteLength(val, encoding)) } stream.writeString(val, encoding) if (this.length == null) { return stream.writeUInt8(0x00) } } return StringT }()) module.exports = StringT /***/ }, /***/ 1219: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const utils = __webpack_require__(6610) const Struct = /* #__PURE__ */(function () { function Struct (fields) { if (fields === void 0) { fields = {} } this.fields = fields } const _proto = Struct.prototype _proto.decode = function decode (stream, parent, length) { if (length === void 0) { length = 0 } const res = this._setup(stream, parent, length) this._parseFields(stream, res, this.fields) if (this.process != null) { this.process.call(res, stream) } return res } _proto._setup = function _setup (stream, parent, length) { const res = {} // define hidden properties Object.defineProperties(res, { parent: { value: parent }, _startOffset: { value: stream.pos }, _currentOffset: { value: 0, writable: true }, _length: { value: length } }) return res } _proto._parseFields = function _parseFields (stream, res, fields) { for (const key in fields) { var val const type = fields[key] if (typeof type === 'function') { val = type.call(res, res) } else { val = type.decode(stream, res) } if (val !== undefined) { if (val instanceof utils.PropertyDescriptor) { Object.defineProperty(res, key, val) } else { res[key] = val } } res._currentOffset = stream.pos - res._startOffset } } _proto.size = function size (val, parent, includePointers) { if (val == null) { val = {} } if (includePointers == null) { includePointers = true } const ctx = { parent, val, pointerSize: 0 } let size = 0 for (const key in this.fields) { const type = this.fields[key] if (type.size != null) { size += type.size(val[key], ctx) } } if (includePointers) { size += ctx.pointerSize } return size } _proto.encode = function encode (stream, val, parent) { let type if (this.preEncode != null) { this.preEncode.call(val, stream) } const ctx = { pointers: [], startOffset: stream.pos, parent, val, pointerSize: 0 } ctx.pointerOffset = stream.pos + this.size(val, ctx, false) for (const key in this.fields) { type = this.fields[key] if (type.encode != null) { type.encode(stream, val[key], ctx) } } let i = 0 while (i < ctx.pointers.length) { const ptr = ctx.pointers[i++] ptr.type.encode(stream, ptr.val, ptr.parent) } } return Struct }()) module.exports = Struct /***/ }, /***/ 3585: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(1539) __webpack_require__(4916) __webpack_require__(3123) function _inheritsLoose (subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } const Struct = __webpack_require__(1219) const getPath = function getPath (object, pathArray) { return pathArray.reduce(function (prevObj, key) { return prevObj && prevObj[key] }, object) } const VersionedStruct = /* #__PURE__ */(function (_Struct) { _inheritsLoose(VersionedStruct, _Struct) function VersionedStruct (type, versions) { let _this if (versions === void 0) { versions = {} } _this = _Struct.call(this) || this _this.type = type _this.versions = versions if (typeof type === 'string') { _this.versionPath = type.split('.') } return _this } const _proto = VersionedStruct.prototype _proto.decode = function decode (stream, parent, length) { if (length === void 0) { length = 0 } const res = this._setup(stream, parent, length) if (typeof this.type === 'string') { res.version = getPath(parent, this.versionPath) } else { res.version = this.type.decode(stream) } if (this.versions.header) { this._parseFields(stream, res, this.versions.header) } const fields = this.versions[res.version] if (fields == null) { throw new Error('Unknown version ' + res.version) } if (fields instanceof VersionedStruct) { return fields.decode(stream, parent) } this._parseFields(stream, res, fields) if (this.process != null) { this.process.call(res, stream) } return res } _proto.size = function size (val, parent, includePointers) { if (includePointers === void 0) { includePointers = true } let key, type if (!val) { throw new Error('Not a fixed size') } const ctx = { parent, val, pointerSize: 0 } let size = 0 if (typeof this.type !== 'string') { size += this.type.size(val.version, ctx) } if (this.versions.header) { for (key in this.versions.header) { type = this.versions.header[key] if (type.size != null) { size += type.size(val[key], ctx) } } } const fields = this.versions[val.version] if (fields == null) { throw new Error('Unknown version ' + val.version) } for (key in fields) { type = fields[key] if (type.size != null) { size += type.size(val[key], ctx) } } if (includePointers) { size += ctx.pointerSize } return size } _proto.encode = function encode (stream, val, parent) { let key, type if (this.preEncode != null) { this.preEncode.call(val, stream) } const ctx = { pointers: [], startOffset: stream.pos, parent, val, pointerSize: 0 } ctx.pointerOffset = stream.pos + this.size(val, ctx, false) if (typeof this.type !== 'string') { this.type.encode(stream, val.version) } if (this.versions.header) { for (key in this.versions.header) { type = this.versions.header[key] if (type.encode != null) { type.encode(stream, val[key], ctx) } } } const fields = this.versions[val.version] for (key in fields) { type = fields[key] if (type.encode != null) { type.encode(stream, val[key], ctx) } } let i = 0 while (i < ctx.pointers.length) { const ptr = ctx.pointers[i++] ptr.type.encode(stream, ptr.val, ptr.parent) } } return VersionedStruct }(Struct)) module.exports = VersionedStruct /***/ }, /***/ 6610: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const _require = __webpack_require__(6462) const NumberT = _require.Number exports.resolveLength = function (length, stream, parent) { let res if (typeof length === 'number') { res = length } else if (typeof length === 'function') { res = length.call(parent, parent) } else if (parent && typeof length === 'string') { res = parent[length] } else if (stream && length instanceof NumberT) { res = length.decode(stream) } if (isNaN(res)) { throw new Error('Not a fixed size') } return res } const PropertyDescriptor = function PropertyDescriptor (opts) { if (opts === void 0) { opts = {} } this.enumerable = true this.configurable = true for (const key in opts) { const val = opts[key] this[key] = val } } exports.PropertyDescriptor = PropertyDescriptor /***/ }, /***/ 8823: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ /* eslint-disable no-proto */ __webpack_require__(2526) __webpack_require__(1817) __webpack_require__(1539) __webpack_require__(6992) __webpack_require__(2472) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(7803) __webpack_require__(6649) __webpack_require__(6078) __webpack_require__(3290) __webpack_require__(7042) __webpack_require__(2222) __webpack_require__(9714) __webpack_require__(3210) __webpack_require__(4916) __webpack_require__(5306) __webpack_require__(6699) __webpack_require__(2023) __webpack_require__(9653) __webpack_require__(3753) __webpack_require__(545) __webpack_require__(8309) __webpack_require__(3161) __webpack_require__(3123) function _defineProperties (target, props) { for (let i = 0; i < props.length; i++) { const descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass (Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor } function _assertThisInitialized (self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _inheritsLoose (subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p; return o }; return _setPrototypeOf(o, p) } const base64 = __webpack_require__(9742) const ieee754 = __webpack_require__(645) const customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' // eslint-disable-line dot-notation ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation : null exports.Buffer = Buffer exports.SlowBuffer = SlowBuffer exports.INSPECT_MAX_BYTES = 50 const K_MAX_LENGTH = 0x7fffffff exports.kMaxLength = K_MAX_LENGTH /** * If `Buffer.TYPED_ARRAY_SUPPORT`: * === true Use Uint8Array implementation (fastest) * === false Print warning and recommend using `buffer` v4.x which has an Object * implementation (most compatible, even IE6) * * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, * Opera 11.6+, iOS 4.2+. * * We report that the browser does not support typed arrays if the are not subclassable * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support * for __proto__ and has a buggy typed array implementation. */ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.') } function typedArraySupport () { // Can typed array instances can be augmented? try { const arr = new Uint8Array(1) const proto = { foo: function foo () { return 42 } } Object.setPrototypeOf(proto, Uint8Array.prototype) Object.setPrototypeOf(arr, proto) return arr.foo() === 42 } catch (e) { return false } } Object.defineProperty(Buffer.prototype, 'parent', { enumerable: true, get: function get () { if (!Buffer.isBuffer(this)) return undefined return this.buffer } }) Object.defineProperty(Buffer.prototype, 'offset', { enumerable: true, get: function get () { if (!Buffer.isBuffer(this)) return undefined return this.byteOffset } }) function createBuffer (length) { if (length > K_MAX_LENGTH) { throw new RangeError('The value "' + length + '" is invalid for option "size"') } // Return an augmented `Uint8Array` instance const buf = new Uint8Array(length) Object.setPrototypeOf(buf, Buffer.prototype) return buf } /** * The Buffer constructor returns instances of `Uint8Array` that have their * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of * `Uint8Array`, so the returned instances will have all the node `Buffer` methods * and the `Uint8Array` methods. Square bracket notation works as expected -- it * returns a single octet. * * The `Uint8Array` prototype remains unmodified. */ function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new TypeError('The "string" argument must be of type string. Received type number') } return allocUnsafe(arg) } return from(arg, encodingOrOffset, length) } Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { if (typeof value === 'string') { return fromString(value, encodingOrOffset) } if (ArrayBuffer.isView(value)) { return fromArrayView(value) } if (value == null) { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value) } if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { return fromArrayBuffer(value, encodingOrOffset, length) } if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type number') } const valueOf = value.valueOf && value.valueOf() if (valueOf != null && valueOf !== value) { return Buffer.from(valueOf, encodingOrOffset, length) } const b = fromObject(value) if (b) return b if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) } throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + typeof value) } /** * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError * if value is a number. * Buffer.from(str[, encoding]) * Buffer.from(array) * Buffer.from(buffer) * Buffer.from(arrayBuffer[, byteOffset[, length]]) **/ Buffer.from = function (value, encodingOrOffset, length) { return from(value, encodingOrOffset, length) } // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: // https://github.com/feross/buffer/pull/148 Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) Object.setPrototypeOf(Buffer, Uint8Array) function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be of type number') } else if (size < 0) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } } function alloc (size, fill, encoding) { assertSize(size) if (size <= 0) { return createBuffer(size) } if (fill !== undefined) { // Only pay attention to encoding if it's a string. This // prevents accidentally sending in a number that would // be interpreted as a start offset. return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill) } return createBuffer(size) } /** * Creates a new filled Buffer instance. * alloc(size[, fill[, encoding]]) **/ Buffer.alloc = function (size, fill, encoding) { return alloc(size, fill, encoding) } function allocUnsafe (size) { assertSize(size) return createBuffer(size < 0 ? 0 : checked(size) | 0) } /** * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. * */ Buffer.allocUnsafe = function (size) { return allocUnsafe(size) } /** * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ Buffer.allocUnsafeSlow = function (size) { return allocUnsafe(size) } function fromString (string, encoding) { if (typeof encoding !== 'string' || encoding === '') { encoding = 'utf8' } if (!Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } const length = byteLength(string, encoding) | 0 let buf = createBuffer(length) const actual = buf.write(string, encoding) if (actual !== length) { // Writing a hex string, for example, that contains invalid characters will // cause everything after the first invalid character to be ignored. (e.g. // 'abxxcd' will be treated as 'ab') buf = buf.slice(0, actual) } return buf } function fromArrayLike (array) { const length = array.length < 0 ? 0 : checked(array.length) | 0 const buf = createBuffer(length) for (let i = 0; i < length; i += 1) { buf[i] = array[i] & 255 } return buf } function fromArrayView (arrayView) { if (isInstance(arrayView, Uint8Array)) { const copy = new Uint8Array(arrayView) return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) } return fromArrayLike(arrayView) } function fromArrayBuffer (array, byteOffset, length) { if (byteOffset < 0 || array.byteLength < byteOffset) { throw new RangeError('"offset" is outside of buffer bounds') } if (array.byteLength < byteOffset + (length || 0)) { throw new RangeError('"length" is outside of buffer bounds') } let buf if (byteOffset === undefined && length === undefined) { buf = new Uint8Array(array) } else if (length === undefined) { buf = new Uint8Array(array, byteOffset) } else { buf = new Uint8Array(array, byteOffset, length) } // Return an augmented `Uint8Array` instance Object.setPrototypeOf(buf, Buffer.prototype) return buf } function fromObject (obj) { if (Buffer.isBuffer(obj)) { const len = checked(obj.length) | 0 const buf = createBuffer(len) if (buf.length === 0) { return buf } obj.copy(buf, 0, 0, len) return buf } if (obj.length !== undefined) { if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { return createBuffer(0) } return fromArrayLike(obj) } if (obj.type === 'Buffer' && Array.isArray(obj.data)) { return fromArrayLike(obj.data) } } function checked (length) { // Note: cannot use `length < K_MAX_LENGTH` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= K_MAX_LENGTH) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') } return length | 0 } function SlowBuffer (length) { if (+length != length) { // eslint-disable-line eqeqeq length = 0 } return Buffer.alloc(+length) } Buffer.isBuffer = function isBuffer (b) { return b != null && b._isBuffer === true && b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false } Buffer.compare = function compare (a, b) { if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array') } if (a === b) return 0 let x = a.length let y = b.length for (let i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i] y = b[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } Buffer.isEncoding = function isEncoding (encoding) { switch (String(encoding).toLowerCase()) { case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true default: return false } } Buffer.concat = function concat (list, length) { if (!Array.isArray(list)) { throw new TypeError('"list" argument must be an Array of Buffers') } if (list.length === 0) { return Buffer.alloc(0) } let i if (length === undefined) { length = 0 for (i = 0; i < list.length; ++i) { length += list[i].length } } const buffer = Buffer.allocUnsafe(length) let pos = 0 for (i = 0; i < list.length; ++i) { let buf = list[i] if (isInstance(buf, Uint8Array)) { if (pos + buf.length > buffer.length) { if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf) buf.copy(buffer, pos) } else { Uint8Array.prototype.set.call(buffer, buf, pos) } } else if (!Buffer.isBuffer(buf)) { throw new TypeError('"list" argument must be an Array of Buffers') } else { buf.copy(buffer, pos) } pos += buf.length } return buffer } function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { return string.byteLength } if (typeof string !== 'string') { throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof string) } const len = string.length const mustMatch = arguments.length > 2 && arguments[2] === true if (!mustMatch && len === 0) return 0 // Use a for loop to avoid recursion let loweredCase = false for (;;) { switch (encoding) { case 'ascii': case 'latin1': case 'binary': return len case 'utf8': case 'utf-8': return utf8ToBytes(string).length case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return len * 2 case 'hex': return len >>> 1 case 'base64': return base64ToBytes(string).length default: if (loweredCase) { return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 } encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.byteLength = byteLength function slowToString (encoding, start, end) { let loweredCase = false // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // property of a typed array. // This behaves neither like String nor Uint8Array in that we set start/end // to their upper/lower bounds if the value passed is out of range. // undefined is handled specially as per ECMA-262 6th Edition, // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. if (start === undefined || start < 0) { start = 0 } // Return early if start > this.length. Done here to prevent potential uint32 // coercion fail below. if (start > this.length) { return '' } if (end === undefined || end > this.length) { end = this.length } if (end <= 0) { return '' } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. end >>>= 0 start >>>= 0 if (end <= start) { return '' } if (!encoding) encoding = 'utf8' while (true) { switch (encoding) { case 'hex': return hexSlice(this, start, end) case 'utf8': case 'utf-8': return utf8Slice(this, start, end) case 'ascii': return asciiSlice(this, start, end) case 'latin1': case 'binary': return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return utf16leSlice(this, start, end) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = (encoding + '').toLowerCase() loweredCase = true } } } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) // to detect a Buffer instance. It's not possible to use `instanceof Buffer` // reliably in a browserify context because there could be multiple different // copies of the 'buffer' package in use. This method works even for Buffer // instances that were created from another copy of the `buffer` package. // See: https://github.com/feross/buffer/issues/154 Buffer.prototype._isBuffer = true function swap (b, n, m) { const i = b[n] b[n] = b[m] b[m] = i } Buffer.prototype.swap16 = function swap16 () { const len = this.length if (len % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits') } for (let i = 0; i < len; i += 2) { swap(this, i, i + 1) } return this } Buffer.prototype.swap32 = function swap32 () { const len = this.length if (len % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits') } for (let i = 0; i < len; i += 4) { swap(this, i, i + 3) swap(this, i + 1, i + 2) } return this } Buffer.prototype.swap64 = function swap64 () { const len = this.length if (len % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits') } for (let i = 0; i < len; i += 8) { swap(this, i, i + 7) swap(this, i + 1, i + 6) swap(this, i + 2, i + 5) swap(this, i + 3, i + 4) } return this } Buffer.prototype.toString = function toString () { const length = this.length if (length === 0) return '' if (arguments.length === 0) return utf8Slice(this, 0, length) return slowToString.apply(this, arguments) } Buffer.prototype.toLocaleString = Buffer.prototype.toString Buffer.prototype.equals = function equals (b) { if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') if (this === b) return true return Buffer.compare(this, b) === 0 } Buffer.prototype.inspect = function inspect () { let str = '' const max = exports.INSPECT_MAX_BYTES str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() if (this.length > max) str += ' ... ' return '' } if (customInspectSymbol) { Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect } Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (isInstance(target, Uint8Array)) { target = Buffer.from(target, target.offset, target.byteLength) } if (!Buffer.isBuffer(target)) { throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + typeof target) } if (start === undefined) { start = 0 } if (end === undefined) { end = target ? target.length : 0 } if (thisStart === undefined) { thisStart = 0 } if (thisEnd === undefined) { thisEnd = this.length } if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { throw new RangeError('out of range index') } if (thisStart >= thisEnd && start >= end) { return 0 } if (thisStart >= thisEnd) { return -1 } if (start >= end) { return 1 } start >>>= 0 end >>>= 0 thisStart >>>= 0 thisEnd >>>= 0 if (this === target) return 0 let x = thisEnd - thisStart let y = end - start const len = Math.min(x, y) const thisCopy = this.slice(thisStart, thisEnd) const targetCopy = target.slice(start, end) for (let i = 0; i < len; ++i) { if (thisCopy[i] !== targetCopy[i]) { x = thisCopy[i] y = targetCopy[i] break } } if (x < y) return -1 if (y < x) return 1 return 0 } // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, // OR the last index of `val` in `buffer` at offset <= `byteOffset`. // // Arguments: // - buffer - a Buffer to search // - val - a string, Buffer, or number // - byteOffset - an index into `buffer`; will be clamped to an int32 // - encoding - an optional encoding, relevant is val is a string // - dir - true for indexOf, false for lastIndexOf function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000 } byteOffset = +byteOffset // Coerce to Number. if (numberIsNaN(byteOffset)) { // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer byteOffset = dir ? 0 : buffer.length - 1 } // Normalize byteOffset: negative offsets start from the end of the buffer if (byteOffset < 0) byteOffset = buffer.length + byteOffset if (byteOffset >= buffer.length) { if (dir) return -1; else byteOffset = buffer.length - 1 } else if (byteOffset < 0) { if (dir) byteOffset = 0; else return -1 } // Normalize val if (typeof val === 'string') { val = Buffer.from(val, encoding) } // Finally, search either indexOf (if dir is true) or lastIndexOf if (Buffer.isBuffer(val)) { // Special case: looking for empty string/buffer always fails if (val.length === 0) { return -1 } return arrayIndexOf(buffer, val, byteOffset, encoding, dir) } else if (typeof val === 'number') { val = val & 0xFF // Search for a byte value [0-255] if (typeof Uint8Array.prototype.indexOf === 'function') { if (dir) { return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) } else { return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) } } return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) } throw new TypeError('val must be string, number or Buffer') } function arrayIndexOf (arr, val, byteOffset, encoding, dir) { let indexSize = 1 let arrLength = arr.length let valLength = val.length if (encoding !== undefined) { encoding = String(encoding).toLowerCase() if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { if (arr.length < 2 || val.length < 2) { return -1 } indexSize = 2 arrLength /= 2 valLength /= 2 byteOffset /= 2 } } function read (buf, i) { if (indexSize === 1) { return buf[i] } else { return buf.readUInt16BE(i * indexSize) } } let i if (dir) { let foundIndex = -1 for (i = byteOffset; i < arrLength; i++) { if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { if (foundIndex === -1) foundIndex = i if (i - foundIndex + 1 === valLength) return foundIndex * indexSize } else { if (foundIndex !== -1) i -= i - foundIndex foundIndex = -1 } } } else { if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength for (i = byteOffset; i >= 0; i--) { let found = true for (let j = 0; j < valLength; j++) { if (read(arr, i + j) !== read(val, j)) { found = false break } } if (found) return i } } return -1 } Buffer.prototype.includes = function includes (val, byteOffset, encoding) { return this.indexOf(val, byteOffset, encoding) !== -1 } Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 const remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } const strLen = string.length if (length > strLen / 2) { length = strLen / 2 } let i for (i = 0; i < length; ++i) { const parsed = parseInt(string.substr(i * 2, 2), 16) if (numberIsNaN(parsed)) return i buf[offset + i] = parsed } return i } function utf8Write (buf, string, offset, length) { return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } function base64Write (buf, string, offset, length) { return blitBuffer(base64ToBytes(string), buf, offset, length) } function ucs2Write (buf, string, offset, length) { return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } Buffer.prototype.write = function write (string, offset, length, encoding) { // Buffer#write(string) if (offset === undefined) { encoding = 'utf8' length = this.length offset = 0 // Buffer#write(string, encoding) } else if (length === undefined && typeof offset === 'string') { encoding = offset length = this.length offset = 0 // Buffer#write(string, offset[, length][, encoding]) } else if (isFinite(offset)) { offset = offset >>> 0 if (isFinite(length)) { length = length >>> 0 if (encoding === undefined) encoding = 'utf8' } else { encoding = length length = undefined } } else { throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported') } const remaining = this.length - offset if (length === undefined || length > remaining) length = remaining if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { throw new RangeError('Attempt to write outside buffer bounds') } if (!encoding) encoding = 'utf8' let loweredCase = false for (;;) { switch (encoding) { case 'hex': return hexWrite(this, string, offset, length) case 'utf8': case 'utf-8': return utf8Write(this, string, offset, length) case 'ascii': case 'latin1': case 'binary': return asciiWrite(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write return base64Write(this, string, offset, length) case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return ucs2Write(this, string, offset, length) default: if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) encoding = ('' + encoding).toLowerCase() loweredCase = true } } } Buffer.prototype.toJSON = function toJSON () { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) } } function base64Slice (buf, start, end) { if (start === 0 && end === buf.length) { return base64.fromByteArray(buf) } else { return base64.fromByteArray(buf.slice(start, end)) } } function utf8Slice (buf, start, end) { end = Math.min(buf.length, end) const res = [] let i = start while (i < end) { const firstByte = buf[i] let codePoint = null let bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1 if (i + bytesPerSequence <= end) { let secondByte = void 0 let thirdByte = void 0 let fourthByte = void 0 let tempCodePoint = void 0 switch (bytesPerSequence) { case 1: if (firstByte < 0x80) { codePoint = firstByte } break case 2: secondByte = buf[i + 1] if ((secondByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F if (tempCodePoint > 0x7F) { codePoint = tempCodePoint } } break case 3: secondByte = buf[i + 1] thirdByte = buf[i + 2] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { codePoint = tempCodePoint } } break case 4: secondByte = buf[i + 1] thirdByte = buf[i + 2] fourthByte = buf[i + 3] if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { codePoint = tempCodePoint } } } } if (codePoint === null) { // we did not generate a valid codePoint so insert a // replacement char (U+FFFD) and advance only 1 byte codePoint = 0xFFFD bytesPerSequence = 1 } else if (codePoint > 0xFFFF) { // encode to utf16 (surrogate pair dance) codePoint -= 0x10000 res.push(codePoint >>> 10 & 0x3FF | 0xD800) codePoint = 0xDC00 | codePoint & 0x3FF } res.push(codePoint) i += bytesPerSequence } return decodeCodePointsArray(res) } // Based on http://stackoverflow.com/a/22747272/680742, the browser with // the lowest limit is Chrome, with 0x10000 args. // We go 1 magnitude less, for safety const MAX_ARGUMENTS_LENGTH = 0x1000 function decodeCodePointsArray (codePoints) { const len = codePoints.length if (len <= MAX_ARGUMENTS_LENGTH) { return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } // Decode in chunks to avoid "call stack size exceeded". let res = '' let i = 0 while (i < len) { res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)) } return res } function asciiSlice (buf, start, end) { let ret = '' end = Math.min(buf.length, end) for (let i = start; i < end; ++i) { ret += String.fromCharCode(buf[i] & 0x7F) } return ret } function latin1Slice (buf, start, end) { let ret = '' end = Math.min(buf.length, end) for (let i = start; i < end; ++i) { ret += String.fromCharCode(buf[i]) } return ret } function hexSlice (buf, start, end) { const len = buf.length if (!start || start < 0) start = 0 if (!end || end < 0 || end > len) end = len let out = '' for (let i = start; i < end; ++i) { out += hexSliceLookupTable[buf[i]] } return out } function utf16leSlice (buf, start, end) { const bytes = buf.slice(start, end) let res = '' // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) for (let i = 0; i < bytes.length - 1; i += 2) { res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } Buffer.prototype.slice = function slice (start, end) { const len = this.length start = ~~start end = end === undefined ? len : ~~end if (start < 0) { start += len if (start < 0) start = 0 } else if (start > len) { start = len } if (end < 0) { end += len if (end < 0) end = 0 } else if (end > len) { end = len } if (end < start) end = start const newBuf = this.subarray(start, end) // Return an augmented `Uint8Array` instance Object.setPrototypeOf(newBuf, Buffer.prototype) return newBuf } /* * Need to make sure that buffer isn't trying to write out of bounds. */ function checkOffset (offset, ext, length) { if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) let val = this[offset] let mul = 1 let i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } return val } Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { checkOffset(offset, byteLength, this.length) } let val = this[offset + --byteLength] let mul = 1 while (byteLength > 0 && (mul *= 0x100)) { val += this[offset + --byteLength] * mul } return val } Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) return this[offset] } Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] | this[offset + 1] << 8 } Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) return this[offset] << 8 | this[offset + 1] } Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000 } Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]) } Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const lo = first + this[++offset] * Math.pow(2, 8) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 24) const hi = this[++offset] + this[++offset] * Math.pow(2, 8) + this[++offset] * Math.pow(2, 16) + last * Math.pow(2, 24) return BigInt(lo) + (BigInt(hi) << BigInt(32)) }) Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const hi = first * Math.pow(2, 24) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + this[++offset] const lo = this[++offset] * Math.pow(2, 24) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + last return (BigInt(hi) << BigInt(32)) + BigInt(lo) }) Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) let val = this[offset] let mul = 1 let i = 0 while (++i < byteLength && (mul *= 0x100)) { val += this[offset + i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) checkOffset(offset, byteLength, this.length) let i = byteLength let mul = 1 let val = this[offset + --i] while (i > 0 && (mul *= 0x100)) { val += this[offset + --i] * mul } mul *= 0x80 if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val } Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 1, this.length) if (!(this[offset] & 0x80)) return this[offset] return (0xff - this[offset] + 1) * -1 } Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) const val = this[offset] | this[offset + 1] << 8 return val & 0x8000 ? val | 0xFFFF0000 : val } Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 2, this.length) const val = this[offset + 1] | this[offset] << 8 return val & 0x8000 ? val | 0xFFFF0000 : val } Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24 } Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3] } Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const val = this[offset + 4] + this[offset + 5] * Math.pow(2, 8) + this[offset + 6] * Math.pow(2, 16) + (last << 24) // Overflow return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * Math.pow(2, 8) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 24)) }) Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { offset = offset >>> 0 validateNumber(offset, 'offset') const first = this[offset] const last = this[offset + 7] if (first === undefined || last === undefined) { boundsError(offset, this.length - 8) } const val = (first << 24) + // Overflow this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + this[++offset] return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * Math.pow(2, 24) + this[++offset] * Math.pow(2, 16) + this[++offset] * Math.pow(2, 8) + last) }) Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, true, 23, 4) } Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 4, this.length) return ieee754.read(this, offset, false, 23, 4) } Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, true, 52, 8) } Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { offset = offset >>> 0 if (!noAssert) checkOffset(offset, 8, this.length) return ieee754.read(this, offset, false, 52, 8) } function checkInt (buf, value, offset, ext, max, min) { if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') if (offset + ext > buf.length) throw new RangeError('Index out of range') } Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { const maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } let mul = 1 let i = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { this[offset + i] = value / mul & 0xFF } return offset + byteLength } Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 byteLength = byteLength >>> 0 if (!noAssert) { const maxBytes = Math.pow(2, 8 * byteLength) - 1 checkInt(this, value, offset, byteLength, maxBytes, 0) } let i = byteLength - 1 let mul = 1 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { this[offset + i] = value / mul & 0xFF } return offset + byteLength } Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) this[offset] = value & 0xff return offset + 1 } Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = value & 0xff this[offset + 1] = value >>> 8 return offset + 2 } Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) this[offset] = value >>> 8 this[offset + 1] = value & 0xff return offset + 2 } Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset + 3] = value >>> 24 this[offset + 2] = value >>> 16 this[offset + 1] = value >>> 8 this[offset] = value & 0xff return offset + 4 } Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) this[offset] = value >>> 24 this[offset + 1] = value >>> 16 this[offset + 2] = value >>> 8 this[offset + 3] = value & 0xff return offset + 4 } function wrtBigUInt64LE (buf, value, offset, min, max) { checkIntBI(value, min, max, buf, offset, 7) let lo = Number(value & BigInt(0xffffffff)) buf[offset++] = lo lo = lo >> 8 buf[offset++] = lo lo = lo >> 8 buf[offset++] = lo lo = lo >> 8 buf[offset++] = lo let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)) buf[offset++] = hi hi = hi >> 8 buf[offset++] = hi hi = hi >> 8 buf[offset++] = hi hi = hi >> 8 buf[offset++] = hi return offset } function wrtBigUInt64BE (buf, value, offset, min, max) { checkIntBI(value, min, max, buf, offset, 7) let lo = Number(value & BigInt(0xffffffff)) buf[offset + 7] = lo lo = lo >> 8 buf[offset + 6] = lo lo = lo >> 8 buf[offset + 5] = lo lo = lo >> 8 buf[offset + 4] = lo let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)) buf[offset + 3] = hi hi = hi >> 8 buf[offset + 2] = hi hi = hi >> 8 buf[offset + 1] = hi hi = hi >> 8 buf[offset] = hi return offset + 8 } Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset) { if (offset === void 0) { offset = 0 } return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) }) Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset) { if (offset === void 0) { offset = 0 } return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) }) Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { const limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } let i = 0 let mul = 1 let sub = 0 this[offset] = value & 0xFF while (++i < byteLength && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { sub = 1 } this[offset + i] = (value / mul >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { const limit = Math.pow(2, 8 * byteLength - 1) checkInt(this, value, offset, byteLength, limit - 1, -limit) } let i = byteLength - 1 let mul = 1 let sub = 0 this[offset + i] = value & 0xFF while (--i >= 0 && (mul *= 0x100)) { if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { sub = 1 } this[offset + i] = (value / mul >> 0) - sub & 0xFF } return offset + byteLength } Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) if (value < 0) value = 0xff + value + 1 this[offset] = value & 0xff return offset + 1 } Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = value & 0xff this[offset + 1] = value >>> 8 return offset + 2 } Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) this[offset] = value >>> 8 this[offset + 1] = value & 0xff return offset + 2 } Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) this[offset] = value & 0xff this[offset + 1] = value >>> 8 this[offset + 2] = value >>> 16 this[offset + 3] = value >>> 24 return offset + 4 } Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) if (value < 0) value = 0xffffffff + value + 1 this[offset] = value >>> 24 this[offset + 1] = value >>> 16 this[offset + 2] = value >>> 8 this[offset + 3] = value & 0xff return offset + 4 } Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset) { if (offset === void 0) { offset = 0 } return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) }) Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset) { if (offset === void 0) { offset = 0 } return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) }) function checkIEEE754 (buf, value, offset, ext, max, min) { if (offset + ext > buf.length) throw new RangeError('Index out of range') if (offset < 0) throw new RangeError('Index out of range') } function writeFloat (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } ieee754.write(buf, value, offset, littleEndian, 23, 4) return offset + 4 } Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { return writeFloat(this, value, offset, true, noAssert) } Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { return writeFloat(this, value, offset, false, noAssert) } function writeDouble (buf, value, offset, littleEndian, noAssert) { value = +value offset = offset >>> 0 if (!noAssert) { checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) } ieee754.write(buf, value, offset, littleEndian, 52, 8) return offset + 8 } Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { return writeDouble(this, value, offset, true, noAssert) } Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { return writeDouble(this, value, offset, false, noAssert) } // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) Buffer.prototype.copy = function copy (target, targetStart, start, end) { if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') if (!start) start = 0 if (!end && end !== 0) end = this.length if (targetStart >= target.length) targetStart = target.length if (!targetStart) targetStart = 0 if (end > 0 && end < start) end = start // Copy 0 bytes; we're done if (end === start) return 0 if (target.length === 0 || this.length === 0) return 0 // Fatal error conditions if (targetStart < 0) { throw new RangeError('targetStart out of bounds') } if (start < 0 || start >= this.length) throw new RangeError('Index out of range') if (end < 0) throw new RangeError('sourceEnd out of bounds') // Are we oob? if (end > this.length) end = this.length if (target.length - targetStart < end - start) { end = target.length - targetStart + start } const len = end - start if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { // Use built-in when available, missing from IE11 this.copyWithin(targetStart, start, end) } else { Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart) } return len } // Usage: // buffer.fill(number[, offset[, end]]) // buffer.fill(buffer[, offset[, end]]) // buffer.fill(string[, offset[, end]][, encoding]) Buffer.prototype.fill = function fill (val, start, end, encoding) { // Handle string cases: if (typeof val === 'string') { if (typeof start === 'string') { encoding = start start = 0 end = this.length } else if (typeof end === 'string') { encoding = end end = this.length } if (encoding !== undefined && typeof encoding !== 'string') { throw new TypeError('encoding must be a string') } if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { throw new TypeError('Unknown encoding: ' + encoding) } if (val.length === 1) { const code = val.charCodeAt(0) if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { // Fast path: If `val` fits into a single byte, use that numeric value. val = code } } } else if (typeof val === 'number') { val = val & 255 } else if (typeof val === 'boolean') { val = Number(val) } // Invalid ranges are not set to a default, so can range check early. if (start < 0 || this.length < start || this.length < end) { throw new RangeError('Out of range index') } if (end <= start) { return this } start = start >>> 0 end = end === undefined ? this.length : end >>> 0 if (!val) val = 0 let i if (typeof val === 'number') { for (i = start; i < end; ++i) { this[i] = val } } else { const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding) const len = bytes.length if (len === 0) { throw new TypeError('The value "' + val + '" is invalid for argument "value"') } for (i = 0; i < end - start; ++i) { this[i + start] = bytes[i % len] } } return this } // CUSTOM ERRORS // ============= // Simplified versions from Node, changed for Buffer-only usage const errors = {} function E (sym, getMessage, Base) { errors[sym] = /* #__PURE__ */(function (_Base) { _inheritsLoose(NodeError, _Base) function NodeError () { let _this _this = _Base.call(this) || this Object.defineProperty(_assertThisInitialized(_this), 'message', { value: getMessage.apply(_assertThisInitialized(_this), arguments), writable: true, configurable: true }) // Add the error code to the name to include it in the stack trace. _this.name = _this.name + ' [' + sym + ']' // Access the stack to generate the error message including the error code // from the name. _this.stack // eslint-disable-line no-unused-expressions // Reset the name to the actual name. delete _this.name return _this } const _proto = NodeError.prototype _proto.toString = function toString () { return this.name + ' [' + sym + ']: ' + this.message } _createClass(NodeError, [{ key: 'code', get: function get () { return sym }, set: function set (value) { Object.defineProperty(this, 'code', { configurable: true, enumerable: true, value, writable: true }) } }]) return NodeError }(Base)) } E('ERR_BUFFER_OUT_OF_BOUNDS', function (name) { if (name) { return name + ' is outside of buffer bounds' } return 'Attempt to access memory outside buffer bounds' }, RangeError) E('ERR_INVALID_ARG_TYPE', function (name, actual) { return 'The "' + name + '" argument must be of type number. Received type ' + typeof actual }, TypeError) E('ERR_OUT_OF_RANGE', function (str, range, input) { let msg = 'The value of "' + str + '" is out of range.' let received = input if (Number.isInteger(input) && Math.abs(input) > Math.pow(2, 32)) { received = addNumericalSeparator(String(input)) } else if (typeof input === 'bigint') { received = String(input) if (input > Math.pow(BigInt(2), BigInt(32)) || input < -Math.pow(BigInt(2), BigInt(32))) { received = addNumericalSeparator(received) } received += 'n' } msg += ' It must be ' + range + '. Received ' + received return msg }, RangeError) function addNumericalSeparator (val) { let res = '' let i = val.length const start = val[0] === '-' ? 1 : 0 for (; i >= start + 4; i -= 3) { res = '_' + val.slice(i - 3, i) + res } return '' + val.slice(0, i) + res } // CHECK FUNCTIONS // =============== function checkBounds (buf, offset, byteLength) { validateNumber(offset, 'offset') if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { boundsError(offset, buf.length - (byteLength + 1)) } } function checkIntBI (value, min, max, buf, offset, byteLength) { if (value > max || value < min) { const n = typeof min === 'bigint' ? 'n' : '' let range if (byteLength > 3) { if (min === 0 || min === BigInt(0)) { range = '>= 0' + n + ' and < 2' + n + ' ** ' + (byteLength + 1) * 8 + n } else { range = '>= -(2' + n + ' ** ' + ((byteLength + 1) * 8 - 1) + n + ') and < 2 ** ' + ('' + ((byteLength + 1) * 8 - 1) + n) } } else { range = '>= ' + min + n + ' and <= ' + max + n } throw new errors.ERR_OUT_OF_RANGE('value', range, value) } checkBounds(buf, offset, byteLength) } function validateNumber (value, name) { if (typeof value !== 'number') { throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) } } function boundsError (value, length, type) { if (Math.floor(value) !== value) { validateNumber(value, type) throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value) } if (length < 0) { throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() } throw new errors.ERR_OUT_OF_RANGE(type || 'offset', '>= ' + (type ? 1 : 0) + ' and <= ' + length, value) } // HELPER FUNCTIONS // ================ const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g function base64clean (str) { // Node takes equal signs as end of the Base64 encoding str = str.split('=')[0] // Node strips out invalid characters like \n and \t from the string, base64-js does not str = str.trim().replace(INVALID_BASE64_RE, '') // Node converts strings with length < 2 to '' if (str.length < 2) return '' // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not while (str.length % 4 !== 0) { str = str + '=' } return str } function utf8ToBytes (string, units) { units = units || Infinity let codePoint const length = string.length let leadSurrogate = null const bytes = [] for (let i = 0; i < length; ++i) { codePoint = string.charCodeAt(i) // is surrogate component if (codePoint > 0xD7FF && codePoint < 0xE000) { // last char was a lead if (!leadSurrogate) { // no lead yet if (codePoint > 0xDBFF) { // unexpected trail if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } else if (i + 1 === length) { // unpaired lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) continue } // valid lead leadSurrogate = codePoint continue } // 2 leads in a row if (codePoint < 0xDC00) { if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) leadSurrogate = codePoint continue } // valid surrogate pair codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 } else if (leadSurrogate) { // valid bmp char, but last char was a lead if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) } leadSurrogate = null // encode utf8 if (codePoint < 0x80) { if ((units -= 1) < 0) break bytes.push(codePoint) } else if (codePoint < 0x800) { if ((units -= 2) < 0) break bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80) } else if (codePoint < 0x10000) { if ((units -= 3) < 0) break bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80) } else if (codePoint < 0x110000) { if ((units -= 4) < 0) break bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80) } else { throw new Error('Invalid code point') } } return bytes } function asciiToBytes (str) { const byteArray = [] for (let i = 0; i < str.length; ++i) { // Node's code seems to be doing this and not & 0x7F.. byteArray.push(str.charCodeAt(i) & 0xFF) } return byteArray } function utf16leToBytes (str, units) { let c, hi, lo const byteArray = [] for (let i = 0; i < str.length; ++i) { if ((units -= 2) < 0) break c = str.charCodeAt(i) hi = c >> 8 lo = c % 256 byteArray.push(lo) byteArray.push(hi) } return byteArray } function base64ToBytes (str) { return base64.toByteArray(base64clean(str)) } function blitBuffer (src, dst, offset, length) { let i for (i = 0; i < length; ++i) { if (i + offset >= dst.length || i >= src.length) break dst[i + offset] = src[i] } return i } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass // the `instanceof` check but they should be treated as of that type. // See: https://github.com/feross/buffer/issues/166 function isInstance (obj, type) { return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name } function numberIsNaN (obj) { // For IE11 support return obj !== obj // eslint-disable-line no-self-compare } // Create lookup table for `toString('hex')` // See: https://github.com/feross/buffer/issues/219 var hexSliceLookupTable = (function () { const alphabet = '0123456789abcdef' const table = new Array(256) for (let i = 0; i < 16; ++i) { const i16 = i * 16 for (let j = 0; j < 16; ++j) { table[i16 + j] = alphabet[i] + alphabet[j] } } return table }()) // Return not function with Error if BigInt not supported function defineBigIntMethod (fn) { return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn } function BufferBigIntNotDefined () { throw new Error('BigInt not supported') } /***/ }, /***/ 477: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(7803) __webpack_require__(1539) // eslint-disable-next-line es/no-typed-arrays -- safe module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined' /***/ }, /***/ 2094: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const NATIVE_ARRAY_BUFFER = __webpack_require__(477) const DESCRIPTORS = __webpack_require__(9781) const global = __webpack_require__(7854) const isCallable = __webpack_require__(614) const isObject = __webpack_require__(111) const hasOwn = __webpack_require__(2597) const classof = __webpack_require__(648) const tryToString = __webpack_require__(6330) const createNonEnumerableProperty = __webpack_require__(8880) const redefine = __webpack_require__(1320) const defineProperty = (__webpack_require__(3070).f) const isPrototypeOf = __webpack_require__(7976) const getPrototypeOf = __webpack_require__(9518) const setPrototypeOf = __webpack_require__(7674) const wellKnownSymbol = __webpack_require__(5112) const uid = __webpack_require__(9711) const Int8Array = global.Int8Array const Int8ArrayPrototype = Int8Array && Int8Array.prototype const Uint8ClampedArray = global.Uint8ClampedArray const Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype let TypedArray = Int8Array && getPrototypeOf(Int8Array) let TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype) const ObjectPrototype = Object.prototype const TypeError = global.TypeError const TO_STRING_TAG = wellKnownSymbol('toStringTag') const TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG') const TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR') // Fixing native typed arrays in Opera Presto crashes the browser, see #595 let NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera' let TYPED_ARRAY_TAG_REQIRED = false let NAME, Constructor, Prototype const TypedArrayConstructorsList = { Int8Array: 1, Uint8Array: 1, Uint8ClampedArray: 1, Int16Array: 2, Uint16Array: 2, Int32Array: 4, Uint32Array: 4, Float32Array: 4, Float64Array: 8 } const BigIntArrayConstructorsList = { BigInt64Array: 8, BigUint64Array: 8 } const isView = function isView (it) { if (!isObject(it)) return false const klass = classof(it) return klass === 'DataView' || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass) } const isTypedArray = function isTypedArray (it) { if (!isObject(it)) return false const klass = classof(it) return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass) } const aTypedArray = function aTypedArray (it) { if (isTypedArray(it)) return it throw TypeError('Target is not a typed array') } const aTypedArrayConstructor = function aTypedArrayConstructor (C) { if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C throw TypeError(tryToString(C) + ' is not a typed array constructor') } const exportTypedArrayMethod = function exportTypedArrayMethod (KEY, property, forced) { if (!DESCRIPTORS) return if (forced) { for (const ARRAY in TypedArrayConstructorsList) { const TypedArrayConstructor = global[ARRAY] if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) { try { delete TypedArrayConstructor.prototype[KEY] } catch (error) { /* empty */ } } } } if (!TypedArrayPrototype[KEY] || forced) { redefine(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property) } } const exportTypedArrayStaticMethod = function exportTypedArrayStaticMethod (KEY, property, forced) { let ARRAY, TypedArrayConstructor if (!DESCRIPTORS) return if (setPrototypeOf) { if (forced) { for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global[ARRAY] if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) { try { delete TypedArrayConstructor[KEY] } catch (error) { /* empty */ } } } } if (!TypedArray[KEY] || forced) { // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable try { return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property) } catch (error) { /* empty */ } } else return } for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global[ARRAY] if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { redefine(TypedArrayConstructor, KEY, property) } } } for (NAME in TypedArrayConstructorsList) { Constructor = global[NAME] Prototype = Constructor && Constructor.prototype if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor); else NATIVE_ARRAY_BUFFER_VIEWS = false } for (NAME in BigIntArrayConstructorsList) { Constructor = global[NAME] Prototype = Constructor && Constructor.prototype if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor) } // WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray = function TypedArray () { throw TypeError('Incorrect invocation') } if (NATIVE_ARRAY_BUFFER_VIEWS) { for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME], TypedArray) } } } if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { TypedArrayPrototype = TypedArray.prototype if (NATIVE_ARRAY_BUFFER_VIEWS) { for (NAME in TypedArrayConstructorsList) { if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype) } } } // WebKit bug - one more object in Uint8ClampedArray prototype chain if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype) } if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { TYPED_ARRAY_TAG_REQIRED = true defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function get () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined } }) for (NAME in TypedArrayConstructorsList) { if (global[NAME]) { createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME) } } } module.exports = { NATIVE_ARRAY_BUFFER_VIEWS, TYPED_ARRAY_CONSTRUCTOR, TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG, aTypedArray, aTypedArrayConstructor, exportTypedArrayMethod, exportTypedArrayStaticMethod, isView, isTypedArray, TypedArray, TypedArrayPrototype } /***/ }, /***/ 2091: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(8309) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const DESCRIPTORS = __webpack_require__(9781) const NATIVE_ARRAY_BUFFER = __webpack_require__(477) const FunctionName = __webpack_require__(6530) const createNonEnumerableProperty = __webpack_require__(8880) const redefineAll = __webpack_require__(2248) const fails = __webpack_require__(7293) const anInstance = __webpack_require__(5787) const toIntegerOrInfinity = __webpack_require__(9303) const toLength = __webpack_require__(7466) const toIndex = __webpack_require__(7067) const IEEE754 = __webpack_require__(1179) const getPrototypeOf = __webpack_require__(9518) const setPrototypeOf = __webpack_require__(7674) const getOwnPropertyNames = (__webpack_require__(8006).f) const defineProperty = (__webpack_require__(3070).f) const arrayFill = __webpack_require__(1285) const arraySlice = __webpack_require__(206) const setToStringTag = __webpack_require__(8003) const InternalStateModule = __webpack_require__(9909) const PROPER_FUNCTION_NAME = FunctionName.PROPER const CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE const getInternalState = InternalStateModule.get const setInternalState = InternalStateModule.set const ARRAY_BUFFER = 'ArrayBuffer' const DATA_VIEW = 'DataView' const PROTOTYPE = 'prototype' const WRONG_LENGTH = 'Wrong length' const WRONG_INDEX = 'Wrong index' const NativeArrayBuffer = global[ARRAY_BUFFER] let $ArrayBuffer = NativeArrayBuffer let ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE] let $DataView = global[DATA_VIEW] let DataViewPrototype = $DataView && $DataView[PROTOTYPE] const ObjectPrototype = Object.prototype const Array = global.Array const RangeError = global.RangeError const fill = uncurryThis(arrayFill) const reverse = uncurryThis([].reverse) const packIEEE754 = IEEE754.pack const unpackIEEE754 = IEEE754.unpack const packInt8 = function packInt8 (number) { return [number & 0xFF] } const packInt16 = function packInt16 (number) { return [number & 0xFF, number >> 8 & 0xFF] } const packInt32 = function packInt32 (number) { return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF] } const unpackInt32 = function unpackInt32 (buffer) { return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0] } const packFloat32 = function packFloat32 (number) { return packIEEE754(number, 23, 4) } const packFloat64 = function packFloat64 (number) { return packIEEE754(number, 52, 8) } const addGetter = function addGetter (Constructor, key) { defineProperty(Constructor[PROTOTYPE], key, { get: function get () { return getInternalState(this)[key] } }) } const get = function get (view, count, index, isLittleEndian) { const intIndex = toIndex(index) const store = getInternalState(view) if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX) const bytes = getInternalState(store.buffer).bytes const start = intIndex + store.byteOffset const pack = arraySlice(bytes, start, start + count) return isLittleEndian ? pack : reverse(pack) } const set = function set (view, count, index, conversion, value, isLittleEndian) { const intIndex = toIndex(index) const store = getInternalState(view) if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX) const bytes = getInternalState(store.buffer).bytes const start = intIndex + store.byteOffset const pack = conversion(+value) for (let i = 0; i < count; i++) { bytes[start + i] = pack[isLittleEndian ? i : count - i - 1] } } if (!NATIVE_ARRAY_BUFFER) { $ArrayBuffer = function ArrayBuffer (length) { anInstance(this, ArrayBufferPrototype) const byteLength = toIndex(length) setInternalState(this, { bytes: fill(Array(byteLength), 0), byteLength }) if (!DESCRIPTORS) this.byteLength = byteLength } ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] $DataView = function DataView (buffer, byteOffset, byteLength) { anInstance(this, DataViewPrototype) anInstance(buffer, ArrayBufferPrototype) const bufferLength = getInternalState(buffer).byteLength const offset = toIntegerOrInfinity(byteOffset) if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset') byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength) if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH) setInternalState(this, { buffer, byteLength, byteOffset: offset }) if (!DESCRIPTORS) { this.buffer = buffer this.byteLength = byteLength this.byteOffset = offset } } DataViewPrototype = $DataView[PROTOTYPE] if (DESCRIPTORS) { addGetter($ArrayBuffer, 'byteLength') addGetter($DataView, 'buffer') addGetter($DataView, 'byteLength') addGetter($DataView, 'byteOffset') } redefineAll(DataViewPrototype, { getInt8: function getInt8 (byteOffset) { return get(this, 1, byteOffset)[0] << 24 >> 24 }, getUint8: function getUint8 (byteOffset) { return get(this, 1, byteOffset)[0] }, getInt16: function getInt16 (byteOffset /* , littleEndian */ ) { const bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined) return (bytes[1] << 8 | bytes[0]) << 16 >> 16 }, getUint16: function getUint16 (byteOffset /* , littleEndian */ ) { const bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined) return bytes[1] << 8 | bytes[0] }, getInt32: function getInt32 (byteOffset /* , littleEndian */ ) { return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) }, getUint32: function getUint32 (byteOffset /* , littleEndian */ ) { return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0 }, getFloat32: function getFloat32 (byteOffset /* , littleEndian */ ) { return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23) }, getFloat64: function getFloat64 (byteOffset /* , littleEndian */ ) { return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52) }, setInt8: function setInt8 (byteOffset, value) { set(this, 1, byteOffset, packInt8, value) }, setUint8: function setUint8 (byteOffset, value) { set(this, 1, byteOffset, packInt8, value) }, setInt16: function setInt16 (byteOffset, value /* , littleEndian */ ) { set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined) }, setUint16: function setUint16 (byteOffset, value /* , littleEndian */ ) { set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined) }, setInt32: function setInt32 (byteOffset, value /* , littleEndian */ ) { set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined) }, setUint32: function setUint32 (byteOffset, value /* , littleEndian */ ) { set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined) }, setFloat32: function setFloat32 (byteOffset, value /* , littleEndian */ ) { set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined) }, setFloat64: function setFloat64 (byteOffset, value /* , littleEndian */ ) { set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined) } }) } else { const INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER /* eslint-disable no-new -- required for testing */ if (!fails(function () { NativeArrayBuffer(1) }) || !fails(function () { new NativeArrayBuffer(-1) }) || fails(function () { new NativeArrayBuffer() new NativeArrayBuffer(1.5) new NativeArrayBuffer(NaN) return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME })) { /* eslint-enable no-new -- required for testing */ $ArrayBuffer = function ArrayBuffer (length) { anInstance(this, ArrayBufferPrototype) return new NativeArrayBuffer(toIndex(length)) } $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) { if (!((key = keys[j++]) in $ArrayBuffer)) { createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]) } } ArrayBufferPrototype.constructor = $ArrayBuffer } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER) } // WebKit bug - the same parent prototype for typed arrays and data view if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) { setPrototypeOf(DataViewPrototype, ObjectPrototype) } // iOS Safari 7.x bug const testView = new $DataView(new $ArrayBuffer(2)) const $setInt8 = uncurryThis(DataViewPrototype.setInt8) testView.setInt8(0, 2147483648) testView.setInt8(1, 2147483649) if (testView.getInt8(0) || !testView.getInt8(1)) { redefineAll(DataViewPrototype, { setInt8: function setInt8 (byteOffset, value) { $setInt8(this, byteOffset, value << 24 >> 24) }, setUint8: function setUint8 (byteOffset, value) { $setInt8(this, byteOffset, value << 24 >> 24) } }, { unsafe: true }) } } setToStringTag($ArrayBuffer, ARRAY_BUFFER) setToStringTag($DataView, DATA_VIEW) module.exports = { ArrayBuffer: $ArrayBuffer, DataView: $DataView } /***/ }, /***/ 7803: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const arrayBufferModule = __webpack_require__(2091) const setSpecies = __webpack_require__(6340) const ARRAY_BUFFER = 'ArrayBuffer' const ArrayBuffer = arrayBufferModule[ARRAY_BUFFER] const NativeArrayBuffer = global[ARRAY_BUFFER] // `ArrayBuffer` constructor // https://tc39.es/ecma262/#sec-arraybuffer-constructor $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, { ArrayBuffer }) setSpecies(ARRAY_BUFFER) /***/ }, /***/ 194: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(7508), __webpack_require__(3440), __webpack_require__(3839), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const BlockCipher = C_lib.BlockCipher const C_algo = C.algo // Lookup tables const SBOX = [] const INV_SBOX = [] const SUB_MIX_0 = [] const SUB_MIX_1 = [] const SUB_MIX_2 = [] const SUB_MIX_3 = [] const INV_SUB_MIX_0 = [] const INV_SUB_MIX_1 = [] const INV_SUB_MIX_2 = [] const INV_SUB_MIX_3 = []; // Compute lookup tables (function () { // Compute double table const d = [] for (var i = 0; i < 256; i++) { if (i < 128) { d[i] = i << 1 } else { d[i] = i << 1 ^ 0x11b } } // Walk GF(2^8) let x = 0 let xi = 0 for (var i = 0; i < 256; i++) { // Compute sbox let sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4 sx = sx >>> 8 ^ sx & 0xff ^ 0x63 SBOX[x] = sx INV_SBOX[sx] = x // Compute multiplication const x2 = d[x] const x4 = d[x2] const x8 = d[x4] // Compute sub bytes, mix columns tables var t = d[sx] * 0x101 ^ sx * 0x1010100 SUB_MIX_0[x] = t << 24 | t >>> 8 SUB_MIX_1[x] = t << 16 | t >>> 16 SUB_MIX_2[x] = t << 8 | t >>> 24 SUB_MIX_3[x] = t // Compute inv sub bytes, inv mix columns tables var t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100 INV_SUB_MIX_0[sx] = t << 24 | t >>> 8 INV_SUB_MIX_1[sx] = t << 16 | t >>> 16 INV_SUB_MIX_2[sx] = t << 8 | t >>> 24 INV_SUB_MIX_3[sx] = t // Compute next counter if (!x) { x = xi = 1 } else { x = x2 ^ d[d[d[x8 ^ x2]]] xi ^= d[d[xi]] } } })() // Precomputed Rcon lookup const RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36] /** * AES block cipher algorithm. */ const AES = C_algo.AES = BlockCipher.extend({ _doReset: function _doReset () { var t // Skip reset of nRounds has been set before and key did not change if (this._nRounds && this._keyPriorReset === this._key) { return } // Shortcuts const key = this._keyPriorReset = this._key const keyWords = key.words const keySize = key.sigBytes / 4 // Compute number of rounds const nRounds = this._nRounds = keySize + 6 // Compute number of key schedule rows const ksRows = (nRounds + 1) * 4 // Compute key schedule const keySchedule = this._keySchedule = [] for (var ksRow = 0; ksRow < ksRows; ksRow++) { if (ksRow < keySize) { keySchedule[ksRow] = keyWords[ksRow] } else { t = keySchedule[ksRow - 1] if (!(ksRow % keySize)) { // Rot word t = t << 8 | t >>> 24 // Sub word t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff] // Mix Rcon t ^= RCON[ksRow / keySize | 0] << 24 } else if (keySize > 6 && ksRow % keySize == 4) { // Sub word t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff] } keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t } } // Compute inv key schedule const invKeySchedule = this._invKeySchedule = [] for (let invKsRow = 0; invKsRow < ksRows; invKsRow++) { var ksRow = ksRows - invKsRow if (invKsRow % 4) { var t = keySchedule[ksRow] } else { var t = keySchedule[ksRow - 4] } if (invKsRow < 4 || ksRow <= 4) { invKeySchedule[invKsRow] = t } else { invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 0xff]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]] } } }, encryptBlock: function encryptBlock (M, offset) { this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) }, decryptBlock: function decryptBlock (M, offset) { // Swap 2nd and 4th rows var t = M[offset + 1] M[offset + 1] = M[offset + 3] M[offset + 3] = t this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX) // Inv swap 2nd and 4th rows var t = M[offset + 1] M[offset + 1] = M[offset + 3] M[offset + 3] = t }, _doCryptBlock: function _doCryptBlock (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { // Shortcut const nRounds = this._nRounds // Get input, add round key let s0 = M[offset] ^ keySchedule[0] let s1 = M[offset + 1] ^ keySchedule[1] let s2 = M[offset + 2] ^ keySchedule[2] let s3 = M[offset + 3] ^ keySchedule[3] // Key schedule row counter let ksRow = 4 // Rounds for (let round = 1; round < nRounds; round++) { // Shift rows, sub bytes, mix columns, add round key var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[s1 >>> 16 & 0xff] ^ SUB_MIX_2[s2 >>> 8 & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++] var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[s2 >>> 16 & 0xff] ^ SUB_MIX_2[s3 >>> 8 & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++] var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[s3 >>> 16 & 0xff] ^ SUB_MIX_2[s0 >>> 8 & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++] var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[s0 >>> 16 & 0xff] ^ SUB_MIX_2[s1 >>> 8 & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++] // Update state s0 = t0 s1 = t1 s2 = t2 s3 = t3 } // Shift rows, sub bytes, add round key var t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 0xff] << 16 | SBOX[s2 >>> 8 & 0xff] << 8 | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++] var t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 0xff] << 16 | SBOX[s3 >>> 8 & 0xff] << 8 | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++] var t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 0xff] << 16 | SBOX[s0 >>> 8 & 0xff] << 8 | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++] var t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 0xff] << 16 | SBOX[s1 >>> 8 & 0xff] << 8 | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++] // Set output M[offset] = t0 M[offset + 1] = t1 M[offset + 2] = t2 M[offset + 3] = t3 }, keySize: 256 / 32 }) /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); */ C.AES = BlockCipher._createHelper(AES) })() return CryptoJS.AES }) /***/ }, /***/ 1582: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) __webpack_require__(2222) __webpack_require__(1539) __webpack_require__(9714) __webpack_require__(561) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(3839)) } else {} })(void 0, function (CryptoJS) { /** * Cipher core components. */ CryptoJS.lib.Cipher || (function (undefined) { // Shortcuts const C = CryptoJS const C_lib = C.lib const Base = C_lib.Base const WordArray = C_lib.WordArray const BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm const C_enc = C.enc const Utf8 = C_enc.Utf8 const Base64 = C_enc.Base64 const C_algo = C.algo const EvpKDF = C_algo.EvpKDF /** * Abstract base cipher template. * * @property {number} keySize This cipher's key size. Default: 4 (128 bits) * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. */ const Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ /** * Configuration options. * * @property {WordArray} iv The IV to use for this operation. */ cfg: Base.extend(), /** * Creates this cipher in encryption mode. * * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {Cipher} A cipher instance. * * @static * * @example * * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); */ createEncryptor: function createEncryptor (key, cfg) { return this.create(this._ENC_XFORM_MODE, key, cfg) }, /** * Creates this cipher in decryption mode. * * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {Cipher} A cipher instance. * * @static * * @example * * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); */ createDecryptor: function createDecryptor (key, cfg) { return this.create(this._DEC_XFORM_MODE, key, cfg) }, /** * Initializes a newly created cipher. * * @param {number} xformMode Either the encryption or decryption transormation mode constant. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @example * * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); */ init: function init (xformMode, key, cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg) // Store transform mode and key this._xformMode = xformMode this._key = key // Set initial values this.reset() }, /** * Resets this cipher to its initial state. * * @example * * cipher.reset(); */ reset: function reset () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this) // Perform concrete-cipher logic this._doReset() }, /** * Adds data to be encrypted or decrypted. * * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. * * @return {WordArray} The data after processing. * * @example * * var encrypted = cipher.process('data'); * var encrypted = cipher.process(wordArray); */ process: function process (dataUpdate) { // Append this._append(dataUpdate) // Process available blocks return this._process() }, /** * Finalizes the encryption or decryption process. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. * * @return {WordArray} The data after final processing. * * @example * * var encrypted = cipher.finalize(); * var encrypted = cipher.finalize('data'); * var encrypted = cipher.finalize(wordArray); */ finalize: function finalize (dataUpdate) { // Final data update if (dataUpdate) { this._append(dataUpdate) } // Perform concrete-cipher logic const finalProcessedData = this._doFinalize() return finalProcessedData }, keySize: 128 / 32, ivSize: 128 / 32, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, /** * Creates shortcut functions to a cipher's object interface. * * @param {Cipher} cipher The cipher to create a helper for. * * @return {Object} An object with encrypt and decrypt shortcut functions. * * @static * * @example * * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); */ _createHelper: (function () { function selectCipherStrategy (key) { if (typeof key === 'string') { return PasswordBasedCipher } else { return SerializableCipher } } return function (cipher) { return { encrypt: function encrypt (message, key, cfg) { return selectCipherStrategy(key).encrypt(cipher, message, key, cfg) }, decrypt: function decrypt (ciphertext, key, cfg) { return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg) } } } }()) }) /** * Abstract base stream cipher template. * * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) */ const StreamCipher = C_lib.StreamCipher = Cipher.extend({ _doFinalize: function _doFinalize () { // Process partial blocks const finalProcessedBlocks = this._process(!!'flush') return finalProcessedBlocks }, blockSize: 1 }) /** * Mode namespace. */ const C_mode = C.mode = {} /** * Abstract base block cipher mode template. */ const BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ /** * Creates this mode for encryption. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @static * * @example * * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); */ createEncryptor: function createEncryptor (cipher, iv) { return this.Encryptor.create(cipher, iv) }, /** * Creates this mode for decryption. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @static * * @example * * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); */ createDecryptor: function createDecryptor (cipher, iv) { return this.Decryptor.create(cipher, iv) }, /** * Initializes a newly created mode. * * @param {Cipher} cipher A block cipher instance. * @param {Array} iv The IV words. * * @example * * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); */ init: function init (cipher, iv) { this._cipher = cipher this._iv = iv } }) /** * Cipher Block Chaining mode. */ const CBC = C_mode.CBC = (function () { /** * Abstract base CBC mode. */ const CBC = BlockCipherMode.extend() /** * CBC encryptor. */ CBC.Encryptor = CBC.extend({ /** * Processes the data block at offset. * * @param {Array} words The data words to operate on. * @param {number} offset The offset where the block starts. * * @example * * mode.processBlock(data.words, offset); */ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize // XOR and encrypt xorBlock.call(this, words, offset, blockSize) cipher.encryptBlock(words, offset) // Remember this block to use with next block this._prevBlock = words.slice(offset, offset + blockSize) } }) /** * CBC decryptor. */ CBC.Decryptor = CBC.extend({ /** * Processes the data block at offset. * * @param {Array} words The data words to operate on. * @param {number} offset The offset where the block starts. * * @example * * mode.processBlock(data.words, offset); */ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize // Remember this block to use with next block const thisBlock = words.slice(offset, offset + blockSize) // Decrypt and XOR cipher.decryptBlock(words, offset) xorBlock.call(this, words, offset, blockSize) // This block becomes the previous block this._prevBlock = thisBlock } }) function xorBlock (words, offset, blockSize) { let block // Shortcut const iv = this._iv // Choose mixing block if (iv) { block = iv // Remove IV for subsequent blocks this._iv = undefined } else { block = this._prevBlock } // XOR blocks for (let i = 0; i < blockSize; i++) { words[offset + i] ^= block[i] } } return CBC }()) /** * Padding namespace. */ const C_pad = C.pad = {} /** * PKCS #5/7 padding strategy. */ const Pkcs7 = C_pad.Pkcs7 = { /** * Pads data using the algorithm defined in PKCS #5/7. * * @param {WordArray} data The data to pad. * @param {number} blockSize The multiple that the data should be padded to. * * @static * * @example * * CryptoJS.pad.Pkcs7.pad(wordArray, 4); */ pad: function pad (data, blockSize) { // Shortcut const blockSizeBytes = blockSize * 4 // Count padding bytes const nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes // Create padding word const paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes // Create padding const paddingWords = [] for (let i = 0; i < nPaddingBytes; i += 4) { paddingWords.push(paddingWord) } const padding = WordArray.create(paddingWords, nPaddingBytes) // Add padding data.concat(padding) }, /** * Unpads data that had been padded using the algorithm defined in PKCS #5/7. * * @param {WordArray} data The data to unpad. * * @static * * @example * * CryptoJS.pad.Pkcs7.unpad(wordArray); */ unpad: function unpad (data) { // Get number of padding bytes from last byte const nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff // Remove padding data.sigBytes -= nPaddingBytes } } /** * Abstract base block cipher template. * * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) */ const BlockCipher = C_lib.BlockCipher = Cipher.extend({ /** * Configuration options. * * @property {Mode} mode The block mode to use. Default: CBC * @property {Padding} padding The padding strategy to use. Default: Pkcs7 */ cfg: Cipher.cfg.extend({ mode: CBC, padding: Pkcs7 }), reset: function reset () { let modeCreator // Reset cipher Cipher.reset.call(this) // Shortcuts const cfg = this.cfg const iv = cfg.iv const mode = cfg.mode // Reset block mode if (this._xformMode == this._ENC_XFORM_MODE) { modeCreator = mode.createEncryptor } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { modeCreator = mode.createDecryptor // Keep at least one block in the buffer for unpadding this._minBufferSize = 1 } if (this._mode && this._mode.__creator == modeCreator) { this._mode.init(this, iv && iv.words) } else { this._mode = modeCreator.call(mode, this, iv && iv.words) this._mode.__creator = modeCreator } }, _doProcessBlock: function _doProcessBlock (words, offset) { this._mode.processBlock(words, offset) }, _doFinalize: function _doFinalize () { let finalProcessedBlocks // Shortcut const padding = this.cfg.padding // Finalize if (this._xformMode == this._ENC_XFORM_MODE) { // Pad data padding.pad(this._data, this.blockSize) // Process final blocks finalProcessedBlocks = this._process(!!'flush') } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { // Process final blocks finalProcessedBlocks = this._process(!!'flush') // Unpad data padding.unpad(finalProcessedBlocks) } return finalProcessedBlocks }, blockSize: 128 / 32 }) /** * A collection of cipher parameters. * * @property {WordArray} ciphertext The raw ciphertext. * @property {WordArray} key The key to this ciphertext. * @property {WordArray} iv The IV used in the ciphering operation. * @property {WordArray} salt The salt used with a key derivation function. * @property {Cipher} algorithm The cipher algorithm. * @property {Mode} mode The block mode used in the ciphering operation. * @property {Padding} padding The padding scheme used in the ciphering operation. * @property {number} blockSize The block size of the cipher. * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. */ const CipherParams = C_lib.CipherParams = Base.extend({ /** * Initializes a newly created cipher params object. * * @param {Object} cipherParams An object with any of the possible cipher parameters. * * @example * * var cipherParams = CryptoJS.lib.CipherParams.create({ * ciphertext: ciphertextWordArray, * key: keyWordArray, * iv: ivWordArray, * salt: saltWordArray, * algorithm: CryptoJS.algo.AES, * mode: CryptoJS.mode.CBC, * padding: CryptoJS.pad.PKCS7, * blockSize: 4, * formatter: CryptoJS.format.OpenSSL * }); */ init: function init (cipherParams) { this.mixIn(cipherParams) }, /** * Converts this cipher params object to a string. * * @param {Format} formatter (Optional) The formatting strategy to use. * * @return {string} The stringified cipher params. * * @throws Error If neither the formatter nor the default formatter is set. * * @example * * var string = cipherParams + ''; * var string = cipherParams.toString(); * var string = cipherParams.toString(CryptoJS.format.OpenSSL); */ toString: function toString (formatter) { return (formatter || this.formatter).stringify(this) } }) /** * Format namespace. */ const C_format = C.format = {} /** * OpenSSL formatting strategy. */ const OpenSSLFormatter = C_format.OpenSSL = { /** * Converts a cipher params object to an OpenSSL-compatible string. * * @param {CipherParams} cipherParams The cipher params object. * * @return {string} The OpenSSL-compatible string. * * @static * * @example * * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); */ stringify: function stringify (cipherParams) { let wordArray // Shortcuts const ciphertext = cipherParams.ciphertext const salt = cipherParams.salt // Format if (salt) { wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext) } else { wordArray = ciphertext } return wordArray.toString(Base64) }, /** * Converts an OpenSSL-compatible string to a cipher params object. * * @param {string} openSSLStr The OpenSSL-compatible string. * * @return {CipherParams} The cipher params object. * * @static * * @example * * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); */ parse: function parse (openSSLStr) { let salt // Parse base64 const ciphertext = Base64.parse(openSSLStr) // Shortcut const ciphertextWords = ciphertext.words // Test for salt if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { // Extract salt salt = WordArray.create(ciphertextWords.slice(2, 4)) // Remove salt from ciphertext ciphertextWords.splice(0, 4) ciphertext.sigBytes -= 16 } return CipherParams.create({ ciphertext, salt }) } } /** * A cipher wrapper that returns ciphertext as a serializable cipher params object. */ var SerializableCipher = C_lib.SerializableCipher = Base.extend({ /** * Configuration options. * * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL */ cfg: Base.extend({ format: OpenSSLFormatter }), /** * Encrypts a message. * * @param {Cipher} cipher The cipher algorithm to use. * @param {WordArray|string} message The message to encrypt. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {CipherParams} A cipher params object. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); */ encrypt: function encrypt (cipher, message, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg) // Encrypt const encryptor = cipher.createEncryptor(key, cfg) const ciphertext = encryptor.finalize(message) // Shortcut const cipherCfg = encryptor.cfg // Create and return serializable cipher params return CipherParams.create({ ciphertext, key, iv: cipherCfg.iv, algorithm: cipher, mode: cipherCfg.mode, padding: cipherCfg.padding, blockSize: cipher.blockSize, formatter: cfg.format }) }, /** * Decrypts serialized ciphertext. * * @param {Cipher} cipher The cipher algorithm to use. * @param {CipherParams|string} ciphertext The ciphertext to decrypt. * @param {WordArray} key The key. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {WordArray} The plaintext. * * @static * * @example * * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); */ decrypt: function decrypt (cipher, ciphertext, key, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg) // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format) // Decrypt const plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext) return plaintext }, /** * Converts serialized ciphertext to CipherParams, * else assumed CipherParams already and returns ciphertext unchanged. * * @param {CipherParams|string} ciphertext The ciphertext. * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. * * @return {CipherParams} The unserialized ciphertext. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); */ _parse: function _parse (ciphertext, format) { if (typeof ciphertext === 'string') { return format.parse(ciphertext, this) } else { return ciphertext } } }) /** * Key derivation function namespace. */ const C_kdf = C.kdf = {} /** * OpenSSL key derivation function. */ const OpenSSLKdf = C_kdf.OpenSSL = { /** * Derives a key and IV from a password. * * @param {string} password The password to derive from. * @param {number} keySize The size in words of the key to generate. * @param {number} ivSize The size in words of the IV to generate. * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. * * @return {CipherParams} A cipher params object with the key, IV, and salt. * * @static * * @example * * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); */ execute: function execute (password, keySize, ivSize, salt) { // Generate random salt if (!salt) { salt = WordArray.random(64 / 8) } // Derive key and IV const key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt) // Separate key and IV const iv = WordArray.create(key.words.slice(keySize), ivSize * 4) key.sigBytes = keySize * 4 // Return params return CipherParams.create({ key, iv, salt }) } } /** * A serializable cipher wrapper that derives the key from a password, * and returns ciphertext as a serializable cipher params object. */ var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ /** * Configuration options. * * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL */ cfg: SerializableCipher.cfg.extend({ kdf: OpenSSLKdf }), /** * Encrypts a message using a password. * * @param {Cipher} cipher The cipher algorithm to use. * @param {WordArray|string} message The message to encrypt. * @param {string} password The password. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {CipherParams} A cipher params object. * * @static * * @example * * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); */ encrypt: function encrypt (cipher, message, password, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg) // Derive key and other params const derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize) // Add IV to config cfg.iv = derivedParams.iv // Encrypt const ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg) // Mix in derived params ciphertext.mixIn(derivedParams) return ciphertext }, /** * Decrypts serialized ciphertext using a password. * * @param {Cipher} cipher The cipher algorithm to use. * @param {CipherParams|string} ciphertext The ciphertext to decrypt. * @param {string} password The password. * @param {Object} cfg (Optional) The configuration options to use for this operation. * * @return {WordArray} The plaintext. * * @static * * @example * * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); */ decrypt: function decrypt (cipher, ciphertext, password, cfg) { // Apply config defaults cfg = this.cfg.extend(cfg) // Convert string to CipherParams ciphertext = this._parse(ciphertext, cfg.format) // Derive key and other params const derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt) // Add IV to config cfg.iv = derivedParams.iv // Decrypt const plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg) return plaintext } }) }()) }) /***/ }, /***/ 757: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(5743) __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(9135) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(9714) __webpack_require__(7042) __webpack_require__(9600) __webpack_require__(2222) __webpack_require__(561) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory() } else {} })(void 0, function () { /* globals window, global, require */ /** * CryptoJS core components. */ var CryptoJS = CryptoJS || (function (Math, undefined) { let crypto // Native crypto from window (Browser) if (typeof window !== 'undefined' && window.crypto) { crypto = window.crypto } // Native crypto in web worker (Browser) if (typeof self !== 'undefined' && self.crypto) { crypto = self.crypto } // Native crypto from worker if (typeof globalThis !== 'undefined' && globalThis.crypto) { crypto = globalThis.crypto } // Native (experimental IE 11) crypto from window (Browser) if (!crypto && typeof window !== 'undefined' && window.msCrypto) { crypto = window.msCrypto } // Native crypto from global (NodeJS) if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) { crypto = __webpack_require__.g.crypto } // Native crypto import via require (NodeJS) if (!crypto && 'function' === 'function') { try { crypto = __webpack_require__(2480) } catch (err) {} } /* * Cryptographically secure pseudorandom number generator * * As Math.random() is cryptographically not safe to use */ const cryptoSecureRandomInt = function cryptoSecureRandomInt () { if (crypto) { // Use getRandomValues method (Browser) if (typeof crypto.getRandomValues === 'function') { try { return crypto.getRandomValues(new Uint32Array(1))[0] } catch (err) {} } // Use randomBytes method (NodeJS) if (typeof crypto.randomBytes === 'function') { try { return crypto.randomBytes(4).readInt32LE() } catch (err) {} } } throw new Error('Native crypto module could not be used to get secure random number.') } /* * Local polyfill of Object.create */ const create = Object.create || (function () { function F () {} return function (obj) { let subtype F.prototype = obj subtype = new F() F.prototype = null return subtype } }()) /** * CryptoJS namespace. */ const C = {} /** * Library namespace. */ const C_lib = C.lib = {} /** * Base object for prototypal inheritance. */ const Base = C_lib.Base = (function () { return { /** * Creates a new object that inherits from this object. * * @param {Object} overrides Properties to copy into the new object. * * @return {Object} The new object. * * @static * * @example * * var MyType = CryptoJS.lib.Base.extend({ * field: 'value', * * method: function () { * } * }); */ extend: function extend (overrides) { // Spawn const subtype = create(this) // Augment if (overrides) { subtype.mixIn(overrides) } // Create default initializer if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { subtype.init = function () { subtype.$super.init.apply(this, arguments) } } // Initializer's prototype is the subtype object subtype.init.prototype = subtype // Reference supertype subtype.$super = this return subtype }, /** * Extends this object and runs the init method. * Arguments to create() will be passed to init(). * * @return {Object} The new object. * * @static * * @example * * var instance = MyType.create(); */ create: function create () { const instance = this.extend() instance.init.apply(instance, arguments) return instance }, /** * Initializes a newly created object. * Override this method to add some logic when your objects are created. * * @example * * var MyType = CryptoJS.lib.Base.extend({ * init: function () { * // ... * } * }); */ init: function init () {}, /** * Copies properties into this object. * * @param {Object} properties The properties to mix in. * * @example * * MyType.mixIn({ * field: 'value' * }); */ mixIn: function mixIn (properties) { for (const propertyName in properties) { if (properties.hasOwnProperty(propertyName)) { this[propertyName] = properties[propertyName] } } // IE won't copy toString using the loop above if (properties.hasOwnProperty('toString')) { this.toString = properties.toString } }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = instance.clone(); */ clone: function clone () { return this.init.prototype.extend(this) } } }()) /** * An array of 32-bit words. * * @property {Array} words The array of 32-bit words. * @property {number} sigBytes The number of significant bytes in this word array. */ var WordArray = C_lib.WordArray = Base.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of 32-bit words. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.lib.WordArray.create(); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); */ init: function init (words, sigBytes) { words = this.words = words || [] if (sigBytes != undefined) { this.sigBytes = sigBytes } else { this.sigBytes = words.length * 4 } }, /** * Converts this word array to a string. * * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex * * @return {string} The stringified word array. * * @example * * var string = wordArray + ''; * var string = wordArray.toString(); * var string = wordArray.toString(CryptoJS.enc.Utf8); */ toString: function toString (encoder) { return (encoder || Hex).stringify(this) }, /** * Concatenates a word array to this word array. * * @param {WordArray} wordArray The word array to append. * * @return {WordArray} This word array. * * @example * * wordArray1.concat(wordArray2); */ concat: function concat (wordArray) { // Shortcuts const thisWords = this.words const thatWords = wordArray.words const thisSigBytes = this.sigBytes const thatSigBytes = wordArray.sigBytes // Clamp excess bits this.clamp() // Concat if (thisSigBytes % 4) { // Copy one byte at a time for (let i = 0; i < thatSigBytes; i++) { const thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8 } } else { // Copy one word at a time for (let j = 0; j < thatSigBytes; j += 4) { thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2] } } this.sigBytes += thatSigBytes // Chainable return this }, /** * Removes insignificant bits. * * @example * * wordArray.clamp(); */ clamp: function clamp () { // Shortcuts const words = this.words const sigBytes = this.sigBytes // Clamp words[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8 words.length = Math.ceil(sigBytes / 4) }, /** * Creates a copy of this word array. * * @return {WordArray} The clone. * * @example * * var clone = wordArray.clone(); */ clone: function clone () { const clone = Base.clone.call(this) clone.words = this.words.slice(0) return clone }, /** * Creates a word array filled with random bytes. * * @param {number} nBytes The number of random bytes to generate. * * @return {WordArray} The random word array. * * @static * * @example * * var wordArray = CryptoJS.lib.WordArray.random(16); */ random: function random (nBytes) { const words = [] for (let i = 0; i < nBytes; i += 4) { words.push(cryptoSecureRandomInt()) } return new WordArray.init(words, nBytes) } }) /** * Encoder namespace. */ const C_enc = C.enc = {} /** * Hex encoding strategy. */ var Hex = C_enc.Hex = { /** * Converts a word array to a hex string. * * @param {WordArray} wordArray The word array. * * @return {string} The hex string. * * @static * * @example * * var hexString = CryptoJS.enc.Hex.stringify(wordArray); */ stringify: function stringify (wordArray) { // Shortcuts const words = wordArray.words const sigBytes = wordArray.sigBytes // Convert const hexChars = [] for (let i = 0; i < sigBytes; i++) { const bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff hexChars.push((bite >>> 4).toString(16)) hexChars.push((bite & 0x0f).toString(16)) } return hexChars.join('') }, /** * Converts a hex string to a word array. * * @param {string} hexStr The hex string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Hex.parse(hexString); */ parse: function parse (hexStr) { // Shortcut const hexStrLength = hexStr.length // Convert const words = [] for (let i = 0; i < hexStrLength; i += 2) { words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4 } return new WordArray.init(words, hexStrLength / 2) } } /** * Latin1 encoding strategy. */ const Latin1 = C_enc.Latin1 = { /** * Converts a word array to a Latin1 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Latin1 string. * * @static * * @example * * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); */ stringify: function stringify (wordArray) { // Shortcuts const words = wordArray.words const sigBytes = wordArray.sigBytes // Convert const latin1Chars = [] for (let i = 0; i < sigBytes; i++) { const bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff latin1Chars.push(String.fromCharCode(bite)) } return latin1Chars.join('') }, /** * Converts a Latin1 string to a word array. * * @param {string} latin1Str The Latin1 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); */ parse: function parse (latin1Str) { // Shortcut const latin1StrLength = latin1Str.length // Convert const words = [] for (let i = 0; i < latin1StrLength; i++) { words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8 } return new WordArray.init(words, latin1StrLength) } } /** * UTF-8 encoding strategy. */ const Utf8 = C_enc.Utf8 = { /** * Converts a word array to a UTF-8 string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-8 string. * * @static * * @example * * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); */ stringify: function stringify (wordArray) { try { return decodeURIComponent(escape(Latin1.stringify(wordArray))) } catch (e) { throw new Error('Malformed UTF-8 data') } }, /** * Converts a UTF-8 string to a word array. * * @param {string} utf8Str The UTF-8 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); */ parse: function parse (utf8Str) { return Latin1.parse(unescape(encodeURIComponent(utf8Str))) } } /** * Abstract buffered block algorithm template. * * The property blockSize must be implemented in a concrete subtype. * * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 */ const BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ /** * Resets this block algorithm's data buffer to its initial state. * * @example * * bufferedBlockAlgorithm.reset(); */ reset: function reset () { // Initial values this._data = new WordArray.init() this._nDataBytes = 0 }, /** * Adds new data to this block algorithm's buffer. * * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. * * @example * * bufferedBlockAlgorithm._append('data'); * bufferedBlockAlgorithm._append(wordArray); */ _append: function _append (data) { // Convert string to WordArray, else assume WordArray already if (typeof data === 'string') { data = Utf8.parse(data) } // Append this._data.concat(data) this._nDataBytes += data.sigBytes }, /** * Processes available data blocks. * * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. * * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. * * @return {WordArray} The processed data. * * @example * * var processedData = bufferedBlockAlgorithm._process(); * var processedData = bufferedBlockAlgorithm._process(!!'flush'); */ _process: function _process (doFlush) { let processedWords // Shortcuts const data = this._data const dataWords = data.words const dataSigBytes = data.sigBytes const blockSize = this.blockSize const blockSizeBytes = blockSize * 4 // Count blocks ready let nBlocksReady = dataSigBytes / blockSizeBytes if (doFlush) { // Round up to include partial blocks nBlocksReady = Math.ceil(nBlocksReady) } else { // Round down to include only full blocks, // less the number of blocks that must remain in the buffer nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0) } // Count words ready const nWordsReady = nBlocksReady * blockSize // Count bytes ready const nBytesReady = Math.min(nWordsReady * 4, dataSigBytes) // Process blocks if (nWordsReady) { for (let offset = 0; offset < nWordsReady; offset += blockSize) { // Perform concrete-algorithm logic this._doProcessBlock(dataWords, offset) } // Remove processed words processedWords = dataWords.splice(0, nWordsReady) data.sigBytes -= nBytesReady } // Return processed words return new WordArray.init(processedWords, nBytesReady) }, /** * Creates a copy of this object. * * @return {Object} The clone. * * @example * * var clone = bufferedBlockAlgorithm.clone(); */ clone: function clone () { const clone = Base.clone.call(this) clone._data = this._data.clone() return clone }, _minBufferSize: 0 }) /** * Abstract hasher template. * * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) */ const Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ /** * Configuration options. */ cfg: Base.extend(), /** * Initializes a newly created hasher. * * @param {Object} cfg (Optional) The configuration options to use for this hash computation. * * @example * * var hasher = CryptoJS.algo.SHA256.create(); */ init: function init (cfg) { // Apply config defaults this.cfg = this.cfg.extend(cfg) // Set initial values this.reset() }, /** * Resets this hasher to its initial state. * * @example * * hasher.reset(); */ reset: function reset () { // Reset data buffer BufferedBlockAlgorithm.reset.call(this) // Perform concrete-hasher logic this._doReset() }, /** * Updates this hasher with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {Hasher} This hasher. * * @example * * hasher.update('message'); * hasher.update(wordArray); */ update: function update (messageUpdate) { // Append this._append(messageUpdate) // Update the hash this._process() // Chainable return this }, /** * Finalizes the hash computation. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The hash. * * @example * * var hash = hasher.finalize(); * var hash = hasher.finalize('message'); * var hash = hasher.finalize(wordArray); */ finalize: function finalize (messageUpdate) { // Final message update if (messageUpdate) { this._append(messageUpdate) } // Perform concrete-hasher logic const hash = this._doFinalize() return hash }, blockSize: 512 / 32, /** * Creates a shortcut function to a hasher's object interface. * * @param {Hasher} hasher The hasher to create a helper for. * * @return {Function} The shortcut function. * * @static * * @example * * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); */ _createHelper: function _createHelper (hasher) { return function (message, cfg) { return new hasher.init(cfg).finalize(message) } }, /** * Creates a shortcut function to the HMAC's object interface. * * @param {Hasher} hasher The hasher to use in this HMAC helper. * * @return {Function} The shortcut function. * * @static * * @example * * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); */ _createHmacHelper: function _createHmacHelper (hasher) { return function (message, key) { return new C_algo.HMAC.init(hasher, key).finalize(message) } } }) /** * Algorithm namespace. */ var C_algo = C.algo = {} return C }(Math)) return CryptoJS }) /***/ }, /***/ 7508: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(9600) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const C_enc = C.enc /** * Base64 encoding strategy. */ const Base64 = C_enc.Base64 = { /** * Converts a word array to a Base64 string. * * @param {WordArray} wordArray The word array. * * @return {string} The Base64 string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64.stringify(wordArray); */ stringify: function stringify (wordArray) { // Shortcuts const words = wordArray.words const sigBytes = wordArray.sigBytes const map = this._map // Clamp excess bits wordArray.clamp() // Convert const base64Chars = [] for (let i = 0; i < sigBytes; i += 3) { const byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff const byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff const byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff const triplet = byte1 << 16 | byte2 << 8 | byte3 for (let j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) { base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f)) } } // Add padding const paddingChar = map.charAt(64) if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar) } } return base64Chars.join('') }, /** * Converts a Base64 string to a word array. * * @param {string} base64Str The Base64 string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64.parse(base64String); */ parse: function parse (base64Str) { // Shortcuts let base64StrLength = base64Str.length const map = this._map let reverseMap = this._reverseMap if (!reverseMap) { reverseMap = this._reverseMap = [] for (let j = 0; j < map.length; j++) { reverseMap[map.charCodeAt(j)] = j } } // Ignore padding const paddingChar = map.charAt(64) if (paddingChar) { const paddingIndex = base64Str.indexOf(paddingChar) if (paddingIndex !== -1) { base64StrLength = paddingIndex } } // Convert return parseLoop(base64Str, base64StrLength, reverseMap) }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' } function parseLoop (base64Str, base64StrLength, reverseMap) { const words = [] let nBytes = 0 for (let i = 0; i < base64StrLength; i++) { if (i % 4) { const bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2 const bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2 const bitsCombined = bits1 | bits2 words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8 nBytes++ } } return WordArray.create(words, nBytes) } })() return CryptoJS.enc.Base64 }) /***/ }, /***/ 7590: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(9600) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const C_enc = C.enc /** * Base64url encoding strategy. */ const Base64url = C_enc.Base64url = { /** * Converts a word array to a Base64url string. * * @param {WordArray} wordArray The word array. * * @param {boolean} urlSafe Whether to use url safe * * @return {string} The Base64url string. * * @static * * @example * * var base64String = CryptoJS.enc.Base64url.stringify(wordArray); */ stringify: function stringify (wordArray, urlSafe) { if (urlSafe === void 0) { urlSafe = true } // Shortcuts const words = wordArray.words const sigBytes = wordArray.sigBytes const map = urlSafe ? this._safe_map : this._map // Clamp excess bits wordArray.clamp() // Convert const base64Chars = [] for (let i = 0; i < sigBytes; i += 3) { const byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff const byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff const byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff const triplet = byte1 << 16 | byte2 << 8 | byte3 for (let j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) { base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f)) } } // Add padding const paddingChar = map.charAt(64) if (paddingChar) { while (base64Chars.length % 4) { base64Chars.push(paddingChar) } } return base64Chars.join('') }, /** * Converts a Base64url string to a word array. * * @param {string} base64Str The Base64url string. * * @param {boolean} urlSafe Whether to use url safe * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Base64url.parse(base64String); */ parse: function parse (base64Str, urlSafe) { if (urlSafe === void 0) { urlSafe = true } // Shortcuts let base64StrLength = base64Str.length const map = urlSafe ? this._safe_map : this._map let reverseMap = this._reverseMap if (!reverseMap) { reverseMap = this._reverseMap = [] for (let j = 0; j < map.length; j++) { reverseMap[map.charCodeAt(j)] = j } } // Ignore padding const paddingChar = map.charAt(64) if (paddingChar) { const paddingIndex = base64Str.indexOf(paddingChar) if (paddingIndex !== -1) { base64StrLength = paddingIndex } } // Convert return parseLoop(base64Str, base64StrLength, reverseMap) }, _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_' } function parseLoop (base64Str, base64StrLength, reverseMap) { const words = [] let nBytes = 0 for (let i = 0; i < base64StrLength; i++) { if (i % 4) { const bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2 const bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2 const bitsCombined = bits1 | bits2 words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8 nBytes++ } } return WordArray.create(words, nBytes) } })() return CryptoJS.enc.Base64url }) /***/ }, /***/ 4978: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(9600) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const C_enc = C.enc /** * UTF-16 BE encoding strategy. */ const Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { /** * Converts a word array to a UTF-16 BE string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-16 BE string. * * @static * * @example * * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); */ stringify: function stringify (wordArray) { // Shortcuts const words = wordArray.words const sigBytes = wordArray.sigBytes // Convert const utf16Chars = [] for (let i = 0; i < sigBytes; i += 2) { const codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff utf16Chars.push(String.fromCharCode(codePoint)) } return utf16Chars.join('') }, /** * Converts a UTF-16 BE string to a word array. * * @param {string} utf16Str The UTF-16 BE string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); */ parse: function parse (utf16Str) { // Shortcut const utf16StrLength = utf16Str.length // Convert const words = [] for (let i = 0; i < utf16StrLength; i++) { words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16 } return WordArray.create(words, utf16StrLength * 2) } } /** * UTF-16 LE encoding strategy. */ C_enc.Utf16LE = { /** * Converts a word array to a UTF-16 LE string. * * @param {WordArray} wordArray The word array. * * @return {string} The UTF-16 LE string. * * @static * * @example * * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); */ stringify: function stringify (wordArray) { // Shortcuts const words = wordArray.words const sigBytes = wordArray.sigBytes // Convert const utf16Chars = [] for (let i = 0; i < sigBytes; i += 2) { const codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff) utf16Chars.push(String.fromCharCode(codePoint)) } return utf16Chars.join('') }, /** * Converts a UTF-16 LE string to a word array. * * @param {string} utf16Str The UTF-16 LE string. * * @return {WordArray} The word array. * * @static * * @example * * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); */ parse: function parse (utf16Str) { // Shortcut const utf16StrLength = utf16Str.length // Convert const words = [] for (let i = 0; i < utf16StrLength; i++) { words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16) } return WordArray.create(words, utf16StrLength * 2) } } function swapEndian (word) { return word << 8 & 0xff00ff00 | word >>> 8 & 0x00ff00ff } })() return CryptoJS.enc.Utf16 }) /***/ }, /***/ 3839: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(2222) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(9865), __webpack_require__(6727)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const Base = C_lib.Base const WordArray = C_lib.WordArray const C_algo = C.algo const MD5 = C_algo.MD5 /** * This key derivation function is meant to conform with EVP_BytesToKey. * www.openssl.org/docs/crypto/EVP_BytesToKey.html */ const EvpKDF = C_algo.EvpKDF = Base.extend({ /** * Configuration options. * * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) * @property {Hasher} hasher The hash algorithm to use. Default: MD5 * @property {number} iterations The number of iterations to perform. Default: 1 */ cfg: Base.extend({ keySize: 128 / 32, hasher: MD5, iterations: 1 }), /** * Initializes a newly created key derivation function. * * @param {Object} cfg (Optional) The configuration options to use for the derivation. * * @example * * var kdf = CryptoJS.algo.EvpKDF.create(); * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); */ init: function init (cfg) { this.cfg = this.cfg.extend(cfg) }, /** * Derives a key from a password. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * * @return {WordArray} The derived key. * * @example * * var key = kdf.compute(password, salt); */ compute: function compute (password, salt) { let block // Shortcut const cfg = this.cfg // Init hasher const hasher = cfg.hasher.create() // Initial values const derivedKey = WordArray.create() // Shortcuts const derivedKeyWords = derivedKey.words const keySize = cfg.keySize const iterations = cfg.iterations // Generate key while (derivedKeyWords.length < keySize) { if (block) { hasher.update(block) } block = hasher.update(password).finalize(salt) hasher.reset() // Iterations for (let i = 1; i < iterations; i++) { block = hasher.finalize(block) hasher.reset() } derivedKey.concat(block) } derivedKey.sigBytes = keySize * 4 return derivedKey } }) /** * Derives a key from a password. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * @param {Object} cfg (Optional) The configuration options to use for this computation. * * @return {WordArray} The derived key. * * @static * * @example * * var key = CryptoJS.EvpKDF(password, salt); * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); */ C.EvpKDF = function (password, salt, cfg) { return EvpKDF.create(cfg).compute(password, salt) } })() return CryptoJS.EvpKDF }) /***/ }, /***/ 8942: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(1539) __webpack_require__(9714) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { (function (undefined) { // Shortcuts const C = CryptoJS const C_lib = C.lib const CipherParams = C_lib.CipherParams const C_enc = C.enc const Hex = C_enc.Hex const C_format = C.format const HexFormatter = C_format.Hex = { /** * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. * * @param {CipherParams} cipherParams The cipher params object. * * @return {string} The hexadecimally encoded string. * * @static * * @example * * var hexString = CryptoJS.format.Hex.stringify(cipherParams); */ stringify: function stringify (cipherParams) { return cipherParams.ciphertext.toString(Hex) }, /** * Converts a hexadecimally encoded ciphertext string to a cipher params object. * * @param {string} input The hexadecimally encoded string. * * @return {CipherParams} The cipher params object. * * @static * * @example * * var cipherParams = CryptoJS.format.Hex.parse(hexString); */ parse: function parse (input) { const ciphertext = Hex.parse(input) return CipherParams.create({ ciphertext }) } } })() return CryptoJS.format.Hex }) /***/ }, /***/ 6727: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(2222) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const Base = C_lib.Base const C_enc = C.enc const Utf8 = C_enc.Utf8 const C_algo = C.algo /** * HMAC algorithm. */ const HMAC = C_algo.HMAC = Base.extend({ /** * Initializes a newly created HMAC. * * @param {Hasher} hasher The hash algorithm to use. * @param {WordArray|string} key The secret key. * * @example * * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); */ init: function init (hasher, key) { // Init hasher hasher = this._hasher = new hasher.init() // Convert string to WordArray, else assume WordArray already if (typeof key === 'string') { key = Utf8.parse(key) } // Shortcuts const hasherBlockSize = hasher.blockSize const hasherBlockSizeBytes = hasherBlockSize * 4 // Allow arbitrary length keys if (key.sigBytes > hasherBlockSizeBytes) { key = hasher.finalize(key) } // Clamp excess bits key.clamp() // Clone key for inner and outer pads const oKey = this._oKey = key.clone() const iKey = this._iKey = key.clone() // Shortcuts const oKeyWords = oKey.words const iKeyWords = iKey.words // XOR keys with pad constants for (let i = 0; i < hasherBlockSize; i++) { oKeyWords[i] ^= 0x5c5c5c5c iKeyWords[i] ^= 0x36363636 } oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes // Set initial values this.reset() }, /** * Resets this HMAC to its initial state. * * @example * * hmacHasher.reset(); */ reset: function reset () { // Shortcut const hasher = this._hasher // Reset hasher.reset() hasher.update(this._iKey) }, /** * Updates this HMAC with a message. * * @param {WordArray|string} messageUpdate The message to append. * * @return {HMAC} This HMAC instance. * * @example * * hmacHasher.update('message'); * hmacHasher.update(wordArray); */ update: function update (messageUpdate) { this._hasher.update(messageUpdate) // Chainable return this }, /** * Finalizes the HMAC computation. * Note that the finalize operation is effectively a destructive, read-once operation. * * @param {WordArray|string} messageUpdate (Optional) A final message update. * * @return {WordArray} The HMAC. * * @example * * var hmac = hmacHasher.finalize(); * var hmac = hmacHasher.finalize('message'); * var hmac = hmacHasher.finalize(wordArray); */ finalize: function finalize (messageUpdate) { // Shortcut const hasher = this._hasher // Compute HMAC const innerHash = hasher.finalize(messageUpdate) hasher.reset() const hmac = hasher.finalize(this._oKey.clone().concat(innerHash)) return hmac } }) })() }) /***/ }, /***/ 5153: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(2601), __webpack_require__(1947), __webpack_require__(4978), __webpack_require__(7508), __webpack_require__(7590), __webpack_require__(3440), __webpack_require__(9865), __webpack_require__(8921), __webpack_require__(6876), __webpack_require__(7991), __webpack_require__(8122), __webpack_require__(8342), __webpack_require__(8714), __webpack_require__(6727), __webpack_require__(3486), __webpack_require__(3839), __webpack_require__(1582), __webpack_require__(702), __webpack_require__(2362), __webpack_require__(4412), __webpack_require__(5720), __webpack_require__(3518), __webpack_require__(6362), __webpack_require__(4431), __webpack_require__(8800), __webpack_require__(3992), __webpack_require__(649), __webpack_require__(8942), __webpack_require__(194), __webpack_require__(8437), __webpack_require__(4640), __webpack_require__(5323), __webpack_require__(4363)) } else {} })(void 0, function (CryptoJS) { return CryptoJS }) /***/ }, /***/ 1947: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7803) __webpack_require__(1539) __webpack_require__(6992) __webpack_require__(2472) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(7145) __webpack_require__(9743) __webpack_require__(5109) __webpack_require__(8255) __webpack_require__(5125) __webpack_require__(9135) __webpack_require__(4197) __webpack_require__(6495) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function () { // Check if typed arrays are supported if (typeof ArrayBuffer !== 'function') { return } // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray // Reference original init const superInit = WordArray.init // Augment WordArray.init to handle typed arrays const subInit = WordArray.init = function (typedArray) { // Convert buffers to uint8 if (typedArray instanceof ArrayBuffer) { typedArray = new Uint8Array(typedArray) } // Convert other array views to uint8 if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== 'undefined' && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) { typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength) } // Handle Uint8Array if (typedArray instanceof Uint8Array) { // Shortcut const typedArrayByteLength = typedArray.byteLength // Extract bytes const words = [] for (let i = 0; i < typedArrayByteLength; i++) { words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8 } // Initialize this word array superInit.call(this, words, typedArrayByteLength) } else { // Else call normal init superInit.apply(this, arguments) } } subInit.prototype = WordArray })() return CryptoJS.lib.WordArray }) /***/ }, /***/ 3440: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function (Math) { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const Hasher = C_lib.Hasher const C_algo = C.algo // Constants table const T = []; // Compute constants (function () { for (let i = 0; i < 64; i++) { T[i] = Math.abs(Math.sin(i + 1)) * 0x100000000 | 0 } })() /** * MD5 hash algorithm. */ const MD5 = C_algo.MD5 = Hasher.extend({ _doReset: function _doReset () { this._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]) }, _doProcessBlock: function _doProcessBlock (M, offset) { // Swap endian for (let i = 0; i < 16; i++) { // Shortcuts const offset_i = offset + i const M_offset_i = M[offset_i] M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00 } // Shortcuts const H = this._hash.words const M_offset_0 = M[offset + 0] const M_offset_1 = M[offset + 1] const M_offset_2 = M[offset + 2] const M_offset_3 = M[offset + 3] const M_offset_4 = M[offset + 4] const M_offset_5 = M[offset + 5] const M_offset_6 = M[offset + 6] const M_offset_7 = M[offset + 7] const M_offset_8 = M[offset + 8] const M_offset_9 = M[offset + 9] const M_offset_10 = M[offset + 10] const M_offset_11 = M[offset + 11] const M_offset_12 = M[offset + 12] const M_offset_13 = M[offset + 13] const M_offset_14 = M[offset + 14] const M_offset_15 = M[offset + 15] // Working varialbes let a = H[0] let b = H[1] let c = H[2] let d = H[3] // Computation a = FF(a, b, c, d, M_offset_0, 7, T[0]) d = FF(d, a, b, c, M_offset_1, 12, T[1]) c = FF(c, d, a, b, M_offset_2, 17, T[2]) b = FF(b, c, d, a, M_offset_3, 22, T[3]) a = FF(a, b, c, d, M_offset_4, 7, T[4]) d = FF(d, a, b, c, M_offset_5, 12, T[5]) c = FF(c, d, a, b, M_offset_6, 17, T[6]) b = FF(b, c, d, a, M_offset_7, 22, T[7]) a = FF(a, b, c, d, M_offset_8, 7, T[8]) d = FF(d, a, b, c, M_offset_9, 12, T[9]) c = FF(c, d, a, b, M_offset_10, 17, T[10]) b = FF(b, c, d, a, M_offset_11, 22, T[11]) a = FF(a, b, c, d, M_offset_12, 7, T[12]) d = FF(d, a, b, c, M_offset_13, 12, T[13]) c = FF(c, d, a, b, M_offset_14, 17, T[14]) b = FF(b, c, d, a, M_offset_15, 22, T[15]) a = GG(a, b, c, d, M_offset_1, 5, T[16]) d = GG(d, a, b, c, M_offset_6, 9, T[17]) c = GG(c, d, a, b, M_offset_11, 14, T[18]) b = GG(b, c, d, a, M_offset_0, 20, T[19]) a = GG(a, b, c, d, M_offset_5, 5, T[20]) d = GG(d, a, b, c, M_offset_10, 9, T[21]) c = GG(c, d, a, b, M_offset_15, 14, T[22]) b = GG(b, c, d, a, M_offset_4, 20, T[23]) a = GG(a, b, c, d, M_offset_9, 5, T[24]) d = GG(d, a, b, c, M_offset_14, 9, T[25]) c = GG(c, d, a, b, M_offset_3, 14, T[26]) b = GG(b, c, d, a, M_offset_8, 20, T[27]) a = GG(a, b, c, d, M_offset_13, 5, T[28]) d = GG(d, a, b, c, M_offset_2, 9, T[29]) c = GG(c, d, a, b, M_offset_7, 14, T[30]) b = GG(b, c, d, a, M_offset_12, 20, T[31]) a = HH(a, b, c, d, M_offset_5, 4, T[32]) d = HH(d, a, b, c, M_offset_8, 11, T[33]) c = HH(c, d, a, b, M_offset_11, 16, T[34]) b = HH(b, c, d, a, M_offset_14, 23, T[35]) a = HH(a, b, c, d, M_offset_1, 4, T[36]) d = HH(d, a, b, c, M_offset_4, 11, T[37]) c = HH(c, d, a, b, M_offset_7, 16, T[38]) b = HH(b, c, d, a, M_offset_10, 23, T[39]) a = HH(a, b, c, d, M_offset_13, 4, T[40]) d = HH(d, a, b, c, M_offset_0, 11, T[41]) c = HH(c, d, a, b, M_offset_3, 16, T[42]) b = HH(b, c, d, a, M_offset_6, 23, T[43]) a = HH(a, b, c, d, M_offset_9, 4, T[44]) d = HH(d, a, b, c, M_offset_12, 11, T[45]) c = HH(c, d, a, b, M_offset_15, 16, T[46]) b = HH(b, c, d, a, M_offset_2, 23, T[47]) a = II(a, b, c, d, M_offset_0, 6, T[48]) d = II(d, a, b, c, M_offset_7, 10, T[49]) c = II(c, d, a, b, M_offset_14, 15, T[50]) b = II(b, c, d, a, M_offset_5, 21, T[51]) a = II(a, b, c, d, M_offset_12, 6, T[52]) d = II(d, a, b, c, M_offset_3, 10, T[53]) c = II(c, d, a, b, M_offset_10, 15, T[54]) b = II(b, c, d, a, M_offset_1, 21, T[55]) a = II(a, b, c, d, M_offset_8, 6, T[56]) d = II(d, a, b, c, M_offset_15, 10, T[57]) c = II(c, d, a, b, M_offset_6, 15, T[58]) b = II(b, c, d, a, M_offset_13, 21, T[59]) a = II(a, b, c, d, M_offset_4, 6, T[60]) d = II(d, a, b, c, M_offset_11, 10, T[61]) c = II(c, d, a, b, M_offset_2, 15, T[62]) b = II(b, c, d, a, M_offset_9, 21, T[63]) // Intermediate hash value H[0] = H[0] + a | 0 H[1] = H[1] + b | 0 H[2] = H[2] + c | 0 H[3] = H[3] + d | 0 }, _doFinalize: function _doFinalize () { // Shortcuts const data = this._data const dataWords = data.words const nBitsTotal = this._nDataBytes * 8 const nBitsLeft = data.sigBytes * 8 // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32 const nBitsTotalH = Math.floor(nBitsTotal / 0x100000000) const nBitsTotalL = nBitsTotal dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 0x00ff00ff | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 0xff00ff00 dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 0x00ff00ff | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 0xff00ff00 data.sigBytes = (dataWords.length + 1) * 4 // Hash final blocks this._process() // Shortcuts const hash = this._hash const H = hash.words // Swap endian for (let i = 0; i < 4; i++) { // Shortcut const H_i = H[i] H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00 } // Return final computed hash return hash }, clone: function clone () { const clone = Hasher.clone.call(this) clone._hash = this._hash.clone() return clone } }) function FF (a, b, c, d, x, s, t) { const n = a + (b & c | ~b & d) + x + t return (n << s | n >>> 32 - s) + b } function GG (a, b, c, d, x, s, t) { const n = a + (b & d | c & ~d) + x + t return (n << s | n >>> 32 - s) + b } function HH (a, b, c, d, x, s, t) { const n = a + (b ^ c ^ d) + x + t return (n << s | n >>> 32 - s) + b } function II (a, b, c, d, x, s, t) { const n = a + (c ^ (b | ~d)) + x + t return (n << s | n >>> 32 - s) + b } /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.MD5('message'); * var hash = CryptoJS.MD5(wordArray); */ C.MD5 = Hasher._createHelper(MD5) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacMD5(message, key); */ C.HmacMD5 = Hasher._createHmacHelper(MD5) })(Math) return CryptoJS.MD5 }) /***/ }, /***/ 702: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * Cipher Feedback block mode. */ CryptoJS.mode.CFB = (function () { const CFB = CryptoJS.lib.BlockCipherMode.extend() CFB.Encryptor = CFB.extend({ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher) // Remember this block to use with next block this._prevBlock = words.slice(offset, offset + blockSize) } }) CFB.Decryptor = CFB.extend({ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize // Remember this block to use with next block const thisBlock = words.slice(offset, offset + blockSize) generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher) // This block becomes the previous block this._prevBlock = thisBlock } }) function generateKeystreamAndEncrypt (words, offset, blockSize, cipher) { let keystream // Shortcut const iv = this._iv // Generate keystream if (iv) { keystream = iv.slice(0) // Remove IV for subsequent blocks this._iv = undefined } else { keystream = this._prevBlock } cipher.encryptBlock(keystream, 0) // Encrypt for (let i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i] } } return CFB }()) return CryptoJS.mode.CFB }) /***/ }, /***/ 4412: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */ CryptoJS.mode.CTRGladman = (function () { const CTRGladman = CryptoJS.lib.BlockCipherMode.extend() function incWord (word) { if ((word >> 24 & 0xff) === 0xff) { // overflow let b1 = word >> 16 & 0xff let b2 = word >> 8 & 0xff let b3 = word & 0xff if (b1 === 0xff) // overflow b1 { b1 = 0 if (b2 === 0xff) { b2 = 0 if (b3 === 0xff) { b3 = 0 } else { ++b3 } } else { ++b2 } } else { ++b1 } word = 0 word += b1 << 16 word += b2 << 8 word += b3 } else { word += 0x01 << 24 } return word } function incCounter (counter) { if ((counter[0] = incWord(counter[0])) === 0) { // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 counter[1] = incWord(counter[1]) } return counter } const Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize const iv = this._iv let counter = this._counter // Generate keystream if (iv) { counter = this._counter = iv.slice(0) // Remove IV for subsequent blocks this._iv = undefined } incCounter(counter) const keystream = counter.slice(0) cipher.encryptBlock(keystream, 0) // Encrypt for (let i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i] } } }) CTRGladman.Decryptor = Encryptor return CTRGladman }()) return CryptoJS.mode.CTRGladman }) /***/ }, /***/ 2362: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * Counter block mode. */ CryptoJS.mode.CTR = (function () { const CTR = CryptoJS.lib.BlockCipherMode.extend() const Encryptor = CTR.Encryptor = CTR.extend({ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize const iv = this._iv let counter = this._counter // Generate keystream if (iv) { counter = this._counter = iv.slice(0) // Remove IV for subsequent blocks this._iv = undefined } const keystream = counter.slice(0) cipher.encryptBlock(keystream, 0) // Increment counter counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0 // Encrypt for (let i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i] } } }) CTR.Decryptor = Encryptor return CTR }()) return CryptoJS.mode.CTR }) /***/ }, /***/ 3518: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * Electronic Codebook block mode. */ CryptoJS.mode.ECB = (function () { const ECB = CryptoJS.lib.BlockCipherMode.extend() ECB.Encryptor = ECB.extend({ processBlock: function processBlock (words, offset) { this._cipher.encryptBlock(words, offset) } }) ECB.Decryptor = ECB.extend({ processBlock: function processBlock (words, offset) { this._cipher.decryptBlock(words, offset) } }) return ECB }()) return CryptoJS.mode.ECB }) /***/ }, /***/ 5720: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * Output Feedback block mode. */ CryptoJS.mode.OFB = (function () { const OFB = CryptoJS.lib.BlockCipherMode.extend() const Encryptor = OFB.Encryptor = OFB.extend({ processBlock: function processBlock (words, offset) { // Shortcuts const cipher = this._cipher const blockSize = cipher.blockSize const iv = this._iv let keystream = this._keystream // Generate keystream if (iv) { keystream = this._keystream = iv.slice(0) // Remove IV for subsequent blocks this._iv = undefined } cipher.encryptBlock(keystream, 0) // Encrypt for (let i = 0; i < blockSize; i++) { words[offset + i] ^= keystream[i] } } }) OFB.Decryptor = Encryptor return OFB }()) return CryptoJS.mode.OFB }) /***/ }, /***/ 6362: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * ANSI X.923 padding strategy. */ CryptoJS.pad.AnsiX923 = { pad: function pad (data, blockSize) { // Shortcuts const dataSigBytes = data.sigBytes const blockSizeBytes = blockSize * 4 // Count padding bytes const nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes // Compute last byte position const lastBytePos = dataSigBytes + nPaddingBytes - 1 // Pad data.clamp() data.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8 data.sigBytes += nPaddingBytes }, unpad: function unpad (data) { // Get number of padding bytes from last byte const nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff // Remove padding data.sigBytes -= nPaddingBytes } } return CryptoJS.pad.Ansix923 }) /***/ }, /***/ 4431: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(2222) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * ISO 10126 padding strategy. */ CryptoJS.pad.Iso10126 = { pad: function pad (data, blockSize) { // Shortcut const blockSizeBytes = blockSize * 4 // Count padding bytes const nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes // Pad data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)) }, unpad: function unpad (data) { // Get number of padding bytes from last byte const nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff // Remove padding data.sigBytes -= nPaddingBytes } } return CryptoJS.pad.Iso10126 }) /***/ }, /***/ 8800: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(2222) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * ISO/IEC 9797-1 Padding Method 2. */ CryptoJS.pad.Iso97971 = { pad: function pad (data, blockSize) { // Add 0x80 byte data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)) // Zero pad the rest CryptoJS.pad.ZeroPadding.pad(data, blockSize) }, unpad: function unpad (data) { // Remove zero padding CryptoJS.pad.ZeroPadding.unpad(data) // Remove one more byte -- the 0x80 byte data.sigBytes-- } } return CryptoJS.pad.Iso97971 }) /***/ }, /***/ 649: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * A noop padding strategy. */ CryptoJS.pad.NoPadding = { pad: function pad () {}, unpad: function unpad () {} } return CryptoJS.pad.NoPadding }) /***/ }, /***/ 3992: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { /** * Zero padding strategy. */ CryptoJS.pad.ZeroPadding = { pad: function pad (data, blockSize) { // Shortcut const blockSizeBytes = blockSize * 4 // Pad data.clamp() data.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes) }, unpad: function unpad (data) { // Shortcut const dataWords = data.words // Unpad var i = data.sigBytes - 1 for (var i = data.sigBytes - 1; i >= 0; i--) { if (dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff) { data.sigBytes = i + 1 break } } } } return CryptoJS.pad.ZeroPadding }) /***/ }, /***/ 3486: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(2222) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(9865), __webpack_require__(6727)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const Base = C_lib.Base const WordArray = C_lib.WordArray const C_algo = C.algo const SHA1 = C_algo.SHA1 const HMAC = C_algo.HMAC /** * Password-Based Key Derivation Function 2 algorithm. */ const PBKDF2 = C_algo.PBKDF2 = Base.extend({ /** * Configuration options. * * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) * @property {Hasher} hasher The hasher to use. Default: SHA1 * @property {number} iterations The number of iterations to perform. Default: 1 */ cfg: Base.extend({ keySize: 128 / 32, hasher: SHA1, iterations: 1 }), /** * Initializes a newly created key derivation function. * * @param {Object} cfg (Optional) The configuration options to use for the derivation. * * @example * * var kdf = CryptoJS.algo.PBKDF2.create(); * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); */ init: function init (cfg) { this.cfg = this.cfg.extend(cfg) }, /** * Computes the Password-Based Key Derivation Function 2. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * * @return {WordArray} The derived key. * * @example * * var key = kdf.compute(password, salt); */ compute: function compute (password, salt) { // Shortcut const cfg = this.cfg // Init HMAC const hmac = HMAC.create(cfg.hasher, password) // Initial values const derivedKey = WordArray.create() const blockIndex = WordArray.create([0x00000001]) // Shortcuts const derivedKeyWords = derivedKey.words const blockIndexWords = blockIndex.words const keySize = cfg.keySize const iterations = cfg.iterations // Generate key while (derivedKeyWords.length < keySize) { const block = hmac.update(salt).finalize(blockIndex) hmac.reset() // Shortcuts const blockWords = block.words const blockWordsLength = blockWords.length // Iterations let intermediate = block for (let i = 1; i < iterations; i++) { intermediate = hmac.finalize(intermediate) hmac.reset() // Shortcut const intermediateWords = intermediate.words // XOR intermediate with block for (let j = 0; j < blockWordsLength; j++) { blockWords[j] ^= intermediateWords[j] } } derivedKey.concat(block) blockIndexWords[0]++ } derivedKey.sigBytes = keySize * 4 return derivedKey } }) /** * Computes the Password-Based Key Derivation Function 2. * * @param {WordArray|string} password The password. * @param {WordArray|string} salt A salt. * @param {Object} cfg (Optional) The configuration options to use for this computation. * * @return {WordArray} The derived key. * * @static * * @example * * var key = CryptoJS.PBKDF2(password, salt); * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); */ C.PBKDF2 = function (password, salt, cfg) { return PBKDF2.create(cfg).compute(password, salt) } })() return CryptoJS.PBKDF2 }) /***/ }, /***/ 4363: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(7508), __webpack_require__(3440), __webpack_require__(3839), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const StreamCipher = C_lib.StreamCipher const C_algo = C.algo // Reusable objects const S = [] const C_ = [] const G = [] /** * Rabbit stream cipher algorithm. * * This is a legacy version that neglected to convert the key to little-endian. * This error doesn't affect the cipher's security, * but it does affect its compatibility with other implementations. */ const RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ _doReset: function _doReset () { // Shortcuts const K = this._key.words const iv = this.cfg.iv // Generate initial state values const X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16] // Generate initial counter values const C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff] // Carry bit this._b = 0 // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this) } // Modify the counters for (var i = 0; i < 8; i++) { C[i] ^= X[i + 4 & 7] } // IV setup if (iv) { // Shortcuts const IV = iv.words const IV_0 = IV[0] const IV_1 = IV[1] // Generate four subvectors const i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00 const i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00 const i1 = i0 >>> 16 | i2 & 0xffff0000 const i3 = i2 << 16 | i0 & 0x0000ffff // Modify counter values C[0] ^= i0 C[1] ^= i1 C[2] ^= i2 C[3] ^= i3 C[4] ^= i0 C[5] ^= i1 C[6] ^= i2 C[7] ^= i3 // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this) } } }, _doProcessBlock: function _doProcessBlock (M, offset) { // Shortcut const X = this._X // Iterate the system nextState.call(this) // Generate four keystream words S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16 S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16 S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16 S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16 for (let i = 0; i < 4; i++) { // Swap endian S[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00 // Encrypt M[offset + i] ^= S[i] } }, blockSize: 128 / 32, ivSize: 64 / 32 }) function nextState () { // Shortcuts const X = this._X const C = this._C // Save old counter values for (var i = 0; i < 8; i++) { C_[i] = C[i] } // Calculate new counter values C[0] = C[0] + 0x4d34d34d + this._b | 0 C[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0 C[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0 C[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0 C[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0 C[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0 C[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0 C[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0 this._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0 // Calculate the g-values for (var i = 0; i < 8; i++) { const gx = X[i] + C[i] // Construct high and low argument for squaring const ga = gx & 0xffff const gb = gx >>> 16 // Calculate high and low result of squaring const gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb const gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0) // High XOR low G[i] = gh ^ gl } // Calculate new state values X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0 X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0 X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0 X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0 X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0 X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0 X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0 X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0 } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); */ C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy) })() return CryptoJS.RabbitLegacy }) /***/ }, /***/ 5323: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(7508), __webpack_require__(3440), __webpack_require__(3839), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const StreamCipher = C_lib.StreamCipher const C_algo = C.algo // Reusable objects const S = [] const C_ = [] const G = [] /** * Rabbit stream cipher algorithm */ const Rabbit = C_algo.Rabbit = StreamCipher.extend({ _doReset: function _doReset () { // Shortcuts const K = this._key.words const iv = this.cfg.iv // Swap endian for (var i = 0; i < 4; i++) { K[i] = (K[i] << 8 | K[i] >>> 24) & 0x00ff00ff | (K[i] << 24 | K[i] >>> 8) & 0xff00ff00 } // Generate initial state values const X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16] // Generate initial counter values const C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff] // Carry bit this._b = 0 // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this) } // Modify the counters for (var i = 0; i < 8; i++) { C[i] ^= X[i + 4 & 7] } // IV setup if (iv) { // Shortcuts const IV = iv.words const IV_0 = IV[0] const IV_1 = IV[1] // Generate four subvectors const i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00 const i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00 const i1 = i0 >>> 16 | i2 & 0xffff0000 const i3 = i2 << 16 | i0 & 0x0000ffff // Modify counter values C[0] ^= i0 C[1] ^= i1 C[2] ^= i2 C[3] ^= i3 C[4] ^= i0 C[5] ^= i1 C[6] ^= i2 C[7] ^= i3 // Iterate the system four times for (var i = 0; i < 4; i++) { nextState.call(this) } } }, _doProcessBlock: function _doProcessBlock (M, offset) { // Shortcut const X = this._X // Iterate the system nextState.call(this) // Generate four keystream words S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16 S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16 S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16 S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16 for (let i = 0; i < 4; i++) { // Swap endian S[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00 // Encrypt M[offset + i] ^= S[i] } }, blockSize: 128 / 32, ivSize: 64 / 32 }) function nextState () { // Shortcuts const X = this._X const C = this._C // Save old counter values for (var i = 0; i < 8; i++) { C_[i] = C[i] } // Calculate new counter values C[0] = C[0] + 0x4d34d34d + this._b | 0 C[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0 C[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0 C[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0 C[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0 C[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0 C[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0 C[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0 this._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0 // Calculate the g-values for (var i = 0; i < 8; i++) { const gx = X[i] + C[i] // Construct high and low argument for squaring const ga = gx & 0xffff const gb = gx >>> 16 // Calculate high and low result of squaring const gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb const gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0) // High XOR low G[i] = gh ^ gl } // Calculate new state values X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0 X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0 X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0 X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0 X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0 X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0 X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0 X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0 } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); */ C.Rabbit = StreamCipher._createHelper(Rabbit) })() return CryptoJS.Rabbit }) /***/ }, /***/ 4640: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(1539) __webpack_require__(8674) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(7508), __webpack_require__(3440), __webpack_require__(3839), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const StreamCipher = C_lib.StreamCipher const C_algo = C.algo /** * RC4 stream cipher algorithm. */ const RC4 = C_algo.RC4 = StreamCipher.extend({ _doReset: function _doReset () { // Shortcuts const key = this._key const keyWords = key.words const keySigBytes = key.sigBytes // Init sbox const S = this._S = [] for (var i = 0; i < 256; i++) { S[i] = i } // Key setup for (var i = 0, j = 0; i < 256; i++) { const keyByteIndex = i % keySigBytes const keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 0xff j = (j + S[i] + keyByte) % 256 // Swap const t = S[i] S[i] = S[j] S[j] = t } // Counters this._i = this._j = 0 }, _doProcessBlock: function _doProcessBlock (M, offset) { M[offset] ^= generateKeystreamWord.call(this) }, keySize: 256 / 32, ivSize: 0 }) function generateKeystreamWord () { // Shortcuts const S = this._S let i = this._i let j = this._j // Generate keystream word let keystreamWord = 0 for (let n = 0; n < 4; n++) { i = (i + 1) % 256 j = (j + S[i]) % 256 // Swap const t = S[i] S[i] = S[j] S[j] = t keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8 } // Update counters this._i = i this._j = j return keystreamWord } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); */ C.RC4 = StreamCipher._createHelper(RC4) /** * Modified RC4 stream cipher algorithm. */ const RC4Drop = C_algo.RC4Drop = RC4.extend({ /** * Configuration options. * * @property {number} drop The number of keystream words to drop. Default 192 */ cfg: RC4.cfg.extend({ drop: 192 }), _doReset: function _doReset () { RC4._doReset.call(this) // Drop for (let i = this.cfg.drop; i > 0; i--) { generateKeystreamWord.call(this) } } }) /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); */ C.RC4Drop = StreamCipher._createHelper(RC4Drop) })() return CryptoJS.RC4 }) /***/ }, /***/ 8714: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function (Math) { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const Hasher = C_lib.Hasher const C_algo = C.algo // Constants table const _zl = WordArray.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]) const _zr = WordArray.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]) const _sl = WordArray.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]) const _sr = WordArray.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]) const _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]) const _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]) /** * RIPEMD160 hash algorithm. */ const RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ _doReset: function _doReset () { this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]) }, _doProcessBlock: function _doProcessBlock (M, offset) { // Swap endian for (var i = 0; i < 16; i++) { // Shortcuts const offset_i = offset + i const M_offset_i = M[offset_i] // Swap M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00 } // Shortcut const H = this._hash.words const hl = _hl.words const hr = _hr.words const zl = _zl.words const zr = _zr.words const sl = _sl.words const sr = _sr.words // Working variables let al, bl, cl, dl, el let ar, br, cr, dr, er ar = al = H[0] br = bl = H[1] cr = cl = H[2] dr = dl = H[3] er = el = H[4] // Computation let t for (var i = 0; i < 80; i += 1) { t = al + M[offset + zl[i]] | 0 if (i < 16) { t += f1(bl, cl, dl) + hl[0] } else if (i < 32) { t += f2(bl, cl, dl) + hl[1] } else if (i < 48) { t += f3(bl, cl, dl) + hl[2] } else if (i < 64) { t += f4(bl, cl, dl) + hl[3] } else { // if (i<80) { t += f5(bl, cl, dl) + hl[4] } t = t | 0 t = rotl(t, sl[i]) t = t + el | 0 al = el el = dl dl = rotl(cl, 10) cl = bl bl = t t = ar + M[offset + zr[i]] | 0 if (i < 16) { t += f5(br, cr, dr) + hr[0] } else if (i < 32) { t += f4(br, cr, dr) + hr[1] } else if (i < 48) { t += f3(br, cr, dr) + hr[2] } else if (i < 64) { t += f2(br, cr, dr) + hr[3] } else { // if (i<80) { t += f1(br, cr, dr) + hr[4] } t = t | 0 t = rotl(t, sr[i]) t = t + er | 0 ar = er er = dr dr = rotl(cr, 10) cr = br br = t } // Intermediate hash value t = H[1] + cl + dr | 0 H[1] = H[2] + dl + er | 0 H[2] = H[3] + el + ar | 0 H[3] = H[4] + al + br | 0 H[4] = H[0] + bl + cr | 0 H[0] = t }, _doFinalize: function _doFinalize () { // Shortcuts const data = this._data const dataWords = data.words const nBitsTotal = this._nDataBytes * 8 const nBitsLeft = data.sigBytes * 8 // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32 dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 0x00ff00ff | (nBitsTotal << 24 | nBitsTotal >>> 8) & 0xff00ff00 data.sigBytes = (dataWords.length + 1) * 4 // Hash final blocks this._process() // Shortcuts const hash = this._hash const H = hash.words // Swap endian for (let i = 0; i < 5; i++) { // Shortcut const H_i = H[i] // Swap H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00 } // Return final computed hash return hash }, clone: function clone () { const clone = Hasher.clone.call(this) clone._hash = this._hash.clone() return clone } }) function f1 (x, y, z) { return x ^ y ^ z } function f2 (x, y, z) { return x & y | ~x & z } function f3 (x, y, z) { return (x | ~y) ^ z } function f4 (x, y, z) { return x & z | y & ~z } function f5 (x, y, z) { return x ^ (y | ~z) } function rotl (x, n) { return x << n | x >>> 32 - n } /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.RIPEMD160('message'); * var hash = CryptoJS.RIPEMD160(wordArray); */ C.RIPEMD160 = Hasher._createHelper(RIPEMD160) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacRIPEMD160(message, key); */ C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160) })(Math) return CryptoJS.RIPEMD160 }) /***/ }, /***/ 9865: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const Hasher = C_lib.Hasher const C_algo = C.algo // Reusable object const W = [] /** * SHA-1 hash algorithm. */ const SHA1 = C_algo.SHA1 = Hasher.extend({ _doReset: function _doReset () { this._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]) }, _doProcessBlock: function _doProcessBlock (M, offset) { // Shortcut const H = this._hash.words // Working variables let a = H[0] let b = H[1] let c = H[2] let d = H[3] let e = H[4] // Computation for (let i = 0; i < 80; i++) { if (i < 16) { W[i] = M[offset + i] | 0 } else { const n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16] W[i] = n << 1 | n >>> 31 } let t = (a << 5 | a >>> 27) + e + W[i] if (i < 20) { t += (b & c | ~b & d) + 0x5a827999 } else if (i < 40) { t += (b ^ c ^ d) + 0x6ed9eba1 } else if (i < 60) { t += (b & c | b & d | c & d) - 0x70e44324 } else /* if (i < 80) */ { t += (b ^ c ^ d) - 0x359d3e2a } e = d d = c c = b << 30 | b >>> 2 b = a a = t } // Intermediate hash value H[0] = H[0] + a | 0 H[1] = H[1] + b | 0 H[2] = H[2] + c | 0 H[3] = H[3] + d | 0 H[4] = H[4] + e | 0 }, _doFinalize: function _doFinalize () { // Shortcuts const data = this._data const dataWords = data.words const nBitsTotal = this._nDataBytes * 8 const nBitsLeft = data.sigBytes * 8 // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32 dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000) dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal data.sigBytes = dataWords.length * 4 // Hash final blocks this._process() // Return final computed hash return this._hash }, clone: function clone () { const clone = Hasher.clone.call(this) clone._hash = this._hash.clone() return clone } }) /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA1('message'); * var hash = CryptoJS.SHA1(wordArray); */ C.SHA1 = Hasher._createHelper(SHA1) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA1(message, key); */ C.HmacSHA1 = Hasher._createHmacHelper(SHA1) })() return CryptoJS.SHA1 }) /***/ }, /***/ 6876: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(8921)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const C_algo = C.algo const SHA256 = C_algo.SHA256 /** * SHA-224 hash algorithm. */ const SHA224 = C_algo.SHA224 = SHA256.extend({ _doReset: function _doReset () { this._hash = new WordArray.init([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]) }, _doFinalize: function _doFinalize () { const hash = SHA256._doFinalize.call(this) hash.sigBytes -= 4 return hash } }) /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA224('message'); * var hash = CryptoJS.SHA224(wordArray); */ C.SHA224 = SHA256._createHelper(SHA224) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA224(message, key); */ C.HmacSHA224 = SHA256._createHmacHelper(SHA224) })() return CryptoJS.SHA224 }) /***/ }, /***/ 8921: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function (Math) { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const Hasher = C_lib.Hasher const C_algo = C.algo // Initialization and round constants tables const H = [] const K = []; // Compute constants (function () { function isPrime (n) { const sqrtN = Math.sqrt(n) for (let factor = 2; factor <= sqrtN; factor++) { if (!(n % factor)) { return false } } return true } function getFractionalBits (n) { return (n - (n | 0)) * 0x100000000 | 0 } let n = 2 let nPrime = 0 while (nPrime < 64) { if (isPrime(n)) { if (nPrime < 8) { H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)) } K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)) nPrime++ } n++ } })() // Reusable object const W = [] /** * SHA-256 hash algorithm. */ const SHA256 = C_algo.SHA256 = Hasher.extend({ _doReset: function _doReset () { this._hash = new WordArray.init(H.slice(0)) }, _doProcessBlock: function _doProcessBlock (M, offset) { // Shortcut const H = this._hash.words // Working variables let a = H[0] let b = H[1] let c = H[2] let d = H[3] let e = H[4] let f = H[5] let g = H[6] let h = H[7] // Computation for (let i = 0; i < 64; i++) { if (i < 16) { W[i] = M[offset + i] | 0 } else { const gamma0x = W[i - 15] const gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3 const gamma1x = W[i - 2] const gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] } const ch = e & f ^ ~e & g const maj = a & b ^ a & c ^ b & c const sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22) const sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25) const t1 = h + sigma1 + ch + K[i] + W[i] const t2 = sigma0 + maj h = g g = f f = e e = d + t1 | 0 d = c c = b b = a a = t1 + t2 | 0 } // Intermediate hash value H[0] = H[0] + a | 0 H[1] = H[1] + b | 0 H[2] = H[2] + c | 0 H[3] = H[3] + d | 0 H[4] = H[4] + e | 0 H[5] = H[5] + f | 0 H[6] = H[6] + g | 0 H[7] = H[7] + h | 0 }, _doFinalize: function _doFinalize () { // Shortcuts const data = this._data const dataWords = data.words const nBitsTotal = this._nDataBytes * 8 const nBitsLeft = data.sigBytes * 8 // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32 dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000) dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal data.sigBytes = dataWords.length * 4 // Hash final blocks this._process() // Return final computed hash return this._hash }, clone: function clone () { const clone = Hasher.clone.call(this) clone._hash = this._hash.clone() return clone } }) /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA256('message'); * var hash = CryptoJS.SHA256(wordArray); */ C.SHA256 = Hasher._createHelper(SHA256) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA256(message, key); */ C.HmacSHA256 = Hasher._createHmacHelper(SHA256) })(Math) return CryptoJS.SHA256 }) /***/ }, /***/ 8342: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(2601)) } else {} })(void 0, function (CryptoJS) { (function (Math) { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const Hasher = C_lib.Hasher const C_x64 = C.x64 const X64Word = C_x64.Word const C_algo = C.algo // Constants tables const RHO_OFFSETS = [] const PI_INDEXES = [] const ROUND_CONSTANTS = []; // Compute Constants (function () { // Compute rho offset constants var x = 1 var y = 0 for (let t = 0; t < 24; t++) { RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64 const newX = y % 5 const newY = (2 * x + 3 * y) % 5 x = newX y = newY } // Compute pi index constants for (var x = 0; x < 5; x++) { for (var y = 0; y < 5; y++) { PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5 } } // Compute round constants let LFSR = 0x01 for (let i = 0; i < 24; i++) { let roundConstantMsw = 0 let roundConstantLsw = 0 for (let j = 0; j < 7; j++) { if (LFSR & 0x01) { const bitPosition = (1 << j) - 1 if (bitPosition < 32) { roundConstantLsw ^= 1 << bitPosition } else /* if (bitPosition >= 32) */ { roundConstantMsw ^= 1 << bitPosition - 32 } } // Compute next LFSR if (LFSR & 0x80) { // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 LFSR = LFSR << 1 ^ 0x71 } else { LFSR <<= 1 } } ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw) } })() // Reusable objects for temporary values const T = []; (function () { for (let i = 0; i < 25; i++) { T[i] = X64Word.create() } })() /** * SHA-3 hash algorithm. */ const SHA3 = C_algo.SHA3 = Hasher.extend({ /** * Configuration options. * * @property {number} outputLength * The desired number of bits in the output hash. * Only values permitted are: 224, 256, 384, 512. * Default: 512 */ cfg: Hasher.cfg.extend({ outputLength: 512 }), _doReset: function _doReset () { const state = this._state = [] for (let i = 0; i < 25; i++) { state[i] = new X64Word.init() } this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32 }, _doProcessBlock: function _doProcessBlock (M, offset) { // Shortcuts const state = this._state const nBlockSizeLanes = this.blockSize / 2 // Absorb for (let i = 0; i < nBlockSizeLanes; i++) { // Shortcuts let M2i = M[offset + 2 * i] let M2i1 = M[offset + 2 * i + 1] // Swap endian M2i = (M2i << 8 | M2i >>> 24) & 0x00ff00ff | (M2i << 24 | M2i >>> 8) & 0xff00ff00 M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 0x00ff00ff | (M2i1 << 24 | M2i1 >>> 8) & 0xff00ff00 // Absorb message into state var lane = state[i] lane.high ^= M2i1 lane.low ^= M2i } // Rounds for (let round = 0; round < 24; round++) { // Theta for (var x = 0; x < 5; x++) { // Mix column lanes var tMsw = 0 var tLsw = 0 for (var y = 0; y < 5; y++) { var lane = state[x + 5 * y] tMsw ^= lane.high tLsw ^= lane.low } // Temporary values const Tx = T[x] Tx.high = tMsw Tx.low = tLsw } for (var x = 0; x < 5; x++) { // Shortcuts const Tx4 = T[(x + 4) % 5] const Tx1 = T[(x + 1) % 5] const Tx1Msw = Tx1.high const Tx1Lsw = Tx1.low // Mix surrounding columns var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31) var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31) for (var y = 0; y < 5; y++) { var lane = state[x + 5 * y] lane.high ^= tMsw lane.low ^= tLsw } } // Rho Pi for (var laneIndex = 1; laneIndex < 25; laneIndex++) { var tMsw var tLsw // Shortcuts var lane = state[laneIndex] const laneMsw = lane.high const laneLsw = lane.low const rhoOffset = RHO_OFFSETS[laneIndex] // Rotate lanes if (rhoOffset < 32) { tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset } else /* if (rhoOffset >= 32) */ { tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset } // Transpose lanes const TPiLane = T[PI_INDEXES[laneIndex]] TPiLane.high = tMsw TPiLane.low = tLsw } // Rho pi at x = y = 0 const T0 = T[0] const state0 = state[0] T0.high = state0.high T0.low = state0.low // Chi for (var x = 0; x < 5; x++) { for (var y = 0; y < 5; y++) { // Shortcuts var laneIndex = x + 5 * y var lane = state[laneIndex] const TLane = T[laneIndex] const Tx1Lane = T[(x + 1) % 5 + 5 * y] const Tx2Lane = T[(x + 2) % 5 + 5 * y] // Mix rows lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low } } // Iota var lane = state[0] const roundConstant = ROUND_CONSTANTS[round] lane.high ^= roundConstant.high lane.low ^= roundConstant.low } }, _doFinalize: function _doFinalize () { // Shortcuts const data = this._data const dataWords = data.words const nBitsTotal = this._nDataBytes * 8 const nBitsLeft = data.sigBytes * 8 const blockSizeBits = this.blockSize * 32 // Add padding dataWords[nBitsLeft >>> 5] |= 0x1 << 24 - nBitsLeft % 32 dataWords[(Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 0x80 data.sigBytes = dataWords.length * 4 // Hash final blocks this._process() // Shortcuts const state = this._state const outputLengthBytes = this.cfg.outputLength / 8 const outputLengthLanes = outputLengthBytes / 8 // Squeeze const hashWords = [] for (let i = 0; i < outputLengthLanes; i++) { // Shortcuts const lane = state[i] let laneMsw = lane.high let laneLsw = lane.low // Swap endian laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 0x00ff00ff | (laneMsw << 24 | laneMsw >>> 8) & 0xff00ff00 laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 0x00ff00ff | (laneLsw << 24 | laneLsw >>> 8) & 0xff00ff00 // Squeeze state to retrieve hash hashWords.push(laneLsw) hashWords.push(laneMsw) } // Return final computed hash return new WordArray.init(hashWords, outputLengthBytes) }, clone: function clone () { const clone = Hasher.clone.call(this) const state = clone._state = this._state.slice(0) for (let i = 0; i < 25; i++) { state[i] = state[i].clone() } return clone } }) /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA3('message'); * var hash = CryptoJS.SHA3(wordArray); */ C.SHA3 = Hasher._createHelper(SHA3) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA3(message, key); */ C.HmacSHA3 = Hasher._createHmacHelper(SHA3) })(Math) return CryptoJS.SHA3 }) /***/ }, /***/ 8122: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(2601), __webpack_require__(7991)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_x64 = C.x64 const X64Word = C_x64.Word const X64WordArray = C_x64.WordArray const C_algo = C.algo const SHA512 = C_algo.SHA512 /** * SHA-384 hash algorithm. */ const SHA384 = C_algo.SHA384 = SHA512.extend({ _doReset: function _doReset () { this._hash = new X64WordArray.init([new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)]) }, _doFinalize: function _doFinalize () { const hash = SHA512._doFinalize.call(this) hash.sigBytes -= 16 return hash } }) /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA384('message'); * var hash = CryptoJS.SHA384(wordArray); */ C.SHA384 = SHA512._createHelper(SHA384) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA384(message, key); */ C.HmacSHA384 = SHA512._createHmacHelper(SHA384) })() return CryptoJS.SHA384 }) /***/ }, /***/ 7991: /***/ function (module, exports, __webpack_require__) { 'use strict' ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(2601)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const Hasher = C_lib.Hasher const C_x64 = C.x64 const X64Word = C_x64.Word const X64WordArray = C_x64.WordArray const C_algo = C.algo function X64Word_create () { return X64Word.create.apply(X64Word, arguments) } // Constants const K = [X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)] // Reusable objects const W = []; (function () { for (let i = 0; i < 80; i++) { W[i] = X64Word_create() } })() /** * SHA-512 hash algorithm. */ const SHA512 = C_algo.SHA512 = Hasher.extend({ _doReset: function _doReset () { this._hash = new X64WordArray.init([new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)]) }, _doProcessBlock: function _doProcessBlock (M, offset) { // Shortcuts const H = this._hash.words const H0 = H[0] const H1 = H[1] const H2 = H[2] const H3 = H[3] const H4 = H[4] const H5 = H[5] const H6 = H[6] const H7 = H[7] const H0h = H0.high let H0l = H0.low const H1h = H1.high let H1l = H1.low const H2h = H2.high let H2l = H2.low const H3h = H3.high let H3l = H3.low const H4h = H4.high let H4l = H4.low const H5h = H5.high let H5l = H5.low const H6h = H6.high let H6l = H6.low const H7h = H7.high let H7l = H7.low // Working variables let ah = H0h let al = H0l let bh = H1h let bl = H1l let ch = H2h let cl = H2l let dh = H3h let dl = H3l let eh = H4h let el = H4l let fh = H5h let fl = H5l let gh = H6h let gl = H6l let hh = H7h let hl = H7l // Rounds for (let i = 0; i < 80; i++) { var Wil var Wih // Shortcut const Wi = W[i] // Extend message if (i < 16) { Wih = Wi.high = M[offset + i * 2] | 0 Wil = Wi.low = M[offset + i * 2 + 1] | 0 } else { // Gamma0 const gamma0x = W[i - 15] const gamma0xh = gamma0x.high const gamma0xl = gamma0x.low const gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7 const gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25) // Gamma1 const gamma1x = W[i - 2] const gamma1xh = gamma1x.high const gamma1xl = gamma1x.low const gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6 const gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26) // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] const Wi7 = W[i - 7] const Wi7h = Wi7.high const Wi7l = Wi7.low const Wi16 = W[i - 16] const Wi16h = Wi16.high const Wi16l = Wi16.low Wil = gamma0l + Wi7l Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0) Wil = Wil + gamma1l Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0) Wil = Wil + Wi16l Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0) Wi.high = Wih Wi.low = Wil } const chh = eh & fh ^ ~eh & gh const chl = el & fl ^ ~el & gl const majh = ah & bh ^ ah & ch ^ bh & ch const majl = al & bl ^ al & cl ^ bl & cl const sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7) const sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7) const sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9) const sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) // t1 = h + sigma1 + ch + K[i] + W[i] const Ki = K[i] const Kih = Ki.high const Kil = Ki.low var t1l = hl + sigma1l var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0) var t1l = t1l + chl var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0) var t1l = t1l + Kil var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0) var t1l = t1l + Wil var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0) // t2 = sigma0 + maj const t2l = sigma0l + majl const t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0) // Update working variables hh = gh hl = gl gh = fh gl = fl fh = eh fl = el el = dl + t1l | 0 eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0 dh = ch dl = cl ch = bh cl = bl bh = ah bl = al al = t1l + t2l | 0 ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0 } // Intermediate hash value H0l = H0.low = H0l + al H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0) H1l = H1.low = H1l + bl H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0) H2l = H2.low = H2l + cl H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0) H3l = H3.low = H3l + dl H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0) H4l = H4.low = H4l + el H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0) H5l = H5.low = H5l + fl H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0) H6l = H6.low = H6l + gl H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0) H7l = H7.low = H7l + hl H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0) }, _doFinalize: function _doFinalize () { // Shortcuts const data = this._data const dataWords = data.words const nBitsTotal = this._nDataBytes * 8 const nBitsLeft = data.sigBytes * 8 // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32 dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 0x100000000) dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal data.sigBytes = dataWords.length * 4 // Hash final blocks this._process() // Convert hash to 32-bit word array before returning const hash = this._hash.toX32() // Return final computed hash return hash }, clone: function clone () { const clone = Hasher.clone.call(this) clone._hash = this._hash.clone() return clone }, blockSize: 1024 / 32 }) /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA512('message'); * var hash = CryptoJS.SHA512(wordArray); */ C.SHA512 = Hasher._createHelper(SHA512) /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA512(message, key); */ C.HmacSHA512 = Hasher._createHmacHelper(SHA512) })() return CryptoJS.SHA512 }) /***/ }, /***/ 8437: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory, undef) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757), __webpack_require__(7508), __webpack_require__(3440), __webpack_require__(3839), __webpack_require__(1582)) } else {} })(void 0, function (CryptoJS) { (function () { // Shortcuts const C = CryptoJS const C_lib = C.lib const WordArray = C_lib.WordArray const BlockCipher = C_lib.BlockCipher const C_algo = C.algo // Permuted Choice 1 constants const PC1 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4] // Permuted Choice 2 constants const PC2 = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32] // Cumulative bit shift constants const BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28] // SBOXes and round permutation constants const SBOX_P = [{ 0x0: 0x808200, 0x10000000: 0x8000, 0x20000000: 0x808002, 0x30000000: 0x2, 0x40000000: 0x200, 0x50000000: 0x808202, 0x60000000: 0x800202, 0x70000000: 0x800000, 0x80000000: 0x202, 0x90000000: 0x800200, 0xa0000000: 0x8200, 0xb0000000: 0x808000, 0xc0000000: 0x8002, 0xd0000000: 0x800002, 0xe0000000: 0x0, 0xf0000000: 0x8202, 0x8000000: 0x0, 0x18000000: 0x808202, 0x28000000: 0x8202, 0x38000000: 0x8000, 0x48000000: 0x808200, 0x58000000: 0x200, 0x68000000: 0x808002, 0x78000000: 0x2, 0x88000000: 0x800200, 0x98000000: 0x8200, 0xa8000000: 0x808000, 0xb8000000: 0x800202, 0xc8000000: 0x800002, 0xd8000000: 0x8002, 0xe8000000: 0x202, 0xf8000000: 0x800000, 0x1: 0x8000, 0x10000001: 0x2, 0x20000001: 0x808200, 0x30000001: 0x800000, 0x40000001: 0x808002, 0x50000001: 0x8200, 0x60000001: 0x200, 0x70000001: 0x800202, 0x80000001: 0x808202, 0x90000001: 0x808000, 0xa0000001: 0x800002, 0xb0000001: 0x8202, 0xc0000001: 0x202, 0xd0000001: 0x800200, 0xe0000001: 0x8002, 0xf0000001: 0x0, 0x8000001: 0x808202, 0x18000001: 0x808000, 0x28000001: 0x800000, 0x38000001: 0x200, 0x48000001: 0x8000, 0x58000001: 0x800002, 0x68000001: 0x2, 0x78000001: 0x8202, 0x88000001: 0x8002, 0x98000001: 0x800202, 0xa8000001: 0x202, 0xb8000001: 0x808200, 0xc8000001: 0x800200, 0xd8000001: 0x0, 0xe8000001: 0x8200, 0xf8000001: 0x808002 }, { 0x0: 0x40084010, 0x1000000: 0x4000, 0x2000000: 0x80000, 0x3000000: 0x40080010, 0x4000000: 0x40000010, 0x5000000: 0x40084000, 0x6000000: 0x40004000, 0x7000000: 0x10, 0x8000000: 0x84000, 0x9000000: 0x40004010, 0xa000000: 0x40000000, 0xb000000: 0x84010, 0xc000000: 0x80010, 0xd000000: 0x0, 0xe000000: 0x4010, 0xf000000: 0x40080000, 0x800000: 0x40004000, 0x1800000: 0x84010, 0x2800000: 0x10, 0x3800000: 0x40004010, 0x4800000: 0x40084010, 0x5800000: 0x40000000, 0x6800000: 0x80000, 0x7800000: 0x40080010, 0x8800000: 0x80010, 0x9800000: 0x0, 0xa800000: 0x4000, 0xb800000: 0x40080000, 0xc800000: 0x40000010, 0xd800000: 0x84000, 0xe800000: 0x40084000, 0xf800000: 0x4010, 0x10000000: 0x0, 0x11000000: 0x40080010, 0x12000000: 0x40004010, 0x13000000: 0x40084000, 0x14000000: 0x40080000, 0x15000000: 0x10, 0x16000000: 0x84010, 0x17000000: 0x4000, 0x18000000: 0x4010, 0x19000000: 0x80000, 0x1a000000: 0x80010, 0x1b000000: 0x40000010, 0x1c000000: 0x84000, 0x1d000000: 0x40004000, 0x1e000000: 0x40000000, 0x1f000000: 0x40084010, 0x10800000: 0x84010, 0x11800000: 0x80000, 0x12800000: 0x40080000, 0x13800000: 0x4000, 0x14800000: 0x40004000, 0x15800000: 0x40084010, 0x16800000: 0x10, 0x17800000: 0x40000000, 0x18800000: 0x40084000, 0x19800000: 0x40000010, 0x1a800000: 0x40004010, 0x1b800000: 0x80010, 0x1c800000: 0x0, 0x1d800000: 0x4010, 0x1e800000: 0x40080010, 0x1f800000: 0x84000 }, { 0x0: 0x104, 0x100000: 0x0, 0x200000: 0x4000100, 0x300000: 0x10104, 0x400000: 0x10004, 0x500000: 0x4000004, 0x600000: 0x4010104, 0x700000: 0x4010000, 0x800000: 0x4000000, 0x900000: 0x4010100, 0xa00000: 0x10100, 0xb00000: 0x4010004, 0xc00000: 0x4000104, 0xd00000: 0x10000, 0xe00000: 0x4, 0xf00000: 0x100, 0x80000: 0x4010100, 0x180000: 0x4010004, 0x280000: 0x0, 0x380000: 0x4000100, 0x480000: 0x4000004, 0x580000: 0x10000, 0x680000: 0x10004, 0x780000: 0x104, 0x880000: 0x4, 0x980000: 0x100, 0xa80000: 0x4010000, 0xb80000: 0x10104, 0xc80000: 0x10100, 0xd80000: 0x4000104, 0xe80000: 0x4010104, 0xf80000: 0x4000000, 0x1000000: 0x4010100, 0x1100000: 0x10004, 0x1200000: 0x10000, 0x1300000: 0x4000100, 0x1400000: 0x100, 0x1500000: 0x4010104, 0x1600000: 0x4000004, 0x1700000: 0x0, 0x1800000: 0x4000104, 0x1900000: 0x4000000, 0x1a00000: 0x4, 0x1b00000: 0x10100, 0x1c00000: 0x4010000, 0x1d00000: 0x104, 0x1e00000: 0x10104, 0x1f00000: 0x4010004, 0x1080000: 0x4000000, 0x1180000: 0x104, 0x1280000: 0x4010100, 0x1380000: 0x0, 0x1480000: 0x10004, 0x1580000: 0x4000100, 0x1680000: 0x100, 0x1780000: 0x4010004, 0x1880000: 0x10000, 0x1980000: 0x4010104, 0x1a80000: 0x10104, 0x1b80000: 0x4000004, 0x1c80000: 0x4000104, 0x1d80000: 0x4010000, 0x1e80000: 0x4, 0x1f80000: 0x10100 }, { 0x0: 0x80401000, 0x10000: 0x80001040, 0x20000: 0x401040, 0x30000: 0x80400000, 0x40000: 0x0, 0x50000: 0x401000, 0x60000: 0x80000040, 0x70000: 0x400040, 0x80000: 0x80000000, 0x90000: 0x400000, 0xa0000: 0x40, 0xb0000: 0x80001000, 0xc0000: 0x80400040, 0xd0000: 0x1040, 0xe0000: 0x1000, 0xf0000: 0x80401040, 0x8000: 0x80001040, 0x18000: 0x40, 0x28000: 0x80400040, 0x38000: 0x80001000, 0x48000: 0x401000, 0x58000: 0x80401040, 0x68000: 0x0, 0x78000: 0x80400000, 0x88000: 0x1000, 0x98000: 0x80401000, 0xa8000: 0x400000, 0xb8000: 0x1040, 0xc8000: 0x80000000, 0xd8000: 0x400040, 0xe8000: 0x401040, 0xf8000: 0x80000040, 0x100000: 0x400040, 0x110000: 0x401000, 0x120000: 0x80000040, 0x130000: 0x0, 0x140000: 0x1040, 0x150000: 0x80400040, 0x160000: 0x80401000, 0x170000: 0x80001040, 0x180000: 0x80401040, 0x190000: 0x80000000, 0x1a0000: 0x80400000, 0x1b0000: 0x401040, 0x1c0000: 0x80001000, 0x1d0000: 0x400000, 0x1e0000: 0x40, 0x1f0000: 0x1000, 0x108000: 0x80400000, 0x118000: 0x80401040, 0x128000: 0x0, 0x138000: 0x401000, 0x148000: 0x400040, 0x158000: 0x80000000, 0x168000: 0x80001040, 0x178000: 0x40, 0x188000: 0x80000040, 0x198000: 0x1000, 0x1a8000: 0x80001000, 0x1b8000: 0x80400040, 0x1c8000: 0x1040, 0x1d8000: 0x80401000, 0x1e8000: 0x400000, 0x1f8000: 0x401040 }, { 0x0: 0x80, 0x1000: 0x1040000, 0x2000: 0x40000, 0x3000: 0x20000000, 0x4000: 0x20040080, 0x5000: 0x1000080, 0x6000: 0x21000080, 0x7000: 0x40080, 0x8000: 0x1000000, 0x9000: 0x20040000, 0xa000: 0x20000080, 0xb000: 0x21040080, 0xc000: 0x21040000, 0xd000: 0x0, 0xe000: 0x1040080, 0xf000: 0x21000000, 0x800: 0x1040080, 0x1800: 0x21000080, 0x2800: 0x80, 0x3800: 0x1040000, 0x4800: 0x40000, 0x5800: 0x20040080, 0x6800: 0x21040000, 0x7800: 0x20000000, 0x8800: 0x20040000, 0x9800: 0x0, 0xa800: 0x21040080, 0xb800: 0x1000080, 0xc800: 0x20000080, 0xd800: 0x21000000, 0xe800: 0x1000000, 0xf800: 0x40080, 0x10000: 0x40000, 0x11000: 0x80, 0x12000: 0x20000000, 0x13000: 0x21000080, 0x14000: 0x1000080, 0x15000: 0x21040000, 0x16000: 0x20040080, 0x17000: 0x1000000, 0x18000: 0x21040080, 0x19000: 0x21000000, 0x1a000: 0x1040000, 0x1b000: 0x20040000, 0x1c000: 0x40080, 0x1d000: 0x20000080, 0x1e000: 0x0, 0x1f000: 0x1040080, 0x10800: 0x21000080, 0x11800: 0x1000000, 0x12800: 0x1040000, 0x13800: 0x20040080, 0x14800: 0x20000000, 0x15800: 0x1040080, 0x16800: 0x80, 0x17800: 0x21040000, 0x18800: 0x40080, 0x19800: 0x21040080, 0x1a800: 0x0, 0x1b800: 0x21000000, 0x1c800: 0x1000080, 0x1d800: 0x40000, 0x1e800: 0x20040000, 0x1f800: 0x20000080 }, { 0x0: 0x10000008, 0x100: 0x2000, 0x200: 0x10200000, 0x300: 0x10202008, 0x400: 0x10002000, 0x500: 0x200000, 0x600: 0x200008, 0x700: 0x10000000, 0x800: 0x0, 0x900: 0x10002008, 0xa00: 0x202000, 0xb00: 0x8, 0xc00: 0x10200008, 0xd00: 0x202008, 0xe00: 0x2008, 0xf00: 0x10202000, 0x80: 0x10200000, 0x180: 0x10202008, 0x280: 0x8, 0x380: 0x200000, 0x480: 0x202008, 0x580: 0x10000008, 0x680: 0x10002000, 0x780: 0x2008, 0x880: 0x200008, 0x980: 0x2000, 0xa80: 0x10002008, 0xb80: 0x10200008, 0xc80: 0x0, 0xd80: 0x10202000, 0xe80: 0x202000, 0xf80: 0x10000000, 0x1000: 0x10002000, 0x1100: 0x10200008, 0x1200: 0x10202008, 0x1300: 0x2008, 0x1400: 0x200000, 0x1500: 0x10000000, 0x1600: 0x10000008, 0x1700: 0x202000, 0x1800: 0x202008, 0x1900: 0x0, 0x1a00: 0x8, 0x1b00: 0x10200000, 0x1c00: 0x2000, 0x1d00: 0x10002008, 0x1e00: 0x10202000, 0x1f00: 0x200008, 0x1080: 0x8, 0x1180: 0x202000, 0x1280: 0x200000, 0x1380: 0x10000008, 0x1480: 0x10002000, 0x1580: 0x2008, 0x1680: 0x10202008, 0x1780: 0x10200000, 0x1880: 0x10202000, 0x1980: 0x10200008, 0x1a80: 0x2000, 0x1b80: 0x202008, 0x1c80: 0x200008, 0x1d80: 0x0, 0x1e80: 0x10000000, 0x1f80: 0x10002008 }, { 0x0: 0x100000, 0x10: 0x2000401, 0x20: 0x400, 0x30: 0x100401, 0x40: 0x2100401, 0x50: 0x0, 0x60: 0x1, 0x70: 0x2100001, 0x80: 0x2000400, 0x90: 0x100001, 0xa0: 0x2000001, 0xb0: 0x2100400, 0xc0: 0x2100000, 0xd0: 0x401, 0xe0: 0x100400, 0xf0: 0x2000000, 0x8: 0x2100001, 0x18: 0x0, 0x28: 0x2000401, 0x38: 0x2100400, 0x48: 0x100000, 0x58: 0x2000001, 0x68: 0x2000000, 0x78: 0x401, 0x88: 0x100401, 0x98: 0x2000400, 0xa8: 0x2100000, 0xb8: 0x100001, 0xc8: 0x400, 0xd8: 0x2100401, 0xe8: 0x1, 0xf8: 0x100400, 0x100: 0x2000000, 0x110: 0x100000, 0x120: 0x2000401, 0x130: 0x2100001, 0x140: 0x100001, 0x150: 0x2000400, 0x160: 0x2100400, 0x170: 0x100401, 0x180: 0x401, 0x190: 0x2100401, 0x1a0: 0x100400, 0x1b0: 0x1, 0x1c0: 0x0, 0x1d0: 0x2100000, 0x1e0: 0x2000001, 0x1f0: 0x400, 0x108: 0x100400, 0x118: 0x2000401, 0x128: 0x2100001, 0x138: 0x1, 0x148: 0x2000000, 0x158: 0x100000, 0x168: 0x401, 0x178: 0x2100400, 0x188: 0x2000001, 0x198: 0x2100000, 0x1a8: 0x0, 0x1b8: 0x2100401, 0x1c8: 0x100401, 0x1d8: 0x400, 0x1e8: 0x2000400, 0x1f8: 0x100001 }, { 0x0: 0x8000820, 0x1: 0x20000, 0x2: 0x8000000, 0x3: 0x20, 0x4: 0x20020, 0x5: 0x8020820, 0x6: 0x8020800, 0x7: 0x800, 0x8: 0x8020000, 0x9: 0x8000800, 0xa: 0x20800, 0xb: 0x8020020, 0xc: 0x820, 0xd: 0x0, 0xe: 0x8000020, 0xf: 0x20820, 0x80000000: 0x800, 0x80000001: 0x8020820, 0x80000002: 0x8000820, 0x80000003: 0x8000000, 0x80000004: 0x8020000, 0x80000005: 0x20800, 0x80000006: 0x20820, 0x80000007: 0x20, 0x80000008: 0x8000020, 0x80000009: 0x820, 0x8000000a: 0x20020, 0x8000000b: 0x8020800, 0x8000000c: 0x0, 0x8000000d: 0x8020020, 0x8000000e: 0x8000800, 0x8000000f: 0x20000, 0x10: 0x20820, 0x11: 0x8020800, 0x12: 0x20, 0x13: 0x800, 0x14: 0x8000800, 0x15: 0x8000020, 0x16: 0x8020020, 0x17: 0x20000, 0x18: 0x0, 0x19: 0x20020, 0x1a: 0x8020000, 0x1b: 0x8000820, 0x1c: 0x8020820, 0x1d: 0x20800, 0x1e: 0x820, 0x1f: 0x8000000, 0x80000010: 0x20000, 0x80000011: 0x800, 0x80000012: 0x8020020, 0x80000013: 0x20820, 0x80000014: 0x20, 0x80000015: 0x8020000, 0x80000016: 0x8000000, 0x80000017: 0x8000820, 0x80000018: 0x8020820, 0x80000019: 0x8000020, 0x8000001a: 0x8000800, 0x8000001b: 0x0, 0x8000001c: 0x20800, 0x8000001d: 0x820, 0x8000001e: 0x20020, 0x8000001f: 0x8020800 }] // Masks that select the SBOX input const SBOX_MASK = [0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f] /** * DES block cipher algorithm. */ const DES = C_algo.DES = BlockCipher.extend({ _doReset: function _doReset () { // Shortcuts const key = this._key const keyWords = key.words // Select 56 bits according to PC1 const keyBits = [] for (var i = 0; i < 56; i++) { const keyBitPos = PC1[i] - 1 keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1 } // Assemble 16 subkeys const subKeys = this._subKeys = [] for (let nSubKey = 0; nSubKey < 16; nSubKey++) { // Create subkey const subKey = subKeys[nSubKey] = [] // Shortcut const bitShift = BIT_SHIFTS[nSubKey] // Select 48 bits according to PC2 for (var i = 0; i < 24; i++) { // Select from the left 28 key bits subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6 // Select from the right 28 key bits subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6 } // Since each subkey is applied to an expanded 32-bit input, // the subkey can be broken into 8 values scaled to 32-bits, // which allows the key to be used without expansion subKey[0] = subKey[0] << 1 | subKey[0] >>> 31 for (var i = 1; i < 7; i++) { subKey[i] = subKey[i] >>> (i - 1) * 4 + 3 } subKey[7] = subKey[7] << 5 | subKey[7] >>> 27 } // Compute inverse subkeys const invSubKeys = this._invSubKeys = [] for (var i = 0; i < 16; i++) { invSubKeys[i] = subKeys[15 - i] } }, encryptBlock: function encryptBlock (M, offset) { this._doCryptBlock(M, offset, this._subKeys) }, decryptBlock: function decryptBlock (M, offset) { this._doCryptBlock(M, offset, this._invSubKeys) }, _doCryptBlock: function _doCryptBlock (M, offset, subKeys) { // Get input this._lBlock = M[offset] this._rBlock = M[offset + 1] // Initial permutation exchangeLR.call(this, 4, 0x0f0f0f0f) exchangeLR.call(this, 16, 0x0000ffff) exchangeRL.call(this, 2, 0x33333333) exchangeRL.call(this, 8, 0x00ff00ff) exchangeLR.call(this, 1, 0x55555555) // Rounds for (let round = 0; round < 16; round++) { // Shortcuts const subKey = subKeys[round] const lBlock = this._lBlock const rBlock = this._rBlock // Feistel function let f = 0 for (let i = 0; i < 8; i++) { f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0] } this._lBlock = rBlock this._rBlock = lBlock ^ f } // Undo swap from last round const t = this._lBlock this._lBlock = this._rBlock this._rBlock = t // Final permutation exchangeLR.call(this, 1, 0x55555555) exchangeRL.call(this, 8, 0x00ff00ff) exchangeRL.call(this, 2, 0x33333333) exchangeLR.call(this, 16, 0x0000ffff) exchangeLR.call(this, 4, 0x0f0f0f0f) // Set output M[offset] = this._lBlock M[offset + 1] = this._rBlock }, keySize: 64 / 32, ivSize: 64 / 32, blockSize: 64 / 32 }) // Swap bits across the left and right words function exchangeLR (offset, mask) { const t = (this._lBlock >>> offset ^ this._rBlock) & mask this._rBlock ^= t this._lBlock ^= t << offset } function exchangeRL (offset, mask) { const t = (this._rBlock >>> offset ^ this._lBlock) & mask this._lBlock ^= t this._rBlock ^= t << offset } /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); */ C.DES = BlockCipher._createHelper(DES) /** * Triple-DES block cipher algorithm. */ const TripleDES = C_algo.TripleDES = BlockCipher.extend({ _doReset: function _doReset () { // Shortcuts const key = this._key const keyWords = key.words // Make sure the key length is valid (64, 128 or >= 192 bit) if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.') } // Extend the key according to the keying options defined in 3DES standard const key1 = keyWords.slice(0, 2) const key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4) const key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6) // Create DES instances this._des1 = DES.createEncryptor(WordArray.create(key1)) this._des2 = DES.createEncryptor(WordArray.create(key2)) this._des3 = DES.createEncryptor(WordArray.create(key3)) }, encryptBlock: function encryptBlock (M, offset) { this._des1.encryptBlock(M, offset) this._des2.decryptBlock(M, offset) this._des3.encryptBlock(M, offset) }, decryptBlock: function decryptBlock (M, offset) { this._des3.decryptBlock(M, offset) this._des2.encryptBlock(M, offset) this._des1.decryptBlock(M, offset) }, keySize: 192 / 32, ivSize: 64 / 32, blockSize: 64 / 32 }) /** * Shortcut functions to the cipher's object interface. * * @example * * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); */ C.TripleDES = BlockCipher._createHelper(TripleDES) })() return CryptoJS.TripleDES }) /***/ }, /***/ 2601: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(7042) ; (function (root, factory) { if (true) { // CommonJS module.exports = exports = factory(__webpack_require__(757)) } else {} })(void 0, function (CryptoJS) { (function (undefined) { // Shortcuts const C = CryptoJS const C_lib = C.lib const Base = C_lib.Base const X32WordArray = C_lib.WordArray /** * x64 namespace. */ const C_x64 = C.x64 = {} /** * A 64-bit word. */ const X64Word = C_x64.Word = Base.extend({ /** * Initializes a newly created 64-bit word. * * @param {number} high The high 32 bits. * @param {number} low The low 32 bits. * * @example * * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); */ init: function init (high, low) { this.high = high this.low = low } /** * Bitwise NOTs this word. * * @return {X64Word} A new x64-Word object after negating. * * @example * * var negated = x64Word.not(); */ // not: function () { // var high = ~this.high; // var low = ~this.low; // return X64Word.create(high, low); // }, /** * Bitwise ANDs this word with the passed word. * * @param {X64Word} word The x64-Word to AND with this word. * * @return {X64Word} A new x64-Word object after ANDing. * * @example * * var anded = x64Word.and(anotherX64Word); */ // and: function (word) { // var high = this.high & word.high; // var low = this.low & word.low; // return X64Word.create(high, low); // }, /** * Bitwise ORs this word with the passed word. * * @param {X64Word} word The x64-Word to OR with this word. * * @return {X64Word} A new x64-Word object after ORing. * * @example * * var ored = x64Word.or(anotherX64Word); */ // or: function (word) { // var high = this.high | word.high; // var low = this.low | word.low; // return X64Word.create(high, low); // }, /** * Bitwise XORs this word with the passed word. * * @param {X64Word} word The x64-Word to XOR with this word. * * @return {X64Word} A new x64-Word object after XORing. * * @example * * var xored = x64Word.xor(anotherX64Word); */ // xor: function (word) { // var high = this.high ^ word.high; // var low = this.low ^ word.low; // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the left. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftL(25); */ // shiftL: function (n) { // if (n < 32) { // var high = (this.high << n) | (this.low >>> (32 - n)); // var low = this.low << n; // } else { // var high = this.low << (n - 32); // var low = 0; // } // return X64Word.create(high, low); // }, /** * Shifts this word n bits to the right. * * @param {number} n The number of bits to shift. * * @return {X64Word} A new x64-Word object after shifting. * * @example * * var shifted = x64Word.shiftR(7); */ // shiftR: function (n) { // if (n < 32) { // var low = (this.low >>> n) | (this.high << (32 - n)); // var high = this.high >>> n; // } else { // var low = this.high >>> (n - 32); // var high = 0; // } // return X64Word.create(high, low); // }, /** * Rotates this word n bits to the left. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotL(25); */ // rotL: function (n) { // return this.shiftL(n).or(this.shiftR(64 - n)); // }, /** * Rotates this word n bits to the right. * * @param {number} n The number of bits to rotate. * * @return {X64Word} A new x64-Word object after rotating. * * @example * * var rotated = x64Word.rotR(7); */ // rotR: function (n) { // return this.shiftR(n).or(this.shiftL(64 - n)); // }, /** * Adds this word with the passed word. * * @param {X64Word} word The x64-Word to add with this word. * * @return {X64Word} A new x64-Word object after adding. * * @example * * var added = x64Word.add(anotherX64Word); */ // add: function (word) { // var low = (this.low + word.low) | 0; // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; // var high = (this.high + word.high + carry) | 0; // return X64Word.create(high, low); // } }) /** * An array of 64-bit words. * * @property {Array} words The array of CryptoJS.x64.Word objects. * @property {number} sigBytes The number of significant bytes in this word array. */ const X64WordArray = C_x64.WordArray = Base.extend({ /** * Initializes a newly created word array. * * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. * @param {number} sigBytes (Optional) The number of significant bytes in the words. * * @example * * var wordArray = CryptoJS.x64.WordArray.create(); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ]); * * var wordArray = CryptoJS.x64.WordArray.create([ * CryptoJS.x64.Word.create(0x00010203, 0x04050607), * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) * ], 10); */ init: function init (words, sigBytes) { words = this.words = words || [] if (sigBytes != undefined) { this.sigBytes = sigBytes } else { this.sigBytes = words.length * 8 } }, /** * Converts this 64-bit word array to a 32-bit word array. * * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. * * @example * * var x32WordArray = x64WordArray.toX32(); */ toX32: function toX32 () { // Shortcuts const x64Words = this.words const x64WordsLength = x64Words.length // Convert const x32Words = [] for (let i = 0; i < x64WordsLength; i++) { const x64Word = x64Words[i] x32Words.push(x64Word.high) x32Words.push(x64Word.low) } return X32WordArray.create(x32Words, this.sigBytes) }, /** * Creates a copy of this word array. * * @return {X64WordArray} The clone. * * @example * * var clone = x64WordArray.clone(); */ clone: function clone () { const clone = Base.clone.call(this) // Clone "words" array const words = clone.words = this.words.slice(0) // Clone each X64Word object const wordsLength = words.length for (let i = 0; i < wordsLength; i++) { words[i] = words[i].clone() } return clone } }) })() return CryptoJS }) /***/ }, /***/ 9811: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(8309) __webpack_require__(1038) __webpack_require__(5666) __webpack_require__(4916) __webpack_require__(4723) __webpack_require__(2165) __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(8783) __webpack_require__(3948) __webpack_require__(2526) __webpack_require__(1817) __webpack_require__(7042) function _createForOfIteratorHelperLoose (o, allowArrayLike) { let it = typeof Symbol !== 'undefined' && o[Symbol.iterator] || o['@@iterator']; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === 'number') { if (it) o = it; let i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] } } } throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.') } function _unsupportedIterableToArray (o, minLen) { if (!o) return; if (typeof o === 'string') return _arrayLikeToArray(o, minLen); let n = Object.prototype.toString.call(o).slice(8, -1); if (n === 'Object' && o.constructor) n = o.constructor.name; if (n === 'Map' || n === 'Set') return Array.from(o); if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen) } function _arrayLikeToArray (arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } const INITIAL_STATE = 1 const FAIL_STATE = 0 /** * A StateMachine represents a deterministic finite automaton. * It can perform matches over a sequence of values, similar to a regular expression. */ const StateMachine = /* #__PURE__ */(function () { function StateMachine (dfa) { this.stateTable = dfa.stateTable this.accepting = dfa.accepting this.tags = dfa.tags } /** * Returns an iterable object that yields pattern matches over the input sequence. * Matches are of the form [startIndex, endIndex, tags]. */ const _proto = StateMachine.prototype _proto.match = function match (str) { let _ref const self = this return _ref = {}, _ref[Symbol.iterator] = /* #__PURE__ */regeneratorRuntime.mark(function _callee () { let state, startRun, lastAccepting, lastState, p, c return regeneratorRuntime.wrap(function _callee$ (_context) { while (1) { switch (_context.prev = _context.next) { case 0: state = INITIAL_STATE startRun = null lastAccepting = null lastState = null p = 0 case 5: if (!(p < str.length)) { _context.next = 21 break } c = str[p] lastState = state state = self.stateTable[state][c] if (!(state === FAIL_STATE)) { _context.next = 15 break } if (!(startRun != null && lastAccepting != null && lastAccepting >= startRun)) { _context.next = 13 break } _context.next = 13 return [startRun, lastAccepting, self.tags[lastState]] case 13: // reset the state as if we started over from the initial state state = self.stateTable[INITIAL_STATE][c] startRun = null case 15: // start a run if not in the failure state if (state !== FAIL_STATE && startRun == null) { startRun = p } // if accepting, mark the potential match end if (self.accepting[state]) { lastAccepting = p } // reset the state to the initial state if we get into the failure state if (state === FAIL_STATE) { state = INITIAL_STATE } case 18: p++ _context.next = 5 break case 21: if (!(startRun != null && lastAccepting != null && lastAccepting >= startRun)) { _context.next = 24 break } _context.next = 24 return [startRun, lastAccepting, self.tags[state]] case 24: case 'end': return _context.stop() } } }, _callee) }), _ref } /** * For each match over the input sequence, action functions matching * the tag definitions in the input pattern are called with the startIndex, * endIndex, and sub-match sequence. */ _proto.apply = function apply (str, actions) { for (var _iterator = _createForOfIteratorHelperLoose(this.match(str)), _step; !(_step = _iterator()).done;) { const _step$value = _step.value const start = _step$value[0] const end = _step$value[1] const tags = _step$value[2] for (var _iterator2 = _createForOfIteratorHelperLoose(tags), _step2; !(_step2 = _iterator2()).done;) { const tag = _step2.value if (typeof actions[tag] === 'function') { actions[tag](start, end, str.slice(start, end + 1)) } } } } return StateMachine }()) module.exports = StateMachine /***/ }, /***/ 8478: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer __webpack_require__(7042) __webpack_require__(6699) /* * MIT LICENSE * Copyright (c) 2011 Devon Govett * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons * to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ const fs = __webpack_require__(3857) const zlib = __webpack_require__(2635) module.exports = /* #__PURE__ */(function () { PNG.decode = function decode (path, fn) { return fs.readFile(path, function (err, file) { const png = new PNG(file) return png.decode(function (pixels) { return fn(pixels) }) }) } PNG.load = function load (path) { const file = fs.readFileSync(path) return new PNG(file) } function PNG (data) { let i this.data = data this.pos = 8 // Skip the default header this.palette = [] this.imgData = [] this.transparency = {} this.text = {} while (true) { const chunkSize = this.readUInt32() let section = '' for (i = 0; i < 4; i++) { section += String.fromCharCode(this.data[this.pos++]) } switch (section) { case 'IHDR': // we can grab interesting values from here (like width, height, etc) this.width = this.readUInt32() this.height = this.readUInt32() this.bits = this.data[this.pos++] this.colorType = this.data[this.pos++] this.compressionMethod = this.data[this.pos++] this.filterMethod = this.data[this.pos++] this.interlaceMethod = this.data[this.pos++] break case 'PLTE': this.palette = this.read(chunkSize) break case 'IDAT': for (i = 0; i < chunkSize; i++) { this.imgData.push(this.data[this.pos++]) } break case 'tRNS': // This chunk can only occur once and it must occur after the // PLTE chunk and before the IDAT chunk. this.transparency = {} switch (this.colorType) { case 3: // Indexed color, RGB. Each byte in this chunk is an alpha for // the palette index in the PLTE ("palette") chunk up until the // last non-opaque entry. Set up an array, stretching over all // palette entries which will be 0 (opaque) or 1 (transparent). this.transparency.indexed = this.read(chunkSize) var short = 255 - this.transparency.indexed.length if (short > 0) { for (i = 0; i < short; i++) { this.transparency.indexed.push(255) } } break case 0: // Greyscale. Corresponding to entries in the PLTE chunk. // Grey is two bytes, range 0 .. (2 ^ bit-depth) - 1 this.transparency.grayscale = this.read(chunkSize)[0] break case 2: // True color with proper alpha channel. this.transparency.rgb = this.read(chunkSize) break } break case 'tEXt': var text = this.read(chunkSize) var index = text.indexOf(0) var key = String.fromCharCode.apply(String, text.slice(0, index)) this.text[key] = String.fromCharCode.apply(String, text.slice(index + 1)) break case 'IEND': // we've got everything we need! switch (this.colorType) { case 0: case 3: case 4: this.colors = 1 break case 2: case 6: this.colors = 3 break } this.hasAlphaChannel = [4, 6].includes(this.colorType) var colors = this.colors + (this.hasAlphaChannel ? 1 : 0) this.pixelBitlength = this.bits * colors switch (this.colors) { case 1: this.colorSpace = 'DeviceGray' break case 3: this.colorSpace = 'DeviceRGB' break } this.imgData = new Buffer(this.imgData) return break default: // unknown (or unimportant) section, skip it this.pos += chunkSize } this.pos += 4 // Skip the CRC if (this.pos > this.data.length) { throw new Error('Incomplete or corrupt PNG file') } } } const _proto = PNG.prototype _proto.read = function read (bytes) { const result = new Array(bytes) for (let i = 0; i < bytes; i++) { result[i] = this.data[this.pos++] } return result } _proto.readUInt32 = function readUInt32 () { const b1 = this.data[this.pos++] << 24 const b2 = this.data[this.pos++] << 16 const b3 = this.data[this.pos++] << 8 const b4 = this.data[this.pos++] return b1 | b2 | b3 | b4 } _proto.readUInt16 = function readUInt16 () { const b1 = this.data[this.pos++] << 8 const b2 = this.data[this.pos++] return b1 | b2 } _proto.decodePixels = function decodePixels (fn) { const _this = this return zlib.inflate(this.imgData, function (err, data) { if (err) { throw err } const width = _this.width const height = _this.height const pixelBytes = _this.pixelBitlength / 8 const pixels = new Buffer(width * height * pixelBytes) const length = data.length let pos = 0 function pass (x0, y0, dx, dy, singlePass) { if (singlePass === void 0) { singlePass = false } const w = Math.ceil((width - x0) / dx) const h = Math.ceil((height - y0) / dy) const scanlineLength = pixelBytes * w const buffer = singlePass ? pixels : new Buffer(scanlineLength * h) let row = 0 let c = 0 while (row < h && pos < length) { var byte, col, i, left, upper switch (data[pos++]) { case 0: // None for (i = 0; i < scanlineLength; i++) { buffer[c++] = data[pos++] } break case 1: // Sub for (i = 0; i < scanlineLength; i++) { byte = data[pos++] left = i < pixelBytes ? 0 : buffer[c - pixelBytes] buffer[c++] = (byte + left) % 256 } break case 2: // Up for (i = 0; i < scanlineLength; i++) { byte = data[pos++] col = (i - i % pixelBytes) / pixelBytes upper = row && buffer[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes] buffer[c++] = (upper + byte) % 256 } break case 3: // Average for (i = 0; i < scanlineLength; i++) { byte = data[pos++] col = (i - i % pixelBytes) / pixelBytes left = i < pixelBytes ? 0 : buffer[c - pixelBytes] upper = row && buffer[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes] buffer[c++] = (byte + Math.floor((left + upper) / 2)) % 256 } break case 4: // Paeth for (i = 0; i < scanlineLength; i++) { var paeth, upperLeft byte = data[pos++] col = (i - i % pixelBytes) / pixelBytes left = i < pixelBytes ? 0 : buffer[c - pixelBytes] if (row === 0) { upper = upperLeft = 0 } else { upper = buffer[(row - 1) * scanlineLength + col * pixelBytes + i % pixelBytes] upperLeft = col && buffer[(row - 1) * scanlineLength + (col - 1) * pixelBytes + i % pixelBytes] } const p = left + upper - upperLeft const pa = Math.abs(p - left) const pb = Math.abs(p - upper) const pc = Math.abs(p - upperLeft) if (pa <= pb && pa <= pc) { paeth = left } else if (pb <= pc) { paeth = upper } else { paeth = upperLeft } buffer[c++] = (byte + paeth) % 256 } break default: throw new Error('Invalid filter algorithm: ' + data[pos - 1]) } if (!singlePass) { let pixelsPos = ((y0 + row * dy) * width + x0) * pixelBytes let bufferPos = row * scanlineLength for (i = 0; i < w; i++) { for (let j = 0; j < pixelBytes; j++) { pixels[pixelsPos++] = buffer[bufferPos++] } pixelsPos += (dx - 1) * pixelBytes } } row++ } } if (_this.interlaceMethod === 1) { /* 1 6 4 6 2 6 4 6 7 7 7 7 7 7 7 7 5 6 5 6 5 6 5 6 7 7 7 7 7 7 7 7 3 6 4 6 3 6 4 6 7 7 7 7 7 7 7 7 5 6 5 6 5 6 5 6 7 7 7 7 7 7 7 7 */ pass(0, 0, 8, 8) // 1 pass(4, 0, 8, 8) // 2 pass(0, 4, 4, 8) // 3 pass(2, 0, 4, 4) // 4 pass(0, 2, 2, 4) // 5 pass(1, 0, 2, 2) // 6 pass(0, 1, 1, 2) // 7 } else { pass(0, 0, 1, 1, true) } return fn(pixels) }) } _proto.decodePalette = function decodePalette () { const palette = this.palette const length = palette.length const transparency = this.transparency.indexed || [] const ret = new Buffer(transparency.length + length) let pos = 0 let c = 0 for (let i = 0; i < length; i += 3) { var left ret[pos++] = palette[i] ret[pos++] = palette[i + 1] ret[pos++] = palette[i + 2] ret[pos++] = (left = transparency[c++]) != null ? left : 255 } return ret } _proto.copyToImageData = function copyToImageData (imageData, pixels) { let j, k let colors = this.colors let palette = null let alpha = this.hasAlphaChannel if (this.palette.length) { palette = this._decodedPalette || (this._decodedPalette = this.decodePalette()) colors = 4 alpha = true } const data = imageData.data || imageData const length = data.length const input = palette || pixels let i = j = 0 if (colors === 1) { while (i < length) { k = palette ? pixels[i / 4] * 4 : j const v = input[k++] data[i++] = v data[i++] = v data[i++] = v data[i++] = alpha ? input[k++] : 255 j = k } } else { while (i < length) { k = palette ? pixels[i / 4] * 4 : j data[i++] = input[k++] data[i++] = input[k++] data[i++] = input[k++] data[i++] = alpha ? input[k++] : 255 j = k } } } _proto.decode = function decode (fn) { const _this2 = this const ret = new Buffer(this.width * this.height * 4) return this.decodePixels(function (pixels) { _this2.copyToImageData(ret, pixels) return fn(ret) }) } return PNG }()) /***/ }, /***/ 1750: /***/ function (module, exports, __webpack_require__) { 'use strict' __webpack_require__(3290) /* eslint-disable node/no-deprecated-api */ const buffer = __webpack_require__(8823) const Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (const key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } const buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }, /***/ 7103: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* provided dependency */ const process = __webpack_require__(4155) /* eslint-disable node/no-deprecated-api */ __webpack_require__(8145) __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(2472) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(3290) const buffer = __webpack_require__(8823) const Buffer = buffer.Buffer const safer = {} let key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } const Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } const buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }, /***/ 3361: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(7941) __webpack_require__(2526) __webpack_require__(7327) __webpack_require__(1539) __webpack_require__(5003) __webpack_require__(4747) __webpack_require__(9337) __webpack_require__(7042) function ownKeys (object, enumerableOnly) { const keys = Object.keys(object) if (Object.getOwnPropertySymbols) { let symbols = Object.getOwnPropertySymbols(object) if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable }) } keys.push.apply(keys, symbols) } return keys } function _objectSpread (target) { for (let i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {} if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]) }) } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)) }) } } return target } function _defineProperty (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } function _classCallCheck (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function') } } function _defineProperties (target, props) { for (let i = 0; i < props.length; i++) { const descriptor = props[i] descriptor.enumerable = descriptor.enumerable || false descriptor.configurable = true if ('value' in descriptor) descriptor.writable = true Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass (Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps) if (staticProps) _defineProperties(Constructor, staticProps) return Constructor } const _require = __webpack_require__(8823) const Buffer = _require.Buffer const _require2 = __webpack_require__(9862) const inspect = _require2.inspect const custom = inspect && inspect.custom || 'inspect' function copyBuffer (src, target, offset) { Buffer.prototype.copy.call(src, target, offset) } module.exports = /* #__PURE__ */(function () { function BufferList () { _classCallCheck(this, BufferList) this.head = null this.tail = null this.length = 0 } _createClass(BufferList, [{ key: 'push', value: function push (v) { const entry = { data: v, next: null } if (this.length > 0) this.tail.next = entry; else this.head = entry this.tail = entry ++this.length } }, { key: 'unshift', value: function unshift (v) { const entry = { data: v, next: this.head } if (this.length === 0) this.tail = entry this.head = entry ++this.length } }, { key: 'shift', value: function shift () { if (this.length === 0) return const ret = this.head.data if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next --this.length return ret } }, { key: 'clear', value: function clear () { this.head = this.tail = null this.length = 0 } }, { key: 'join', value: function join (s) { if (this.length === 0) return '' let p = this.head let ret = '' + p.data while (p = p.next) { ret += s + p.data } return ret } }, { key: 'concat', value: function concat (n) { if (this.length === 0) return Buffer.alloc(0) const ret = Buffer.allocUnsafe(n >>> 0) let p = this.head let i = 0 while (p) { copyBuffer(p.data, ret, i) i += p.data.length p = p.next } return ret } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: 'consume', value: function consume (n, hasStrings) { let ret if (n < this.head.data.length) { // `slice` is the same for buffers and strings. ret = this.head.data.slice(0, n) this.head.data = this.head.data.slice(n) } else if (n === this.head.data.length) { // First chunk is a perfect match. ret = this.shift() } else { // Result spans more than one buffer. ret = hasStrings ? this._getString(n) : this._getBuffer(n) } return ret } }, { key: 'first', value: function first () { return this.head.data } // Consumes a specified amount of characters from the buffered data. }, { key: '_getString', value: function _getString (n) { let p = this.head let c = 1 let ret = p.data n -= ret.length while (p = p.next) { const str = p.data const nb = n > str.length ? str.length : n if (nb === str.length) ret += str; else ret += str.slice(0, n) n -= nb if (n === 0) { if (nb === str.length) { ++c if (p.next) this.head = p.next; else this.head = this.tail = null } else { this.head = p p.data = str.slice(nb) } break } ++c } this.length -= c return ret } // Consumes a specified amount of bytes from the buffered data. }, { key: '_getBuffer', value: function _getBuffer (n) { const ret = Buffer.allocUnsafe(n) let p = this.head let c = 1 p.data.copy(ret) n -= p.data.length while (p = p.next) { const buf = p.data const nb = n > buf.length ? buf.length : n buf.copy(ret, ret.length - n, 0, nb) n -= nb if (n === 0) { if (nb === buf.length) { ++c if (p.next) this.head = p.next; else this.head = this.tail = null } else { this.head = p p.data = buf.slice(nb) } break } ++c } this.length -= c return ret } // Make sure the linked list only shows the minimal necessary information. }, { key: custom, value: function value (_, options) { return inspect(this, _objectSpread({}, options, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: false })) } }]) return BufferList }()) /***/ }, /***/ 4872: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const __dirname = '/' /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer Object.defineProperty(exports, '__esModule', ({ value: true })) exports.default = void 0 __webpack_require__(7941) __webpack_require__(2526) __webpack_require__(7327) __webpack_require__(1539) __webpack_require__(5003) __webpack_require__(4747) __webpack_require__(9337) __webpack_require__(489) __webpack_require__(2419) __webpack_require__(1817) __webpack_require__(2165) __webpack_require__(6992) __webpack_require__(8783) __webpack_require__(3948) __webpack_require__(1038) __webpack_require__(7042) __webpack_require__(8309) __webpack_require__(4916) __webpack_require__(2707) __webpack_require__(2222) __webpack_require__(9600) __webpack_require__(9714) __webpack_require__(5306) __webpack_require__(1249) __webpack_require__(9841) __webpack_require__(4953) __webpack_require__(6977) __webpack_require__(6699) __webpack_require__(5192) __webpack_require__(9653) __webpack_require__(3123) __webpack_require__(4723) __webpack_require__(8734) __webpack_require__(2472) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(7803) __webpack_require__(3290) __webpack_require__(9601) __webpack_require__(3210) __webpack_require__(9254) __webpack_require__(7397) const _stream = _interopRequireDefault(__webpack_require__(2830)) const _zlib = _interopRequireDefault(__webpack_require__(2635)) const _cryptoJs = _interopRequireDefault(__webpack_require__(5153)) const _fontkit = _interopRequireDefault(__webpack_require__(1917)) const _events = __webpack_require__(7187) const _linebreak = _interopRequireDefault(__webpack_require__(7337)) const _pngJs = _interopRequireDefault(__webpack_require__(8478)) function _interopRequireDefault (obj) { return obj && obj.__esModule ? obj : { default: obj } } const fs = __webpack_require__(3857) function _classCallCheck (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function') } } function _defineProperties (target, props) { for (let i = 0; i < props.length; i++) { const descriptor = props[i] descriptor.enumerable = descriptor.enumerable || false descriptor.configurable = true if ('value' in descriptor) descriptor.writable = true Object.defineProperty(target, descriptor.key, descriptor) } } function _createClass (Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps) if (staticProps) _defineProperties(Constructor, staticProps) return Constructor } function _defineProperty (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }) } else { obj[key] = value } return obj } function ownKeys (object, enumerableOnly) { const keys = Object.keys(object) if (Object.getOwnPropertySymbols) { let symbols = Object.getOwnPropertySymbols(object) if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable }) } keys.push.apply(keys, symbols) } return keys } function _objectSpread2 (target) { for (let i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {} if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]) }) } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)) }) } } return target } function _inherits (subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function') } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }) if (superClass) _setPrototypeOf(subClass, superClass) } function _getPrototypeOf (o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf (o) { return o.__proto__ || Object.getPrototypeOf(o) } return _getPrototypeOf(o) } function _setPrototypeOf (o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf (o, p) { o.__proto__ = p return o } return _setPrototypeOf(o, p) } function _isNativeReflectConstruct () { if (typeof Reflect === 'undefined' || !Reflect.construct) return false if (Reflect.construct.sham) return false if (typeof Proxy === 'function') return true try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})) return true } catch (e) { return false } } function _assertThisInitialized (self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called") } return self } function _possibleConstructorReturn (self, call) { if (call && (typeof call === 'object' || typeof call === 'function')) { return call } return _assertThisInitialized(self) } function _createSuper (Derived) { const hasNativeReflectConstruct = _isNativeReflectConstruct() return function _createSuperInternal () { const Super = _getPrototypeOf(Derived) let result if (hasNativeReflectConstruct) { const NewTarget = _getPrototypeOf(this).constructor result = Reflect.construct(Super, arguments, NewTarget) } else { result = Super.apply(this, arguments) } return _possibleConstructorReturn(this, result) } } function _slicedToArray (arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest() } function _toConsumableArray (arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread() } function _arrayWithoutHoles (arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr) } function _arrayWithHoles (arr) { if (Array.isArray(arr)) return arr } function _iterableToArray (iter) { if (typeof Symbol !== 'undefined' && Symbol.iterator in Object(iter)) return Array.from(iter) } function _iterableToArrayLimit (arr, i) { if (typeof Symbol === 'undefined' || !(Symbol.iterator in Object(arr))) return const _arr = [] let _n = true let _d = false let _e try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value) if (i && _arr.length === i) break } } catch (err) { _d = true _e = err } finally { try { if (!_n && _i.return != null) _i.return() } finally { if (_d) throw _e } } return _arr } function _unsupportedIterableToArray (o, minLen) { if (!o) return if (typeof o === 'string') return _arrayLikeToArray(o, minLen) let n = Object.prototype.toString.call(o).slice(8, -1) if (n === 'Object' && o.constructor) n = o.constructor.name if (n === 'Map' || n === 'Set') return Array.from(o) if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen) } function _arrayLikeToArray (arr, len) { if (len == null || len > arr.length) len = arr.length for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i] } return arr2 } function _nonIterableSpread () { throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.') } function _nonIterableRest () { throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.') } function _createForOfIteratorHelper (o, allowArrayLike) { let it if (typeof Symbol === 'undefined' || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === 'number') { if (it) o = it let i = 0 const F = function F () {} return { s: F, n: function n () { if (i >= o.length) { return { done: true } } return { done: false, value: o[i++] } }, e: function e (_e2) { throw _e2 }, f: F } } throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.') } let normalCompletion = true let didErr = false let err return { s: function s () { it = o[Symbol.iterator]() }, n: function n () { const step = it.next() normalCompletion = step.done return step }, e: function e (_e3) { didErr = true err = _e3 }, f: function f () { try { if (!normalCompletion && it.return != null) it.return() } finally { if (didErr) throw err } } } } /* PDFAbstractReference - abstract class for PDF reference */ const PDFAbstractReference = /* #__PURE__ */(function () { function PDFAbstractReference () { _classCallCheck(this, PDFAbstractReference) } _createClass(PDFAbstractReference, [{ key: 'toString', value: function toString () { throw new Error('Must be implemented by subclasses') } }]) return PDFAbstractReference }()) const PDFTree = /* #__PURE__ */(function () { function PDFTree () { const options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} _classCallCheck(this, PDFTree) this._items = {} // disable /Limits output for this tree this.limits = typeof options.limits === 'boolean' ? options.limits : true } _createClass(PDFTree, [{ key: 'add', value: function add (key, val) { return this._items[key] = val } }, { key: 'get', value: function get (key) { return this._items[key] } }, { key: 'toString', value: function toString () { const _this = this // Needs to be sorted by key const sortedKeys = Object.keys(this._items).sort(function (a, b) { return _this._compareKeys(a, b) }) const out = ['<<'] if (this.limits && sortedKeys.length > 1) { const first = sortedKeys[0] const last = sortedKeys[sortedKeys.length - 1] out.push(' /Limits '.concat(PDFObject.convert([this._dataForKey(first), this._dataForKey(last)]))) } out.push(' /'.concat(this._keysName(), ' [')) const _iterator = _createForOfIteratorHelper(sortedKeys) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const key = _step.value out.push(' '.concat(PDFObject.convert(this._dataForKey(key)), ' ').concat(PDFObject.convert(this._items[key]))) } } catch (err) { _iterator.e(err) } finally { _iterator.f() } out.push(']') out.push('>>') return out.join('\n') } }, { key: '_compareKeys', value: function _compareKeys () /* a, b */ { throw new Error('Must be implemented by subclasses') } }, { key: '_keysName', value: function _keysName () { throw new Error('Must be implemented by subclasses') } }, { key: '_dataForKey', value: function _dataForKey () /* k */ { throw new Error('Must be implemented by subclasses') } }]) return PDFTree }()) const pad = function pad (str, length) { return (Array(length + 1).join('0') + str).slice(-length) } const escapableRe = /[\n\r\t\b\f()\\]/g const escapable = { '\n': '\\n', '\r': '\\r', '\t': '\\t', '\b': '\\b', '\f': '\\f', '\\': '\\\\', '(': '\\(', ')': '\\)' } // Convert little endian UTF-16 to big endian const swapBytes = function swapBytes (buff) { const l = buff.length if (l & 0x01) { throw new Error('Buffer length must be even') } else { for (let i = 0, end = l - 1; i < end; i += 2) { const a = buff[i] buff[i] = buff[i + 1] buff[i + 1] = a } } return buff } var PDFObject = /* #__PURE__ */(function () { function PDFObject () { _classCallCheck(this, PDFObject) } _createClass(PDFObject, null, [{ key: 'convert', value: function convert (object) { const encryptFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null // String literals are converted to the PDF name type if (typeof object === 'string') { return '/'.concat(object) // String objects are converted to PDF strings (UTF-16) } else if (object instanceof String) { let string = object // Detect if this is a unicode string let isUnicode = false for (let i = 0, end = string.length; i < end; i++) { if (string.charCodeAt(i) > 0x7f) { isUnicode = true break } } // If so, encode it as big endian UTF-16 let stringBuffer if (isUnicode) { stringBuffer = swapBytes(Buffer.from('\uFEFF'.concat(string), 'utf16le')) } else { stringBuffer = Buffer.from(string.valueOf(), 'ascii') } // Encrypt the string when necessary if (encryptFn) { string = encryptFn(stringBuffer).toString('binary') } else { string = stringBuffer.toString('binary') } // Escape characters as required by the spec string = string.replace(escapableRe, function (c) { return escapable[c] }) return '('.concat(string, ')') // Buffers are converted to PDF hex strings } else if (Buffer.isBuffer(object)) { return '<'.concat(object.toString('hex'), '>') } else if (object instanceof PDFAbstractReference || object instanceof PDFTree) { return object.toString() } else if (object instanceof Date) { let _string = 'D:'.concat(pad(object.getUTCFullYear(), 4)) + pad(object.getUTCMonth() + 1, 2) + pad(object.getUTCDate(), 2) + pad(object.getUTCHours(), 2) + pad(object.getUTCMinutes(), 2) + pad(object.getUTCSeconds(), 2) + 'Z' // Encrypt the string when necessary if (encryptFn) { _string = encryptFn(Buffer.from(_string, 'ascii')).toString('binary') // Escape characters as required by the spec _string = _string.replace(escapableRe, function (c) { return escapable[c] }) } return '('.concat(_string, ')') } else if (Array.isArray(object)) { const items = object.map(function (e) { return PDFObject.convert(e, encryptFn) }).join(' ') return '['.concat(items, ']') } else if ({}.toString.call(object) === '[object Object]') { const out = ['<<'] for (const key in object) { const val = object[key] out.push('/'.concat(key, ' ').concat(PDFObject.convert(val, encryptFn))) } out.push('>>') return out.join('\n') } else if (typeof object === 'number') { return PDFObject.number(object) } else { return ''.concat(object) } } }, { key: 'number', value: function number (n) { if (n > -1e21 && n < 1e21) { return Math.round(n * 1e6) / 1e6 } throw new Error('unsupported number: '.concat(n)) } }]) return PDFObject }()) const PDFReference = /* #__PURE__ */(function (_PDFAbstractReference) { _inherits(PDFReference, _PDFAbstractReference) const _super = _createSuper(PDFReference) function PDFReference (document, id) { let _this const data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {} _classCallCheck(this, PDFReference) _this = _super.call(this) _this.document = document _this.id = id _this.data = data _this.gen = 0 _this.compress = _this.document.compress && !_this.data.Filter _this.uncompressedLength = 0 _this.buffer = [] return _this } _createClass(PDFReference, [{ key: 'write', value: function write (chunk) { if (!Buffer.isBuffer(chunk)) { chunk = Buffer.from(chunk + '\n', 'binary') } this.uncompressedLength += chunk.length if (this.data.Length == null) { this.data.Length = 0 } this.buffer.push(chunk) this.data.Length += chunk.length if (this.compress) { return this.data.Filter = 'FlateDecode' } } }, { key: 'end', value: function end (chunk) { if (chunk) { this.write(chunk) } return this.finalize() } }, { key: 'finalize', value: function finalize () { this.offset = this.document._offset const encryptFn = this.document._security ? this.document._security.getEncryptFn(this.id, this.gen) : null if (this.buffer.length) { this.buffer = Buffer.concat(this.buffer) if (this.compress) { this.buffer = _zlib.default.deflateSync(this.buffer) } if (encryptFn) { this.buffer = encryptFn(this.buffer) } this.data.Length = this.buffer.length } this.document._write(''.concat(this.id, ' ').concat(this.gen, ' obj')) this.document._write(PDFObject.convert(this.data, encryptFn)) if (this.buffer.length) { this.document._write('stream') this.document._write(this.buffer) this.buffer = [] // free up memory this.document._write('\nendstream') } this.document._write('endobj') this.document._refEnd(this) } }, { key: 'toString', value: function toString () { return ''.concat(this.id, ' ').concat(this.gen, ' R') } }]) return PDFReference }(PDFAbstractReference)) /* PDFPage - represents a single page in the PDF document By Devon Govett */ const DEFAULT_MARGINS = { top: 72, left: 72, bottom: 72, right: 72 } const SIZES = { '4A0': [4767.87, 6740.79], '2A0': [3370.39, 4767.87], A0: [2383.94, 3370.39], A1: [1683.78, 2383.94], A2: [1190.55, 1683.78], A3: [841.89, 1190.55], A4: [595.28, 841.89], A5: [419.53, 595.28], A6: [297.64, 419.53], A7: [209.76, 297.64], A8: [147.4, 209.76], A9: [104.88, 147.4], A10: [73.7, 104.88], B0: [2834.65, 4008.19], B1: [2004.09, 2834.65], B2: [1417.32, 2004.09], B3: [1000.63, 1417.32], B4: [708.66, 1000.63], B5: [498.9, 708.66], B6: [354.33, 498.9], B7: [249.45, 354.33], B8: [175.75, 249.45], B9: [124.72, 175.75], B10: [87.87, 124.72], C0: [2599.37, 3676.54], C1: [1836.85, 2599.37], C2: [1298.27, 1836.85], C3: [918.43, 1298.27], C4: [649.13, 918.43], C5: [459.21, 649.13], C6: [323.15, 459.21], C7: [229.61, 323.15], C8: [161.57, 229.61], C9: [113.39, 161.57], C10: [79.37, 113.39], RA0: [2437.8, 3458.27], RA1: [1729.13, 2437.8], RA2: [1218.9, 1729.13], RA3: [864.57, 1218.9], RA4: [609.45, 864.57], SRA0: [2551.18, 3628.35], SRA1: [1814.17, 2551.18], SRA2: [1275.59, 1814.17], SRA3: [907.09, 1275.59], SRA4: [637.8, 907.09], EXECUTIVE: [521.86, 756.0], FOLIO: [612.0, 936.0], LEGAL: [612.0, 1008.0], LETTER: [612.0, 792.0], TABLOID: [792.0, 1224.0] } const PDFPage = /* #__PURE__ */(function () { function PDFPage (document) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} _classCallCheck(this, PDFPage) this.document = document this.size = options.size || 'letter' this.layout = options.layout || 'portrait' // process margins if (typeof options.margin === 'number') { this.margins = { top: options.margin, left: options.margin, bottom: options.margin, right: options.margin } // default to 1 inch margins } else { this.margins = options.margins || DEFAULT_MARGINS } // calculate page dimensions const dimensions = Array.isArray(this.size) ? this.size : SIZES[this.size.toUpperCase()] this.width = dimensions[this.layout === 'portrait' ? 0 : 1] this.height = dimensions[this.layout === 'portrait' ? 1 : 0] this.content = this.document.ref() // Initialize the Font, XObject, and ExtGState dictionaries this.resources = this.document.ref({ ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'] }) // The page dictionary this.dictionary = this.document.ref({ Type: 'Page', Parent: this.document._root.data.Pages, MediaBox: [0, 0, this.width, this.height], Contents: this.content, Resources: this.resources }) this.markings = [] } // Lazily create these objects _createClass(PDFPage, [{ key: 'maxY', value: function maxY () { return this.height - this.margins.bottom } }, { key: 'write', value: function write (chunk) { return this.content.write(chunk) } }, { key: 'end', value: function end () { this.dictionary.end() this.resources.end() return this.content.end() } }, { key: 'fonts', get: function get () { const data = this.resources.data return data.Font != null ? data.Font : data.Font = {} } }, { key: 'xobjects', get: function get () { const data = this.resources.data return data.XObject != null ? data.XObject : data.XObject = {} } }, { key: 'ext_gstates', get: function get () { const data = this.resources.data return data.ExtGState != null ? data.ExtGState : data.ExtGState = {} } }, { key: 'patterns', get: function get () { const data = this.resources.data return data.Pattern != null ? data.Pattern : data.Pattern = {} } }, { key: 'colorSpaces', get: function get () { const data = this.resources.data return data.ColorSpace || (data.ColorSpace = {}) } }, { key: 'annotations', get: function get () { const data = this.dictionary.data return data.Annots != null ? data.Annots : data.Annots = [] } }, { key: 'structParentTreeKey', get: function get () { const data = this.dictionary.data return data.StructParents != null ? data.StructParents : data.StructParents = this.document.createStructParentTreeNextKey() } }]) return PDFPage }()) const PDFNameTree = /* #__PURE__ */(function (_PDFTree) { _inherits(PDFNameTree, _PDFTree) const _super = _createSuper(PDFNameTree) function PDFNameTree () { _classCallCheck(this, PDFNameTree) return _super.apply(this, arguments) } _createClass(PDFNameTree, [{ key: '_compareKeys', value: function _compareKeys (a, b) { return a.localeCompare(b) } }, { key: '_keysName', value: function _keysName () { return 'Names' } }, { key: '_dataForKey', value: function _dataForKey (k) { return new String(k) } }]) return PDFNameTree }(PDFTree)) /** * Check if value is in a range group. * @param {number} value * @param {number[]} rangeGroup * @returns {boolean} */ function inRange (value, rangeGroup) { if (value < rangeGroup[0]) return false let startRange = 0 let endRange = rangeGroup.length / 2 while (startRange <= endRange) { const middleRange = Math.floor((startRange + endRange) / 2) // actual array index const arrayIndex = middleRange * 2 // Check if value is in range pointed by actual index if (value >= rangeGroup[arrayIndex] && value <= rangeGroup[arrayIndex + 1]) { return true } if (value > rangeGroup[arrayIndex + 1]) { // Search Right Side Of Array startRange = middleRange + 1 } else { // Search Left Side Of Array endRange = middleRange - 1 } } return false } /** * A.1 Unassigned code points in Unicode 3.2 * @link https://tools.ietf.org/html/rfc3454#appendix-A.1 */ const unassigned_code_points = [0x0221, 0x0221, 0x0234, 0x024f, 0x02ae, 0x02af, 0x02ef, 0x02ff, 0x0350, 0x035f, 0x0370, 0x0373, 0x0376, 0x0379, 0x037b, 0x037d, 0x037f, 0x0383, 0x038b, 0x038b, 0x038d, 0x038d, 0x03a2, 0x03a2, 0x03cf, 0x03cf, 0x03f7, 0x03ff, 0x0487, 0x0487, 0x04cf, 0x04cf, 0x04f6, 0x04f7, 0x04fa, 0x04ff, 0x0510, 0x0530, 0x0557, 0x0558, 0x0560, 0x0560, 0x0588, 0x0588, 0x058b, 0x0590, 0x05a2, 0x05a2, 0x05ba, 0x05ba, 0x05c5, 0x05cf, 0x05eb, 0x05ef, 0x05f5, 0x060b, 0x060d, 0x061a, 0x061c, 0x061e, 0x0620, 0x0620, 0x063b, 0x063f, 0x0656, 0x065f, 0x06ee, 0x06ef, 0x06ff, 0x06ff, 0x070e, 0x070e, 0x072d, 0x072f, 0x074b, 0x077f, 0x07b2, 0x0900, 0x0904, 0x0904, 0x093a, 0x093b, 0x094e, 0x094f, 0x0955, 0x0957, 0x0971, 0x0980, 0x0984, 0x0984, 0x098d, 0x098e, 0x0991, 0x0992, 0x09a9, 0x09a9, 0x09b1, 0x09b1, 0x09b3, 0x09b5, 0x09ba, 0x09bb, 0x09bd, 0x09bd, 0x09c5, 0x09c6, 0x09c9, 0x09ca, 0x09ce, 0x09d6, 0x09d8, 0x09db, 0x09de, 0x09de, 0x09e4, 0x09e5, 0x09fb, 0x0a01, 0x0a03, 0x0a04, 0x0a0b, 0x0a0e, 0x0a11, 0x0a12, 0x0a29, 0x0a29, 0x0a31, 0x0a31, 0x0a34, 0x0a34, 0x0a37, 0x0a37, 0x0a3a, 0x0a3b, 0x0a3d, 0x0a3d, 0x0a43, 0x0a46, 0x0a49, 0x0a4a, 0x0a4e, 0x0a58, 0x0a5d, 0x0a5d, 0x0a5f, 0x0a65, 0x0a75, 0x0a80, 0x0a84, 0x0a84, 0x0a8c, 0x0a8c, 0x0a8e, 0x0a8e, 0x0a92, 0x0a92, 0x0aa9, 0x0aa9, 0x0ab1, 0x0ab1, 0x0ab4, 0x0ab4, 0x0aba, 0x0abb, 0x0ac6, 0x0ac6, 0x0aca, 0x0aca, 0x0ace, 0x0acf, 0x0ad1, 0x0adf, 0x0ae1, 0x0ae5, 0x0af0, 0x0b00, 0x0b04, 0x0b04, 0x0b0d, 0x0b0e, 0x0b11, 0x0b12, 0x0b29, 0x0b29, 0x0b31, 0x0b31, 0x0b34, 0x0b35, 0x0b3a, 0x0b3b, 0x0b44, 0x0b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0df5, 0x0e00, 0x0e3b, 0x0e3e, 0x0e5c, 0x0e80, 0x0e83, 0x0e83, 0x0e85, 0x0e86, 0x0e89, 0x0e89, 0x0e8b, 0x0e8c, 0x0e8e, 0x0e93, 0x0e98, 0x0e98, 0x0ea0, 0x0ea0, 0x0ea4, 0x0ea4, 0x0ea6, 0x0ea6, 0x0ea8, 0x0ea9, 0x0eac, 0x0eac, 0x0eba, 0x0eba, 0x0ebe, 0x0ebf, 0x0ec5, 0x0ec5, 0x0ec7, 0x0ec7, 0x0ece, 0x0ecf, 0x0eda, 0x0edb, 0x0ede, 0x0eff, 0x0f48, 0x0f48, 0x0f6b, 0x0f70, 0x0f8c, 0x0f8f, 0x0f98, 0x0f98, 0x0fbd, 0x0fbd, 0x0fcd, 0x0fce, 0x0fd0, 0x0fff, 0x1022, 0x1022, 0x1028, 0x1028, 0x102b, 0x102b, 0x1033, 0x1035, 0x103a, 0x103f, 0x105a, 0x109f, 0x10c6, 0x10cf, 0x10f9, 0x10fa, 0x10fc, 0x10ff, 0x115a, 0x115e, 0x11a3, 0x11a7, 0x11fa, 0x11ff, 0x1207, 0x1207, 0x1247, 0x1247, 0x1249, 0x1249, 0x124e, 0x124f, 0x1257, 0x1257, 0x1259, 0x1259, 0x125e, 0x125f, 0x1287, 0x1287, 0x1289, 0x1289, 0x128e, 0x128f, 0x12af, 0x12af, 0x12b1, 0x12b1, 0x12b6, 0x12b7, 0x12bf, 0x12bf, 0x12c1, 0x12c1, 0x12c6, 0x12c7, 0x12cf, 0x12cf, 0x12d7, 0x12d7, 0x12ef, 0x12ef, 0x130f, 0x130f, 0x1311, 0x1311, 0x1316, 0x1317, 0x131f, 0x131f, 0x1347, 0x1347, 0x135b, 0x1360, 0x137d, 0x139f, 0x13f5, 0x1400, 0x1677, 0x167f, 0x169d, 0x169f, 0x16f1, 0x16ff, 0x170d, 0x170d, 0x1715, 0x171f, 0x1737, 0x173f, 0x1754, 0x175f, 0x176d, 0x176d, 0x1771, 0x1771, 0x1774, 0x177f, 0x17dd, 0x17df, 0x17ea, 0x17ff, 0x180f, 0x180f, 0x181a, 0x181f, 0x1878, 0x187f, 0x18aa, 0x1dff, 0x1e9c, 0x1e9f, 0x1efa, 0x1eff, 0x1f16, 0x1f17, 0x1f1e, 0x1f1f, 0x1f46, 0x1f47, 0x1f4e, 0x1f4f, 0x1f58, 0x1f58, 0x1f5a, 0x1f5a, 0x1f5c, 0x1f5c, 0x1f5e, 0x1f5e, 0x1f7e, 0x1f7f, 0x1fb5, 0x1fb5, 0x1fc5, 0x1fc5, 0x1fd4, 0x1fd5, 0x1fdc, 0x1fdc, 0x1ff0, 0x1ff1, 0x1ff5, 0x1ff5, 0x1fff, 0x1fff, 0x2053, 0x2056, 0x2058, 0x205e, 0x2064, 0x2069, 0x2072, 0x2073, 0x208f, 0x209f, 0x20b2, 0x20cf, 0x20eb, 0x20ff, 0x213b, 0x213c, 0x214c, 0x2152, 0x2184, 0x218f, 0x23cf, 0x23ff, 0x2427, 0x243f, 0x244b, 0x245f, 0x24ff, 0x24ff, 0x2614, 0x2615, 0x2618, 0x2618, 0x267e, 0x267f, 0x268a, 0x2700, 0x2705, 0x2705, 0x270a, 0x270b, 0x2728, 0x2728, 0x274c, 0x274c, 0x274e, 0x274e, 0x2753, 0x2755, 0x2757, 0x2757, 0x275f, 0x2760, 0x2795, 0x2797, 0x27b0, 0x27b0, 0x27bf, 0x27cf, 0x27ec, 0x27ef, 0x2b00, 0x2e7f, 0x2e9a, 0x2e9a, 0x2ef4, 0x2eff, 0x2fd6, 0x2fef, 0x2ffc, 0x2fff, 0x3040, 0x3040, 0x3097, 0x3098, 0x3100, 0x3104, 0x312d, 0x3130, 0x318f, 0x318f, 0x31b8, 0x31ef, 0x321d, 0x321f, 0x3244, 0x3250, 0x327c, 0x327e, 0x32cc, 0x32cf, 0x32ff, 0x32ff, 0x3377, 0x337a, 0x33de, 0x33df, 0x33ff, 0x33ff, 0x4db6, 0x4dff, 0x9fa6, 0x9fff, 0xa48d, 0xa48f, 0xa4c7, 0xabff, 0xd7a4, 0xd7ff, 0xfa2e, 0xfa2f, 0xfa6b, 0xfaff, 0xfb07, 0xfb12, 0xfb18, 0xfb1c, 0xfb37, 0xfb37, 0xfb3d, 0xfb3d, 0xfb3f, 0xfb3f, 0xfb42, 0xfb42, 0xfb45, 0xfb45, 0xfbb2, 0xfbd2, 0xfd40, 0xfd4f, 0xfd90, 0xfd91, 0xfdc8, 0xfdcf, 0xfdfd, 0xfdff, 0xfe10, 0xfe1f, 0xfe24, 0xfe2f, 0xfe47, 0xfe48, 0xfe53, 0xfe53, 0xfe67, 0xfe67, 0xfe6c, 0xfe6f, 0xfe75, 0xfe75, 0xfefd, 0xfefe, 0xff00, 0xff00, 0xffbf, 0xffc1, 0xffc8, 0xffc9, 0xffd0, 0xffd1, 0xffd8, 0xffd9, 0xffdd, 0xffdf, 0xffe7, 0xffe7, 0xffef, 0xfff8, 0x10000, 0x102ff, 0x1031f, 0x1031f, 0x10324, 0x1032f, 0x1034b, 0x103ff, 0x10426, 0x10427, 0x1044e, 0x1cfff, 0x1d0f6, 0x1d0ff, 0x1d127, 0x1d129, 0x1d1de, 0x1d3ff, 0x1d455, 0x1d455, 0x1d49d, 0x1d49d, 0x1d4a0, 0x1d4a1, 0x1d4a3, 0x1d4a4, 0x1d4a7, 0x1d4a8, 0x1d4ad, 0x1d4ad, 0x1d4ba, 0x1d4ba, 0x1d4bc, 0x1d4bc, 0x1d4c1, 0x1d4c1, 0x1d4c4, 0x1d4c4, 0x1d506, 0x1d506, 0x1d50b, 0x1d50c, 0x1d515, 0x1d515, 0x1d51d, 0x1d51d, 0x1d53a, 0x1d53a, 0x1d53f, 0x1d53f, 0x1d545, 0x1d545, 0x1d547, 0x1d549, 0x1d551, 0x1d551, 0x1d6a4, 0x1d6a7, 0x1d7ca, 0x1d7cd, 0x1d800, 0x1fffd, 0x2a6d7, 0x2f7ff, 0x2fa1e, 0x2fffd, 0x30000, 0x3fffd, 0x40000, 0x4fffd, 0x50000, 0x5fffd, 0x60000, 0x6fffd, 0x70000, 0x7fffd, 0x80000, 0x8fffd, 0x90000, 0x9fffd, 0xa0000, 0xafffd, 0xb0000, 0xbfffd, 0xc0000, 0xcfffd, 0xd0000, 0xdfffd, 0xe0000, 0xe0000, 0xe0002, 0xe001f, 0xe0080, 0xefffd] // prettier-ignore-end const isUnassignedCodePoint = function isUnassignedCodePoint (character) { return inRange(character, unassigned_code_points) } // prettier-ignore-start /** * B.1 Commonly mapped to nothing * @link https://tools.ietf.org/html/rfc3454#appendix-B.1 */ const commonly_mapped_to_nothing = [0x00ad, 0x00ad, 0x034f, 0x034f, 0x1806, 0x1806, 0x180b, 0x180b, 0x180c, 0x180c, 0x180d, 0x180d, 0x200b, 0x200b, 0x200c, 0x200c, 0x200d, 0x200d, 0x2060, 0x2060, 0xfe00, 0xfe00, 0xfe01, 0xfe01, 0xfe02, 0xfe02, 0xfe03, 0xfe03, 0xfe04, 0xfe04, 0xfe05, 0xfe05, 0xfe06, 0xfe06, 0xfe07, 0xfe07, 0xfe08, 0xfe08, 0xfe09, 0xfe09, 0xfe0a, 0xfe0a, 0xfe0b, 0xfe0b, 0xfe0c, 0xfe0c, 0xfe0d, 0xfe0d, 0xfe0e, 0xfe0e, 0xfe0f, 0xfe0f, 0xfeff, 0xfeff] // prettier-ignore-end const isCommonlyMappedToNothing = function isCommonlyMappedToNothing (character) { return inRange(character, commonly_mapped_to_nothing) } // prettier-ignore-start /** * C.1.2 Non-ASCII space characters * @link https://tools.ietf.org/html/rfc3454#appendix-C.1.2 */ const non_ASCII_space_characters = [0x00a0, 0x00a0, /* NO-BREAK SPACE */ 0x1680, 0x1680, /* OGHAM SPACE MARK */ 0x2000, 0x2000, /* EN QUAD */ 0x2001, 0x2001, /* EM QUAD */ 0x2002, 0x2002, /* EN SPACE */ 0x2003, 0x2003, /* EM SPACE */ 0x2004, 0x2004, /* THREE-PER-EM SPACE */ 0x2005, 0x2005, /* FOUR-PER-EM SPACE */ 0x2006, 0x2006, /* SIX-PER-EM SPACE */ 0x2007, 0x2007, /* FIGURE SPACE */ 0x2008, 0x2008, /* PUNCTUATION SPACE */ 0x2009, 0x2009, /* THIN SPACE */ 0x200a, 0x200a, /* HAIR SPACE */ 0x200b, 0x200b, /* ZERO WIDTH SPACE */ 0x202f, 0x202f, /* NARROW NO-BREAK SPACE */ 0x205f, 0x205f, /* MEDIUM MATHEMATICAL SPACE */ 0x3000, 0x3000 /* IDEOGRAPHIC SPACE */ ] // prettier-ignore-end const isNonASCIISpaceCharacter = function isNonASCIISpaceCharacter (character) { return inRange(character, non_ASCII_space_characters) } // prettier-ignore-start const non_ASCII_controls_characters = [ /** * C.2.2 Non-ASCII control characters * @link https://tools.ietf.org/html/rfc3454#appendix-C.2.2 */ 0x0080, 0x009f, /* [CONTROL CHARACTERS] */ 0x06dd, 0x06dd, /* ARABIC END OF AYAH */ 0x070f, 0x070f, /* SYRIAC ABBREVIATION MARK */ 0x180e, 0x180e, /* MONGOLIAN VOWEL SEPARATOR */ 0x200c, 0x200c, /* ZERO WIDTH NON-JOINER */ 0x200d, 0x200d, /* ZERO WIDTH JOINER */ 0x2028, 0x2028, /* LINE SEPARATOR */ 0x2029, 0x2029, /* PARAGRAPH SEPARATOR */ 0x2060, 0x2060, /* WORD JOINER */ 0x2061, 0x2061, /* FUNCTION APPLICATION */ 0x2062, 0x2062, /* INVISIBLE TIMES */ 0x2063, 0x2063, /* INVISIBLE SEPARATOR */ 0x206a, 0x206f, /* [CONTROL CHARACTERS] */ 0xfeff, 0xfeff, /* ZERO WIDTH NO-BREAK SPACE */ 0xfff9, 0xfffc, /* [CONTROL CHARACTERS] */ 0x1d173, 0x1d17a /* [MUSICAL CONTROL CHARACTERS] */ ] const non_character_codepoints = [ /** * C.4 Non-character code points * @link https://tools.ietf.org/html/rfc3454#appendix-C.4 */ 0xfdd0, 0xfdef, /* [NONCHARACTER CODE POINTS] */ 0xfffe, 0xffff, /* [NONCHARACTER CODE POINTS] */ 0x1fffe, 0x1ffff, /* [NONCHARACTER CODE POINTS] */ 0x2fffe, 0x2ffff, /* [NONCHARACTER CODE POINTS] */ 0x3fffe, 0x3ffff, /* [NONCHARACTER CODE POINTS] */ 0x4fffe, 0x4ffff, /* [NONCHARACTER CODE POINTS] */ 0x5fffe, 0x5ffff, /* [NONCHARACTER CODE POINTS] */ 0x6fffe, 0x6ffff, /* [NONCHARACTER CODE POINTS] */ 0x7fffe, 0x7ffff, /* [NONCHARACTER CODE POINTS] */ 0x8fffe, 0x8ffff, /* [NONCHARACTER CODE POINTS] */ 0x9fffe, 0x9ffff, /* [NONCHARACTER CODE POINTS] */ 0xafffe, 0xaffff, /* [NONCHARACTER CODE POINTS] */ 0xbfffe, 0xbffff, /* [NONCHARACTER CODE POINTS] */ 0xcfffe, 0xcffff, /* [NONCHARACTER CODE POINTS] */ 0xdfffe, 0xdffff, /* [NONCHARACTER CODE POINTS] */ 0xefffe, 0xeffff, /* [NONCHARACTER CODE POINTS] */ 0x10fffe, 0x10ffff /* [NONCHARACTER CODE POINTS] */ ] /** * 2.3. Prohibited Output */ const prohibited_characters = [ /** * C.2.1 ASCII control characters * @link https://tools.ietf.org/html/rfc3454#appendix-C.2.1 */ 0, 0x001f, /* [CONTROL CHARACTERS] */ 0x007f, 0x007f, /* DELETE */ /** * C.8 Change display properties or are deprecated * @link https://tools.ietf.org/html/rfc3454#appendix-C.8 */ 0x0340, 0x0340, /* COMBINING GRAVE TONE MARK */ 0x0341, 0x0341, /* COMBINING ACUTE TONE MARK */ 0x200e, 0x200e, /* LEFT-TO-RIGHT MARK */ 0x200f, 0x200f, /* RIGHT-TO-LEFT MARK */ 0x202a, 0x202a, /* LEFT-TO-RIGHT EMBEDDING */ 0x202b, 0x202b, /* RIGHT-TO-LEFT EMBEDDING */ 0x202c, 0x202c, /* POP DIRECTIONAL FORMATTING */ 0x202d, 0x202d, /* LEFT-TO-RIGHT OVERRIDE */ 0x202e, 0x202e, /* RIGHT-TO-LEFT OVERRIDE */ 0x206a, 0x206a, /* INHIBIT SYMMETRIC SWAPPING */ 0x206b, 0x206b, /* ACTIVATE SYMMETRIC SWAPPING */ 0x206c, 0x206c, /* INHIBIT ARABIC FORM SHAPING */ 0x206d, 0x206d, /* ACTIVATE ARABIC FORM SHAPING */ 0x206e, 0x206e, /* NATIONAL DIGIT SHAPES */ 0x206f, 0x206f, /* NOMINAL DIGIT SHAPES */ /** * C.7 Inappropriate for canonical representation * @link https://tools.ietf.org/html/rfc3454#appendix-C.7 */ 0x2ff0, 0x2ffb, /* [IDEOGRAPHIC DESCRIPTION CHARACTERS] */ /** * C.5 Surrogate codes * @link https://tools.ietf.org/html/rfc3454#appendix-C.5 */ 0xd800, 0xdfff, /** * C.3 Private use * @link https://tools.ietf.org/html/rfc3454#appendix-C.3 */ 0xe000, 0xf8ff, /* [PRIVATE USE, PLANE 0] */ /** * C.6 Inappropriate for plain text * @link https://tools.ietf.org/html/rfc3454#appendix-C.6 */ 0xfff9, 0xfff9, /* INTERLINEAR ANNOTATION ANCHOR */ 0xfffa, 0xfffa, /* INTERLINEAR ANNOTATION SEPARATOR */ 0xfffb, 0xfffb, /* INTERLINEAR ANNOTATION TERMINATOR */ 0xfffc, 0xfffc, /* OBJECT REPLACEMENT CHARACTER */ 0xfffd, 0xfffd, /* REPLACEMENT CHARACTER */ /** * C.9 Tagging characters * @link https://tools.ietf.org/html/rfc3454#appendix-C.9 */ 0xe0001, 0xe0001, /* LANGUAGE TAG */ 0xe0020, 0xe007f, /* [TAGGING CHARACTERS] */ /** * C.3 Private use * @link https://tools.ietf.org/html/rfc3454#appendix-C.3 */ 0xf0000, 0xffffd, /* [PRIVATE USE, PLANE 15] */ 0x100000, 0x10fffd /* [PRIVATE USE, PLANE 16] */ ] // prettier-ignore-end const isProhibitedCharacter = function isProhibitedCharacter (character) { return inRange(character, non_ASCII_space_characters) || inRange(character, prohibited_characters) || inRange(character, non_ASCII_controls_characters) || inRange(character, non_character_codepoints) } // prettier-ignore-start /** * D.1 Characters with bidirectional property "R" or "AL" * @link https://tools.ietf.org/html/rfc3454#appendix-D.1 */ const bidirectional_r_al = [0x05be, 0x05be, 0x05c0, 0x05c0, 0x05c3, 0x05c3, 0x05d0, 0x05ea, 0x05f0, 0x05f4, 0x061b, 0x061b, 0x061f, 0x061f, 0x0621, 0x063a, 0x0640, 0x064a, 0x066d, 0x066f, 0x0671, 0x06d5, 0x06dd, 0x06dd, 0x06e5, 0x06e6, 0x06fa, 0x06fe, 0x0700, 0x070d, 0x0710, 0x0710, 0x0712, 0x072c, 0x0780, 0x07a5, 0x07b1, 0x07b1, 0x200f, 0x200f, 0xfb1d, 0xfb1d, 0xfb1f, 0xfb28, 0xfb2a, 0xfb36, 0xfb38, 0xfb3c, 0xfb3e, 0xfb3e, 0xfb40, 0xfb41, 0xfb43, 0xfb44, 0xfb46, 0xfbb1, 0xfbd3, 0xfd3d, 0xfd50, 0xfd8f, 0xfd92, 0xfdc7, 0xfdf0, 0xfdfc, 0xfe70, 0xfe74, 0xfe76, 0xfefc] // prettier-ignore-end const isBidirectionalRAL = function isBidirectionalRAL (character) { return inRange(character, bidirectional_r_al) } // prettier-ignore-start /** * D.2 Characters with bidirectional property "L" * @link https://tools.ietf.org/html/rfc3454#appendix-D.2 */ const bidirectional_l = [0x0041, 0x005a, 0x0061, 0x007a, 0x00aa, 0x00aa, 0x00b5, 0x00b5, 0x00ba, 0x00ba, 0x00c0, 0x00d6, 0x00d8, 0x00f6, 0x00f8, 0x0220, 0x0222, 0x0233, 0x0250, 0x02ad, 0x02b0, 0x02b8, 0x02bb, 0x02c1, 0x02d0, 0x02d1, 0x02e0, 0x02e4, 0x02ee, 0x02ee, 0x037a, 0x037a, 0x0386, 0x0386, 0x0388, 0x038a, 0x038c, 0x038c, 0x038e, 0x03a1, 0x03a3, 0x03ce, 0x03d0, 0x03f5, 0x0400, 0x0482, 0x048a, 0x04ce, 0x04d0, 0x04f5, 0x04f8, 0x04f9, 0x0500, 0x050f, 0x0531, 0x0556, 0x0559, 0x055f, 0x0561, 0x0587, 0x0589, 0x0589, 0x0903, 0x0903, 0x0905, 0x0939, 0x093d, 0x0940, 0x0949, 0x094c, 0x0950, 0x0950, 0x0958, 0x0961, 0x0964, 0x0970, 0x0982, 0x0983, 0x0985, 0x098c, 0x098f, 0x0990, 0x0993, 0x09a8, 0x09aa, 0x09b0, 0x09b2, 0x09b2, 0x09b6, 0x09b9, 0x09be, 0x09c0, 0x09c7, 0x09c8, 0x09cb, 0x09cc, 0x09d7, 0x09d7, 0x09dc, 0x09dd, 0x09df, 0x09e1, 0x09e6, 0x09f1, 0x09f4, 0x09fa, 0x0a05, 0x0a0a, 0x0a0f, 0x0a10, 0x0a13, 0x0a28, 0x0a2a, 0x0a30, 0x0a32, 0x0a33, 0x0a35, 0x0a36, 0x0a38, 0x0a39, 0x0a3e, 0x0a40, 0x0a59, 0x0a5c, 0x0a5e, 0x0a5e, 0x0a66, 0x0a6f, 0x0a72, 0x0a74, 0x0a83, 0x0a83, 0x0a85, 0x0a8b, 0x0a8d, 0x0a8d, 0x0a8f, 0x0a91, 0x0a93, 0x0aa8, 0x0aaa, 0x0ab0, 0x0ab2, 0x0ab3, 0x0ab5, 0x0ab9, 0x0abd, 0x0ac0, 0x0ac9, 0x0ac9, 0x0acb, 0x0acc, 0x0ad0, 0x0ad0, 0x0ae0, 0x0ae0, 0x0ae6, 0x0aef, 0x0b02, 0x0b03, 0x0b05, 0x0b0c, 0x0b0f, 0x0b10, 0x0b13, 0x0b28, 0x0b2a, 0x0b30, 0x0b32, 0x0b33, 0x0b36, 0x0b39, 0x0b3d, 0x0b3e, 0x0b40, 0x0b40, 0x0b47, 0x0b48, 0x0b4b, 0x0b4c, 0x0b57, 0x0b57, 0x0b5c, 0x0b5d, 0x0b5f, 0x0b61, 0x0b66, 0x0b70, 0x0b83, 0x0b83, 0x0b85, 0x0b8a, 0x0b8e, 0x0b90, 0x0b92, 0x0b95, 0x0b99, 0x0b9a, 0x0b9c, 0x0b9c, 0x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aa, 0x0eab, 0x0ead, 0x0eb0, 0x0eb2, 0x0eb3, 0x0ebd, 0x0ebd, 0x0ec0, 0x0ec4, 0x0ec6, 0x0ec6, 0x0ed0, 0x0ed9, 0x0edc, 0x0edd, 0x0f00, 0x0f17, 0x0f1a, 0x0f34, 0x0f36, 0x0f36, 0x0f38, 0x0f38, 0x0f3e, 0x0f47, 0x0f49, 0x0f6a, 0x0f7f, 0x0f7f, 0x0f85, 0x0f85, 0x0f88, 0x0f8b, 0x0fbe, 0x0fc5, 0x0fc7, 0x0fcc, 0x0fcf, 0x0fcf, 0x1000, 0x1021, 0x1023, 0x1027, 0x1029, 0x102a, 0x102c, 0x102c, 0x1031, 0x1031, 0x1038, 0x1038, 0x1040, 0x1057, 0x10a0, 0x10c5, 0x10d0, 0x10f8, 0x10fb, 0x10fb, 0x1100, 0x1159, 0x115f, 0x11a2, 0x11a8, 0x11f9, 0x1200, 0x1206, 0x1208, 0x1246, 0x1248, 0x1248, 0x124a, 0x124d, 0x1250, 0x1256, 0x1258, 0x1258, 0x125a, 0x125d, 0x1260, 0x1286, 0x1288, 0x1288, 0x128a, 0x128d, 0x1290, 0x12ae, 0x12b0, 0x12b0, 0x12b2, 0x12b5, 0x12b8, 0x12be, 0x12c0, 0x12c0, 0x12c2, 0x12c5, 0x12c8, 0x12ce, 0x12d0, 0x12d6, 0x12d8, 0x12ee, 0x12f0, 0x130e, 0x1310, 0x1310, 0x1312, 0x1315, 0x1318, 0x131e, 0x1320, 0x1346, 0x1348, 0x135a, 0x1361, 0x137c, 0x13a0, 0x13f4, 0x1401, 0x1676, 0x1681, 0x169a, 0x16a0, 0x16f0, 0x1700, 0x170c, 0x170e, 0x1711, 0x1720, 0x1731, 0x1735, 0x1736, 0x1740, 0x1751, 0x1760, 0x176c, 0x176e, 0x1770, 0x1780, 0x17b6, 0x17be, 0x17c5, 0x17c7, 0x17c8, 0x17d4, 0x17da, 0x17dc, 0x17dc, 0x17e0, 0x17e9, 0x1810, 0x1819, 0x1820, 0x1877, 0x1880, 0x18a8, 0x1e00, 0x1e9b, 0x1ea0, 0x1ef9, 0x1f00, 0x1f15, 0x1f18, 0x1f1d, 0x1f20, 0x1f45, 0x1f48, 0x1f4d, 0x1f50, 0x1f57, 0x1f59, 0x1f59, 0x1f5b, 0x1f5b, 0x1f5d, 0x1f5d, 0x1f5f, 0x1f7d, 0x1f80, 0x1fb4, 0x1fb6, 0x1fbc, 0x1fbe, 0x1fbe, 0x1fc2, 0x1fc4, 0x1fc6, 0x1fcc, 0x1fd0, 0x1fd3, 0x1fd6, 0x1fdb, 0x1fe0, 0x1fec, 0x1ff2, 0x1ff4, 0x1ff6, 0x1ffc, 0x200e, 0x200e, 0x2071, 0x2071, 0x207f, 0x207f, 0x2102, 0x2102, 0x2107, 0x2107, 0x210a, 0x2113, 0x2115, 0x2115, 0x2119, 0x211d, 0x2124, 0x2124, 0x2126, 0x2126, 0x2128, 0x2128, 0x212a, 0x212d, 0x212f, 0x2131, 0x2133, 0x2139, 0x213d, 0x213f, 0x2145, 0x2149, 0x2160, 0x2183, 0x2336, 0x237a, 0x2395, 0x2395, 0x249c, 0x24e9, 0x3005, 0x3007, 0x3021, 0x3029, 0x3031, 0x3035, 0x3038, 0x303c, 0x3041, 0x3096, 0x309d, 0x309f, 0x30a1, 0x30fa, 0x30fc, 0x30ff, 0x3105, 0x312c, 0x3131, 0x318e, 0x3190, 0x31b7, 0x31f0, 0x321c, 0x3220, 0x3243, 0x3260, 0x327b, 0x327f, 0x32b0, 0x32c0, 0x32cb, 0x32d0, 0x32fe, 0x3300, 0x3376, 0x337b, 0x33dd, 0x33e0, 0x33fe, 0x3400, 0x4db5, 0x4e00, 0x9fa5, 0xa000, 0xa48c, 0xac00, 0xd7a3, 0xd800, 0xfa2d, 0xfa30, 0xfa6a, 0xfb00, 0xfb06, 0xfb13, 0xfb17, 0xff21, 0xff3a, 0xff41, 0xff5a, 0xff66, 0xffbe, 0xffc2, 0xffc7, 0xffca, 0xffcf, 0xffd2, 0xffd7, 0xffda, 0xffdc, 0x10300, 0x1031e, 0x10320, 0x10323, 0x10330, 0x1034a, 0x10400, 0x10425, 0x10428, 0x1044d, 0x1d000, 0x1d0f5, 0x1d100, 0x1d126, 0x1d12a, 0x1d166, 0x1d16a, 0x1d172, 0x1d183, 0x1d184, 0x1d18c, 0x1d1a9, 0x1d1ae, 0x1d1dd, 0x1d400, 0x1d454, 0x1d456, 0x1d49c, 0x1d49e, 0x1d49f, 0x1d4a2, 0x1d4a2, 0x1d4a5, 0x1d4a6, 0x1d4a9, 0x1d4ac, 0x1d4ae, 0x1d4b9, 0x1d4bb, 0x1d4bb, 0x1d4bd, 0x1d4c0, 0x1d4c2, 0x1d4c3, 0x1d4c5, 0x1d505, 0x1d507, 0x1d50a, 0x1d50d, 0x1d514, 0x1d516, 0x1d51c, 0x1d51e, 0x1d539, 0x1d53b, 0x1d53e, 0x1d540, 0x1d544, 0x1d546, 0x1d546, 0x1d54a, 0x1d550, 0x1d552, 0x1d6a3, 0x1d6a8, 0x1d7c9, 0x20000, 0x2a6d6, 0x2f800, 0x2fa1d, 0xf0000, 0xffffd, 0x100000, 0x10fffd] // prettier-ignore-end const isBidirectionalL = function isBidirectionalL (character) { return inRange(character, bidirectional_l) } /** * non-ASCII space characters [StringPrep, C.1.2] that can be * mapped to SPACE (U+0020) */ const mapping2space = isNonASCIISpaceCharacter /** * the "commonly mapped to nothing" characters [StringPrep, B.1] * that can be mapped to nothing. */ const mapping2nothing = isCommonlyMappedToNothing // utils const getCodePoint = function getCodePoint (character) { return character.codePointAt(0) } const first = function first (x) { return x[0] } const last = function last (x) { return x[x.length - 1] } /** * Convert provided string into an array of Unicode Code Points. * Based on https://stackoverflow.com/a/21409165/1556249 * and https://www.npmjs.com/package/code-point-at. * @param {string} input * @returns {number[]} */ function toCodePoints (input) { const codepoints = [] const size = input.length for (let i = 0; i < size; i += 1) { const before = input.charCodeAt(i) if (before >= 0xd800 && before <= 0xdbff && size > i + 1) { const next = input.charCodeAt(i + 1) if (next >= 0xdc00 && next <= 0xdfff) { codepoints.push((before - 0xd800) * 0x400 + next - 0xdc00 + 0x10000) i += 1 continue } } codepoints.push(before) } return codepoints } /** * SASLprep. * @param {string} input * @param {Object} opts * @param {boolean} opts.allowUnassigned * @returns {string} */ function saslprep (input) { const opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} if (typeof input !== 'string') { throw new TypeError('Expected string.') } if (input.length === 0) { return '' } // 1. Map const mapped_input = toCodePoints(input) // 1.1 mapping to space .map(function (character) { return mapping2space(character) ? 0x20 : character }) // 1.2 mapping to nothing .filter(function (character) { return !mapping2nothing(character) }) // 2. Normalize const normalized_input = String.fromCodePoint.apply(null, mapped_input).normalize('NFKC') const normalized_map = toCodePoints(normalized_input) // 3. Prohibit const hasProhibited = normalized_map.some(isProhibitedCharacter) if (hasProhibited) { throw new Error('Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3') } // Unassigned Code Points if (opts.allowUnassigned !== true) { const hasUnassigned = normalized_map.some(isUnassignedCodePoint) if (hasUnassigned) { throw new Error('Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5') } } // 4. check bidi const hasBidiRAL = normalized_map.some(isBidirectionalRAL) const hasBidiL = normalized_map.some(isBidirectionalL) // 4.1 If a string contains any RandALCat character, the string MUST NOT // contain any LCat character. if (hasBidiRAL && hasBidiL) { throw new Error('String must not contain RandALCat and LCat at the same time,' + ' see https://tools.ietf.org/html/rfc3454#section-6') } /** * 4.2 If a string contains any RandALCat character, a RandALCat * character MUST be the first character of the string, and a * RandALCat character MUST be the last character of the string. */ const isFirstBidiRAL = isBidirectionalRAL(getCodePoint(first(normalized_input))) const isLastBidiRAL = isBidirectionalRAL(getCodePoint(last(normalized_input))) if (hasBidiRAL && !(isFirstBidiRAL && isLastBidiRAL)) { throw new Error('Bidirectional RandALCat character must be the first and the last' + ' character of the string, see https://tools.ietf.org/html/rfc3454#section-6') } return normalized_input } const PDFSecurity = /* #__PURE__ */(function () { _createClass(PDFSecurity, null, [{ key: 'generateFileID', value: function generateFileID () { const info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} let infoStr = ''.concat(info.CreationDate.getTime(), '\n') for (const key in info) { // eslint-disable-next-line no-prototype-builtins if (!info.hasOwnProperty(key)) { continue } infoStr += ''.concat(key, ': ').concat(info[key].valueOf(), '\n') } return wordArrayToBuffer(_cryptoJs.default.MD5(infoStr)) } }, { key: 'generateRandomWordArray', value: function generateRandomWordArray (bytes) { return _cryptoJs.default.lib.WordArray.random(bytes) } }, { key: 'create', value: function create (document) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} if (!options.ownerPassword && !options.userPassword) { return null } return new PDFSecurity(document, options) } }]) function PDFSecurity (document) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} _classCallCheck(this, PDFSecurity) if (!options.ownerPassword && !options.userPassword) { throw new Error('None of owner password and user password is defined.') } this.document = document this._setupEncryption(options) } _createClass(PDFSecurity, [{ key: '_setupEncryption', value: function _setupEncryption (options) { switch (options.pdfVersion) { case '1.4': case '1.5': this.version = 2 break case '1.6': case '1.7': this.version = 4 break case '1.7ext3': this.version = 5 break default: this.version = 1 break } const encDict = { Filter: 'Standard' } switch (this.version) { case 1: case 2: case 4: this._setupEncryptionV1V2V4(this.version, encDict, options) break case 5: this._setupEncryptionV5(encDict, options) break } this.dictionary = this.document.ref(encDict) } }, { key: '_setupEncryptionV1V2V4', value: function _setupEncryptionV1V2V4 (v, encDict, options) { let r, permissions switch (v) { case 1: r = 2 this.keyBits = 40 permissions = getPermissionsR2(options.permissions) break case 2: r = 3 this.keyBits = 128 permissions = getPermissionsR3(options.permissions) break case 4: r = 4 this.keyBits = 128 permissions = getPermissionsR3(options.permissions) break } const paddedUserPassword = processPasswordR2R3R4(options.userPassword) const paddedOwnerPassword = options.ownerPassword ? processPasswordR2R3R4(options.ownerPassword) : paddedUserPassword const ownerPasswordEntry = getOwnerPasswordR2R3R4(r, this.keyBits, paddedUserPassword, paddedOwnerPassword) this.encryptionKey = getEncryptionKeyR2R3R4(r, this.keyBits, this.document._id, paddedUserPassword, ownerPasswordEntry, permissions) let userPasswordEntry if (r === 2) { userPasswordEntry = getUserPasswordR2(this.encryptionKey) } else { userPasswordEntry = getUserPasswordR3R4(this.document._id, this.encryptionKey) } encDict.V = v if (v >= 2) { encDict.Length = this.keyBits } if (v === 4) { encDict.CF = { StdCF: { AuthEvent: 'DocOpen', CFM: 'AESV2', Length: this.keyBits / 8 } } encDict.StmF = 'StdCF' encDict.StrF = 'StdCF' } encDict.R = r encDict.O = wordArrayToBuffer(ownerPasswordEntry) encDict.U = wordArrayToBuffer(userPasswordEntry) encDict.P = permissions } }, { key: '_setupEncryptionV5', value: function _setupEncryptionV5 (encDict, options) { this.keyBits = 256 const permissions = getPermissionsR3(options.permissions) const processedUserPassword = processPasswordR5(options.userPassword) const processedOwnerPassword = options.ownerPassword ? processPasswordR5(options.ownerPassword) : processedUserPassword this.encryptionKey = getEncryptionKeyR5(PDFSecurity.generateRandomWordArray) const userPasswordEntry = getUserPasswordR5(processedUserPassword, PDFSecurity.generateRandomWordArray) const userKeySalt = _cryptoJs.default.lib.WordArray.create(userPasswordEntry.words.slice(10, 12), 8) const userEncryptionKeyEntry = getUserEncryptionKeyR5(processedUserPassword, userKeySalt, this.encryptionKey) const ownerPasswordEntry = getOwnerPasswordR5(processedOwnerPassword, userPasswordEntry, PDFSecurity.generateRandomWordArray) const ownerKeySalt = _cryptoJs.default.lib.WordArray.create(ownerPasswordEntry.words.slice(10, 12), 8) const ownerEncryptionKeyEntry = getOwnerEncryptionKeyR5(processedOwnerPassword, ownerKeySalt, userPasswordEntry, this.encryptionKey) const permsEntry = getEncryptedPermissionsR5(permissions, this.encryptionKey, PDFSecurity.generateRandomWordArray) encDict.V = 5 encDict.Length = this.keyBits encDict.CF = { StdCF: { AuthEvent: 'DocOpen', CFM: 'AESV3', Length: this.keyBits / 8 } } encDict.StmF = 'StdCF' encDict.StrF = 'StdCF' encDict.R = 5 encDict.O = wordArrayToBuffer(ownerPasswordEntry) encDict.OE = wordArrayToBuffer(ownerEncryptionKeyEntry) encDict.U = wordArrayToBuffer(userPasswordEntry) encDict.UE = wordArrayToBuffer(userEncryptionKeyEntry) encDict.P = permissions encDict.Perms = wordArrayToBuffer(permsEntry) } }, { key: 'getEncryptFn', value: function getEncryptFn (obj, gen) { let digest if (this.version < 5) { digest = this.encryptionKey.clone().concat(_cryptoJs.default.lib.WordArray.create([(obj & 0xff) << 24 | (obj & 0xff00) << 8 | obj >> 8 & 0xff00 | gen & 0xff, (gen & 0xff00) << 16], 5)) } if (this.version === 1 || this.version === 2) { const _key = _cryptoJs.default.MD5(digest) _key.sigBytes = Math.min(16, this.keyBits / 8 + 5) return function (buffer) { return wordArrayToBuffer(_cryptoJs.default.RC4.encrypt(_cryptoJs.default.lib.WordArray.create(buffer), _key).ciphertext) } } let key if (this.version === 4) { key = _cryptoJs.default.MD5(digest.concat(_cryptoJs.default.lib.WordArray.create([0x73416c54], 4))) } else { key = this.encryptionKey } const iv = PDFSecurity.generateRandomWordArray(16) const options = { mode: _cryptoJs.default.mode.CBC, padding: _cryptoJs.default.pad.Pkcs7, iv } return function (buffer) { return wordArrayToBuffer(iv.clone().concat(_cryptoJs.default.AES.encrypt(_cryptoJs.default.lib.WordArray.create(buffer), key, options).ciphertext)) } } }, { key: 'end', value: function end () { this.dictionary.end() } }]) return PDFSecurity }()) function getPermissionsR2 () { const permissionObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} let permissions = 0xffffffc0 >> 0 if (permissionObject.printing) { permissions |= 4 } if (permissionObject.modifying) { permissions |= 8 } if (permissionObject.copying) { permissions |= 16 } if (permissionObject.annotating) { permissions |= 32 } return permissions } function getPermissionsR3 () { const permissionObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} let permissions = 0xfffff0c0 >> 0 if (permissionObject.printing === 'lowResolution') { permissions |= 4 } if (permissionObject.printing === 'highResolution') { permissions |= 2052 } if (permissionObject.modifying) { permissions |= 8 } if (permissionObject.copying) { permissions |= 16 } if (permissionObject.annotating) { permissions |= 32 } if (permissionObject.fillingForms) { permissions |= 256 } if (permissionObject.contentAccessibility) { permissions |= 512 } if (permissionObject.documentAssembly) { permissions |= 1024 } return permissions } function getUserPasswordR2 (encryptionKey) { return _cryptoJs.default.RC4.encrypt(processPasswordR2R3R4(), encryptionKey).ciphertext } function getUserPasswordR3R4 (documentId, encryptionKey) { const key = encryptionKey.clone() let cipher = _cryptoJs.default.MD5(processPasswordR2R3R4().concat(_cryptoJs.default.lib.WordArray.create(documentId))) for (let i = 0; i < 20; i++) { const xorRound = Math.ceil(key.sigBytes / 4) for (let j = 0; j < xorRound; j++) { key.words[j] = encryptionKey.words[j] ^ (i | i << 8 | i << 16 | i << 24) } cipher = _cryptoJs.default.RC4.encrypt(cipher, key).ciphertext } return cipher.concat(_cryptoJs.default.lib.WordArray.create(null, 16)) } function getOwnerPasswordR2R3R4 (r, keyBits, paddedUserPassword, paddedOwnerPassword) { let digest = paddedOwnerPassword let round = r >= 3 ? 51 : 1 for (let i = 0; i < round; i++) { digest = _cryptoJs.default.MD5(digest) } const key = digest.clone() key.sigBytes = keyBits / 8 let cipher = paddedUserPassword round = r >= 3 ? 20 : 1 for (let _i = 0; _i < round; _i++) { const xorRound = Math.ceil(key.sigBytes / 4) for (let j = 0; j < xorRound; j++) { key.words[j] = digest.words[j] ^ (_i | _i << 8 | _i << 16 | _i << 24) } cipher = _cryptoJs.default.RC4.encrypt(cipher, key).ciphertext } return cipher } function getEncryptionKeyR2R3R4 (r, keyBits, documentId, paddedUserPassword, ownerPasswordEntry, permissions) { let key = paddedUserPassword.clone().concat(ownerPasswordEntry).concat(_cryptoJs.default.lib.WordArray.create([lsbFirstWord(permissions)], 4)).concat(_cryptoJs.default.lib.WordArray.create(documentId)) const round = r >= 3 ? 51 : 1 for (let i = 0; i < round; i++) { key = _cryptoJs.default.MD5(key) key.sigBytes = keyBits / 8 } return key } function getUserPasswordR5 (processedUserPassword, generateRandomWordArray) { const validationSalt = generateRandomWordArray(8) const keySalt = generateRandomWordArray(8) return _cryptoJs.default.SHA256(processedUserPassword.clone().concat(validationSalt)).concat(validationSalt).concat(keySalt) } function getUserEncryptionKeyR5 (processedUserPassword, userKeySalt, encryptionKey) { const key = _cryptoJs.default.SHA256(processedUserPassword.clone().concat(userKeySalt)) const options = { mode: _cryptoJs.default.mode.CBC, padding: _cryptoJs.default.pad.NoPadding, iv: _cryptoJs.default.lib.WordArray.create(null, 16) } return _cryptoJs.default.AES.encrypt(encryptionKey, key, options).ciphertext } function getOwnerPasswordR5 (processedOwnerPassword, userPasswordEntry, generateRandomWordArray) { const validationSalt = generateRandomWordArray(8) const keySalt = generateRandomWordArray(8) return _cryptoJs.default.SHA256(processedOwnerPassword.clone().concat(validationSalt).concat(userPasswordEntry)).concat(validationSalt).concat(keySalt) } function getOwnerEncryptionKeyR5 (processedOwnerPassword, ownerKeySalt, userPasswordEntry, encryptionKey) { const key = _cryptoJs.default.SHA256(processedOwnerPassword.clone().concat(ownerKeySalt).concat(userPasswordEntry)) const options = { mode: _cryptoJs.default.mode.CBC, padding: _cryptoJs.default.pad.NoPadding, iv: _cryptoJs.default.lib.WordArray.create(null, 16) } return _cryptoJs.default.AES.encrypt(encryptionKey, key, options).ciphertext } function getEncryptionKeyR5 (generateRandomWordArray) { return generateRandomWordArray(32) } function getEncryptedPermissionsR5 (permissions, encryptionKey, generateRandomWordArray) { const cipher = _cryptoJs.default.lib.WordArray.create([lsbFirstWord(permissions), 0xffffffff, 0x54616462], 12).concat(generateRandomWordArray(4)) const options = { mode: _cryptoJs.default.mode.ECB, padding: _cryptoJs.default.pad.NoPadding } return _cryptoJs.default.AES.encrypt(cipher, encryptionKey, options).ciphertext } function processPasswordR2R3R4 () { const password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '' const out = Buffer.alloc(32) const length = password.length let index = 0 while (index < length && index < 32) { const code = password.charCodeAt(index) if (code > 0xff) { throw new Error('Password contains one or more invalid characters.') } out[index] = code index++ } while (index < 32) { out[index] = PASSWORD_PADDING[index - length] index++ } return _cryptoJs.default.lib.WordArray.create(out) } function processPasswordR5 () { let password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '' password = unescape(encodeURIComponent(saslprep(password))) const length = Math.min(127, password.length) const out = Buffer.alloc(length) for (let i = 0; i < length; i++) { out[i] = password.charCodeAt(i) } return _cryptoJs.default.lib.WordArray.create(out) } function lsbFirstWord (data) { return (data & 0xff) << 24 | (data & 0xff00) << 8 | data >> 8 & 0xff00 | data >> 24 & 0xff } function wordArrayToBuffer (wordArray) { const byteArray = [] for (let i = 0; i < wordArray.sigBytes; i++) { byteArray.push(wordArray.words[Math.floor(i / 4)] >> 8 * (3 - i % 4) & 0xff) } return Buffer.from(byteArray) } var PASSWORD_PADDING = [0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a] const number = PDFObject.number const PDFGradient = /* #__PURE__ */(function () { function PDFGradient (doc) { _classCallCheck(this, PDFGradient) this.doc = doc this.stops = [] this.embedded = false this.transform = [1, 0, 0, 1, 0, 0] } _createClass(PDFGradient, [{ key: 'stop', value: function stop (pos, color, opacity) { if (opacity == null) { opacity = 1 } color = this.doc._normalizeColor(color) if (this.stops.length === 0) { if (color.length === 3) { this._colorSpace = 'DeviceRGB' } else if (color.length === 4) { this._colorSpace = 'DeviceCMYK' } else if (color.length === 1) { this._colorSpace = 'DeviceGray' } else { throw new Error('Unknown color space') } } else if (this._colorSpace === 'DeviceRGB' && color.length !== 3 || this._colorSpace === 'DeviceCMYK' && color.length !== 4 || this._colorSpace === 'DeviceGray' && color.length !== 1) { throw new Error('All gradient stops must use the same color space') } opacity = Math.max(0, Math.min(1, opacity)) this.stops.push([pos, color, opacity]) return this } }, { key: 'setTransform', value: function setTransform (m11, m12, m21, m22, dx, dy) { this.transform = [m11, m12, m21, m22, dx, dy] return this } }, { key: 'embed', value: function embed (m) { let fn const stopsLength = this.stops.length if (stopsLength === 0) { return } this.embedded = true this.matrix = m // if the last stop comes before 100%, add a copy at 100% const last = this.stops[stopsLength - 1] if (last[0] < 1) { this.stops.push([1, last[1], last[2]]) } const bounds = [] const encode = [] const stops = [] for (let i = 0; i < stopsLength - 1; i++) { encode.push(0, 1) if (i + 2 !== stopsLength) { bounds.push(this.stops[i + 1][0]) } fn = this.doc.ref({ FunctionType: 2, Domain: [0, 1], C0: this.stops[i + 0][1], C1: this.stops[i + 1][1], N: 1 }) stops.push(fn) fn.end() } // if there are only two stops, we don't need a stitching function if (stopsLength === 1) { fn = stops[0] } else { fn = this.doc.ref({ FunctionType: 3, // stitching function Domain: [0, 1], Functions: stops, Bounds: bounds, Encode: encode }) fn.end() } this.id = 'Sh'.concat(++this.doc._gradCount) const shader = this.shader(fn) shader.end() const pattern = this.doc.ref({ Type: 'Pattern', PatternType: 2, Shading: shader, Matrix: this.matrix.map(number) }) pattern.end() if (this.stops.some(function (stop) { return stop[2] < 1 })) { let grad = this.opacityGradient() grad._colorSpace = 'DeviceGray' const _iterator = _createForOfIteratorHelper(this.stops) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const stop = _step.value grad.stop(stop[0], [stop[2]]) } } catch (err) { _iterator.e(err) } finally { _iterator.f() } grad = grad.embed(this.matrix) const pageBBox = [0, 0, this.doc.page.width, this.doc.page.height] const form = this.doc.ref({ Type: 'XObject', Subtype: 'Form', FormType: 1, BBox: pageBBox, Group: { Type: 'Group', S: 'Transparency', CS: 'DeviceGray' }, Resources: { ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], Pattern: { Sh1: grad } } }) form.write('/Pattern cs /Sh1 scn') form.end(''.concat(pageBBox.join(' '), ' re f')) const gstate = this.doc.ref({ Type: 'ExtGState', SMask: { Type: 'Mask', S: 'Luminosity', G: form } }) gstate.end() const opacityPattern = this.doc.ref({ Type: 'Pattern', PatternType: 1, PaintType: 1, TilingType: 2, BBox: pageBBox, XStep: pageBBox[2], YStep: pageBBox[3], Resources: { ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], Pattern: { Sh1: pattern }, ExtGState: { Gs1: gstate } } }) opacityPattern.write('/Gs1 gs /Pattern cs /Sh1 scn') opacityPattern.end(''.concat(pageBBox.join(' '), ' re f')) this.doc.page.patterns[this.id] = opacityPattern } else { this.doc.page.patterns[this.id] = pattern } return pattern } }, { key: 'apply', value: function apply (stroke) { // apply gradient transform to existing document ctm const _this$doc$_ctm = _slicedToArray(this.doc._ctm, 6) const m0 = _this$doc$_ctm[0] const m1 = _this$doc$_ctm[1] const m2 = _this$doc$_ctm[2] const m3 = _this$doc$_ctm[3] const m4 = _this$doc$_ctm[4] const m5 = _this$doc$_ctm[5] const _this$transform = _slicedToArray(this.transform, 6) const m11 = _this$transform[0] const m12 = _this$transform[1] const m21 = _this$transform[2] const m22 = _this$transform[3] const dx = _this$transform[4] const dy = _this$transform[5] const m = [m0 * m11 + m2 * m12, m1 * m11 + m3 * m12, m0 * m21 + m2 * m22, m1 * m21 + m3 * m22, m0 * dx + m2 * dy + m4, m1 * dx + m3 * dy + m5] if (!this.embedded || m.join(' ') !== this.matrix.join(' ')) { this.embed(m) } this.doc._setColorSpace('Pattern', stroke) const op = stroke ? 'SCN' : 'scn' return this.doc.addContent('/'.concat(this.id, ' ').concat(op)) } }]) return PDFGradient }()) const PDFLinearGradient = /* #__PURE__ */(function (_PDFGradient) { _inherits(PDFLinearGradient, _PDFGradient) const _super = _createSuper(PDFLinearGradient) function PDFLinearGradient (doc, x1, y1, x2, y2) { let _this _classCallCheck(this, PDFLinearGradient) _this = _super.call(this, doc) _this.x1 = x1 _this.y1 = y1 _this.x2 = x2 _this.y2 = y2 return _this } _createClass(PDFLinearGradient, [{ key: 'shader', value: function shader (fn) { return this.doc.ref({ ShadingType: 2, ColorSpace: this._colorSpace, Coords: [this.x1, this.y1, this.x2, this.y2], Function: fn, Extend: [true, true] }) } }, { key: 'opacityGradient', value: function opacityGradient () { return new PDFLinearGradient(this.doc, this.x1, this.y1, this.x2, this.y2) } }]) return PDFLinearGradient }(PDFGradient)) const PDFRadialGradient = /* #__PURE__ */(function (_PDFGradient2) { _inherits(PDFRadialGradient, _PDFGradient2) const _super2 = _createSuper(PDFRadialGradient) function PDFRadialGradient (doc, x1, y1, r1, x2, y2, r2) { let _this2 _classCallCheck(this, PDFRadialGradient) _this2 = _super2.call(this, doc) _this2.doc = doc _this2.x1 = x1 _this2.y1 = y1 _this2.r1 = r1 _this2.x2 = x2 _this2.y2 = y2 _this2.r2 = r2 return _this2 } _createClass(PDFRadialGradient, [{ key: 'shader', value: function shader (fn) { return this.doc.ref({ ShadingType: 3, ColorSpace: this._colorSpace, Coords: [this.x1, this.y1, this.r1, this.x2, this.y2, this.r2], Function: fn, Extend: [true, true] }) } }, { key: 'opacityGradient', value: function opacityGradient () { return new PDFRadialGradient(this.doc, this.x1, this.y1, this.r1, this.x2, this.y2, this.r2) } }]) return PDFRadialGradient }(PDFGradient)) const Gradient = { PDFGradient, PDFLinearGradient, PDFRadialGradient } /* PDF tiling pattern support. Uncolored only. */ const underlyingColorSpaces = ['DeviceCMYK', 'DeviceRGB'] const PDFTilingPattern = /* #__PURE__ */(function () { function PDFTilingPattern (doc, bBox, xStep, yStep, stream) { _classCallCheck(this, PDFTilingPattern) this.doc = doc this.bBox = bBox this.xStep = xStep this.yStep = yStep this.stream = stream } _createClass(PDFTilingPattern, [{ key: 'createPattern', value: function createPattern () { // no resources needed for our current usage // required entry const resources = this.doc.ref() resources.end() // apply default transform matrix (flipped in the default doc._ctm) // see document.js & gradient.js const _this$doc$_ctm = _slicedToArray(this.doc._ctm, 6) const m0 = _this$doc$_ctm[0] const m1 = _this$doc$_ctm[1] const m2 = _this$doc$_ctm[2] const m3 = _this$doc$_ctm[3] const m4 = _this$doc$_ctm[4] const m5 = _this$doc$_ctm[5] const m11 = 1 const m12 = 0 const m21 = 0 const m22 = 1 const dx = 0 const dy = 0 const m = [m0 * m11 + m2 * m12, m1 * m11 + m3 * m12, m0 * m21 + m2 * m22, m1 * m21 + m3 * m22, m0 * dx + m2 * dy + m4, m1 * dx + m3 * dy + m5] const pattern = this.doc.ref({ Type: 'Pattern', PatternType: 1, // tiling PaintType: 2, // 1-colored, 2-uncolored TilingType: 2, // 2-no distortion BBox: this.bBox, XStep: this.xStep, YStep: this.yStep, Matrix: m.map(function (v) { return +v.toFixed(5) }), Resources: resources }) pattern.end(this.stream) return pattern } }, { key: 'embedPatternColorSpaces', value: function embedPatternColorSpaces () { const _this = this // map each pattern to an underlying color space // and embed on each page underlyingColorSpaces.forEach(function (csName) { const csId = _this.getPatternColorSpaceId(csName) if (_this.doc.page.colorSpaces[csId]) return const cs = _this.doc.ref(['Pattern', csName]) cs.end() _this.doc.page.colorSpaces[csId] = cs }) } }, { key: 'getPatternColorSpaceId', value: function getPatternColorSpaceId (underlyingColorspace) { return 'CsP'.concat(underlyingColorspace) } }, { key: 'embed', value: function embed () { if (!this.id) { this.doc._patternCount = this.doc._patternCount + 1 this.id = 'P' + this.doc._patternCount this.pattern = this.createPattern() } // patterns are embedded in each page if (!this.doc.page.patterns[this.id]) { this.doc.page.patterns[this.id] = this.pattern } } }, { key: 'apply', value: function apply (stroke, patternColor) { // do any embedding/creating that might be needed this.embedPatternColorSpaces() this.embed() const normalizedColor = this.doc._normalizeColor(patternColor) if (!normalizedColor) throw Error('invalid pattern color. (value: '.concat(patternColor, ')')) // select one of the pattern color spaces const csId = this.getPatternColorSpaceId(this.doc._getColorSpace(normalizedColor)) this.doc._setColorSpace(csId, stroke) // stroke/fill using the pattern and color (in the above underlying color space) const op = stroke ? 'SCN' : 'scn' return this.doc.addContent(''.concat(normalizedColor.join(' '), ' /').concat(this.id, ' ').concat(op)) } }]) return PDFTilingPattern }()) const pattern = { PDFTilingPattern } const PDFGradient$1 = Gradient.PDFGradient const PDFLinearGradient$1 = Gradient.PDFLinearGradient const PDFRadialGradient$1 = Gradient.PDFRadialGradient const PDFTilingPattern$1 = pattern.PDFTilingPattern const ColorMixin = { initColor: function initColor () { // The opacity dictionaries this._opacityRegistry = {} this._opacityCount = 0 this._patternCount = 0 return this._gradCount = 0 }, _normalizeColor: function _normalizeColor (color) { if (typeof color === 'string') { if (color.charAt(0) === '#') { if (color.length === 4) { color = color.replace(/#([0-9A-F])([0-9A-F])([0-9A-F])/i, '#$1$1$2$2$3$3') } const hex = parseInt(color.slice(1), 16) color = [hex >> 16, hex >> 8 & 0xff, hex & 0xff] } else if (namedColors[color]) { color = namedColors[color] } } if (Array.isArray(color)) { // RGB if (color.length === 3) { color = color.map(function (part) { return part / 255 }) // CMYK } else if (color.length === 4) { color = color.map(function (part) { return part / 100 }) } return color } return null }, _setColor: function _setColor (color, stroke) { if (color instanceof PDFGradient$1) { color.apply(stroke) return true // see if tiling pattern, decode & apply it it } else if (Array.isArray(color) && color[0] instanceof PDFTilingPattern$1) { color[0].apply(stroke, color[1]) return true } // any other case should be a normal color and not a pattern return this._setColorCore(color, stroke) }, _setColorCore: function _setColorCore (color, stroke) { color = this._normalizeColor(color) if (!color) { return false } const op = stroke ? 'SCN' : 'scn' const space = this._getColorSpace(color) this._setColorSpace(space, stroke) color = color.join(' ') this.addContent(''.concat(color, ' ').concat(op)) return true }, _setColorSpace: function _setColorSpace (space, stroke) { const op = stroke ? 'CS' : 'cs' return this.addContent('/'.concat(space, ' ').concat(op)) }, _getColorSpace: function _getColorSpace (color) { return color.length === 4 ? 'DeviceCMYK' : 'DeviceRGB' }, fillColor: function fillColor (color, opacity) { const set = this._setColor(color, false) if (set) { this.fillOpacity(opacity) } // save this for text wrapper, which needs to reset // the fill color on new pages this._fillColor = [color, opacity] return this }, strokeColor: function strokeColor (color, opacity) { const set = this._setColor(color, true) if (set) { this.strokeOpacity(opacity) } return this }, opacity: function opacity (_opacity) { this._doOpacity(_opacity, _opacity) return this }, fillOpacity: function fillOpacity (opacity) { this._doOpacity(opacity, null) return this }, strokeOpacity: function strokeOpacity (opacity) { this._doOpacity(null, opacity) return this }, _doOpacity: function _doOpacity (fillOpacity, strokeOpacity) { let dictionary, name if (fillOpacity == null && strokeOpacity == null) { return } if (fillOpacity != null) { fillOpacity = Math.max(0, Math.min(1, fillOpacity)) } if (strokeOpacity != null) { strokeOpacity = Math.max(0, Math.min(1, strokeOpacity)) } const key = ''.concat(fillOpacity, '_').concat(strokeOpacity) if (this._opacityRegistry[key]) { const _this$_opacityRegistr = _slicedToArray(this._opacityRegistry[key], 2) dictionary = _this$_opacityRegistr[0] name = _this$_opacityRegistr[1] } else { dictionary = { Type: 'ExtGState' } if (fillOpacity != null) { dictionary.ca = fillOpacity } if (strokeOpacity != null) { dictionary.CA = strokeOpacity } dictionary = this.ref(dictionary) dictionary.end() const id = ++this._opacityCount name = 'Gs'.concat(id) this._opacityRegistry[key] = [dictionary, name] } this.page.ext_gstates[name] = dictionary return this.addContent('/'.concat(name, ' gs')) }, linearGradient: function linearGradient (x1, y1, x2, y2) { return new PDFLinearGradient$1(this, x1, y1, x2, y2) }, radialGradient: function radialGradient (x1, y1, r1, x2, y2, r2) { return new PDFRadialGradient$1(this, x1, y1, r1, x2, y2, r2) }, pattern: function pattern (bbox, xStep, yStep, stream) { return new PDFTilingPattern$1(this, bbox, xStep, yStep, stream) } } var namedColors = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], grey: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] } let cx, cy, px, py, sx, sy cx = cy = px = py = sx = sy = 0 const parameters = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 } const parse = function parse (path) { let cmd const ret = [] let args = [] let curArg = '' let foundDecimal = false let params = 0 const _iterator = _createForOfIteratorHelper(path) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const c = _step.value if (parameters[c] != null) { params = parameters[c] if (cmd) { // save existing command if (curArg.length > 0) { args[args.length] = +curArg } ret[ret.length] = { cmd, args } args = [] curArg = '' foundDecimal = false } cmd = c } else if ([' ', ','].includes(c) || c === '-' && curArg.length > 0 && curArg[curArg.length - 1] !== 'e' || c === '.' && foundDecimal) { if (curArg.length === 0) { continue } if (args.length === params) { // handle reused commands ret[ret.length] = { cmd, args } args = [+curArg] // handle assumed commands if (cmd === 'M') { cmd = 'L' } if (cmd === 'm') { cmd = 'l' } } else { args[args.length] = +curArg } foundDecimal = c === '.' // fix for negative numbers or repeated decimals with no delimeter between commands curArg = ['-', '.'].includes(c) ? c : '' } else { curArg += c if (c === '.') { foundDecimal = true } } } // add the last command } catch (err) { _iterator.e(err) } finally { _iterator.f() } if (curArg.length > 0) { if (args.length === params) { // handle reused commands ret[ret.length] = { cmd, args } args = [+curArg] // handle assumed commands if (cmd === 'M') { cmd = 'L' } if (cmd === 'm') { cmd = 'l' } } else { args[args.length] = +curArg } } ret[ret.length] = { cmd, args } return ret } const _apply = function apply (commands, doc) { // current point, control point, and subpath starting point cx = cy = px = py = sx = sy = 0 // run the commands for (let i = 0; i < commands.length; i++) { const c = commands[i] if (typeof runners[c.cmd] === 'function') { runners[c.cmd](doc, c.args) } } } var runners = { M: function M (doc, a) { cx = a[0] cy = a[1] px = py = null sx = cx sy = cy return doc.moveTo(cx, cy) }, m: function m (doc, a) { cx += a[0] cy += a[1] px = py = null sx = cx sy = cy return doc.moveTo(cx, cy) }, C: function C (doc, a) { cx = a[4] cy = a[5] px = a[2] py = a[3] return doc.bezierCurveTo.apply(doc, _toConsumableArray(a)) }, c: function c (doc, a) { doc.bezierCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy, a[4] + cx, a[5] + cy) px = cx + a[2] py = cy + a[3] cx += a[4] return cy += a[5] }, S: function S (doc, a) { if (px === null) { px = cx py = cy } doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), a[0], a[1], a[2], a[3]) px = a[0] py = a[1] cx = a[2] return cy = a[3] }, s: function s (doc, a) { if (px === null) { px = cx py = cy } doc.bezierCurveTo(cx - (px - cx), cy - (py - cy), cx + a[0], cy + a[1], cx + a[2], cy + a[3]) px = cx + a[0] py = cy + a[1] cx += a[2] return cy += a[3] }, Q: function Q (doc, a) { px = a[0] py = a[1] cx = a[2] cy = a[3] return doc.quadraticCurveTo(a[0], a[1], cx, cy) }, q: function q (doc, a) { doc.quadraticCurveTo(a[0] + cx, a[1] + cy, a[2] + cx, a[3] + cy) px = cx + a[0] py = cy + a[1] cx += a[2] return cy += a[3] }, T: function T (doc, a) { if (px === null) { px = cx py = cy } else { px = cx - (px - cx) py = cy - (py - cy) } doc.quadraticCurveTo(px, py, a[0], a[1]) px = cx - (px - cx) py = cy - (py - cy) cx = a[0] return cy = a[1] }, t: function t (doc, a) { if (px === null) { px = cx py = cy } else { px = cx - (px - cx) py = cy - (py - cy) } doc.quadraticCurveTo(px, py, cx + a[0], cy + a[1]) cx += a[0] return cy += a[1] }, A: function A (doc, a) { solveArc(doc, cx, cy, a) cx = a[5] return cy = a[6] }, a: function a (doc, _a) { _a[5] += cx _a[6] += cy solveArc(doc, cx, cy, _a) cx = _a[5] return cy = _a[6] }, L: function L (doc, a) { cx = a[0] cy = a[1] px = py = null return doc.lineTo(cx, cy) }, l: function l (doc, a) { cx += a[0] cy += a[1] px = py = null return doc.lineTo(cx, cy) }, H: function H (doc, a) { cx = a[0] px = py = null return doc.lineTo(cx, cy) }, h: function h (doc, a) { cx += a[0] px = py = null return doc.lineTo(cx, cy) }, V: function V (doc, a) { cy = a[0] px = py = null return doc.lineTo(cx, cy) }, v: function v (doc, a) { cy += a[0] px = py = null return doc.lineTo(cx, cy) }, Z: function Z (doc) { doc.closePath() cx = sx return cy = sy }, z: function z (doc) { doc.closePath() cx = sx return cy = sy } } var solveArc = function solveArc (doc, x, y, coords) { const _coords = _slicedToArray(coords, 7) const rx = _coords[0] const ry = _coords[1] const rot = _coords[2] const large = _coords[3] const sweep = _coords[4] const ex = _coords[5] const ey = _coords[6] const segs = arcToSegments(ex, ey, rx, ry, large, sweep, rot, x, y) const _iterator2 = _createForOfIteratorHelper(segs) let _step2 try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { const seg = _step2.value const bez = segmentToBezier.apply(void 0, _toConsumableArray(seg)) doc.bezierCurveTo.apply(doc, _toConsumableArray(bez)) } } catch (err) { _iterator2.e(err) } finally { _iterator2.f() } } // from Inkscape svgtopdf, thanks! var arcToSegments = function arcToSegments (x, y, rx, ry, large, sweep, rotateX, ox, oy) { const th = rotateX * (Math.PI / 180) const sin_th = Math.sin(th) const cos_th = Math.cos(th) rx = Math.abs(rx) ry = Math.abs(ry) px = cos_th * (ox - x) * 0.5 + sin_th * (oy - y) * 0.5 py = cos_th * (oy - y) * 0.5 - sin_th * (ox - x) * 0.5 let pl = px * px / (rx * rx) + py * py / (ry * ry) if (pl > 1) { pl = Math.sqrt(pl) rx *= pl ry *= pl } const a00 = cos_th / rx const a01 = sin_th / rx const a10 = -sin_th / ry const a11 = cos_th / ry const x0 = a00 * ox + a01 * oy const y0 = a10 * ox + a11 * oy const x1 = a00 * x + a01 * y const y1 = a10 * x + a11 * y const d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0) let sfactor_sq = 1 / d - 0.25 if (sfactor_sq < 0) { sfactor_sq = 0 } let sfactor = Math.sqrt(sfactor_sq) if (sweep === large) { sfactor = -sfactor } const xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0) const yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0) const th0 = Math.atan2(y0 - yc, x0 - xc) const th1 = Math.atan2(y1 - yc, x1 - xc) let th_arc = th1 - th0 if (th_arc < 0 && sweep === 1) { th_arc += 2 * Math.PI } else if (th_arc > 0 && sweep === 0) { th_arc -= 2 * Math.PI } const segments = Math.ceil(Math.abs(th_arc / (Math.PI * 0.5 + 0.001))) const result = [] for (let i = 0; i < segments; i++) { const th2 = th0 + i * th_arc / segments const th3 = th0 + (i + 1) * th_arc / segments result[i] = [xc, yc, th2, th3, rx, ry, sin_th, cos_th] } return result } var segmentToBezier = function segmentToBezier (cx, cy, th0, th1, rx, ry, sin_th, cos_th) { const a00 = cos_th * rx const a01 = -sin_th * ry const a10 = sin_th * rx const a11 = cos_th * ry const th_half = 0.5 * (th1 - th0) const t = 8 / 3 * Math.sin(th_half * 0.5) * Math.sin(th_half * 0.5) / Math.sin(th_half) const x1 = cx + Math.cos(th0) - t * Math.sin(th0) const y1 = cy + Math.sin(th0) + t * Math.cos(th0) const x3 = cx + Math.cos(th1) const y3 = cy + Math.sin(th1) const x2 = x3 + t * Math.sin(th1) const y2 = y3 - t * Math.cos(th1) return [a00 * x1 + a01 * y1, a10 * x1 + a11 * y1, a00 * x2 + a01 * y2, a10 * x2 + a11 * y2, a00 * x3 + a01 * y3, a10 * x3 + a11 * y3] } const SVGPath = /* #__PURE__ */(function () { function SVGPath () { _classCallCheck(this, SVGPath) } _createClass(SVGPath, null, [{ key: 'apply', value: function apply (doc, path) { const commands = parse(path) _apply(commands, doc) } }]) return SVGPath }()) const number$1 = PDFObject.number // This constant is used to approximate a symmetrical arc using a cubic // Bezier curve. const KAPPA = 4.0 * ((Math.sqrt(2) - 1.0) / 3.0) const VectorMixin = { initVector: function initVector () { this._ctm = [1, 0, 0, 1, 0, 0] // current transformation matrix return this._ctmStack = [] }, save: function save () { this._ctmStack.push(this._ctm.slice()) // TODO: save/restore colorspace and styles so not setting it unnessesarily all the time? return this.addContent('q') }, restore: function restore () { this._ctm = this._ctmStack.pop() || [1, 0, 0, 1, 0, 0] return this.addContent('Q') }, closePath: function closePath () { return this.addContent('h') }, lineWidth: function lineWidth (w) { return this.addContent(''.concat(number$1(w), ' w')) }, _CAP_STYLES: { BUTT: 0, ROUND: 1, SQUARE: 2 }, lineCap: function lineCap (c) { if (typeof c === 'string') { c = this._CAP_STYLES[c.toUpperCase()] } return this.addContent(''.concat(c, ' J')) }, _JOIN_STYLES: { MITER: 0, ROUND: 1, BEVEL: 2 }, lineJoin: function lineJoin (j) { if (typeof j === 'string') { j = this._JOIN_STYLES[j.toUpperCase()] } return this.addContent(''.concat(j, ' j')) }, miterLimit: function miterLimit (m) { return this.addContent(''.concat(number$1(m), ' M')) }, dash: function dash (length) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} const originalLength = length if (!Array.isArray(length)) { length = [length, options.space || length] } const valid = length.every(function (x) { return Number.isFinite(x) && x > 0 }) if (!valid) { throw new Error('dash('.concat(JSON.stringify(originalLength), ', ').concat(JSON.stringify(options), ') invalid, lengths must be numeric and greater than zero')) } length = length.map(number$1).join(' ') return this.addContent('['.concat(length, '] ').concat(number$1(options.phase || 0), ' d')) }, undash: function undash () { return this.addContent('[] 0 d') }, moveTo: function moveTo (x, y) { return this.addContent(''.concat(number$1(x), ' ').concat(number$1(y), ' m')) }, lineTo: function lineTo (x, y) { return this.addContent(''.concat(number$1(x), ' ').concat(number$1(y), ' l')) }, bezierCurveTo: function bezierCurveTo (cp1x, cp1y, cp2x, cp2y, x, y) { return this.addContent(''.concat(number$1(cp1x), ' ').concat(number$1(cp1y), ' ').concat(number$1(cp2x), ' ').concat(number$1(cp2y), ' ').concat(number$1(x), ' ').concat(number$1(y), ' c')) }, quadraticCurveTo: function quadraticCurveTo (cpx, cpy, x, y) { return this.addContent(''.concat(number$1(cpx), ' ').concat(number$1(cpy), ' ').concat(number$1(x), ' ').concat(number$1(y), ' v')) }, rect: function rect (x, y, w, h) { return this.addContent(''.concat(number$1(x), ' ').concat(number$1(y), ' ').concat(number$1(w), ' ').concat(number$1(h), ' re')) }, roundedRect: function roundedRect (x, y, w, h, r) { if (r == null) { r = 0 } r = Math.min(r, 0.5 * w, 0.5 * h) // amount to inset control points from corners (see `ellipse`) const c = r * (1.0 - KAPPA) this.moveTo(x + r, y) this.lineTo(x + w - r, y) this.bezierCurveTo(x + w - c, y, x + w, y + c, x + w, y + r) this.lineTo(x + w, y + h - r) this.bezierCurveTo(x + w, y + h - c, x + w - c, y + h, x + w - r, y + h) this.lineTo(x + r, y + h) this.bezierCurveTo(x + c, y + h, x, y + h - c, x, y + h - r) this.lineTo(x, y + r) this.bezierCurveTo(x, y + c, x + c, y, x + r, y) return this.closePath() }, ellipse: function ellipse (x, y, r1, r2) { // based on http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas/2173084#2173084 if (r2 == null) { r2 = r1 } x -= r1 y -= r2 const ox = r1 * KAPPA const oy = r2 * KAPPA const xe = x + r1 * 2 const ye = y + r2 * 2 const xm = x + r1 const ym = y + r2 this.moveTo(x, ym) this.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y) this.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym) this.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye) this.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym) return this.closePath() }, circle: function circle (x, y, radius) { return this.ellipse(x, y, radius) }, arc: function arc (x, y, radius, startAngle, endAngle, anticlockwise) { if (anticlockwise == null) { anticlockwise = false } const TWO_PI = 2.0 * Math.PI const HALF_PI = 0.5 * Math.PI let deltaAng = endAngle - startAngle if (Math.abs(deltaAng) > TWO_PI) { // draw only full circle if more than that is specified deltaAng = TWO_PI } else if (deltaAng !== 0 && anticlockwise !== deltaAng < 0) { // necessary to flip direction of rendering const dir = anticlockwise ? -1 : 1 deltaAng = dir * TWO_PI + deltaAng } const numSegs = Math.ceil(Math.abs(deltaAng) / HALF_PI) const segAng = deltaAng / numSegs const handleLen = segAng / HALF_PI * KAPPA * radius let curAng = startAngle // component distances between anchor point and control point let deltaCx = -Math.sin(curAng) * handleLen let deltaCy = Math.cos(curAng) * handleLen // anchor point let ax = x + Math.cos(curAng) * radius let ay = y + Math.sin(curAng) * radius // calculate and render segments this.moveTo(ax, ay) for (let segIdx = 0; segIdx < numSegs; segIdx++) { // starting control point const cp1x = ax + deltaCx const cp1y = ay + deltaCy // step angle curAng += segAng // next anchor point ax = x + Math.cos(curAng) * radius ay = y + Math.sin(curAng) * radius // next control point delta deltaCx = -Math.sin(curAng) * handleLen deltaCy = Math.cos(curAng) * handleLen // ending control point const cp2x = ax - deltaCx const cp2y = ay - deltaCy // render segment this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, ax, ay) } return this }, polygon: function polygon () { for (var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++) { points[_key] = arguments[_key] } this.moveTo.apply(this, _toConsumableArray(points.shift() || [])) for (let _i = 0, _points = points; _i < _points.length; _i++) { const point = _points[_i] this.lineTo.apply(this, _toConsumableArray(point || [])) } return this.closePath() }, path: function path (_path) { SVGPath.apply(this, _path) return this }, _windingRule: function _windingRule (rule) { if (/even-?odd/.test(rule)) { return '*' } return '' }, fill: function fill (color, rule) { if (/(even-?odd)|(non-?zero)/.test(color)) { rule = color color = null } if (color) { this.fillColor(color) } return this.addContent('f'.concat(this._windingRule(rule))) }, stroke: function stroke (color) { if (color) { this.strokeColor(color) } return this.addContent('S') }, fillAndStroke: function fillAndStroke (fillColor, strokeColor, rule) { if (strokeColor == null) { strokeColor = fillColor } const isFillRule = /(even-?odd)|(non-?zero)/ if (isFillRule.test(fillColor)) { rule = fillColor fillColor = null } if (isFillRule.test(strokeColor)) { rule = strokeColor strokeColor = fillColor } if (fillColor) { this.fillColor(fillColor) this.strokeColor(strokeColor) } return this.addContent('B'.concat(this._windingRule(rule))) }, clip: function clip (rule) { return this.addContent('W'.concat(this._windingRule(rule), ' n')) }, transform: function transform (m11, m12, m21, m22, dx, dy) { // keep track of the current transformation matrix const m = this._ctm const _m = _slicedToArray(m, 6) const m0 = _m[0] const m1 = _m[1] const m2 = _m[2] const m3 = _m[3] const m4 = _m[4] const m5 = _m[5] m[0] = m0 * m11 + m2 * m12 m[1] = m1 * m11 + m3 * m12 m[2] = m0 * m21 + m2 * m22 m[3] = m1 * m21 + m3 * m22 m[4] = m0 * dx + m2 * dy + m4 m[5] = m1 * dx + m3 * dy + m5 const values = [m11, m12, m21, m22, dx, dy].map(function (v) { return number$1(v) }).join(' ') return this.addContent(''.concat(values, ' cm')) }, translate: function translate (x, y) { return this.transform(1, 0, 0, 1, x, y) }, rotate: function rotate (angle) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} let y const rad = angle * Math.PI / 180 const cos = Math.cos(rad) const sin = Math.sin(rad) let x = y = 0 if (options.origin != null) { const _options$origin = _slicedToArray(options.origin, 2) x = _options$origin[0] y = _options$origin[1] const x1 = x * cos - y * sin const y1 = x * sin + y * cos x -= x1 y -= y1 } return this.transform(cos, sin, -sin, cos, x, y) }, scale: function scale (xFactor, yFactor) { let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {} let y if (yFactor == null) { yFactor = xFactor } if (typeof yFactor === 'object') { options = yFactor yFactor = xFactor } let x = y = 0 if (options.origin != null) { const _options$origin2 = _slicedToArray(options.origin, 2) x = _options$origin2[0] y = _options$origin2[1] x -= xFactor * x y -= yFactor * y } return this.transform(xFactor, 0, 0, yFactor, x, y) } } const WIN_ANSI_MAP = { 402: 131, 8211: 150, 8212: 151, 8216: 145, 8217: 146, 8218: 130, 8220: 147, 8221: 148, 8222: 132, 8224: 134, 8225: 135, 8226: 149, 8230: 133, 8364: 128, 8240: 137, 8249: 139, 8250: 155, 710: 136, 8482: 153, 338: 140, 339: 156, 732: 152, 352: 138, 353: 154, 376: 159, 381: 142, 382: 158 } const characters = '.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n.notdef .notdef .notdef .notdef\n \nspace exclam quotedbl numbersign\ndollar percent ampersand quotesingle\nparenleft parenright asterisk plus\ncomma hyphen period slash\nzero one two three\nfour five six seven\neight nine colon semicolon\nless equal greater question\n \nat A B C\nD E F G\nH I J K\nL M N O\nP Q R S\nT U V W\nX Y Z bracketleft\nbackslash bracketright asciicircum underscore\n \ngrave a b c\nd e f g\nh i j k\nl m n o\np q r s\nt u v w\nx y z braceleft\nbar braceright asciitilde .notdef\n \nEuro .notdef quotesinglbase florin\nquotedblbase ellipsis dagger daggerdbl\ncircumflex perthousand Scaron guilsinglleft\nOE .notdef Zcaron .notdef\n.notdef quoteleft quoteright quotedblleft\nquotedblright bullet endash emdash\ntilde trademark scaron guilsinglright\noe .notdef zcaron ydieresis\n \nspace exclamdown cent sterling\ncurrency yen brokenbar section\ndieresis copyright ordfeminine guillemotleft\nlogicalnot hyphen registered macron\ndegree plusminus twosuperior threesuperior\nacute mu paragraph periodcentered\ncedilla onesuperior ordmasculine guillemotright\nonequarter onehalf threequarters questiondown\n \nAgrave Aacute Acircumflex Atilde\nAdieresis Aring AE Ccedilla\nEgrave Eacute Ecircumflex Edieresis\nIgrave Iacute Icircumflex Idieresis\nEth Ntilde Ograve Oacute\nOcircumflex Otilde Odieresis multiply\nOslash Ugrave Uacute Ucircumflex\nUdieresis Yacute Thorn germandbls\n \nagrave aacute acircumflex atilde\nadieresis aring ae ccedilla\negrave eacute ecircumflex edieresis\nigrave iacute icircumflex idieresis\neth ntilde ograve oacute\nocircumflex otilde odieresis divide\noslash ugrave uacute ucircumflex\nudieresis yacute thorn ydieresis'.split(/\s+/) const AFMFont = /* #__PURE__ */(function () { _createClass(AFMFont, null, [{ key: 'open', value: function open (filename) { return new AFMFont(fs.readFileSync(filename, 'utf8')) } }]) function AFMFont (contents) { _classCallCheck(this, AFMFont) this.contents = contents this.attributes = {} this.glyphWidths = {} this.boundingBoxes = {} this.kernPairs = {} this.parse() // todo: remove charWidths since appears to not be used this.charWidths = new Array(256) for (let char = 0; char <= 255; char++) { this.charWidths[char] = this.glyphWidths[characters[char]] } this.bbox = this.attributes.FontBBox.split(/\s+/).map(function (e) { return +e }) this.ascender = +(this.attributes.Ascender || 0) this.descender = +(this.attributes.Descender || 0) this.xHeight = +(this.attributes.XHeight || 0) this.capHeight = +(this.attributes.CapHeight || 0) this.lineGap = this.bbox[3] - this.bbox[1] - (this.ascender - this.descender) } _createClass(AFMFont, [{ key: 'parse', value: function parse () { let section = '' const _iterator = _createForOfIteratorHelper(this.contents.split('\n')) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const line = _step.value var match var a if (match = line.match(/^Start(\w+)/)) { section = match[1] continue } else if (match = line.match(/^End(\w+)/)) { section = '' continue } switch (section) { case 'FontMetrics': match = line.match(/(^\w+)\s+(.*)/) var key = match[1] var value = match[2] if (a = this.attributes[key]) { if (!Array.isArray(a)) { a = this.attributes[key] = [a] } a.push(value) } else { this.attributes[key] = value } break case 'CharMetrics': if (!/^CH?\s/.test(line)) { continue } var name = line.match(/\bN\s+(\.?\w+)\s*;/)[1] this.glyphWidths[name] = +line.match(/\bWX\s+(\d+)\s*;/)[1] break case 'KernPairs': match = line.match(/^KPX\s+(\.?\w+)\s+(\.?\w+)\s+(-?\d+)/) if (match) { this.kernPairs[match[1] + '\0' + match[2]] = parseInt(match[3]) } break } } } catch (err) { _iterator.e(err) } finally { _iterator.f() } } }, { key: 'encodeText', value: function encodeText (text) { const res = [] for (let i = 0, len = text.length; i < len; i++) { let char = text.charCodeAt(i) char = WIN_ANSI_MAP[char] || char res.push(char.toString(16)) } return res } }, { key: 'glyphsForString', value: function glyphsForString (string) { const glyphs = [] for (let i = 0, len = string.length; i < len; i++) { const charCode = string.charCodeAt(i) glyphs.push(this.characterToGlyph(charCode)) } return glyphs } }, { key: 'characterToGlyph', value: function characterToGlyph (character) { return characters[WIN_ANSI_MAP[character] || character] || '.notdef' } }, { key: 'widthOfGlyph', value: function widthOfGlyph (glyph) { return this.glyphWidths[glyph] || 0 } }, { key: 'getKernPair', value: function getKernPair (left, right) { return this.kernPairs[left + '\0' + right] || 0 } }, { key: 'advancesForGlyphs', value: function advancesForGlyphs (glyphs) { const advances = [] for (let index = 0; index < glyphs.length; index++) { const left = glyphs[index] const right = glyphs[index + 1] advances.push(this.widthOfGlyph(left) + this.getKernPair(left, right)) } return advances } }]) return AFMFont }()) const PDFFont = /* #__PURE__ */(function () { function PDFFont () { _classCallCheck(this, PDFFont) } _createClass(PDFFont, [{ key: 'encode', value: function encode () { throw new Error('Must be implemented by subclasses') } }, { key: 'widthOfString', value: function widthOfString () { throw new Error('Must be implemented by subclasses') } }, { key: 'ref', value: function ref () { return this.dictionary != null ? this.dictionary : this.dictionary = this.document.ref() } }, { key: 'finalize', value: function finalize () { if (this.embedded || this.dictionary == null) { return } this.embed() return this.embedded = true } }, { key: 'embed', value: function embed () { throw new Error('Must be implemented by subclasses') } }, { key: 'lineHeight', value: function lineHeight (size, includeGap) { if (includeGap == null) { includeGap = false } const gap = includeGap ? this.lineGap : 0 return (this.ascender + gap - this.descender) / 1000 * size } }]) return PDFFont }()) const STANDARD_FONTS = { Courier: function Courier () { return fs.readFileSync(__dirname + '/data/Courier.afm', 'utf8') }, 'Courier-Bold': function CourierBold () { return fs.readFileSync(__dirname + '/data/Courier-Bold.afm', 'utf8') }, 'Courier-Oblique': function CourierOblique () { return fs.readFileSync(__dirname + '/data/Courier-Oblique.afm', 'utf8') }, 'Courier-BoldOblique': function CourierBoldOblique () { return fs.readFileSync(__dirname + '/data/Courier-BoldOblique.afm', 'utf8') }, Helvetica: function Helvetica () { return fs.readFileSync(__dirname + '/data/Helvetica.afm', 'utf8') }, 'Helvetica-Bold': function HelveticaBold () { return fs.readFileSync(__dirname + '/data/Helvetica-Bold.afm', 'utf8') }, 'Helvetica-Oblique': function HelveticaOblique () { return fs.readFileSync(__dirname + '/data/Helvetica-Oblique.afm', 'utf8') }, 'Helvetica-BoldOblique': function HelveticaBoldOblique () { return fs.readFileSync(__dirname + '/data/Helvetica-BoldOblique.afm', 'utf8') }, 'Times-Roman': function TimesRoman () { return fs.readFileSync(__dirname + '/data/Times-Roman.afm', 'utf8') }, 'Times-Bold': function TimesBold () { return fs.readFileSync(__dirname + '/data/Times-Bold.afm', 'utf8') }, 'Times-Italic': function TimesItalic () { return fs.readFileSync(__dirname + '/data/Times-Italic.afm', 'utf8') }, 'Times-BoldItalic': function TimesBoldItalic () { return fs.readFileSync(__dirname + '/data/Times-BoldItalic.afm', 'utf8') }, Symbol: function Symbol () { return fs.readFileSync(__dirname + '/data/Symbol.afm', 'utf8') }, ZapfDingbats: function ZapfDingbats () { return fs.readFileSync(__dirname + '/data/ZapfDingbats.afm', 'utf8') } } const StandardFont = /* #__PURE__ */(function (_PDFFont) { _inherits(StandardFont, _PDFFont) const _super = _createSuper(StandardFont) function StandardFont (document, name, id) { let _this _classCallCheck(this, StandardFont) _this = _super.call(this) _this.document = document _this.name = name _this.id = id _this.font = new AFMFont(STANDARD_FONTS[_this.name]()) const _this$font = _this.font _this.ascender = _this$font.ascender _this.descender = _this$font.descender _this.bbox = _this$font.bbox _this.lineGap = _this$font.lineGap _this.xHeight = _this$font.xHeight _this.capHeight = _this$font.capHeight return _this } _createClass(StandardFont, [{ key: 'embed', value: function embed () { this.dictionary.data = { Type: 'Font', BaseFont: this.name, Subtype: 'Type1', Encoding: 'WinAnsiEncoding' } return this.dictionary.end() } }, { key: 'encode', value: function encode (text) { const encoded = this.font.encodeText(text) const glyphs = this.font.glyphsForString(''.concat(text)) const advances = this.font.advancesForGlyphs(glyphs) const positions = [] for (let i = 0; i < glyphs.length; i++) { const glyph = glyphs[i] positions.push({ xAdvance: advances[i], yAdvance: 0, xOffset: 0, yOffset: 0, advanceWidth: this.font.widthOfGlyph(glyph) }) } return [encoded, positions] } }, { key: 'widthOfString', value: function widthOfString (string, size) { const glyphs = this.font.glyphsForString(''.concat(string)) const advances = this.font.advancesForGlyphs(glyphs) let width = 0 const _iterator = _createForOfIteratorHelper(advances) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const advance = _step.value width += advance } } catch (err) { _iterator.e(err) } finally { _iterator.f() } const scale = size / 1000 return width * scale } }], [{ key: 'isStandardFont', value: function isStandardFont (name) { return name in STANDARD_FONTS } }]) return StandardFont }(PDFFont)) const toHex = function toHex (num) { return '0000'.concat(num.toString(16)).slice(-4) } const EmbeddedFont = /* #__PURE__ */(function (_PDFFont) { _inherits(EmbeddedFont, _PDFFont) const _super = _createSuper(EmbeddedFont) function EmbeddedFont (document, font, id) { let _this _classCallCheck(this, EmbeddedFont) _this = _super.call(this) _this.document = document _this.font = font _this.id = id _this.subset = _this.font.createSubset() _this.unicode = [[0]] _this.widths = [_this.font.getGlyph(0).advanceWidth] _this.name = _this.font.postscriptName _this.scale = 1000 / _this.font.unitsPerEm _this.ascender = _this.font.ascent * _this.scale _this.descender = _this.font.descent * _this.scale _this.xHeight = _this.font.xHeight * _this.scale _this.capHeight = _this.font.capHeight * _this.scale _this.lineGap = _this.font.lineGap * _this.scale _this.bbox = _this.font.bbox if (document.options.fontLayoutCache !== false) { _this.layoutCache = Object.create(null) } return _this } _createClass(EmbeddedFont, [{ key: 'layoutRun', value: function layoutRun (text, features) { const run = this.font.layout(text, features) // Normalize position values for (let i = 0; i < run.positions.length; i++) { const position = run.positions[i] for (const key in position) { position[key] *= this.scale } position.advanceWidth = run.glyphs[i].advanceWidth * this.scale } return run } }, { key: 'layoutCached', value: function layoutCached (text) { if (!this.layoutCache) { return this.layoutRun(text) } let cached if (cached = this.layoutCache[text]) { return cached } const run = this.layoutRun(text) this.layoutCache[text] = run return run } }, { key: 'layout', value: function layout (text, features, onlyWidth) { // Skip the cache if any user defined features are applied if (features) { return this.layoutRun(text, features) } let glyphs = onlyWidth ? null : [] let positions = onlyWidth ? null : [] let advanceWidth = 0 // Split the string by words to increase cache efficiency. // For this purpose, spaces and tabs are a good enough delimeter. let last = 0 let index = 0 while (index <= text.length) { var needle if (index === text.length && last < index || (needle = text.charAt(index), [' ', '\t'].includes(needle))) { const run = this.layoutCached(text.slice(last, ++index)) if (!onlyWidth) { glyphs = glyphs.concat(run.glyphs) positions = positions.concat(run.positions) } advanceWidth += run.advanceWidth last = index } else { index++ } } return { glyphs, positions, advanceWidth } } }, { key: 'encode', value: function encode (text, features) { const _this$layout = this.layout(text, features) const glyphs = _this$layout.glyphs const positions = _this$layout.positions const res = [] for (let i = 0; i < glyphs.length; i++) { const glyph = glyphs[i] const gid = this.subset.includeGlyph(glyph.id) res.push('0000'.concat(gid.toString(16)).slice(-4)) if (this.widths[gid] == null) { this.widths[gid] = glyph.advanceWidth * this.scale } if (this.unicode[gid] == null) { this.unicode[gid] = glyph.codePoints } } return [res, positions] } }, { key: 'widthOfString', value: function widthOfString (string, size, features) { const width = this.layout(string, features, true).advanceWidth const scale = size / 1000 return width * scale } }, { key: 'embed', value: function embed () { const _this2 = this const isCFF = this.subset.cff != null const fontFile = this.document.ref() if (isCFF) { fontFile.data.Subtype = 'CIDFontType0C' } this.subset.encodeStream().on('data', function (data) { return fontFile.write(data) }).on('end', function () { return fontFile.end() }) const familyClass = ((this.font['OS/2'] != null ? this.font['OS/2'].sFamilyClass : undefined) || 0) >> 8 let flags = 0 if (this.font.post.isFixedPitch) { flags |= 1 << 0 } if (familyClass >= 1 && familyClass <= 7) { flags |= 1 << 1 } flags |= 1 << 2 // assume the font uses non-latin characters if (familyClass === 10) { flags |= 1 << 3 } if (this.font.head.macStyle.italic) { flags |= 1 << 6 } // generate a tag (6 uppercase letters. 17 is the char code offset from '0' to 'A'. 73 will map to 'Z') const tag = [1, 2, 3, 4, 5, 6].map(function (i) { return String.fromCharCode((_this2.id.charCodeAt(i) || 73) + 17) }).join('') const name = tag + '+' + this.font.postscriptName const bbox = this.font.bbox const descriptor = this.document.ref({ Type: 'FontDescriptor', FontName: name, Flags: flags, FontBBox: [bbox.minX * this.scale, bbox.minY * this.scale, bbox.maxX * this.scale, bbox.maxY * this.scale], ItalicAngle: this.font.italicAngle, Ascent: this.ascender, Descent: this.descender, CapHeight: (this.font.capHeight || this.font.ascent) * this.scale, XHeight: (this.font.xHeight || 0) * this.scale, StemV: 0 }) // not sure how to calculate this if (isCFF) { descriptor.data.FontFile3 = fontFile } else { descriptor.data.FontFile2 = fontFile } descriptor.end() const descendantFontData = { Type: 'Font', Subtype: 'CIDFontType0', BaseFont: name, CIDSystemInfo: { Registry: new String('Adobe'), Ordering: new String('Identity'), Supplement: 0 }, FontDescriptor: descriptor, W: [0, this.widths] } if (!isCFF) { descendantFontData.Subtype = 'CIDFontType2' descendantFontData.CIDToGIDMap = 'Identity' } const descendantFont = this.document.ref(descendantFontData) descendantFont.end() this.dictionary.data = { Type: 'Font', Subtype: 'Type0', BaseFont: name, Encoding: 'Identity-H', DescendantFonts: [descendantFont], ToUnicode: this.toUnicodeCmap() } return this.dictionary.end() } // Maps the glyph ids encoded in the PDF back to unicode strings // Because of ligature substitutions and the like, there may be one or more // unicode characters represented by each glyph. }, { key: 'toUnicodeCmap', value: function toUnicodeCmap () { const cmap = this.document.ref() const entries = [] const _iterator = _createForOfIteratorHelper(this.unicode) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const codePoints = _step.value const encoded = [] // encode codePoints to utf16 const _iterator2 = _createForOfIteratorHelper(codePoints) var _step2 try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { let value = _step2.value if (value > 0xffff) { value -= 0x10000 encoded.push(toHex(value >>> 10 & 0x3ff | 0xd800)) value = 0xdc00 | value & 0x3ff } encoded.push(toHex(value)) } } catch (err) { _iterator2.e(err) } finally { _iterator2.f() } entries.push('<'.concat(encoded.join(' '), '>')) } } catch (err) { _iterator.e(err) } finally { _iterator.f() } cmap.end('/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\n1 beginbfrange\n<0000> <'.concat(toHex(entries.length - 1), '> [').concat(entries.join(' '), ']\nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend')) return cmap } }]) return EmbeddedFont }(PDFFont)) const PDFFontFactory = /* #__PURE__ */(function () { function PDFFontFactory () { _classCallCheck(this, PDFFontFactory) } _createClass(PDFFontFactory, null, [{ key: 'open', value: function open (document, src, family, id) { let font if (typeof src === 'string') { if (StandardFont.isStandardFont(src)) { return new StandardFont(document, src, id) } src = fs.readFileSync(src) } if (Buffer.isBuffer(src)) { font = _fontkit.default.create(src, family) } else if (src instanceof Uint8Array) { font = _fontkit.default.create(Buffer.from(src), family) } else if (src instanceof ArrayBuffer) { font = _fontkit.default.create(Buffer.from(new Uint8Array(src)), family) } if (font == null) { throw new Error('Not a supported font format or standard PDF font.') } return new EmbeddedFont(document, font, id) } }]) return PDFFontFactory }()) const FontsMixin = { initFonts: function initFonts () { const defaultFont = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Helvetica' // Lookup table for embedded fonts this._fontFamilies = {} this._fontCount = 0 // Font state this._fontSize = 12 this._font = null this._registeredFonts = {} // Set the default font if (defaultFont) { this.font(defaultFont) } }, font: function font (src, family, size) { let cacheKey, font if (typeof family === 'number') { size = family family = null } // check registered fonts if src is a string if (typeof src === 'string' && this._registeredFonts[src]) { cacheKey = src const _this$_registeredFont = this._registeredFonts[src] src = _this$_registeredFont.src family = _this$_registeredFont.family } else { cacheKey = family || src if (typeof cacheKey !== 'string') { cacheKey = null } } if (size != null) { this.fontSize(size) } // fast path: check if the font is already in the PDF if (font = this._fontFamilies[cacheKey]) { this._font = font return this } // load the font const id = 'F'.concat(++this._fontCount) this._font = PDFFontFactory.open(this, src, family, id) // check for existing font familes with the same name already in the PDF // useful if the font was passed as a buffer if (font = this._fontFamilies[this._font.name]) { this._font = font return this } // save the font for reuse later if (cacheKey) { this._fontFamilies[cacheKey] = this._font } if (this._font.name) { this._fontFamilies[this._font.name] = this._font } return this }, fontSize: function fontSize (_fontSize) { this._fontSize = _fontSize return this }, currentLineHeight: function currentLineHeight (includeGap) { if (includeGap == null) { includeGap = false } return this._font.lineHeight(this._fontSize, includeGap) }, registerFont: function registerFont (name, src, family) { this._registeredFonts[name] = { src, family } return this } } const LineWrapper = /* #__PURE__ */(function (_EventEmitter) { _inherits(LineWrapper, _EventEmitter) const _super = _createSuper(LineWrapper) function LineWrapper (document, options) { let _this _classCallCheck(this, LineWrapper) _this = _super.call(this) _this.document = document _this.indent = options.indent || 0 _this.characterSpacing = options.characterSpacing || 0 _this.wordSpacing = options.wordSpacing === 0 _this.columns = options.columns || 1 _this.columnGap = options.columnGap != null ? options.columnGap : 18 // 1/4 inch _this.lineWidth = (options.width - _this.columnGap * (_this.columns - 1)) / _this.columns _this.spaceLeft = _this.lineWidth _this.startX = _this.document.x _this.startY = _this.document.y _this.column = 1 _this.ellipsis = options.ellipsis _this.continuedX = 0 _this.features = options.features // calculate the maximum Y position the text can appear at if (options.height != null) { _this.height = options.height _this.maxY = _this.startY + options.height } else { _this.maxY = _this.document.page.maxY() } // handle paragraph indents _this.on('firstLine', function (options) { // if this is the first line of the text segment, and // we're continuing where we left off, indent that much // otherwise use the user specified indent option const indent = _this.continuedX || _this.indent _this.document.x += indent _this.lineWidth -= indent return _this.once('line', function () { _this.document.x -= indent _this.lineWidth += indent if (options.continued && !_this.continuedX) { _this.continuedX = _this.indent } if (!options.continued) { return _this.continuedX = 0 } }) }) // handle left aligning last lines of paragraphs _this.on('lastLine', function (options) { const align = options.align if (align === 'justify') { options.align = 'left' } _this.lastLine = true return _this.once('line', function () { _this.document.y += options.paragraphGap || 0 options.align = align return _this.lastLine = false }) }) return _this } _createClass(LineWrapper, [{ key: 'wordWidth', value: function wordWidth (word) { return this.document.widthOfString(word, this) + this.characterSpacing + this.wordSpacing } }, { key: 'eachWord', value: function eachWord (text, fn) { // setup a unicode line breaker let bk const breaker = new _linebreak.default(text) let last = null const wordWidths = Object.create(null) while (bk = breaker.nextBreak()) { var shouldContinue let word = text.slice((last != null ? last.position : undefined) || 0, bk.position) let w = wordWidths[word] != null ? wordWidths[word] : wordWidths[word] = this.wordWidth(word) // if the word is longer than the whole line, chop it up // TODO: break by grapheme clusters, not JS string characters if (w > this.lineWidth + this.continuedX) { // make some fake break objects let lbk = last const fbk = {} while (word.length) { // fit as much of the word as possible into the space we have var l, mightGrow if (w > this.spaceLeft) { // start our check at the end of our available space - this method is faster than a loop of each character and it resolves // an issue with long loops when processing massive words, such as a huge number of spaces l = Math.ceil(this.spaceLeft / (w / word.length)) w = this.wordWidth(word.slice(0, l)) mightGrow = w <= this.spaceLeft && l < word.length } else { l = word.length } let mustShrink = w > this.spaceLeft && l > 0 // shrink or grow word as necessary after our near-guess above while (mustShrink || mightGrow) { if (mustShrink) { w = this.wordWidth(word.slice(0, --l)) mustShrink = w > this.spaceLeft && l > 0 } else { w = this.wordWidth(word.slice(0, ++l)) mustShrink = w > this.spaceLeft && l > 0 mightGrow = w <= this.spaceLeft && l < word.length } } // check for the edge case where a single character cannot fit into a line. if (l === 0 && this.spaceLeft === this.lineWidth) { l = 1 } // send a required break unless this is the last piece and a linebreak is not specified fbk.required = bk.required || l < word.length shouldContinue = fn(word.slice(0, l), w, fbk, lbk) lbk = { required: false } // get the remaining piece of the word word = word.slice(l) w = this.wordWidth(word) if (shouldContinue === false) { break } } } else { // otherwise just emit the break as it was given to us shouldContinue = fn(word, w, bk, last) } if (shouldContinue === false) { break } last = bk } } }, { key: 'wrap', value: function wrap (text, options) { const _this2 = this // override options from previous continued fragments if (options.indent != null) { this.indent = options.indent } if (options.characterSpacing != null) { this.characterSpacing = options.characterSpacing } if (options.wordSpacing != null) { this.wordSpacing = options.wordSpacing } if (options.ellipsis != null) { this.ellipsis = options.ellipsis } // make sure we're actually on the page // and that the first line of is never by // itself at the bottom of a page (orphans) const nextY = this.document.y + this.document.currentLineHeight(true) if (this.document.y > this.maxY || nextY > this.maxY) { this.nextSection() } let buffer = '' let textWidth = 0 let wc = 0 let lc = 0 let y = this.document.y // used to reset Y pos if options.continued (below) const emitLine = function emitLine () { options.textWidth = textWidth + _this2.wordSpacing * (wc - 1) options.wordCount = wc options.lineWidth = _this2.lineWidth y = _this2.document.y _this2.emit('line', buffer, options, _this2) return lc++ } this.emit('sectionStart', options, this) this.eachWord(text, function (word, w, bk, last) { if (last == null || last.required) { _this2.emit('firstLine', options, _this2) _this2.spaceLeft = _this2.lineWidth } if (w <= _this2.spaceLeft) { buffer += word textWidth += w wc++ } if (bk.required || w > _this2.spaceLeft) { // if the user specified a max height and an ellipsis, and is about to pass the // max height and max columns after the next line, append the ellipsis const lh = _this2.document.currentLineHeight(true) if (_this2.height != null && _this2.ellipsis && _this2.document.y + lh * 2 > _this2.maxY && _this2.column >= _this2.columns) { if (_this2.ellipsis === true) { _this2.ellipsis = '…' } // map default ellipsis character buffer = buffer.replace(/\s+$/, '') textWidth = _this2.wordWidth(buffer + _this2.ellipsis) // remove characters from the buffer until the ellipsis fits // to avoid infinite loop need to stop while-loop if buffer is empty string while (buffer && textWidth > _this2.lineWidth) { buffer = buffer.slice(0, -1).replace(/\s+$/, '') textWidth = _this2.wordWidth(buffer + _this2.ellipsis) } // need to add ellipsis only if there is enough space for it if (textWidth <= _this2.lineWidth) { buffer = buffer + _this2.ellipsis } textWidth = _this2.wordWidth(buffer) } if (bk.required) { if (w > _this2.spaceLeft) { emitLine() buffer = word textWidth = w wc = 1 } _this2.emit('lastLine', options, _this2) } emitLine() // if we've reached the edge of the page, // continue on a new page or column if (_this2.document.y + lh > _this2.maxY) { const shouldContinue = _this2.nextSection() // stop if we reached the maximum height if (!shouldContinue) { wc = 0 buffer = '' return false } } // reset the space left and buffer if (bk.required) { _this2.spaceLeft = _this2.lineWidth buffer = '' textWidth = 0 return wc = 0 } else { // reset the space left and buffer _this2.spaceLeft = _this2.lineWidth - w buffer = word textWidth = w return wc = 1 } } else { return _this2.spaceLeft -= w } }) if (wc > 0) { this.emit('lastLine', options, this) emitLine() } this.emit('sectionEnd', options, this) // if the wrap is set to be continued, save the X position // to start the first line of the next segment at, and reset // the y position if (options.continued === true) { if (lc > 1) { this.continuedX = 0 } this.continuedX += options.textWidth || 0 return this.document.y = y } else { return this.document.x = this.startX } } }, { key: 'nextSection', value: function nextSection (options) { this.emit('sectionEnd', options, this) if (++this.column > this.columns) { // if a max height was specified by the user, we're done. // otherwise, the default is to make a new page at the bottom. if (this.height != null) { return false } this.document.continueOnNewPage() this.column = 1 this.startY = this.document.page.margins.top this.maxY = this.document.page.maxY() this.document.x = this.startX if (this.document._fillColor) { let _this$document; (_this$document = this.document).fillColor.apply(_this$document, _toConsumableArray(this.document._fillColor)) } this.emit('pageBreak', options, this) } else { this.document.x += this.lineWidth + this.columnGap this.document.y = this.startY this.emit('columnBreak', options, this) } this.emit('sectionStart', options, this) return true } }]) return LineWrapper }(_events.EventEmitter)) const number$2 = PDFObject.number const TextMixin = { initText: function initText () { this._line = this._line.bind(this) // Current coordinates this.x = 0 this.y = 0 return this._lineGap = 0 }, lineGap: function lineGap (_lineGap) { this._lineGap = _lineGap return this }, moveDown: function moveDown (lines) { if (lines == null) { lines = 1 } this.y += this.currentLineHeight(true) * lines + this._lineGap return this }, moveUp: function moveUp (lines) { if (lines == null) { lines = 1 } this.y -= this.currentLineHeight(true) * lines + this._lineGap return this }, _text: function _text (text, x, y, options, lineCallback) { const _this = this options = this._initOptions(x, y, options) // Convert text to a string text = text == null ? '' : ''.concat(text) // if the wordSpacing option is specified, remove multiple consecutive spaces if (options.wordSpacing) { text = text.replace(/\s{2,}/g, ' ') } const addStructure = function addStructure () { if (options.structParent) { options.structParent.add(_this.struct(options.structType || 'P', [_this.markStructureContent(options.structType || 'P')])) } } // word wrapping if (options.width) { let wrapper = this._wrapper if (!wrapper) { wrapper = new LineWrapper(this, options) wrapper.on('line', lineCallback) wrapper.on('firstLine', addStructure) } this._wrapper = options.continued ? wrapper : null this._textOptions = options.continued ? options : null wrapper.wrap(text, options) // render paragraphs as single lines } else { const _iterator = _createForOfIteratorHelper(text.split('\n')) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const line = _step.value addStructure() lineCallback(line, options) } } catch (err) { _iterator.e(err) } finally { _iterator.f() } } return this }, text: function text (_text2, x, y, options) { return this._text(_text2, x, y, options, this._line) }, widthOfString: function widthOfString (string) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} return this._font.widthOfString(string, this._fontSize, options.features) + (options.characterSpacing || 0) * (string.length - 1) }, heightOfString: function heightOfString (text, options) { const _this2 = this const x = this.x const y = this.y options = this._initOptions(options) options.height = Infinity // don't break pages const lineGap = options.lineGap || this._lineGap || 0 this._text(text, this.x, this.y, options, function () { return _this2.y += _this2.currentLineHeight(true) + lineGap }) const height = this.y - y this.x = x this.y = y return height }, list: function list (_list, x, y, options, wrapper) { const _this3 = this options = this._initOptions(x, y, options) const listType = options.listType || 'bullet' const unit = Math.round(this._font.ascender / 1000 * this._fontSize) const midLine = unit / 2 const r = options.bulletRadius || unit / 3 const indent = options.textIndent || (listType === 'bullet' ? r * 5 : unit * 2) const itemIndent = options.bulletIndent || (listType === 'bullet' ? r * 8 : unit * 2) let level = 1 const items = [] const levels = [] const numbers = [] const flatten = function flatten (list) { let n = 1 for (let _i = 0; _i < list.length; _i++) { const item = list[_i] if (Array.isArray(item)) { level++ flatten(item) level-- } else { items.push(item) levels.push(level) if (listType !== 'bullet') { numbers.push(n++) } } } } flatten(_list) const label = function label (n) { switch (listType) { case 'numbered': return ''.concat(n, '.') case 'lettered': var letter = String.fromCharCode((n - 1) % 26 + 65) var times = Math.floor((n - 1) / 26 + 1) var text = Array(times + 1).join(letter) return ''.concat(text, '.') } } wrapper = new LineWrapper(this, options) wrapper.on('line', this._line) level = 1 let i = 0 wrapper.on('firstLine', function () { let item, itemType, labelType, bodyType if (options.structParent) { if (options.structTypes) { const _options$structTypes = _slicedToArray(options.structTypes, 3) itemType = _options$structTypes[0] labelType = _options$structTypes[1] bodyType = _options$structTypes[2] } else { itemType = 'LI' labelType = 'Lbl' bodyType = 'LBody' } } if (itemType) { item = _this3.struct(itemType) options.structParent.add(item) } else if (options.structParent) { item = options.structParent } let l if ((l = levels[i++]) !== level) { const diff = itemIndent * (l - level) _this3.x += diff wrapper.lineWidth -= diff level = l } if (item && (labelType || bodyType)) { item.add(_this3.struct(labelType || bodyType, [_this3.markStructureContent(labelType || bodyType)])) } switch (listType) { case 'bullet': _this3.circle(_this3.x - indent + r, _this3.y + midLine, r) _this3.fill() break case 'numbered': case 'lettered': var text = label(numbers[i - 1]) _this3._fragment(text, _this3.x - indent, _this3.y, options) break } if (item && labelType && bodyType) { item.add(_this3.struct(bodyType, [_this3.markStructureContent(bodyType)])) } if (item && item !== options.structParent) { item.end() } }) wrapper.on('sectionStart', function () { const pos = indent + itemIndent * (level - 1) _this3.x += pos return wrapper.lineWidth -= pos }) wrapper.on('sectionEnd', function () { const pos = indent + itemIndent * (level - 1) _this3.x -= pos return wrapper.lineWidth += pos }) wrapper.wrap(items.join('\n'), options) return this }, _initOptions: function _initOptions () { let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} const y = arguments.length > 1 ? arguments[1] : undefined let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {} if (typeof x === 'object') { options = x x = null } // clone options object const result = Object.assign({}, options) // extend options with previous values for continued text if (this._textOptions) { for (const key in this._textOptions) { const val = this._textOptions[key] if (key !== 'continued') { if (result[key] === undefined) { result[key] = val } } } } // Update the current position if (x != null) { this.x = x } if (y != null) { this.y = y } // wrap to margins if no x or y position passed if (result.lineBreak !== false) { if (result.width == null) { result.width = this.page.width - this.x - this.page.margins.right } result.width = Math.max(result.width, 0) } if (!result.columns) { result.columns = 0 } if (result.columnGap == null) { result.columnGap = 18 } // 1/4 inch return result }, _line: function _line (text) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} const wrapper = arguments.length > 2 ? arguments[2] : undefined this._fragment(text, this.x, this.y, options) const lineGap = options.lineGap || this._lineGap || 0 if (!wrapper) { return this.x += this.widthOfString(text) } else { return this.y += this.currentLineHeight(true) + lineGap } }, _fragment: function _fragment (text, x, y, options) { const _this4 = this let dy, encoded, i, positions, textWidth, words text = ''.concat(text).replace(/\n/g, '') if (text.length === 0) { return } // handle options const align = options.align || 'left' let wordSpacing = options.wordSpacing || 0 const characterSpacing = options.characterSpacing || 0 // text alignments if (options.width) { switch (align) { case 'right': textWidth = this.widthOfString(text.replace(/\s+$/, ''), options) x += options.lineWidth - textWidth break case 'center': x += options.lineWidth / 2 - options.textWidth / 2 break case 'justify': // calculate the word spacing value words = text.trim().split(/\s+/) textWidth = this.widthOfString(text.replace(/\s+/g, ''), options) var spaceWidth = this.widthOfString(' ') + characterSpacing wordSpacing = Math.max(0, (options.lineWidth - textWidth) / Math.max(1, words.length - 1) - spaceWidth) break } } // text baseline alignments based on http://wiki.apache.org/xmlgraphics-fop/LineLayout/AlignmentHandling if (typeof options.baseline === 'number') { dy = -options.baseline } else { switch (options.baseline) { case 'svg-middle': dy = 0.5 * this._font.xHeight break case 'middle': case 'svg-central': dy = 0.5 * (this._font.descender + this._font.ascender) break case 'bottom': case 'ideographic': dy = this._font.descender break case 'alphabetic': dy = 0 break case 'mathematical': dy = 0.5 * this._font.ascender break case 'hanging': dy = 0.8 * this._font.ascender break case 'top': dy = this._font.ascender break default: dy = this._font.ascender } dy = dy / 1000 * this._fontSize } // calculate the actual rendered width of the string after word and character spacing const renderedWidth = options.textWidth + wordSpacing * (options.wordCount - 1) + characterSpacing * (text.length - 1) // create link annotations if the link option is given if (options.link != null) { this.link(x, y, renderedWidth, this.currentLineHeight(), options.link) } if (options.goTo != null) { this.goTo(x, y, renderedWidth, this.currentLineHeight(), options.goTo) } if (options.destination != null) { this.addNamedDestination(options.destination, 'XYZ', x, y, null) } // create underline if (options.underline) { this.save() if (!options.stroke) { this.strokeColor.apply(this, _toConsumableArray(this._fillColor || [])) } const lineWidth = this._fontSize < 10 ? 0.5 : Math.floor(this._fontSize / 10) this.lineWidth(lineWidth) const lineY = y + this.currentLineHeight() - lineWidth this.moveTo(x, lineY) this.lineTo(x + renderedWidth, lineY) this.stroke() this.restore() } // create strikethrough line if (options.strike) { this.save() if (!options.stroke) { this.strokeColor.apply(this, _toConsumableArray(this._fillColor || [])) } const _lineWidth = this._fontSize < 10 ? 0.5 : Math.floor(this._fontSize / 10) this.lineWidth(_lineWidth) const _lineY = y + this.currentLineHeight() / 2 this.moveTo(x, _lineY) this.lineTo(x + renderedWidth, _lineY) this.stroke() this.restore() } this.save() // oblique (angle in degrees or boolean) if (options.oblique) { let skew if (typeof options.oblique === 'number') { skew = -Math.tan(options.oblique * Math.PI / 180) } else { skew = -0.25 } this.transform(1, 0, 0, 1, x, y) this.transform(1, 0, skew, 1, -skew * dy, 0) this.transform(1, 0, 0, 1, -x, -y) } // flip coordinate system this.transform(1, 0, 0, -1, 0, this.page.height) y = this.page.height - y - dy // add current font to page if necessary if (this.page.fonts[this._font.id] == null) { this.page.fonts[this._font.id] = this._font.ref() } // begin the text object this.addContent('BT') // text position this.addContent('1 0 0 1 '.concat(number$2(x), ' ').concat(number$2(y), ' Tm')) // font and font size this.addContent('/'.concat(this._font.id, ' ').concat(number$2(this._fontSize), ' Tf')) // rendering mode const mode = options.fill && options.stroke ? 2 : options.stroke ? 1 : 0 if (mode) { this.addContent(''.concat(mode, ' Tr')) } // Character spacing if (characterSpacing) { this.addContent(''.concat(number$2(characterSpacing), ' Tc')) } // Add the actual text // If we have a word spacing value, we need to encode each word separately // since the normal Tw operator only works on character code 32, which isn't // used for embedded fonts. if (wordSpacing) { words = text.trim().split(/\s+/) wordSpacing += this.widthOfString(' ') + characterSpacing wordSpacing *= 1000 / this._fontSize encoded = [] positions = [] const _iterator2 = _createForOfIteratorHelper(words) let _step2 try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { const word = _step2.value const _this$_font$encode = this._font.encode(word, options.features) const _this$_font$encode2 = _slicedToArray(_this$_font$encode, 2) const encodedWord = _this$_font$encode2[0] const positionsWord = _this$_font$encode2[1] encoded = encoded.concat(encodedWord) positions = positions.concat(positionsWord) // add the word spacing to the end of the word // clone object because of cache const space = {} const object = positions[positions.length - 1] for (const key in object) { const val = object[key] space[key] = val } space.xAdvance += wordSpacing positions[positions.length - 1] = space } } catch (err) { _iterator2.e(err) } finally { _iterator2.f() } } else { const _this$_font$encode3 = this._font.encode(text, options.features) const _this$_font$encode4 = _slicedToArray(_this$_font$encode3, 2) encoded = _this$_font$encode4[0] positions = _this$_font$encode4[1] } const scale = this._fontSize / 1000 const commands = [] let last = 0 let hadOffset = false // Adds a segment of text to the TJ command buffer const addSegment = function addSegment (cur) { if (last < cur) { const hex = encoded.slice(last, cur).join('') const advance = positions[cur - 1].xAdvance - positions[cur - 1].advanceWidth commands.push('<'.concat(hex, '> ').concat(number$2(-advance))) } return last = cur } // Flushes the current TJ commands to the output stream const flush = function flush (i) { addSegment(i) if (commands.length > 0) { _this4.addContent('['.concat(commands.join(' '), '] TJ')) return commands.length = 0 } } for (i = 0; i < positions.length; i++) { // If we have an x or y offset, we have to break out of the current TJ command // so we can move the text position. const pos = positions[i] if (pos.xOffset || pos.yOffset) { // Flush the current buffer flush(i) // Move the text position and flush just the current character this.addContent('1 0 0 1 '.concat(number$2(x + pos.xOffset * scale), ' ').concat(number$2(y + pos.yOffset * scale), ' Tm')) flush(i + 1) hadOffset = true } else { // If the last character had an offset, reset the text position if (hadOffset) { this.addContent('1 0 0 1 '.concat(number$2(x), ' ').concat(number$2(y), ' Tm')) hadOffset = false } // Group segments that don't have any advance adjustments if (pos.xAdvance - pos.advanceWidth !== 0) { addSegment(i + 1) } } x += pos.xAdvance * scale } // Flush any remaining commands flush(i) // end the text object this.addContent('ET') // restore flipped coordinate system return this.restore() } } const MARKERS = [0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc5, 0xffc6, 0xffc7, 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf] const COLOR_SPACE_MAP = { 1: 'DeviceGray', 3: 'DeviceRGB', 4: 'DeviceCMYK' } const JPEG = /* #__PURE__ */(function () { function JPEG (data, label) { _classCallCheck(this, JPEG) let marker this.data = data this.label = label if (this.data.readUInt16BE(0) !== 0xffd8) { throw 'SOI not found in JPEG' } let pos = 2 while (pos < this.data.length) { marker = this.data.readUInt16BE(pos) pos += 2 if (MARKERS.includes(marker)) { break } pos += this.data.readUInt16BE(pos) } if (!MARKERS.includes(marker)) { throw 'Invalid JPEG.' } pos += 2 this.bits = this.data[pos++] this.height = this.data.readUInt16BE(pos) pos += 2 this.width = this.data.readUInt16BE(pos) pos += 2 const channels = this.data[pos++] this.colorSpace = COLOR_SPACE_MAP[channels] this.obj = null } _createClass(JPEG, [{ key: 'embed', value: function embed (document) { if (this.obj) { return } this.obj = document.ref({ Type: 'XObject', Subtype: 'Image', BitsPerComponent: this.bits, Width: this.width, Height: this.height, ColorSpace: this.colorSpace, Filter: 'DCTDecode' }) // add extra decode params for CMYK images. By swapping the // min and max values from the default, we invert the colors. See // section 4.8.4 of the spec. if (this.colorSpace === 'DeviceCMYK') { this.obj.data.Decode = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0] } this.obj.end(this.data) // free memory return this.data = null } }]) return JPEG }()) const PNGImage = /* #__PURE__ */(function () { function PNGImage (data, label) { _classCallCheck(this, PNGImage) this.label = label this.image = new _pngJs.default(data) this.width = this.image.width this.height = this.image.height this.imgData = this.image.imgData this.obj = null } _createClass(PNGImage, [{ key: 'embed', value: function embed (document) { let dataDecoded = false this.document = document if (this.obj) { return } const hasAlphaChannel = this.image.hasAlphaChannel const isInterlaced = this.image.interlaceMethod === 1 this.obj = this.document.ref({ Type: 'XObject', Subtype: 'Image', BitsPerComponent: hasAlphaChannel ? 8 : this.image.bits, Width: this.width, Height: this.height, Filter: 'FlateDecode' }) if (!hasAlphaChannel) { const params = this.document.ref({ Predictor: isInterlaced ? 1 : 15, Colors: this.image.colors, BitsPerComponent: this.image.bits, Columns: this.width }) this.obj.data.DecodeParms = params params.end() } if (this.image.palette.length === 0) { this.obj.data.ColorSpace = this.image.colorSpace } else { // embed the color palette in the PDF as an object stream const palette = this.document.ref() palette.end(Buffer.from(this.image.palette)) // build the color space array for the image this.obj.data.ColorSpace = ['Indexed', 'DeviceRGB', this.image.palette.length / 3 - 1, palette] } // For PNG color types 0, 2 and 3, the transparency data is stored in // a dedicated PNG chunk. if (this.image.transparency.grayscale != null) { // Use Color Key Masking (spec section 4.8.5) // An array with N elements, where N is two times the number of color components. const val = this.image.transparency.grayscale this.obj.data.Mask = [val, val] } else if (this.image.transparency.rgb) { // Use Color Key Masking (spec section 4.8.5) // An array with N elements, where N is two times the number of color components. const rgb = this.image.transparency.rgb const mask = [] const _iterator = _createForOfIteratorHelper(rgb) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const x = _step.value mask.push(x, x) } } catch (err) { _iterator.e(err) } finally { _iterator.f() } this.obj.data.Mask = mask } else if (this.image.transparency.indexed) { // Create a transparency SMask for the image based on the data // in the PLTE and tRNS sections. See below for details on SMasks. dataDecoded = true return this.loadIndexedAlphaChannel() } else if (hasAlphaChannel) { // For PNG color types 4 and 6, the transparency data is stored as a alpha // channel mixed in with the main image data. Separate this data out into an // SMask object and store it separately in the PDF. dataDecoded = true return this.splitAlphaChannel() } if (isInterlaced && !dataDecoded) { return this.decodeData() } this.finalize() } }, { key: 'finalize', value: function finalize () { if (this.alphaChannel) { const sMask = this.document.ref({ Type: 'XObject', Subtype: 'Image', Height: this.height, Width: this.width, BitsPerComponent: 8, Filter: 'FlateDecode', ColorSpace: 'DeviceGray', Decode: [0, 1] }) sMask.end(this.alphaChannel) this.obj.data.SMask = sMask } // add the actual image data this.obj.end(this.imgData) // free memory this.image = null return this.imgData = null } }, { key: 'splitAlphaChannel', value: function splitAlphaChannel () { const _this = this return this.image.decodePixels(function (pixels) { let a, p const colorCount = _this.image.colors const pixelCount = _this.width * _this.height const imgData = Buffer.alloc(pixelCount * colorCount) const alphaChannel = Buffer.alloc(pixelCount) let i = p = a = 0 const len = pixels.length // For 16bit images copy only most significant byte (MSB) - PNG data is always stored in network byte order (MSB first) const skipByteCount = _this.image.bits === 16 ? 1 : 0 while (i < len) { for (let colorIndex = 0; colorIndex < colorCount; colorIndex++) { imgData[p++] = pixels[i++] i += skipByteCount } alphaChannel[a++] = pixels[i++] i += skipByteCount } _this.imgData = _zlib.default.deflateSync(imgData) _this.alphaChannel = _zlib.default.deflateSync(alphaChannel) return _this.finalize() }) } }, { key: 'loadIndexedAlphaChannel', value: function loadIndexedAlphaChannel () { const _this2 = this const transparency = this.image.transparency.indexed return this.image.decodePixels(function (pixels) { const alphaChannel = Buffer.alloc(_this2.width * _this2.height) let i = 0 for (let j = 0, end = pixels.length; j < end; j++) { alphaChannel[i++] = transparency[pixels[j]] } _this2.alphaChannel = _zlib.default.deflateSync(alphaChannel) return _this2.finalize() }) } }, { key: 'decodeData', value: function decodeData () { const _this3 = this this.image.decodePixels(function (pixels) { _this3.imgData = _zlib.default.deflateSync(pixels) _this3.finalize() }) } }]) return PNGImage }()) const PDFImage = /* #__PURE__ */(function () { function PDFImage () { _classCallCheck(this, PDFImage) } _createClass(PDFImage, null, [{ key: 'open', value: function open (src, label) { let data if (Buffer.isBuffer(src)) { data = src } else if (src instanceof ArrayBuffer) { data = Buffer.from(new Uint8Array(src)) } else { let match if (match = /^data:.+;base64,(.*)$/.exec(src)) { data = Buffer.from(match[1], 'base64') } else { data = fs.readFileSync(src) if (!data) { return } } } if (data[0] === 0xff && data[1] === 0xd8) { return new JPEG(data, label) } else if (data[0] === 0x89 && data.toString('ascii', 1, 4) === 'PNG') { return new PNGImage(data, label) } else { throw new Error('Unknown image format.') } } }]) return PDFImage }()) const ImagesMixin = { initImages: function initImages () { this._imageRegistry = {} return this._imageCount = 0 }, image: function image (src, x, y) { let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {} let bh, bp, bw, image, ip, left, left1 if (typeof x === 'object') { options = x x = null } x = (left = x != null ? x : options.x) != null ? left : this.x y = (left1 = y != null ? y : options.y) != null ? left1 : this.y if (typeof src === 'string') { image = this._imageRegistry[src] } if (!image) { if (src.width && src.height) { image = src } else { image = this.openImage(src) } } if (!image.obj) { image.embed(this) } if (this.page.xobjects[image.label] == null) { this.page.xobjects[image.label] = image.obj } let w = options.width || image.width let h = options.height || image.height if (options.width && !options.height) { const wp = w / image.width w = image.width * wp h = image.height * wp } else if (options.height && !options.width) { const hp = h / image.height w = image.width * hp h = image.height * hp } else if (options.scale) { w = image.width * options.scale h = image.height * options.scale } else if (options.fit) { const _options$fit = _slicedToArray(options.fit, 2) bw = _options$fit[0] bh = _options$fit[1] bp = bw / bh ip = image.width / image.height if (ip > bp) { w = bw h = bw / ip } else { h = bh w = bh * ip } } else if (options.cover) { const _options$cover = _slicedToArray(options.cover, 2) bw = _options$cover[0] bh = _options$cover[1] bp = bw / bh ip = image.width / image.height if (ip > bp) { h = bh w = bh * ip } else { w = bw h = bw / ip } } if (options.fit || options.cover) { if (options.align === 'center') { x = x + bw / 2 - w / 2 } else if (options.align === 'right') { x = x + bw - w } if (options.valign === 'center') { y = y + bh / 2 - h / 2 } else if (options.valign === 'bottom') { y = y + bh - h } } // create link annotations if the link option is given if (options.link != null) { this.link(x, y, w, h, options.link) } if (options.goTo != null) { this.goTo(x, y, w, h, options.goTo) } if (options.destination != null) { this.addNamedDestination(options.destination, 'XYZ', x, y, null) } // Set the current y position to below the image if it is in the document flow if (this.y === y) { this.y += h } this.save() this.transform(w, 0, 0, -h, x, y + h) this.addContent('/'.concat(image.label, ' Do')) this.restore() return this }, openImage: function openImage (src) { let image if (typeof src === 'string') { image = this._imageRegistry[src] } if (!image) { image = PDFImage.open(src, 'I'.concat(++this._imageCount)) if (typeof src === 'string') { this._imageRegistry[src] = image } } return image } } const AnnotationsMixin = { annotate: function annotate (x, y, w, h, options) { options.Type = 'Annot' options.Rect = this._convertRect(x, y, w, h) options.Border = [0, 0, 0] if (options.Subtype === 'Link' && typeof options.F === 'undefined') { options.F = 1 << 2 // Print Annotation Flag } if (options.Subtype !== 'Link') { if (options.C == null) { options.C = this._normalizeColor(options.color || [0, 0, 0]) } } // convert colors delete options.color if (typeof options.Dest === 'string') { options.Dest = new String(options.Dest) } // Capitalize keys for (const key in options) { const val = options[key] options[key[0].toUpperCase() + key.slice(1)] = val } const ref = this.ref(options) this.page.annotations.push(ref) ref.end() return this }, note: function note (x, y, w, h, contents) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} options.Subtype = 'Text' options.Contents = new String(contents) options.Name = 'Comment' if (options.color == null) { options.color = [243, 223, 92] } return this.annotate(x, y, w, h, options) }, goTo: function goTo (x, y, w, h, name) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} options.Subtype = 'Link' options.A = this.ref({ S: 'GoTo', D: new String(name) }) options.A.end() return this.annotate(x, y, w, h, options) }, link: function link (x, y, w, h, url) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} options.Subtype = 'Link' if (typeof url === 'number') { // Link to a page in the document (the page must already exist) const pages = this._root.data.Pages.data if (url >= 0 && url < pages.Kids.length) { options.A = this.ref({ S: 'GoTo', D: [pages.Kids[url], 'XYZ', null, null, null] }) options.A.end() } else { throw new Error('The document has no page '.concat(url)) } } else { // Link to an external url options.A = this.ref({ S: 'URI', URI: new String(url) }) options.A.end() } return this.annotate(x, y, w, h, options) }, _markup: function _markup (x, y, w, h) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} const _this$_convertRect = this._convertRect(x, y, w, h) const _this$_convertRect2 = _slicedToArray(_this$_convertRect, 4) const x1 = _this$_convertRect2[0] const y1 = _this$_convertRect2[1] const x2 = _this$_convertRect2[2] const y2 = _this$_convertRect2[3] options.QuadPoints = [x1, y2, x2, y2, x1, y1, x2, y1] options.Contents = new String() return this.annotate(x, y, w, h, options) }, highlight: function highlight (x, y, w, h) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} options.Subtype = 'Highlight' if (options.color == null) { options.color = [241, 238, 148] } return this._markup(x, y, w, h, options) }, underline: function underline (x, y, w, h) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} options.Subtype = 'Underline' return this._markup(x, y, w, h, options) }, strike: function strike (x, y, w, h) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} options.Subtype = 'StrikeOut' return this._markup(x, y, w, h, options) }, lineAnnotation: function lineAnnotation (x1, y1, x2, y2) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} options.Subtype = 'Line' options.Contents = new String() options.L = [x1, this.page.height - y1, x2, this.page.height - y2] return this.annotate(x1, y1, x2, y2, options) }, rectAnnotation: function rectAnnotation (x, y, w, h) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} options.Subtype = 'Square' options.Contents = new String() return this.annotate(x, y, w, h, options) }, ellipseAnnotation: function ellipseAnnotation (x, y, w, h) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} options.Subtype = 'Circle' options.Contents = new String() return this.annotate(x, y, w, h, options) }, textAnnotation: function textAnnotation (x, y, w, h, text) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} options.Subtype = 'FreeText' options.Contents = new String(text) options.DA = new String() return this.annotate(x, y, w, h, options) }, fileAnnotation: function fileAnnotation (x, y, w, h) { const file = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {} const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} // create hidden file const filespec = this.file(file.src, Object.assign({ hidden: true }, file)) options.Subtype = 'FileAttachment' options.FS = filespec // add description from filespec unless description (Contents) has already been set if (options.Contents) { options.Contents = new String(options.Contents) } else if (filespec.data.Desc) { options.Contents = filespec.data.Desc } return this.annotate(x, y, w, h, options) }, _convertRect: function _convertRect (x1, y1, w, h) { // flip y1 and y2 let y2 = y1 y1 += h // make x2 let x2 = x1 + w // apply current transformation matrix to points const _this$_ctm = _slicedToArray(this._ctm, 6) const m0 = _this$_ctm[0] const m1 = _this$_ctm[1] const m2 = _this$_ctm[2] const m3 = _this$_ctm[3] const m4 = _this$_ctm[4] const m5 = _this$_ctm[5] x1 = m0 * x1 + m2 * y1 + m4 y1 = m1 * x1 + m3 * y1 + m5 x2 = m0 * x2 + m2 * y2 + m4 y2 = m1 * x2 + m3 * y2 + m5 return [x1, y1, x2, y2] } } const PDFOutline = /* #__PURE__ */(function () { function PDFOutline (document, parent, title, dest) { const options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { expanded: false } _classCallCheck(this, PDFOutline) this.document = document this.options = options this.outlineData = {} if (dest !== null) { this.outlineData.Dest = [dest.dictionary, 'Fit'] } if (parent !== null) { this.outlineData.Parent = parent } if (title !== null) { this.outlineData.Title = new String(title) } this.dictionary = this.document.ref(this.outlineData) this.children = [] } _createClass(PDFOutline, [{ key: 'addItem', value: function addItem (title) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { expanded: false } const result = new PDFOutline(this.document, this.dictionary, title, this.document.page, options) this.children.push(result) return result } }, { key: 'endOutline', value: function endOutline () { if (this.children.length > 0) { if (this.options.expanded) { this.outlineData.Count = this.children.length } const first = this.children[0] const last = this.children[this.children.length - 1] this.outlineData.First = first.dictionary this.outlineData.Last = last.dictionary for (let i = 0, len = this.children.length; i < len; i++) { const child = this.children[i] if (i > 0) { child.outlineData.Prev = this.children[i - 1].dictionary } if (i < this.children.length - 1) { child.outlineData.Next = this.children[i + 1].dictionary } child.endOutline() } } return this.dictionary.end() } }]) return PDFOutline }()) const OutlineMixin = { initOutline: function initOutline () { return this.outline = new PDFOutline(this, null, null, null) }, endOutline: function endOutline () { this.outline.endOutline() if (this.outline.children.length > 0) { this._root.data.Outlines = this.outline.dictionary return this._root.data.PageMode = 'UseOutlines' } } } /* PDFStructureContent - a reference to a marked structure content By Ben Schmidt */ const PDFStructureContent = /* #__PURE__ */(function () { function PDFStructureContent (pageRef, mcid) { _classCallCheck(this, PDFStructureContent) this.refs = [{ pageRef, mcid }] } _createClass(PDFStructureContent, [{ key: 'push', value: function push (structContent) { const _this = this structContent.refs.forEach(function (ref) { return _this.refs.push(ref) }) } }]) return PDFStructureContent }()) const PDFStructureElement = /* #__PURE__ */(function () { function PDFStructureElement (document, type) { const _this = this let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {} let children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null _classCallCheck(this, PDFStructureElement) this.document = document this._attached = false this._ended = false this._flushed = false this.dictionary = document.ref({ // Type: "StructElem", S: type }) const data = this.dictionary.data if (Array.isArray(options) || this._isValidChild(options)) { children = options options = {} } if (typeof options.title !== 'undefined') { data.T = new String(options.title) } if (typeof options.lang !== 'undefined') { data.Lang = new String(options.lang) } if (typeof options.alt !== 'undefined') { data.Alt = new String(options.alt) } if (typeof options.expanded !== 'undefined') { data.E = new String(options.expanded) } if (typeof options.actual !== 'undefined') { data.ActualText = new String(options.actual) } this._children = [] if (children) { if (!Array.isArray(children)) { children = [children] } children.forEach(function (child) { return _this.add(child) }) this.end() } } _createClass(PDFStructureElement, [{ key: 'add', value: function add (child) { if (this._ended) { throw new Error('Cannot add child to already-ended structure element') } if (!this._isValidChild(child)) { throw new Error('Invalid structure element child') } if (child instanceof PDFStructureElement) { child.setParent(this.dictionary) if (this._attached) { child.setAttached() } } if (child instanceof PDFStructureContent) { this._addContentToParentTree(child) } if (typeof child === 'function' && this._attached) { // _contentForClosure() adds the content to the parent tree child = this._contentForClosure(child) } this._children.push(child) return this } }, { key: '_addContentToParentTree', value: function _addContentToParentTree (content) { const _this2 = this content.refs.forEach(function (_ref) { const pageRef = _ref.pageRef const mcid = _ref.mcid const pageStructParents = _this2.document.getStructParentTree().get(pageRef.data.StructParents) pageStructParents[mcid] = _this2.dictionary }) } }, { key: 'setParent', value: function setParent (parentRef) { if (this.dictionary.data.P) { throw new Error('Structure element added to more than one parent') } this.dictionary.data.P = parentRef this._flush() } }, { key: 'setAttached', value: function setAttached () { const _this3 = this if (this._attached) { return } this._children.forEach(function (child, index) { if (child instanceof PDFStructureElement) { child.setAttached() } if (typeof child === 'function') { _this3._children[index] = _this3._contentForClosure(child) } }) this._attached = true this._flush() } }, { key: 'end', value: function end () { if (this._ended) { return } this._children.filter(function (child) { return child instanceof PDFStructureElement }).forEach(function (child) { return child.end() }) this._ended = true this._flush() } }, { key: '_isValidChild', value: function _isValidChild (child) { return child instanceof PDFStructureElement || child instanceof PDFStructureContent || typeof child === 'function' } }, { key: '_contentForClosure', value: function _contentForClosure (closure) { const content = this.document.markStructureContent(this.dictionary.data.S) closure() this.document.endMarkedContent() this._addContentToParentTree(content) return content } }, { key: '_isFlushable', value: function _isFlushable () { if (!this.dictionary.data.P || !this._ended) { return false } return this._children.every(function (child) { if (typeof child === 'function') { return false } if (child instanceof PDFStructureElement) { return child._isFlushable() } return true }) } }, { key: '_flush', value: function _flush () { const _this4 = this if (this._flushed || !this._isFlushable()) { return } this.dictionary.data.K = [] this._children.forEach(function (child) { return _this4._flushChild(child) }) this.dictionary.end() // free memory used by children; the dictionary itself may still be // referenced by a parent structure element or root, but we can // at least trim the tree here this._children = [] this.dictionary.data.K = null this._flushed = true } }, { key: '_flushChild', value: function _flushChild (child) { const _this5 = this if (child instanceof PDFStructureElement) { this.dictionary.data.K.push(child.dictionary) } if (child instanceof PDFStructureContent) { child.refs.forEach(function (_ref2) { const pageRef = _ref2.pageRef const mcid = _ref2.mcid if (!_this5.dictionary.data.Pg) { _this5.dictionary.data.Pg = pageRef } if (_this5.dictionary.data.Pg === pageRef) { _this5.dictionary.data.K.push(mcid) } else { _this5.dictionary.data.K.push({ Type: 'MCR', Pg: pageRef, MCID: mcid }) } }) } } }]) return PDFStructureElement }()) const PDFNumberTree = /* #__PURE__ */(function (_PDFTree) { _inherits(PDFNumberTree, _PDFTree) const _super = _createSuper(PDFNumberTree) function PDFNumberTree () { _classCallCheck(this, PDFNumberTree) return _super.apply(this, arguments) } _createClass(PDFNumberTree, [{ key: '_compareKeys', value: function _compareKeys (a, b) { return parseInt(a) - parseInt(b) } }, { key: '_keysName', value: function _keysName () { return 'Nums' } }, { key: '_dataForKey', value: function _dataForKey (k) { return parseInt(k) } }]) return PDFNumberTree }(PDFTree)) const MarkingsMixin = { initMarkings: function initMarkings (options) { this.structChildren = [] if (options.tagged) { this.getMarkInfoDictionary().data.Marked = true this.getStructTreeRoot() } }, markContent: function markContent (tag) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null if (tag === 'Artifact' || options && options.mcid) { let toClose = 0 this.page.markings.forEach(function (marking) { if (toClose || marking.structContent || marking.tag === 'Artifact') { toClose++ } }) while (toClose--) { this.endMarkedContent() } } if (!options) { this.page.markings.push({ tag }) this.addContent('/'.concat(tag, ' BMC')) return this } this.page.markings.push({ tag, options }) const dictionary = {} if (typeof options.mcid !== 'undefined') { dictionary.MCID = options.mcid } if (tag === 'Artifact') { if (typeof options.type === 'string') { dictionary.Type = options.type } if (Array.isArray(options.bbox)) { dictionary.BBox = [options.bbox[0], this.page.height - options.bbox[3], options.bbox[2], this.page.height - options.bbox[1]] } if (Array.isArray(options.attached) && options.attached.every(function (val) { return typeof val === 'string' })) { dictionary.Attached = options.attached } } if (tag === 'Span') { if (options.lang) { dictionary.Lang = new String(options.lang) } if (options.alt) { dictionary.Alt = new String(options.alt) } if (options.expanded) { dictionary.E = new String(options.expanded) } if (options.actual) { dictionary.ActualText = new String(options.actual) } } this.addContent('/'.concat(tag, ' ').concat(PDFObject.convert(dictionary), ' BDC')) return this }, markStructureContent: function markStructureContent (tag) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} const pageStructParents = this.getStructParentTree().get(this.page.structParentTreeKey) const mcid = pageStructParents.length pageStructParents.push(null) this.markContent(tag, _objectSpread2(_objectSpread2({}, options), {}, { mcid })) const structContent = new PDFStructureContent(this.page.dictionary, mcid) this.page.markings.slice(-1)[0].structContent = structContent return structContent }, endMarkedContent: function endMarkedContent () { this.page.markings.pop() this.addContent('EMC') return this }, struct: function struct (type) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} const children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null return new PDFStructureElement(this, type, options, children) }, addStructure: function addStructure (structElem) { const structTreeRoot = this.getStructTreeRoot() structElem.setParent(structTreeRoot) structElem.setAttached() this.structChildren.push(structElem) if (!structTreeRoot.data.K) { structTreeRoot.data.K = [] } structTreeRoot.data.K.push(structElem.dictionary) return this }, initPageMarkings: function initPageMarkings (pageMarkings) { const _this = this pageMarkings.forEach(function (marking) { if (marking.structContent) { const structContent = marking.structContent const newStructContent = _this.markStructureContent(marking.tag, marking.options) structContent.push(newStructContent) _this.page.markings.slice(-1)[0].structContent = structContent } else { _this.markContent(marking.tag, marking.options) } }) }, endPageMarkings: function endPageMarkings (page) { const pageMarkings = page.markings pageMarkings.forEach(function () { return page.write('EMC') }) page.markings = [] return pageMarkings }, getMarkInfoDictionary: function getMarkInfoDictionary () { if (!this._root.data.MarkInfo) { this._root.data.MarkInfo = this.ref({}) } return this._root.data.MarkInfo }, getStructTreeRoot: function getStructTreeRoot () { if (!this._root.data.StructTreeRoot) { this._root.data.StructTreeRoot = this.ref({ Type: 'StructTreeRoot', ParentTree: new PDFNumberTree(), ParentTreeNextKey: 0 }) } return this._root.data.StructTreeRoot }, getStructParentTree: function getStructParentTree () { return this.getStructTreeRoot().data.ParentTree }, createStructParentTreeNextKey: function createStructParentTreeNextKey () { // initialise the MarkInfo dictionary this.getMarkInfoDictionary() const structTreeRoot = this.getStructTreeRoot() const key = structTreeRoot.data.ParentTreeNextKey++ structTreeRoot.data.ParentTree.add(key, []) return key }, endMarkings: function endMarkings () { const structTreeRoot = this._root.data.StructTreeRoot if (structTreeRoot) { structTreeRoot.end() this.structChildren.forEach(function (structElem) { return structElem.end() }) } if (this._root.data.MarkInfo) { this._root.data.MarkInfo.end() } } } const FIELD_FLAGS = { readOnly: 1, required: 2, noExport: 4, multiline: 0x1000, password: 0x2000, toggleToOffButton: 0x4000, radioButton: 0x8000, pushButton: 0x10000, combo: 0x20000, edit: 0x40000, sort: 0x80000, multiSelect: 0x200000, noSpell: 0x400000 } const FIELD_JUSTIFY = { left: 0, center: 1, right: 2 } const VALUE_MAP = { value: 'V', defaultValue: 'DV' } const FORMAT_SPECIAL = { zip: '0', zipPlus4: '1', zip4: '1', phone: '2', ssn: '3' } const FORMAT_DEFAULT = { number: { nDec: 0, sepComma: false, negStyle: 'MinusBlack', currency: '', currencyPrepend: true }, percent: { nDec: 0, sepComma: false } } const AcroFormMixin = { /** * Must call if adding AcroForms to a document. Must also call font() before * this method to set the default font. */ initForm: function initForm () { if (!this._font) { throw new Error('Must set a font before calling initForm method') } this._acroform = { fonts: {}, defaultFont: this._font.name } this._acroform.fonts[this._font.id] = this._font.ref() const data = { Fields: [], NeedAppearances: true, DA: new String('/'.concat(this._font.id, ' 0 Tf 0 g')), DR: { Font: {} } } data.DR.Font[this._font.id] = this._font.ref() const AcroForm = this.ref(data) this._root.data.AcroForm = AcroForm return this }, /** * Called automatically by document.js */ endAcroForm: function endAcroForm () { const _this = this if (this._root.data.AcroForm) { if (!Object.keys(this._acroform.fonts).length && !this._acroform.defaultFont) { throw new Error('No fonts specified for PDF form') } const fontDict = this._root.data.AcroForm.data.DR.Font Object.keys(this._acroform.fonts).forEach(function (name) { fontDict[name] = _this._acroform.fonts[name] }) this._root.data.AcroForm.data.Fields.forEach(function (fieldRef) { _this._endChild(fieldRef) }) this._root.data.AcroForm.end() } return this }, _endChild: function _endChild (ref) { const _this2 = this if (Array.isArray(ref.data.Kids)) { ref.data.Kids.forEach(function (childRef) { _this2._endChild(childRef) }) ref.end() } return this }, /** * Creates and adds a form field to the document. Form fields are intermediate * nodes in a PDF form that are used to specify form name heirarchy and form * value defaults. * @param {string} name - field name (T attribute in field dictionary) * @param {object} options - other attributes to include in field dictionary */ formField: function formField (name) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} const fieldDict = this._fieldDict(name, null, options) const fieldRef = this.ref(fieldDict) this._addToParent(fieldRef) return fieldRef }, /** * Creates and adds a Form Annotation to the document. Form annotations are * called Widget annotations internally within a PDF file. * @param {string} name - form field name (T attribute of widget annotation * dictionary) * @param {number} x * @param {number} y * @param {number} w * @param {number} h * @param {object} options */ formAnnotation: function formAnnotation (name, type, x, y, w, h) { const options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {} const fieldDict = this._fieldDict(name, type, options) fieldDict.Subtype = 'Widget' if (fieldDict.F === undefined) { fieldDict.F = 4 // print the annotation } // Add Field annot to page, and get it's ref this.annotate(x, y, w, h, fieldDict) const annotRef = this.page.annotations[this.page.annotations.length - 1] return this._addToParent(annotRef) }, formText: function formText (name, x, y, w, h) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} return this.formAnnotation(name, 'text', x, y, w, h, options) }, formPushButton: function formPushButton (name, x, y, w, h) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} return this.formAnnotation(name, 'pushButton', x, y, w, h, options) }, formCombo: function formCombo (name, x, y, w, h) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} return this.formAnnotation(name, 'combo', x, y, w, h, options) }, formList: function formList (name, x, y, w, h) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} return this.formAnnotation(name, 'list', x, y, w, h, options) }, formRadioButton: function formRadioButton (name, x, y, w, h) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} return this.formAnnotation(name, 'radioButton', x, y, w, h, options) }, formCheckbox: function formCheckbox (name, x, y, w, h) { const options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {} return this.formAnnotation(name, 'checkbox', x, y, w, h, options) }, _addToParent: function _addToParent (fieldRef) { const parent = fieldRef.data.Parent if (parent) { if (!parent.data.Kids) { parent.data.Kids = [] } parent.data.Kids.push(fieldRef) } else { this._root.data.AcroForm.data.Fields.push(fieldRef) } return this }, _fieldDict: function _fieldDict (name, type) { const options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {} if (!this._acroform) { throw new Error('Call document.initForms() method before adding form elements to document') } let opts = Object.assign({}, options) if (type !== null) { opts = this._resolveType(type, options) } opts = this._resolveFlags(opts) opts = this._resolveJustify(opts) opts = this._resolveFont(opts) opts = this._resolveStrings(opts) opts = this._resolveColors(opts) opts = this._resolveFormat(opts) opts.T = new String(name) if (opts.parent) { opts.Parent = opts.parent delete opts.parent } return opts }, _resolveType: function _resolveType (type, opts) { if (type === 'text') { opts.FT = 'Tx' } else if (type === 'pushButton') { opts.FT = 'Btn' opts.pushButton = true } else if (type === 'radioButton') { opts.FT = 'Btn' opts.radioButton = true } else if (type === 'checkbox') { opts.FT = 'Btn' } else if (type === 'combo') { opts.FT = 'Ch' opts.combo = true } else if (type === 'list') { opts.FT = 'Ch' } else { throw new Error("Invalid form annotation type '".concat(type, "'")) } return opts }, _resolveFormat: function _resolveFormat (opts) { const f = opts.format if (f && f.type) { let fnKeystroke let fnFormat let params = '' if (FORMAT_SPECIAL[f.type] !== undefined) { fnKeystroke = 'AFSpecial_Keystroke' fnFormat = 'AFSpecial_Format' params = FORMAT_SPECIAL[f.type] } else { const format = f.type.charAt(0).toUpperCase() + f.type.slice(1) fnKeystroke = 'AF'.concat(format, '_Keystroke') fnFormat = 'AF'.concat(format, '_Format') if (f.type === 'date') { fnKeystroke += 'Ex' params = String(f.param) } else if (f.type === 'time') { params = String(f.param) } else if (f.type === 'number') { const p = Object.assign({}, FORMAT_DEFAULT.number, f) params = String([String(p.nDec), p.sepComma ? '0' : '1', '"' + p.negStyle + '"', 'null', '"' + p.currency + '"', String(p.currencyPrepend)].join(',')) } else if (f.type === 'percent') { const _p = Object.assign({}, FORMAT_DEFAULT.percent, f) params = String([String(_p.nDec), _p.sepComma ? '0' : '1'].join(',')) } } opts.AA = opts.AA ? opts.AA : {} opts.AA.K = { S: 'JavaScript', JS: new String(''.concat(fnKeystroke, '(').concat(params, ');')) } opts.AA.F = { S: 'JavaScript', JS: new String(''.concat(fnFormat, '(').concat(params, ');')) } } delete opts.format return opts }, _resolveColors: function _resolveColors (opts) { let color = this._normalizeColor(opts.backgroundColor) if (color) { if (!opts.MK) { opts.MK = {} } opts.MK.BG = color } color = this._normalizeColor(opts.borderColor) if (color) { if (!opts.MK) { opts.MK = {} } opts.MK.BC = color } delete opts.backgroundColor delete opts.borderColor return opts }, _resolveFlags: function _resolveFlags (options) { let result = 0 Object.keys(options).forEach(function (key) { if (FIELD_FLAGS[key]) { result |= FIELD_FLAGS[key] delete options[key] } }) if (result !== 0) { options.Ff = options.Ff ? options.Ff : 0 options.Ff |= result } return options }, _resolveJustify: function _resolveJustify (options) { let result = 0 if (options.align !== undefined) { if (typeof FIELD_JUSTIFY[options.align] === 'number') { result = FIELD_JUSTIFY[options.align] } delete options.align } if (result !== 0) { options.Q = result // default } return options }, _resolveFont: function _resolveFont (options) { // add current font to document-level AcroForm dict if necessary if (this._acroform.fonts[this._font.id] === null) { this._acroform.fonts[this._font.id] = this._font.ref() } // add current font to field's resource dict (RD) if not the default acroform font if (this._acroform.defaultFont !== this._font.name) { options.DR = { Font: {} } // Get the fontSize option. If not set use auto sizing const fontSize = options.fontSize || 0 options.DR.Font[this._font.id] = this._font.ref() options.DA = new String('/'.concat(this._font.id, ' ').concat(fontSize, ' Tf 0 g')) } return options }, _resolveStrings: function _resolveStrings (options) { const select = [] function appendChoices (a) { if (Array.isArray(a)) { for (let idx = 0; idx < a.length; idx++) { if (typeof a[idx] === 'string') { select.push(new String(a[idx])) } else { select.push(a[idx]) } } } } appendChoices(options.Opt) if (options.select) { appendChoices(options.select) delete options.select } if (select.length) { options.Opt = select } Object.keys(VALUE_MAP).forEach(function (key) { if (options[key] !== undefined) { options[VALUE_MAP[key]] = options[key] delete options[key] } }); ['V', 'DV'].forEach(function (key) { if (typeof options[key] === 'string') { options[key] = new String(options[key]) } }) if (options.MK && options.MK.CA) { options.MK.CA = new String(options.MK.CA) } if (options.label) { options.MK = options.MK ? options.MK : {} options.MK.CA = new String(options.label) delete options.label } return options } } const AttachmentsMixin = { /** * Embed contents of `src` in PDF * @param {Buffer | ArrayBuffer | string} src input Buffer, ArrayBuffer, base64 encoded string or path to file * @param {object} options * * options.name: filename to be shown in PDF, will use `src` if none set * * options.type: filetype to be shown in PDF * * options.description: description to be shown in PDF * * options.hidden: if true, do not add attachment to EmbeddedFiles dictionary. Useful for file attachment annotations * * options.creationDate: override creation date * * options.modifiedDate: override modified date * @returns filespec reference */ file: function file (src) { const options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {} options.name = options.name || src const refBody = { Type: 'EmbeddedFile', Params: {} } let data if (!src) { throw new Error('No src specified') } if (Buffer.isBuffer(src)) { data = src } else if (src instanceof ArrayBuffer) { data = Buffer.from(new Uint8Array(src)) } else { let match if (match = /^data:(.*);base64,(.*)$/.exec(src)) { if (match[1]) { refBody.Subtype = match[1].replace('/', '#2F') } data = Buffer.from(match[2], 'base64') } else { data = fs.readFileSync(src) if (!data) { throw new Error('Could not read contents of file at filepath '.concat(src)) } // update CreationDate and ModDate const _fs$statSync = fs.statSync(src) const birthtime = _fs$statSync.birthtime const ctime = _fs$statSync.ctime refBody.Params.CreationDate = birthtime refBody.Params.ModDate = ctime } } // override creation date and modified date if (options.creationDate instanceof Date) { refBody.Params.CreationDate = options.creationDate } if (options.modifiedDate instanceof Date) { refBody.Params.ModDate = options.modifiedDate } // add optional subtype if (options.type) { refBody.Subtype = options.type.replace('/', '#2F') } // add checksum and size information const checksum = _cryptoJs.default.MD5(_cryptoJs.default.lib.WordArray.create(new Uint8Array(data))) refBody.Params.CheckSum = new String(checksum) refBody.Params.Size = data.byteLength // save some space when embedding the same file again // if a file with the same name and metadata exists, reuse its reference let ref if (!this._fileRegistry) this._fileRegistry = {} const file = this._fileRegistry[options.name] if (file && isEqual(refBody, file)) { ref = file.ref } else { ref = this.ref(refBody) ref.end(data) this._fileRegistry[options.name] = _objectSpread2(_objectSpread2({}, refBody), {}, { ref }) } // add filespec for embedded file const fileSpecBody = { Type: 'Filespec', F: new String(options.name), EF: { F: ref }, UF: new String(options.name) } if (options.description) { fileSpecBody.Desc = new String(options.description) } const filespec = this.ref(fileSpecBody) filespec.end() if (!options.hidden) { this.addNamedEmbeddedFile(options.name, filespec) } return filespec } } /** check two embedded file metadata objects for equality */ function isEqual (a, b) { return a.Subtype === b.Subtype && a.Params.CheckSum.toString() === b.Params.CheckSum.toString() && a.Params.Size === b.Params.Size && a.Params.CreationDate === b.Params.CreationDate && a.Params.ModDate === b.Params.ModDate } const PDFDocument = /* #__PURE__ */(function (_stream$Readable) { _inherits(PDFDocument, _stream$Readable) const _super = _createSuper(PDFDocument) function PDFDocument () { let _this const options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {} _classCallCheck(this, PDFDocument) _this = _super.call(this, options) _this.options = options // PDF version switch (options.pdfVersion) { case '1.4': _this.version = 1.4 break case '1.5': _this.version = 1.5 break case '1.6': _this.version = 1.6 break case '1.7': case '1.7ext3': _this.version = 1.7 break default: _this.version = 1.3 break } // Whether streams should be compressed _this.compress = _this.options.compress != null ? _this.options.compress : true _this._pageBuffer = [] _this._pageBufferStart = 0 // The PDF object store _this._offsets = [] _this._waiting = 0 _this._ended = false _this._offset = 0 const Pages = _this.ref({ Type: 'Pages', Count: 0, Kids: [] }) const Names = _this.ref({ Dests: new PDFNameTree() }) _this._root = _this.ref({ Type: 'Catalog', Pages, Names }) if (_this.options.lang) { _this._root.data.Lang = new String(_this.options.lang) } // The current page _this.page = null // Initialize mixins _this.initColor() _this.initVector() _this.initFonts(options.font) _this.initText() _this.initImages() _this.initOutline() _this.initMarkings(options) // Initialize the metadata _this.info = { Producer: 'PDFKit', Creator: 'PDFKit', CreationDate: new Date() } if (_this.options.info) { for (const key in _this.options.info) { const val = _this.options.info[key] _this.info[key] = val } } if (_this.options.displayTitle) { _this._root.data.ViewerPreferences = _this.ref({ DisplayDocTitle: true }) } // Generate file ID _this._id = PDFSecurity.generateFileID(_this.info) // Initialize security settings _this._security = PDFSecurity.create(_assertThisInitialized(_this), options) // Write the header // PDF version _this._write('%PDF-'.concat(_this.version)) // 4 binary chars, as recommended by the spec _this._write('%\xFF\xFF\xFF\xFF') // Add the first page if (_this.options.autoFirstPage !== false) { _this.addPage() } return _this } _createClass(PDFDocument, [{ key: 'addPage', value: function addPage (options) { if (options == null) { options = this.options } // end the current page if needed if (!this.options.bufferPages) { this.flushPages() } // create a page object this.page = new PDFPage(this, options) this._pageBuffer.push(this.page) // add the page to the object store const pages = this._root.data.Pages.data pages.Kids.push(this.page.dictionary) pages.Count++ // reset x and y coordinates this.x = this.page.margins.left this.y = this.page.margins.top // flip PDF coordinate system so that the origin is in // the top left rather than the bottom left this._ctm = [1, 0, 0, 1, 0, 0] this.transform(1, 0, 0, -1, 0, this.page.height) this.emit('pageAdded') return this } }, { key: 'continueOnNewPage', value: function continueOnNewPage (options) { const pageMarkings = this.endPageMarkings(this.page) this.addPage(options) this.initPageMarkings(pageMarkings) return this } }, { key: 'bufferedPageRange', value: function bufferedPageRange () { return { start: this._pageBufferStart, count: this._pageBuffer.length } } }, { key: 'switchToPage', value: function switchToPage (n) { let page if (!(page = this._pageBuffer[n - this._pageBufferStart])) { throw new Error('switchToPage('.concat(n, ') out of bounds, current buffer covers pages ').concat(this._pageBufferStart, ' to ').concat(this._pageBufferStart + this._pageBuffer.length - 1)) } return this.page = page } }, { key: 'flushPages', value: function flushPages () { // this local variable exists so we're future-proof against // reentrant calls to flushPages. const pages = this._pageBuffer this._pageBuffer = [] this._pageBufferStart += pages.length const _iterator = _createForOfIteratorHelper(pages) let _step try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const page = _step.value this.endPageMarkings(page) page.end() } } catch (err) { _iterator.e(err) } finally { _iterator.f() } } }, { key: 'addNamedDestination', value: function addNamedDestination (name) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key] } if (args.length === 0) { args = ['XYZ', null, null, null] } if (args[0] === 'XYZ' && args[2] !== null) { args[2] = this.page.height - args[2] } args.unshift(this.page.dictionary) this._root.data.Names.data.Dests.add(name, args) } }, { key: 'addNamedEmbeddedFile', value: function addNamedEmbeddedFile (name, ref) { if (!this._root.data.Names.data.EmbeddedFiles) { // disabling /Limits for this tree fixes attachments not showing in Adobe Reader this._root.data.Names.data.EmbeddedFiles = new PDFNameTree({ limits: false }) } // add filespec to EmbeddedFiles this._root.data.Names.data.EmbeddedFiles.add(name, ref) } }, { key: 'addNamedJavaScript', value: function addNamedJavaScript (name, js) { if (!this._root.data.Names.data.JavaScript) { this._root.data.Names.data.JavaScript = new PDFNameTree() } const data = { JS: new String(js), S: 'JavaScript' } this._root.data.Names.data.JavaScript.add(name, data) } }, { key: 'ref', value: function ref (data) { const ref = new PDFReference(this, this._offsets.length + 1, data) this._offsets.push(null) // placeholder for this object's offset once it is finalized this._waiting++ return ref } }, { key: '_read', value: function _read () {} // do nothing, but this method is required by node }, { key: '_write', value: function _write (data) { if (!Buffer.isBuffer(data)) { data = Buffer.from(data + '\n', 'binary') } this.push(data) return this._offset += data.length } }, { key: 'addContent', value: function addContent (data) { this.page.write(data) return this } }, { key: '_refEnd', value: function _refEnd (ref) { this._offsets[ref.id - 1] = ref.offset if (--this._waiting === 0 && this._ended) { this._finalize() return this._ended = false } } }, { key: 'write', value: function write (filename, fn) { // print a deprecation warning with a stacktrace const err = new Error('PDFDocument#write is deprecated, and will be removed in a future version of PDFKit. Please pipe the document into a Node stream.') console.warn(err.stack) this.pipe(fs.createWriteStream(filename)) this.end() return this.once('end', fn) } }, { key: 'end', value: function end () { this.flushPages() this._info = this.ref() for (const key in this.info) { let val = this.info[key] if (typeof val === 'string') { val = new String(val) } const entry = this.ref(val) entry.end() this._info.data[key] = entry } this._info.end() for (const name in this._fontFamilies) { const font = this._fontFamilies[name] font.finalize() } this.endOutline() this.endMarkings() this._root.end() this._root.data.Pages.end() this._root.data.Names.end() this.endAcroForm() if (this._root.data.ViewerPreferences) { this._root.data.ViewerPreferences.end() } if (this._security) { this._security.end() } if (this._waiting === 0) { return this._finalize() } else { return this._ended = true } } }, { key: '_finalize', value: function _finalize () { // generate xref const xRefOffset = this._offset this._write('xref') this._write('0 '.concat(this._offsets.length + 1)) this._write('0000000000 65535 f ') const _iterator2 = _createForOfIteratorHelper(this._offsets) let _step2 try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { let offset = _step2.value offset = '0000000000'.concat(offset).slice(-10) this._write(offset + ' 00000 n ') } // trailer } catch (err) { _iterator2.e(err) } finally { _iterator2.f() } const trailer = { Size: this._offsets.length + 1, Root: this._root, Info: this._info, ID: [this._id, this._id] } if (this._security) { trailer.Encrypt = this._security.dictionary } this._write('trailer') this._write(PDFObject.convert(trailer)) this._write('startxref') this._write(''.concat(xRefOffset)) this._write('%%EOF') // end the stream return this.push(null) } }, { key: 'toString', value: function toString () { return '[object PDFDocument]' } }]) return PDFDocument }(_stream.default.Readable)) const mixin = function mixin (methods) { Object.assign(PDFDocument.prototype, methods) } mixin(ColorMixin) mixin(VectorMixin) mixin(FontsMixin) mixin(TextMixin) mixin(ImagesMixin) mixin(AnnotationsMixin) mixin(OutlineMixin) mixin(MarkingsMixin) mixin(AcroFormMixin) mixin(AttachmentsMixin) PDFDocument.LineWrapper = LineWrapper const _default = PDFDocument exports.default = _default /***/ }, /***/ 9160: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' Object.defineProperty(exports, '__esModule', ({ value: true })) exports.default = void 0 __webpack_require__(4256) const _unicodeTrie = _interopRequireDefault(__webpack_require__(4781)) const _base64Js = _interopRequireDefault(__webpack_require__(9742)) function _interopRequireDefault (obj) { return obj && obj.__esModule ? obj : { default: obj } } const categories = ['Cc', 'Zs', 'Po', 'Sc', 'Ps', 'Pe', 'Sm', 'Pd', 'Nd', 'Lu', 'Sk', 'Pc', 'Ll', 'So', 'Lo', 'Pi', 'Cf', 'No', 'Pf', 'Lt', 'Lm', 'Mn', 'Me', 'Mc', 'Nl', 'Zl', 'Zp', 'Cs', 'Co'] const combiningClasses = ['Not_Reordered', 'Above', 'Above_Right', 'Below', 'Attached_Above_Right', 'Attached_Below', 'Overlay', 'Iota_Subscript', 'Double_Below', 'Double_Above', 'Below_Right', 'Above_Left', 'CCC10', 'CCC11', 'CCC12', 'CCC13', 'CCC14', 'CCC15', 'CCC16', 'CCC17', 'CCC18', 'CCC19', 'CCC20', 'CCC21', 'CCC22', 'CCC23', 'CCC24', 'CCC25', 'CCC30', 'CCC31', 'CCC32', 'CCC27', 'CCC28', 'CCC29', 'CCC33', 'CCC34', 'CCC35', 'CCC36', 'Nukta', 'Virama', 'CCC84', 'CCC91', 'CCC103', 'CCC107', 'CCC118', 'CCC122', 'CCC129', 'CCC130', 'CCC132', 'Attached_Above', 'Below_Left', 'Left', 'Kana_Voicing', 'CCC26', 'Right'] const scripts = ['Common', 'Latin', 'Bopomofo', 'Inherited', 'Greek', 'Coptic', 'Cyrillic', 'Armenian', 'Hebrew', 'Arabic', 'Syriac', 'Thaana', 'Nko', 'Samaritan', 'Mandaic', 'Devanagari', 'Bengali', 'Gurmukhi', 'Gujarati', 'Oriya', 'Tamil', 'Telugu', 'Kannada', 'Malayalam', 'Sinhala', 'Thai', 'Lao', 'Tibetan', 'Myanmar', 'Georgian', 'Hangul', 'Ethiopic', 'Cherokee', 'Canadian_Aboriginal', 'Ogham', 'Runic', 'Tagalog', 'Hanunoo', 'Buhid', 'Tagbanwa', 'Khmer', 'Mongolian', 'Limbu', 'Tai_Le', 'New_Tai_Lue', 'Buginese', 'Tai_Tham', 'Balinese', 'Sundanese', 'Batak', 'Lepcha', 'Ol_Chiki', 'Braille', 'Glagolitic', 'Tifinagh', 'Han', 'Hiragana', 'Katakana', 'Yi', 'Lisu', 'Vai', 'Bamum', 'Syloti_Nagri', 'Phags_Pa', 'Saurashtra', 'Kayah_Li', 'Rejang', 'Javanese', 'Cham', 'Tai_Viet', 'Meetei_Mayek', 'null', 'Linear_B', 'Lycian', 'Carian', 'Old_Italic', 'Gothic', 'Old_Permic', 'Ugaritic', 'Old_Persian', 'Deseret', 'Shavian', 'Osmanya', 'Osage', 'Elbasan', 'Caucasian_Albanian', 'Linear_A', 'Cypriot', 'Imperial_Aramaic', 'Palmyrene', 'Nabataean', 'Hatran', 'Phoenician', 'Lydian', 'Meroitic_Hieroglyphs', 'Meroitic_Cursive', 'Kharoshthi', 'Old_South_Arabian', 'Old_North_Arabian', 'Manichaean', 'Avestan', 'Inscriptional_Parthian', 'Inscriptional_Pahlavi', 'Psalter_Pahlavi', 'Old_Turkic', 'Old_Hungarian', 'Hanifi_Rohingya', 'Old_Sogdian', 'Sogdian', 'Elymaic', 'Brahmi', 'Kaithi', 'Sora_Sompeng', 'Chakma', 'Mahajani', 'Sharada', 'Khojki', 'Multani', 'Khudawadi', 'Grantha', 'Newa', 'Tirhuta', 'Siddham', 'Modi', 'Takri', 'Ahom', 'Dogra', 'Warang_Citi', 'Nandinagari', 'Zanabazar_Square', 'Soyombo', 'Pau_Cin_Hau', 'Bhaiksuki', 'Marchen', 'Masaram_Gondi', 'Gunjala_Gondi', 'Makasar', 'Cuneiform', 'Egyptian_Hieroglyphs', 'Anatolian_Hieroglyphs', 'Mro', 'Bassa_Vah', 'Pahawh_Hmong', 'Medefaidrin', 'Miao', 'Tangut', 'Nushu', 'Duployan', 'SignWriting', 'Nyiakeng_Puachue_Hmong', 'Wancho', 'Mende_Kikakui', 'Adlam'] const eaw = ['N', 'Na', 'A', 'W', 'H', 'F'] const data = { categories, combiningClasses, scripts, eaw } const data$1 = 'AAARAAAAAADwfAEAZXl5ONRt+/5bPVFZimRfKoTQJNm37CGE7Iw0j3UsTWKsoyI7kwyyTiEUzSD7NiEzhWYijH0wMVkHE4Mx49fzfo+3nuP4/fdZjvv+XNd5n/d9nef1WZvmKhTxiZndzDQBSEYQqxqKwnsKvGQucFh+6t6cJ792ePQBZv5S9yXSwkyjf/P4T7mTNnIAv1dOVhMlR9lflbUL9JeJguqsjvG9NTj/wLb566VAURnLo2vvRi89S3gW/33ihh2eXpDn40BIW7REl/7coRKIhAFlAiOtbLDTt6mMb4G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KAnHnPuH2fPGrjx0GcuCDEU+yXUtXh6nfUL+cykws1gJ5vkfYFaFBr9PdCXvVf35OJQxzUMmWjv0W6uGJK11uAGDqSpOwCf6rouSIjPVgw57cJCOQ4b9tkI/Y5WNon9Swe72aZryKo8d+HyHBEdWJKrkary0LIGczA4Irq353Wc0Zga3om7UQiAGCvIl8GGyaqz5zH+1gMP5phWUCpKtttWIyicz09vXg76GxkmiGSMQ06Z9X8BUwqOtauDbPIf4rpK/yYoeAHxJ9soXS9VDe1Aw+awOOxaN8foLrif0TXBvQ55dtRtulRq9emFDBxlQcqKCaD8NeTSE7FOHvcjf/+oKbbtRqz9gbofoc2EzQ3pL6W5JdfJzAWmOk8oeoECe90lVMruwl/ltM015P/zIPazqvdvFmLNVHMIZrwiQ2tIKtGh6PDVH+85ew3caqVt2BsDv5rOcu3G9srQWd7NmgtzCRUXLYknYRSwtH9oUtkqyN3CfP20xQ1faXQl4MEmjQehWR6GmGnkdpYNQYeIG408yAX7uCZmYUic9juOfb+Re28+OVOB+scYK4DaPcBe+5wmji9gymtkMpKo4UKqCz7yxzuN8VIlx9yNozpRJpNaWHtaZVEqP45n2JemTlYBSmNIK1FuSYAUQ1yBLnKxevrjayd+h2i8PjdB3YY6b0nr3JuOXGpPMyh4V2dslpR3DFEvgpsBLqhqLDOWP4yEvIL6f21PpA7/8B' const trieData = { data: data$1 } const log2 = Math.log2 || function (n) { return Math.log(n) / Math.LN2 } const bits = function bits (n) { return log2(n) + 1 | 0 } const buildUnicodeProperties = function buildUnicodeProperties (data, trie) { // compute the number of bits stored for each field const CATEGORY_BITS = bits(data.categories.length - 1) const COMBINING_BITS = bits(data.combiningClasses.length - 1) const SCRIPT_BITS = bits(data.scripts.length - 1) const EAW_BITS = bits(data.eaw.length - 1) const NUMBER_BITS = 10 // compute shift and mask values for each field const CATEGORY_SHIFT = COMBINING_BITS + SCRIPT_BITS + EAW_BITS + NUMBER_BITS const COMBINING_SHIFT = SCRIPT_BITS + EAW_BITS + NUMBER_BITS const SCRIPT_SHIFT = EAW_BITS + NUMBER_BITS const EAW_SHIFT = NUMBER_BITS const CATEGORY_MASK = (1 << CATEGORY_BITS) - 1 const COMBINING_MASK = (1 << COMBINING_BITS) - 1 const SCRIPT_MASK = (1 << SCRIPT_BITS) - 1 const EAW_MASK = (1 << EAW_BITS) - 1 const NUMBER_MASK = (1 << NUMBER_BITS) - 1 const getCategory = function getCategory (codePoint) { const val = trie.get(codePoint) return data.categories[val >> CATEGORY_SHIFT & CATEGORY_MASK] } const getCombiningClass = function getCombiningClass (codePoint) { const val = trie.get(codePoint) return data.combiningClasses[val >> COMBINING_SHIFT & COMBINING_MASK] } const getScript = function getScript (codePoint) { const val = trie.get(codePoint) return data.scripts[val >> SCRIPT_SHIFT & SCRIPT_MASK] } const getEastAsianWidth = function getEastAsianWidth (codePoint) { const val = trie.get(codePoint) return data.eaw[val >> EAW_SHIFT & EAW_MASK] } const getNumericValue = function getNumericValue (codePoint) { let val = trie.get(codePoint) const num = val & NUMBER_MASK if (num === 0) { return null } else if (num <= 50) { return num - 1 } else if (num < 0x1e0) { const numerator = (num >> 4) - 12 const denominator = (num & 0xf) + 1 return numerator / denominator } else if (num < 0x300) { val = (num >> 5) - 14 let exp = (num & 0x1f) + 2 while (exp > 0) { val *= 10 exp-- } return val } else { val = (num >> 2) - 0xbf let _exp = (num & 3) + 1 while (_exp > 0) { val *= 60 _exp-- } return val } } const isAlphabetic = function isAlphabetic (codePoint) { const category = getCategory(codePoint) return category === 'Lu' || category === 'Ll' || category === 'Lt' || category === 'Lm' || category === 'Lo' || category === 'Nl' } const isDigit = function isDigit (codePoint) { return getCategory(codePoint) === 'Nd' } const isPunctuation = function isPunctuation (codePoint) { const category = getCategory(codePoint) return category === 'Pc' || category === 'Pd' || category === 'Pe' || category === 'Pf' || category === 'Pi' || category === 'Po' || category === 'Ps' } const isLowerCase = function isLowerCase (codePoint) { return getCategory(codePoint) === 'Ll' } const isUpperCase = function isUpperCase (codePoint) { return getCategory(codePoint) === 'Lu' } const isTitleCase = function isTitleCase (codePoint) { return getCategory(codePoint) === 'Lt' } const isWhiteSpace = function isWhiteSpace (codePoint) { const category = getCategory(codePoint) return category === 'Zs' || category === 'Zl' || category === 'Zp' } const isBaseForm = function isBaseForm (codePoint) { const category = getCategory(codePoint) return category === 'Nd' || category === 'No' || category === 'Nl' || category === 'Lu' || category === 'Ll' || category === 'Lt' || category === 'Lm' || category === 'Lo' || category === 'Me' || category === 'Mc' } const isMark = function isMark (codePoint) { const category = getCategory(codePoint) return category === 'Mn' || category === 'Me' || category === 'Mc' } return { getCategory, getCombiningClass, getScript, getEastAsianWidth, getNumericValue, isAlphabetic, isDigit, isPunctuation, isLowerCase, isUpperCase, isTitleCase, isWhiteSpace, isBaseForm, isMark } } const trie = new _unicodeTrie.default(_base64Js.default.toByteArray(trieData.data)) const unicodeProperties = buildUnicodeProperties(data, trie) const _default = unicodeProperties exports.default = _default /***/ }, /***/ 4781: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(7042) __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(2472) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(9135) const inflate = __webpack_require__(311) const _require = __webpack_require__(1753) const swap32LE = _require.swap32LE // Shift size for getting the index-1 table offset. const SHIFT_1 = 6 + 5 // Shift size for getting the index-2 table offset. const SHIFT_2 = 5 // Difference between the two shift sizes, // for getting an index-1 offset from an index-2 offset. 6=11-5 const SHIFT_1_2 = SHIFT_1 - SHIFT_2 // Number of index-1 entries for the BMP. 32=0x20 // This part of the index-1 table is omitted from the serialized form. const OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1 // Number of entries in an index-2 block. 64=0x40 const INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2 // Mask for getting the lower bits for the in-index-2-block offset. */ const INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1 // Shift size for shifting left the index array values. // Increases possible data size with 16-bit index values at the cost // of compactability. // This requires data blocks to be aligned by DATA_GRANULARITY. const INDEX_SHIFT = 2 // Number of entries in a data block. 32=0x20 const DATA_BLOCK_LENGTH = 1 << SHIFT_2 // Mask for getting the lower bits for the in-data-block offset. const DATA_MASK = DATA_BLOCK_LENGTH - 1 // The part of the index-2 table for U+D800..U+DBFF stores values for // lead surrogate code _units_ not code _points_. // Values for lead surrogate code _points_ are indexed with this portion of the table. // Length=32=0x20=0x400>>SHIFT_2. (There are 1024=0x400 lead surrogates.) const LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2 const LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2 // Count the lengths of both BMP pieces. 2080=0x820 const INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH // The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820. // Length 32=0x20 for lead bytes C0..DF, regardless of SHIFT_2. const UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH const UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6 // U+0800 is the first code point after 2-byte UTF-8 // The index-1 table, only used for supplementary code points, at offset 2112=0x840. // Variable length, for code points up to highStart, where the last single-value range starts. // Maximum length 512=0x200=0x100000>>SHIFT_1. // (For 0x100000 supplementary code points U+10000..U+10ffff.) // // The part of the index-2 table for supplementary code points starts // after this index-1 table. // // Both the index-1 table and the following part of the index-2 table // are omitted completely if there is only BMP data. const INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH // The alignment size of a data block. Also the granularity for compaction. const DATA_GRANULARITY = 1 << INDEX_SHIFT const UnicodeTrie = /* #__PURE__ */(function () { function UnicodeTrie (data) { const isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function' if (isBuffer || data instanceof Uint8Array) { // read binary format let uncompressedLength if (isBuffer) { this.highStart = data.readUInt32LE(0) this.errorValue = data.readUInt32LE(4) uncompressedLength = data.readUInt32LE(8) data = data.slice(12) } else { const view = new DataView(data.buffer) this.highStart = view.getUint32(0, true) this.errorValue = view.getUint32(4, true) uncompressedLength = view.getUint32(8, true) data = data.subarray(12) } // double inflate the actual trie data data = inflate(data, new Uint8Array(uncompressedLength)) data = inflate(data, new Uint8Array(uncompressedLength)) // swap bytes from little-endian swap32LE(data) this.data = new Uint32Array(data.buffer) } else { // pre-parsed data const _data = data this.data = _data.data this.highStart = _data.highStart this.errorValue = _data.errorValue } } const _proto = UnicodeTrie.prototype _proto.get = function get (codePoint) { let index if (codePoint < 0 || codePoint > 0x10ffff) { return this.errorValue } if (codePoint < 0xd800 || codePoint > 0xdbff && codePoint <= 0xffff) { // Ordinary BMP code point, excluding leading surrogates. // BMP uses a single level lookup. BMP index starts at offset 0 in the index. // data is stored in the index array itself. index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK) return this.data[index] } if (codePoint <= 0xffff) { // Lead Surrogate Code Point. A Separate index section is stored for // lead surrogate code units and code points. // The main index has the code unit data. // For this function, we need the code point data. index = (this.data[LSCP_INDEX_2_OFFSET + (codePoint - 0xd800 >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK) return this.data[index] } if (codePoint < this.highStart) { // Supplemental code point, use two-level lookup. index = this.data[INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> SHIFT_1)] index = this.data[index + (codePoint >> SHIFT_2 & INDEX_2_MASK)] index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK) return this.data[index] } return this.data[this.data.length - DATA_GRANULARITY] } return UnicodeTrie }()) module.exports = UnicodeTrie /***/ }, /***/ 1753: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(2472) __webpack_require__(2990) __webpack_require__(8927) __webpack_require__(3105) __webpack_require__(5035) __webpack_require__(4345) __webpack_require__(7174) __webpack_require__(2846) __webpack_require__(4731) __webpack_require__(7209) __webpack_require__(6319) __webpack_require__(8867) __webpack_require__(7789) __webpack_require__(3739) __webpack_require__(9368) __webpack_require__(4483) __webpack_require__(2056) __webpack_require__(3462) __webpack_require__(678) __webpack_require__(7462) __webpack_require__(3824) __webpack_require__(5021) __webpack_require__(2974) __webpack_require__(5016) __webpack_require__(9135) const isBigEndian = new Uint8Array(new Uint32Array([0x12345678]).buffer)[0] === 0x12 const swap = function swap (b, n, m) { const i = b[n] b[n] = b[m] b[m] = i } const swap32 = function swap32 (array) { const len = array.length for (let i = 0; i < len; i += 4) { swap(array, i, i + 3) swap(array, i + 1, i + 2) } } const swap32LE = function swap32LE (array) { if (isBigEndian) { swap32(array) } } module.exports = { swap32LE } /***/ }, /***/ 8071: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const SVGtoPDF = __webpack_require__(8519) module.exports = SVGtoPDF /***/ }, /***/ 8519: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* module decorator */ module = __webpack_require__.nmd(module) __webpack_require__(8309) __webpack_require__(7941) __webpack_require__(3210) __webpack_require__(4916) __webpack_require__(4723) __webpack_require__(3123) __webpack_require__(3728) __webpack_require__(5306) __webpack_require__(7042) __webpack_require__(9653) __webpack_require__(2222) __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(3948) __webpack_require__(9254) __webpack_require__(3290) const SVGtoPDF = function SVGtoPDF (doc, svg, x, y, options) { 'use strict' const NamedColors = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], grey: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgrey: [211, 211, 211], lightgreen: [144, 238, 144], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0] } const DefaultColors = { black: [NamedColors.black, 1], white: [NamedColors.white, 1], transparent: [NamedColors.black, 0] } const Entities = { quot: 34, amp: 38, lt: 60, gt: 62, apos: 39, OElig: 338, oelig: 339, Scaron: 352, scaron: 353, Yuml: 376, circ: 710, tilde: 732, ensp: 8194, emsp: 8195, thinsp: 8201, zwnj: 8204, zwj: 8205, lrm: 8206, rlm: 8207, ndash: 8211, mdash: 8212, lsquo: 8216, rsquo: 8217, sbquo: 8218, ldquo: 8220, rdquo: 8221, bdquo: 8222, dagger: 8224, Dagger: 8225, permil: 8240, lsaquo: 8249, rsaquo: 8250, euro: 8364, nbsp: 160, iexcl: 161, cent: 162, pound: 163, curren: 164, yen: 165, brvbar: 166, sect: 167, uml: 168, copy: 169, ordf: 170, laquo: 171, not: 172, shy: 173, reg: 174, macr: 175, deg: 176, plusmn: 177, sup2: 178, sup3: 179, acute: 180, micro: 181, para: 182, middot: 183, cedil: 184, sup1: 185, ordm: 186, raquo: 187, frac14: 188, frac12: 189, frac34: 190, iquest: 191, Agrave: 192, Aacute: 193, Acirc: 194, Atilde: 195, Auml: 196, Aring: 197, AElig: 198, Ccedil: 199, Egrave: 200, Eacute: 201, Ecirc: 202, Euml: 203, Igrave: 204, Iacute: 205, Icirc: 206, Iuml: 207, ETH: 208, Ntilde: 209, Ograve: 210, Oacute: 211, Ocirc: 212, Otilde: 213, Ouml: 214, times: 215, Oslash: 216, Ugrave: 217, Uacute: 218, Ucirc: 219, Uuml: 220, Yacute: 221, THORN: 222, szlig: 223, agrave: 224, aacute: 225, acirc: 226, atilde: 227, auml: 228, aring: 229, aelig: 230, ccedil: 231, egrave: 232, eacute: 233, ecirc: 234, euml: 235, igrave: 236, iacute: 237, icirc: 238, iuml: 239, eth: 240, ntilde: 241, ograve: 242, oacute: 243, ocirc: 244, otilde: 245, ouml: 246, divide: 247, oslash: 248, ugrave: 249, uacute: 250, ucirc: 251, uuml: 252, yacute: 253, thorn: 254, yuml: 255, fnof: 402, Alpha: 913, Beta: 914, Gamma: 915, Delta: 916, Epsilon: 917, Zeta: 918, Eta: 919, Theta: 920, Iota: 921, Kappa: 922, Lambda: 923, Mu: 924, Nu: 925, Xi: 926, Omicron: 927, Pi: 928, Rho: 929, Sigma: 931, Tau: 932, Upsilon: 933, Phi: 934, Chi: 935, Psi: 936, Omega: 937, alpha: 945, beta: 946, gamma: 947, delta: 948, epsilon: 949, zeta: 950, eta: 951, theta: 952, iota: 953, kappa: 954, lambda: 955, mu: 956, nu: 957, xi: 958, omicron: 959, pi: 960, rho: 961, sigmaf: 962, sigma: 963, tau: 964, upsilon: 965, phi: 966, chi: 967, psi: 968, omega: 969, thetasym: 977, upsih: 978, piv: 982, bull: 8226, hellip: 8230, prime: 8242, Prime: 8243, oline: 8254, frasl: 8260, weierp: 8472, image: 8465, real: 8476, trade: 8482, alefsym: 8501, larr: 8592, uarr: 8593, rarr: 8594, darr: 8595, harr: 8596, crarr: 8629, lArr: 8656, uArr: 8657, rArr: 8658, dArr: 8659, hArr: 8660, forall: 8704, part: 8706, exist: 8707, empty: 8709, nabla: 8711, isin: 8712, notin: 8713, ni: 8715, prod: 8719, sum: 8721, minus: 8722, lowast: 8727, radic: 8730, prop: 8733, infin: 8734, ang: 8736, and: 8743, or: 8744, cap: 8745, cup: 8746, int: 8747, there4: 8756, sim: 8764, cong: 8773, asymp: 8776, ne: 8800, equiv: 8801, le: 8804, ge: 8805, sub: 8834, sup: 8835, nsub: 8836, sube: 8838, supe: 8839, oplus: 8853, otimes: 8855, perp: 8869, sdot: 8901, lceil: 8968, rceil: 8969, lfloor: 8970, rfloor: 8971, lang: 9001, rang: 9002, loz: 9674, spades: 9824, clubs: 9827, hearts: 9829, diams: 9830 } const PathArguments = { A: 7, a: 7, C: 6, c: 6, H: 1, h: 1, L: 2, l: 2, M: 2, m: 2, Q: 4, q: 4, S: 4, s: 4, T: 2, t: 2, V: 1, v: 1, Z: 0, z: 0 } const PathFlags = { A3: true, A4: true, a3: true, a4: true } const Properties = { color: { inherit: true, initial: undefined }, visibility: { inherit: true, initial: 'visible', values: { hidden: 'hidden', collapse: 'hidden', visible: 'visible' } }, fill: { inherit: true, initial: DefaultColors.black }, stroke: { inherit: true, initial: 'none' }, 'stop-color': { inherit: false, initial: DefaultColors.black }, 'fill-opacity': { inherit: true, initial: 1 }, 'stroke-opacity': { inherit: true, initial: 1 }, 'stop-opacity': { inherit: false, initial: 1 }, 'fill-rule': { inherit: true, initial: 'nonzero', values: { nonzero: 'nonzero', evenodd: 'evenodd' } }, 'clip-rule': { inherit: true, initial: 'nonzero', values: { nonzero: 'nonzero', evenodd: 'evenodd' } }, 'stroke-width': { inherit: true, initial: 1 }, 'stroke-dasharray': { inherit: true, initial: [] }, 'stroke-dashoffset': { inherit: true, initial: 0 }, 'stroke-miterlimit': { inherit: true, initial: 4 }, 'stroke-linejoin': { inherit: true, initial: 'miter', values: { miter: 'miter', round: 'round', bevel: 'bevel' } }, 'stroke-linecap': { inherit: true, initial: 'butt', values: { butt: 'butt', round: 'round', square: 'square' } }, 'font-size': { inherit: true, initial: 16, values: { 'xx-small': 9, 'x-small': 10, small: 13, medium: 16, large: 18, 'x-large': 24, 'xx-large': 32 } }, 'font-family': { inherit: true, initial: 'sans-serif' }, 'font-weight': { inherit: true, initial: 'normal', values: { 600: 'bold', 700: 'bold', 800: 'bold', 900: 'bold', bold: 'bold', bolder: 'bold', 500: 'normal', 400: 'normal', 300: 'normal', 200: 'normal', 100: 'normal', normal: 'normal', lighter: 'normal' } }, 'font-style': { inherit: true, initial: 'normal', values: { italic: 'italic', oblique: 'italic', normal: 'normal' } }, 'text-anchor': { inherit: true, initial: 'start', values: { start: 'start', middle: 'middle', end: 'end' } }, direction: { inherit: true, initial: 'ltr', values: { ltr: 'ltr', rtl: 'rtl' } }, 'dominant-baseline': { inherit: true, initial: 'baseline', values: { auto: 'baseline', baseline: 'baseline', 'before-edge': 'before-edge', 'text-before-edge': 'before-edge', middle: 'middle', central: 'central', 'after-edge': 'after-edge', 'text-after-edge': 'after-edge', ideographic: 'ideographic', alphabetic: 'alphabetic', hanging: 'hanging', mathematical: 'mathematical' } }, 'alignment-baseline': { inherit: false, initial: undefined, values: { auto: 'baseline', baseline: 'baseline', 'before-edge': 'before-edge', 'text-before-edge': 'before-edge', middle: 'middle', central: 'central', 'after-edge': 'after-edge', 'text-after-edge': 'after-edge', ideographic: 'ideographic', alphabetic: 'alphabetic', hanging: 'hanging', mathematical: 'mathematical' } }, 'baseline-shift': { inherit: true, initial: 'baseline', values: { baseline: 'baseline', sub: 'sub', super: 'super' } }, 'word-spacing': { inherit: true, initial: 0, values: { normal: 0 } }, 'letter-spacing': { inherit: true, initial: 0, values: { normal: 0 } }, 'text-decoration': { inherit: false, initial: 'none', values: { none: 'none', underline: 'underline', overline: 'overline', 'line-through': 'line-through' } }, 'xml:space': { inherit: true, initial: 'default', css: 'white-space', values: { preserve: 'preserve', default: 'default', pre: 'preserve', 'pre-line': 'preserve', 'pre-wrap': 'preserve', nowrap: 'default' } }, 'marker-start': { inherit: true, initial: 'none' }, 'marker-mid': { inherit: true, initial: 'none' }, 'marker-end': { inherit: true, initial: 'none' }, opacity: { inherit: false, initial: 1 }, transform: { inherit: false, initial: [1, 0, 0, 1, 0, 0] }, display: { inherit: false, initial: 'inline', values: { none: 'none', inline: 'inline', block: 'inline' } }, 'clip-path': { inherit: false, initial: 'none' }, mask: { inherit: false, initial: 'none' }, overflow: { inherit: false, initial: 'hidden', values: { hidden: 'hidden', scroll: 'hidden', visible: 'visible' } } } function docBeginGroup (bbox) { const group = new function PDFGroup () {}() group.name = 'G' + (doc._groupCount = (doc._groupCount || 0) + 1) group.resources = doc.ref() group.xobj = doc.ref({ Type: 'XObject', Subtype: 'Form', FormType: 1, BBox: bbox, Group: { S: 'Transparency', CS: 'DeviceRGB', I: true, K: false }, Resources: group.resources }) group.xobj.write('') group.savedMatrix = doc._ctm group.savedPage = doc.page groupStack.push(group) doc._ctm = [1, 0, 0, 1, 0, 0] doc.page = { width: doc.page.width, height: doc.page.height, write: function write (data) { group.xobj.write(data) }, fonts: {}, xobjects: {}, ext_gstates: {}, patterns: {} } return group } function docEndGroup (group) { if (group !== groupStack.pop()) { throw 'Group not matching' } if (Object.keys(doc.page.fonts).length) { group.resources.data.Font = doc.page.fonts } if (Object.keys(doc.page.xobjects).length) { group.resources.data.XObject = doc.page.xobjects } if (Object.keys(doc.page.ext_gstates).length) { group.resources.data.ExtGState = doc.page.ext_gstates } if (Object.keys(doc.page.patterns).length) { group.resources.data.Pattern = doc.page.patterns } group.resources.end() group.xobj.end() doc._ctm = group.savedMatrix doc.page = group.savedPage } function docInsertGroup (group) { doc.page.xobjects[group.name] = group.xobj doc.addContent('/' + group.name + ' Do') } function docApplyMask (group, clip) { const name = 'M' + (doc._maskCount = (doc._maskCount || 0) + 1) const gstate = doc.ref({ Type: 'ExtGState', CA: 1, ca: 1, BM: 'Normal', SMask: { S: 'Luminosity', G: group.xobj, BC: clip ? [0, 0, 0] : [1, 1, 1] } }) gstate.end() doc.page.ext_gstates[name] = gstate doc.addContent('/' + name + ' gs') } function docCreatePattern (group, dx, dy, matrix) { const pattern = new function PDFPattern () {}() pattern.group = group pattern.dx = dx pattern.dy = dy pattern.matrix = matrix || [1, 0, 0, 1, 0, 0] return pattern } function docUsePattern (pattern, stroke) { const name = 'P' + (doc._patternCount = (doc._patternCount || 0) + 1) const ref = doc.ref({ Type: 'Pattern', PatternType: 1, PaintType: 1, TilingType: 2, BBox: [0, 0, pattern.dx, pattern.dy], XStep: pattern.dx, YStep: pattern.dy, Matrix: multiplyMatrix(doc._ctm, pattern.matrix), Resources: { ProcSet: ['PDF', 'Text', 'ImageB', 'ImageC', 'ImageI'], XObject: (function () { const temp = {} temp[pattern.group.name] = pattern.group.xobj return temp }()) } }) ref.write('/' + pattern.group.name + ' Do') ref.end() doc.page.patterns[name] = ref if (stroke) { doc.addContent('/Pattern CS') doc.addContent('/' + name + ' SCN') } else { doc.addContent('/Pattern cs') doc.addContent('/' + name + ' scn') } } function docBeginText (font, size) { if (!doc.page.fonts[font.id]) { doc.page.fonts[font.id] = font.ref() } doc.addContent('BT').addContent('/' + font.id + ' ' + size + ' Tf') } function docSetTextMatrix (a, b, c, d, e, f) { doc.addContent(validateNumber(a) + ' ' + validateNumber(b) + ' ' + validateNumber(-c) + ' ' + validateNumber(-d) + ' ' + validateNumber(e) + ' ' + validateNumber(f) + ' Tm') } function docSetTextMode (fill, stroke) { const mode = fill && stroke ? 2 : stroke ? 1 : fill ? 0 : 3 doc.addContent(mode + ' Tr') } function docWriteGlyph (glyph) { doc.addContent('<' + glyph + '> Tj') } function docEndText () { doc.addContent('ET') } function docFillColor (color) { if (color[0].constructor.name === 'PDFPattern') { doc.fillOpacity(color[1]) docUsePattern(color[0], false) } else { doc.fillColor(color[0], color[1]) } } function docStrokeColor (color) { if (color[0].constructor.name === 'PDFPattern') { doc.strokeOpacity(color[1]) docUsePattern(color[0], true) } else { doc.strokeColor(color[0], color[1]) } } function docInsertLink (x, y, w, h, url) { const ref = doc.ref({ Type: 'Annot', Subtype: 'Link', Rect: [x, y, w, h], Border: [0, 0, 0], A: { S: 'URI', URI: new String(url) } }) ref.end() links.push(ref) } function parseXml (xml) { const SvgNode = function SvgNode (tag, type, value, error) { this.error = error this.nodeName = tag this.nodeValue = value this.nodeType = type this.attributes = Object.create(null) this.childNodes = [] this.parentNode = null this.id = '' this.textContent = '' this.classList = [] } SvgNode.prototype.getAttribute = function (attr) { return this.attributes[attr] != null ? this.attributes[attr] : null } SvgNode.prototype.getElementById = function (id) { let result = null; (function recursive (node) { if (result) { return } if (node.nodeType === 1) { if (node.id === id) { result = node } for (let i = 0; i < node.childNodes.length; i++) { recursive(node.childNodes[i]) } } })(this) return result } SvgNode.prototype.getElementsByTagName = function (tag) { const result = []; (function recursive (node) { if (node.nodeType === 1) { if (node.nodeName === tag) { result.push(node) } for (let i = 0; i < node.childNodes.length; i++) { recursive(node.childNodes[i]) } } })(this) return result } const parser = new StringParser(xml.trim()) let result let child let error = false const recursive = function recursive () { let temp, child if (temp = parser.match(/^<([\w:.-]+)\s*/, true)) { // Opening tag const node = new SvgNode(temp[1], 1, null, error) while (temp = parser.match(/^([\w:.-]+)(?:\s*=\s*"([^"]*)"|\s*=\s*'([^']*)')?\s*/, true)) { // Attribute const attr = temp[1] const value = decodeEntities(temp[2] || temp[3] || '') if (!node.attributes[attr]) { node.attributes[attr] = value if (attr === 'id') { node.id = value } if (attr === 'class') { node.classList = value.split(' ') } } else { warningCallback('parseXml: duplicate attribute "' + attr + '"') error = true } } if (parser.match(/^>/)) { // End of opening tag while (child = recursive()) { node.childNodes.push(child) child.parentNode = node node.textContent += child.nodeType === 3 || child.nodeType === 4 ? child.nodeValue : child.textContent } if (temp = parser.match(/^<\/([\w:.-]+)\s*>/, true)) { // Closing tag if (temp[1] === node.nodeName) { return node } else { warningCallback('parseXml: tag not matching, opening "' + node.nodeName + '" & closing "' + temp[1] + '"') error = true return node } } else { warningCallback('parseXml: tag not matching, opening "' + node.nodeName + '" & not closing') error = true return node } } else if (parser.match(/^\/>/)) { // Self-closing tag return node } else { warningCallback('parseXml: tag could not be parsed "' + node.nodeName + '"') error = true } } else if (temp = parser.match(/^/)) { // Comment return new SvgNode(null, 8, temp, error) } else if (temp = parser.match(/^<\?[\s\S]*?\?>/)) { // Processing instructions return new SvgNode(null, 7, temp, error) } else if (temp = parser.match(/^/)) { // Doctype return new SvgNode(null, 10, temp, error) } else if (temp = parser.match(/^/, true)) { // Cdata node return new SvgNode('#cdata-section', 4, temp[1], error) } else if (temp = parser.match(/^([^<]+)/, true)) { // Text node return new SvgNode('#text', 3, decodeEntities(temp[1]), error) } } while (child = recursive()) { if (child.nodeType === 1 && !result) { result = child } else if (child.nodeType === 1 || child.nodeType === 3 && child.nodeValue.trim() !== '') { warningCallback('parseXml: data after document end has been discarded') } } if (parser.matchAll()) { warningCallback('parseXml: parsing error') } return result } ; function decodeEntities (str) { return str.replace(/&(?:#([0-9]+)|#[xX]([0-9A-Fa-f]+)|([0-9A-Za-z]+));/g, function (mt, m0, m1, m2) { if (m0) { return String.fromCharCode(parseInt(m0, 10)) } else if (m1) { return String.fromCharCode(parseInt(m1, 16)) } else if (m2 && Entities[m2]) { return String.fromCharCode(Entities[m2]) } else { return mt } }) } function parseColor (raw) { let temp, result raw = (raw || '').trim() if (temp = NamedColors[raw]) { result = [temp.slice(), 1] } else if (temp = raw.match(/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)$/i)) { temp[1] = parseInt(temp[1]) temp[2] = parseInt(temp[2]) temp[3] = parseInt(temp[3]) temp[4] = parseFloat(temp[4]) if (temp[1] < 256 && temp[2] < 256 && temp[3] < 256 && temp[4] <= 1) { result = [temp.slice(1, 4), temp[4]] } } else if (temp = raw.match(/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)$/i)) { temp[1] = parseInt(temp[1]) temp[2] = parseInt(temp[2]) temp[3] = parseInt(temp[3]) if (temp[1] < 256 && temp[2] < 256 && temp[3] < 256) { result = [temp.slice(1, 4), 1] } } else if (temp = raw.match(/^rgb\(\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/i)) { temp[1] = 2.55 * parseFloat(temp[1]) temp[2] = 2.55 * parseFloat(temp[2]) temp[3] = 2.55 * parseFloat(temp[3]) if (temp[1] < 256 && temp[2] < 256 && temp[3] < 256) { result = [temp.slice(1, 4), 1] } } else if (temp = raw.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)) { result = [[parseInt(temp[1], 16), parseInt(temp[2], 16), parseInt(temp[3], 16)], 1] } else if (temp = raw.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i)) { result = [[0x11 * parseInt(temp[1], 16), 0x11 * parseInt(temp[2], 16), 0x11 * parseInt(temp[3], 16)], 1] } return colorCallback ? colorCallback(result, raw) : result } function opacityToColor (color, opacity, isMask) { const newColor = color[0].slice() const newOpacity = color[1] * opacity if (isMask) { for (let i = 0; i < color.length; i++) { newColor[i] *= newOpacity } return [newColor, 1] } else { return [newColor, newOpacity] } } function multiplyMatrix () { function multiply (a, b) { return [a[0] * b[0] + a[2] * b[1], a[1] * b[0] + a[3] * b[1], a[0] * b[2] + a[2] * b[3], a[1] * b[2] + a[3] * b[3], a[0] * b[4] + a[2] * b[5] + a[4], a[1] * b[4] + a[3] * b[5] + a[5]] } let result = arguments[0] for (let i = 1; i < arguments.length; i++) { result = multiply(result, arguments[i]) } return result } function transformPoint (p, m) { return [m[0] * p[0] + m[2] * p[1] + m[4], m[1] * p[0] + m[3] * p[1] + m[5]] } function getGlobalMatrix () { let ctm = doc._ctm for (let i = groupStack.length - 1; i >= 0; i--) { ctm = multiplyMatrix(groupStack[i].savedMatrix, ctm) } return ctm } function getPageBBox () { return new SvgShape().M(0, 0).L(doc.page.width, 0).L(doc.page.width, doc.page.height).L(0, doc.page.height).transform(inverseMatrix(getGlobalMatrix())).getBoundingBox() } function inverseMatrix (m) { const dt = m[0] * m[3] - m[1] * m[2] return [m[3] / dt, -m[1] / dt, -m[2] / dt, m[0] / dt, (m[2] * m[5] - m[3] * m[4]) / dt, (m[1] * m[4] - m[0] * m[5]) / dt] } function validateMatrix (m) { const m0 = validateNumber(m[0]) const m1 = validateNumber(m[1]) const m2 = validateNumber(m[2]) const m3 = validateNumber(m[3]) const m4 = validateNumber(m[4]) const m5 = validateNumber(m[5]) if (isNotEqual(m0 * m3 - m1 * m2, 0)) { return [m0, m1, m2, m3, m4, m5] } } function solveEquation (curve) { const a = curve[2] || 0 const b = curve[1] || 0 const c = curve[0] || 0 if (isEqual(a, 0) && isEqual(b, 0)) { return [] } else if (isEqual(a, 0)) { return [-c / b] } else { const d = b * b - 4 * a * c if (isNotEqual(d, 0) && d > 0) { return [(-b + Math.sqrt(d)) / (2 * a), (-b - Math.sqrt(d)) / (2 * a)] } else if (isEqual(d, 0)) { return [-b / (2 * a)] } else { return [] } } } function getCurveValue (t, curve) { return (curve[0] || 0) + (curve[1] || 0) * t + (curve[2] || 0) * t * t + (curve[3] || 0) * t * t * t } function isEqual (number, ref) { return Math.abs(number - ref) < 1e-10 } function isNotEqual (number, ref) { return Math.abs(number - ref) >= 1e-10 } function validateNumber (n) { return n > -1e21 && n < 1e21 ? Math.round(n * 1e6) / 1e6 : 0 } function isArrayLike (v) { return typeof v === 'object' && v !== null && typeof v.length === 'number' } function parseTranform (v) { const parser = new StringParser((v || '').trim()) let result = [1, 0, 0, 1, 0, 0] let temp while (temp = parser.match(/^([A-Za-z]+)\s*[(]([^(]+)[)]/, true)) { const func = temp[1] const nums = [] const parser2 = new StringParser(temp[2].trim()) let temp2 = void 0 while (temp2 = parser2.matchNumber()) { nums.push(Number(temp2)) parser2.matchSeparator() } if (func === 'matrix' && nums.length === 6) { result = multiplyMatrix(result, [nums[0], nums[1], nums[2], nums[3], nums[4], nums[5]]) } else if (func === 'translate' && nums.length === 2) { result = multiplyMatrix(result, [1, 0, 0, 1, nums[0], nums[1]]) } else if (func === 'translate' && nums.length === 1) { result = multiplyMatrix(result, [1, 0, 0, 1, nums[0], 0]) } else if (func === 'scale' && nums.length === 2) { result = multiplyMatrix(result, [nums[0], 0, 0, nums[1], 0, 0]) } else if (func === 'scale' && nums.length === 1) { result = multiplyMatrix(result, [nums[0], 0, 0, nums[0], 0, 0]) } else if (func === 'rotate' && nums.length === 3) { const a = nums[0] * Math.PI / 180 result = multiplyMatrix(result, [1, 0, 0, 1, nums[1], nums[2]], [Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0], [1, 0, 0, 1, -nums[1], -nums[2]]) } else if (func === 'rotate' && nums.length === 1) { const _a = nums[0] * Math.PI / 180 result = multiplyMatrix(result, [Math.cos(_a), Math.sin(_a), -Math.sin(_a), Math.cos(_a), 0, 0]) } else if (func === 'skewX' && nums.length === 1) { const _a2 = nums[0] * Math.PI / 180 result = multiplyMatrix(result, [1, 0, Math.tan(_a2), 1, 0, 0]) } else if (func === 'skewY' && nums.length === 1) { const _a3 = nums[0] * Math.PI / 180 result = multiplyMatrix(result, [1, Math.tan(_a3), 0, 1, 0, 0]) } else { return } parser.matchSeparator() } if (parser.matchAll()) { return } return result } function parseAspectRatio (aspectRatio, availWidth, availHeight, elemWidth, elemHeight, initAlign) { const temp = (aspectRatio || '').trim().match(/^(none)$|^x(Min|Mid|Max)Y(Min|Mid|Max)(?:\s+(meet|slice))?$/) || [] const ratioType = temp[1] || temp[4] || 'meet' const xAlign = temp[2] || 'Mid' const yAlign = temp[3] || 'Mid' let scaleX = availWidth / elemWidth let scaleY = availHeight / elemHeight const dx = { Min: 0, Mid: 0.5, Max: 1 }[xAlign] - (initAlign || 0) const dy = { Min: 0, Mid: 0.5, Max: 1 }[yAlign] - (initAlign || 0) if (ratioType === 'slice') { scaleY = scaleX = Math.max(scaleX, scaleY) } else if (ratioType === 'meet') { scaleY = scaleX = Math.min(scaleX, scaleY) } return [scaleX, 0, 0, scaleY, dx * (availWidth - elemWidth * scaleX), dy * (availHeight - elemHeight * scaleY)] } function parseStyleAttr (v) { const result = Object.create(null) v = (v || '').trim().split(/;/) for (let i = 0; i < v.length; i++) { const key = (v[i].split(':')[0] || '').trim() const value = (v[i].split(':')[1] || '').trim() if (key) { result[key] = value } } if (result.marker) { if (!result['marker-start']) { result['marker-start'] = result.marker } if (!result['marker-mid']) { result['marker-mid'] = result.marker } if (!result['marker-end']) { result['marker-end'] = result.marker } } if (result.font) { let fontFamily = null let fontSize = null let fontStyle = 'normal' let fontWeight = 'normal' let fontVariant = 'normal' const parts = result.font.split(/\s+/) for (let _i = 0; _i < parts.length; _i++) { switch (parts[_i]) { case 'normal': break case 'italic': case 'oblique': fontStyle = parts[_i] break case 'small-caps': fontVariant = parts[_i] break case 'bold': case 'bolder': case 'lighter': case '100': case '200': case '300': case '400': case '500': case '600': case '700': case '800': case '900': fontWeight = parts[_i] break default: if (!fontSize) { fontSize = parts[_i].split('/')[0] } else { if (!fontFamily) { fontFamily = parts[_i] } else { fontFamily += ' ' + parts[_i] } } break } } if (!result['font-style']) { result['font-style'] = fontStyle } if (!result['font-variant']) { result['font-variant'] = fontVariant } if (!result['font-weight']) { result['font-weight'] = fontWeight } if (!result['font-size']) { result['font-size'] = fontSize } if (!result['font-family']) { result['font-family'] = fontFamily } } return result } function parseSelector (v) { const parts = v.split(/(?=[.#])/g) const ids = [] const classes = [] const tags = [] let temp for (let i = 0; i < parts.length; i++) { if (temp = parts[i].match(/^[#]([_A-Za-z0-9-]+)$/)) { ids.push(temp[1]) } else if (temp = parts[i].match(/^[.]([_A-Za-z0-9-]+)$/)) { classes.push(temp[1]) } else if (temp = parts[i].match(/^([_A-Za-z0-9-]+)$/)) { tags.push(temp[1]) } else if (parts[i] !== '*') { return } } return { tags, ids, classes, specificity: ids.length * 10000 + classes.length * 100 + tags.length } } function parseStyleSheet (v) { const parser = new StringParser(v.trim()) const rules = [] let rule while (rule = parser.match(/^\s*([^\{\}]*?)\s*\{([^\{\}]*?)\}/, true)) { const selectors = rule[1].split(/\s*,\s*/g) const css = parseStyleAttr(rule[2]) for (let i = 0; i < selectors.length; i++) { const selector = parseSelector(selectors[i]) if (selector) { rules.push({ selector, css }) } } } return rules } function matchesSelector (elem, selector) { if (elem.nodeType !== 1) { return false } for (let i = 0; i < selector.tags.length; i++) { if (selector.tags[i] !== elem.nodeName) { return false } } for (let _i2 = 0; _i2 < selector.ids.length; _i2++) { if (selector.ids[_i2] !== elem.id) { return false } } for (let _i3 = 0; _i3 < selector.classes.length; _i3++) { if (elem.classList.indexOf(selector.classes[_i3]) === -1) { return false } } return true } function getStyle (elem) { const result = Object.create(null) const specificities = Object.create(null) for (let i = 0; i < styleRules.length; i++) { const rule = styleRules[i] if (matchesSelector(elem, rule.selector)) { for (const key in rule.css) { if (!(specificities[key] > rule.selector.specificity)) { result[key] = rule.css[key] specificities[key] = rule.selector.specificity } } } } return result } function combineArrays (array1, array2) { return array1.concat(array2.slice(array1.length)) } function getAscent (font, size) { return Math.max(font.ascender, (font.bbox[3] || font.bbox.maxY) * (font.scale || 1)) * size / 1000 } function getDescent (font, size) { return Math.min(font.descender, (font.bbox[1] || font.bbox.minY) * (font.scale || 1)) * size / 1000 } function getXHeight (font, size) { return (font.xHeight || 0.5 * (font.ascender - font.descender)) * size / 1000 } function getBaseline (font, size, baseline, shift) { let dy1, dy2 switch (baseline) { case 'middle': dy1 = 0.5 * getXHeight(font, size) break case 'central': dy1 = 0.5 * (getDescent(font, size) + getAscent(font, size)) break case 'after-edge': case 'text-after-edge': dy1 = getDescent(font, size) break case 'alphabetic': case 'auto': case 'baseline': dy1 = 0 break case 'mathematical': dy1 = 0.5 * getAscent(font, size) break case 'hanging': dy1 = 0.8 * getAscent(font, size) break case 'before-edge': case 'text-before-edge': dy1 = getAscent(font, size) break default: dy1 = 0 break } switch (shift) { case 'baseline': dy2 = 0 break case 'super': dy2 = 0.6 * size break case 'sub': dy2 = -0.6 * size break default: dy2 = shift break } return dy1 - dy2 } function getTextPos (font, size, text) { const encoded = font.encode('' + text) const hex = encoded[0] const pos = encoded[1] const data = [] for (let i = 0; i < hex.length; i++) { const unicode = font.unicode ? font.unicode[parseInt(hex[i], 16)] : [text.charCodeAt(i)] data.push({ glyph: hex[i], unicode, width: pos[i].advanceWidth * size / 1000, xOffset: pos[i].xOffset * size / 1000, yOffset: pos[i].yOffset * size / 1000, xAdvance: pos[i].xAdvance * size / 1000, yAdvance: pos[i].yAdvance * size / 1000 }) } return data } function createSVGElement (obj, inherits) { switch (obj.nodeName) { case 'use': return new SvgElemUse(obj, inherits) case 'symbol': return new SvgElemSymbol(obj, inherits) case 'g': return new SvgElemGroup(obj, inherits) case 'a': return new SvgElemLink(obj, inherits) case 'svg': return new SvgElemSvg(obj, inherits) case 'image': return new SVGElemImage(obj, inherits) case 'rect': return new SvgElemRect(obj, inherits) case 'circle': return new SvgElemCircle(obj, inherits) case 'ellipse': return new SvgElemEllipse(obj, inherits) case 'line': return new SvgElemLine(obj, inherits) case 'polyline': return new SvgElemPolyline(obj, inherits) case 'polygon': return new SvgElemPolygon(obj, inherits) case 'path': return new SvgElemPath(obj, inherits) case 'text': return new SvgElemText(obj, inherits) case 'tspan': return new SvgElemTspan(obj, inherits) case 'textPath': return new SvgElemTextPath(obj, inherits) case '#text': case '#cdata-section': return new SvgElemTextNode(obj, inherits) default: return new SvgElem(obj, inherits) } } var StringParser = function StringParser (str) { this.match = function (exp, all) { const temp = str.match(exp) if (!temp || temp.index !== 0) { return } str = str.substring(temp[0].length) return all ? temp : temp[0] } this.matchSeparator = function () { return this.match(/^(?:\s*,\s*|\s*|)/) } this.matchSpace = function () { return this.match(/^(?:\s*)/) } this.matchLengthUnit = function () { return this.match(/^(?:px|pt|cm|mm|in|pc|em|ex|%|)/) } this.matchNumber = function () { return this.match(/^(?:[-+]?(?:[0-9]+[.][0-9]+|[0-9]+[.]|[.][0-9]+|[0-9]+)(?:[eE][-+]?[0-9]+)?)/) } this.matchAll = function () { return this.match(/^[\s\S]+/) } } const BezierSegment = function BezierSegment (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) { const divisions = 6 * precision const equationX = [p1x, -3 * p1x + 3 * c1x, 3 * p1x - 6 * c1x + 3 * c2x, -p1x + 3 * c1x - 3 * c2x + p2x] const equationY = [p1y, -3 * p1y + 3 * c1y, 3 * p1y - 6 * c1y + 3 * c2y, -p1y + 3 * c1y - 3 * c2y + p2y] const derivativeX = [-3 * p1x + 3 * c1x, 6 * p1x - 12 * c1x + 6 * c2x, -3 * p1x + 9 * c1x - 9 * c2x + 3 * p2x] const derivativeY = [-3 * p1y + 3 * c1y, 6 * p1y - 12 * c1y + 6 * c2y, -3 * p1y + 9 * c1y - 9 * c2y + 3 * p2y] const lengthMap = [0] for (let i = 1; i <= divisions; i++) { const t = (i - 0.5) / divisions const dx = getCurveValue(t, derivativeX) / divisions const dy = getCurveValue(t, derivativeY) / divisions const l = Math.sqrt(dx * dx + dy * dy) lengthMap[i] = lengthMap[i - 1] + l } this.totalLength = lengthMap[divisions] this.startPoint = [p1x, p1y, isEqual(p1x, c1x) && isEqual(p1y, c1y) ? Math.atan2(c2y - c1y, c2x - c1x) : Math.atan2(c1y - p1y, c1x - p1x)] this.endPoint = [p2x, p2y, isEqual(c2x, p2x) && isEqual(c2y, p2y) ? Math.atan2(c2y - c1y, c2x - c1x) : Math.atan2(p2y - c2y, p2x - c2x)] this.getBoundingBox = function () { let temp let minX = getCurveValue(0, equationX) let minY = getCurveValue(0, equationY) let maxX = getCurveValue(1, equationX) let maxY = getCurveValue(1, equationY) if (minX > maxX) { temp = maxX maxX = minX minX = temp } if (minY > maxY) { temp = maxY maxY = minY minY = temp } const rootsX = solveEquation(derivativeX) for (let _i4 = 0; _i4 < rootsX.length; _i4++) { if (rootsX[_i4] >= 0 && rootsX[_i4] <= 1) { const _x = getCurveValue(rootsX[_i4], equationX) if (_x < minX) { minX = _x } if (_x > maxX) { maxX = _x } } } const rootsY = solveEquation(derivativeY) for (let _i5 = 0; _i5 < rootsY.length; _i5++) { if (rootsY[_i5] >= 0 && rootsY[_i5] <= 1) { const _y = getCurveValue(rootsY[_i5], equationY) if (_y < minY) { minY = _y } if (_y > maxY) { maxY = _y } } } return [minX, minY, maxX, maxY] } this.getPointAtLength = function (l) { if (isEqual(l, 0)) { return this.startPoint } if (isEqual(l, this.totalLength)) { return this.endPoint } if (l < 0 || l > this.totalLength) { return } for (let _i6 = 1; _i6 <= divisions; _i6++) { const l1 = lengthMap[_i6 - 1] const l2 = lengthMap[_i6] if (l1 <= l && l <= l2) { const _t = (_i6 - (l2 - l) / (l2 - l1)) / divisions const _x2 = getCurveValue(_t, equationX) const _y2 = getCurveValue(_t, equationY) const _dx = getCurveValue(_t, derivativeX) const _dy = getCurveValue(_t, derivativeY) return [_x2, _y2, Math.atan2(_dy, _dx)] } } } } const LineSegment = function LineSegment (p1x, p1y, p2x, p2y) { this.totalLength = Math.sqrt((p2x - p1x) * (p2x - p1x) + (p2y - p1y) * (p2y - p1y)) this.startPoint = [p1x, p1y, Math.atan2(p2y - p1y, p2x - p1x)] this.endPoint = [p2x, p2y, Math.atan2(p2y - p1y, p2x - p1x)] this.getBoundingBox = function () { return [Math.min(this.startPoint[0], this.endPoint[0]), Math.min(this.startPoint[1], this.endPoint[1]), Math.max(this.startPoint[0], this.endPoint[0]), Math.max(this.startPoint[1], this.endPoint[1])] } this.getPointAtLength = function (l) { if (l >= 0 && l <= this.totalLength) { const r = l / this.totalLength || 0 const _x3 = this.startPoint[0] + r * (this.endPoint[0] - this.startPoint[0]) const _y3 = this.startPoint[1] + r * (this.endPoint[1] - this.startPoint[1]) return [_x3, _y3, this.startPoint[2]] } } } var SvgShape = function SvgShape () { this.pathCommands = [] this.pathSegments = [] this.startPoint = null this.endPoint = null this.totalLength = 0 let startX = 0 let startY = 0 let currX = 0 let currY = 0 let lastCom let lastCtrlX let lastCtrlY this.move = function (x, y) { startX = currX = x startY = currY = y return null } this.line = function (x, y) { const segment = new LineSegment(currX, currY, x, y) currX = x currY = y return segment } this.curve = function (c1x, c1y, c2x, c2y, x, y) { const segment = new BezierSegment(currX, currY, c1x, c1y, c2x, c2y, x, y) currX = x currY = y return segment } this.close = function () { const segment = new LineSegment(currX, currY, startX, startY) currX = startX currY = startY return segment } this.addCommand = function (data) { this.pathCommands.push(data) const segment = this[data[0]].apply(this, data.slice(3)) if (segment) { segment.hasStart = data[1] segment.hasEnd = data[2] this.startPoint = this.startPoint || segment.startPoint this.endPoint = segment.endPoint this.pathSegments.push(segment) this.totalLength += segment.totalLength } } this.M = function (x, y) { this.addCommand(['move', true, true, x, y]) lastCom = 'M' return this } this.m = function (x, y) { return this.M(currX + x, currY + y) } this.Z = this.z = function () { this.addCommand(['close', true, true]) lastCom = 'Z' return this } this.L = function (x, y) { this.addCommand(['line', true, true, x, y]) lastCom = 'L' return this } this.l = function (x, y) { return this.L(currX + x, currY + y) } this.H = function (x) { return this.L(x, currY) } this.h = function (x) { return this.L(currX + x, currY) } this.V = function (y) { return this.L(currX, y) } this.v = function (y) { return this.L(currX, currY + y) } this.C = function (c1x, c1y, c2x, c2y, x, y) { this.addCommand(['curve', true, true, c1x, c1y, c2x, c2y, x, y]) lastCom = 'C' lastCtrlX = c2x lastCtrlY = c2y return this } this.c = function (c1x, c1y, c2x, c2y, x, y) { return this.C(currX + c1x, currY + c1y, currX + c2x, currY + c2y, currX + x, currY + y) } this.S = function (c1x, c1y, x, y) { return this.C(currX + (lastCom === 'C' ? currX - lastCtrlX : 0), currY + (lastCom === 'C' ? currY - lastCtrlY : 0), c1x, c1y, x, y) } this.s = function (c1x, c1y, x, y) { return this.C(currX + (lastCom === 'C' ? currX - lastCtrlX : 0), currY + (lastCom === 'C' ? currY - lastCtrlY : 0), currX + c1x, currY + c1y, currX + x, currY + y) } this.Q = function (cx, cy, x, y) { const c1x = currX + 2 / 3 * (cx - currX) const c1y = currY + 2 / 3 * (cy - currY) const c2x = x + 2 / 3 * (cx - x) const c2y = y + 2 / 3 * (cy - y) this.addCommand(['curve', true, true, c1x, c1y, c2x, c2y, x, y]) lastCom = 'Q' lastCtrlX = cx lastCtrlY = cy return this } this.q = function (c1x, c1y, x, y) { return this.Q(currX + c1x, currY + c1y, currX + x, currY + y) } this.T = function (x, y) { return this.Q(currX + (lastCom === 'Q' ? currX - lastCtrlX : 0), currY + (lastCom === 'Q' ? currY - lastCtrlY : 0), x, y) } this.t = function (x, y) { return this.Q(currX + (lastCom === 'Q' ? currX - lastCtrlX : 0), currY + (lastCom === 'Q' ? currY - lastCtrlY : 0), currX + x, currY + y) } this.A = function (rx, ry, fi, fa, fs, x, y) { if (isEqual(rx, 0) || isEqual(ry, 0)) { this.addCommand(['line', true, true, x, y]) } else { fi = fi * (Math.PI / 180) rx = Math.abs(rx) ry = Math.abs(ry) fa = 1 * !!fa fs = 1 * !!fs const x1 = Math.cos(fi) * (currX - x) / 2 + Math.sin(fi) * (currY - y) / 2 const y1 = Math.cos(fi) * (currY - y) / 2 - Math.sin(fi) * (currX - x) / 2 const lambda = x1 * x1 / (rx * rx) + y1 * y1 / (ry * ry) if (lambda > 1) { rx *= Math.sqrt(lambda) ry *= Math.sqrt(lambda) } const r = Math.sqrt(Math.max(0, rx * rx * ry * ry - rx * rx * y1 * y1 - ry * ry * x1 * x1) / (rx * rx * y1 * y1 + ry * ry * x1 * x1)) const x2 = (fa === fs ? -1 : 1) * r * rx * y1 / ry const y2 = (fa === fs ? 1 : -1) * r * ry * x1 / rx const cx = Math.cos(fi) * x2 - Math.sin(fi) * y2 + (currX + x) / 2 const cy = Math.sin(fi) * x2 + Math.cos(fi) * y2 + (currY + y) / 2 const th1 = Math.atan2((y1 - y2) / ry, (x1 - x2) / rx) let th2 = Math.atan2((-y1 - y2) / ry, (-x1 - x2) / rx) if (fs === 0 && th2 - th1 > 0) { th2 -= 2 * Math.PI } else if (fs === 1 && th2 - th1 < 0) { th2 += 2 * Math.PI } const segms = Math.ceil(Math.abs(th2 - th1) / (Math.PI / precision)) for (let i = 0; i < segms; i++) { const th3 = th1 + i * (th2 - th1) / segms const th4 = th1 + (i + 1) * (th2 - th1) / segms const t = 4 / 3 * Math.tan((th4 - th3) / 4) const c1x = cx + Math.cos(fi) * rx * (Math.cos(th3) - t * Math.sin(th3)) - Math.sin(fi) * ry * (Math.sin(th3) + t * Math.cos(th3)) const c1y = cy + Math.sin(fi) * rx * (Math.cos(th3) - t * Math.sin(th3)) + Math.cos(fi) * ry * (Math.sin(th3) + t * Math.cos(th3)) const c2x = cx + Math.cos(fi) * rx * (Math.cos(th4) + t * Math.sin(th4)) - Math.sin(fi) * ry * (Math.sin(th4) - t * Math.cos(th4)) const c2y = cy + Math.sin(fi) * rx * (Math.cos(th4) + t * Math.sin(th4)) + Math.cos(fi) * ry * (Math.sin(th4) - t * Math.cos(th4)) const endX = cx + Math.cos(fi) * rx * Math.cos(th4) - Math.sin(fi) * ry * Math.sin(th4) const endY = cy + Math.sin(fi) * rx * Math.cos(th4) + Math.cos(fi) * ry * Math.sin(th4) this.addCommand(['curve', i === 0, i === segms - 1, c1x, c1y, c2x, c2y, endX, endY]) } } lastCom = 'A' return this } this.a = function (rx, ry, fi, fa, fs, x, y) { return this.A(rx, ry, fi, fa, fs, currX + x, currY + y) } this.path = function (d) { let command let value let temp const parser = new StringParser((d || '').trim()) while (command = parser.match(/^[astvzqmhlcASTVZQMHLC]/)) { parser.matchSeparator() let values = [] while (value = PathFlags[command + values.length] ? parser.match(/^[01]/) : parser.matchNumber()) { parser.matchSeparator() if (values.length === PathArguments[command]) { this[command].apply(this, values) values = [] if (command === 'M') { command = 'L' } else if (command === 'm') { command = 'l' } } values.push(Number(value)) } if (values.length === PathArguments[command]) { this[command].apply(this, values) } else { warningCallback('SvgPath: command ' + command + ' with ' + values.length + ' numbers') return } } if (temp = parser.matchAll()) { warningCallback('SvgPath: unexpected string ' + temp) } return this } this.getBoundingBox = function () { const bbox = [Infinity, Infinity, -Infinity, -Infinity] function addBounds (bbox1) { if (bbox1[0] < bbox[0]) { bbox[0] = bbox1[0] } if (bbox1[2] > bbox[2]) { bbox[2] = bbox1[2] } if (bbox1[1] < bbox[1]) { bbox[1] = bbox1[1] } if (bbox1[3] > bbox[3]) { bbox[3] = bbox1[3] } } for (let i = 0; i < this.pathSegments.length; i++) { addBounds(this.pathSegments[i].getBoundingBox()) } if (bbox[0] === Infinity) { bbox[0] = 0 } if (bbox[1] === Infinity) { bbox[1] = 0 } if (bbox[2] === -Infinity) { bbox[2] = 0 } if (bbox[3] === -Infinity) { bbox[3] = 0 } return bbox } this.getPointAtLength = function (l) { if (l >= 0 && l <= this.totalLength) { let temp for (let i = 0; i < this.pathSegments.length; i++) { if (temp = this.pathSegments[i].getPointAtLength(l)) { return temp } l -= this.pathSegments[i].totalLength } return this.endPoint } } this.transform = function (m) { this.pathSegments = [] this.startPoint = null this.endPoint = null this.totalLength = 0 for (let i = 0; i < this.pathCommands.length; i++) { const data = this.pathCommands.shift() for (let j = 3; j < data.length; j += 2) { const p = transformPoint([data[j], data[j + 1]], m) data[j] = p[0] data[j + 1] = p[1] } this.addCommand(data) } return this } this.mergeShape = function (shape) { for (let i = 0; i < shape.pathCommands.length; i++) { this.addCommand(shape.pathCommands[i].slice()) } return this } this.clone = function () { return new SvgShape().mergeShape(this) } this.insertInDocument = function () { for (let i = 0; i < this.pathCommands.length; i++) { const command = this.pathCommands[i][0] const values = this.pathCommands[i].slice(3) switch (command) { case 'move': doc.moveTo(values[0], values[1]) break case 'line': doc.lineTo(values[0], values[1]) break case 'curve': doc.bezierCurveTo(values[0], values[1], values[2], values[3], values[4], values[5]) break case 'close': doc.closePath() break } } } this.getSubPaths = function () { const subPaths = [] let shape = new SvgShape() for (let i = 0; i < this.pathCommands.length; i++) { const data = this.pathCommands[i] const command = this.pathCommands[i][0] if (command === 'move' && i !== 0) { subPaths.push(shape) shape = new SvgShape() } shape.addCommand(data) } subPaths.push(shape) return subPaths } this.getMarkers = function () { let markers = [] const subPaths = this.getSubPaths() for (let i = 0; i < subPaths.length; i++) { const subPath = subPaths[i] const subPathMarkers = [] for (let j = 0; j < subPath.pathSegments.length; j++) { const segment = subPath.pathSegments[j] if (isNotEqual(segment.totalLength, 0) || j === 0 || j === subPath.pathSegments.length - 1) { if (segment.hasStart) { const startMarker = segment.getPointAtLength(0) const prevEndMarker = subPathMarkers.pop() if (prevEndMarker) { startMarker[2] = 0.5 * (prevEndMarker[2] + startMarker[2]) } subPathMarkers.push(startMarker) } if (segment.hasEnd) { const endMarker = segment.getPointAtLength(segment.totalLength) subPathMarkers.push(endMarker) } } } markers = markers.concat(subPathMarkers) } return markers } } var SvgElem = function SvgElem (obj, inherits) { const styleCache = Object.create(null) let childrenCache = null this.name = obj.nodeName this.isOuterElement = obj === svg || !obj.parentNode this.inherits = inherits || (!this.isOuterElement ? createSVGElement(obj.parentNode, null) : null) this.stack = this.inherits ? this.inherits.stack.concat(obj) : [obj] this.style = parseStyleAttr(typeof obj.getAttribute === 'function' && obj.getAttribute('style')) this.css = useCSS ? getComputedStyle(obj) : getStyle(obj) this.allowedChildren = [] this.attr = function (key) { if (typeof obj.getAttribute === 'function') { return obj.getAttribute(key) } } this.resolveUrl = function (value) { const temp = (value || '').match(/^\s*(?:url\("(.*)#(.*)"\)|url\('(.*)#(.*)'\)|url\((.*)#(.*)\)|(.*)#(.*))\s*$/) || [] const file = temp[1] || temp[3] || temp[5] || temp[7] const id = temp[2] || temp[4] || temp[6] || temp[8] if (id) { if (!file) { const svgObj = svg.getElementById(id) if (svgObj) { if (this.stack.indexOf(svgObj) === -1) { return svgObj } else { warningCallback('SVGtoPDF: loop of circular references for id "' + id + '"') return } } } if (documentCallback) { let svgs = documentCache[file] if (!svgs) { svgs = documentCallback(file) if (!isArrayLike(svgs)) { svgs = [svgs] } for (let i = 0; i < svgs.length; i++) { if (typeof svgs[i] === 'string') { svgs[i] = parseXml(svgs[i]) } } documentCache[file] = svgs } for (let _i7 = 0; _i7 < svgs.length; _i7++) { const _svgObj = svgs[_i7].getElementById(id) if (_svgObj) { if (this.stack.indexOf(_svgObj) === -1) { return _svgObj } else { warningCallback('SVGtoPDF: loop of circular references for id "' + file + '#' + id + '"') return } } } } } } this.computeUnits = function (value, unit, percent, isFontSize) { if (unit === '%') { return parseFloat(value) / 100 * (isFontSize || percent != null ? percent : this.getViewport()) } else if (unit === 'ex' || unit === 'em') { return value * { em: 1, ex: 0.5 }[unit] * (isFontSize ? percent : this.get('font-size')) } else { return value * { '': 1, px: 1, pt: 96 / 72, cm: 96 / 2.54, mm: 96 / 25.4, in: 96, pc: 96 / 6 }[unit] } } this.computeLength = function (value, percent, initial, isFontSize) { const parser = new StringParser((value || '').trim()) let temp1 let temp2 if (typeof (temp1 = parser.matchNumber()) === 'string' && typeof (temp2 = parser.matchLengthUnit()) === 'string' && !parser.matchAll()) { return this.computeUnits(temp1, temp2, percent, isFontSize) } return initial } this.computeLengthList = function (value, percent, strict) { const parser = new StringParser((value || '').trim()) const result = [] let temp1 let temp2 while (typeof (temp1 = parser.matchNumber()) === 'string' && typeof (temp2 = parser.matchLengthUnit()) === 'string') { result.push(this.computeUnits(temp1, temp2, percent)) parser.matchSeparator() } if (strict && parser.matchAll()) { return } return result } this.getLength = function (key, percent, initial) { return this.computeLength(this.attr(key), percent, initial) } this.getLengthList = function (key, percent) { return this.computeLengthList(this.attr(key), percent) } this.getUrl = function (key) { return this.resolveUrl(this.attr(key)) } this.getNumberList = function (key) { const parser = new StringParser((this.attr(key) || '').trim()) const result = [] let temp while (temp = parser.matchNumber()) { result.push(Number(temp)) parser.matchSeparator() } result.error = parser.matchAll() return result } this.getViewbox = function (key, initial) { const viewBox = this.getNumberList(key) if (viewBox.length === 4 && viewBox[2] >= 0 && viewBox[3] >= 0) { return viewBox } return initial } this.getPercent = function (key, initial) { const value = this.attr(key) const parser = new StringParser((value || '').trim()) let temp1 let temp2 let number = parser.matchNumber() if (!number) { return initial } if (parser.match('%')) { number *= 0.01 } if (parser.matchAll()) { return initial } return Math.max(0, Math.min(1, number)) } this.chooseValue = function (args) { for (let i = 0; i < arguments.length; i++) { if (arguments[i] != null && arguments[i] === arguments[i]) { return arguments[i] } } return arguments[arguments.length - 1] } this.get = function (key) { if (styleCache[key] !== undefined) { return styleCache[key] } const keyInfo = Properties[key] || {} let value let result for (let i = 0; i < 3; i++) { switch (i) { case 0: if (key !== 'transform') { // the CSS transform behaves strangely value = this.css[keyInfo.css || key] } break case 1: value = this.style[key] break case 2: value = this.attr(key) break } if (value === 'inherit') { result = this.inherits ? this.inherits.get(key) : keyInfo.initial if (result != null) { return styleCache[key] = result } } if (keyInfo.values != null) { result = keyInfo.values[value] if (result != null) { return styleCache[key] = result } } if (value != null) { let parsed = void 0 switch (key) { case 'font-size': result = this.computeLength(value, this.inherits ? this.inherits.get(key) : keyInfo.initial, undefined, true) break case 'baseline-shift': result = this.computeLength(value, this.get('font-size')) break case 'font-family': result = value || undefined break case 'opacity': case 'stroke-opacity': case 'fill-opacity': case 'stop-opacity': parsed = parseFloat(value) if (!isNaN(parsed)) { result = Math.max(0, Math.min(1, parsed)) } break case 'transform': result = parseTranform(value) break case 'stroke-dasharray': if (value === 'none') { result = [] } else if (parsed = this.computeLengthList(value, this.getViewport(), true)) { let sum = 0 let error = false for (let j = 0; j < parsed.length; j++) { if (parsed[j] < 0) { error = true } sum += parsed[j] } if (!error) { if (parsed.length % 2 === 1) { parsed = parsed.concat(parsed) } result = sum === 0 ? [] : parsed } } break case 'color': if (value === 'none' || value === 'transparent') { result = 'none' } else { result = parseColor(value) } break case 'fill': case 'stroke': if (value === 'none' || value === 'transparent') { result = 'none' } else if (value === 'currentColor') { result = this.get('color') } else if (parsed = parseColor(value)) { return parsed } else if (parsed = (value || '').split(' ')) { const object = this.resolveUrl(parsed[0]) const fallbackColor = parseColor(parsed[1]) if (object == null) { result = fallbackColor } else if (object.nodeName === 'linearGradient' || object.nodeName === 'radialGradient') { result = new SvgElemGradient(object, null, fallbackColor) } else if (object.nodeName === 'pattern') { result = new SvgElemPattern(object, null, fallbackColor) } else { result = fallbackColor } } break case 'stop-color': if (value === 'none' || value === 'transparent') { result = 'none' } else if (value === 'currentColor') { result = this.get('color') } else { result = parseColor(value) } break case 'marker-start': case 'marker-mid': case 'marker-end': case 'clip-path': case 'mask': if (value === 'none') { result = 'none' } else { result = this.resolveUrl(value) } break case 'stroke-width': parsed = this.computeLength(value, this.getViewport()) if (parsed != null && parsed >= 0) { result = parsed } break case 'stroke-miterlimit': parsed = parseFloat(value) if (parsed != null && parsed >= 1) { result = parsed } break case 'word-spacing': case 'letter-spacing': result = this.computeLength(value, this.getViewport()) break case 'stroke-dashoffset': result = this.computeLength(value, this.getViewport()) if (result != null) { if (result < 0) { // fix for crbug.com/660850 const dasharray = this.get('stroke-dasharray') for (let _j = 0; _j < dasharray.length; _j++) { result += dasharray[_j] } } } break } if (result != null) { return styleCache[key] = result } } } return styleCache[key] = keyInfo.inherit && this.inherits ? this.inherits.get(key) : keyInfo.initial } this.getChildren = function () { if (childrenCache != null) { return childrenCache } const children = [] for (let i = 0; i < obj.childNodes.length; i++) { const child = obj.childNodes[i] if (!child.error && this.allowedChildren.indexOf(child.nodeName) !== -1) { children.push(createSVGElement(child, this)) } } return childrenCache = children } this.getParentVWidth = function () { return this.inherits ? this.inherits.getVWidth() : viewportWidth } this.getParentVHeight = function () { return this.inherits ? this.inherits.getVHeight() : viewportHeight } this.getParentViewport = function () { return Math.sqrt(0.5 * this.getParentVWidth() * this.getParentVWidth() + 0.5 * this.getParentVHeight() * this.getParentVHeight()) } this.getVWidth = function () { return this.getParentVWidth() } this.getVHeight = function () { return this.getParentVHeight() } this.getViewport = function () { return Math.sqrt(0.5 * this.getVWidth() * this.getVWidth() + 0.5 * this.getVHeight() * this.getVHeight()) } this.getBoundingBox = function () { const shape = this.getBoundingShape() return shape.getBoundingBox() } } const SvgElemStylable = function SvgElemStylable (obj, inherits) { SvgElem.call(this, obj, inherits) this.transform = function () { doc.transform.apply(doc, this.getTransformation()) } this.clip = function () { if (this.get('clip-path') !== 'none') { const clipPath = new SvgElemClipPath(this.get('clip-path'), null) clipPath.useMask(this.getBoundingBox()) return true } } this.mask = function () { if (this.get('mask') !== 'none') { const mask = new SvgElemMask(this.get('mask'), null) mask.useMask(this.getBoundingBox()) return true } } this.getFill = function (isClip, isMask) { const opacity = this.get('opacity') const fill = this.get('fill') const fillOpacity = this.get('fill-opacity') if (isClip) { return DefaultColors.white } if (fill !== 'none' && opacity && fillOpacity) { if (fill instanceof SvgElemGradient || fill instanceof SvgElemPattern) { return fill.getPaint(this.getBoundingBox(), fillOpacity * opacity, isClip, isMask) } return opacityToColor(fill, fillOpacity * opacity, isMask) } } this.getStroke = function (isClip, isMask) { const opacity = this.get('opacity') const stroke = this.get('stroke') const strokeOpacity = this.get('stroke-opacity') if (isClip || isEqual(this.get('stroke-width'), 0)) { return } if (stroke !== 'none' && opacity && strokeOpacity) { if (stroke instanceof SvgElemGradient || stroke instanceof SvgElemPattern) { return stroke.getPaint(this.getBoundingBox(), strokeOpacity * opacity, isClip, isMask) } return opacityToColor(stroke, strokeOpacity * opacity, isMask) } } } const SvgElemHasChildren = function SvgElemHasChildren (obj, inherits) { SvgElemStylable.call(this, obj, inherits) this.allowedChildren = ['use', 'g', 'a', 'svg', 'image', 'rect', 'circle', 'ellipse', 'line', 'polyline', 'polygon', 'path', 'text'] this.getBoundingShape = function () { const shape = new SvgShape() const children = this.getChildren() for (let i = 0; i < children.length; i++) { if (children[i].get('display') !== 'none') { if (typeof children[i].getBoundingShape === 'function') { const childShape = children[i].getBoundingShape().clone() if (typeof children[i].getTransformation === 'function') { childShape.transform(children[i].getTransformation()) } shape.mergeShape(childShape) } } } return shape } this.drawChildren = function (isClip, isMask) { const children = this.getChildren() for (let i = 0; i < children.length; i++) { if (children[i].get('display') !== 'none') { if (typeof children[i].drawInDocument === 'function') { children[i].drawInDocument(isClip, isMask) } } } } } const SvgElemContainer = function SvgElemContainer (obj, inherits) { SvgElemHasChildren.call(this, obj, inherits) this.drawContent = function (isClip, isMask) { this.transform() const clipped = this.clip() const masked = this.mask() let group if ((this.get('opacity') < 1 || clipped || masked) && !isClip) { group = docBeginGroup(getPageBBox()) } this.drawChildren(isClip, isMask) if (group) { docEndGroup(group) doc.fillOpacity(this.get('opacity')) docInsertGroup(group) } } } var SvgElemUse = function SvgElemUse (obj, inherits) { SvgElemContainer.call(this, obj, inherits) const x = this.getLength('x', this.getVWidth(), 0) const y = this.getLength('y', this.getVHeight(), 0) let child = this.getUrl('href') || this.getUrl('xlink:href') if (child) { child = createSVGElement(child, this) } this.getChildren = function () { return child ? [child] : [] } this.drawInDocument = function (isClip, isMask) { doc.save() this.drawContent(isClip, isMask) doc.restore() } this.getTransformation = function () { return multiplyMatrix(this.get('transform'), [1, 0, 0, 1, x, y]) } } var SvgElemSymbol = function SvgElemSymbol (obj, inherits) { SvgElemContainer.call(this, obj, inherits) let width = this.getLength('width', this.getParentVWidth(), this.getParentVWidth()) let height = this.getLength('height', this.getParentVHeight(), this.getParentVHeight()) if (inherits instanceof SvgElemUse) { width = inherits.getLength('width', inherits.getParentVWidth(), width) height = inherits.getLength('height', inherits.getParentVHeight(), height) } const aspectRatio = (this.attr('preserveAspectRatio') || '').trim() const viewBox = this.getViewbox('viewBox', [0, 0, width, height]) this.getVWidth = function () { return viewBox[2] } this.getVHeight = function () { return viewBox[3] } this.drawInDocument = function (isClip, isMask) { doc.save() this.drawContent(isClip, isMask) doc.restore() } this.getTransformation = function () { return multiplyMatrix(parseAspectRatio(aspectRatio, width, height, viewBox[2], viewBox[3]), [1, 0, 0, 1, -viewBox[0], -viewBox[1]]) } } var SvgElemGroup = function SvgElemGroup (obj, inherits) { SvgElemContainer.call(this, obj, inherits) this.drawInDocument = function (isClip, isMask) { doc.save() if (this.link && !isClip && !isMask) { this.addLink() } this.drawContent(isClip, isMask) doc.restore() } this.getTransformation = function () { return this.get('transform') } } var SvgElemLink = function SvgElemLink (obj, inherits) { if (inherits && inherits.isText) { SvgElemTspan.call(this, obj, inherits) this.allowedChildren = ['textPath', 'tspan', '#text', '#cdata-section', 'a'] } else { SvgElemGroup.call(this, obj, inherits) } this.link = this.attr('href') || this.attr('xlink:href') this.addLink = function () { if (this.link.match(/^(?:[a-z][a-z0-9+.-]*:|\/\/)?/i) && this.getChildren().length) { const bbox = this.getBoundingShape().transform(getGlobalMatrix()).getBoundingBox() docInsertLink(bbox[0], bbox[1], bbox[2], bbox[3], this.link) } } } var SvgElemSvg = function SvgElemSvg (obj, inherits) { SvgElemContainer.call(this, obj, inherits) let width = this.getLength('width', this.getParentVWidth(), this.getParentVWidth()) let height = this.getLength('height', this.getParentVHeight(), this.getParentVHeight()) let x = this.getLength('x', this.getParentVWidth(), 0) let y = this.getLength('y', this.getParentVHeight(), 0) if (inherits instanceof SvgElemUse) { width = inherits.getLength('width', inherits.getParentVWidth(), width) height = inherits.getLength('height', inherits.getParentVHeight(), height) } let aspectRatio = this.attr('preserveAspectRatio') const viewBox = this.getViewbox('viewBox', [0, 0, width, height]) if (this.isOuterElement && preserveAspectRatio) { x = y = 0 width = viewportWidth height = viewportHeight aspectRatio = preserveAspectRatio } this.getVWidth = function () { return viewBox[2] } this.getVHeight = function () { return viewBox[3] } this.drawInDocument = function (isClip, isMask) { doc.save() if (this.get('overflow') === 'hidden') { new SvgShape().M(x, y).L(x + width, y).L(x + width, y + height).L(x, y + height).Z().transform(this.get('transform')).insertInDocument() doc.clip() } this.drawContent(isClip, isMask) doc.restore() } this.getTransformation = function () { return multiplyMatrix(this.get('transform'), [1, 0, 0, 1, x, y], parseAspectRatio(aspectRatio, width, height, viewBox[2], viewBox[3]), [1, 0, 0, 1, -viewBox[0], -viewBox[1]]) } } var SVGElemImage = function SVGElemImage (obj, inherits) { SvgElemStylable.call(this, obj, inherits) const link = imageCallback(this.attr('href') || this.attr('xlink:href') || '') const x = this.getLength('x', this.getVWidth(), 0) const y = this.getLength('y', this.getVHeight(), 0) let width = this.getLength('width', this.getVWidth(), 'auto') let height = this.getLength('height', this.getVHeight(), 'auto') let image try { image = doc.openImage(link) } catch (e) { warningCallback('SVGElemImage: failed to open image "' + link + '" in PDFKit') } if (image) { if (width === 'auto' && height !== 'auto') { width = height * image.width / image.height } else if (height === 'auto' && width !== 'auto') { height = width * image.height / image.width } else if (width === 'auto' && height === 'auto') { width = image.width height = image.height } } if (width === 'auto' || width < 0) { width = 0 } if (height === 'auto' || height < 0) { height = 0 } this.getTransformation = function () { return this.get('transform') } this.getBoundingShape = function () { return new SvgShape().M(x, y).L(x + width, y).M(x + width, y + height).L(x, y + height) } this.drawInDocument = function (isClip, isMask) { if (this.get('visibility') === 'hidden' || !image) { return } doc.save() this.transform() if (this.get('overflow') === 'hidden') { doc.rect(x, y, width, height).clip() } this.clip() this.mask() doc.translate(x, y) doc.transform.apply(doc, parseAspectRatio(this.attr('preserveAspectRatio'), width, height, image ? image.width : width, image ? image.height : height)) if (!isClip) { doc.fillOpacity(this.get('opacity')) doc.image(image, 0, 0) } else { doc.rect(0, 0, image.width, image.height) docFillColor(DefaultColors.white).fill() } doc.restore() } } var SvgElemPattern = function SvgElemPattern (obj, inherits, fallback) { SvgElemHasChildren.call(this, obj, inherits) this.ref = (function () { const ref = this.getUrl('href') || this.getUrl('xlink:href') if (ref && ref.nodeName === obj.nodeName) { return new SvgElemPattern(ref, inherits, fallback) } }.call(this)) const _attr = this.attr this.attr = function (key) { const attr = _attr.call(this, key) if (attr != null || key === 'href' || key === 'xlink:href') { return attr } return this.ref ? this.ref.attr(key) : null } const _getChildren = this.getChildren this.getChildren = function () { const children = _getChildren.call(this) if (children.length > 0) { return children } return this.ref ? this.ref.getChildren() : [] } this.getPaint = function (bBox, gOpacity, isClip, isMask) { const bBoxUnitsPattern = this.attr('patternUnits') !== 'userSpaceOnUse' const bBoxUnitsContent = this.attr('patternContentUnits') === 'objectBoundingBox' let x = this.getLength('x', bBoxUnitsPattern ? 1 : this.getParentVWidth(), 0) let y = this.getLength('y', bBoxUnitsPattern ? 1 : this.getParentVHeight(), 0) let width = this.getLength('width', bBoxUnitsPattern ? 1 : this.getParentVWidth(), 0) let height = this.getLength('height', bBoxUnitsPattern ? 1 : this.getParentVHeight(), 0) if (bBoxUnitsContent && !bBoxUnitsPattern) { // Use the same units for pattern & pattern content x = (x - bBox[0]) / (bBox[2] - bBox[0]) || 0 y = (y - bBox[1]) / (bBox[3] - bBox[1]) || 0 width = width / (bBox[2] - bBox[0]) || 0 height = height / (bBox[3] - bBox[1]) || 0 } else if (!bBoxUnitsContent && bBoxUnitsPattern) { x = bBox[0] + x * (bBox[2] - bBox[0]) y = bBox[1] + y * (bBox[3] - bBox[1]) width = width * (bBox[2] - bBox[0]) height = height * (bBox[3] - bBox[1]) } const viewBox = this.getViewbox('viewBox', [0, 0, width, height]) const aspectRatio = (this.attr('preserveAspectRatio') || '').trim() let aspectRatioMatrix = multiplyMatrix(parseAspectRatio(aspectRatio, width, height, viewBox[2], viewBox[3], 0), [1, 0, 0, 1, -viewBox[0], -viewBox[1]]) let matrix = parseTranform(this.attr('patternTransform')) if (bBoxUnitsContent) { matrix = multiplyMatrix([bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]], matrix) } matrix = multiplyMatrix(matrix, [1, 0, 0, 1, x, y]) if ((matrix = validateMatrix(matrix)) && (aspectRatioMatrix = validateMatrix(aspectRatioMatrix)) && (width = validateNumber(width)) && (height = validateNumber(height))) { const group = docBeginGroup([0, 0, width, height]) doc.transform.apply(doc, aspectRatioMatrix) this.drawChildren(isClip, isMask) docEndGroup(group) return [docCreatePattern(group, width, height, matrix), gOpacity] } else { return fallback ? [fallback[0], fallback[1] * gOpacity] : undefined } } this.getVWidth = function () { const bBoxUnitsPattern = this.attr('patternUnits') !== 'userSpaceOnUse' const width = this.getLength('width', bBoxUnitsPattern ? 1 : this.getParentVWidth(), 0) return this.getViewbox('viewBox', [0, 0, width, 0])[2] } this.getVHeight = function () { const bBoxUnitsPattern = this.attr('patternUnits') !== 'userSpaceOnUse' const height = this.getLength('height', bBoxUnitsPattern ? 1 : this.getParentVHeight(), 0) return this.getViewbox('viewBox', [0, 0, 0, height])[3] } } var SvgElemGradient = function SvgElemGradient (obj, inherits, fallback) { SvgElem.call(this, obj, inherits) this.allowedChildren = ['stop'] this.ref = (function () { const ref = this.getUrl('href') || this.getUrl('xlink:href') if (ref && ref.nodeName === obj.nodeName) { return new SvgElemGradient(ref, inherits, fallback) } }.call(this)) const _attr = this.attr this.attr = function (key) { const attr = _attr.call(this, key) if (attr != null || key === 'href' || key === 'xlink:href') { return attr } return this.ref ? this.ref.attr(key) : null } const _getChildren = this.getChildren this.getChildren = function () { const children = _getChildren.call(this) if (children.length > 0) { return children } return this.ref ? this.ref.getChildren() : [] } this.getPaint = function (bBox, gOpacity, isClip, isMask) { const children = this.getChildren() if (children.length === 0) { return } if (children.length === 1) { const child = children[0] const stopColor = child.get('stop-color') if (stopColor === 'none') { return } return opacityToColor(stopColor, child.get('stop-opacity') * gOpacity, isMask) } const bBoxUnits = this.attr('gradientUnits') !== 'userSpaceOnUse' let matrix = parseTranform(this.attr('gradientTransform')) const spread = this.attr('spreadMethod') let grad let x1 let x2 let y1 let y2 let r2 let nAfter = 0 let nBefore = 0 let nTotal = 1 if (bBoxUnits) { matrix = multiplyMatrix([bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]], matrix) } if (matrix = validateMatrix(matrix)) { if (this.name === 'linearGradient') { x1 = this.getLength('x1', bBoxUnits ? 1 : this.getVWidth(), 0) x2 = this.getLength('x2', bBoxUnits ? 1 : this.getVWidth(), bBoxUnits ? 1 : this.getVWidth()) y1 = this.getLength('y1', bBoxUnits ? 1 : this.getVHeight(), 0) y2 = this.getLength('y2', bBoxUnits ? 1 : this.getVHeight(), 0) } else { x2 = this.getLength('cx', bBoxUnits ? 1 : this.getVWidth(), bBoxUnits ? 0.5 : 0.5 * this.getVWidth()) y2 = this.getLength('cy', bBoxUnits ? 1 : this.getVHeight(), bBoxUnits ? 0.5 : 0.5 * this.getVHeight()) r2 = this.getLength('r', bBoxUnits ? 1 : this.getViewport(), bBoxUnits ? 0.5 : 0.5 * this.getViewport()) x1 = this.getLength('fx', bBoxUnits ? 1 : this.getVWidth(), x2) y1 = this.getLength('fy', bBoxUnits ? 1 : this.getVHeight(), y2) if (r2 < 0) { warningCallback('SvgElemGradient: negative r value') } const d = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)) let multiplier = 1 if (d > r2) { // according to specification multiplier = r2 / d x1 = x2 + (x1 - x2) * multiplier y1 = y2 + (y1 - y2) * multiplier } r2 = Math.max(r2, d * multiplier * (1 + 1e-6)) // fix for edge-case gradients see issue #84 } if (spread === 'reflect' || spread === 'repeat') { const inv = inverseMatrix(matrix) const corner1 = transformPoint([bBox[0], bBox[1]], inv) const corner2 = transformPoint([bBox[2], bBox[1]], inv) const corner3 = transformPoint([bBox[2], bBox[3]], inv) const corner4 = transformPoint([bBox[0], bBox[3]], inv) if (this.name === 'linearGradient') { // See file 'gradient-repeat-maths.png' nAfter = Math.max((corner1[0] - x2) * (x2 - x1) + (corner1[1] - y2) * (y2 - y1), (corner2[0] - x2) * (x2 - x1) + (corner2[1] - y2) * (y2 - y1), (corner3[0] - x2) * (x2 - x1) + (corner3[1] - y2) * (y2 - y1), (corner4[0] - x2) * (x2 - x1) + (corner4[1] - y2) * (y2 - y1)) / (Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)) nBefore = Math.max((corner1[0] - x1) * (x1 - x2) + (corner1[1] - y1) * (y1 - y2), (corner2[0] - x1) * (x1 - x2) + (corner2[1] - y1) * (y1 - y2), (corner3[0] - x1) * (x1 - x2) + (corner3[1] - y1) * (y1 - y2), (corner4[0] - x1) * (x1 - x2) + (corner4[1] - y1) * (y1 - y2)) / (Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)) } else { nAfter = Math.sqrt(Math.max(Math.pow(corner1[0] - x2, 2) + Math.pow(corner1[1] - y2, 2), Math.pow(corner2[0] - x2, 2) + Math.pow(corner2[1] - y2, 2), Math.pow(corner3[0] - x2, 2) + Math.pow(corner3[1] - y2, 2), Math.pow(corner4[0] - x2, 2) + Math.pow(corner4[1] - y2, 2))) / r2 - 1 } nAfter = Math.ceil(nAfter + 0.5) // Add a little more because the stroke can extend outside of the bounding box nBefore = Math.ceil(nBefore + 0.5) nTotal = nBefore + 1 + nAfter // How many times the gradient needs to be repeated to fill the object bounding box } if (this.name === 'linearGradient') { grad = doc.linearGradient(x1 - nBefore * (x2 - x1), y1 - nBefore * (y2 - y1), x2 + nAfter * (x2 - x1), y2 + nAfter * (y2 - y1)) } else { grad = doc.radialGradient(x1, y1, 0, x2, y2, r2 + nAfter * r2) } for (let n = 0; n < nTotal; n++) { let offset = 0 const inOrder = spread !== 'reflect' || (n - nBefore) % 2 === 0 for (let i = 0; i < children.length; i++) { const _child = children[inOrder ? i : children.length - 1 - i] let _stopColor = _child.get('stop-color') if (_stopColor === 'none') { _stopColor = DefaultColors.transparent } _stopColor = opacityToColor(_stopColor, _child.get('stop-opacity') * gOpacity, isMask) offset = Math.max(offset, inOrder ? _child.getPercent('offset', 0) : 1 - _child.getPercent('offset', 0)) if (i === 0 && _stopColor[0].length === 4) { grad._colorSpace = 'DeviceCMYK' } // Fix until PR #763 is merged into PDFKit if (i === 0 && offset > 0) { grad.stop((n + 0) / nTotal, _stopColor[0], _stopColor[1]) } grad.stop((n + offset) / (nAfter + nBefore + 1), _stopColor[0], _stopColor[1]) if (i === children.length - 1 && offset < 1) { grad.stop((n + 1) / nTotal, _stopColor[0], _stopColor[1]) } } } grad.setTransform.apply(grad, matrix) return [grad, 1] } else { return fallback ? [fallback[0], fallback[1] * gOpacity] : undefined } } } const SvgElemBasicShape = function SvgElemBasicShape (obj, inherits) { SvgElemStylable.call(this, obj, inherits) this.dashScale = 1 this.getBoundingShape = function () { return this.shape } this.getTransformation = function () { return this.get('transform') } this.drawInDocument = function (isClip, isMask) { if (this.get('visibility') === 'hidden' || !this.shape) { return } doc.save() this.transform() this.clip() if (!isClip) { const masked = this.mask() let group if (masked) { group = docBeginGroup(getPageBBox()) } const subPaths = this.shape.getSubPaths() const fill = this.getFill(isClip, isMask) const stroke = this.getStroke(isClip, isMask) const lineWidth = this.get('stroke-width') const lineCap = this.get('stroke-linecap') if (fill || stroke) { if (fill) { docFillColor(fill) } if (stroke) { for (let j = 0; j < subPaths.length; j++) { if (isEqual(subPaths[j].totalLength, 0)) { if ((lineCap === 'square' || lineCap === 'round') && lineWidth > 0) { if (subPaths[j].startPoint && subPaths[j].startPoint.length > 1) { const _x4 = subPaths[j].startPoint[0] const _y4 = subPaths[j].startPoint[1] docFillColor(stroke) if (lineCap === 'square') { doc.rect(_x4 - 0.5 * lineWidth, _y4 - 0.5 * lineWidth, lineWidth, lineWidth) } else if (lineCap === 'round') { doc.circle(_x4, _y4, 0.5 * lineWidth) } doc.fill() } } } } const dashArray = this.get('stroke-dasharray') let dashOffset = this.get('stroke-dashoffset') if (isNotEqual(this.dashScale, 1)) { for (let _j2 = 0; _j2 < dashArray.length; _j2++) { dashArray[_j2] *= this.dashScale } dashOffset *= this.dashScale } docStrokeColor(stroke) doc.lineWidth(lineWidth).miterLimit(this.get('stroke-miterlimit')).lineJoin(this.get('stroke-linejoin')).lineCap(lineCap).dash(dashArray, { phase: dashOffset }) } for (let _j3 = 0; _j3 < subPaths.length; _j3++) { if (subPaths[_j3].totalLength > 0) { subPaths[_j3].insertInDocument() } } if (fill && stroke) { doc.fillAndStroke(this.get('fill-rule')) } else if (fill) { doc.fill(this.get('fill-rule')) } else if (stroke) { doc.stroke() } } const markerStart = this.get('marker-start') const markerMid = this.get('marker-mid') const markerEnd = this.get('marker-end') if (markerStart !== 'none' || markerMid !== 'none' || markerEnd !== 'none') { const markersPos = this.shape.getMarkers() if (markerStart !== 'none') { const marker = new SvgElemMarker(markerStart, null) marker.drawMarker(false, isMask, markersPos[0], lineWidth) } if (markerMid !== 'none') { for (let i = 1; i < markersPos.length - 1; i++) { const _marker = new SvgElemMarker(markerMid, null) _marker.drawMarker(false, isMask, markersPos[i], lineWidth) } } if (markerEnd !== 'none') { const _marker2 = new SvgElemMarker(markerEnd, null) _marker2.drawMarker(false, isMask, markersPos[markersPos.length - 1], lineWidth) } } if (group) { docEndGroup(group) docInsertGroup(group) } } else { this.shape.insertInDocument() docFillColor(DefaultColors.white) doc.fill(this.get('clip-rule')) } doc.restore() } } var SvgElemRect = function SvgElemRect (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) const x = this.getLength('x', this.getVWidth(), 0) const y = this.getLength('y', this.getVHeight(), 0) const w = this.getLength('width', this.getVWidth(), 0) const h = this.getLength('height', this.getVHeight(), 0) let rx = this.getLength('rx', this.getVWidth()) let ry = this.getLength('ry', this.getVHeight()) if (rx === undefined && ry === undefined) { rx = ry = 0 } else if (rx === undefined && ry !== undefined) { rx = ry } else if (rx !== undefined && ry === undefined) { ry = rx } if (w > 0 && h > 0) { if (rx && ry) { rx = Math.min(rx, 0.5 * w) ry = Math.min(ry, 0.5 * h) this.shape = new SvgShape().M(x + rx, y).L(x + w - rx, y).A(rx, ry, 0, 0, 1, x + w, y + ry).L(x + w, y + h - ry).A(rx, ry, 0, 0, 1, x + w - rx, y + h).L(x + rx, y + h).A(rx, ry, 0, 0, 1, x, y + h - ry).L(x, y + ry).A(rx, ry, 0, 0, 1, x + rx, y).Z() } else { this.shape = new SvgShape().M(x, y).L(x + w, y).L(x + w, y + h).L(x, y + h).Z() } } else { this.shape = new SvgShape() } } var SvgElemCircle = function SvgElemCircle (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) const cx = this.getLength('cx', this.getVWidth(), 0) const cy = this.getLength('cy', this.getVHeight(), 0) const r = this.getLength('r', this.getViewport(), 0) if (r > 0) { this.shape = new SvgShape().M(cx + r, cy).A(r, r, 0, 0, 1, cx - r, cy).A(r, r, 0, 0, 1, cx + r, cy).Z() } else { this.shape = new SvgShape() } } var SvgElemEllipse = function SvgElemEllipse (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) const cx = this.getLength('cx', this.getVWidth(), 0) const cy = this.getLength('cy', this.getVHeight(), 0) const rx = this.getLength('rx', this.getVWidth(), 0) const ry = this.getLength('ry', this.getVHeight(), 0) if (rx > 0 && ry > 0) { this.shape = new SvgShape().M(cx + rx, cy).A(rx, ry, 0, 0, 1, cx - rx, cy).A(rx, ry, 0, 0, 1, cx + rx, cy).Z() } else { this.shape = new SvgShape() } } var SvgElemLine = function SvgElemLine (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) const x1 = this.getLength('x1', this.getVWidth(), 0) const y1 = this.getLength('y1', this.getVHeight(), 0) const x2 = this.getLength('x2', this.getVWidth(), 0) const y2 = this.getLength('y2', this.getVHeight(), 0) this.shape = new SvgShape().M(x1, y1).L(x2, y2) } var SvgElemPolyline = function SvgElemPolyline (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) const points = this.getNumberList('points') this.shape = new SvgShape() for (let i = 0; i < points.length - 1; i += 2) { if (i === 0) { this.shape.M(points[i], points[i + 1]) } else { this.shape.L(points[i], points[i + 1]) } } if (points.error) { warningCallback('SvgElemPolygon: unexpected string ' + points.error) } if (points.length % 2 === 1) { warningCallback('SvgElemPolyline: uneven number of coordinates') } } var SvgElemPolygon = function SvgElemPolygon (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) const points = this.getNumberList('points') this.shape = new SvgShape() for (let i = 0; i < points.length - 1; i += 2) { if (i === 0) { this.shape.M(points[i], points[i + 1]) } else { this.shape.L(points[i], points[i + 1]) } } this.shape.Z() if (points.error) { warningCallback('SvgElemPolygon: unexpected string ' + points.error) } if (points.length % 2 === 1) { warningCallback('SvgElemPolygon: uneven number of coordinates') } } var SvgElemPath = function SvgElemPath (obj, inherits) { SvgElemBasicShape.call(this, obj, inherits) this.shape = new SvgShape().path(this.attr('d')) const pathLength = this.getLength('pathLength', this.getViewport()) this.pathLength = pathLength > 0 ? pathLength : undefined this.dashScale = this.pathLength !== undefined ? this.shape.totalLength / this.pathLength : 1 } var SvgElemMarker = function SvgElemMarker (obj, inherits) { SvgElemHasChildren.call(this, obj, inherits) const width = this.getLength('markerWidth', this.getParentVWidth(), 3) const height = this.getLength('markerHeight', this.getParentVHeight(), 3) const viewBox = this.getViewbox('viewBox', [0, 0, width, height]) this.getVWidth = function () { return viewBox[2] } this.getVHeight = function () { return viewBox[3] } this.drawMarker = function (isClip, isMask, posArray, strokeWidth) { doc.save() const orient = this.attr('orient') const units = this.attr('markerUnits') const rotate = orient === 'auto' ? posArray[2] : (parseFloat(orient) || 0) * Math.PI / 180 const scale = units === 'userSpaceOnUse' ? 1 : strokeWidth doc.transform(Math.cos(rotate) * scale, Math.sin(rotate) * scale, -Math.sin(rotate) * scale, Math.cos(rotate) * scale, posArray[0], posArray[1]) const refX = this.getLength('refX', this.getVWidth(), 0) const refY = this.getLength('refY', this.getVHeight(), 0) const aspectRatioMatrix = parseAspectRatio(this.attr('preserveAspectRatio'), width, height, viewBox[2], viewBox[3], 0.5) if (this.get('overflow') === 'hidden') { doc.rect(aspectRatioMatrix[0] * (viewBox[0] + viewBox[2] / 2 - refX) - width / 2, aspectRatioMatrix[3] * (viewBox[1] + viewBox[3] / 2 - refY) - height / 2, width, height).clip() } doc.transform.apply(doc, aspectRatioMatrix) doc.translate(-refX, -refY) let group if (this.get('opacity') < 1 && !isClip) { group = docBeginGroup(getPageBBox()) } this.drawChildren(isClip, isMask) if (group) { docEndGroup(group) doc.fillOpacity(this.get('opacity')) docInsertGroup(group) } doc.restore() } } var SvgElemClipPath = function SvgElemClipPath (obj, inherits) { SvgElemHasChildren.call(this, obj, inherits) this.useMask = function (bBox) { const group = docBeginGroup(getPageBBox()) doc.save() if (this.attr('clipPathUnits') === 'objectBoundingBox') { doc.transform(bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]) } this.clip() this.drawChildren(true, false) doc.restore() docEndGroup(group) docApplyMask(group, true) } } var SvgElemMask = function SvgElemMask (obj, inherits) { SvgElemHasChildren.call(this, obj, inherits) this.useMask = function (bBox) { const group = docBeginGroup(getPageBBox()) doc.save() let x, y, w, h if (this.attr('maskUnits') === 'userSpaceOnUse') { x = this.getLength('x', this.getVWidth(), -0.1 * (bBox[2] - bBox[0]) + bBox[0]) y = this.getLength('y', this.getVHeight(), -0.1 * (bBox[3] - bBox[1]) + bBox[1]) w = this.getLength('width', this.getVWidth(), 1.2 * (bBox[2] - bBox[0])) h = this.getLength('height', this.getVHeight(), 1.2 * (bBox[3] - bBox[1])) } else { x = this.getLength('x', this.getVWidth(), -0.1) * (bBox[2] - bBox[0]) + bBox[0] y = this.getLength('y', this.getVHeight(), -0.1) * (bBox[3] - bBox[1]) + bBox[1] w = this.getLength('width', this.getVWidth(), 1.2) * (bBox[2] - bBox[0]) h = this.getLength('height', this.getVHeight(), 1.2) * (bBox[3] - bBox[1]) } doc.rect(x, y, w, h).clip() if (this.attr('maskContentUnits') === 'objectBoundingBox') { doc.transform(bBox[2] - bBox[0], 0, 0, bBox[3] - bBox[1], bBox[0], bBox[1]) } this.clip() this.drawChildren(false, true) doc.restore() docEndGroup(group) docApplyMask(group, true) } } const SvgElemTextContainer = function SvgElemTextContainer (obj, inherits) { SvgElemStylable.call(this, obj, inherits) this.allowedChildren = ['tspan', '#text', '#cdata-section', 'a'] this.isText = true this.getBoundingShape = function () { const shape = new SvgShape() for (let i = 0; i < this._pos.length; i++) { const pos = this._pos[i] if (!pos.hidden) { const dx0 = pos.ascent * Math.sin(pos.rotate) const dy0 = -pos.ascent * Math.cos(pos.rotate) const dx1 = pos.descent * Math.sin(pos.rotate) const dy1 = -pos.descent * Math.cos(pos.rotate) const dx2 = pos.width * Math.cos(pos.rotate) const dy2 = pos.width * Math.sin(pos.rotate) shape.M(pos.x + dx0, pos.y + dy0).L(pos.x + dx0 + dx2, pos.y + dy0 + dy2).M(pos.x + dx1 + dx2, pos.y + dy1 + dy2).L(pos.x + dx1, pos.y + dy1) } } return shape } this.drawTextInDocument = function (isClip, isMask) { if (this.link && !isClip && !isMask) { this.addLink() } if (this.get('text-decoration') === 'underline') { this.decorate(0.05 * this._font.size, -0.075 * this._font.size, isClip, isMask) } if (this.get('text-decoration') === 'overline') { this.decorate(0.05 * this._font.size, getAscent(this._font.font, this._font.size) + 0.075 * this._font.size, isClip, isMask) } const fill = this.getFill(isClip, isMask) let stroke = this.getStroke(isClip, isMask) let strokeWidth = this.get('stroke-width') if (this._font.fauxBold) { if (!stroke) { stroke = fill strokeWidth = this._font.size * 0.03 } else { strokeWidth += this._font.size * 0.03 } } const children = this.getChildren() for (let i = 0; i < children.length; i++) { const childElem = children[i] switch (childElem.name) { case 'tspan': case 'textPath': case 'a': if (childElem.get('display') !== 'none') { childElem.drawTextInDocument(isClip, isMask) } break case '#text': case '#cdata-section': if (this.get('visibility') === 'hidden') { continue } if (fill || stroke || isClip) { if (fill) { docFillColor(fill) } if (stroke && strokeWidth) { docStrokeColor(stroke) doc.lineWidth(strokeWidth).miterLimit(this.get('stroke-miterlimit')).lineJoin(this.get('stroke-linejoin')).lineCap(this.get('stroke-linecap')).dash(this.get('stroke-dasharray'), { phase: this.get('stroke-dashoffset') }) } docBeginText(this._font.font, this._font.size) docSetTextMode(!!fill, !!stroke) for (let j = 0, pos = childElem._pos; j < pos.length; j++) { if (!pos[j].hidden && isNotEqual(pos[j].width, 0)) { const cos = Math.cos(pos[j].rotate) const sin = Math.sin(pos[j].rotate) const skew = this._font.fauxItalic ? -0.25 : 0 docSetTextMatrix(cos * pos[j].scale, sin * pos[j].scale, cos * skew - sin, sin * skew + cos, pos[j].x, pos[j].y) docWriteGlyph(pos[j].glyph) } } docEndText() } break } } if (this.get('text-decoration') === 'line-through') { this.decorate(0.05 * this._font.size, 0.5 * (getAscent(this._font.font, this._font.size) + getDescent(this._font.font, this._font.size)), isClip, isMask) } } this.decorate = function (lineWidth, linePosition, isClip, isMask) { const fill = this.getFill(isClip, isMask) const stroke = this.getStroke(isClip, isMask) if (fill) { docFillColor(fill) } if (stroke) { docStrokeColor(stroke) doc.lineWidth(this.get('stroke-width')).miterLimit(this.get('stroke-miterlimit')).lineJoin(this.get('stroke-linejoin')).lineCap(this.get('stroke-linecap')).dash(this.get('stroke-dasharray'), { phase: this.get('stroke-dashoffset') }) } for (let j = 0, pos = this._pos; j < pos.length; j++) { if (!pos[j].hidden && isNotEqual(pos[j].width, 0)) { const dx0 = (linePosition + lineWidth / 2) * Math.sin(pos[j].rotate) const dy0 = -(linePosition + lineWidth / 2) * Math.cos(pos[j].rotate) const dx1 = (linePosition - lineWidth / 2) * Math.sin(pos[j].rotate) const dy1 = -(linePosition - lineWidth / 2) * Math.cos(pos[j].rotate) const dx2 = pos[j].width * Math.cos(pos[j].rotate) const dy2 = pos[j].width * Math.sin(pos[j].rotate) new SvgShape().M(pos[j].x + dx0, pos[j].y + dy0).L(pos[j].x + dx0 + dx2, pos[j].y + dy0 + dy2).L(pos[j].x + dx1 + dx2, pos[j].y + dy1 + dy2).L(pos[j].x + dx1, pos[j].y + dy1).Z().insertInDocument() if (fill && stroke) { doc.fillAndStroke() } else if (fill) { doc.fill() } else if (stroke) { doc.stroke() } } } } } var SvgElemTextNode = function SvgElemTextNode (obj, inherits) { this.name = obj.nodeName this.textContent = obj.nodeValue } var SvgElemTspan = function SvgElemTspan (obj, inherits) { SvgElemTextContainer.call(this, obj, inherits) } var SvgElemTextPath = function SvgElemTextPath (obj, inherits) { SvgElemTextContainer.call(this, obj, inherits) let pathObject, pathLength, temp if ((temp = this.attr('path')) && temp.trim() !== '') { const _pathLength = this.getLength('pathLength', this.getViewport()) this.pathObject = new SvgShape().path(temp) this.pathLength = _pathLength > 0 ? _pathLength : this.pathObject.totalLength this.pathScale = this.pathObject.totalLength / this.pathLength } else if ((temp = this.getUrl('href') || this.getUrl('xlink:href')) && temp.nodeName === 'path') { const pathElem = new SvgElemPath(temp, this) this.pathObject = pathElem.shape.clone().transform(pathElem.get('transform')) this.pathLength = this.chooseValue(pathElem.pathLength, this.pathObject.totalLength) this.pathScale = this.pathObject.totalLength / this.pathLength } } var SvgElemText = function SvgElemText (obj, inherits) { SvgElemTextContainer.call(this, obj, inherits) this.allowedChildren = ['textPath', 'tspan', '#text', '#cdata-section', 'a']; (function (textParentElem) { let processedText = '' let remainingText = obj.textContent const textPaths = [] let currentChunk = [] let currentAnchor let currentDirection let currentX = 0 let currentY = 0 function doAnchoring () { if (currentChunk.length) { const last = currentChunk[currentChunk.length - 1] const first = currentChunk[0] const width = last.x + last.width - first.x const anchordx = { startltr: 0, middleltr: 0.5, endltr: 1, startrtl: 1, middlertl: 0.5, endrtl: 0 }[currentAnchor + currentDirection] * width || 0 for (let i = 0; i < currentChunk.length; i++) { currentChunk[i].x -= anchordx } } currentChunk = [] } function adjustLength (pos, length, spacingAndGlyphs) { const firstChar = pos[0] const lastChar = pos[pos.length - 1] const startX = firstChar.x const endX = lastChar.x + lastChar.width if (spacingAndGlyphs) { const textScale = length / (endX - startX) if (textScale > 0 && textScale < Infinity) { for (let j = 0; j < pos.length; j++) { pos[j].x = startX + textScale * (pos[j].x - startX) pos[j].scale *= textScale pos[j].width *= textScale } } } else { if (pos.length >= 2) { const spaceDiff = (length - (endX - startX)) / (pos.length - 1) for (let _j4 = 0; _j4 < pos.length; _j4++) { pos[_j4].x += _j4 * spaceDiff } } } currentX += length - (endX - startX) } function recursive (currentElem, parentElem) { currentElem._x = combineArrays(currentElem.getLengthList('x', currentElem.getVWidth()), parentElem ? parentElem._x.slice(parentElem._pos.length) : []) currentElem._y = combineArrays(currentElem.getLengthList('y', currentElem.getVHeight()), parentElem ? parentElem._y.slice(parentElem._pos.length) : []) currentElem._dx = combineArrays(currentElem.getLengthList('dx', currentElem.getVWidth()), parentElem ? parentElem._dx.slice(parentElem._pos.length) : []) currentElem._dy = combineArrays(currentElem.getLengthList('dy', currentElem.getVHeight()), parentElem ? parentElem._dy.slice(parentElem._pos.length) : []) currentElem._rot = combineArrays(currentElem.getNumberList('rotate'), parentElem ? parentElem._rot.slice(parentElem._pos.length) : []) currentElem._defRot = currentElem.chooseValue(currentElem._rot[currentElem._rot.length - 1], parentElem && parentElem._defRot, 0) if (currentElem.name === 'textPath') { currentElem._y = [] } const fontOptions = { fauxItalic: false, fauxBold: false } const fontNameorLink = fontCallback(currentElem.get('font-family'), currentElem.get('font-weight') === 'bold', currentElem.get('font-style') === 'italic', fontOptions) try { doc.font(fontNameorLink) } catch (e) { warningCallback('SVGElemText: failed to open font "' + fontNameorLink + '" in PDFKit') } currentElem._pos = [] currentElem._index = 0 currentElem._font = { font: doc._font, size: currentElem.get('font-size'), fauxItalic: fontOptions.fauxItalic, fauxBold: fontOptions.fauxBold } const textLength = currentElem.getLength('textLength', currentElem.getVWidth(), undefined) const spacingAndGlyphs = currentElem.attr('lengthAdjust') === 'spacingAndGlyphs' const wordSpacing = currentElem.get('word-spacing') const letterSpacing = currentElem.get('letter-spacing') const textAnchor = currentElem.get('text-anchor') const textDirection = currentElem.get('direction') const baseline = getBaseline(currentElem._font.font, currentElem._font.size, currentElem.get('alignment-baseline') || currentElem.get('dominant-baseline'), currentElem.get('baseline-shift')) if (currentElem.name === 'textPath') { doAnchoring() currentX = currentY = 0 } const children = currentElem.getChildren() for (let i = 0; i < children.length; i++) { const childElem = children[i] switch (childElem.name) { case 'tspan': case 'textPath': case 'a': recursive(childElem, currentElem) break case '#text': case '#cdata-section': var rawText = childElem.textContent var renderedText = rawText var words = void 0 childElem._font = currentElem._font childElem._pos = [] remainingText = remainingText.substring(rawText.length) if (currentElem.get('xml:space') === 'preserve') { renderedText = renderedText.replace(/[\s]/g, ' ') } else { renderedText = renderedText.replace(/[\s]+/g, ' ') if (processedText.match(/[\s]$|^$/)) { renderedText = renderedText.replace(/^[\s]/, '') } if (remainingText.match(/^[\s]*$/)) { renderedText = renderedText.replace(/[\s]$/, '') } } processedText += rawText if (wordSpacing === 0) { words = [renderedText] } else { words = renderedText.split(/(\s)/) } for (let w = 0; w < words.length; w++) { const pos = getTextPos(currentElem._font.font, currentElem._font.size, words[w]) for (let j = 0; j < pos.length; j++) { const index = currentElem._index const xAttr = currentElem._x[index] const yAttr = currentElem._y[index] const dxAttr = currentElem._dx[index] const dyAttr = currentElem._dy[index] const rotAttr = currentElem._rot[index] let continuous = !(w === 0 && j === 0) if (xAttr !== undefined) { continuous = false doAnchoring() currentX = xAttr } if (yAttr !== undefined) { continuous = false doAnchoring() currentY = yAttr } if (dxAttr !== undefined) { continuous = false currentX += dxAttr } if (dyAttr !== undefined) { continuous = false currentY += dyAttr } if (rotAttr !== undefined || currentElem._defRot !== 0) { continuous = false } const position = { glyph: pos[j].glyph, rotate: Math.PI / 180 * currentElem.chooseValue(rotAttr, currentElem._defRot), x: currentX + pos[j].xOffset, y: currentY + baseline + pos[j].yOffset, width: pos[j].width, ascent: getAscent(currentElem._font.font, currentElem._font.size), descent: getDescent(currentElem._font.font, currentElem._font.size), scale: 1, hidden: false, continuous } currentChunk.push(position) childElem._pos.push(position) currentElem._pos.push(position) currentElem._index += pos[j].unicode.length if (currentChunk.length === 1) { currentAnchor = textAnchor currentDirection = textDirection } currentX += pos[j].xAdvance + letterSpacing currentY += pos[j].yAdvance } if (words[w] === ' ') { currentX += wordSpacing } } break default: remainingText = remainingText.substring(childElem.textContent.length) } } if (textLength && currentElem._pos.length) { adjustLength(currentElem._pos, textLength, spacingAndGlyphs) } if (currentElem.name === 'textPath' || currentElem.name === 'text') { doAnchoring() } if (currentElem.name === 'textPath') { textPaths.push(currentElem) const pathObject = currentElem.pathObject if (pathObject) { currentX = pathObject.endPoint[0] currentY = pathObject.endPoint[1] } } if (parentElem) { parentElem._pos = parentElem._pos.concat(currentElem._pos) parentElem._index += currentElem._index } } function textOnPath (currentElem) { const pathObject = currentElem.pathObject const pathLength = currentElem.pathLength const pathScale = currentElem.pathScale if (pathObject) { const textOffset = currentElem.getLength('startOffset', pathLength, 0) for (let j = 0; j < currentElem._pos.length; j++) { const charMidX = textOffset + currentElem._pos[j].x + 0.5 * currentElem._pos[j].width if (charMidX > pathLength || charMidX < 0) { currentElem._pos[j].hidden = true } else { const pointOnPath = pathObject.getPointAtLength(charMidX * pathScale) if (isNotEqual(pathScale, 1)) { currentElem._pos[j].scale *= pathScale currentElem._pos[j].width *= pathScale } currentElem._pos[j].x = pointOnPath[0] - 0.5 * currentElem._pos[j].width * Math.cos(pointOnPath[2]) - currentElem._pos[j].y * Math.sin(pointOnPath[2]) currentElem._pos[j].y = pointOnPath[1] - 0.5 * currentElem._pos[j].width * Math.sin(pointOnPath[2]) + currentElem._pos[j].y * Math.cos(pointOnPath[2]) currentElem._pos[j].rotate = pointOnPath[2] + currentElem._pos[j].rotate currentElem._pos[j].continuous = false } } } else { for (let _j5 = 0; _j5 < currentElem._pos.length; _j5++) { currentElem._pos[_j5].hidden = true } } } recursive(textParentElem, null) for (let i = 0; i < textPaths.length; i++) { textOnPath(textPaths[i]) } })(this) this.getTransformation = function () { return this.get('transform') } this.drawInDocument = function (isClip, isMask) { doc.save() this.transform() this.clip() const masked = this.mask() let group if (masked) { group = docBeginGroup(getPageBBox()) } this.drawTextInDocument(isClip, isMask) if (group) { docEndGroup(group) docInsertGroup(group) } doc.restore() } } options = options || {} const pxToPt = options.assumePt ? 1 : 72 / 96 // 1px = 72/96pt, but only if assumePt is false var viewportWidth = (options.width || doc.page.width) / pxToPt var viewportHeight = (options.height || doc.page.height) / pxToPt var preserveAspectRatio = options.preserveAspectRatio || null // default to null so that the attr can override if not passed var useCSS = options.useCSS && typeof SVGElement !== 'undefined' && svg instanceof SVGElement && typeof getComputedStyle === 'function' var warningCallback = options.warningCallback var fontCallback = options.fontCallback var imageCallback = options.imageCallback var colorCallback = options.colorCallback var documentCallback = options.documentCallback var precision = Math.ceil(Math.max(1, options.precision)) || 3 var groupStack = [] var documentCache = {} var links = [] var styleRules = [] if (typeof warningCallback !== 'function') { warningCallback = function warningCallback (str) { if (typeof console !== undefined && typeof console.warn === 'function') { console.warn(str) } } } if (typeof fontCallback !== 'function') { fontCallback = function fontCallback (family, bold, italic, fontOptions) { // Check if the font is already registered in the document if (bold && italic) { if (doc._registeredFonts.hasOwnProperty(family + '-BoldItalic')) { return family + '-BoldItalic' } else if (doc._registeredFonts.hasOwnProperty(family + '-Italic')) { fontOptions.fauxBold = true return family + '-Italic' } else if (doc._registeredFonts.hasOwnProperty(family + '-Bold')) { fontOptions.fauxItalic = true return family + '-Bold' } else if (doc._registeredFonts.hasOwnProperty(family)) { fontOptions.fauxBold = true fontOptions.fauxItalic = true return family } } if (bold && !italic) { if (doc._registeredFonts.hasOwnProperty(family + '-Bold')) { return family + '-Bold' } else if (doc._registeredFonts.hasOwnProperty(family)) { fontOptions.fauxBold = true return family } } if (!bold && italic) { if (doc._registeredFonts.hasOwnProperty(family + '-Italic')) { return family + '-Italic' } else if (doc._registeredFonts.hasOwnProperty(family)) { fontOptions.fauxItalic = true return family } } if (!bold && !italic) { if (doc._registeredFonts.hasOwnProperty(family)) { return family } } // Use standard fonts as fallback if (family.match(/(?:^|,)\s*serif\s*$/)) { if (bold && italic) { return 'Times-BoldItalic' } if (bold && !italic) { return 'Times-Bold' } if (!bold && italic) { return 'Times-Italic' } if (!bold && !italic) { return 'Times-Roman' } } else if (family.match(/(?:^|,)\s*monospace\s*$/)) { if (bold && italic) { return 'Courier-BoldOblique' } if (bold && !italic) { return 'Courier-Bold' } if (!bold && italic) { return 'Courier-Oblique' } if (!bold && !italic) { return 'Courier' } } else if (family.match(/(?:^|,)\s*sans-serif\s*$/) || true) { if (bold && italic) { return 'Helvetica-BoldOblique' } if (bold && !italic) { return 'Helvetica-Bold' } if (!bold && italic) { return 'Helvetica-Oblique' } if (!bold && !italic) { return 'Helvetica' } } } } if (typeof imageCallback !== 'function') { imageCallback = function imageCallback (link) { return link.replace(/\s+/g, '') } } if (typeof colorCallback !== 'function') { colorCallback = null } else { for (const color in DefaultColors) { const newColor = colorCallback(DefaultColors[color]) DefaultColors[color][0] = newColor[0] DefaultColors[color][1] = newColor[1] } } if (typeof documentCallback !== 'function') { documentCallback = null } if (typeof svg === 'string') { svg = parseXml(svg) } if (svg) { const styles = svg.getElementsByTagName('style') for (let i = 0; i < styles.length; i++) { styleRules = styleRules.concat(parseStyleSheet(styles[i].textContent)) } const elem = createSVGElement(svg, null) if (typeof elem.drawInDocument === 'function') { if (options.useCSS && !useCSS) { warningCallback('SVGtoPDF: useCSS option can only be used for SVG *elements* in compatible browsers') } const savedFillColor = doc._fillColor doc.save().translate(x || 0, y || 0).scale(pxToPt) elem.drawInDocument() for (let _i8 = 0; _i8 < links.length; _i8++) { doc.page.annotations.push(links[_i8]) } doc.restore() doc._fillColor = savedFillColor } else { warningCallback('SVGtoPDF: this element can\'t be rendered directly: ' + svg.nodeName) } } else { warningCallback('SVGtoPDF: the input does not look like a valid SVG') } } if (true && module && typeof module.exports !== 'undefined') { module.exports = SVGtoPDF } /***/ }, /***/ 9742: /***/ function (__unused_webpack_module, exports) { 'use strict' exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray const lookup = [] const revLookup = [] const Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array const code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' for (let i = 0, len = code.length; i < len; ++i) { lookup[i] = code[i] revLookup[code.charCodeAt(i)] = i } // Support decoding URL-safe base64 strings, as Node.js does. // See: https://en.wikipedia.org/wiki/Base64#URL_applications revLookup['-'.charCodeAt(0)] = 62 revLookup['_'.charCodeAt(0)] = 63 function getLens (b64) { const len = b64.length if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } // Trim off extra bytes after placeholder bytes are found // See: https://github.com/beatgammit/base64-js/issues/42 let validLen = b64.indexOf('=') if (validLen === -1) validLen = len const placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4) return [validLen, placeHoldersLen] } // base64 is 4/3 + up to two characters of the original data function byteLength (b64) { const lens = getLens(b64) const validLen = lens[0] const placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function _byteLength (b64, validLen, placeHoldersLen) { return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen } function toByteArray (b64) { let tmp const lens = getLens(b64) const validLen = lens[0] const placeHoldersLen = lens[1] const arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) let curByte = 0 // if there are placeholders, only get up to the last complete 4 chars const len = placeHoldersLen > 0 ? validLen - 4 : validLen let i for (i = 0; i < len; i += 4) { tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] arr[curByte++] = (tmp >> 16) & 0xFF arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 2) { tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) arr[curByte++] = tmp & 0xFF } if (placeHoldersLen === 1) { tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) arr[curByte++] = (tmp >> 8) & 0xFF arr[curByte++] = tmp & 0xFF } return arr } function tripletToBase64 (num) { return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] } function encodeChunk (uint8, start, end) { let tmp const output = [] for (let i = start; i < end; i += 3) { tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF) output.push(tripletToBase64(tmp)) } return output.join('') } function fromByteArray (uint8) { let tmp const len = uint8.length const extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes const parts = [] const maxChunkLength = 16383 // must be multiple of 3 // go through the array every three bytes, we'll deal with trailing stuff later for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { parts.push(encodeChunk( uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) )) } // pad the end with zeros, but make sure to not forget the extra bytes if (extraBytes === 1) { tmp = uint8[len - 1] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3F] + '==' ) } else if (extraBytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3F] + lookup[(tmp << 2) & 0x3F] + '=' ) } return parts.join('') } /***/ }, /***/ 4181: /***/ function (module) { /* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Bit reading helpers */ const BROTLI_READ_SIZE = 4096 const BROTLI_IBUF_SIZE = (2 * BROTLI_READ_SIZE + 32) const BROTLI_IBUF_MASK = (2 * BROTLI_READ_SIZE - 1) const kBitMask = new Uint32Array([ 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215 ]) /* Input byte buffer, consist of a ringbuffer and a "slack" region where */ /* bytes from the start of the ringbuffer are copied. */ function BrotliBitReader (input) { this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE) this.input_ = input /* input callback */ this.reset() } BrotliBitReader.READ_SIZE = BROTLI_READ_SIZE BrotliBitReader.IBUF_MASK = BROTLI_IBUF_MASK BrotliBitReader.prototype.reset = function () { this.buf_ptr_ = 0 /* next input will write here */ this.val_ = 0 /* pre-fetched bits */ this.pos_ = 0 /* byte position in stream */ this.bit_pos_ = 0 /* current bit-reading position in val_ */ this.bit_end_pos_ = 0 /* bit-reading end position from LSB of val_ */ this.eos_ = 0 /* input stream is finished */ this.readMoreInput() for (let i = 0; i < 4; i++) { this.val_ |= this.buf_[this.pos_] << (8 * i) ++this.pos_ } return this.bit_end_pos_ > 0 } /* Fills up the input ringbuffer by calling the input callback. Does nothing if there are at least 32 bytes present after current position. Returns 0 if either: - the input callback returned an error, or - there is no more input and the position is past the end of the stream. After encountering the end of the input stream, 32 additional zero bytes are copied to the ringbuffer, therefore it is safe to call this function after every 32 bytes of input is read. */ BrotliBitReader.prototype.readMoreInput = function () { if (this.bit_end_pos_ > 256) { } else if (this.eos_) { if (this.bit_pos_ > this.bit_end_pos_) { throw new Error('Unexpected end of input ' + this.bit_pos_ + ' ' + this.bit_end_pos_) } } else { const dst = this.buf_ptr_ const bytes_read = this.input_.read(this.buf_, dst, BROTLI_READ_SIZE) if (bytes_read < 0) { throw new Error('Unexpected end of input') } if (bytes_read < BROTLI_READ_SIZE) { this.eos_ = 1 /* Store 32 bytes of zero after the stream end. */ for (var p = 0; p < 32; p++) { this.buf_[dst + bytes_read + p] = 0 } } if (dst === 0) { /* Copy the head of the ringbuffer to the slack region. */ for (var p = 0; p < 32; p++) { this.buf_[(BROTLI_READ_SIZE << 1) + p] = this.buf_[p] } this.buf_ptr_ = BROTLI_READ_SIZE } else { this.buf_ptr_ = 0 } this.bit_end_pos_ += bytes_read << 3 } } /* Guarantees that there are at least 24 bits in the buffer. */ BrotliBitReader.prototype.fillBitWindow = function () { while (this.bit_pos_ >= 8) { this.val_ >>>= 8 this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24 ++this.pos_ this.bit_pos_ = this.bit_pos_ - 8 >>> 0 this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0 } } /* Reads the specified number of bits from Read Buffer. */ BrotliBitReader.prototype.readBits = function (n_bits) { if (32 - this.bit_pos_ < n_bits) { this.fillBitWindow() } const val = ((this.val_ >>> this.bit_pos_) & kBitMask[n_bits]) this.bit_pos_ += n_bits return val } module.exports = BrotliBitReader /***/ }, /***/ 7080: /***/ function (__unused_webpack_module, exports) { /* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Lookup table to map the previous two bytes to a context id. There are four different context modeling modes defined here: CONTEXT_LSB6: context id is the least significant 6 bits of the last byte, CONTEXT_MSB6: context id is the most significant 6 bits of the last byte, CONTEXT_UTF8: second-order context model tuned for UTF8-encoded text, CONTEXT_SIGNED: second-order context model tuned for signed integers. The context id for the UTF8 context model is calculated as follows. If p1 and p2 are the previous two bytes, we calcualte the context as context = kContextLookup[p1] | kContextLookup[p2 + 256]. If the previous two bytes are ASCII characters (i.e. < 128), this will be equivalent to context = 4 * context1(p1) + context2(p2), where context1 is based on the previous byte in the following way: 0 : non-ASCII control 1 : \t, \n, \r 2 : space 3 : other punctuation 4 : " ' 5 : % 6 : ( < [ { 7 : ) > ] } 8 : , ; : 9 : . 10 : = 11 : number 12 : upper-case vowel 13 : upper-case consonant 14 : lower-case vowel 15 : lower-case consonant and context2 is based on the second last byte: 0 : control, space 1 : punctuation 2 : upper-case letter, number 3 : lower-case letter If the last byte is ASCII, and the second last byte is not (in a valid UTF8 stream it will be a continuation byte, value between 128 and 191), the context is the same as if the second last byte was an ASCII control or space. If the last byte is a UTF8 lead byte (value >= 192), then the next byte will be a continuation byte and the context id is 2 or 3 depending on the LSB of the last byte and to a lesser extent on the second last byte if it is ASCII. If the last byte is a UTF8 continuation byte, the second last byte can be: - continuation byte: the next byte is probably ASCII or lead byte (assuming 4-byte UTF8 characters are rare) and the context id is 0 or 1. - lead byte (192 - 207): next byte is ASCII or lead byte, context is 0 or 1 - lead byte (208 - 255): next byte is continuation byte, context is 2 or 3 The possible value combinations of the previous two bytes, the range of context ids and the type of the next byte is summarized in the table below: |--------\-----------------------------------------------------------------| | \ Last byte | | Second \---------------------------------------------------------------| | last byte \ ASCII | cont. byte | lead byte | | \ (0-127) | (128-191) | (192-) | |=============|===================|=====================|==================| | ASCII | next: ASCII/lead | not valid | next: cont. | | (0-127) | context: 4 - 63 | | context: 2 - 3 | |-------------|-------------------|---------------------|------------------| | cont. byte | next: ASCII/lead | next: ASCII/lead | next: cont. | | (128-191) | context: 4 - 63 | context: 0 - 1 | context: 2 - 3 | |-------------|-------------------|---------------------|------------------| | lead byte | not valid | next: ASCII/lead | not valid | | (192-207) | | context: 0 - 1 | | |-------------|-------------------|---------------------|------------------| | lead byte | not valid | next: cont. | not valid | | (208-) | | context: 2 - 3 | | |-------------|-------------------|---------------------|------------------| The context id for the signed context mode is calculated as: context = (kContextLookup[512 + p1] << 3) | kContextLookup[512 + p2]. For any context modeling modes, the context ids can be calculated by |-ing together two lookups from one table using context model dependent offsets: context = kContextLookup[offset1 + p1] | kContextLookup[offset2 + p2]. where offset1 and offset2 are dependent on the context mode. */ const CONTEXT_LSB6 = 0 const CONTEXT_MSB6 = 1 const CONTEXT_UTF8 = 2 const CONTEXT_SIGNED = 3 /* Common context lookup table for all context modes. */ exports.lookup = new Uint8Array([ /* CONTEXT_UTF8, last byte. */ /* ASCII range. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12, 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12, 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0, /* UTF8 continuation byte range. */ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, /* UTF8 lead byte range. */ 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, /* CONTEXT_UTF8 second last byte. */ /* ASCII range. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56, /* CONTEXT_LSB6, last byte. */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, /* CONTEXT_MSB6, last byte. */ 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63, /* CONTEXT_{M,L}SB6, second last byte, */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]) exports.lookupOffsets = new Uint16Array([ /* CONTEXT_LSB6 */ 1024, 1536, /* CONTEXT_MSB6 */ 1280, 1536, /* CONTEXT_UTF8 */ 0, 256, /* CONTEXT_SIGNED */ 768, 512 ]) /***/ }, /***/ 6450: /***/ function (__unused_webpack_module, exports, __webpack_require__) { let __webpack_unused_export__ /* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ const BrotliInput = (__webpack_require__(6154)/* .BrotliInput */ .g) const BrotliOutput = (__webpack_require__(6154)/* .BrotliOutput */ .j) const BrotliBitReader = __webpack_require__(4181) const BrotliDictionary = __webpack_require__(5139) const HuffmanCode = (__webpack_require__(966)/* .HuffmanCode */ .h) const BrotliBuildHuffmanTable = (__webpack_require__(966)/* .BrotliBuildHuffmanTable */ .g) const Context = __webpack_require__(7080) const Prefix = __webpack_require__(8435) const Transform = __webpack_require__(2973) const kDefaultCodeLength = 8 const kCodeLengthRepeatCode = 16 const kNumLiteralCodes = 256 const kNumInsertAndCopyCodes = 704 const kNumBlockLengthCodes = 26 const kLiteralContextBits = 6 const kDistanceContextBits = 2 const HUFFMAN_TABLE_BITS = 8 const HUFFMAN_TABLE_MASK = 0xff /* Maximum possible Huffman table size for an alphabet size of 704, max code * length 15 and root table bits 8. */ const HUFFMAN_MAX_TABLE_SIZE = 1080 const CODE_LENGTH_CODES = 18 const kCodeLengthCodeOrder = new Uint8Array([ 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]) const NUM_DISTANCE_SHORT_CODES = 16 const kDistanceShortCodeIndexOffset = new Uint8Array([ 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 ]) const kDistanceShortCodeValueOffset = new Int8Array([ 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3 ]) const kMaxHuffmanTableSize = new Uint16Array([ 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822, 854, 886, 920, 952, 984, 1016, 1048, 1080 ]) function DecodeWindowBits (br) { let n if (br.readBits(1) === 0) { return 16 } n = br.readBits(3) if (n > 0) { return 17 + n } n = br.readBits(3) if (n > 0) { return 8 + n } return 17 } /* Decodes a number in the range [0..255], by reading 1 - 11 bits. */ function DecodeVarLenUint8 (br) { if (br.readBits(1)) { const nbits = br.readBits(3) if (nbits === 0) { return 1 } else { return br.readBits(nbits) + (1 << nbits) } } return 0 } function MetaBlockLength () { this.meta_block_length = 0 this.input_end = 0 this.is_uncompressed = 0 this.is_metadata = false } function DecodeMetaBlockLength (br) { const out = new MetaBlockLength() let size_nibbles let size_bytes let i out.input_end = br.readBits(1) if (out.input_end && br.readBits(1)) { return out } size_nibbles = br.readBits(2) + 4 if (size_nibbles === 7) { out.is_metadata = true if (br.readBits(1) !== 0) { throw new Error('Invalid reserved bit') } size_bytes = br.readBits(2) if (size_bytes === 0) { return out } for (i = 0; i < size_bytes; i++) { const next_byte = br.readBits(8) if (i + 1 === size_bytes && size_bytes > 1 && next_byte === 0) { throw new Error('Invalid size byte') } out.meta_block_length |= next_byte << (i * 8) } } else { for (i = 0; i < size_nibbles; ++i) { const next_nibble = br.readBits(4) if (i + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0) { throw new Error('Invalid size nibble') } out.meta_block_length |= next_nibble << (i * 4) } } ++out.meta_block_length if (!out.input_end && !out.is_metadata) { out.is_uncompressed = br.readBits(1) } return out } /* Decodes the next Huffman code from bit-stream. */ function ReadSymbol (table, index, br) { const start_index = index let nbits br.fillBitWindow() index += (br.val_ >>> br.bit_pos_) & HUFFMAN_TABLE_MASK nbits = table[index].bits - HUFFMAN_TABLE_BITS if (nbits > 0) { br.bit_pos_ += HUFFMAN_TABLE_BITS index += table[index].value index += (br.val_ >>> br.bit_pos_) & ((1 << nbits) - 1) } br.bit_pos_ += table[index].bits return table[index].value } function ReadHuffmanCodeLengths (code_length_code_lengths, num_symbols, code_lengths, br) { let symbol = 0 let prev_code_len = kDefaultCodeLength let repeat = 0 let repeat_code_len = 0 let space = 32768 const table = [] for (let i = 0; i < 32; i++) { table.push(new HuffmanCode(0, 0)) } BrotliBuildHuffmanTable(table, 0, 5, code_length_code_lengths, CODE_LENGTH_CODES) while (symbol < num_symbols && space > 0) { let p = 0 var code_len br.readMoreInput() br.fillBitWindow() p += (br.val_ >>> br.bit_pos_) & 31 br.bit_pos_ += table[p].bits code_len = table[p].value & 0xff if (code_len < kCodeLengthRepeatCode) { repeat = 0 code_lengths[symbol++] = code_len if (code_len !== 0) { prev_code_len = code_len space -= 32768 >> code_len } } else { const extra_bits = code_len - 14 var old_repeat var repeat_delta let new_len = 0 if (code_len === kCodeLengthRepeatCode) { new_len = prev_code_len } if (repeat_code_len !== new_len) { repeat = 0 repeat_code_len = new_len } old_repeat = repeat if (repeat > 0) { repeat -= 2 repeat <<= extra_bits } repeat += br.readBits(extra_bits) + 3 repeat_delta = repeat - old_repeat if (symbol + repeat_delta > num_symbols) { throw new Error('[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols') } for (let x = 0; x < repeat_delta; x++) { code_lengths[symbol + x] = repeat_code_len } symbol += repeat_delta if (repeat_code_len !== 0) { space -= repeat_delta << (15 - repeat_code_len) } } } if (space !== 0) { throw new Error('[ReadHuffmanCodeLengths] space = ' + space) } for (; symbol < num_symbols; symbol++) { code_lengths[symbol] = 0 } } function ReadHuffmanCode (alphabet_size, tables, table, br) { let table_size = 0 let simple_code_or_skip const code_lengths = new Uint8Array(alphabet_size) br.readMoreInput() /* simple_code_or_skip is used as follows: 1 for simple code; 0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */ simple_code_or_skip = br.readBits(2) if (simple_code_or_skip === 1) { /* Read symbols, codes & code lengths directly. */ var i let max_bits_counter = alphabet_size - 1 let max_bits = 0 const symbols = new Int32Array(4) const num_symbols = br.readBits(2) + 1 while (max_bits_counter) { max_bits_counter >>= 1 ++max_bits } for (i = 0; i < num_symbols; ++i) { symbols[i] = br.readBits(max_bits) % alphabet_size code_lengths[symbols[i]] = 2 } code_lengths[symbols[0]] = 1 switch (num_symbols) { case 1: break case 3: if ((symbols[0] === symbols[1]) || (symbols[0] === symbols[2]) || (symbols[1] === symbols[2])) { throw new Error('[ReadHuffmanCode] invalid symbols') } break case 2: if (symbols[0] === symbols[1]) { throw new Error('[ReadHuffmanCode] invalid symbols') } code_lengths[symbols[1]] = 1 break case 4: if ((symbols[0] === symbols[1]) || (symbols[0] === symbols[2]) || (symbols[0] === symbols[3]) || (symbols[1] === symbols[2]) || (symbols[1] === symbols[3]) || (symbols[2] === symbols[3])) { throw new Error('[ReadHuffmanCode] invalid symbols') } if (br.readBits(1)) { code_lengths[symbols[2]] = 3 code_lengths[symbols[3]] = 3 } else { code_lengths[symbols[0]] = 2 } break } } else { /* Decode Huffman-coded code lengths. */ var i const code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES) let space = 32 let num_codes = 0 /* Static Huffman code for the code length code lengths */ const huff = [ new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 1), new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(3, 2), new HuffmanCode(2, 0), new HuffmanCode(2, 4), new HuffmanCode(2, 3), new HuffmanCode(4, 5) ] for (i = simple_code_or_skip; i < CODE_LENGTH_CODES && space > 0; ++i) { const code_len_idx = kCodeLengthCodeOrder[i] let p = 0 var v br.fillBitWindow() p += (br.val_ >>> br.bit_pos_) & 15 br.bit_pos_ += huff[p].bits v = huff[p].value code_length_code_lengths[code_len_idx] = v if (v !== 0) { space -= (32 >> v) ++num_codes } } if (!(num_codes === 1 || space === 0)) { throw new Error('[ReadHuffmanCode] invalid num_codes or space') } ReadHuffmanCodeLengths(code_length_code_lengths, alphabet_size, code_lengths, br) } table_size = BrotliBuildHuffmanTable(tables, table, HUFFMAN_TABLE_BITS, code_lengths, alphabet_size) if (table_size === 0) { throw new Error('[ReadHuffmanCode] BuildHuffmanTable failed: ') } return table_size } function ReadBlockLength (table, index, br) { let code let nbits code = ReadSymbol(table, index, br) nbits = Prefix.kBlockLengthPrefixCode[code].nbits return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits) } function TranslateShortCodes (code, ringbuffer, index) { let val if (code < NUM_DISTANCE_SHORT_CODES) { index += kDistanceShortCodeIndexOffset[code] index &= 3 val = ringbuffer[index] + kDistanceShortCodeValueOffset[code] } else { val = code - NUM_DISTANCE_SHORT_CODES + 1 } return val } function MoveToFront (v, index) { const value = v[index] let i = index for (; i; --i) v[i] = v[i - 1] v[0] = value } function InverseMoveToFrontTransform (v, v_len) { const mtf = new Uint8Array(256) let i for (i = 0; i < 256; ++i) { mtf[i] = i } for (i = 0; i < v_len; ++i) { const index = v[i] v[i] = mtf[index] if (index) MoveToFront(mtf, index) } } /* Contains a collection of huffman trees with the same alphabet size. */ function HuffmanTreeGroup (alphabet_size, num_htrees) { this.alphabet_size = alphabet_size this.num_htrees = num_htrees this.codes = new Array(num_htrees + num_htrees * kMaxHuffmanTableSize[(alphabet_size + 31) >>> 5]) this.htrees = new Uint32Array(num_htrees) } HuffmanTreeGroup.prototype.decode = function (br) { let i let table_size let next = 0 for (i = 0; i < this.num_htrees; ++i) { this.htrees[i] = next table_size = ReadHuffmanCode(this.alphabet_size, this.codes, next, br) next += table_size } } function DecodeContextMap (context_map_size, br) { const out = { num_htrees: null, context_map: null } let use_rle_for_zeros let max_run_length_prefix = 0 let table let i br.readMoreInput() const num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1 const context_map = out.context_map = new Uint8Array(context_map_size) if (num_htrees <= 1) { return out } use_rle_for_zeros = br.readBits(1) if (use_rle_for_zeros) { max_run_length_prefix = br.readBits(4) + 1 } table = [] for (i = 0; i < HUFFMAN_MAX_TABLE_SIZE; i++) { table[i] = new HuffmanCode(0, 0) } ReadHuffmanCode(num_htrees + max_run_length_prefix, table, 0, br) for (i = 0; i < context_map_size;) { var code br.readMoreInput() code = ReadSymbol(table, 0, br) if (code === 0) { context_map[i] = 0 ++i } else if (code <= max_run_length_prefix) { let reps = 1 + (1 << code) + br.readBits(code) while (--reps) { if (i >= context_map_size) { throw new Error('[DecodeContextMap] i >= context_map_size') } context_map[i] = 0 ++i } } else { context_map[i] = code - max_run_length_prefix ++i } } if (br.readBits(1)) { InverseMoveToFrontTransform(context_map, context_map_size) } return out } function DecodeBlockType (max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) { const ringbuffer = tree_type * 2 const index = tree_type const type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br) let block_type if (type_code === 0) { block_type = ringbuffers[ringbuffer + (indexes[index] & 1)] } else if (type_code === 1) { block_type = ringbuffers[ringbuffer + ((indexes[index] - 1) & 1)] + 1 } else { block_type = type_code - 2 } if (block_type >= max_block_type) { block_type -= max_block_type } block_types[tree_type] = block_type ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type ++indexes[index] } function CopyUncompressedBlockToOutput (output, len, pos, ringbuffer, ringbuffer_mask, br) { const rb_size = ringbuffer_mask + 1 let rb_pos = pos & ringbuffer_mask let br_pos = br.pos_ & BrotliBitReader.IBUF_MASK let nbytes /* For short lengths copy byte-by-byte */ if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) { while (len-- > 0) { br.readMoreInput() ringbuffer[rb_pos++] = br.readBits(8) if (rb_pos === rb_size) { output.write(ringbuffer, rb_size) rb_pos = 0 } } return } if (br.bit_end_pos_ < 32) { throw new Error('[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32') } /* Copy remaining 0-4 bytes from br.val_ to ringbuffer. */ while (br.bit_pos_ < 32) { ringbuffer[rb_pos] = (br.val_ >>> br.bit_pos_) br.bit_pos_ += 8 ++rb_pos --len } /* Copy remaining bytes from br.buf_ to ringbuffer. */ nbytes = (br.bit_end_pos_ - br.bit_pos_) >> 3 if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) { const tail = BrotliBitReader.IBUF_MASK + 1 - br_pos for (var x = 0; x < tail; x++) { ringbuffer[rb_pos + x] = br.buf_[br_pos + x] } nbytes -= tail rb_pos += tail len -= tail br_pos = 0 } for (var x = 0; x < nbytes; x++) { ringbuffer[rb_pos + x] = br.buf_[br_pos + x] } rb_pos += nbytes len -= nbytes /* If we wrote past the logical end of the ringbuffer, copy the tail of the ringbuffer to its beginning and flush the ringbuffer to the output. */ if (rb_pos >= rb_size) { output.write(ringbuffer, rb_size) rb_pos -= rb_size for (var x = 0; x < rb_pos; x++) { ringbuffer[x] = ringbuffer[rb_size + x] } } /* If we have more to copy than the remaining size of the ringbuffer, then we first fill the ringbuffer from the input and then flush the ringbuffer to the output */ while (rb_pos + len >= rb_size) { nbytes = rb_size - rb_pos if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) { throw new Error('[CopyUncompressedBlockToOutput] not enough bytes') } output.write(ringbuffer, rb_size) len -= nbytes rb_pos = 0 } /* Copy straight from the input onto the ringbuffer. The ringbuffer will be flushed to the output at a later time. */ if (br.input_.read(ringbuffer, rb_pos, len) < len) { throw new Error('[CopyUncompressedBlockToOutput] not enough bytes') } /* Restore the state of the bit reader. */ br.reset() } /* Advances the bit reader position to the next byte boundary and verifies that any skipped bits are set to zero. */ function JumpToByteBoundary (br) { const new_bit_pos = (br.bit_pos_ + 7) & ~7 const pad_bits = br.readBits(new_bit_pos - br.bit_pos_) return pad_bits == 0 } function BrotliDecompressedSize (buffer) { const input = new BrotliInput(buffer) const br = new BrotliBitReader(input) DecodeWindowBits(br) const out = DecodeMetaBlockLength(br) return out.meta_block_length } __webpack_unused_export__ = BrotliDecompressedSize function BrotliDecompressBuffer (buffer, output_size) { const input = new BrotliInput(buffer) if (output_size == null) { output_size = BrotliDecompressedSize(buffer) } const output_buffer = new Uint8Array(output_size) const output = new BrotliOutput(output_buffer) BrotliDecompress(input, output) if (output.pos < output.buffer.length) { output.buffer = output.buffer.subarray(0, output.pos) } return output.buffer } exports.BrotliDecompressBuffer = BrotliDecompressBuffer function BrotliDecompress (input, output) { let i let pos = 0 let input_end = 0 let window_bits = 0 let max_backward_distance let max_distance = 0 let ringbuffer_size let ringbuffer_mask let ringbuffer let ringbuffer_end /* This ring buffer holds a few past copy distances that will be used by */ /* some special distance codes. */ const dist_rb = [16, 15, 11, 4] let dist_rb_idx = 0 /* The previous 2 bytes used for context. */ let prev_byte1 = 0 let prev_byte2 = 0 const hgroup = [new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0)] let block_type_trees let block_len_trees let br /* We need the slack region for the following reasons: - always doing two 8-byte copies for fast backward copying - transforms - flushing the input ringbuffer when decoding uncompressed blocks */ const kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE br = new BrotliBitReader(input) /* Decode window size. */ window_bits = DecodeWindowBits(br) max_backward_distance = (1 << window_bits) - 16 ringbuffer_size = 1 << window_bits ringbuffer_mask = ringbuffer_size - 1 ringbuffer = new Uint8Array(ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength) ringbuffer_end = ringbuffer_size block_type_trees = [] block_len_trees = [] for (let x = 0; x < 3 * HUFFMAN_MAX_TABLE_SIZE; x++) { block_type_trees[x] = new HuffmanCode(0, 0) block_len_trees[x] = new HuffmanCode(0, 0) } while (!input_end) { let meta_block_remaining_len = 0 var is_uncompressed const block_length = [1 << 28, 1 << 28, 1 << 28] const block_type = [0] const num_block_types = [1, 1, 1] const block_type_rb = [0, 1, 0, 1, 0, 1] const block_type_rb_index = [0] var distance_postfix_bits var num_direct_distance_codes var distance_postfix_mask var num_distance_codes let context_map = null let context_modes = null var num_literal_htrees let dist_context_map = null var num_dist_htrees let context_offset = 0 let context_map_slice = null let literal_htree_index = 0 let dist_context_offset = 0 let dist_context_map_slice = null let dist_htree_index = 0 let context_lookup_offset1 = 0 let context_lookup_offset2 = 0 var context_mode var htree_command for (i = 0; i < 3; ++i) { hgroup[i].codes = null hgroup[i].htrees = null } br.readMoreInput() const _out = DecodeMetaBlockLength(br) meta_block_remaining_len = _out.meta_block_length if (pos + meta_block_remaining_len > output.buffer.length) { /* We need to grow the output buffer to fit the additional data. */ const tmp = new Uint8Array(pos + meta_block_remaining_len) tmp.set(output.buffer) output.buffer = tmp } input_end = _out.input_end is_uncompressed = _out.is_uncompressed if (_out.is_metadata) { JumpToByteBoundary(br) for (; meta_block_remaining_len > 0; --meta_block_remaining_len) { br.readMoreInput() /* Read one byte and ignore it. */ br.readBits(8) } continue } if (meta_block_remaining_len === 0) { continue } if (is_uncompressed) { br.bit_pos_ = (br.bit_pos_ + 7) & ~7 CopyUncompressedBlockToOutput(output, meta_block_remaining_len, pos, ringbuffer, ringbuffer_mask, br) pos += meta_block_remaining_len continue } for (i = 0; i < 3; ++i) { num_block_types[i] = DecodeVarLenUint8(br) + 1 if (num_block_types[i] >= 2) { ReadHuffmanCode(num_block_types[i] + 2, block_type_trees, i * HUFFMAN_MAX_TABLE_SIZE, br) ReadHuffmanCode(kNumBlockLengthCodes, block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br) block_length[i] = ReadBlockLength(block_len_trees, i * HUFFMAN_MAX_TABLE_SIZE, br) block_type_rb_index[i] = 1 } } br.readMoreInput() distance_postfix_bits = br.readBits(2) num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits) distance_postfix_mask = (1 << distance_postfix_bits) - 1 num_distance_codes = (num_direct_distance_codes + (48 << distance_postfix_bits)) context_modes = new Uint8Array(num_block_types[0]) for (i = 0; i < num_block_types[0]; ++i) { br.readMoreInput() context_modes[i] = (br.readBits(2) << 1) } const _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br) num_literal_htrees = _o1.num_htrees context_map = _o1.context_map const _o2 = DecodeContextMap(num_block_types[2] << kDistanceContextBits, br) num_dist_htrees = _o2.num_htrees dist_context_map = _o2.context_map hgroup[0] = new HuffmanTreeGroup(kNumLiteralCodes, num_literal_htrees) hgroup[1] = new HuffmanTreeGroup(kNumInsertAndCopyCodes, num_block_types[1]) hgroup[2] = new HuffmanTreeGroup(num_distance_codes, num_dist_htrees) for (i = 0; i < 3; ++i) { hgroup[i].decode(br) } context_map_slice = 0 dist_context_map_slice = 0 context_mode = context_modes[block_type[0]] context_lookup_offset1 = Context.lookupOffsets[context_mode] context_lookup_offset2 = Context.lookupOffsets[context_mode + 1] htree_command = hgroup[1].htrees[0] while (meta_block_remaining_len > 0) { var cmd_code var range_idx var insert_code var copy_code var insert_length var copy_length var distance_code var distance var context var j var copy_dst br.readMoreInput() if (block_length[1] === 0) { DecodeBlockType(num_block_types[1], block_type_trees, 1, block_type, block_type_rb, block_type_rb_index, br) block_length[1] = ReadBlockLength(block_len_trees, HUFFMAN_MAX_TABLE_SIZE, br) htree_command = hgroup[1].htrees[block_type[1]] } --block_length[1] cmd_code = ReadSymbol(hgroup[1].codes, htree_command, br) range_idx = cmd_code >> 6 if (range_idx >= 2) { range_idx -= 2 distance_code = -1 } else { distance_code = 0 } insert_code = Prefix.kInsertRangeLut[range_idx] + ((cmd_code >> 3) & 7) copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7) insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset + br.readBits(Prefix.kInsertLengthPrefixCode[insert_code].nbits) copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset + br.readBits(Prefix.kCopyLengthPrefixCode[copy_code].nbits) prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask] prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask] for (j = 0; j < insert_length; ++j) { br.readMoreInput() if (block_length[0] === 0) { DecodeBlockType(num_block_types[0], block_type_trees, 0, block_type, block_type_rb, block_type_rb_index, br) block_length[0] = ReadBlockLength(block_len_trees, 0, br) context_offset = block_type[0] << kLiteralContextBits context_map_slice = context_offset context_mode = context_modes[block_type[0]] context_lookup_offset1 = Context.lookupOffsets[context_mode] context_lookup_offset2 = Context.lookupOffsets[context_mode + 1] } context = (Context.lookup[context_lookup_offset1 + prev_byte1] | Context.lookup[context_lookup_offset2 + prev_byte2]) literal_htree_index = context_map[context_map_slice + context] --block_length[0] prev_byte2 = prev_byte1 prev_byte1 = ReadSymbol(hgroup[0].codes, hgroup[0].htrees[literal_htree_index], br) ringbuffer[pos & ringbuffer_mask] = prev_byte1 if ((pos & ringbuffer_mask) === ringbuffer_mask) { output.write(ringbuffer, ringbuffer_size) } ++pos } meta_block_remaining_len -= insert_length if (meta_block_remaining_len <= 0) break if (distance_code < 0) { var context br.readMoreInput() if (block_length[2] === 0) { DecodeBlockType(num_block_types[2], block_type_trees, 2, block_type, block_type_rb, block_type_rb_index, br) block_length[2] = ReadBlockLength(block_len_trees, 2 * HUFFMAN_MAX_TABLE_SIZE, br) dist_context_offset = block_type[2] << kDistanceContextBits dist_context_map_slice = dist_context_offset } --block_length[2] context = (copy_length > 4 ? 3 : copy_length - 2) & 0xff dist_htree_index = dist_context_map[dist_context_map_slice + context] distance_code = ReadSymbol(hgroup[2].codes, hgroup[2].htrees[dist_htree_index], br) if (distance_code >= num_direct_distance_codes) { var nbits var postfix var offset distance_code -= num_direct_distance_codes postfix = distance_code & distance_postfix_mask distance_code >>= distance_postfix_bits nbits = (distance_code >> 1) + 1 offset = ((2 + (distance_code & 1)) << nbits) - 4 distance_code = num_direct_distance_codes + ((offset + br.readBits(nbits)) << distance_postfix_bits) + postfix } } /* Convert the distance code to the actual distance by possibly looking */ /* up past distnaces from the ringbuffer. */ distance = TranslateShortCodes(distance_code, dist_rb, dist_rb_idx) if (distance < 0) { throw new Error('[BrotliDecompress] invalid distance') } if (pos < max_backward_distance && max_distance !== max_backward_distance) { max_distance = pos } else { max_distance = max_backward_distance } copy_dst = pos & ringbuffer_mask if (distance > max_distance) { if (copy_length >= BrotliDictionary.minDictionaryWordLength && copy_length <= BrotliDictionary.maxDictionaryWordLength) { var offset = BrotliDictionary.offsetsByLength[copy_length] const word_id = distance - max_distance - 1 const shift = BrotliDictionary.sizeBitsByLength[copy_length] const mask = (1 << shift) - 1 const word_idx = word_id & mask const transform_idx = word_id >> shift offset += word_idx * copy_length if (transform_idx < Transform.kNumTransforms) { const len = Transform.transformDictionaryWord(ringbuffer, copy_dst, offset, copy_length, transform_idx) copy_dst += len pos += len meta_block_remaining_len -= len if (copy_dst >= ringbuffer_end) { output.write(ringbuffer, ringbuffer_size) for (let _x = 0; _x < (copy_dst - ringbuffer_end); _x++) { ringbuffer[_x] = ringbuffer[ringbuffer_end + _x] } } } else { throw new Error('Invalid backward reference. pos: ' + pos + ' distance: ' + distance + ' len: ' + copy_length + ' bytes left: ' + meta_block_remaining_len) } } else { throw new Error('Invalid backward reference. pos: ' + pos + ' distance: ' + distance + ' len: ' + copy_length + ' bytes left: ' + meta_block_remaining_len) } } else { if (distance_code > 0) { dist_rb[dist_rb_idx & 3] = distance ++dist_rb_idx } if (copy_length > meta_block_remaining_len) { throw new Error('Invalid backward reference. pos: ' + pos + ' distance: ' + distance + ' len: ' + copy_length + ' bytes left: ' + meta_block_remaining_len) } for (j = 0; j < copy_length; ++j) { ringbuffer[pos & ringbuffer_mask] = ringbuffer[(pos - distance) & ringbuffer_mask] if ((pos & ringbuffer_mask) === ringbuffer_mask) { output.write(ringbuffer, ringbuffer_size) } ++pos --meta_block_remaining_len } } /* When we get here, we must have inserted at least one literal and */ /* made a copy of at least length two, therefore accessing the last 2 */ /* bytes is valid. */ prev_byte1 = ringbuffer[(pos - 1) & ringbuffer_mask] prev_byte2 = ringbuffer[(pos - 2) & ringbuffer_mask] } /* Protect pos from overflow, wrap it around at every GB of input data */ pos &= 0x3fffffff } output.write(ringbuffer, pos & ringbuffer_mask) } __webpack_unused_export__ = BrotliDecompress BrotliDictionary.init() /***/ }, /***/ 5340: /***/ function (__unused_webpack_module, exports, __webpack_require__) { const base64 = __webpack_require__(9742) const fs = __webpack_require__(3857) /** * The normal dictionary-data.js is quite large, which makes it * unsuitable for browser usage. In order to make it smaller, * we read dictionary.bin, which is a compressed version of * the dictionary, and on initial load, Brotli decompresses * it's own dictionary. 😜 */ exports.init = function () { const BrotliDecompressBuffer = (__webpack_require__(6450).BrotliDecompressBuffer) const compressed = base64.toByteArray(__webpack_require__(2722)) return BrotliDecompressBuffer(compressed) } /***/ }, /***/ 2722: /***/ function (module) { module.exports = 'W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWST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Osenxyvf8DAGObT60pfTTlhEg9u/KKkhJqm5U1/+BEcSkpFDA5XeCqxwXmPac1jcuZ3JWQ+p0NdWzb/5v1ZvF8GtMTFFEdQjpLO0bwPb0BHNWnip3liDXI2fXf05jjvfJ0NpjLCUgfTh9CMFYVFKEd4Z/OG/2C+N435mnK+9t1gvCiVcaaH7rK4+PjCvpVNiz+t2QyqH1O8x3JKZVl6Q+Lp/XK8wMjVMslOq9FdSw5FtUs/CptXH9PW+wbWHgrV17R5jTVOtGtKFu3nb80T+E0tv9QkzW3J2dbaw/8ddAKZ0pxIaEqLjlPrji3VgJ3GvdFvlqD8075woxh4fVt0JZE0KVFsAvqhe0dqN9b35jtSpnYMXkU+vZq+IAHad3IHc2s/LYrnD1anfG46IFiMIr9oNbZDWvwthqYNqOigaKd/XlLU4XHfk/PXIjPsLy/9/kAtQ+/wKH+hI/IROWj5FPvTZAT9f7j4ZXQyG4M0TujMAFXYkKvEHv1xhySekgXGGqNxWeWKlf8dDAlLuB1cb/qOD+rk7cmwt+1yKpk9cudqBanTi6zTbXRtV8qylNtjyOVKy1HTz0GW9rjt6sSjAZcT5R+KdtyYb0zyqG9pSLuCw5WBwAn7fjBjKLLoxLXMI+52L9cLwIR2B6OllJZLHJ8vDxmWdtF+QJnmt1rsHPIWY20lftk8fYePkAIg6Hgn532QoIpegMxiWgAOfe5/U44APR8Ac0NeZrVh3gEhs12W+tVSiWiUQekf/YBECUy5fdYbA08dd7VzPAP9aiVcIB9k6tY7WdJ1wNV+bHeydNtmC6G5ICtFC1ZwmJU/j8hf0I8TRVKSiz5oYIa93EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg=' /***/ }, /***/ 5139: /***/ function (__unused_webpack_module, exports, __webpack_require__) { /* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Collection of static dictionary words. */ const data = __webpack_require__(5340) exports.init = function () { exports.dictionary = data.init() } exports.offsetsByLength = new Uint32Array([ 0, 0, 0, 0, 0, 4096, 9216, 21504, 35840, 44032, 53248, 63488, 74752, 87040, 93696, 100864, 104704, 106752, 108928, 113536, 115968, 118528, 119872, 121280, 122016 ]) exports.sizeBitsByLength = new Uint8Array([ 0, 0, 0, 0, 10, 10, 11, 11, 10, 10, 10, 10, 10, 9, 9, 8, 7, 7, 8, 7, 7, 6, 6, 5, 5 ]) exports.minDictionaryWordLength = 4 exports.maxDictionaryWordLength = 24 /***/ }, /***/ 966: /***/ function (__unused_webpack_module, exports) { function HuffmanCode (bits, value) { this.bits = bits /* number of bits used for this symbol */ this.value = value /* symbol value or table offset */ } exports.h = HuffmanCode const MAX_LENGTH = 15 /* Returns reverse(reverse(key, len) + 1, len), where reverse(key, len) is the bit-wise reversal of the len least significant bits of key. */ function GetNextKey (key, len) { let step = 1 << (len - 1) while (key & step) { step >>= 1 } return (key & (step - 1)) + step } /* Stores code in table[0], table[step], table[2*step], ..., table[end] */ /* Assumes that end is an integer multiple of step */ function ReplicateValue (table, i, step, end, code) { do { end -= step table[i + end] = new HuffmanCode(code.bits, code.value) } while (end > 0) } /* Returns the table width of the next 2nd level table. count is the histogram of bit lengths for the remaining symbols, len is the code length of the next processed symbol */ function NextTableBitSize (count, len, root_bits) { let left = 1 << (len - root_bits) while (len < MAX_LENGTH) { left -= count[len] if (left <= 0) break ++len left <<= 1 } return len - root_bits } exports.g = function (root_table, table, root_bits, code_lengths, code_lengths_size) { const start_table = table let code /* current table entry */ let len /* current code length */ let symbol /* symbol index in original or sorted table */ let key /* reversed prefix code */ let step /* step size to replicate values in current table */ let low /* low bits for current root entry */ let mask /* mask for low bits */ let table_bits /* key length of current table */ let table_size /* size of current table */ let total_size /* sum of root table size and 2nd level table sizes */ let sorted /* symbols sorted by code length */ const count = new Int32Array(MAX_LENGTH + 1) /* number of codes of each length */ const offset = new Int32Array(MAX_LENGTH + 1) /* offsets in sorted table for each length */ sorted = new Int32Array(code_lengths_size) /* build histogram of code lengths */ for (symbol = 0; symbol < code_lengths_size; symbol++) { count[code_lengths[symbol]]++ } /* generate offsets into sorted symbol table by code length */ offset[1] = 0 for (len = 1; len < MAX_LENGTH; len++) { offset[len + 1] = offset[len] + count[len] } /* sort symbols by length, by symbol order within each length */ for (symbol = 0; symbol < code_lengths_size; symbol++) { if (code_lengths[symbol] !== 0) { sorted[offset[code_lengths[symbol]]++] = symbol } } table_bits = root_bits table_size = 1 << table_bits total_size = table_size /* special case code with only one value */ if (offset[MAX_LENGTH] === 1) { for (key = 0; key < total_size; ++key) { root_table[table + key] = new HuffmanCode(0, sorted[0] & 0xffff) } return total_size } /* fill in root table */ key = 0 symbol = 0 for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) { for (; count[len] > 0; --count[len]) { code = new HuffmanCode(len & 0xff, sorted[symbol++] & 0xffff) ReplicateValue(root_table, table + key, step, table_size, code) key = GetNextKey(key, len) } } /* fill in 2nd level tables and add pointers to root table */ mask = total_size - 1 low = -1 for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) { for (; count[len] > 0; --count[len]) { if ((key & mask) !== low) { table += table_size table_bits = NextTableBitSize(count, len, root_bits) table_size = 1 << table_bits total_size += table_size low = key & mask root_table[start_table + low] = new HuffmanCode((table_bits + root_bits) & 0xff, ((table - start_table) - low) & 0xffff) } code = new HuffmanCode((len - root_bits) & 0xff, sorted[symbol++] & 0xffff) ReplicateValue(root_table, table + (key >> root_bits), step, table_size, code) key = GetNextKey(key, len) } } return total_size } /***/ }, /***/ 8435: /***/ function (__unused_webpack_module, exports) { /* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Lookup tables to map prefix codes to value ranges. This is used during decoding of the block lengths, literal insertion lengths and copy lengths. */ /* Represents the range of values belonging to a prefix code: */ /* [offset, offset + 2^nbits) */ function PrefixCodeRange (offset, nbits) { this.offset = offset this.nbits = nbits } exports.kBlockLengthPrefixCode = [ new PrefixCodeRange(1, 2), new PrefixCodeRange(5, 2), new PrefixCodeRange(9, 2), new PrefixCodeRange(13, 2), new PrefixCodeRange(17, 3), new PrefixCodeRange(25, 3), new PrefixCodeRange(33, 3), new PrefixCodeRange(41, 3), new PrefixCodeRange(49, 4), new PrefixCodeRange(65, 4), new PrefixCodeRange(81, 4), new PrefixCodeRange(97, 4), new PrefixCodeRange(113, 5), new PrefixCodeRange(145, 5), new PrefixCodeRange(177, 5), new PrefixCodeRange(209, 5), new PrefixCodeRange(241, 6), new PrefixCodeRange(305, 6), new PrefixCodeRange(369, 7), new PrefixCodeRange(497, 8), new PrefixCodeRange(753, 9), new PrefixCodeRange(1265, 10), new PrefixCodeRange(2289, 11), new PrefixCodeRange(4337, 12), new PrefixCodeRange(8433, 13), new PrefixCodeRange(16625, 24) ] exports.kInsertLengthPrefixCode = [ new PrefixCodeRange(0, 0), new PrefixCodeRange(1, 0), new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 1), new PrefixCodeRange(8, 1), new PrefixCodeRange(10, 2), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 3), new PrefixCodeRange(26, 3), new PrefixCodeRange(34, 4), new PrefixCodeRange(50, 4), new PrefixCodeRange(66, 5), new PrefixCodeRange(98, 5), new PrefixCodeRange(130, 6), new PrefixCodeRange(194, 7), new PrefixCodeRange(322, 8), new PrefixCodeRange(578, 9), new PrefixCodeRange(1090, 10), new PrefixCodeRange(2114, 12), new PrefixCodeRange(6210, 14), new PrefixCodeRange(22594, 24) ] exports.kCopyLengthPrefixCode = [ new PrefixCodeRange(2, 0), new PrefixCodeRange(3, 0), new PrefixCodeRange(4, 0), new PrefixCodeRange(5, 0), new PrefixCodeRange(6, 0), new PrefixCodeRange(7, 0), new PrefixCodeRange(8, 0), new PrefixCodeRange(9, 0), new PrefixCodeRange(10, 1), new PrefixCodeRange(12, 1), new PrefixCodeRange(14, 2), new PrefixCodeRange(18, 2), new PrefixCodeRange(22, 3), new PrefixCodeRange(30, 3), new PrefixCodeRange(38, 4), new PrefixCodeRange(54, 4), new PrefixCodeRange(70, 5), new PrefixCodeRange(102, 5), new PrefixCodeRange(134, 6), new PrefixCodeRange(198, 7), new PrefixCodeRange(326, 8), new PrefixCodeRange(582, 9), new PrefixCodeRange(1094, 10), new PrefixCodeRange(2118, 24) ] exports.kInsertRangeLut = [ 0, 0, 8, 8, 0, 16, 8, 16, 16 ] exports.kCopyRangeLut = [ 0, 8, 0, 8, 16, 0, 16, 8, 16 ] /***/ }, /***/ 6154: /***/ function (__unused_webpack_module, exports) { function BrotliInput (buffer) { this.buffer = buffer this.pos = 0 } BrotliInput.prototype.read = function (buf, i, count) { if (this.pos + count > this.buffer.length) { count = this.buffer.length - this.pos } for (let p = 0; p < count; p++) { buf[i + p] = this.buffer[this.pos + p] } this.pos += count return count } exports.g = BrotliInput function BrotliOutput (buf) { this.buffer = buf this.pos = 0 } BrotliOutput.prototype.write = function (buf, count) { if (this.pos + count > this.buffer.length) { throw new Error('Output buffer is not large enough') } this.buffer.set(buf.subarray(0, count), this.pos) this.pos += count return count } exports.j = BrotliOutput /***/ }, /***/ 2973: /***/ function (__unused_webpack_module, exports, __webpack_require__) { /* Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Transformations on dictionary words. */ const BrotliDictionary = __webpack_require__(5139) const kIdentity = 0 const kOmitLast1 = 1 const kOmitLast2 = 2 const kOmitLast3 = 3 const kOmitLast4 = 4 const kOmitLast5 = 5 const kOmitLast6 = 6 const kOmitLast7 = 7 const kOmitLast8 = 8 const kOmitLast9 = 9 const kUppercaseFirst = 10 const kUppercaseAll = 11 const kOmitFirst1 = 12 const kOmitFirst2 = 13 const kOmitFirst3 = 14 const kOmitFirst4 = 15 const kOmitFirst5 = 16 const kOmitFirst6 = 17 const kOmitFirst7 = 18 const kOmitFirst8 = 19 const kOmitFirst9 = 20 function Transform (prefix, transform, suffix) { this.prefix = new Uint8Array(prefix.length) this.transform = transform this.suffix = new Uint8Array(suffix.length) for (var i = 0; i < prefix.length; i++) { this.prefix[i] = prefix.charCodeAt(i) } for (var i = 0; i < suffix.length; i++) { this.suffix[i] = suffix.charCodeAt(i) } } const kTransforms = [ new Transform('', kIdentity, ''), new Transform('', kIdentity, ' '), new Transform(' ', kIdentity, ' '), new Transform('', kOmitFirst1, ''), new Transform('', kUppercaseFirst, ' '), new Transform('', kIdentity, ' the '), new Transform(' ', kIdentity, ''), new Transform('s ', kIdentity, ' '), new Transform('', kIdentity, ' of '), new Transform('', kUppercaseFirst, ''), new Transform('', kIdentity, ' and '), new Transform('', kOmitFirst2, ''), new Transform('', kOmitLast1, ''), new Transform(', ', kIdentity, ' '), new Transform('', kIdentity, ', '), new Transform(' ', kUppercaseFirst, ' '), new Transform('', kIdentity, ' in '), new Transform('', kIdentity, ' to '), new Transform('e ', kIdentity, ' '), new Transform('', kIdentity, '"'), new Transform('', kIdentity, '.'), new Transform('', kIdentity, '">'), new Transform('', kIdentity, '\n'), new Transform('', kOmitLast3, ''), new Transform('', kIdentity, ']'), new Transform('', kIdentity, ' for '), new Transform('', kOmitFirst3, ''), new Transform('', kOmitLast2, ''), new Transform('', kIdentity, ' a '), new Transform('', kIdentity, ' that '), new Transform(' ', kUppercaseFirst, ''), new Transform('', kIdentity, '. '), new Transform('.', kIdentity, ''), new Transform(' ', kIdentity, ', '), new Transform('', kOmitFirst4, ''), new Transform('', kIdentity, ' with '), new Transform('', kIdentity, "'"), new Transform('', kIdentity, ' from '), new Transform('', kIdentity, ' by '), new Transform('', kOmitFirst5, ''), new Transform('', kOmitFirst6, ''), new Transform(' the ', kIdentity, ''), new Transform('', kOmitLast4, ''), new Transform('', kIdentity, '. The '), new Transform('', kUppercaseAll, ''), new Transform('', kIdentity, ' on '), new Transform('', kIdentity, ' as '), new Transform('', kIdentity, ' is '), new Transform('', kOmitLast7, ''), new Transform('', kOmitLast1, 'ing '), new Transform('', kIdentity, '\n\t'), new Transform('', kIdentity, ':'), new Transform(' ', kIdentity, '. '), new Transform('', kIdentity, 'ed '), new Transform('', kOmitFirst9, ''), new Transform('', kOmitFirst7, ''), new Transform('', kOmitLast6, ''), new Transform('', kIdentity, '('), new Transform('', kUppercaseFirst, ', '), new Transform('', kOmitLast8, ''), new Transform('', kIdentity, ' at '), new Transform('', kIdentity, 'ly '), new Transform(' the ', kIdentity, ' of '), new Transform('', kOmitLast5, ''), new Transform('', kOmitLast9, ''), new Transform(' ', kUppercaseFirst, ', '), new Transform('', kUppercaseFirst, '"'), new Transform('.', kIdentity, '('), new Transform('', kUppercaseAll, ' '), new Transform('', kUppercaseFirst, '">'), new Transform('', kIdentity, '="'), new Transform(' ', kIdentity, '.'), new Transform('.com/', kIdentity, ''), new Transform(' the ', kIdentity, ' of the '), new Transform('', kUppercaseFirst, "'"), new Transform('', kIdentity, '. This '), new Transform('', kIdentity, ','), new Transform('.', kIdentity, ' '), new Transform('', kUppercaseFirst, '('), new Transform('', kUppercaseFirst, '.'), new Transform('', kIdentity, ' not '), new Transform(' ', kIdentity, '="'), new Transform('', kIdentity, 'er '), new Transform(' ', kUppercaseAll, ' '), new Transform('', kIdentity, 'al '), new Transform(' ', kUppercaseAll, ''), new Transform('', kIdentity, "='"), new Transform('', kUppercaseAll, '"'), new Transform('', kUppercaseFirst, '. '), new Transform(' ', kIdentity, '('), new Transform('', kIdentity, 'ful '), new Transform(' ', kUppercaseFirst, '. '), new Transform('', kIdentity, 'ive '), new Transform('', kIdentity, 'less '), new Transform('', kUppercaseAll, "'"), new Transform('', kIdentity, 'est '), new Transform(' ', kUppercaseFirst, '.'), new Transform('', kUppercaseAll, '">'), new Transform(' ', kIdentity, "='"), new Transform('', kUppercaseFirst, ','), new Transform('', kIdentity, 'ize '), new Transform('', kUppercaseAll, '.'), new Transform('\xc2\xa0', kIdentity, ''), new Transform(' ', kIdentity, ','), new Transform('', kUppercaseFirst, '="'), new Transform('', kUppercaseAll, '="'), new Transform('', kIdentity, 'ous '), new Transform('', kUppercaseAll, ', '), new Transform('', kUppercaseFirst, "='"), new Transform(' ', kUppercaseFirst, ','), new Transform(' ', kUppercaseAll, '="'), new Transform(' ', kUppercaseAll, ', '), new Transform('', kUppercaseAll, ','), new Transform('', kUppercaseAll, '('), new Transform('', kUppercaseAll, '. '), new Transform(' ', kUppercaseAll, '.'), new Transform('', kUppercaseAll, "='"), new Transform(' ', kUppercaseAll, '. '), new Transform(' ', kUppercaseFirst, '="'), new Transform(' ', kUppercaseAll, "='"), new Transform(' ', kUppercaseFirst, "='") ] exports.kTransforms = kTransforms exports.kNumTransforms = kTransforms.length function ToUpperCase (p, i) { if (p[i] < 0xc0) { if (p[i] >= 97 && p[i] <= 122) { p[i] ^= 32 } return 1 } /* An overly simplified uppercasing model for utf-8. */ if (p[i] < 0xe0) { p[i + 1] ^= 32 return 2 } /* An arbitrary transform for three byte characters. */ p[i + 2] ^= 5 return 3 } exports.transformDictionaryWord = function (dst, idx, word, len, transform) { const prefix = kTransforms[transform].prefix const suffix = kTransforms[transform].suffix const t = kTransforms[transform].transform let skip = t < kOmitFirst1 ? 0 : t - (kOmitFirst1 - 1) let i = 0 const start_idx = idx let uppercase if (skip > len) { skip = len } let prefix_pos = 0 while (prefix_pos < prefix.length) { dst[idx++] = prefix[prefix_pos++] } word += skip len -= skip if (t <= kOmitLast9) { len -= t } for (i = 0; i < len; i++) { dst[idx++] = BrotliDictionary.dictionary[word + i] } uppercase = idx - len if (t === kUppercaseFirst) { ToUpperCase(dst, uppercase) } else if (t === kUppercaseAll) { while (len > 0) { const step = ToUpperCase(dst, uppercase) uppercase += step len -= step } } let suffix_pos = 0 while (suffix_pos < suffix.length) { dst[idx++] = suffix[suffix_pos++] } return idx - start_idx } /***/ }, /***/ 7709: /***/ function (module, __unused_webpack_exports, __webpack_require__) { module.exports = __webpack_require__(6450).BrotliDecompressBuffer /***/ }, /***/ 4505: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer /* provided dependency */ const process = __webpack_require__(4155) /* eslint camelcase: "off" */ const assert = __webpack_require__(9282) const Zstream = __webpack_require__(4860) const zlib_deflate = __webpack_require__(2233) const zlib_inflate = __webpack_require__(3001) const constants = __webpack_require__(7162) for (const key in constants) { exports[key] = constants[key] } // zlib modes exports.NONE = 0 exports.DEFLATE = 1 exports.INFLATE = 2 exports.GZIP = 3 exports.GUNZIP = 4 exports.DEFLATERAW = 5 exports.INFLATERAW = 6 exports.UNZIP = 7 const GZIP_HEADER_ID1 = 0x1f const GZIP_HEADER_ID2 = 0x8b /** * Emulate Node's zlib C++ layer for use by the JS layer in index.js */ function Zlib (mode) { if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) { throw new TypeError('Bad argument') } this.dictionary = null this.err = 0 this.flush = 0 this.init_done = false this.level = 0 this.memLevel = 0 this.mode = mode this.strategy = 0 this.windowBits = 0 this.write_in_progress = false this.pending_close = false this.gzip_id_bytes_read = 0 } Zlib.prototype.close = function () { if (this.write_in_progress) { this.pending_close = true return } this.pending_close = false assert(this.init_done, 'close before init') assert(this.mode <= exports.UNZIP) if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) { zlib_deflate.deflateEnd(this.strm) } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) { zlib_inflate.inflateEnd(this.strm) } this.mode = exports.NONE this.dictionary = null } Zlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) { return this._write(true, flush, input, in_off, in_len, out, out_off, out_len) } Zlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) { return this._write(false, flush, input, in_off, in_len, out, out_off, out_len) } Zlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) { assert.equal(arguments.length, 8) assert(this.init_done, 'write before init') assert(this.mode !== exports.NONE, 'already finalized') assert.equal(false, this.write_in_progress, 'write already in progress') assert.equal(false, this.pending_close, 'close is pending') this.write_in_progress = true assert.equal(false, flush === undefined, 'must provide flush value') this.write_in_progress = true if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) { throw new Error('Invalid flush value') } if (input == null) { input = Buffer.alloc(0) in_len = 0 in_off = 0 } this.strm.avail_in = in_len this.strm.input = input this.strm.next_in = in_off this.strm.avail_out = out_len this.strm.output = out this.strm.next_out = out_off this.flush = flush if (!async) { // sync version this._process() if (this._checkError()) { return this._afterSync() } return } // async version const self = this process.nextTick(function () { self._process() self._after() }) return this } Zlib.prototype._afterSync = function () { const avail_out = this.strm.avail_out const avail_in = this.strm.avail_in this.write_in_progress = false return [avail_in, avail_out] } Zlib.prototype._process = function () { let next_expected_header_byte = null // If the avail_out is left at 0, then it means that it ran out // of room. If there was avail_out left over, then it means // that all of the input was consumed. switch (this.mode) { case exports.DEFLATE: case exports.GZIP: case exports.DEFLATERAW: this.err = zlib_deflate.deflate(this.strm, this.flush) break case exports.UNZIP: if (this.strm.avail_in > 0) { next_expected_header_byte = this.strm.next_in } switch (this.gzip_id_bytes_read) { case 0: if (next_expected_header_byte === null) { break } if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) { this.gzip_id_bytes_read = 1 next_expected_header_byte++ if (this.strm.avail_in === 1) { // The only available byte was already read. break } } else { this.mode = exports.INFLATE break } // fallthrough case 1: if (next_expected_header_byte === null) { break } if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) { this.gzip_id_bytes_read = 2 this.mode = exports.GUNZIP } else { // There is no actual difference between INFLATE and INFLATERAW // (after initialization). this.mode = exports.INFLATE } break default: throw new Error('invalid number of gzip magic number bytes read') } // fallthrough case exports.INFLATE: case exports.GUNZIP: case exports.INFLATERAW: this.err = zlib_inflate.inflate(this.strm, this.flush // If data was encoded with dictionary ); if (this.err === exports.Z_NEED_DICT && this.dictionary) { // Load it this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary) if (this.err === exports.Z_OK) { // And try to decode again this.err = zlib_inflate.inflate(this.strm, this.flush) } else if (this.err === exports.Z_DATA_ERROR) { // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR. // Make it possible for After() to tell a bad dictionary from bad // input. this.err = exports.Z_NEED_DICT } } while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) { // Bytes remain in input buffer. Perhaps this is another compressed // member in the same archive, or just trailing garbage. // Trailing zero bytes are okay, though, since they are frequently // used for padding. this.reset() this.err = zlib_inflate.inflate(this.strm, this.flush) } break default: throw new Error('Unknown mode ' + this.mode) } } Zlib.prototype._checkError = function () { // Acceptable error states depend on the type of zlib stream. switch (this.err) { case exports.Z_OK: case exports.Z_BUF_ERROR: if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) { this._error('unexpected end of file') return false } break case exports.Z_STREAM_END: // normal statuses, not fatal break case exports.Z_NEED_DICT: if (this.dictionary == null) { this._error('Missing dictionary') } else { this._error('Bad dictionary') } return false default: // something else. this._error('Zlib error') return false } return true } Zlib.prototype._after = function () { if (!this._checkError()) { return } const avail_out = this.strm.avail_out const avail_in = this.strm.avail_in this.write_in_progress = false // call the write() cb this.callback(avail_in, avail_out) if (this.pending_close) { this.close() } } Zlib.prototype._error = function (message) { if (this.strm.msg) { message = this.strm.msg } this.onerror(message, this.err // no hope of rescue. ); this.write_in_progress = false if (this.pending_close) { this.close() } } Zlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) { assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])') assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits') assert(level >= -1 && level <= 9, 'invalid compression level') assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel') assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy') this._init(level, windowBits, memLevel, strategy, dictionary) this._setDictionary() } Zlib.prototype.params = function () { throw new Error('deflateParams Not supported') } Zlib.prototype.reset = function () { this._reset() this._setDictionary() } Zlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) { this.level = level this.windowBits = windowBits this.memLevel = memLevel this.strategy = strategy this.flush = exports.Z_NO_FLUSH this.err = exports.Z_OK if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) { this.windowBits += 16 } if (this.mode === exports.UNZIP) { this.windowBits += 32 } if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) { this.windowBits = -1 * this.windowBits } this.strm = new Zstream() switch (this.mode) { case exports.DEFLATE: case exports.GZIP: case exports.DEFLATERAW: this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy) break case exports.INFLATE: case exports.GUNZIP: case exports.INFLATERAW: case exports.UNZIP: this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits) break default: throw new Error('Unknown mode ' + this.mode) } if (this.err !== exports.Z_OK) { this._error('Init error') } this.dictionary = dictionary this.write_in_progress = false this.init_done = true } Zlib.prototype._setDictionary = function () { if (this.dictionary == null) { return } this.err = exports.Z_OK switch (this.mode) { case exports.DEFLATE: case exports.DEFLATERAW: this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary) break default: break } if (this.err !== exports.Z_OK) { this._error('Failed to set dictionary') } } Zlib.prototype._reset = function () { this.err = exports.Z_OK switch (this.mode) { case exports.DEFLATE: case exports.DEFLATERAW: case exports.GZIP: this.err = zlib_deflate.deflateReset(this.strm) break case exports.INFLATE: case exports.INFLATERAW: case exports.GUNZIP: this.err = zlib_inflate.inflateReset(this.strm) break default: break } if (this.err !== exports.Z_OK) { this._error('Failed to reset stream') } } exports.Zlib = Zlib /***/ }, /***/ 2635: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' /* provided dependency */ const process = __webpack_require__(4155) const Buffer = (__webpack_require__(8823).Buffer) const Transform = (__webpack_require__(2830).Transform) const binding = __webpack_require__(4505) const util = __webpack_require__(9539) const assert = (__webpack_require__(9282).ok) const kMaxLength = (__webpack_require__(8823).kMaxLength) const kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + 'than 0x' + kMaxLength.toString(16) + ' bytes' // zlib doesn't provide these, so kludge them in following the same // const naming scheme zlib uses. binding.Z_MIN_WINDOWBITS = 8 binding.Z_MAX_WINDOWBITS = 15 binding.Z_DEFAULT_WINDOWBITS = 15 // fewer than 64 bytes per chunk is stupid. // technically it could work with as few as 8, but even 64 bytes // is absurdly low. Usually a MB or more is best. binding.Z_MIN_CHUNK = 64 binding.Z_MAX_CHUNK = Infinity binding.Z_DEFAULT_CHUNK = 16 * 1024 binding.Z_MIN_MEMLEVEL = 1 binding.Z_MAX_MEMLEVEL = 9 binding.Z_DEFAULT_MEMLEVEL = 8 binding.Z_MIN_LEVEL = -1 binding.Z_MAX_LEVEL = 9 binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION // expose all the zlib constants const bkeys = Object.keys(binding) for (let bk = 0; bk < bkeys.length; bk++) { const bkey = bkeys[bk] if (bkey.match(/^Z/)) { Object.defineProperty(exports, bkey, { enumerable: true, value: binding[bkey], writable: false }) } } // translation table for return codes. const codes = { Z_OK: binding.Z_OK, Z_STREAM_END: binding.Z_STREAM_END, Z_NEED_DICT: binding.Z_NEED_DICT, Z_ERRNO: binding.Z_ERRNO, Z_STREAM_ERROR: binding.Z_STREAM_ERROR, Z_DATA_ERROR: binding.Z_DATA_ERROR, Z_MEM_ERROR: binding.Z_MEM_ERROR, Z_BUF_ERROR: binding.Z_BUF_ERROR, Z_VERSION_ERROR: binding.Z_VERSION_ERROR } const ckeys = Object.keys(codes) for (let ck = 0; ck < ckeys.length; ck++) { const ckey = ckeys[ck] codes[codes[ckey]] = ckey } Object.defineProperty(exports, 'codes', ({ enumerable: true, value: Object.freeze(codes), writable: false })) exports.Deflate = Deflate exports.Inflate = Inflate exports.Gzip = Gzip exports.Gunzip = Gunzip exports.DeflateRaw = DeflateRaw exports.InflateRaw = InflateRaw exports.Unzip = Unzip exports.createDeflate = function (o) { return new Deflate(o) } exports.createInflate = function (o) { return new Inflate(o) } exports.createDeflateRaw = function (o) { return new DeflateRaw(o) } exports.createInflateRaw = function (o) { return new InflateRaw(o) } exports.createGzip = function (o) { return new Gzip(o) } exports.createGunzip = function (o) { return new Gunzip(o) } exports.createUnzip = function (o) { return new Unzip(o) } // Convenience methods. // compress/decompress a string or buffer in one step. exports.deflate = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new Deflate(opts), buffer, callback) } exports.deflateSync = function (buffer, opts) { return zlibBufferSync(new Deflate(opts), buffer) } exports.gzip = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new Gzip(opts), buffer, callback) } exports.gzipSync = function (buffer, opts) { return zlibBufferSync(new Gzip(opts), buffer) } exports.deflateRaw = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new DeflateRaw(opts), buffer, callback) } exports.deflateRawSync = function (buffer, opts) { return zlibBufferSync(new DeflateRaw(opts), buffer) } exports.unzip = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new Unzip(opts), buffer, callback) } exports.unzipSync = function (buffer, opts) { return zlibBufferSync(new Unzip(opts), buffer) } exports.inflate = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new Inflate(opts), buffer, callback) } exports.inflateSync = function (buffer, opts) { return zlibBufferSync(new Inflate(opts), buffer) } exports.gunzip = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new Gunzip(opts), buffer, callback) } exports.gunzipSync = function (buffer, opts) { return zlibBufferSync(new Gunzip(opts), buffer) } exports.inflateRaw = function (buffer, opts, callback) { if (typeof opts === 'function') { callback = opts opts = {} } return zlibBuffer(new InflateRaw(opts), buffer, callback) } exports.inflateRawSync = function (buffer, opts) { return zlibBufferSync(new InflateRaw(opts), buffer) } function zlibBuffer (engine, buffer, callback) { let buffers = [] let nread = 0 engine.on('error', onError) engine.on('end', onEnd) engine.end(buffer) flow() function flow () { let chunk while ((chunk = engine.read()) !== null) { buffers.push(chunk) nread += chunk.length } engine.once('readable', flow) } function onError (err) { engine.removeListener('end', onEnd) engine.removeListener('readable', flow) callback(err) } function onEnd () { let buf let err = null if (nread >= kMaxLength) { err = new RangeError(kRangeErrorMessage) } else { buf = Buffer.concat(buffers, nread) } buffers = [] engine.close() callback(err, buf) } } function zlibBufferSync (engine, buffer) { if (typeof buffer === 'string') buffer = Buffer.from(buffer) if (!Buffer.isBuffer(buffer)) throw new TypeError('Not a string or buffer') const flushFlag = engine._finishFlushFlag return engine._processChunk(buffer, flushFlag) } // generic zlib // minimal 2-byte header function Deflate (opts) { if (!(this instanceof Deflate)) return new Deflate(opts) Zlib.call(this, opts, binding.DEFLATE) } function Inflate (opts) { if (!(this instanceof Inflate)) return new Inflate(opts) Zlib.call(this, opts, binding.INFLATE) } // gzip - bigger header, same deflate compression function Gzip (opts) { if (!(this instanceof Gzip)) return new Gzip(opts) Zlib.call(this, opts, binding.GZIP) } function Gunzip (opts) { if (!(this instanceof Gunzip)) return new Gunzip(opts) Zlib.call(this, opts, binding.GUNZIP) } // raw - no header function DeflateRaw (opts) { if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts) Zlib.call(this, opts, binding.DEFLATERAW) } function InflateRaw (opts) { if (!(this instanceof InflateRaw)) return new InflateRaw(opts) Zlib.call(this, opts, binding.INFLATERAW) } // auto-detect header. function Unzip (opts) { if (!(this instanceof Unzip)) return new Unzip(opts) Zlib.call(this, opts, binding.UNZIP) } function isValidFlushFlag (flag) { return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK } // the Zlib class they all inherit from // This thing manages the queue of requests, and returns // true or false if there is anything in the queue when // you call the .write() method. function Zlib (opts, mode) { const _this = this this._opts = opts = opts || {} this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK Transform.call(this, opts) if (opts.flush && !isValidFlushFlag(opts.flush)) { throw new Error('Invalid flush flag: ' + opts.flush) } if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) { throw new Error('Invalid flush flag: ' + opts.finishFlush) } this._flushFlag = opts.flush || binding.Z_NO_FLUSH this._finishFlushFlag = typeof opts.finishFlush !== 'undefined' ? opts.finishFlush : binding.Z_FINISH if (opts.chunkSize) { if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) { throw new Error('Invalid chunk size: ' + opts.chunkSize) } } if (opts.windowBits) { if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) { throw new Error('Invalid windowBits: ' + opts.windowBits) } } if (opts.level) { if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) { throw new Error('Invalid compression level: ' + opts.level) } } if (opts.memLevel) { if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) { throw new Error('Invalid memLevel: ' + opts.memLevel) } } if (opts.strategy) { if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) { throw new Error('Invalid strategy: ' + opts.strategy) } } if (opts.dictionary) { if (!Buffer.isBuffer(opts.dictionary)) { throw new Error('Invalid dictionary: it should be a Buffer instance') } } this._handle = new binding.Zlib(mode) const self = this this._hadError = false this._handle.onerror = function (message, errno) { // there is no way to cleanly recover. // continuing only obscures problems. _close(self) self._hadError = true const error = new Error(message) error.errno = errno error.code = exports.codes[errno] self.emit('error', error) } let level = exports.Z_DEFAULT_COMPRESSION if (typeof opts.level === 'number') level = opts.level let strategy = exports.Z_DEFAULT_STRATEGY if (typeof opts.strategy === 'number') strategy = opts.strategy this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary) this._buffer = Buffer.allocUnsafe(this._chunkSize) this._offset = 0 this._level = level this._strategy = strategy this.once('end', this.close) Object.defineProperty(this, '_closed', { get: function () { return !_this._handle }, configurable: true, enumerable: true }) } util.inherits(Zlib, Transform) Zlib.prototype.params = function (level, strategy, callback) { if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL) { throw new RangeError('Invalid compression level: ' + level) } if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY) { throw new TypeError('Invalid strategy: ' + strategy) } if (this._level !== level || this._strategy !== strategy) { const self = this this.flush(binding.Z_SYNC_FLUSH, function () { assert(self._handle, 'zlib binding closed') self._handle.params(level, strategy) if (!self._hadError) { self._level = level self._strategy = strategy if (callback) callback() } }) } else { process.nextTick(callback) } } Zlib.prototype.reset = function () { assert(this._handle, 'zlib binding closed') return this._handle.reset() } // This is the _flush function called by the transform class, // internally, when the last chunk has been written. Zlib.prototype._flush = function (callback) { this._transform(Buffer.alloc(0), '', callback) } Zlib.prototype.flush = function (kind, callback) { const _this2 = this const ws = this._writableState if (typeof kind === 'function' || kind === undefined && !callback) { callback = kind kind = binding.Z_FULL_FLUSH } if (ws.ended) { if (callback) process.nextTick(callback) } else if (ws.ending) { if (callback) this.once('end', callback) } else if (ws.needDrain) { if (callback) { this.once('drain', function () { return _this2.flush(kind, callback) }) } } else { this._flushFlag = kind this.write(Buffer.alloc(0), '', callback) } } Zlib.prototype.close = function (callback) { _close(this, callback) process.nextTick(emitCloseNT, this) } function _close (engine, callback) { if (callback) process.nextTick(callback) // Caller may invoke .close after a zlib error (which will null _handle). if (!engine._handle) return engine._handle.close() engine._handle = null } function emitCloseNT (self) { self.emit('close') } Zlib.prototype._transform = function (chunk, encoding, cb) { let flushFlag const ws = this._writableState const ending = ws.ending || ws.ended const last = ending && (!chunk || ws.length === chunk.length) if (chunk !== null && !Buffer.isBuffer(chunk)) return cb(new Error('invalid input')) if (!this._handle) return cb(new Error('zlib binding closed')) // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag // (or whatever flag was provided using opts.finishFlush). // If it's explicitly flushing at some other time, then we use // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression // goodness. if (last) flushFlag = this._finishFlushFlag; else { flushFlag = this._flushFlag // once we've flushed the last of the queue, stop flushing and // go back to the normal behavior. if (chunk.length >= ws.length) { this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH } } this._processChunk(chunk, flushFlag, cb) } Zlib.prototype._processChunk = function (chunk, flushFlag, cb) { let availInBefore = chunk && chunk.length let availOutBefore = this._chunkSize - this._offset let inOff = 0 const self = this const async = typeof cb === 'function' if (!async) { var buffers = [] var nread = 0 let error this.on('error', function (er) { error = er }) assert(this._handle, 'zlib binding closed') do { var res = this._handle.writeSync(flushFlag, chunk, // in inOff, // in_off availInBefore, // in_len this._buffer, // out this._offset, // out_off availOutBefore) // out_len } while (!this._hadError && callback(res[0], res[1])) if (this._hadError) { throw error } if (nread >= kMaxLength) { _close(this) throw new RangeError(kRangeErrorMessage) } const buf = Buffer.concat(buffers, nread) _close(this) return buf } assert(this._handle, 'zlib binding closed') const req = this._handle.write(flushFlag, chunk, // in inOff, // in_off availInBefore, // in_len this._buffer, // out this._offset, // out_off availOutBefore) // out_len req.buffer = chunk req.callback = callback function callback (availInAfter, availOutAfter) { // When the callback is used in an async write, the callback's // context is the `req` object that was created. The req object // is === this._handle, and that's why it's important to null // out the values after they are done being used. `this._handle` // can stay in memory longer than the callback and buffer are needed. if (this) { this.buffer = null this.callback = null } if (self._hadError) return const have = availOutBefore - availOutAfter assert(have >= 0, 'have should not go down') if (have > 0) { const out = self._buffer.slice(self._offset, self._offset + have) self._offset += have // serve some output to the consumer. if (async) { self.push(out) } else { buffers.push(out) nread += out.length } } // exhausted the output buffer, or used all the input create a new one. if (availOutAfter === 0 || self._offset >= self._chunkSize) { availOutBefore = self._chunkSize self._offset = 0 self._buffer = Buffer.allocUnsafe(self._chunkSize) } if (availOutAfter === 0) { // Not actually done. Need to reprocess. // Also, update the availInBefore to the availInAfter value, // so that if we have to hit it a third (fourth, etc.) time, // it'll have the correct byte counts. inOff += availInBefore - availInAfter availInBefore = availInAfter if (!async) return true const newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize) newReq.callback = callback // this same function newReq.buffer = chunk return } if (!async) return false // finished with the chunk. cb() } } util.inherits(Deflate, Zlib) util.inherits(Inflate, Zlib) util.inherits(Gzip, Zlib) util.inherits(Gunzip, Zlib) util.inherits(DeflateRaw, Zlib) util.inherits(InflateRaw, Zlib) util.inherits(Unzip, Zlib) /***/ }, /***/ 6907: /***/ function (__unused_webpack_module, exports) { 'use strict' const TYPED_OK = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Int32Array !== 'undefined') function _has (obj, key) { return Object.prototype.hasOwnProperty.call(obj, key) } exports.assign = function (obj /* from1, from2, from3, ... */) { const sources = Array.prototype.slice.call(arguments, 1) while (sources.length) { const source = sources.shift() if (!source) { continue } if (typeof source !== 'object') { throw new TypeError(source + 'must be non-object') } for (const p in source) { if (_has(source, p)) { obj[p] = source[p] } } } return obj } // reduce buffer size, avoiding mem copy exports.shrinkBuf = function (buf, size) { if (buf.length === size) { return buf } if (buf.subarray) { return buf.subarray(0, size) } buf.length = size return buf } const fnTyped = { arraySet: function (dest, src, src_offs, len, dest_offs) { if (src.subarray && dest.subarray) { dest.set(src.subarray(src_offs, src_offs + len), dest_offs) return } // Fallback to ordinary array for (let i = 0; i < len; i++) { dest[dest_offs + i] = src[src_offs + i] } }, // Join array of chunks to single array. flattenChunks: function (chunks) { let i, l, len, pos, chunk, result // calculate data length len = 0 for (i = 0, l = chunks.length; i < l; i++) { len += chunks[i].length } // join chunks result = new Uint8Array(len) pos = 0 for (i = 0, l = chunks.length; i < l; i++) { chunk = chunks[i] result.set(chunk, pos) pos += chunk.length } return result } } const fnUntyped = { arraySet: function (dest, src, src_offs, len, dest_offs) { for (let i = 0; i < len; i++) { dest[dest_offs + i] = src[src_offs + i] } }, // Join array of chunks to single array. flattenChunks: function (chunks) { return [].concat.apply([], chunks) } } // Enable/Disable typed arrays use, for testing // exports.setTyped = function (on) { if (on) { exports.Buf8 = Uint8Array exports.Buf16 = Uint16Array exports.Buf32 = Int32Array exports.assign(exports, fnTyped) } else { exports.Buf8 = Array exports.Buf16 = Array exports.Buf32 = Array exports.assign(exports, fnUntyped) } } exports.setTyped(TYPED_OK) /***/ }, /***/ 7575: /***/ function (module) { 'use strict' // Note: adler32 takes 12% for level 0 and 2% for level 6. // It isn't worth it to make additional optimizations as in original. // Small size is preferable. // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. function adler32 (adler, buf, len, pos) { let s1 = (adler & 0xffff) | 0 let s2 = ((adler >>> 16) & 0xffff) | 0 let n = 0 while (len !== 0) { // Set limit ~ twice less than 5552, to keep // s2 in 31-bits, because we force signed ints. // in other case %= will fail. n = len > 2000 ? 2000 : len len -= n do { s1 = (s1 + buf[pos++]) | 0 s2 = (s2 + s1) | 0 } while (--n) s1 %= 65521 s2 %= 65521 } return (s1 | (s2 << 16)) | 0 } module.exports = adler32 /***/ }, /***/ 7162: /***/ function (module) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. module.exports = { /* Allowed flush values; see deflate() and inflate() below for details */ Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, // Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, // Z_VERSION_ERROR: -6, /* compression levels */ Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, /* Possible values of the data_type field (though see inflate()) */ Z_BINARY: 0, Z_TEXT: 1, // Z_ASCII: 1, // = Z_TEXT (deprecated) Z_UNKNOWN: 2, /* The deflate compression method */ Z_DEFLATED: 8 // Z_NULL: null // Use -1 or null inline, depending on var type } /***/ }, /***/ 3415: /***/ function (module) { 'use strict' // Note: we can't get significant speed boost here. // So write code to minimize size - no pregenerated tables // and array tools dependencies. // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // Use ordinary array, since untyped makes no boost here function makeTable () { let c; const table = [] for (let n = 0; n < 256; n++) { c = n for (let k = 0; k < 8; k++) { c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)) } table[n] = c } return table } // Create table on load. Just 255 signed longs. Not a problem. const crcTable = makeTable() function crc32 (crc, buf, len, pos) { const t = crcTable const end = pos + len crc ^= -1 for (let i = pos; i < end; i++) { crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF] } return (crc ^ (-1)) // >>> 0; } module.exports = crc32 /***/ }, /***/ 2233: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. const utils = __webpack_require__(6907) const trees = __webpack_require__(1339) const adler32 = __webpack_require__(7575) const crc32 = __webpack_require__(3415) const msg = __webpack_require__(9364) /* Public constants ========================================================== */ /* =========================================================================== */ /* Allowed flush values; see deflate() and inflate() below for details */ const Z_NO_FLUSH = 0 const Z_PARTIAL_FLUSH = 1 // var Z_SYNC_FLUSH = 2; const Z_FULL_FLUSH = 3 const Z_FINISH = 4 const Z_BLOCK = 5 // var Z_TREES = 6; /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ const Z_OK = 0 const Z_STREAM_END = 1 // var Z_NEED_DICT = 2; // var Z_ERRNO = -1; const Z_STREAM_ERROR = -2 const Z_DATA_ERROR = -3 // var Z_MEM_ERROR = -4; const Z_BUF_ERROR = -5 // var Z_VERSION_ERROR = -6; /* compression levels */ // var Z_NO_COMPRESSION = 0; // var Z_BEST_SPEED = 1; // var Z_BEST_COMPRESSION = 9; const Z_DEFAULT_COMPRESSION = -1 const Z_FILTERED = 1 const Z_HUFFMAN_ONLY = 2 const Z_RLE = 3 const Z_FIXED = 4 const Z_DEFAULT_STRATEGY = 0 /* Possible values of the data_type field (though see inflate()) */ // var Z_BINARY = 0; // var Z_TEXT = 1; // var Z_ASCII = 1; // = Z_TEXT const Z_UNKNOWN = 2 /* The deflate compression method */ const Z_DEFLATED = 8 /* ============================================================================ */ const MAX_MEM_LEVEL = 9 /* Maximum value for memLevel in deflateInit2 */ const MAX_WBITS = 15 /* 32K LZ77 window */ const DEF_MEM_LEVEL = 8 const LENGTH_CODES = 29 /* number of length codes, not counting the special END_BLOCK code */ const LITERALS = 256 /* number of literal bytes 0..255 */ const L_CODES = LITERALS + 1 + LENGTH_CODES /* number of Literal or Length codes, including the END_BLOCK code */ const D_CODES = 30 /* number of distance codes */ const BL_CODES = 19 /* number of codes used to transfer the bit lengths */ const HEAP_SIZE = 2 * L_CODES + 1 /* maximum heap size */ const MAX_BITS = 15 /* All codes must not exceed MAX_BITS bits */ const MIN_MATCH = 3 const MAX_MATCH = 258 const MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1) const PRESET_DICT = 0x20 const INIT_STATE = 42 const EXTRA_STATE = 69 const NAME_STATE = 73 const COMMENT_STATE = 91 const HCRC_STATE = 103 const BUSY_STATE = 113 const FINISH_STATE = 666 const BS_NEED_MORE = 1 /* block not completed, need more input or more output */ const BS_BLOCK_DONE = 2 /* block flush performed */ const BS_FINISH_STARTED = 3 /* finish started, need only more output at next deflate */ const BS_FINISH_DONE = 4 /* finish done, accept no more input or output */ const OS_CODE = 0x03 // Unix :) . Don't detect, use this default. function err (strm, errorCode) { strm.msg = msg[errorCode] return errorCode } function rank (f) { return ((f) << 1) - ((f) > 4 ? 9 : 0) } function zero (buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0 } } /* ========================================================================= * Flush as much pending output as possible. All deflate() output goes * through this function so some applications may wish to modify it * to avoid allocating a large strm->output buffer and copying into it. * (See also read_buf()). */ function flush_pending (strm) { const s = strm.state // _tr_flush_bits(s); let len = s.pending if (len > strm.avail_out) { len = strm.avail_out } if (len === 0) { return } utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out) strm.next_out += len s.pending_out += len strm.total_out += len strm.avail_out -= len s.pending -= len if (s.pending === 0) { s.pending_out = 0 } } function flush_block_only (s, last) { trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last) s.block_start = s.strstart flush_pending(s.strm) } function put_byte (s, b) { s.pending_buf[s.pending++] = b } /* ========================================================================= * Put a short in the pending buffer. The 16-bit value is put in MSB order. * IN assertion: the stream state is correct and there is enough room in * pending_buf. */ function putShortMSB (s, b) { // put_byte(s, (Byte)(b >> 8)); // put_byte(s, (Byte)(b & 0xff)); s.pending_buf[s.pending++] = (b >>> 8) & 0xff s.pending_buf[s.pending++] = b & 0xff } /* =========================================================================== * Read a new buffer from the current input stream, update the adler32 * and total number of bytes read. All deflate() input goes through * this function so some applications may wish to modify it to avoid * allocating a large strm->input buffer and copying from it. * (See also flush_pending()). */ function read_buf (strm, buf, start, size) { let len = strm.avail_in if (len > size) { len = size } if (len === 0) { return 0 } strm.avail_in -= len // zmemcpy(buf, strm->next_in, len); utils.arraySet(buf, strm.input, strm.next_in, len, start) if (strm.state.wrap === 1) { strm.adler = adler32(strm.adler, buf, len, start) } else if (strm.state.wrap === 2) { strm.adler = crc32(strm.adler, buf, len, start) } strm.next_in += len strm.total_in += len return len } /* =========================================================================== * Set match_start to the longest match starting at the given string and * return its length. Matches shorter or equal to prev_length are discarded, * in which case the result is equal to prev_length and match_start is * garbage. * IN assertions: cur_match is the head of the hash chain for the current * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 * OUT assertion: the match length is not greater than s->lookahead. */ function longest_match (s, cur_match) { let chain_length = s.max_chain_length /* max hash chain length */ let scan = s.strstart /* current string */ let match /* matched string */ let len /* length of current match */ let best_len = s.prev_length /* best match length so far */ let nice_match = s.nice_match /* stop if match long enough */ const limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/* NIL */ const _win = s.window // shortcut const wmask = s.w_mask const prev = s.prev /* Stop when cur_match becomes <= limit. To simplify the code, * we prevent matches with the string of window index 0. */ const strend = s.strstart + MAX_MATCH let scan_end1 = _win[scan + best_len - 1] let scan_end = _win[scan + best_len] /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. * It is easy to get rid of this optimization if necessary. */ // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever"); /* Do not waste too much time if we already have a good match: */ if (s.prev_length >= s.good_match) { chain_length >>= 2 } /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ if (nice_match > s.lookahead) { nice_match = s.lookahead } // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); do { // Assert(cur_match < s->strstart, "no future"); match = cur_match /* Skip to next match if the match length cannot increase * or if the match length is less than 2. Note that the checks below * for insufficient lookahead only occur occasionally for performance * reasons. Therefore uninitialized memory will be accessed, and * conditional jumps will be made that depend on those values. * However the length of the match is limited to the lookahead, so * the output of deflate is not affected by the uninitialized values. */ if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { continue } /* The check at best_len-1 can be removed because it will be made * again later. (This heuristic is not always a win.) * It is not necessary to compare scan[2] and match[2] since they * are always equal when the other bytes match, given that * the hash keys are equal and that HASH_BITS >= 8. */ scan += 2 match++ // Assert(*scan == *match, "match[2]?"); /* We check for insufficient lookahead only every 8th comparison; * the 256th check will be made at strstart+258. */ do { /* jshint noempty:false */ } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend) // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan"); len = MAX_MATCH - (strend - scan) scan = strend - MAX_MATCH if (len > best_len) { s.match_start = cur_match best_len = len if (len >= nice_match) { break } scan_end1 = _win[scan + best_len - 1] scan_end = _win[scan + best_len] } } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0) if (best_len <= s.lookahead) { return best_len } return s.lookahead } /* =========================================================================== * Fill the window when the lookahead becomes insufficient. * Updates strstart and lookahead. * * IN assertion: lookahead < MIN_LOOKAHEAD * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD * At least one byte has been read, or avail_in == 0; reads are * performed for at least two bytes (required for the zip translate_eol * option -- not supported here). */ function fill_window (s) { const _w_size = s.w_size let p, n, m, more, str // Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); do { more = s.window_size - s.lookahead - s.strstart // JS ints have 32 bit, block below not needed /* Deal with !@#$% 64K limit: */ // if (sizeof(int) <= 2) { // if (more == 0 && s->strstart == 0 && s->lookahead == 0) { // more = wsize; // // } else if (more == (unsigned)(-1)) { // /* Very unlikely, but possible on 16 bit machine if // * strstart == 0 && lookahead == 1 (input done a byte at time) // */ // more--; // } // } /* If the window is almost full and there is insufficient lookahead, * move the upper half to the lower one to make room in the upper half. */ if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { utils.arraySet(s.window, s.window, _w_size, _w_size, 0) s.match_start -= _w_size s.strstart -= _w_size /* we now have strstart >= MAX_DIST */ s.block_start -= _w_size /* Slide the hash table (could be avoided with 32 bit values at the expense of memory usage). We slide even when level == 0 to keep the hash table consistent if we switch back to level > 0 later. (Using level 0 permanently is not an optimal usage of zlib, so we don't care about this pathological case.) */ n = s.hash_size p = n do { m = s.head[--p] s.head[p] = (m >= _w_size ? m - _w_size : 0) } while (--n) n = _w_size p = n do { m = s.prev[--p] s.prev[p] = (m >= _w_size ? m - _w_size : 0) /* If n is not on any hash chain, prev[n] is garbage but * its value will never be used. */ } while (--n) more += _w_size } if (s.strm.avail_in === 0) { break } /* If there was no sliding: * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && * more == window_size - lookahead - strstart * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) * => more >= window_size - 2*WSIZE + 2 * In the BIG_MEM or MMAP case (not yet supported), * window_size == input_size + MIN_LOOKAHEAD && * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. * Otherwise, window_size == 2*WSIZE so more >= 2. * If there was sliding, more >= WSIZE. So in all cases, more >= 2. */ // Assert(more >= 2, "more < 2"); n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more) s.lookahead += n /* Initialize the hash value now that we have some input: */ if (s.lookahead + s.insert >= MIN_MATCH) { str = s.strstart - s.insert s.ins_h = s.window[str] /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask // #if MIN_MATCH != 3 // Call update_hash() MIN_MATCH-3 more times // #endif while (s.insert) { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask s.prev[str & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = str str++ s.insert-- if (s.lookahead + s.insert < MIN_MATCH) { break } } } /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, * but this is not important since only literal bytes will be emitted. */ } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0) /* If the WIN_INIT bytes after the end of the current data have never been * written, then zero those bytes in order to avoid memory check reports of * the use of uninitialized (or uninitialised as Julian writes) bytes by * the longest match routines. Update the high water mark for the next * time through here. WIN_INIT is set to MAX_MATCH since the longest match * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. */ // if (s.high_water < s.window_size) { // var curr = s.strstart + s.lookahead; // var init = 0; // // if (s.high_water < curr) { // /* Previous high water mark below current data -- zero WIN_INIT // * bytes or up to end of window, whichever is less. // */ // init = s.window_size - curr; // if (init > WIN_INIT) // init = WIN_INIT; // zmemzero(s->window + curr, (unsigned)init); // s->high_water = curr + init; // } // else if (s->high_water < (ulg)curr + WIN_INIT) { // /* High water mark at or above current data, but below current data // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up // * to end of window, whichever is less. // */ // init = (ulg)curr + WIN_INIT - s->high_water; // if (init > s->window_size - s->high_water) // init = s->window_size - s->high_water; // zmemzero(s->window + s->high_water, (unsigned)init); // s->high_water += init; // } // } // // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, // "not enough room for search"); } /* =========================================================================== * Copy without compression as much as possible from the input stream, return * the current block state. * This function does not insert new strings in the dictionary since * uncompressible data is probably not useful. This function is used * only for the level=0 compression option. * NOTE: this function should be optimized to avoid extra copying from * window to pending_buf. */ function deflate_stored (s, flush) { /* Stored blocks are limited to 0xffff bytes, pending_buf is limited * to pending_buf_size, and each stored block has a 5 byte header: */ let max_block_size = 0xffff if (max_block_size > s.pending_buf_size - 5) { max_block_size = s.pending_buf_size - 5 } /* Copy as much as possible from input to output: */ for (;;) { /* Fill the window as much as possible: */ if (s.lookahead <= 1) { // Assert(s->strstart < s->w_size+MAX_DIST(s) || // s->block_start >= (long)s->w_size, "slide too late"); // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) || // s.block_start >= s.w_size)) { // throw new Error("slide too late"); // } fill_window(s) if (s.lookahead === 0 && flush === Z_NO_FLUSH) { return BS_NEED_MORE } if (s.lookahead === 0) { break } /* flush the current block */ } // Assert(s->block_start >= 0L, "block gone"); // if (s.block_start < 0) throw new Error("block gone"); s.strstart += s.lookahead s.lookahead = 0 /* Emit a stored block if pending_buf will be full: */ const max_start = s.block_start + max_block_size if (s.strstart === 0 || s.strstart >= max_start) { /* strstart == 0 is possible when wraparound on 16-bit machine */ s.lookahead = s.strstart - max_start s.strstart = max_start /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } /* Flush if we may have to slide, otherwise block_start may become * negative and the data will be gone: */ if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } } s.insert = 0 if (flush === Z_FINISH) { /** * FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true) if (s.strm.avail_out === 0) { return BS_FINISH_STARTED } /***/ return BS_FINISH_DONE } if (s.strstart > s.block_start) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } return BS_NEED_MORE } /* =========================================================================== * Compress as much as possible from the input stream, return the current * block state. * This function does not perform lazy evaluation of matches and inserts * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ function deflate_fast (s, flush) { let hash_head /* head of the hash chain */ let bflush /* set if current block must be flushed */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s) if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE } if (s.lookahead === 0) { break /* flush the current block */ } } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/* NIL */ if (s.lookahead >= MIN_MATCH) { /** * INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart /***/ } /* Find the longest match, discarding those <= prev_length. * At this point we have always match_length < MIN_MATCH */ if (hash_head !== 0/* NIL */ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s.match_length = longest_match(s, hash_head) /* longest_match() sets match_start */ } if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only /** * _tr_tally_dist(s, s.strstart - s.match_start, s.match_length - MIN_MATCH, bflush); ***/ bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH) s.lookahead -= s.match_length /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ if (s.match_length <= s.max_lazy_match/* max_insert_length */ && s.lookahead >= MIN_MATCH) { s.match_length-- /* string at strstart already in table */ do { s.strstart++ /** * INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart /***/ /* strstart never exceeds WSIZE-MAX_MATCH, so there are * always MIN_MATCH bytes ahead. */ } while (--s.match_length !== 0) s.strstart++ } else { s.strstart += s.match_length s.match_length = 0 s.ins_h = s.window[s.strstart] /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask // #if MIN_MATCH != 3 // Call UPDATE_HASH() MIN_MATCH-3 more times // #endif /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not * matter since it will be recomputed at next deflate call. */ } } else { /* No match, output a literal byte */ // Tracevv((stderr,"%c", s.window[s.strstart])); /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]) s.lookahead-- s.strstart++ } if (bflush) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } } s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1) if (flush === Z_FINISH) { /** * FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true) if (s.strm.avail_out === 0) { return BS_FINISH_STARTED } /***/ return BS_FINISH_DONE } if (s.last_lit) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } return BS_BLOCK_DONE } /* =========================================================================== * Same as above, but achieves better compression. We use a lazy * evaluation for matches: a match is finally adopted only if there is * no better match at the next window position. */ function deflate_slow (s, flush) { let hash_head /* head of hash chain */ let bflush /* set if current block must be flushed */ let max_insert /* Process the input block. */ for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (s.lookahead < MIN_LOOKAHEAD) { fill_window(s) if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { return BS_NEED_MORE } if (s.lookahead === 0) { break } /* flush the current block */ } /* Insert the string window[strstart .. strstart+2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = 0/* NIL */ if (s.lookahead >= MIN_MATCH) { /** * INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart /***/ } /* Find the longest match, discarding those <= prev_length. */ s.prev_length = s.match_length s.prev_match = s.match_start s.match_length = MIN_MATCH - 1 if (hash_head !== 0/* NIL */ && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/* MAX_DIST(s) */) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ s.match_length = longest_match(s, hash_head) /* longest_match() sets match_start */ if (s.match_length <= 5 && (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/* TOO_FAR */))) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ s.match_length = MIN_MATCH - 1 } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { max_insert = s.strstart + s.lookahead - MIN_MATCH /* Do not insert strings in hash table beyond this. */ // check_match(s, s.strstart-1, s.prev_match, s.prev_length); /** *_tr_tally_dist(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH, bflush);***/ bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH) /* Insert in hash table all strings up to the end of the match. * strstart-1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ s.lookahead -= s.prev_length - 1 s.prev_length -= 2 do { if (++s.strstart <= max_insert) { /** * INSERT_STRING(s, s.strstart, hash_head); ***/ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = s.strstart /***/ } } while (--s.prev_length !== 0) s.match_available = 0 s.match_length = MIN_MATCH - 1 s.strstart++ if (bflush) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } } else if (s.match_available) { /* If there was no match at the previous position, output a * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ // Tracevv((stderr,"%c", s->window[s->strstart-1])); /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]) if (bflush) { /** * FLUSH_BLOCK_ONLY(s, 0) ***/ flush_block_only(s, false) /***/ } s.strstart++ s.lookahead-- if (s.strm.avail_out === 0) { return BS_NEED_MORE } } else { /* There is no previous match to compare with, wait for * the next step to decide. */ s.match_available = 1 s.strstart++ s.lookahead-- } } // Assert (flush != Z_NO_FLUSH, "no flush?"); if (s.match_available) { // Tracevv((stderr,"%c", s->window[s->strstart-1])); /** * _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]) s.match_available = 0 } s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1 if (flush === Z_FINISH) { /** * FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true) if (s.strm.avail_out === 0) { return BS_FINISH_STARTED } /***/ return BS_FINISH_DONE } if (s.last_lit) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } return BS_BLOCK_DONE } /* =========================================================================== * For Z_RLE, simply look for runs of bytes, generate matches only of distance * one. Do not maintain a hash table. (It will be regenerated if this run of * deflate switches away from Z_RLE.) */ function deflate_rle (s, flush) { let bflush /* set if current block must be flushed */ let prev /* byte at distance one to match */ let scan, strend /* scan goes up to strend for length of run */ const _win = s.window for (;;) { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ if (s.lookahead <= MAX_MATCH) { fill_window(s) if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { return BS_NEED_MORE } if (s.lookahead === 0) { break } /* flush the current block */ } /* See how many times the previous byte repeats */ s.match_length = 0 if (s.lookahead >= MIN_MATCH && s.strstart > 0) { scan = s.strstart - 1 prev = _win[scan] if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { strend = s.strstart + MAX_MATCH do { /* jshint noempty:false */ } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend) s.match_length = MAX_MATCH - (strend - scan) if (s.match_length > s.lookahead) { s.match_length = s.lookahead } } // Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ if (s.match_length >= MIN_MATCH) { // check_match(s, s.strstart, s.strstart - 1, s.match_length); /** * _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/ bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH) s.lookahead -= s.match_length s.strstart += s.match_length s.match_length = 0 } else { /* No match, output a literal byte */ // Tracevv((stderr,"%c", s->window[s->strstart])); /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]) s.lookahead-- s.strstart++ } if (bflush) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } } s.insert = 0 if (flush === Z_FINISH) { /** * FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true) if (s.strm.avail_out === 0) { return BS_FINISH_STARTED } /***/ return BS_FINISH_DONE } if (s.last_lit) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } return BS_BLOCK_DONE } /* =========================================================================== * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. * (It will be regenerated if this run of deflate switches away from Huffman.) */ function deflate_huff (s, flush) { let bflush /* set if current block must be flushed */ for (;;) { /* Make sure that we have a literal to write. */ if (s.lookahead === 0) { fill_window(s) if (s.lookahead === 0) { if (flush === Z_NO_FLUSH) { return BS_NEED_MORE } break /* flush the current block */ } } /* Output a literal byte */ s.match_length = 0 // Tracevv((stderr,"%c", s->window[s->strstart])); /** * _tr_tally_lit(s, s.window[s.strstart], bflush); ***/ bflush = trees._tr_tally(s, 0, s.window[s.strstart]) s.lookahead-- s.strstart++ if (bflush) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } } s.insert = 0 if (flush === Z_FINISH) { /** * FLUSH_BLOCK(s, 1); ***/ flush_block_only(s, true) if (s.strm.avail_out === 0) { return BS_FINISH_STARTED } /***/ return BS_FINISH_DONE } if (s.last_lit) { /** * FLUSH_BLOCK(s, 0); ***/ flush_block_only(s, false) if (s.strm.avail_out === 0) { return BS_NEED_MORE } /***/ } return BS_BLOCK_DONE } /* Values for max_lazy_match, good_match and max_chain_length, depending on * the desired pack level (0..9). The values given below have been tuned to * exclude worst case performance for pathological files. Better values may be * found for specific files. */ function Config (good_length, max_lazy, nice_length, max_chain, func) { this.good_length = good_length this.max_lazy = max_lazy this.nice_length = nice_length this.max_chain = max_chain this.func = func } let configuration_table configuration_table = [ /* good lazy nice chain */ new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */ new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */ new Config(4, 5, 16, 8, deflate_fast), /* 2 */ new Config(4, 6, 32, 32, deflate_fast), /* 3 */ new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */ new Config(8, 16, 32, 32, deflate_slow), /* 5 */ new Config(8, 16, 128, 128, deflate_slow), /* 6 */ new Config(8, 32, 128, 256, deflate_slow), /* 7 */ new Config(32, 128, 258, 1024, deflate_slow), /* 8 */ new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */ ] /* =========================================================================== * Initialize the "longest match" routines for a new zlib stream */ function lm_init (s) { s.window_size = 2 * s.w_size /** * CLEAR_HASH(s); ***/ zero(s.head) // Fill with NIL (= 0); /* Set the default configuration parameters: */ s.max_lazy_match = configuration_table[s.level].max_lazy s.good_match = configuration_table[s.level].good_length s.nice_match = configuration_table[s.level].nice_length s.max_chain_length = configuration_table[s.level].max_chain s.strstart = 0 s.block_start = 0 s.lookahead = 0 s.insert = 0 s.match_length = s.prev_length = MIN_MATCH - 1 s.match_available = 0 s.ins_h = 0 } function DeflateState () { this.strm = null /* pointer back to this zlib stream */ this.status = 0 /* as the name implies */ this.pending_buf = null /* output still pending */ this.pending_buf_size = 0 /* size of pending_buf */ this.pending_out = 0 /* next pending byte to output to the stream */ this.pending = 0 /* nb of bytes in the pending buffer */ this.wrap = 0 /* bit 0 true for zlib, bit 1 true for gzip */ this.gzhead = null /* gzip header information to write */ this.gzindex = 0 /* where in extra, name, or comment */ this.method = Z_DEFLATED /* can only be DEFLATED */ this.last_flush = -1 /* value of flush param for previous deflate call */ this.w_size = 0 /* LZ77 window size (32K by default) */ this.w_bits = 0 /* log2(w_size) (8..16) */ this.w_mask = 0 /* w_size - 1 */ this.window = null /* Sliding window. Input bytes are read into the second half of the window, * and move to the first half later to keep a dictionary of at least wSize * bytes. With this organization, matches are limited to a distance of * wSize-MAX_MATCH bytes, but this ensures that IO is always * performed with a length multiple of the block size. */ this.window_size = 0 /* Actual size of window: 2*wSize, except when the user input buffer * is directly used as sliding window. */ this.prev = null /* Link to older string with same hash index. To limit the size of this * array to 64K, this link is maintained only for the last 32K strings. * An index in this array is thus a window index modulo 32K. */ this.head = null /* Heads of the hash chains or NIL. */ this.ins_h = 0 /* hash index of string to be inserted */ this.hash_size = 0 /* number of elements in hash table */ this.hash_bits = 0 /* log2(hash_size) */ this.hash_mask = 0 /* hash_size-1 */ this.hash_shift = 0 /* Number of bits by which ins_h must be shifted at each input * step. It must be such that after MIN_MATCH steps, the oldest * byte no longer takes part in the hash key, that is: * hash_shift * MIN_MATCH >= hash_bits */ this.block_start = 0 /* Window position at the beginning of the current output block. Gets * negative when the window is moved backwards. */ this.match_length = 0 /* length of best match */ this.prev_match = 0 /* previous match */ this.match_available = 0 /* set if previous match exists */ this.strstart = 0 /* start of string to insert */ this.match_start = 0 /* start of matching string */ this.lookahead = 0 /* number of valid bytes ahead in window */ this.prev_length = 0 /* Length of the best match at previous step. Matches not greater than this * are discarded. This is used in the lazy match evaluation. */ this.max_chain_length = 0 /* To speed up deflation, hash chains are never searched beyond this * length. A higher limit improves compression ratio but degrades the * speed. */ this.max_lazy_match = 0 /* Attempt to find a better match only when the current match is strictly * smaller than this value. This mechanism is used only for compression * levels >= 4. */ // That's alias to max_lazy_match, don't use directly // this.max_insert_length = 0; /* Insert new strings in the hash table only if the match length is not * greater than this length. This saves time but degrades compression. * max_insert_length is used only for compression levels <= 3. */ this.level = 0 /* compression level (1..9) */ this.strategy = 0 /* favor or force Huffman coding */ this.good_match = 0 /* Use a faster search when the previous match is longer than this */ this.nice_match = 0 /* Stop searching when current match exceeds this */ /* used by trees.c: */ /* Didn't use ct_data typedef below to suppress compiler warning */ // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ // Use flat array of DOUBLE size, with interleaved fata, // because JS does not support effective this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2) this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2) this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2) zero(this.dyn_ltree) zero(this.dyn_dtree) zero(this.bl_tree) this.l_desc = null /* desc. for literal tree */ this.d_desc = null /* desc. for distance tree */ this.bl_desc = null /* desc. for bit length tree */ // ush bl_count[MAX_BITS+1]; this.bl_count = new utils.Buf16(MAX_BITS + 1) /* number of codes at each bit length for an optimal tree */ // int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ this.heap = new utils.Buf16(2 * L_CODES + 1) /* heap used to build the Huffman trees */ zero(this.heap) this.heap_len = 0 /* number of elements in the heap */ this.heap_max = 0 /* element of largest frequency */ /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. * The same heap array is used to build all trees. */ this.depth = new utils.Buf16(2 * L_CODES + 1) // uch depth[2*L_CODES+1]; zero(this.depth) /* Depth of each subtree used as tie breaker for trees of equal frequency */ this.l_buf = 0 /* buffer index for literals or lengths */ this.lit_bufsize = 0 /* Size of match buffer for literals/lengths. There are 4 reasons for * limiting lit_bufsize to 64K: * - frequencies can be kept in 16 bit counters * - if compression is not successful for the first block, all input * data is still in the window so we can still emit a stored block even * when input comes from standard input. (This can also be done for * all blocks if lit_bufsize is not greater than 32K.) * - if compression is not successful for a file smaller than 64K, we can * even emit a stored file instead of a stored block (saving 5 bytes). * This is applicable only for zip (not gzip or zlib). * - creating new Huffman trees less frequently may not provide fast * adaptation to changes in the input data statistics. (Take for * example a binary file with poorly compressible code followed by * a highly compressible string table.) Smaller buffer sizes give * fast adaptation but have of course the overhead of transmitting * trees more frequently. * - I can't count above 4 */ this.last_lit = 0 /* running index in l_buf */ this.d_buf = 0 /* Buffer index for distances. To simplify the code, d_buf and l_buf have * the same number of elements. To use different lengths, an extra flag * array would be necessary. */ this.opt_len = 0 /* bit length of current block with optimal trees */ this.static_len = 0 /* bit length of current block with static trees */ this.matches = 0 /* number of string matches in current block */ this.insert = 0 /* bytes at end of window left to insert */ this.bi_buf = 0 /* Output buffer. bits are inserted starting at the bottom (least * significant bits). */ this.bi_valid = 0 /* Number of valid bits in bi_buf. All bits above the last valid bit * are always zero. */ // Used for window memory init. We safely ignore it for JS. That makes // sense only for pointers and memory check tools. // this.high_water = 0; /* High water mark offset in window for initialized bytes -- bytes above * this are set to zero in order to avoid memory check warnings when * longest match routines access bytes past the input. This is then * updated to the new high water mark. */ } function deflateResetKeep (strm) { let s if (!strm || !strm.state) { return err(strm, Z_STREAM_ERROR) } strm.total_in = strm.total_out = 0 strm.data_type = Z_UNKNOWN s = strm.state s.pending = 0 s.pending_out = 0 if (s.wrap < 0) { s.wrap = -s.wrap /* was made negative by deflate(..., Z_FINISH); */ } s.status = (s.wrap ? INIT_STATE : BUSY_STATE) strm.adler = (s.wrap === 2) ? 0 // crc32(0, Z_NULL, 0) : 1 // adler32(0, Z_NULL, 0) s.last_flush = Z_NO_FLUSH trees._tr_init(s) return Z_OK } function deflateReset (strm) { const ret = deflateResetKeep(strm) if (ret === Z_OK) { lm_init(strm.state) } return ret } function deflateSetHeader (strm, head) { if (!strm || !strm.state) { return Z_STREAM_ERROR } if (strm.state.wrap !== 2) { return Z_STREAM_ERROR } strm.state.gzhead = head return Z_OK } function deflateInit2 (strm, level, method, windowBits, memLevel, strategy) { if (!strm) { // === Z_NULL return Z_STREAM_ERROR } let wrap = 1 if (level === Z_DEFAULT_COMPRESSION) { level = 6 } if (windowBits < 0) { /* suppress zlib wrapper */ wrap = 0 windowBits = -windowBits } else if (windowBits > 15) { wrap = 2 /* write gzip wrapper instead */ windowBits -= 16 } if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { return err(strm, Z_STREAM_ERROR) } if (windowBits === 8) { windowBits = 9 } /* until 256-byte window bug fixed */ const s = new DeflateState() strm.state = s s.strm = strm s.wrap = wrap s.gzhead = null s.w_bits = windowBits s.w_size = 1 << s.w_bits s.w_mask = s.w_size - 1 s.hash_bits = memLevel + 7 s.hash_size = 1 << s.hash_bits s.hash_mask = s.hash_size - 1 s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH) s.window = new utils.Buf8(s.w_size * 2) s.head = new utils.Buf16(s.hash_size) s.prev = new utils.Buf16(s.w_size) // Don't need mem init magic for JS. // s.high_water = 0; /* nothing written to s->window yet */ s.lit_bufsize = 1 << (memLevel + 6) /* 16K elements by default */ s.pending_buf_size = s.lit_bufsize * 4 // overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2); // s->pending_buf = (uchf *) overlay; s.pending_buf = new utils.Buf8(s.pending_buf_size) // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`) // s->d_buf = overlay + s->lit_bufsize/sizeof(ush); s.d_buf = 1 * s.lit_bufsize // s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize; s.l_buf = (1 + 2) * s.lit_bufsize s.level = level s.strategy = strategy s.method = method return deflateReset(strm) } function deflateInit (strm, level) { return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY) } function deflate (strm, flush) { let old_flush, s let beg, val // for gzip header write only if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR } s = strm.state if (!strm.output || (!strm.input && strm.avail_in !== 0) || (s.status === FINISH_STATE && flush !== Z_FINISH)) { return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR) } s.strm = strm /* just in case */ old_flush = s.last_flush s.last_flush = flush /* Write the header */ if (s.status === INIT_STATE) { if (s.wrap === 2) { // GZIP header strm.adler = 0 // crc32(0L, Z_NULL, 0); put_byte(s, 31) put_byte(s, 139) put_byte(s, 8) if (!s.gzhead) { // s->gzhead == Z_NULL put_byte(s, 0) put_byte(s, 0) put_byte(s, 0) put_byte(s, 0) put_byte(s, 0) put_byte(s, s.level === 9 ? 2 : (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0)) put_byte(s, OS_CODE) s.status = BUSY_STATE } else { put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16) ) put_byte(s, s.gzhead.time & 0xff) put_byte(s, (s.gzhead.time >> 8) & 0xff) put_byte(s, (s.gzhead.time >> 16) & 0xff) put_byte(s, (s.gzhead.time >> 24) & 0xff) put_byte(s, s.level === 9 ? 2 : (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0)) put_byte(s, s.gzhead.os & 0xff) if (s.gzhead.extra && s.gzhead.extra.length) { put_byte(s, s.gzhead.extra.length & 0xff) put_byte(s, (s.gzhead.extra.length >> 8) & 0xff) } if (s.gzhead.hcrc) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0) } s.gzindex = 0 s.status = EXTRA_STATE } } else // DEFLATE header { let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8 let level_flags = -1 if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { level_flags = 0 } else if (s.level < 6) { level_flags = 1 } else if (s.level === 6) { level_flags = 2 } else { level_flags = 3 } header |= (level_flags << 6) if (s.strstart !== 0) { header |= PRESET_DICT } header += 31 - (header % 31) s.status = BUSY_STATE putShortMSB(s, header) /* Save the adler32 of the preset dictionary: */ if (s.strstart !== 0) { putShortMSB(s, strm.adler >>> 16) putShortMSB(s, strm.adler & 0xffff) } strm.adler = 1 // adler32(0L, Z_NULL, 0); } } // #ifdef GZIP if (s.status === EXTRA_STATE) { if (s.gzhead.extra/* != Z_NULL */) { beg = s.pending /* start of bytes to update crc */ while (s.gzindex < (s.gzhead.extra.length & 0xffff)) { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg) } flush_pending(strm) beg = s.pending if (s.pending === s.pending_buf_size) { break } } put_byte(s, s.gzhead.extra[s.gzindex] & 0xff) s.gzindex++ } if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg) } if (s.gzindex === s.gzhead.extra.length) { s.gzindex = 0 s.status = NAME_STATE } } else { s.status = NAME_STATE } } if (s.status === NAME_STATE) { if (s.gzhead.name/* != Z_NULL */) { beg = s.pending /* start of bytes to update crc */ // int val; do { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg) } flush_pending(strm) beg = s.pending if (s.pending === s.pending_buf_size) { val = 1 break } } // JS specific: little magic to add zero terminator to end of string if (s.gzindex < s.gzhead.name.length) { val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff } else { val = 0 } put_byte(s, val) } while (val !== 0) if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg) } if (val === 0) { s.gzindex = 0 s.status = COMMENT_STATE } } else { s.status = COMMENT_STATE } } if (s.status === COMMENT_STATE) { if (s.gzhead.comment/* != Z_NULL */) { beg = s.pending /* start of bytes to update crc */ // int val; do { if (s.pending === s.pending_buf_size) { if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg) } flush_pending(strm) beg = s.pending if (s.pending === s.pending_buf_size) { val = 1 break } } // JS specific: little magic to add zero terminator to end of string if (s.gzindex < s.gzhead.comment.length) { val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff } else { val = 0 } put_byte(s, val) } while (val !== 0) if (s.gzhead.hcrc && s.pending > beg) { strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg) } if (val === 0) { s.status = HCRC_STATE } } else { s.status = HCRC_STATE } } if (s.status === HCRC_STATE) { if (s.gzhead.hcrc) { if (s.pending + 2 > s.pending_buf_size) { flush_pending(strm) } if (s.pending + 2 <= s.pending_buf_size) { put_byte(s, strm.adler & 0xff) put_byte(s, (strm.adler >> 8) & 0xff) strm.adler = 0 // crc32(0L, Z_NULL, 0); s.status = BUSY_STATE } } else { s.status = BUSY_STATE } } // #endif /* Flush as much pending output as possible */ if (s.pending !== 0) { flush_pending(strm) if (strm.avail_out === 0) { /* Since avail_out is 0, deflate will be called again with * more output space, but possibly with both pending and * avail_in equal to zero. There won't be anything to do, * but this is not an error situation so make sure we * return OK instead of BUF_ERROR at next call of deflate: */ s.last_flush = -1 return Z_OK } /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { return err(strm, Z_BUF_ERROR) } /* User must not provide more input after the first FINISH: */ if (s.status === FINISH_STATE && strm.avail_in !== 0) { return err(strm, Z_BUF_ERROR) } /* Start a new block or continue the current one. */ if (strm.avail_in !== 0 || s.lookahead !== 0 || (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) { const bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) : (s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush)) if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { s.status = FINISH_STATE } if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { if (strm.avail_out === 0) { s.last_flush = -1 /* avoid BUF_ERROR next call, see above */ } return Z_OK /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an * empty block here, this will be done at next call. This also * ensures that for a very small output buffer, we emit at most * one empty block. */ } if (bstate === BS_BLOCK_DONE) { if (flush === Z_PARTIAL_FLUSH) { trees._tr_align(s) } else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ trees._tr_stored_block(s, 0, 0, false) /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ if (flush === Z_FULL_FLUSH) { /** * CLEAR_HASH(s); ***/ /* forget history */ zero(s.head) // Fill with NIL (= 0); if (s.lookahead === 0) { s.strstart = 0 s.block_start = 0 s.insert = 0 } } } flush_pending(strm) if (strm.avail_out === 0) { s.last_flush = -1 /* avoid BUF_ERROR at next call, see above */ return Z_OK } } } // Assert(strm->avail_out > 0, "bug2"); // if (strm.avail_out <= 0) { throw new Error("bug2");} if (flush !== Z_FINISH) { return Z_OK } if (s.wrap <= 0) { return Z_STREAM_END } /* Write the trailer */ if (s.wrap === 2) { put_byte(s, strm.adler & 0xff) put_byte(s, (strm.adler >> 8) & 0xff) put_byte(s, (strm.adler >> 16) & 0xff) put_byte(s, (strm.adler >> 24) & 0xff) put_byte(s, strm.total_in & 0xff) put_byte(s, (strm.total_in >> 8) & 0xff) put_byte(s, (strm.total_in >> 16) & 0xff) put_byte(s, (strm.total_in >> 24) & 0xff) } else { putShortMSB(s, strm.adler >>> 16) putShortMSB(s, strm.adler & 0xffff) } flush_pending(strm) /* If avail_out is zero, the application will call deflate again * to flush the rest. */ if (s.wrap > 0) { s.wrap = -s.wrap } /* write the trailer only once! */ return s.pending !== 0 ? Z_OK : Z_STREAM_END } function deflateEnd (strm) { let status if (!strm/* == Z_NULL */ || !strm.state/* == Z_NULL */) { return Z_STREAM_ERROR } status = strm.state.status if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE ) { return err(strm, Z_STREAM_ERROR) } strm.state = null return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK } /* ========================================================================= * Initializes the compression dictionary from the given byte * sequence without producing any compressed output. */ function deflateSetDictionary (strm, dictionary) { let dictLength = dictionary.length let s let str, n let wrap let avail let next let input let tmpDict if (!strm/* == Z_NULL */ || !strm.state/* == Z_NULL */) { return Z_STREAM_ERROR } s = strm.state wrap = s.wrap if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) { return Z_STREAM_ERROR } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ if (wrap === 1) { /* adler32(strm->adler, dictionary, dictLength); */ strm.adler = adler32(strm.adler, dictionary, dictLength, 0) } s.wrap = 0 /* avoid computing Adler-32 in read_buf */ /* if dictionary would fill window, just replace the history */ if (dictLength >= s.w_size) { if (wrap === 0) { /* already empty otherwise */ /** * CLEAR_HASH(s); ***/ zero(s.head) // Fill with NIL (= 0); s.strstart = 0 s.block_start = 0 s.insert = 0 } /* use the tail */ // dictionary = dictionary.slice(dictLength - s.w_size); tmpDict = new utils.Buf8(s.w_size) utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0) dictionary = tmpDict dictLength = s.w_size } /* insert dictionary into window and hash */ avail = strm.avail_in next = strm.next_in input = strm.input strm.avail_in = dictLength strm.next_in = 0 strm.input = dictionary fill_window(s) while (s.lookahead >= MIN_MATCH) { str = s.strstart n = s.lookahead - (MIN_MATCH - 1) do { /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */ s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask s.prev[str & s.w_mask] = s.head[s.ins_h] s.head[s.ins_h] = str str++ } while (--n) s.strstart = str s.lookahead = MIN_MATCH - 1 fill_window(s) } s.strstart += s.lookahead s.block_start = s.strstart s.insert = s.lookahead s.lookahead = 0 s.match_length = s.prev_length = MIN_MATCH - 1 s.match_available = 0 strm.next_in = next strm.input = input strm.avail_in = avail s.wrap = wrap return Z_OK } exports.deflateInit = deflateInit exports.deflateInit2 = deflateInit2 exports.deflateReset = deflateReset exports.deflateResetKeep = deflateResetKeep exports.deflateSetHeader = deflateSetHeader exports.deflate = deflate exports.deflateEnd = deflateEnd exports.deflateSetDictionary = deflateSetDictionary exports.deflateInfo = 'pako deflate (from Nodeca project)' /* Not implemented exports.deflateBound = deflateBound; exports.deflateCopy = deflateCopy; exports.deflateParams = deflateParams; exports.deflatePending = deflatePending; exports.deflatePrime = deflatePrime; exports.deflateTune = deflateTune; */ /***/ }, /***/ 6438: /***/ function (module) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. // See state defs from inflate.js const BAD = 30 /* got a data error -- remain here until reset */ const TYPE = 12 /* i: waiting for type bits, including last-flag bit */ /* Decode literal, length, and distance codes and write out the resulting literal and match bytes until either not enough input or output is available, an end-of-block is encountered, or a data error is encountered. When large enough input and output buffers are supplied to inflate(), for example, a 16K input buffer and a 64K output buffer, more than 95% of the inflate execution time is spent in this routine. Entry assumptions: state.mode === LEN strm.avail_in >= 6 strm.avail_out >= 258 start >= strm.avail_out state.bits < 8 On return, state.mode is one of: LEN -- ran out of enough output space or enough available input TYPE -- reached end of block code, inflate() to interpret next block BAD -- error in block data Notes: - The maximum input bits used by a length/distance pair is 15 bits for the length code, 5 bits for the length extra, 15 bits for the distance code, and 13 bits for the distance extra. This totals 48 bits, or six bytes. Therefore if strm.avail_in >= 6, then there is enough input to avoid checking for available input while decoding. - The maximum bytes that a single length/distance pair can output is 258 bytes, which is the maximum length that can be coded. inflate_fast() requires strm.avail_out >= 258 for each loop to avoid checking for output space. */ module.exports = function inflate_fast (strm, start) { let state let _in /* local strm.input */ let last /* have enough input while in < last */ let _out /* local strm.output */ let beg /* inflate()'s initial strm.output */ let end /* while out < end, enough space available */ // #ifdef INFLATE_STRICT let dmax /* maximum distance from zlib header */ // #endif let wsize /* window size or zero if not using window */ let whave /* valid bytes in the window */ let wnext /* window write index */ // Use `s_window` instead `window`, avoid conflict with instrumentation tools let s_window /* allocated sliding window, if wsize != 0 */ let hold /* local strm.hold */ let bits /* local strm.bits */ let lcode /* local strm.lencode */ let dcode /* local strm.distcode */ let lmask /* mask for first level of length codes */ let dmask /* mask for first level of distance codes */ let here /* retrieved table entry */ let op /* code bits, operation, extra bits, or */ /* window position, window bytes to copy */ let len /* match length, unused bytes */ let dist /* match distance */ let from /* where to copy match from */ let from_source let input, output // JS specific, because we have no pointers /* copy state to local variables */ state = strm.state // here = state.here; _in = strm.next_in input = strm.input last = _in + (strm.avail_in - 5) _out = strm.next_out output = strm.output beg = _out - (start - strm.avail_out) end = _out + (strm.avail_out - 257) // #ifdef INFLATE_STRICT dmax = state.dmax // #endif wsize = state.wsize whave = state.whave wnext = state.wnext s_window = state.window hold = state.hold bits = state.bits lcode = state.lencode dcode = state.distcode lmask = (1 << state.lenbits) - 1 dmask = (1 << state.distbits) - 1 /* decode literals and length/distances until end-of-block or not enough input data or output space */ top: do { if (bits < 15) { hold += input[_in++] << bits bits += 8 hold += input[_in++] << bits bits += 8 } here = lcode[hold & lmask] dolen: for (;;) { // Goto emulation op = here >>> 24/* here.bits */ hold >>>= op bits -= op op = (here >>> 16) & 0xff/* here.op */ if (op === 0) { /* literal */ // Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? // "inflate: literal '%c'\n" : // "inflate: literal 0x%02x\n", here.val)); output[_out++] = here & 0xffff/* here.val */ } else if (op & 16) { /* length base */ len = here & 0xffff/* here.val */ op &= 15 /* number of extra bits */ if (op) { if (bits < op) { hold += input[_in++] << bits bits += 8 } len += hold & ((1 << op) - 1) hold >>>= op bits -= op } // Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { hold += input[_in++] << bits bits += 8 hold += input[_in++] << bits bits += 8 } here = dcode[hold & dmask] dodist: for (;;) { // goto emulation op = here >>> 24/* here.bits */ hold >>>= op bits -= op op = (here >>> 16) & 0xff/* here.op */ if (op & 16) { /* distance base */ dist = here & 0xffff/* here.val */ op &= 15 /* number of extra bits */ if (bits < op) { hold += input[_in++] << bits bits += 8 if (bits < op) { hold += input[_in++] << bits bits += 8 } } dist += hold & ((1 << op) - 1) // #ifdef INFLATE_STRICT if (dist > dmax) { strm.msg = 'invalid distance too far back' state.mode = BAD break top } // #endif hold >>>= op bits -= op // Tracevv((stderr, "inflate: distance %u\n", dist)); op = _out - beg /* max distance in output */ if (dist > op) { /* see if copy from window */ op = dist - op /* distance back in window */ if (op > whave) { if (state.sane) { strm.msg = 'invalid distance too far back' state.mode = BAD break top } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility // #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR // if (len <= op - whave) { // do { // output[_out++] = 0; // } while (--len); // continue top; // } // len -= op - whave; // do { // output[_out++] = 0; // } while (--op > whave); // if (op === 0) { // from = _out - dist; // do { // output[_out++] = output[from++]; // } while (--len); // continue top; // } // #endif } from = 0 // window index from_source = s_window if (wnext === 0) { /* very common case */ from += wsize - op if (op < len) { /* some from window */ len -= op do { output[_out++] = s_window[from++] } while (--op) from = _out - dist /* rest from output */ from_source = output } } else if (wnext < op) { /* wrap around window */ from += wsize + wnext - op op -= wnext if (op < len) { /* some from end of window */ len -= op do { output[_out++] = s_window[from++] } while (--op) from = 0 if (wnext < len) { /* some from start of window */ op = wnext len -= op do { output[_out++] = s_window[from++] } while (--op) from = _out - dist /* rest from output */ from_source = output } } } else { /* contiguous in window */ from += wnext - op if (op < len) { /* some from window */ len -= op do { output[_out++] = s_window[from++] } while (--op) from = _out - dist /* rest from output */ from_source = output } } while (len > 2) { output[_out++] = from_source[from++] output[_out++] = from_source[from++] output[_out++] = from_source[from++] len -= 3 } if (len) { output[_out++] = from_source[from++] if (len > 1) { output[_out++] = from_source[from++] } } } else { from = _out - dist /* copy direct from output */ do { /* minimum length is three */ output[_out++] = output[from++] output[_out++] = output[from++] output[_out++] = output[from++] len -= 3 } while (len > 2) if (len) { output[_out++] = output[from++] if (len > 1) { output[_out++] = output[from++] } } } } else if ((op & 64) === 0) { /* 2nd level distance code */ here = dcode[(here & 0xffff)/* here.val */ + (hold & ((1 << op) - 1))] continue dodist } else { strm.msg = 'invalid distance code' state.mode = BAD break top } break // need to emulate goto via "continue" } } else if ((op & 64) === 0) { /* 2nd level length code */ here = lcode[(here & 0xffff)/* here.val */ + (hold & ((1 << op) - 1))] continue dolen } else if (op & 32) { /* end-of-block */ // Tracevv((stderr, "inflate: end of block\n")); state.mode = TYPE break top } else { strm.msg = 'invalid literal/length code' state.mode = BAD break top } break // need to emulate goto via "continue" } } while (_in < last && _out < end) /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ len = bits >> 3 _in -= len bits -= len << 3 hold &= (1 << bits) - 1 /* update state and return */ strm.next_in = _in strm.next_out = _out strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last)) strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end)) state.hold = hold state.bits = bits } /***/ }, /***/ 3001: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. const utils = __webpack_require__(6907) const adler32 = __webpack_require__(7575) const crc32 = __webpack_require__(3415) const inflate_fast = __webpack_require__(6438) const inflate_table = __webpack_require__(1375) const CODES = 0 const LENS = 1 const DISTS = 2 /* Public constants ========================================================== */ /* =========================================================================== */ /* Allowed flush values; see deflate() and inflate() below for details */ // var Z_NO_FLUSH = 0; // var Z_PARTIAL_FLUSH = 1; // var Z_SYNC_FLUSH = 2; // var Z_FULL_FLUSH = 3; const Z_FINISH = 4 const Z_BLOCK = 5 const Z_TREES = 6 /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ const Z_OK = 0 const Z_STREAM_END = 1 const Z_NEED_DICT = 2 // var Z_ERRNO = -1; const Z_STREAM_ERROR = -2 const Z_DATA_ERROR = -3 const Z_MEM_ERROR = -4 const Z_BUF_ERROR = -5 // var Z_VERSION_ERROR = -6; /* The deflate compression method */ const Z_DEFLATED = 8 /* STATES ==================================================================== */ /* =========================================================================== */ const HEAD = 1 /* i: waiting for magic header */ const FLAGS = 2 /* i: waiting for method and flags (gzip) */ const TIME = 3 /* i: waiting for modification time (gzip) */ const OS = 4 /* i: waiting for extra flags and operating system (gzip) */ const EXLEN = 5 /* i: waiting for extra length (gzip) */ const EXTRA = 6 /* i: waiting for extra bytes (gzip) */ const NAME = 7 /* i: waiting for end of file name (gzip) */ const COMMENT = 8 /* i: waiting for end of comment (gzip) */ const HCRC = 9 /* i: waiting for header crc (gzip) */ const DICTID = 10 /* i: waiting for dictionary check value */ const DICT = 11 /* waiting for inflateSetDictionary() call */ const TYPE = 12 /* i: waiting for type bits, including last-flag bit */ const TYPEDO = 13 /* i: same, but skip check to exit inflate on new block */ const STORED = 14 /* i: waiting for stored size (length and complement) */ const COPY_ = 15 /* i/o: same as COPY below, but only first time in */ const COPY = 16 /* i/o: waiting for input or output to copy stored block */ const TABLE = 17 /* i: waiting for dynamic block table lengths */ const LENLENS = 18 /* i: waiting for code length code lengths */ const CODELENS = 19 /* i: waiting for length/lit and distance code lengths */ const LEN_ = 20 /* i: same as LEN below, but only first time in */ const LEN = 21 /* i: waiting for length/lit/eob code */ const LENEXT = 22 /* i: waiting for length extra bits */ const DIST = 23 /* i: waiting for distance code */ const DISTEXT = 24 /* i: waiting for distance extra bits */ const MATCH = 25 /* o: waiting for output space to copy string */ const LIT = 26 /* o: waiting for output space to write literal */ const CHECK = 27 /* i: waiting for 32-bit check value */ const LENGTH = 28 /* i: waiting for 32-bit length (gzip) */ const DONE = 29 /* finished check, done -- remain here until reset */ const BAD = 30 /* got a data error -- remain here until reset */ const MEM = 31 /* got an inflate() memory error -- remain here until reset */ const SYNC = 32 /* looking for synchronization bytes to restart inflate() */ /* =========================================================================== */ const ENOUGH_LENS = 852 const ENOUGH_DISTS = 592 // var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); const MAX_WBITS = 15 /* 32K LZ77 window */ const DEF_WBITS = MAX_WBITS function zswap32 (q) { return (((q >>> 24) & 0xff) + ((q >>> 8) & 0xff00) + ((q & 0xff00) << 8) + ((q & 0xff) << 24)) } function InflateState () { this.mode = 0 /* current inflate mode */ this.last = false /* true if processing last block */ this.wrap = 0 /* bit 0 true for zlib, bit 1 true for gzip */ this.havedict = false /* true if dictionary provided */ this.flags = 0 /* gzip header method and flags (0 if zlib) */ this.dmax = 0 /* zlib header max distance (INFLATE_STRICT) */ this.check = 0 /* protected copy of check value */ this.total = 0 /* protected copy of output count */ // TODO: may be {} this.head = null /* where to save gzip header information */ /* sliding window */ this.wbits = 0 /* log base 2 of requested window size */ this.wsize = 0 /* window size or zero if not using window */ this.whave = 0 /* valid bytes in the window */ this.wnext = 0 /* window write index */ this.window = null /* allocated sliding window, if needed */ /* bit accumulator */ this.hold = 0 /* input bit accumulator */ this.bits = 0 /* number of bits in "in" */ /* for string and stored block copying */ this.length = 0 /* literal or length of data to copy */ this.offset = 0 /* distance back to copy string from */ /* for table and code decoding */ this.extra = 0 /* extra bits needed */ /* fixed and dynamic code tables */ this.lencode = null /* starting table for length/literal codes */ this.distcode = null /* starting table for distance codes */ this.lenbits = 0 /* index bits for lencode */ this.distbits = 0 /* index bits for distcode */ /* dynamic table building */ this.ncode = 0 /* number of code length code lengths */ this.nlen = 0 /* number of length code lengths */ this.ndist = 0 /* number of distance code lengths */ this.have = 0 /* number of code lengths in lens[] */ this.next = null /* next available space in codes[] */ this.lens = new utils.Buf16(320) /* temporary storage for code lengths */ this.work = new utils.Buf16(288) /* work area for code table building */ /* because we don't have pointers in js, we use lencode and distcode directly as buffers so we don't need codes */ // this.codes = new utils.Buf32(ENOUGH); /* space for code tables */ this.lendyn = null /* dynamic table for length/literal codes (JS specific) */ this.distdyn = null /* dynamic table for distance codes (JS specific) */ this.sane = 0 /* if false, allow invalid distance too far */ this.back = 0 /* bits back of last unprocessed length/lit */ this.was = 0 /* initial length of match */ } function inflateResetKeep (strm) { let state if (!strm || !strm.state) { return Z_STREAM_ERROR } state = strm.state strm.total_in = strm.total_out = state.total = 0 strm.msg = '' /* Z_NULL */ if (state.wrap) { /* to support ill-conceived Java test suite */ strm.adler = state.wrap & 1 } state.mode = HEAD state.last = 0 state.havedict = 0 state.dmax = 32768 state.head = null/* Z_NULL */ state.hold = 0 state.bits = 0 // state.lencode = state.distcode = state.next = state.codes; state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS) state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS) state.sane = 1 state.back = -1 // Tracev((stderr, "inflate: reset\n")); return Z_OK } function inflateReset (strm) { let state if (!strm || !strm.state) { return Z_STREAM_ERROR } state = strm.state state.wsize = 0 state.whave = 0 state.wnext = 0 return inflateResetKeep(strm) } function inflateReset2 (strm, windowBits) { let wrap let state /* get the state */ if (!strm || !strm.state) { return Z_STREAM_ERROR } state = strm.state /* extract wrap request from windowBits parameter */ if (windowBits < 0) { wrap = 0 windowBits = -windowBits } else { wrap = (windowBits >> 4) + 1 if (windowBits < 48) { windowBits &= 15 } } /* set number of window bits, free window if different */ if (windowBits && (windowBits < 8 || windowBits > 15)) { return Z_STREAM_ERROR } if (state.window !== null && state.wbits !== windowBits) { state.window = null } /* update state and reset the rest of it */ state.wrap = wrap state.wbits = windowBits return inflateReset(strm) } function inflateInit2 (strm, windowBits) { let ret let state if (!strm) { return Z_STREAM_ERROR } // strm.msg = Z_NULL; /* in case we return an error */ state = new InflateState() // if (state === Z_NULL) return Z_MEM_ERROR; // Tracev((stderr, "inflate: allocated\n")); strm.state = state state.window = null/* Z_NULL */ ret = inflateReset2(strm, windowBits) if (ret !== Z_OK) { strm.state = null/* Z_NULL */ } return ret } function inflateInit (strm) { return inflateInit2(strm, DEF_WBITS) } /* Return state with length and distance decoding tables and index sizes set to fixed code decoding. Normally this returns fixed tables from inffixed.h. If BUILDFIXED is defined, then instead this routine builds the tables the first time it's called, and returns those tables the first time and thereafter. This reduces the size of the code by about 2K bytes, in exchange for a little execution time. However, BUILDFIXED should not be used for threaded applications, since the rewriting of the tables and virgin may not be thread-safe. */ let virgin = true let lenfix, distfix // We have no pointers in JS, so keep tables separate function fixedtables (state) { /* build fixed huffman tables if first call (may not be thread safe) */ if (virgin) { let sym lenfix = new utils.Buf32(512) distfix = new utils.Buf32(32) /* literal/length table */ sym = 0 while (sym < 144) { state.lens[sym++] = 8 } while (sym < 256) { state.lens[sym++] = 9 } while (sym < 280) { state.lens[sym++] = 7 } while (sym < 288) { state.lens[sym++] = 8 } inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }) /* distance table */ sym = 0 while (sym < 32) { state.lens[sym++] = 5 } inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }) /* do this just once */ virgin = false } state.lencode = lenfix state.lenbits = 9 state.distcode = distfix state.distbits = 5 } /* Update the window with the last wsize (normally 32K) bytes written before returning. If window does not exist yet, create it. This is only called when a window is already in use, or when output has been written during this inflate call, but the end of the deflate stream has not been reached yet. It is also called to create a window for dictionary data when a dictionary is loaded. Providing output buffers larger than 32K to inflate() should provide a speed advantage, since only the last 32K of output is copied to the sliding window upon return from inflate(), and since all distances after the first 32K of output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ function updatewindow (strm, src, end, copy) { let dist const state = strm.state /* if it hasn't been done already, allocate space for the window */ if (state.window === null) { state.wsize = 1 << state.wbits state.wnext = 0 state.whave = 0 state.window = new utils.Buf8(state.wsize) } /* copy state->wsize or less output bytes into the circular window */ if (copy >= state.wsize) { utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0) state.wnext = 0 state.whave = state.wsize } else { dist = state.wsize - state.wnext if (dist > copy) { dist = copy } // zmemcpy(state->window + state->wnext, end - copy, dist); utils.arraySet(state.window, src, end - copy, dist, state.wnext) copy -= dist if (copy) { // zmemcpy(state->window, end - copy, copy); utils.arraySet(state.window, src, end - copy, copy, 0) state.wnext = copy state.whave = state.wsize } else { state.wnext += dist if (state.wnext === state.wsize) { state.wnext = 0 } if (state.whave < state.wsize) { state.whave += dist } } } return 0 } function inflate (strm, flush) { let state let input, output // input/output buffers let next /* next input INDEX */ let put /* next output INDEX */ let have, left /* available input and output */ let hold /* bit buffer */ let bits /* bits in bit buffer */ let _in, _out /* save starting available input and output */ let copy /* number of stored or match bytes to copy */ let from /* where to copy match bytes from */ let from_source let here = 0 /* current decoding table entry */ let here_bits, here_op, here_val // paked "here" denormalized (JS specific) // var last; /* parent table entry */ let last_bits, last_op, last_val // paked "last" denormalized (JS specific) let len /* length to copy for repeats, bits to drop */ let ret /* return code */ const hbuf = new utils.Buf8(4) /* buffer for gzip header crc calculation */ let opts let n // temporary var for NEED_BITS const order = /* permutation of code lengths */ [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] if (!strm || !strm.state || !strm.output || (!strm.input && strm.avail_in !== 0)) { return Z_STREAM_ERROR } state = strm.state if (state.mode === TYPE) { state.mode = TYPEDO } /* skip check */ // --- LOAD() --- put = strm.next_out output = strm.output left = strm.avail_out next = strm.next_in input = strm.input have = strm.avail_in hold = state.hold bits = state.bits // --- _in = have _out = left ret = Z_OK inf_leave: // goto emulation for (;;) { switch (state.mode) { case HEAD: if (state.wrap === 0) { state.mode = TYPEDO break } //= == NEEDBITS(16); while (bits < 16) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */ state.check = 0/* crc32(0L, Z_NULL, 0) */ //= == CRC2(state.check, hold); hbuf[0] = hold & 0xff hbuf[1] = (hold >>> 8) & 0xff state.check = crc32(state.check, hbuf, 2, 0) //= ==// //= == INITBITS(); hold = 0 bits = 0 //= ==// state.mode = FLAGS break } state.flags = 0 /* expect zlib header */ if (state.head) { state.head.done = false } if (!(state.wrap & 1) || /* check if zlib header allowed */ (((hold & 0xff)/* BITS(8) */ << 8) + (hold >> 8)) % 31) { strm.msg = 'incorrect header check' state.mode = BAD break } if ((hold & 0x0f)/* BITS(4) */ !== Z_DEFLATED) { strm.msg = 'unknown compression method' state.mode = BAD break } // --- DROPBITS(4) ---// hold >>>= 4 bits -= 4 // ---// len = (hold & 0x0f)/* BITS(4) */ + 8 if (state.wbits === 0) { state.wbits = len } else if (len > state.wbits) { strm.msg = 'invalid window size' state.mode = BAD break } state.dmax = 1 << len // Tracev((stderr, "inflate: zlib header ok\n")); strm.adler = state.check = 1/* adler32(0L, Z_NULL, 0) */ state.mode = hold & 0x200 ? DICTID : TYPE //= == INITBITS(); hold = 0 bits = 0 //= ==// break case FLAGS: //= == NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.flags = hold if ((state.flags & 0xff) !== Z_DEFLATED) { strm.msg = 'unknown compression method' state.mode = BAD break } if (state.flags & 0xe000) { strm.msg = 'unknown header flags set' state.mode = BAD break } if (state.head) { state.head.text = ((hold >> 8) & 1) } if (state.flags & 0x0200) { //= == CRC2(state.check, hold); hbuf[0] = hold & 0xff hbuf[1] = (hold >>> 8) & 0xff state.check = crc32(state.check, hbuf, 2, 0) //= ==// } //= == INITBITS(); hold = 0 bits = 0 //= ==// state.mode = TIME /* falls through */ case TIME: //= == NEEDBITS(32); */ while (bits < 32) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// if (state.head) { state.head.time = hold } if (state.flags & 0x0200) { //= == CRC4(state.check, hold) hbuf[0] = hold & 0xff hbuf[1] = (hold >>> 8) & 0xff hbuf[2] = (hold >>> 16) & 0xff hbuf[3] = (hold >>> 24) & 0xff state.check = crc32(state.check, hbuf, 4, 0) //= == } //= == INITBITS(); hold = 0 bits = 0 //= ==// state.mode = OS /* falls through */ case OS: //= == NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// if (state.head) { state.head.xflags = (hold & 0xff) state.head.os = (hold >> 8) } if (state.flags & 0x0200) { //= == CRC2(state.check, hold); hbuf[0] = hold & 0xff hbuf[1] = (hold >>> 8) & 0xff state.check = crc32(state.check, hbuf, 2, 0) //= ==// } //= == INITBITS(); hold = 0 bits = 0 //= ==// state.mode = EXLEN /* falls through */ case EXLEN: if (state.flags & 0x0400) { //= == NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.length = hold if (state.head) { state.head.extra_len = hold } if (state.flags & 0x0200) { //= == CRC2(state.check, hold); hbuf[0] = hold & 0xff hbuf[1] = (hold >>> 8) & 0xff state.check = crc32(state.check, hbuf, 2, 0) //= ==// } //= == INITBITS(); hold = 0 bits = 0 //= ==// } else if (state.head) { state.head.extra = null/* Z_NULL */ } state.mode = EXTRA /* falls through */ case EXTRA: if (state.flags & 0x0400) { copy = state.length if (copy > have) { copy = have } if (copy) { if (state.head) { len = state.head.extra_len - state.length if (!state.head.extra) { // Use untyped array for more convenient processing later state.head.extra = new Array(state.head.extra_len) } utils.arraySet( state.head.extra, input, next, // extra field is limited to 65536 bytes // - no need for additional size check copy, /* len + copy > state.head.extra_max - len ? state.head.extra_max : copy, */ len ) // zmemcpy(state.head.extra + len, next, // len + copy > state.head.extra_max ? // state.head.extra_max - len : copy); } if (state.flags & 0x0200) { state.check = crc32(state.check, input, copy, next) } have -= copy next += copy state.length -= copy } if (state.length) { break inf_leave } } state.length = 0 state.mode = NAME /* falls through */ case NAME: if (state.flags & 0x0800) { if (have === 0) { break inf_leave } copy = 0 do { // TODO: 2 or 1 bytes? len = input[next + copy++] /* use constant limit because in js we should not preallocate memory */ if (state.head && len && (state.length < 65536 /* state.head.name_max */)) { state.head.name += String.fromCharCode(len) } } while (len && copy < have) if (state.flags & 0x0200) { state.check = crc32(state.check, input, copy, next) } have -= copy next += copy if (len) { break inf_leave } } else if (state.head) { state.head.name = null } state.length = 0 state.mode = COMMENT /* falls through */ case COMMENT: if (state.flags & 0x1000) { if (have === 0) { break inf_leave } copy = 0 do { len = input[next + copy++] /* use constant limit because in js we should not preallocate memory */ if (state.head && len && (state.length < 65536 /* state.head.comm_max */)) { state.head.comment += String.fromCharCode(len) } } while (len && copy < have) if (state.flags & 0x0200) { state.check = crc32(state.check, input, copy, next) } have -= copy next += copy if (len) { break inf_leave } } else if (state.head) { state.head.comment = null } state.mode = HCRC /* falls through */ case HCRC: if (state.flags & 0x0200) { //= == NEEDBITS(16); */ while (bits < 16) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// if (hold !== (state.check & 0xffff)) { strm.msg = 'header crc mismatch' state.mode = BAD break } //= == INITBITS(); hold = 0 bits = 0 //= ==// } if (state.head) { state.head.hcrc = ((state.flags >> 9) & 1) state.head.done = true } strm.adler = state.check = 0 state.mode = TYPE break case DICTID: //= == NEEDBITS(32); */ while (bits < 32) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// strm.adler = state.check = zswap32(hold) //= == INITBITS(); hold = 0 bits = 0 //= ==// state.mode = DICT /* falls through */ case DICT: if (state.havedict === 0) { // --- RESTORE() --- strm.next_out = put strm.avail_out = left strm.next_in = next strm.avail_in = have state.hold = hold state.bits = bits // --- return Z_NEED_DICT } strm.adler = state.check = 1/* adler32(0L, Z_NULL, 0) */ state.mode = TYPE /* falls through */ case TYPE: if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave } /* falls through */ case TYPEDO: if (state.last) { // --- BYTEBITS() ---// hold >>>= bits & 7 bits -= bits & 7 // ---// state.mode = CHECK break } //= == NEEDBITS(3); */ while (bits < 3) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.last = (hold & 0x01)/* BITS(1) */ // --- DROPBITS(1) ---// hold >>>= 1 bits -= 1 // ---// switch ((hold & 0x03)/* BITS(2) */) { case 0: /* stored block */ // Tracev((stderr, "inflate: stored block%s\n", // state.last ? " (last)" : "")); state.mode = STORED break case 1: /* fixed block */ fixedtables(state) // Tracev((stderr, "inflate: fixed codes block%s\n", // state.last ? " (last)" : "")); state.mode = LEN_ /* decode codes */ if (flush === Z_TREES) { // --- DROPBITS(2) ---// hold >>>= 2 bits -= 2 // ---// break inf_leave } break case 2: /* dynamic block */ // Tracev((stderr, "inflate: dynamic codes block%s\n", // state.last ? " (last)" : "")); state.mode = TABLE break case 3: strm.msg = 'invalid block type' state.mode = BAD } // --- DROPBITS(2) ---// hold >>>= 2 bits -= 2 // ---// break case STORED: // --- BYTEBITS() ---// /* go to byte boundary */ hold >>>= bits & 7 bits -= bits & 7 // ---// //= == NEEDBITS(32); */ while (bits < 32) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) { strm.msg = 'invalid stored block lengths' state.mode = BAD break } state.length = hold & 0xffff // Tracev((stderr, "inflate: stored length %u\n", // state.length)); //= == INITBITS(); hold = 0 bits = 0 //= ==// state.mode = COPY_ if (flush === Z_TREES) { break inf_leave } /* falls through */ case COPY_: state.mode = COPY /* falls through */ case COPY: copy = state.length if (copy) { if (copy > have) { copy = have } if (copy > left) { copy = left } if (copy === 0) { break inf_leave } // --- zmemcpy(put, next, copy); --- utils.arraySet(output, input, next, copy, put) // ---// have -= copy next += copy left -= copy put += copy state.length -= copy break } // Tracev((stderr, "inflate: stored end\n")); state.mode = TYPE break case TABLE: //= == NEEDBITS(14); */ while (bits < 14) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.nlen = (hold & 0x1f)/* BITS(5) */ + 257 // --- DROPBITS(5) ---// hold >>>= 5 bits -= 5 // ---// state.ndist = (hold & 0x1f)/* BITS(5) */ + 1 // --- DROPBITS(5) ---// hold >>>= 5 bits -= 5 // ---// state.ncode = (hold & 0x0f)/* BITS(4) */ + 4 // --- DROPBITS(4) ---// hold >>>= 4 bits -= 4 // ---// // #ifndef PKZIP_BUG_WORKAROUND if (state.nlen > 286 || state.ndist > 30) { strm.msg = 'too many length or distance symbols' state.mode = BAD break } // #endif // Tracev((stderr, "inflate: table sizes ok\n")); state.have = 0 state.mode = LENLENS /* falls through */ case LENLENS: while (state.have < state.ncode) { //= == NEEDBITS(3); while (bits < 3) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.lens[order[state.have++]] = (hold & 0x07)// BITS(3); // --- DROPBITS(3) ---// hold >>>= 3 bits -= 3 // ---// } while (state.have < 19) { state.lens[order[state.have++]] = 0 } // We have separate tables & no pointers. 2 commented lines below not needed. // state.next = state.codes; // state.lencode = state.next; // Switch to use dynamic table state.lencode = state.lendyn state.lenbits = 7 opts = { bits: state.lenbits } ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts) state.lenbits = opts.bits if (ret) { strm.msg = 'invalid code lengths set' state.mode = BAD break } // Tracev((stderr, "inflate: code lengths ok\n")); state.have = 0 state.mode = CODELENS /* falls through */ case CODELENS: while (state.have < state.nlen + state.ndist) { for (;;) { here = state.lencode[hold & ((1 << state.lenbits) - 1)]/* BITS(state.lenbits) */ here_bits = here >>> 24 here_op = (here >>> 16) & 0xff here_val = here & 0xffff if ((here_bits) <= bits) { break } // --- PULLBYTE() ---// if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 // ---// } if (here_val < 16) { // --- DROPBITS(here.bits) ---// hold >>>= here_bits bits -= here_bits // ---// state.lens[state.have++] = here_val } else { if (here_val === 16) { //= == NEEDBITS(here.bits + 2); n = here_bits + 2 while (bits < n) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// // --- DROPBITS(here.bits) ---// hold >>>= here_bits bits -= here_bits // ---// if (state.have === 0) { strm.msg = 'invalid bit length repeat' state.mode = BAD break } len = state.lens[state.have - 1] copy = 3 + (hold & 0x03)// BITS(2); // --- DROPBITS(2) ---// hold >>>= 2 bits -= 2 // ---// } else if (here_val === 17) { //= == NEEDBITS(here.bits + 3); n = here_bits + 3 while (bits < n) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// // --- DROPBITS(here.bits) ---// hold >>>= here_bits bits -= here_bits // ---// len = 0 copy = 3 + (hold & 0x07)// BITS(3); // --- DROPBITS(3) ---// hold >>>= 3 bits -= 3 // ---// } else { //= == NEEDBITS(here.bits + 7); n = here_bits + 7 while (bits < n) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// // --- DROPBITS(here.bits) ---// hold >>>= here_bits bits -= here_bits // ---// len = 0 copy = 11 + (hold & 0x7f)// BITS(7); // --- DROPBITS(7) ---// hold >>>= 7 bits -= 7 // ---// } if (state.have + copy > state.nlen + state.ndist) { strm.msg = 'invalid bit length repeat' state.mode = BAD break } while (copy--) { state.lens[state.have++] = len } } } /* handle error breaks in while */ if (state.mode === BAD) { break } /* check for end-of-block code (better have one) */ if (state.lens[256] === 0) { strm.msg = 'invalid code -- missing end-of-block' state.mode = BAD break } /* build code tables -- note: do not change the lenbits or distbits values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ state.lenbits = 9 opts = { bits: state.lenbits } ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts) // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.lenbits = opts.bits // state.lencode = state.next; if (ret) { strm.msg = 'invalid literal/lengths set' state.mode = BAD break } state.distbits = 6 // state.distcode.copy(state.codes); // Switch to use dynamic table state.distcode = state.distdyn opts = { bits: state.distbits } ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts) // We have separate tables & no pointers. 2 commented lines below not needed. // state.next_index = opts.table_index; state.distbits = opts.bits // state.distcode = state.next; if (ret) { strm.msg = 'invalid distances set' state.mode = BAD break } // Tracev((stderr, 'inflate: codes ok\n')); state.mode = LEN_ if (flush === Z_TREES) { break inf_leave } /* falls through */ case LEN_: state.mode = LEN /* falls through */ case LEN: if (have >= 6 && left >= 258) { // --- RESTORE() --- strm.next_out = put strm.avail_out = left strm.next_in = next strm.avail_in = have state.hold = hold state.bits = bits // --- inflate_fast(strm, _out) // --- LOAD() --- put = strm.next_out output = strm.output left = strm.avail_out next = strm.next_in input = strm.input have = strm.avail_in hold = state.hold bits = state.bits // --- if (state.mode === TYPE) { state.back = -1 } break } state.back = 0 for (;;) { here = state.lencode[hold & ((1 << state.lenbits) - 1)] /* BITS(state.lenbits) */ here_bits = here >>> 24 here_op = (here >>> 16) & 0xff here_val = here & 0xffff if (here_bits <= bits) { break } // --- PULLBYTE() ---// if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 // ---// } if (here_op && (here_op & 0xf0) === 0) { last_bits = here_bits last_op = here_op last_val = here_val for (;;) { here = state.lencode[last_val + ((hold & ((1 << (last_bits + last_op)) - 1))/* BITS(last.bits + last.op) */ >> last_bits)] here_bits = here >>> 24 here_op = (here >>> 16) & 0xff here_val = here & 0xffff if ((last_bits + here_bits) <= bits) { break } // --- PULLBYTE() ---// if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 // ---// } // --- DROPBITS(last.bits) ---// hold >>>= last_bits bits -= last_bits // ---// state.back += last_bits } // --- DROPBITS(here.bits) ---// hold >>>= here_bits bits -= here_bits // ---// state.back += here_bits state.length = here_val if (here_op === 0) { // Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? // "inflate: literal '%c'\n" : // "inflate: literal 0x%02x\n", here.val)); state.mode = LIT break } if (here_op & 32) { // Tracevv((stderr, "inflate: end of block\n")); state.back = -1 state.mode = TYPE break } if (here_op & 64) { strm.msg = 'invalid literal/length code' state.mode = BAD break } state.extra = here_op & 15 state.mode = LENEXT /* falls through */ case LENEXT: if (state.extra) { //= == NEEDBITS(state.extra); n = state.extra while (bits < n) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.length += hold & ((1 << state.extra) - 1)/* BITS(state.extra) */ // --- DROPBITS(state.extra) ---// hold >>>= state.extra bits -= state.extra // ---// state.back += state.extra } // Tracevv((stderr, "inflate: length %u\n", state.length)); state.was = state.length state.mode = DIST /* falls through */ case DIST: for (;;) { here = state.distcode[hold & ((1 << state.distbits) - 1)]/* BITS(state.distbits) */ here_bits = here >>> 24 here_op = (here >>> 16) & 0xff here_val = here & 0xffff if ((here_bits) <= bits) { break } // --- PULLBYTE() ---// if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 // ---// } if ((here_op & 0xf0) === 0) { last_bits = here_bits last_op = here_op last_val = here_val for (;;) { here = state.distcode[last_val + ((hold & ((1 << (last_bits + last_op)) - 1))/* BITS(last.bits + last.op) */ >> last_bits)] here_bits = here >>> 24 here_op = (here >>> 16) & 0xff here_val = here & 0xffff if ((last_bits + here_bits) <= bits) { break } // --- PULLBYTE() ---// if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 // ---// } // --- DROPBITS(last.bits) ---// hold >>>= last_bits bits -= last_bits // ---// state.back += last_bits } // --- DROPBITS(here.bits) ---// hold >>>= here_bits bits -= here_bits // ---// state.back += here_bits if (here_op & 64) { strm.msg = 'invalid distance code' state.mode = BAD break } state.offset = here_val state.extra = (here_op) & 15 state.mode = DISTEXT /* falls through */ case DISTEXT: if (state.extra) { //= == NEEDBITS(state.extra); n = state.extra while (bits < n) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// state.offset += hold & ((1 << state.extra) - 1)/* BITS(state.extra) */ // --- DROPBITS(state.extra) ---// hold >>>= state.extra bits -= state.extra // ---// state.back += state.extra } // #ifdef INFLATE_STRICT if (state.offset > state.dmax) { strm.msg = 'invalid distance too far back' state.mode = BAD break } // #endif // Tracevv((stderr, "inflate: distance %u\n", state.offset)); state.mode = MATCH /* falls through */ case MATCH: if (left === 0) { break inf_leave } copy = _out - left if (state.offset > copy) { /* copy from window */ copy = state.offset - copy if (copy > state.whave) { if (state.sane) { strm.msg = 'invalid distance too far back' state.mode = BAD break } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility // #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR // Trace((stderr, "inflate.c too far\n")); // copy -= state.whave; // if (copy > state.length) { copy = state.length; } // if (copy > left) { copy = left; } // left -= copy; // state.length -= copy; // do { // output[put++] = 0; // } while (--copy); // if (state.length === 0) { state.mode = LEN; } // break; // #endif } if (copy > state.wnext) { copy -= state.wnext from = state.wsize - copy } else { from = state.wnext - copy } if (copy > state.length) { copy = state.length } from_source = state.window } else { /* copy from output */ from_source = output from = put - state.offset copy = state.length } if (copy > left) { copy = left } left -= copy state.length -= copy do { output[put++] = from_source[from++] } while (--copy) if (state.length === 0) { state.mode = LEN } break case LIT: if (left === 0) { break inf_leave } output[put++] = state.length left-- state.mode = LEN break case CHECK: if (state.wrap) { //= == NEEDBITS(32); while (bits < 32) { if (have === 0) { break inf_leave } have-- // Use '|' instead of '+' to make sure that result is signed hold |= input[next++] << bits bits += 8 } //= ==// _out -= left strm.total_out += _out state.total += _out if (_out) { strm.adler = state.check = /* UPDATE(state.check, put - _out, _out); */ (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out)) } _out = left // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too if ((state.flags ? hold : zswap32(hold)) !== state.check) { strm.msg = 'incorrect data check' state.mode = BAD break } //= == INITBITS(); hold = 0 bits = 0 //= ==// // Tracev((stderr, "inflate: check matches trailer\n")); } state.mode = LENGTH /* falls through */ case LENGTH: if (state.wrap && state.flags) { //= == NEEDBITS(32); while (bits < 32) { if (have === 0) { break inf_leave } have-- hold += input[next++] << bits bits += 8 } //= ==// if (hold !== (state.total & 0xffffffff)) { strm.msg = 'incorrect length check' state.mode = BAD break } //= == INITBITS(); hold = 0 bits = 0 //= ==// // Tracev((stderr, "inflate: length matches trailer\n")); } state.mode = DONE /* falls through */ case DONE: ret = Z_STREAM_END break inf_leave case BAD: ret = Z_DATA_ERROR break inf_leave case MEM: return Z_MEM_ERROR case SYNC: /* falls through */ default: return Z_STREAM_ERROR } } // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave" /* Return from inflate(), updating the total counts and the check value. If there was no progress during the inflate() call, return a buffer error. Call updatewindow() to create and/or update the window state. Note: a memory error from inflate() is non-recoverable. */ // --- RESTORE() --- strm.next_out = put strm.avail_out = left strm.next_in = next strm.avail_in = have state.hold = hold state.bits = bits // --- if (state.wsize || (_out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH))) { if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { state.mode = MEM return Z_MEM_ERROR } } _in -= strm.avail_in _out -= strm.avail_out strm.total_in += _in strm.total_out += _out state.total += _out if (state.wrap && _out) { strm.adler = state.check = /* UPDATE(state.check, strm.next_out - _out, _out); */ (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out)) } strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0) if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) { ret = Z_BUF_ERROR } return ret } function inflateEnd (strm) { if (!strm || !strm.state /* || strm->zfree == (free_func)0 */) { return Z_STREAM_ERROR } const state = strm.state if (state.window) { state.window = null } strm.state = null return Z_OK } function inflateGetHeader (strm, head) { let state /* check state */ if (!strm || !strm.state) { return Z_STREAM_ERROR } state = strm.state if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR } /* save header structure */ state.head = head head.done = false return Z_OK } function inflateSetDictionary (strm, dictionary) { const dictLength = dictionary.length let state let dictid let ret /* check state */ if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR } state = strm.state if (state.wrap !== 0 && state.mode !== DICT) { return Z_STREAM_ERROR } /* check for correct dictionary identifier */ if (state.mode === DICT) { dictid = 1 /* adler32(0, null, 0) */ /* dictid = adler32(dictid, dictionary, dictLength); */ dictid = adler32(dictid, dictionary, dictLength, 0) if (dictid !== state.check) { return Z_DATA_ERROR } } /* copy dictionary to window using updatewindow(), which will amend the existing dictionary if appropriate */ ret = updatewindow(strm, dictionary, dictLength, dictLength) if (ret) { state.mode = MEM return Z_MEM_ERROR } state.havedict = 1 // Tracev((stderr, "inflate: dictionary set\n")); return Z_OK } exports.inflateReset = inflateReset exports.inflateReset2 = inflateReset2 exports.inflateResetKeep = inflateResetKeep exports.inflateInit = inflateInit exports.inflateInit2 = inflateInit2 exports.inflate = inflate exports.inflateEnd = inflateEnd exports.inflateGetHeader = inflateGetHeader exports.inflateSetDictionary = inflateSetDictionary exports.inflateInfo = 'pako inflate (from Nodeca project)' /* Not implemented exports.inflateCopy = inflateCopy; exports.inflateGetDictionary = inflateGetDictionary; exports.inflateMark = inflateMark; exports.inflatePrime = inflatePrime; exports.inflateSync = inflateSync; exports.inflateSyncPoint = inflateSyncPoint; exports.inflateUndermine = inflateUndermine; */ /***/ }, /***/ 1375: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. const utils = __webpack_require__(6907) const MAXBITS = 15 const ENOUGH_LENS = 852 const ENOUGH_DISTS = 592 // var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS); const CODES = 0 const LENS = 1 const DISTS = 2 const lbase = [ /* Length codes 257..285 base */ 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, 0, 0 ] const lext = [ /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78 ] const dbase = [ /* Distance codes 0..29 base */ 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, 0, 0 ] const dext = [ /* Distance codes 0..29 extra */ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64 ] module.exports = function inflate_table (type, lens, lens_index, codes, table, table_index, work, opts) { const bits = opts.bits // here = opts.here; /* table entry for duplication */ let len = 0 /* a code's length in bits */ let sym = 0 /* index of code symbols */ let min = 0; let max = 0 /* minimum and maximum code lengths */ let root = 0 /* number of index bits for root table */ let curr = 0 /* number of index bits for current table */ let drop = 0 /* code bits to drop for sub-table */ let left = 0 /* number of prefix codes available */ let used = 0 /* code entries in table used */ let huff = 0 /* Huffman code */ let incr /* for incrementing code, index */ let fill /* index for replicating entries */ let low /* low bits for current root entry */ let mask /* mask for low root bits */ let next /* next available space in table */ let base = null /* base value table to use */ let base_index = 0 // var shoextra; /* extra bits table to use */ let end /* use base and extra for symbol > end */ const count = new utils.Buf16(MAXBITS + 1) // [MAXBITS+1]; /* number of codes of each length */ const offs = new utils.Buf16(MAXBITS + 1) // [MAXBITS+1]; /* offsets in table for each length */ let extra = null let extra_index = 0 let here_bits, here_op, here_val /* Process a set of code lengths to create a canonical Huffman code. The code lengths are lens[0..codes-1]. Each length corresponds to the symbols 0..codes-1. The Huffman code is generated by first sorting the symbols by length from short to long, and retaining the symbol order for codes with equal lengths. Then the code starts with all zero bits for the first code of the shortest length, and the codes are integer increments for the same length, and zeros are appended as the length increases. For the deflate format, these bits are stored backwards from their more natural integer increment ordering, and so when the decoding tables are built in the large loop below, the integer codes are incremented backwards. This routine assumes, but does not check, that all of the entries in lens[] are in the range 0..MAXBITS. The caller must assure this. 1..MAXBITS is interpreted as that code length. zero means that that symbol does not occur in this code. The codes are sorted by computing a count of codes for each length, creating from that a table of starting indices for each length in the sorted table, and then entering the symbols in order in the sorted table. The sorted table is work[], with that space being provided by the caller. The length counts are used for other purposes as well, i.e. finding the minimum and maximum length codes, determining if there are any codes at all, checking for a valid set of lengths, and looking ahead at length counts to determine sub-table sizes when building the decoding tables. */ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ for (len = 0; len <= MAXBITS; len++) { count[len] = 0 } for (sym = 0; sym < codes; sym++) { count[lens[lens_index + sym]]++ } /* bound code lengths, force root to be within code lengths */ root = bits for (max = MAXBITS; max >= 1; max--) { if (count[max] !== 0) { break } } if (root > max) { root = max } if (max === 0) { /* no symbols to code at all */ // table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */ // table.bits[opts.table_index] = 1; //here.bits = (var char)1; // table.val[opts.table_index++] = 0; //here.val = (var short)0; table[table_index++] = (1 << 24) | (64 << 16) | 0 // table.op[opts.table_index] = 64; // table.bits[opts.table_index] = 1; // table.val[opts.table_index++] = 0; table[table_index++] = (1 << 24) | (64 << 16) | 0 opts.bits = 1 return 0 /* no symbols, but wait for decoding to report error */ } for (min = 1; min < max; min++) { if (count[min] !== 0) { break } } if (root < min) { root = min } /* check for an over-subscribed or incomplete set of lengths */ left = 1 for (len = 1; len <= MAXBITS; len++) { left <<= 1 left -= count[len] if (left < 0) { return -1 } /* over-subscribed */ } if (left > 0 && (type === CODES || max !== 1)) { return -1 /* incomplete set */ } /* generate offsets into symbol table for each length for sorting */ offs[1] = 0 for (len = 1; len < MAXBITS; len++) { offs[len + 1] = offs[len] + count[len] } /* sort symbols by length, by symbol order within each length */ for (sym = 0; sym < codes; sym++) { if (lens[lens_index + sym] !== 0) { work[offs[lens[lens_index + sym]]++] = sym } } /* Create and fill in decoding tables. In this loop, the table being filled is at next and has curr index bits. The code being used is huff with length len. That code is converted to an index by dropping drop bits off of the bottom. For codes where len is less than drop + curr, those top drop + curr - len bits are incremented through all values to fill the table with replicated entries. root is the number of index bits for the root table. When len exceeds root, sub-tables are created pointed to by the root entry with an index of the low root bits of huff. This is saved in low to check for when a new sub-table should be started. drop is zero when the root table is being filled, and drop is root when sub-tables are being filled. When a new sub-table is needed, it is necessary to look ahead in the code lengths to determine what size sub-table is needed. The length counts are used for this, and so count[] is decremented as codes are entered in the tables. used keeps track of how many table entries have been allocated from the provided *table space. It is checked for LENS and DIST tables against the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in the initial root table size constants. See the comments in inftrees.h for more information. sym increments through all symbols, and the loop terminates when all codes of length max, i.e. all codes, have been processed. This routine permits incomplete codes, so another loop after this one fills in the rest of the decoding tables with invalid code markers. */ /* set up for code type */ // poor man optimization - use if-else instead of switch, // to avoid deopts in old v8 if (type === CODES) { base = extra = work /* dummy value--not used */ end = 19 } else if (type === LENS) { base = lbase base_index -= 257 extra = lext extra_index -= 257 end = 256 } else { /* DISTS */ base = dbase extra = dext end = -1 } /* initialize opts for loop */ huff = 0 /* starting code */ sym = 0 /* starting code symbol */ len = min /* starting code length */ next = table_index /* current table to fill in */ curr = root /* current table index bits */ drop = 0 /* current bits to drop from code for index */ low = -1 /* trigger new sub-table when len > root */ used = 1 << root /* use root table entries */ mask = used - 1 /* mask for comparing low */ /* check available table space */ if ((type === LENS && used > ENOUGH_LENS) || (type === DISTS && used > ENOUGH_DISTS)) { return 1 } /* process all codes and make table entries */ for (;;) { /* create table entry */ here_bits = len - drop if (work[sym] < end) { here_op = 0 here_val = work[sym] } else if (work[sym] > end) { here_op = extra[extra_index + work[sym]] here_val = base[base_index + work[sym]] } else { here_op = 32 + 64 /* end of block */ here_val = 0 } /* replicate for those indices with low len bits equal to huff */ incr = 1 << (len - drop) fill = 1 << curr min = fill /* save offset to next table */ do { fill -= incr table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val | 0 } while (fill !== 0) /* backwards increment the len-bit code huff */ incr = 1 << (len - 1) while (huff & incr) { incr >>= 1 } if (incr !== 0) { huff &= incr - 1 huff += incr } else { huff = 0 } /* go to next symbol, update count, len */ sym++ if (--count[len] === 0) { if (len === max) { break } len = lens[lens_index + work[sym]] } /* create new sub-table if needed */ if (len > root && (huff & mask) !== low) { /* if first time, transition to sub-tables */ if (drop === 0) { drop = root } /* increment past last table */ next += min /* here min is 1 << curr */ /* determine length of next table */ curr = len - drop left = 1 << curr while (curr + drop < max) { left -= count[curr + drop] if (left <= 0) { break } curr++ left <<= 1 } /* check for enough space */ used += 1 << curr if ((type === LENS && used > ENOUGH_LENS) || (type === DISTS && used > ENOUGH_DISTS)) { return 1 } /* point entry in root table to sub-table */ low = huff & mask /* table.op[low] = curr; table.bits[low] = root; table.val[low] = next - opts.table_index; */ table[low] = (root << 24) | (curr << 16) | (next - table_index) | 0 } } /* fill in remaining table entry if code is incomplete (guaranteed to have at most one remaining entry, since if the code is incomplete, the maximum code length that was allowed to get this far is one bit) */ if (huff !== 0) { // table.op[next + huff] = 64; /* invalid code marker */ // table.bits[next + huff] = len - drop; // table.val[next + huff] = 0; table[next + huff] = ((len - drop) << 24) | (64 << 16) | 0 } /* set return parameters */ // opts.table_index += used; opts.bits = root return 0 } /***/ }, /***/ 9364: /***/ function (module) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. module.exports = { 2: 'need dictionary', /* Z_NEED_DICT 2 */ 1: 'stream end', /* Z_STREAM_END 1 */ 0: '', /* Z_OK 0 */ '-1': 'file error', /* Z_ERRNO (-1) */ '-2': 'stream error', /* Z_STREAM_ERROR (-2) */ '-3': 'data error', /* Z_DATA_ERROR (-3) */ '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */ '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ } /***/ }, /***/ 1339: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. /* eslint-disable space-unary-ops */ const utils = __webpack_require__(6907) /* Public constants ========================================================== */ /* =========================================================================== */ // var Z_FILTERED = 1; // var Z_HUFFMAN_ONLY = 2; // var Z_RLE = 3; const Z_FIXED = 4 // var Z_DEFAULT_STRATEGY = 0; /* Possible values of the data_type field (though see inflate()) */ const Z_BINARY = 0 const Z_TEXT = 1 // var Z_ASCII = 1; // = Z_TEXT const Z_UNKNOWN = 2 /* ============================================================================ */ function zero (buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0 } } // From zutil.h const STORED_BLOCK = 0 const STATIC_TREES = 1 const DYN_TREES = 2 /* The three kinds of block type */ const MIN_MATCH = 3 const MAX_MATCH = 258 /* The minimum and maximum match lengths */ // From deflate.h /* =========================================================================== * Internal compression state. */ const LENGTH_CODES = 29 /* number of length codes, not counting the special END_BLOCK code */ const LITERALS = 256 /* number of literal bytes 0..255 */ const L_CODES = LITERALS + 1 + LENGTH_CODES /* number of Literal or Length codes, including the END_BLOCK code */ const D_CODES = 30 /* number of distance codes */ const BL_CODES = 19 /* number of codes used to transfer the bit lengths */ const HEAP_SIZE = 2 * L_CODES + 1 /* maximum heap size */ const MAX_BITS = 15 /* All codes must not exceed MAX_BITS bits */ const Buf_size = 16 /* size of bit buffer in bi_buf */ /* =========================================================================== * Constants */ const MAX_BL_BITS = 7 /* Bit length codes must not exceed MAX_BL_BITS bits */ const END_BLOCK = 256 /* end of block literal code */ const REP_3_6 = 16 /* repeat previous bit length 3-6 times (2 bits of repeat count) */ const REPZ_3_10 = 17 /* repeat a zero length 3-10 times (3 bits of repeat count) */ const REPZ_11_138 = 18 /* repeat a zero length 11-138 times (7 bits of repeat count) */ /* eslint-disable comma-spacing,array-bracket-spacing */ const extra_lbits = /* extra bits for each length code */ [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] const extra_dbits = /* extra bits for each distance code */ [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] const extra_blbits = /* extra bits for each bit length code */ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7] const bl_order = [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15] /* eslint-enable comma-spacing,array-bracket-spacing */ /* The lengths of the bit length codes are sent in order of decreasing * probability, to avoid transmitting the lengths for unused bit length codes. */ /* =========================================================================== * Local data. These are initialized only once. */ // We pre-fill arrays with 0 to avoid uninitialized gaps const DIST_CODE_LEN = 512 /* see definition of array dist_code below */ // !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1 const static_ltree = new Array((L_CODES + 2) * 2) zero(static_ltree) /* The static literal tree. Since the bit lengths are imposed, there is no * need for the L_CODES extra codes used during heap construction. However * The codes 286 and 287 are needed to build a canonical tree (see _tr_init * below). */ const static_dtree = new Array(D_CODES * 2) zero(static_dtree) /* The static distance tree. (Actually a trivial tree since all codes use * 5 bits.) */ const _dist_code = new Array(DIST_CODE_LEN) zero(_dist_code) /* Distance codes. The first 256 values correspond to the distances * 3 .. 258, the last 256 values correspond to the top 8 bits of * the 15 bit distances. */ const _length_code = new Array(MAX_MATCH - MIN_MATCH + 1) zero(_length_code) /* length code for each normalized match length (0 == MIN_MATCH) */ const base_length = new Array(LENGTH_CODES) zero(base_length) /* First normalized length for each code (0 = MIN_MATCH) */ const base_dist = new Array(D_CODES) zero(base_dist) /* First normalized distance for each code (0 = distance of 1) */ function StaticTreeDesc (static_tree, extra_bits, extra_base, elems, max_length) { this.static_tree = static_tree /* static tree or NULL */ this.extra_bits = extra_bits /* extra bits for each code or NULL */ this.extra_base = extra_base /* base index for extra_bits */ this.elems = elems /* max number of elements in the tree */ this.max_length = max_length /* max bit length for the codes */ // show if `static_tree` has data or dummy - needed for monomorphic objects this.has_stree = static_tree && static_tree.length } let static_l_desc let static_d_desc let static_bl_desc function TreeDesc (dyn_tree, stat_desc) { this.dyn_tree = dyn_tree /* the dynamic tree */ this.max_code = 0 /* largest code with non zero frequency */ this.stat_desc = stat_desc /* the corresponding static tree */ } function d_code (dist) { return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)] } /* =========================================================================== * Output a short LSB first on the stream. * IN assertion: there is enough room in pendingBuf. */ function put_short (s, w) { // put_byte(s, (uch)((w) & 0xff)); // put_byte(s, (uch)((ush)(w) >> 8)); s.pending_buf[s.pending++] = (w) & 0xff s.pending_buf[s.pending++] = (w >>> 8) & 0xff } /* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ function send_bits (s, value, length) { if (s.bi_valid > (Buf_size - length)) { s.bi_buf |= (value << s.bi_valid) & 0xffff put_short(s, s.bi_buf) s.bi_buf = value >> (Buf_size - s.bi_valid) s.bi_valid += length - Buf_size } else { s.bi_buf |= (value << s.bi_valid) & 0xffff s.bi_valid += length } } function send_code (s, c, tree) { send_bits(s, tree[c * 2]/* .Code */, tree[c * 2 + 1]/* .Len */) } /* =========================================================================== * Reverse the first len bits of a code, using straightforward code (a faster * method would use a table) * IN assertion: 1 <= len <= 15 */ function bi_reverse (code, len) { let res = 0 do { res |= code & 1 code >>>= 1 res <<= 1 } while (--len > 0) return res >>> 1 } /* =========================================================================== * Flush the bit buffer, keeping at most 7 bits in it. */ function bi_flush (s) { if (s.bi_valid === 16) { put_short(s, s.bi_buf) s.bi_buf = 0 s.bi_valid = 0 } else if (s.bi_valid >= 8) { s.pending_buf[s.pending++] = s.bi_buf & 0xff s.bi_buf >>= 8 s.bi_valid -= 8 } } /* =========================================================================== * Compute the optimal bit lengths for a tree and update the total bit length * for the current block. * IN assertion: the fields freq and dad are set, heap[heap_max] and * above are the tree nodes sorted by increasing frequency. * OUT assertions: the field len is set to the optimal bit length, the * array bl_count contains the frequencies for each bit length. * The length opt_len is updated; static_len is also updated if stree is * not null. */ function gen_bitlen (s, desc) // deflate_state *s; // tree_desc *desc; /* the tree descriptor */ { const tree = desc.dyn_tree const max_code = desc.max_code const stree = desc.stat_desc.static_tree const has_stree = desc.stat_desc.has_stree const extra = desc.stat_desc.extra_bits const base = desc.stat_desc.extra_base const max_length = desc.stat_desc.max_length let h /* heap index */ let n, m /* iterate over the tree elements */ let bits /* bit length */ let xbits /* extra bits */ let f /* frequency */ let overflow = 0 /* number of elements with bit length too large */ for (bits = 0; bits <= MAX_BITS; bits++) { s.bl_count[bits] = 0 } /* In a first pass, compute the optimal bit lengths (which may * overflow in the case of the bit length tree). */ tree[s.heap[s.heap_max] * 2 + 1]/* .Len */ = 0 /* root of the heap */ for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { n = s.heap[h] bits = tree[tree[n * 2 + 1]/* .Dad */ * 2 + 1]/* .Len */ + 1 if (bits > max_length) { bits = max_length overflow++ } tree[n * 2 + 1]/* .Len */ = bits /* We overwrite tree[n].Dad which is no longer needed */ if (n > max_code) { continue } /* not a leaf node */ s.bl_count[bits]++ xbits = 0 if (n >= base) { xbits = extra[n - base] } f = tree[n * 2]/* .Freq */ s.opt_len += f * (bits + xbits) if (has_stree) { s.static_len += f * (stree[n * 2 + 1]/* .Len */ + xbits) } } if (overflow === 0) { return } // Trace((stderr,"\nbit length overflow\n")); /* This happens for example on obj2 and pic of the Calgary corpus */ /* Find the first bit length which could increase: */ do { bits = max_length - 1 while (s.bl_count[bits] === 0) { bits-- } s.bl_count[bits]-- /* move one leaf down the tree */ s.bl_count[bits + 1] += 2 /* move one overflow item as its brother */ s.bl_count[max_length]-- /* The brother of the overflow item also moves one step up, * but this does not affect bl_count[max_length] */ overflow -= 2 } while (overflow > 0) /* Now recompute all bit lengths, scanning in increasing frequency. * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all * lengths instead of fixing only the wrong ones. This idea is taken * from 'ar' written by Haruhiko Okumura.) */ for (bits = max_length; bits !== 0; bits--) { n = s.bl_count[bits] while (n !== 0) { m = s.heap[--h] if (m > max_code) { continue } if (tree[m * 2 + 1]/* .Len */ !== bits) { // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s.opt_len += (bits - tree[m * 2 + 1]/* .Len */) * tree[m * 2]/* .Freq */ tree[m * 2 + 1]/* .Len */ = bits } n-- } } } /* =========================================================================== * Generate the codes for a given tree and bit counts (which need not be * optimal). * IN assertion: the array bl_count contains the bit length statistics for * the given tree and the field len is set for all tree elements. * OUT assertion: the field code is set for all tree elements of non * zero code length. */ function gen_codes (tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */ // int max_code; /* largest code with non zero frequency */ // ushf *bl_count; /* number of codes at each bit length */ { const next_code = new Array(MAX_BITS + 1) /* next code value for each bit length */ let code = 0 /* running code value */ let bits /* bit index */ let n /* code index */ /* The distribution counts are first used to generate the code values * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { next_code[bits] = code = (code + bl_count[bits - 1]) << 1 } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. */ // Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */ length = 0 for (code = 0; code < LENGTH_CODES - 1; code++) { base_length[code] = length for (n = 0; n < (1 << extra_lbits[code]); n++) { _length_code[length++] = code } } // Assert (length == 256, "tr_static_init: length != 256"); /* Note that the length 255 (match length 258) can be represented * in two different ways: code 284 + 5 bits or code 285, so we * overwrite length_code[255] to use the best encoding: */ _length_code[length - 1] = code /* Initialize the mapping dist (0..32K) -> dist code (0..29) */ dist = 0 for (code = 0; code < 16; code++) { base_dist[code] = dist for (n = 0; n < (1 << extra_dbits[code]); n++) { _dist_code[dist++] = code } } // Assert (dist == 256, "tr_static_init: dist != 256"); dist >>= 7 /* from now on, all distances are divided by 128 */ for (; code < D_CODES; code++) { base_dist[code] = dist << 7 for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) { _dist_code[256 + dist++] = code } } // Assert (dist == 256, "tr_static_init: 256+dist != 512"); /* Construct the codes of the static literal tree */ for (bits = 0; bits <= MAX_BITS; bits++) { bl_count[bits] = 0 } n = 0 while (n <= 143) { static_ltree[n * 2 + 1]/* .Len */ = 8 n++ bl_count[8]++ } while (n <= 255) { static_ltree[n * 2 + 1]/* .Len */ = 9 n++ bl_count[9]++ } while (n <= 279) { static_ltree[n * 2 + 1]/* .Len */ = 7 n++ bl_count[7]++ } while (n <= 287) { static_ltree[n * 2 + 1]/* .Len */ = 8 n++ bl_count[8]++ } /* Codes 286 and 287 do not exist, but we must include them in the * tree construction to get a canonical Huffman tree (longest code * all ones) */ gen_codes(static_ltree, L_CODES + 1, bl_count) /* The static distance tree is trivial: */ for (n = 0; n < D_CODES; n++) { static_dtree[n * 2 + 1]/* .Len */ = 5 static_dtree[n * 2]/* .Code */ = bi_reverse(n, 5) } // Now data ready and we can init static trees static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS) static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS) static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS) // static_init_done = true; } /* =========================================================================== * Initialize a new block. */ function init_block (s) { let n /* iterates over tree elements */ /* Initialize the trees. */ for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/* .Freq */ = 0 } for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/* .Freq */ = 0 } for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/* .Freq */ = 0 } s.dyn_ltree[END_BLOCK * 2]/* .Freq */ = 1 s.opt_len = s.static_len = 0 s.last_lit = s.matches = 0 } /* =========================================================================== * Flush the bit buffer and align the output on a byte boundary */ function bi_windup (s) { if (s.bi_valid > 8) { put_short(s, s.bi_buf) } else if (s.bi_valid > 0) { // put_byte(s, (Byte)s->bi_buf); s.pending_buf[s.pending++] = s.bi_buf } s.bi_buf = 0 s.bi_valid = 0 } /* =========================================================================== * Copy a stored block, storing first the length and its * one's complement if requested. */ function copy_block (s, buf, len, header) // DeflateState *s; // charf *buf; /* the input data */ // unsigned len; /* its length */ // int header; /* true if block header must be written */ { bi_windup(s) /* align on byte boundary */ if (header) { put_short(s, len) put_short(s, ~len) } // while (len--) { // put_byte(s, *buf++); // } utils.arraySet(s.pending_buf, s.window, buf, len, s.pending) s.pending += len } /* =========================================================================== * Compares to subtrees, using the tree depth as tie breaker when * the subtrees have equal frequency. This minimizes the worst case length. */ function smaller (tree, n, m, depth) { const _n2 = n * 2 const _m2 = m * 2 return (tree[_n2]/* .Freq */ < tree[_m2]/* .Freq */ || (tree[_n2]/* .Freq */ === tree[_m2]/* .Freq */ && depth[n] <= depth[m])) } /* =========================================================================== * Restore the heap property by moving down the tree starting at node k, * exchanging a node with the smallest of its two sons if necessary, stopping * when the heap property is re-established (each father smaller than its * two sons). */ function pqdownheap (s, tree, k) // deflate_state *s; // ct_data *tree; /* the tree to restore */ // int k; /* node to move down */ { const v = s.heap[k] let j = k << 1 /* left son of k */ while (j <= s.heap_len) { /* Set j to the smallest of the two sons: */ if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { j++ } /* Exit if v is smaller than both sons */ if (smaller(tree, v, s.heap[j], s.depth)) { break } /* Exchange v with the smallest son */ s.heap[k] = s.heap[j] k = j /* And continue down the tree, setting j to the left son of k */ j <<= 1 } s.heap[k] = v } // inlined manually // var SMALLEST = 1; /* =========================================================================== * Send the block data compressed using the given Huffman trees */ function compress_block (s, ltree, dtree) // deflate_state *s; // const ct_data *ltree; /* literal tree */ // const ct_data *dtree; /* distance tree */ { let dist /* distance of matched string */ let lc /* match length or unmatched char (if dist == 0) */ let lx = 0 /* running index in l_buf */ let code /* the code to send */ let extra /* number of extra bits to send */ if (s.last_lit !== 0) { do { dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]) lc = s.pending_buf[s.l_buf + lx] lx++ if (dist === 0) { send_code(s, lc, ltree) /* send a literal byte */ // Tracecv(isgraph(lc), (stderr," '%c' ", lc)); } else { /* Here, lc is the match length - MIN_MATCH */ code = _length_code[lc] send_code(s, code + LITERALS + 1, ltree) /* send the length code */ extra = extra_lbits[code] if (extra !== 0) { lc -= base_length[code] send_bits(s, lc, extra) /* send the extra length bits */ } dist-- /* dist is now the match distance - 1 */ code = d_code(dist) // Assert (code < D_CODES, "bad d_code"); send_code(s, code, dtree) /* send the distance code */ extra = extra_dbits[code] if (extra !== 0) { dist -= base_dist[code] send_bits(s, dist, extra) /* send the extra distance bits */ } } /* literal or match pair ? */ /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */ // Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx, // "pendingBuf overflow"); } while (lx < s.last_lit) } send_code(s, END_BLOCK, ltree) } /* =========================================================================== * Construct one Huffman tree and assigns the code bit strings and lengths. * Update the total bit length for the current block. * IN assertion: the field freq is set for all tree elements. * OUT assertions: the fields len and code are set to the optimal bit length * and corresponding code. The length opt_len is updated; static_len is * also updated if stree is not null. The field max_code is set. */ function build_tree (s, desc) // deflate_state *s; // tree_desc *desc; /* the tree descriptor */ { const tree = desc.dyn_tree const stree = desc.stat_desc.static_tree const has_stree = desc.stat_desc.has_stree const elems = desc.stat_desc.elems let n, m /* iterate over heap elements */ let max_code = -1 /* largest code with non zero frequency */ let node /* new node being created */ /* Construct the initial heap, with least frequent element in * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. * heap[0] is not used. */ s.heap_len = 0 s.heap_max = HEAP_SIZE for (n = 0; n < elems; n++) { if (tree[n * 2]/* .Freq */ !== 0) { s.heap[++s.heap_len] = max_code = n s.depth[n] = 0 } else { tree[n * 2 + 1]/* .Len */ = 0 } } /* The pkzip format requires that at least one distance code exists, * and that at least one bit should be sent even if there is only one * possible code. So to avoid special checks later on we force at least * two codes of non zero frequency. */ while (s.heap_len < 2) { node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0) tree[node * 2]/* .Freq */ = 1 s.depth[node] = 0 s.opt_len-- if (has_stree) { s.static_len -= stree[node * 2 + 1]/* .Len */ } /* node is 0 or 1 so it does not have extra bits */ } desc.max_code = max_code /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, * establish sub-heaps of increasing lengths: */ for (n = (s.heap_len >> 1/* int /2 */); n >= 1; n--) { pqdownheap(s, tree, n) } /* Construct the Huffman tree by repeatedly combining the least two * frequent nodes. */ node = elems /* next internal node of the tree */ do { // pqremove(s, tree, n); /* n = node of least frequency */ /** * pqremove ***/ n = s.heap[1/* SMALLEST */] s.heap[1/* SMALLEST */] = s.heap[s.heap_len--] pqdownheap(s, tree, 1/* SMALLEST */) /***/ m = s.heap[1/* SMALLEST */] /* m = node of next least frequency */ s.heap[--s.heap_max] = n /* keep the nodes sorted by frequency */ s.heap[--s.heap_max] = m /* Create a new node father of n and m */ tree[node * 2]/* .Freq */ = tree[n * 2]/* .Freq */ + tree[m * 2]/* .Freq */ s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1 tree[n * 2 + 1]/* .Dad */ = tree[m * 2 + 1]/* .Dad */ = node /* and insert the new node in the heap */ s.heap[1/* SMALLEST */] = node++ pqdownheap(s, tree, 1/* SMALLEST */) } while (s.heap_len >= 2) s.heap[--s.heap_max] = s.heap[1/* SMALLEST */] /* At this point, the fields freq and dad are set. We can now * generate the bit lengths. */ gen_bitlen(s, desc) /* The field len is now set, we can generate the bit codes */ gen_codes(tree, max_code, s.bl_count) } /* =========================================================================== * Scan a literal or distance tree to determine the frequencies of the codes * in the bit length tree. */ function scan_tree (s, tree, max_code) // deflate_state *s; // ct_data *tree; /* the tree to be scanned */ // int max_code; /* and its largest code of non zero frequency */ { let n /* iterates over all tree elements */ let prevlen = -1 /* last emitted length */ let curlen /* length of current code */ let nextlen = tree[0 * 2 + 1]/* .Len */ /* length of next code */ let count = 0 /* repeat count of the current code */ let max_count = 7 /* max repeat count */ let min_count = 4 /* min repeat count */ if (nextlen === 0) { max_count = 138 min_count = 3 } tree[(max_code + 1) * 2 + 1]/* .Len */ = 0xffff /* guard */ for (n = 0; n <= max_code; n++) { curlen = nextlen nextlen = tree[(n + 1) * 2 + 1]/* .Len */ if (++count < max_count && curlen === nextlen) { continue } else if (count < min_count) { s.bl_tree[curlen * 2]/* .Freq */ += count } else if (curlen !== 0) { if (curlen !== prevlen) { s.bl_tree[curlen * 2]/* .Freq */++ } s.bl_tree[REP_3_6 * 2]/* .Freq */++ } else if (count <= 10) { s.bl_tree[REPZ_3_10 * 2]/* .Freq */++ } else { s.bl_tree[REPZ_11_138 * 2]/* .Freq */++ } count = 0 prevlen = curlen if (nextlen === 0) { max_count = 138 min_count = 3 } else if (curlen === nextlen) { max_count = 6 min_count = 3 } else { max_count = 7 min_count = 4 } } } /* =========================================================================== * Send a literal or distance tree in compressed form, using the codes in * bl_tree. */ function send_tree (s, tree, max_code) // deflate_state *s; // ct_data *tree; /* the tree to be scanned */ // int max_code; /* and its largest code of non zero frequency */ { let n /* iterates over all tree elements */ let prevlen = -1 /* last emitted length */ let curlen /* length of current code */ let nextlen = tree[0 * 2 + 1]/* .Len */ /* length of next code */ let count = 0 /* repeat count of the current code */ let max_count = 7 /* max repeat count */ let min_count = 4 /* min repeat count */ /* tree[max_code+1].Len = -1; */ /* guard already set */ if (nextlen === 0) { max_count = 138 min_count = 3 } for (n = 0; n <= max_code; n++) { curlen = nextlen nextlen = tree[(n + 1) * 2 + 1]/* .Len */ if (++count < max_count && curlen === nextlen) { continue } else if (count < min_count) { do { send_code(s, curlen, s.bl_tree) } while (--count !== 0) } else if (curlen !== 0) { if (curlen !== prevlen) { send_code(s, curlen, s.bl_tree) count-- } // Assert(count >= 3 && count <= 6, " 3_6?"); send_code(s, REP_3_6, s.bl_tree) send_bits(s, count - 3, 2) } else if (count <= 10) { send_code(s, REPZ_3_10, s.bl_tree) send_bits(s, count - 3, 3) } else { send_code(s, REPZ_11_138, s.bl_tree) send_bits(s, count - 11, 7) } count = 0 prevlen = curlen if (nextlen === 0) { max_count = 138 min_count = 3 } else if (curlen === nextlen) { max_count = 6 min_count = 3 } else { max_count = 7 min_count = 4 } } } /* =========================================================================== * Construct the Huffman tree for the bit lengths and return the index in * bl_order of the last bit length code to send. */ function build_bl_tree (s) { let max_blindex /* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */ scan_tree(s, s.dyn_ltree, s.l_desc.max_code) scan_tree(s, s.dyn_dtree, s.d_desc.max_code) /* Build the bit length tree: */ build_tree(s, s.bl_desc) /* opt_len now includes the length of the tree representations, except * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. */ /* Determine the number of bit length codes to send. The pkzip format * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/* .Len */ !== 0) { break } } /* Update opt_len to include the bit length tree and counts */ s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4 // Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", // s->opt_len, s->static_len)); return max_blindex } /* =========================================================================== * Send the header for a block using dynamic Huffman trees: the counts, the * lengths of the bit length codes, the literal tree and the distance tree. * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. */ function send_all_trees (s, lcodes, dcodes, blcodes) // deflate_state *s; // int lcodes, dcodes, blcodes; /* number of codes for each tree */ { let rank /* index in bl_order */ // Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes"); // Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES, // "too many codes"); // Tracev((stderr, "\nbl counts: ")); send_bits(s, lcodes - 257, 5) /* not +255 as stated in appnote.txt */ send_bits(s, dcodes - 1, 5) send_bits(s, blcodes - 4, 4) /* not -3 as stated in appnote.txt */ for (rank = 0; rank < blcodes; rank++) { // Tracev((stderr, "\nbl code %2d ", bl_order[rank])); send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/* .Len */, 3) } // Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent)); send_tree(s, s.dyn_ltree, lcodes - 1) /* literal tree */ // Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent)); send_tree(s, s.dyn_dtree, dcodes - 1) /* distance tree */ // Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent)); } /* =========================================================================== * Check if the data type is TEXT or BINARY, using the following algorithm: * - TEXT if the two conditions below are satisfied: * a) There are no non-portable control characters belonging to the * "black list" (0..6, 14..25, 28..31). * b) There is at least one printable character belonging to the * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). * - BINARY otherwise. * - The following partially-portable control characters form a * "gray list" that is ignored in this detection algorithm: * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). * IN assertion: the fields Freq of dyn_ltree are set. */ function detect_data_type (s) { /* black_mask is the bit mask of black-listed bytes * set bits 0..6, 14..25, and 28..31 * 0xf3ffc07f = binary 11110011111111111100000001111111 */ let black_mask = 0xf3ffc07f let n /* Check for non-textual ("black-listed") bytes. */ for (n = 0; n <= 31; n++, black_mask >>>= 1) { if ((black_mask & 1) && (s.dyn_ltree[n * 2]/* .Freq */ !== 0)) { return Z_BINARY } } /* Check for textual ("white-listed") bytes. */ if (s.dyn_ltree[9 * 2]/* .Freq */ !== 0 || s.dyn_ltree[10 * 2]/* .Freq */ !== 0 || s.dyn_ltree[13 * 2]/* .Freq */ !== 0) { return Z_TEXT } for (n = 32; n < LITERALS; n++) { if (s.dyn_ltree[n * 2]/* .Freq */ !== 0) { return Z_TEXT } } /* There are no "black-listed" or "white-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ return Z_BINARY } let static_init_done = false /* =========================================================================== * Initialize the tree data structures for a new zlib stream. */ function _tr_init (s) { if (!static_init_done) { tr_static_init() static_init_done = true } s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc) s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc) s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc) s.bi_buf = 0 s.bi_valid = 0 /* Initialize the first block of the first file: */ init_block(s) } /* =========================================================================== * Send a stored block */ function _tr_stored_block (s, buf, stored_len, last) // DeflateState *s; // charf *buf; /* input block */ // ulg stored_len; /* length of input block */ // int last; /* one if this is the last block for a file */ { send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3) /* send block type */ copy_block(s, buf, stored_len, true) /* with header */ } /* =========================================================================== * Send one empty static block to give enough lookahead for inflate. * This takes 10 bits, of which 7 may remain in the bit buffer. */ function _tr_align (s) { send_bits(s, STATIC_TREES << 1, 3) send_code(s, END_BLOCK, static_ltree) bi_flush(s) } /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static * trees or store, and output the encoded block to the zip file. */ function _tr_flush_block (s, buf, stored_len, last) // DeflateState *s; // charf *buf; /* input block, or NULL if too old */ // ulg stored_len; /* length of input block */ // int last; /* one if this is the last block for a file */ { let opt_lenb, static_lenb /* opt_len and static_len in bytes */ let max_blindex = 0 /* index of last bit length code of non zero freq */ /* Build the Huffman trees unless a stored block is forced */ if (s.level > 0) { /* Check if the file is binary or text */ if (s.strm.data_type === Z_UNKNOWN) { s.strm.data_type = detect_data_type(s) } /* Construct the literal and distance trees */ build_tree(s, s.l_desc) // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len, // s->static_len)); build_tree(s, s.d_desc) // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len, // s->static_len)); /* At this point, opt_len and static_len are the total bit lengths of * the compressed block data, excluding the tree representations. */ /* Build the bit length tree for the above two trees, and get the index * in bl_order of the last bit length code to send. */ max_blindex = build_bl_tree(s) /* Determine the best encoding. Compute the block lengths in bytes. */ opt_lenb = (s.opt_len + 3 + 7) >>> 3 static_lenb = (s.static_len + 3 + 7) >>> 3 // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ", // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len, // s->last_lit)); if (static_lenb <= opt_lenb) { opt_lenb = static_lenb } } else { // Assert(buf != (char*)0, "lost buf"); opt_lenb = static_lenb = stored_len + 5 /* force a stored block */ } if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) { /* 4: two words for the lengths */ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. * Otherwise we can't have processed more than WSIZE input bytes since * the last block flush, because compression would have been * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ _tr_stored_block(s, buf, stored_len, last) } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3) compress_block(s, static_ltree, static_dtree) } else { send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3) send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1) compress_block(s, s.dyn_ltree, s.dyn_dtree) } // Assert (s->compressed_len == s->bits_sent, "bad compressed size"); /* The above check is made mod 2^32, for files larger than 512 MB * and uLong implemented on 32 bits. */ init_block(s) if (last) { bi_windup(s) } // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3, // s->compressed_len-7*last)); } /* =========================================================================== * Save the match info and tally the frequency counts. Return true if * the current block must be flushed. */ function _tr_tally (s, dist, lc) // deflate_state *s; // unsigned dist; /* distance of matched string */ // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */ { // var out_length, in_length, dcode; s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff s.last_lit++ if (dist === 0) { /* lc is the unmatched char */ s.dyn_ltree[lc * 2]/* .Freq */++ } else { s.matches++ /* Here, lc is the match length - MIN_MATCH */ dist-- /* dist = match distance - 1 */ // Assert((ush)dist < (ush)MAX_DIST(s) && // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) && // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match"); s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/* .Freq */++ s.dyn_dtree[d_code(dist) * 2]/* .Freq */++ } // (!) This block is disabled in zlib defaults, // don't enable it for binary compatibility // #ifdef TRUNCATE_BLOCK // /* Try to guess if it is profitable to stop the current block here */ // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) { // /* Compute an upper bound for the compressed length */ // out_length = s.last_lit*8; // in_length = s.strstart - s.block_start; // // for (dcode = 0; dcode < D_CODES; dcode++) { // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]); // } // out_length >>>= 3; // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", // // s->last_lit, in_length, out_length, // // 100L - out_length*100L/in_length)); // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) { // return true; // } // } // #endif return (s.last_lit === s.lit_bufsize - 1) /* We avoid equality with lit_bufsize because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. */ } exports._tr_init = _tr_init exports._tr_stored_block = _tr_stored_block exports._tr_flush_block = _tr_flush_block exports._tr_tally = _tr_tally exports._tr_align = _tr_align /***/ }, /***/ 4860: /***/ function (module) { 'use strict' // (C) 1995-2013 Jean-loup Gailly and Mark Adler // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // 3. This notice may not be removed or altered from any source distribution. function ZStream () { /* next input byte */ this.input = null // JS specific, because we have no pointers this.next_in = 0 /* number of bytes available at input */ this.avail_in = 0 /* total number of input bytes read so far */ this.total_in = 0 /* next output byte should be put there */ this.output = null // JS specific, because we have no pointers this.next_out = 0 /* remaining free space at output */ this.avail_out = 0 /* total number of bytes output so far */ this.total_out = 0 /* last error message, NULL if no error */ this.msg = ''/* Z_NULL */ /* not visible by applications */ this.state = null /* best guess about the data type: binary or text */ this.data_type = 2/* Z_UNKNOWN */ /* adler32 value of the uncompressed data */ this.adler = 0 } module.exports = ZStream /***/ }, /***/ 1924: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const GetIntrinsic = __webpack_require__(210) const callBind = __webpack_require__(5559) const $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')) module.exports = function callBoundIntrinsic (name, allowMissing) { const intrinsic = GetIntrinsic(name, !!allowMissing) if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBind(intrinsic) } return intrinsic } /***/ }, /***/ 5559: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const bind = __webpack_require__(8612) const GetIntrinsic = __webpack_require__(210) const $apply = GetIntrinsic('%Function.prototype.apply%') const $call = GetIntrinsic('%Function.prototype.call%') const $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply) const $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true) let $defineProperty = GetIntrinsic('%Object.defineProperty%', true) const $max = GetIntrinsic('%Math.max%') if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }) } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null } } module.exports = function callBind (originalFunction) { const func = $reflectApply(bind, $call, arguments) if ($gOPD && $defineProperty) { const desc = $gOPD(func, 'length') if (desc.configurable) { // original length, plus the receiver, minus any additional arguments (after the receiver) $defineProperty( func, 'length', { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } ) } } return func } const applyBind = function applyBind () { return $reflectApply(bind, $apply, arguments) } if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }) } else { module.exports.apply = applyBind } /***/ }, /***/ 6313: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer const clone = (function () { 'use strict' /** * Clones (copies) an Object using deep copying. * * This function supports circular references by default, but if you are certain * there are no circular references in your object, you can save some CPU time * by calling clone(obj, false). * * Caution: if `circular` is false and `parent` contains circular references, * your program may enter an infinite loop and crash. * * @param `parent` - the object to be cloned * @param `circular` - set to true if the object to be cloned may contain * circular references. (optional - true by default) * @param `depth` - set to a number if the object is only to be cloned to * a particular depth. (optional - defaults to Infinity) * @param `prototype` - sets the prototype to be used when cloning an object. * (optional - defaults to parent prototype). */ function clone (parent, circular, depth, prototype) { let filter if (typeof circular === 'object') { depth = circular.depth prototype = circular.prototype filter = circular.filter circular = circular.circular } // maintain two arrays for circular references, where corresponding parents // and children have the same index const allParents = [] const allChildren = [] const useBuffer = typeof Buffer !== 'undefined' if (typeof circular === 'undefined') { circular = true } if (typeof depth === 'undefined') { depth = Infinity } // recurse this function so we don't reset allParents and allChildren function _clone (parent, depth) { // cloning null always returns null if (parent === null) { return null } if (depth == 0) { return parent } let child let proto if (typeof parent !== 'object') { return parent } if (clone.__isArray(parent)) { child = [] } else if (clone.__isRegExp(parent)) { child = new RegExp(parent.source, __getRegExpFlags(parent)) if (parent.lastIndex) child.lastIndex = parent.lastIndex } else if (clone.__isDate(parent)) { child = new Date(parent.getTime()) } else if (useBuffer && Buffer.isBuffer(parent)) { if (Buffer.allocUnsafe) { // Node.js >= 4.5.0 child = Buffer.allocUnsafe(parent.length) } else { // Older Node.js versions child = new Buffer(parent.length) } parent.copy(child) return child } else { if (typeof prototype === 'undefined') { proto = Object.getPrototypeOf(parent) child = Object.create(proto) } else { child = Object.create(prototype) proto = prototype } } if (circular) { const index = allParents.indexOf(parent) if (index != -1) { return allChildren[index] } allParents.push(parent) allChildren.push(child) } for (const i in parent) { var attrs if (proto) { attrs = Object.getOwnPropertyDescriptor(proto, i) } if (attrs && attrs.set == null) { continue } child[i] = _clone(parent[i], depth - 1) } return child } return _clone(parent, depth) } /** * Simple flat clone using prototype, accepts only objects, usefull for property * override on FLAT configuration object (no nested props). * * USE WITH CAUTION! This may not behave as you wish if you do not know how this * works. */ clone.clonePrototype = function clonePrototype (parent) { if (parent === null) { return null } const c = function () {} c.prototype = parent return new c() } // private utility functions function __objToStr (o) { return Object.prototype.toString.call(o) }; clone.__objToStr = __objToStr function __isDate (o) { return typeof o === 'object' && __objToStr(o) === '[object Date]' }; clone.__isDate = __isDate function __isArray (o) { return typeof o === 'object' && __objToStr(o) === '[object Array]' }; clone.__isArray = __isArray function __isRegExp (o) { return typeof o === 'object' && __objToStr(o) === '[object RegExp]' }; clone.__isRegExp = __isRegExp function __getRegExpFlags (re) { let flags = '' if (re.global) flags += 'g' if (re.ignoreCase) flags += 'i' if (re.multiline) flags += 'm' return flags }; clone.__getRegExpFlags = __getRegExpFlags return clone })() if (true && module.exports) { module.exports = clone } /***/ }, /***/ 4667: /***/ function (module, __unused_webpack_exports, __webpack_require__) { __webpack_require__(2479) const path = __webpack_require__(857) module.exports = path.Object.values /***/ }, /***/ 7633: /***/ function (module, __unused_webpack_exports, __webpack_require__) { __webpack_require__(9170) __webpack_require__(6992) __webpack_require__(1539) __webpack_require__(8674) __webpack_require__(7922) __webpack_require__(4668) __webpack_require__(7727) __webpack_require__(8783) const path = __webpack_require__(857) module.exports = path.Promise /***/ }, /***/ 3867: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const parent = __webpack_require__(1150) __webpack_require__(8628) // TODO: Remove from `core-js@4` __webpack_require__(7314) __webpack_require__(7479) __webpack_require__(6290) module.exports = parent /***/ }, /***/ 9662: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isCallable = __webpack_require__(614) const tryToString = __webpack_require__(6330) const TypeError = global.TypeError // `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument throw TypeError(tryToString(argument) + ' is not a function') } /***/ }, /***/ 9483: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isConstructor = __webpack_require__(4411) const tryToString = __webpack_require__(6330) const TypeError = global.TypeError // `Assert: IsConstructor(argument) is true` module.exports = function (argument) { if (isConstructor(argument)) return argument throw TypeError(tryToString(argument) + ' is not a constructor') } /***/ }, /***/ 6077: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isCallable = __webpack_require__(614) const String = global.String const TypeError = global.TypeError module.exports = function (argument) { if (typeof argument === 'object' || isCallable(argument)) return argument throw TypeError("Can't set " + String(argument) + ' as a prototype') } /***/ }, /***/ 1223: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const wellKnownSymbol = __webpack_require__(5112) const create = __webpack_require__(30) const definePropertyModule = __webpack_require__(3070) const UNSCOPABLES = wellKnownSymbol('unscopables') const ArrayPrototype = Array.prototype // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }) } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true } /***/ }, /***/ 1530: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const charAt = (__webpack_require__(8710).charAt) // `AdvanceStringIndex` abstract operation // https://tc39.es/ecma262/#sec-advancestringindex module.exports = function (S, index, unicode) { return index + (unicode ? charAt(S, index).length : 1) } /***/ }, /***/ 5787: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isPrototypeOf = __webpack_require__(7976) const TypeError = global.TypeError module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it throw TypeError('Incorrect invocation') } /***/ }, /***/ 9670: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isObject = __webpack_require__(111) const String = global.String const TypeError = global.TypeError // `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument throw TypeError(String(argument) + ' is not an object') } /***/ }, /***/ 1048: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const toObject = __webpack_require__(7908) const toAbsoluteIndex = __webpack_require__(1400) const lengthOfArrayLike = __webpack_require__(6244) const min = Math.min // `Array.prototype.copyWithin` method implementation // https://tc39.es/ecma262/#sec-array.prototype.copywithin // eslint-disable-next-line es/no-array-prototype-copywithin -- safe module.exports = [].copyWithin || function copyWithin (target /* = 0 */, start /* = 0, end = @length */) { const O = toObject(this) const len = lengthOfArrayLike(O) let to = toAbsoluteIndex(target, len) let from = toAbsoluteIndex(start, len) const end = arguments.length > 2 ? arguments[2] : undefined let count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to) let inc = 1 if (from < to && to < from + count) { inc = -1 from += count - 1 to += count - 1 } while (count-- > 0) { if (from in O) O[to] = O[from] else delete O[to] to += inc from += inc } return O } /***/ }, /***/ 1285: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const toObject = __webpack_require__(7908) const toAbsoluteIndex = __webpack_require__(1400) const lengthOfArrayLike = __webpack_require__(6244) // `Array.prototype.fill` method implementation // https://tc39.es/ecma262/#sec-array.prototype.fill module.exports = function fill (value /* , start = 0, end = @length */) { const O = toObject(this) const length = lengthOfArrayLike(O) const argumentsLength = arguments.length let index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length) const end = argumentsLength > 2 ? arguments[2] : undefined const endPos = end === undefined ? length : toAbsoluteIndex(end, length) while (endPos > index) O[index++] = value return O } /***/ }, /***/ 8533: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $forEach = (__webpack_require__(2092).forEach) const arrayMethodIsStrict = __webpack_require__(9341) const STRICT_METHOD = arrayMethodIsStrict('forEach') // `Array.prototype.forEach` method implementation // https://tc39.es/ecma262/#sec-array.prototype.foreach module.exports = !STRICT_METHOD ? function forEach (callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined) // eslint-disable-next-line es/no-array-prototype-foreach -- safe } : [].forEach /***/ }, /***/ 7745: /***/ function (module) { module.exports = function (Constructor, list) { let index = 0 const length = list.length const result = new Constructor(length) while (length > index) result[index] = list[index++] return result } /***/ }, /***/ 8457: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const bind = __webpack_require__(9974) const call = __webpack_require__(6916) const toObject = __webpack_require__(7908) const callWithSafeIterationClosing = __webpack_require__(3411) const isArrayIteratorMethod = __webpack_require__(7659) const isConstructor = __webpack_require__(4411) const lengthOfArrayLike = __webpack_require__(6244) const createProperty = __webpack_require__(6135) const getIterator = __webpack_require__(8554) const getIteratorMethod = __webpack_require__(1246) const Array = global.Array // `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from module.exports = function from (arrayLike /* , mapfn = undefined, thisArg = undefined */) { const O = toObject(arrayLike) const IS_CONSTRUCTOR = isConstructor(this) const argumentsLength = arguments.length let mapfn = argumentsLength > 1 ? arguments[1] : undefined const mapping = mapfn !== undefined if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined) const iteratorMethod = getIteratorMethod(O) let index = 0 let length, result, step, iterator, next, value // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) { iterator = getIterator(O, iteratorMethod) next = iterator.next result = IS_CONSTRUCTOR ? new this() : [] for (;!(step = call(next, iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value createProperty(result, index, value) } } else { length = lengthOfArrayLike(O) result = IS_CONSTRUCTOR ? new this(length) : Array(length) for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index] createProperty(result, index, value) } } result.length = index return result } /***/ }, /***/ 1318: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const toIndexedObject = __webpack_require__(5656) const toAbsoluteIndex = __webpack_require__(1400) const lengthOfArrayLike = __webpack_require__(6244) // `Array.prototype.{ indexOf, includes }` methods implementation const createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { const O = toIndexedObject($this) const length = lengthOfArrayLike(O) let index = toAbsoluteIndex(fromIndex, length) let value // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el != el) { while (length > index) { value = O[index++] // eslint-disable-next-line no-self-compare -- NaN check if (value != value) return true // Array#indexOf ignores holes, Array#includes - not } } else { for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0 } } return !IS_INCLUDES && -1 } } module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) } /***/ }, /***/ 2092: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const bind = __webpack_require__(9974) const uncurryThis = __webpack_require__(1702) const IndexedObject = __webpack_require__(8361) const toObject = __webpack_require__(7908) const lengthOfArrayLike = __webpack_require__(6244) const arraySpeciesCreate = __webpack_require__(5417) const push = uncurryThis([].push) // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation const createMethod = function (TYPE) { const IS_MAP = TYPE == 1 const IS_FILTER = TYPE == 2 const IS_SOME = TYPE == 3 const IS_EVERY = TYPE == 4 const IS_FIND_INDEX = TYPE == 6 const IS_FILTER_REJECT = TYPE == 7 const NO_HOLES = TYPE == 5 || IS_FIND_INDEX return function ($this, callbackfn, that, specificCreate) { const O = toObject($this) const self = IndexedObject(O) const boundFunction = bind(callbackfn, that) const length = lengthOfArrayLike(self) let index = 0 const create = specificCreate || arraySpeciesCreate const target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined let value, result for (;length > index; index++) { if (NO_HOLES || index in self) { value = self[index] result = boundFunction(value, index, O) if (TYPE) { if (IS_MAP) target[index] = result // map else if (result) { switch (TYPE) { case 3: return true // some case 5: return value // find case 6: return index // findIndex case 2: push(target, value) // filter } } else { switch (TYPE) { case 4: return false // every case 7: push(target, value) // filterReject } } } } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target } } module.exports = { // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach forEach: createMethod(0), // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map map: createMethod(1), // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter filter: createMethod(2), // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some some: createMethod(3), // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every every: createMethod(4), // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find find: createMethod(5), // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findIndex findIndex: createMethod(6), // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering filterReject: createMethod(7) } /***/ }, /***/ 6583: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* eslint-disable es/no-array-prototype-lastindexof -- safe */ const apply = __webpack_require__(2104) const toIndexedObject = __webpack_require__(5656) const toIntegerOrInfinity = __webpack_require__(9303) const lengthOfArrayLike = __webpack_require__(6244) const arrayMethodIsStrict = __webpack_require__(9341) const min = Math.min const $lastIndexOf = [].lastIndexOf const NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0 const STRICT_METHOD = arrayMethodIsStrict('lastIndexOf') const FORCED = NEGATIVE_ZERO || !STRICT_METHOD // `Array.prototype.lastIndexOf` method implementation // https://tc39.es/ecma262/#sec-array.prototype.lastindexof module.exports = FORCED ? function lastIndexOf (searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0 const O = toIndexedObject(this) const length = lengthOfArrayLike(O) let index = length - 1 if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1])) if (index < 0) index = length + index for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0 return -1 } : $lastIndexOf /***/ }, /***/ 1194: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) const wellKnownSymbol = __webpack_require__(5112) const V8_VERSION = __webpack_require__(7392) const SPECIES = wellKnownSymbol('species') module.exports = function (METHOD_NAME) { // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/677 return V8_VERSION >= 51 || !fails(function () { const array = [] const constructor = array.constructor = {} constructor[SPECIES] = function () { return { foo: 1 } } return array[METHOD_NAME](Boolean).foo !== 1 }) } /***/ }, /***/ 9341: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const fails = __webpack_require__(7293) module.exports = function (METHOD_NAME, argument) { const method = [][METHOD_NAME] return !!method && fails(function () { // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing method.call(null, argument || function () { throw 1 }, 1) }) } /***/ }, /***/ 3671: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const aCallable = __webpack_require__(9662) const toObject = __webpack_require__(7908) const IndexedObject = __webpack_require__(8361) const lengthOfArrayLike = __webpack_require__(6244) const TypeError = global.TypeError // `Array.prototype.{ reduce, reduceRight }` methods implementation const createMethod = function (IS_RIGHT) { return function (that, callbackfn, argumentsLength, memo) { aCallable(callbackfn) const O = toObject(that) const self = IndexedObject(O) const length = lengthOfArrayLike(O) let index = IS_RIGHT ? length - 1 : 0 const i = IS_RIGHT ? -1 : 1 if (argumentsLength < 2) { while (true) { if (index in self) { memo = self[index] index += i break } index += i if (IS_RIGHT ? index < 0 : length <= index) { throw TypeError('Reduce of empty array with no initial value') } } } for (;IS_RIGHT ? index >= 0 : length > index; index += i) { if (index in self) { memo = callbackfn(memo, self[index], index, O) } } return memo } } module.exports = { // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce left: createMethod(false), // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright right: createMethod(true) } /***/ }, /***/ 206: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) module.exports = uncurryThis([].slice) /***/ }, /***/ 4362: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const arraySlice = __webpack_require__(206) const floor = Math.floor const mergeSort = function (array, comparefn) { const length = array.length const middle = floor(length / 2) return length < 8 ? insertionSort(array, comparefn) : merge( array, mergeSort(arraySlice(array, 0, middle), comparefn), mergeSort(arraySlice(array, middle), comparefn), comparefn ) } var insertionSort = function (array, comparefn) { const length = array.length let i = 1 let element, j while (i < length) { j = i element = array[i] while (j && comparefn(array[j - 1], element) > 0) { array[j] = array[--j] } if (j !== i++) array[j] = element } return array } var merge = function (array, left, right, comparefn) { const llength = left.length const rlength = right.length let lindex = 0 let rindex = 0 while (lindex < llength || rindex < rlength) { array[lindex + rindex] = (lindex < llength && rindex < rlength) ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++] } return array } module.exports = mergeSort /***/ }, /***/ 7475: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isArray = __webpack_require__(3157) const isConstructor = __webpack_require__(4411) const isObject = __webpack_require__(111) const wellKnownSymbol = __webpack_require__(5112) const SPECIES = wellKnownSymbol('species') const Array = global.Array // a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate module.exports = function (originalArray) { let C if (isArray(originalArray)) { C = originalArray.constructor // cross-realm fallback if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined else if (isObject(C)) { C = C[SPECIES] if (C === null) C = undefined } } return C === undefined ? Array : C } /***/ }, /***/ 5417: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const arraySpeciesConstructor = __webpack_require__(7475) // `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate module.exports = function (originalArray, length) { return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length) } /***/ }, /***/ 3411: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const anObject = __webpack_require__(9670) const iteratorClose = __webpack_require__(9212) // call something on iterator step with safe closing on error module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value) } catch (error) { iteratorClose(iterator, 'throw', error) } } /***/ }, /***/ 7072: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const wellKnownSymbol = __webpack_require__(5112) const ITERATOR = wellKnownSymbol('iterator') let SAFE_CLOSING = false try { let called = 0 const iteratorWithReturn = { next: function () { return { done: !!called++ } }, return: function () { SAFE_CLOSING = true } } iteratorWithReturn[ITERATOR] = function () { return this } // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing Array.from(iteratorWithReturn, function () { throw 2 }) } catch (error) { /* empty */ } module.exports = function (exec, SKIP_CLOSING) { if (!SKIP_CLOSING && !SAFE_CLOSING) return false let ITERATION_SUPPORT = false try { const object = {} object[ITERATOR] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true } } } } exec(object) } catch (error) { /* empty */ } return ITERATION_SUPPORT } /***/ }, /***/ 4326: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const toString = uncurryThis({}.toString) const stringSlice = uncurryThis(''.slice) module.exports = function (it) { return stringSlice(toString(it), 8, -1) } /***/ }, /***/ 648: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const TO_STRING_TAG_SUPPORT = __webpack_require__(1694) const isCallable = __webpack_require__(614) const classofRaw = __webpack_require__(4326) const wellKnownSymbol = __webpack_require__(5112) const TO_STRING_TAG = wellKnownSymbol('toStringTag') const Object = global.Object // ES3 wrong here const CORRECT_ARGUMENTS = classofRaw(function () { return arguments }()) == 'Arguments' // fallback for IE11 Script Access Denied error const tryGet = function (it, key) { try { return it[key] } catch (error) { /* empty */ } } // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { let O, tag, result return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) === 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result } /***/ }, /***/ 7741: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const arraySlice = __webpack_require__(206) const replace = uncurryThis(''.replace) const split = uncurryThis(''.split) const join = uncurryThis([].join) const TEST = (function (arg) { return String(Error(arg).stack) })('zxcasd') const V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/ const IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST) const IS_FIREFOX_OR_SAFARI_STACK = /@[^\n]*\n/.test(TEST) && !/zxcasd/.test(TEST) module.exports = function (stack, dropEntries) { if (typeof stack !== 'string') return stack if (IS_V8_OR_CHAKRA_STACK) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '') } else if (IS_FIREFOX_OR_SAFARI_STACK) { return join(arraySlice(split(stack, '\n'), dropEntries), '\n') } return stack } /***/ }, /***/ 5631: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const defineProperty = (__webpack_require__(3070).f) const create = __webpack_require__(30) const redefineAll = __webpack_require__(2248) const bind = __webpack_require__(9974) const anInstance = __webpack_require__(5787) const iterate = __webpack_require__(408) const defineIterator = __webpack_require__(654) const setSpecies = __webpack_require__(6340) const DESCRIPTORS = __webpack_require__(9781) const fastKey = (__webpack_require__(2423).fastKey) const InternalStateModule = __webpack_require__(9909) const setInternalState = InternalStateModule.set const internalStateGetterFor = InternalStateModule.getterFor module.exports = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { const Constructor = wrapper(function (that, iterable) { anInstance(that, Prototype) setInternalState(that, { type: CONSTRUCTOR_NAME, index: create(null), first: undefined, last: undefined, size: 0 }) if (!DESCRIPTORS) that.size = 0 if (iterable != undefined) iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP }) }) var Prototype = Constructor.prototype const getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME) const define = function (that, key, value) { const state = getInternalState(that) let entry = getEntry(that, key) let previous, index // change existing entry if (entry) { entry.value = value // create new entry } else { state.last = entry = { index: index = fastKey(key, true), key, value, previous: previous = state.last, next: undefined, removed: false } if (!state.first) state.first = entry if (previous) previous.next = entry if (DESCRIPTORS) state.size++ else that.size++ // add to index if (index !== 'F') state.index[index] = entry } return that } var getEntry = function (that, key) { const state = getInternalState(that) // fast case const index = fastKey(key) let entry if (index !== 'F') return state.index[index] // frozen object case for (entry = state.first; entry; entry = entry.next) { if (entry.key == key) return entry } } redefineAll(Prototype, { // `{ Map, Set }.prototype.clear()` methods // https://tc39.es/ecma262/#sec-map.prototype.clear // https://tc39.es/ecma262/#sec-set.prototype.clear clear: function clear () { const that = this const state = getInternalState(that) const data = state.index let entry = state.first while (entry) { entry.removed = true if (entry.previous) entry.previous = entry.previous.next = undefined delete data[entry.index] entry = entry.next } state.first = state.last = undefined if (DESCRIPTORS) state.size = 0 else that.size = 0 }, // `{ Map, Set }.prototype.delete(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.delete // https://tc39.es/ecma262/#sec-set.prototype.delete delete: function (key) { const that = this const state = getInternalState(that) const entry = getEntry(that, key) if (entry) { const next = entry.next const prev = entry.previous delete state.index[entry.index] entry.removed = true if (prev) prev.next = next if (next) next.previous = prev if (state.first == entry) state.first = next if (state.last == entry) state.last = prev if (DESCRIPTORS) state.size-- else that.size-- } return !!entry }, // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods // https://tc39.es/ecma262/#sec-map.prototype.foreach // https://tc39.es/ecma262/#sec-set.prototype.foreach forEach: function forEach (callbackfn /* , that = undefined */) { const state = getInternalState(this) const boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined) let entry while (entry = entry ? entry.next : state.first) { boundFunction(entry.value, entry.key, this) // revert to the last existing entry while (entry && entry.removed) entry = entry.previous } }, // `{ Map, Set}.prototype.has(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.has // https://tc39.es/ecma262/#sec-set.prototype.has has: function has (key) { return !!getEntry(this, key) } }) redefineAll(Prototype, IS_MAP ? { // `Map.prototype.get(key)` method // https://tc39.es/ecma262/#sec-map.prototype.get get: function get (key) { const entry = getEntry(this, key) return entry && entry.value }, // `Map.prototype.set(key, value)` method // https://tc39.es/ecma262/#sec-map.prototype.set set: function set (key, value) { return define(this, key === 0 ? 0 : key, value) } } : { // `Set.prototype.add(value)` method // https://tc39.es/ecma262/#sec-set.prototype.add add: function add (value) { return define(this, value = value === 0 ? 0 : value, value) } }) if (DESCRIPTORS) { defineProperty(Prototype, 'size', { get: function () { return getInternalState(this).size } }) } return Constructor }, setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { const ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator' const getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME) const getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME) // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods // https://tc39.es/ecma262/#sec-map.prototype.entries // https://tc39.es/ecma262/#sec-map.prototype.keys // https://tc39.es/ecma262/#sec-map.prototype.values // https://tc39.es/ecma262/#sec-map.prototype-@@iterator // https://tc39.es/ecma262/#sec-set.prototype.entries // https://tc39.es/ecma262/#sec-set.prototype.keys // https://tc39.es/ecma262/#sec-set.prototype.values // https://tc39.es/ecma262/#sec-set.prototype-@@iterator defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState(this, { type: ITERATOR_NAME, target: iterated, state: getInternalCollectionState(iterated), kind, last: undefined }) }, function () { const state = getInternalIteratorState(this) const kind = state.kind let entry = state.last // revert to the last existing entry while (entry && entry.removed) entry = entry.previous // get next entry if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { // or finish the iteration state.target = undefined return { value: undefined, done: true } } // return step by kind if (kind == 'keys') return { value: entry.key, done: false } if (kind == 'values') return { value: entry.value, done: false } return { value: [entry.key, entry.value], done: false } }, IS_MAP ? 'entries' : 'values', !IS_MAP, true) // `{ Map, Set }.prototype[@@species]` accessors // https://tc39.es/ecma262/#sec-get-map-@@species // https://tc39.es/ecma262/#sec-get-set-@@species setSpecies(CONSTRUCTOR_NAME) } } /***/ }, /***/ 7710: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const isForced = __webpack_require__(4705) const redefine = __webpack_require__(1320) const InternalMetadataModule = __webpack_require__(2423) const iterate = __webpack_require__(408) const anInstance = __webpack_require__(5787) const isCallable = __webpack_require__(614) const isObject = __webpack_require__(111) const fails = __webpack_require__(7293) const checkCorrectnessOfIteration = __webpack_require__(7072) const setToStringTag = __webpack_require__(8003) const inheritIfRequired = __webpack_require__(9587) module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { const IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1 const IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1 const ADDER = IS_MAP ? 'set' : 'add' const NativeConstructor = global[CONSTRUCTOR_NAME] const NativePrototype = NativeConstructor && NativeConstructor.prototype let Constructor = NativeConstructor const exported = {} const fixMethod = function (KEY) { const uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]) redefine(NativePrototype, KEY, KEY == 'add' ? function add (value) { uncurriedNativeMethod(this, value === 0 ? 0 : value) return this } : KEY == 'delete' ? function (key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key) } : KEY == 'get' ? function get (key) { return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key) } : KEY == 'has' ? function has (key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key) } : function set (key, value) { uncurriedNativeMethod(this, key === 0 ? 0 : key, value) return this } ) } const REPLACE = isForced( CONSTRUCTOR_NAME, !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next() })) ) if (REPLACE) { // create collection constructor Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) InternalMetadataModule.enable() } else if (isForced(CONSTRUCTOR_NAME, true)) { const instance = new Constructor() // early implementations not supports chaining const HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false const THROWS_ON_PRIMITIVES = fails(function () { instance.has(1) }) // most early implementations doesn't supports iterables, most modern - not close it correctly // eslint-disable-next-line no-new -- required for testing const ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable) }) // for early implementations -0 and +0 not the same const BUGGY_ZERO = !IS_WEAK && fails(function () { // V8 ~ Chromium 42- fails only with 5+ elements const $instance = new NativeConstructor() let index = 5 while (index--) $instance[ADDER](index, index) return !$instance.has(-0) }) if (!ACCEPT_ITERABLES) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, NativePrototype) const that = inheritIfRequired(new NativeConstructor(), dummy, Constructor) if (iterable != undefined) iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP }) return that }) Constructor.prototype = NativePrototype NativePrototype.constructor = Constructor } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete') fixMethod('has') IS_MAP && fixMethod('get') } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER) // weak collections should not contains .clear method if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear } exported[CONSTRUCTOR_NAME] = Constructor $({ global: true, forced: Constructor != NativeConstructor }, exported) setToStringTag(Constructor, CONSTRUCTOR_NAME) if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP) return Constructor } /***/ }, /***/ 9920: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const hasOwn = __webpack_require__(2597) const ownKeys = __webpack_require__(3887) const getOwnPropertyDescriptorModule = __webpack_require__(1236) const definePropertyModule = __webpack_require__(3070) module.exports = function (target, source) { const keys = ownKeys(source) const defineProperty = definePropertyModule.f const getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f for (let i = 0; i < keys.length; i++) { const key = keys[i] if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)) } } /***/ }, /***/ 4964: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const wellKnownSymbol = __webpack_require__(5112) const MATCH = wellKnownSymbol('match') module.exports = function (METHOD_NAME) { const regexp = /./ try { '/./'[METHOD_NAME](regexp) } catch (error1) { try { regexp[MATCH] = false return '/./'[METHOD_NAME](regexp) } catch (error2) { /* empty */ } } return false } /***/ }, /***/ 8544: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) module.exports = !fails(function () { function F () { /* empty */ } F.prototype.constructor = null // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype }) /***/ }, /***/ 4230: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const requireObjectCoercible = __webpack_require__(4488) const toString = __webpack_require__(1340) const quot = /"/g const replace = uncurryThis(''.replace) // `CreateHTML` abstract operation // https://tc39.es/ecma262/#sec-createhtml module.exports = function (string, tag, attribute, value) { const S = toString(requireObjectCoercible(string)) let p1 = '<' + tag if (attribute !== '') p1 += ' ' + attribute + '="' + replace(toString(value), quot, '"') + '"' return p1 + '>' + S + '' } /***/ }, /***/ 4994: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const IteratorPrototype = (__webpack_require__(3383).IteratorPrototype) const create = __webpack_require__(30) const createPropertyDescriptor = __webpack_require__(9114) const setToStringTag = __webpack_require__(8003) const Iterators = __webpack_require__(7497) const returnThis = function () { return this } module.exports = function (IteratorConstructor, NAME, next) { const TO_STRING_TAG = NAME + ' Iterator' IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }) setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true) Iterators[TO_STRING_TAG] = returnThis return IteratorConstructor } /***/ }, /***/ 8880: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const definePropertyModule = __webpack_require__(3070) const createPropertyDescriptor = __webpack_require__(9114) module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)) } : function (object, key, value) { object[key] = value return object } /***/ }, /***/ 9114: /***/ function (module) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value } } /***/ }, /***/ 6135: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const toPropertyKey = __webpack_require__(4948) const definePropertyModule = __webpack_require__(3070) const createPropertyDescriptor = __webpack_require__(9114) module.exports = function (object, key, value) { const propertyKey = toPropertyKey(key) if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)) else object[propertyKey] = value } /***/ }, /***/ 8709: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const anObject = __webpack_require__(9670) const ordinaryToPrimitive = __webpack_require__(2140) const TypeError = global.TypeError // `Date.prototype[@@toPrimitive](hint)` method implementation // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive module.exports = function (hint) { anObject(this) if (hint === 'string' || hint === 'default') hint = 'string' else if (hint !== 'number') throw TypeError('Incorrect hint') return ordinaryToPrimitive(this, hint) } /***/ }, /***/ 654: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const call = __webpack_require__(6916) const IS_PURE = __webpack_require__(1913) const FunctionName = __webpack_require__(6530) const isCallable = __webpack_require__(614) const createIteratorConstructor = __webpack_require__(4994) const getPrototypeOf = __webpack_require__(9518) const setPrototypeOf = __webpack_require__(7674) const setToStringTag = __webpack_require__(8003) const createNonEnumerableProperty = __webpack_require__(8880) const redefine = __webpack_require__(1320) const wellKnownSymbol = __webpack_require__(5112) const Iterators = __webpack_require__(7497) const IteratorsCore = __webpack_require__(3383) const PROPER_FUNCTION_NAME = FunctionName.PROPER const CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE const IteratorPrototype = IteratorsCore.IteratorPrototype const BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS const ITERATOR = wellKnownSymbol('iterator') const KEYS = 'keys' const VALUES = 'values' const ENTRIES = 'entries' const returnThis = function () { return this } module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next) const getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND] switch (KIND) { case KEYS: return function keys () { return new IteratorConstructor(this, KIND) } case VALUES: return function values () { return new IteratorConstructor(this, KIND) } case ENTRIES: return function entries () { return new IteratorConstructor(this, KIND) } } return function () { return new IteratorConstructor(this) } } const TO_STRING_TAG = NAME + ' Iterator' let INCORRECT_VALUES_NAME = false var IterablePrototype = Iterable.prototype const nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT] var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT) const anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator let CurrentIteratorPrototype, methods, KEY // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())) if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype) } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) { redefine(CurrentIteratorPrototype, ITERATOR, returnThis) } } // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true) if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis } } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty(IterablePrototype, 'name', VALUES) } else { INCORRECT_VALUES_NAME = true defaultIterator = function values () { return call(nativeIterator, this) } } } // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) } if (FORCED) { for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { redefine(IterablePrototype, KEY, methods[KEY]) } } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods) } // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT }) } Iterators[NAME] = defaultIterator return methods } /***/ }, /***/ 7235: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const path = __webpack_require__(857) const hasOwn = __webpack_require__(2597) const wrappedWellKnownSymbolModule = __webpack_require__(6061) const defineProperty = (__webpack_require__(3070).f) module.exports = function (NAME) { const Symbol = path.Symbol || (path.Symbol = {}) if (!hasOwn(Symbol, NAME)) { defineProperty(Symbol, NAME, { value: wrappedWellKnownSymbolModule.f(NAME) }) } } /***/ }, /***/ 9781: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7 } })[1] != 7 }) /***/ }, /***/ 317: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isObject = __webpack_require__(111) const document = global.document // typeof document.createElement is 'object' in old IE const EXISTS = isObject(document) && isObject(document.createElement) module.exports = function (it) { return EXISTS ? document.createElement(it) : {} } /***/ }, /***/ 8324: /***/ function (module) { // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods module.exports = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 } /***/ }, /***/ 8509: /***/ function (module, __unused_webpack_exports, __webpack_require__) { // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList` const documentCreateElement = __webpack_require__(317) const classList = documentCreateElement('span').classList const DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype /***/ }, /***/ 8886: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const userAgent = __webpack_require__(8113) const firefox = userAgent.match(/firefox\/(\d+)/i) module.exports = !!firefox && +firefox[1] /***/ }, /***/ 7871: /***/ function (module) { module.exports = typeof window === 'object' /***/ }, /***/ 256: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const UA = __webpack_require__(8113) module.exports = /MSIE|Trident/.test(UA) /***/ }, /***/ 1528: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const userAgent = __webpack_require__(8113) const global = __webpack_require__(7854) module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined /***/ }, /***/ 6833: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const userAgent = __webpack_require__(8113) module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent) /***/ }, /***/ 5268: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const classof = __webpack_require__(4326) const global = __webpack_require__(7854) module.exports = classof(global.process) == 'process' /***/ }, /***/ 1036: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const userAgent = __webpack_require__(8113) module.exports = /web0s(?!.*chrome)/i.test(userAgent) /***/ }, /***/ 8113: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const getBuiltIn = __webpack_require__(5005) module.exports = getBuiltIn('navigator', 'userAgent') || '' /***/ }, /***/ 7392: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const userAgent = __webpack_require__(8113) const process = global.process const Deno = global.Deno const versions = process && process.versions || Deno && Deno.version const v8 = versions && versions.v8 let match, version if (v8) { match = v8.split('.') // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]) } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/) if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/) if (match) version = +match[1] } } module.exports = version /***/ }, /***/ 8008: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const userAgent = __webpack_require__(8113) const webkit = userAgent.match(/AppleWebKit\/(\d+)\./) module.exports = !!webkit && +webkit[1] /***/ }, /***/ 748: /***/ function (module) { // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ] /***/ }, /***/ 2914: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) const createPropertyDescriptor = __webpack_require__(9114) module.exports = !fails(function () { const error = Error('a') if (!('stack' in error)) return true // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)) return error.stack !== 7 }) /***/ }, /***/ 2109: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const getOwnPropertyDescriptor = (__webpack_require__(1236).f) const createNonEnumerableProperty = __webpack_require__(8880) const redefine = __webpack_require__(1320) const setGlobal = __webpack_require__(3505) const copyConstructorProperties = __webpack_require__(9920) const isForced = __webpack_require__(4705) /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ module.exports = function (options, source) { const TARGET = options.target const GLOBAL = options.global const STATIC = options.stat let FORCED, target, key, targetProperty, sourceProperty, descriptor if (GLOBAL) { target = global } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}) } else { target = (global[TARGET] || {}).prototype } if (target) { for (key in source) { sourceProperty = source[key] if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key) targetProperty = descriptor && descriptor.value } else targetProperty = target[key] FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced) // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue copyConstructorProperties(sourceProperty, targetProperty) } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true) } // extend global redefine(target, key, sourceProperty, options) } } } /***/ }, /***/ 7293: /***/ function (module) { module.exports = function (exec) { try { return !!exec() } catch (error) { return true } } /***/ }, /***/ 7007: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' // TODO: Remove from `core-js@4` since it's moved to entry points __webpack_require__(4916) const uncurryThis = __webpack_require__(1702) const redefine = __webpack_require__(1320) const regexpExec = __webpack_require__(2261) const fails = __webpack_require__(7293) const wellKnownSymbol = __webpack_require__(5112) const createNonEnumerableProperty = __webpack_require__(8880) const SPECIES = wellKnownSymbol('species') const RegExpPrototype = RegExp.prototype module.exports = function (KEY, exec, FORCED, SHAM) { const SYMBOL = wellKnownSymbol(KEY) const DELEGATES_TO_SYMBOL = !fails(function () { // String methods call symbol-named RegEp methods const O = {} O[SYMBOL] = function () { return 7 } return ''[KEY](O) != 7 }) const DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { // Symbol-named RegExp methods call .exec let execCalled = false let re = /a/ if (KEY === 'split') { // We can't use real regex here since it causes deoptimization // and serious performance degradation in V8 // https://github.com/zloirock/core-js/issues/306 re = {} // RegExp[@@split] doesn't call the regex's exec method, but first creates // a new one. We need to return the patched regex when creating the new one. re.constructor = {} re.constructor[SPECIES] = function () { return re } re.flags = '' re[SYMBOL] = /./[SYMBOL] } re.exec = function () { execCalled = true; return null } re[SYMBOL]('') return !execCalled }) if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED ) { const uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]) const methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { const uncurriedNativeMethod = uncurryThis(nativeMethod) const $exec = regexp.exec if ($exec === regexpExec || $exec === RegExpPrototype.exec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { // The native String method already delegates to @@method (this // polyfilled function), leasing to infinite recursion. // We avoid it by directly calling the native @@method method. return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) } } return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) } } return { done: false } }) redefine(String.prototype, KEY, methods[0]) redefine(RegExpPrototype, SYMBOL, methods[1]) } if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true) } /***/ }, /***/ 6677: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) module.exports = !fails(function () { // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing return Object.isExtensible(Object.preventExtensions({})) }) /***/ }, /***/ 2104: /***/ function (module) { const FunctionPrototype = Function.prototype const apply = FunctionPrototype.apply const bind = FunctionPrototype.bind const call = FunctionPrototype.call // eslint-disable-next-line es/no-reflect -- safe module.exports = typeof Reflect === 'object' && Reflect.apply || (bind ? call.bind(apply) : function () { return call.apply(apply, arguments) }) /***/ }, /***/ 9974: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const aCallable = __webpack_require__(9662) const bind = uncurryThis(uncurryThis.bind) // optional / simple context binding module.exports = function (fn, that) { aCallable(fn) return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) { return fn.apply(that, arguments) } } /***/ }, /***/ 7065: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const aCallable = __webpack_require__(9662) const isObject = __webpack_require__(111) const hasOwn = __webpack_require__(2597) const arraySlice = __webpack_require__(206) const Function = global.Function const concat = uncurryThis([].concat) const join = uncurryThis([].join) const factories = {} const construct = function (C, argsLength, args) { if (!hasOwn(factories, argsLength)) { for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']' factories[argsLength] = Function('C,a', 'return new C(' + join(list, ',') + ')') } return factories[argsLength](C, args) } // `Function.prototype.bind` method implementation // https://tc39.es/ecma262/#sec-function.prototype.bind module.exports = Function.bind || function bind (that /* , ...args */) { const F = aCallable(this) const Prototype = F.prototype const partArgs = arraySlice(arguments, 1) const boundFunction = function bound (/* args... */) { const args = concat(partArgs, arraySlice(arguments)) return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args) } if (isObject(Prototype)) boundFunction.prototype = Prototype return boundFunction } /***/ }, /***/ 6916: /***/ function (module) { const call = Function.prototype.call module.exports = call.bind ? call.bind(call) : function () { return call.apply(call, arguments) } /***/ }, /***/ 6530: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const hasOwn = __webpack_require__(2597) const FunctionPrototype = Function.prototype // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe const getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor const EXISTS = hasOwn(FunctionPrototype, 'name') // additional protection from minified / mangled / dropped function names const PROPER = EXISTS && function something () { /* empty */ }.name === 'something' const CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)) module.exports = { EXISTS, PROPER, CONFIGURABLE } /***/ }, /***/ 1702: /***/ function (module) { const FunctionPrototype = Function.prototype const bind = FunctionPrototype.bind const call = FunctionPrototype.call const callBind = bind && bind.bind(call) module.exports = bind ? function (fn) { return fn && callBind(call, fn) } : function (fn) { return fn && function () { return call.apply(fn, arguments) } } /***/ }, /***/ 5005: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isCallable = __webpack_require__(614) const aFunction = function (argument) { return isCallable(argument) ? argument : undefined } module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method] } /***/ }, /***/ 1246: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const classof = __webpack_require__(648) const getMethod = __webpack_require__(8173) const Iterators = __webpack_require__(7497) const wellKnownSymbol = __webpack_require__(5112) const ITERATOR = wellKnownSymbol('iterator') module.exports = function (it) { if (it != undefined) { return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)] } } /***/ }, /***/ 8554: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const call = __webpack_require__(6916) const aCallable = __webpack_require__(9662) const anObject = __webpack_require__(9670) const tryToString = __webpack_require__(6330) const getIteratorMethod = __webpack_require__(1246) const TypeError = global.TypeError module.exports = function (argument, usingIterator) { const iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)) throw TypeError(tryToString(argument) + ' is not iterable') } /***/ }, /***/ 8173: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const aCallable = __webpack_require__(9662) // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod module.exports = function (V, P) { const func = V[P] return func == null ? undefined : aCallable(func) } /***/ }, /***/ 647: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const toObject = __webpack_require__(7908) const floor = Math.floor const charAt = uncurryThis(''.charAt) const replace = uncurryThis(''.replace) const stringSlice = uncurryThis(''.slice) const SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g const SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g // `GetSubstitution` abstract operation // https://tc39.es/ecma262/#sec-getsubstitution module.exports = function (matched, str, position, captures, namedCaptures, replacement) { const tailPos = position + matched.length const m = captures.length let symbols = SUBSTITUTION_SYMBOLS_NO_NAMED if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures) symbols = SUBSTITUTION_SYMBOLS } return replace(replacement, symbols, function (match, ch) { let capture switch (charAt(ch, 0)) { case '$': return '$' case '&': return matched case '`': return stringSlice(str, 0, position) case "'": return stringSlice(str, tailPos) case '<': capture = namedCaptures[stringSlice(ch, 1, -1)] break default: // \d\d? var n = +ch if (n === 0) return match if (n > m) { const f = floor(n / 10) if (f === 0) return match if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1) return match } capture = captures[n - 1] } return capture === undefined ? '' : capture }) } /***/ }, /***/ 7854: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const check = function (it) { return it && it.Math == Math && it } // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis === 'object' && globalThis) || check(typeof window === 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self === 'object' && self) || check(typeof __webpack_require__.g === 'object' && __webpack_require__.g) || // eslint-disable-next-line no-new-func -- fallback (function () { return this })() || Function('return this')() /***/ }, /***/ 2597: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const toObject = __webpack_require__(7908) const hasOwnProperty = uncurryThis({}.hasOwnProperty) // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty module.exports = Object.hasOwn || function hasOwn (it, key) { return hasOwnProperty(toObject(it), key) } /***/ }, /***/ 3501: /***/ function (module) { module.exports = {} /***/ }, /***/ 842: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) module.exports = function (a, b) { const console = global.console if (console && console.error) { arguments.length == 1 ? console.error(a) : console.error(a, b) } } /***/ }, /***/ 490: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const getBuiltIn = __webpack_require__(5005) module.exports = getBuiltIn('document', 'documentElement') /***/ }, /***/ 4664: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const fails = __webpack_require__(7293) const createElement = __webpack_require__(317) // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- requied for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7 } }).a != 7 }) /***/ }, /***/ 1179: /***/ function (module, __unused_webpack_exports, __webpack_require__) { // IEEE754 conversions based on https://github.com/feross/ieee754 const global = __webpack_require__(7854) const Array = global.Array const abs = Math.abs const pow = Math.pow const floor = Math.floor const log = Math.log const LN2 = Math.LN2 const pack = function (number, mantissaLength, bytes) { const buffer = Array(bytes) let exponentLength = bytes * 8 - mantissaLength - 1 const eMax = (1 << exponentLength) - 1 const eBias = eMax >> 1 const rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0 const sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0 let index = 0 let exponent, mantissa, c number = abs(number) // eslint-disable-next-line no-self-compare -- NaN check if (number != number || number === Infinity) { // eslint-disable-next-line no-self-compare -- NaN check mantissa = number != number ? 1 : 0 exponent = eMax } else { exponent = floor(log(number) / LN2) if (number * (c = pow(2, -exponent)) < 1) { exponent-- c *= 2 } if (exponent + eBias >= 1) { number += rt / c } else { number += rt * pow(2, 1 - eBias) } if (number * c >= 2) { exponent++ c /= 2 } if (exponent + eBias >= eMax) { mantissa = 0 exponent = eMax } else if (exponent + eBias >= 1) { mantissa = (number * c - 1) * pow(2, mantissaLength) exponent = exponent + eBias } else { mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength) exponent = 0 } } for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); exponent = exponent << mantissaLength | mantissa exponentLength += mantissaLength for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); buffer[--index] |= sign * 128 return buffer } const unpack = function (buffer, mantissaLength) { const bytes = buffer.length const exponentLength = bytes * 8 - mantissaLength - 1 const eMax = (1 << exponentLength) - 1 const eBias = eMax >> 1 let nBits = exponentLength - 7 let index = bytes - 1 let sign = buffer[index--] let exponent = sign & 127 let mantissa sign >>= 7 for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); mantissa = exponent & (1 << -nBits) - 1 exponent >>= -nBits nBits += mantissaLength for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); if (exponent === 0) { exponent = 1 - eBias } else if (exponent === eMax) { return mantissa ? NaN : sign ? -Infinity : Infinity } else { mantissa = mantissa + pow(2, mantissaLength) exponent = exponent - eBias } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength) } module.exports = { pack, unpack } /***/ }, /***/ 8361: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const fails = __webpack_require__(7293) const classof = __webpack_require__(4326) const Object = global.Object const split = uncurryThis(''.split) // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !Object('z').propertyIsEnumerable(0) }) ? function (it) { return classof(it) == 'String' ? split(it, '') : Object(it) } : Object /***/ }, /***/ 9587: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const isCallable = __webpack_require__(614) const isObject = __webpack_require__(111) const setPrototypeOf = __webpack_require__(7674) // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { let NewTarget, NewTargetPrototype if ( // it can work only with native `setPrototypeOf` setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype) return $this } /***/ }, /***/ 2788: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const isCallable = __webpack_require__(614) const store = __webpack_require__(5465) const functionToString = uncurryThis(Function.toString) // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it) } } module.exports = store.inspectSource /***/ }, /***/ 8340: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const isObject = __webpack_require__(111) const createNonEnumerableProperty = __webpack_require__(8880) // `InstallErrorCause` abstract operation // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause module.exports = function (O, options) { if (isObject(options) && 'cause' in options) { createNonEnumerableProperty(O, 'cause', options.cause) } } /***/ }, /***/ 2423: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const uncurryThis = __webpack_require__(1702) const hiddenKeys = __webpack_require__(3501) const isObject = __webpack_require__(111) const hasOwn = __webpack_require__(2597) const defineProperty = (__webpack_require__(3070).f) const getOwnPropertyNamesModule = __webpack_require__(8006) const getOwnPropertyNamesExternalModule = __webpack_require__(1156) const uid = __webpack_require__(9711) const FREEZING = __webpack_require__(6677) let REQUIRED = false const METADATA = uid('meta') let id = 0 // eslint-disable-next-line es/no-object-isextensible -- safe const isExtensible = Object.isExtensible || function () { return true } const setMetadata = function (it) { defineProperty(it, METADATA, { value: { objectID: 'O' + id++, // object ID weakData: {} // weak collections IDs } }) } const fastKey = function (it, create) { // return a primitive with prefix if (!isObject(it)) return typeof it === 'symbol' ? it : (typeof it === 'string' ? 'S' : 'P') + it if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F' // not necessary to add metadata if (!create) return 'E' // add missing metadata setMetadata(it) // return object ID } return it[METADATA].objectID } const getWeakData = function (it, create) { if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true // not necessary to add metadata if (!create) return false // add missing metadata setMetadata(it) // return the store of weak collections IDs } return it[METADATA].weakData } // add metadata on freeze-family methods calling const onFreeze = function (it) { if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it) return it } const enable = function () { meta.enable = function () { /* empty */ } REQUIRED = true const getOwnPropertyNames = getOwnPropertyNamesModule.f const splice = uncurryThis([].splice) const test = {} test[METADATA] = 1 // prevent exposing of metadata key if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { const result = getOwnPropertyNames(it) for (let i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA) { splice(result, i, 1) break } } return result } $({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }) } } var meta = module.exports = { enable, fastKey, getWeakData, onFreeze } hiddenKeys[METADATA] = true /***/ }, /***/ 9909: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const NATIVE_WEAK_MAP = __webpack_require__(8536) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const isObject = __webpack_require__(111) const createNonEnumerableProperty = __webpack_require__(8880) const hasOwn = __webpack_require__(2597) const shared = __webpack_require__(5465) const sharedKey = __webpack_require__(6200) const hiddenKeys = __webpack_require__(3501) const OBJECT_ALREADY_INITIALIZED = 'Object already initialized' const TypeError = global.TypeError const WeakMap = global.WeakMap let set, get, has const enforce = function (it) { return has(it) ? get(it) : set(it, {}) } const getterFor = function (TYPE) { return function (it) { let state if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required') } return state } } if (NATIVE_WEAK_MAP || shared.state) { const store = shared.state || (shared.state = new WeakMap()) const wmget = uncurryThis(store.get) const wmhas = uncurryThis(store.has) const wmset = uncurryThis(store.set) set = function (it, metadata) { if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED) metadata.facade = it wmset(store, it, metadata) return metadata } get = function (it) { return wmget(store, it) || {} } has = function (it) { return wmhas(store, it) } } else { const STATE = sharedKey('state') hiddenKeys[STATE] = true set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED) metadata.facade = it createNonEnumerableProperty(it, STATE, metadata) return metadata } get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {} } has = function (it) { return hasOwn(it, STATE) } } module.exports = { set, get, has, enforce, getterFor } /***/ }, /***/ 7659: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const wellKnownSymbol = __webpack_require__(5112) const Iterators = __webpack_require__(7497) const ITERATOR = wellKnownSymbol('iterator') const ArrayPrototype = Array.prototype // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it) } /***/ }, /***/ 3157: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const classof = __webpack_require__(4326) // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe module.exports = Array.isArray || function isArray (argument) { return classof(argument) == 'Array' } /***/ }, /***/ 614: /***/ function (module) { // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable module.exports = function (argument) { return typeof argument === 'function' } /***/ }, /***/ 4411: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const fails = __webpack_require__(7293) const isCallable = __webpack_require__(614) const classof = __webpack_require__(648) const getBuiltIn = __webpack_require__(5005) const inspectSource = __webpack_require__(2788) const noop = function () { /* empty */ } const empty = [] const construct = getBuiltIn('Reflect', 'construct') const constructorRegExp = /^\s*(?:class|function)\b/ const exec = uncurryThis(constructorRegExp.exec) const INCORRECT_TO_STRING = !constructorRegExp.exec(noop) const isConstructorModern = function (argument) { if (!isCallable(argument)) return false try { construct(noop, empty, argument) return true } catch (error) { return false } } const isConstructorLegacy = function (argument) { if (!isCallable(argument)) return false switch (classof(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false // we can't check .prototype since constructors produced by .bind haven't it } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)) } // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor module.exports = !construct || fails(function () { let called return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true }) || called }) ? isConstructorLegacy : isConstructorModern /***/ }, /***/ 4705: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) const isCallable = __webpack_require__(614) const replacement = /#|\.prototype\./ const isForced = function (feature, detection) { const value = data[normalize(feature)] return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection } var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase() } var data = isForced.data = {} var NATIVE = isForced.NATIVE = 'N' var POLYFILL = isForced.POLYFILL = 'P' module.exports = isForced /***/ }, /***/ 5988: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const isObject = __webpack_require__(111) const floor = Math.floor // `IsIntegralNumber` abstract operation // https://tc39.es/ecma262/#sec-isintegralnumber // eslint-disable-next-line es/no-number-isinteger -- safe module.exports = Number.isInteger || function isInteger (it) { return !isObject(it) && isFinite(it) && floor(it) === it } /***/ }, /***/ 111: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const isCallable = __webpack_require__(614) module.exports = function (it) { return typeof it === 'object' ? it !== null : isCallable(it) } /***/ }, /***/ 1913: /***/ function (module) { module.exports = false /***/ }, /***/ 7850: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const isObject = __webpack_require__(111) const classof = __webpack_require__(4326) const wellKnownSymbol = __webpack_require__(5112) const MATCH = wellKnownSymbol('match') // `IsRegExp` abstract operation // https://tc39.es/ecma262/#sec-isregexp module.exports = function (it) { let isRegExp return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp') } /***/ }, /***/ 2190: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const getBuiltIn = __webpack_require__(5005) const isCallable = __webpack_require__(614) const isPrototypeOf = __webpack_require__(7976) const USE_SYMBOL_AS_UID = __webpack_require__(3307) const Object = global.Object module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it === 'symbol' } : function (it) { const $Symbol = getBuiltIn('Symbol') return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object(it)) } /***/ }, /***/ 408: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const bind = __webpack_require__(9974) const call = __webpack_require__(6916) const anObject = __webpack_require__(9670) const tryToString = __webpack_require__(6330) const isArrayIteratorMethod = __webpack_require__(7659) const lengthOfArrayLike = __webpack_require__(6244) const isPrototypeOf = __webpack_require__(7976) const getIterator = __webpack_require__(8554) const getIteratorMethod = __webpack_require__(1246) const iteratorClose = __webpack_require__(9212) const TypeError = global.TypeError const Result = function (stopped, result) { this.stopped = stopped this.result = result } const ResultPrototype = Result.prototype module.exports = function (iterable, unboundFunction, options) { const that = options && options.that const AS_ENTRIES = !!(options && options.AS_ENTRIES) const IS_ITERATOR = !!(options && options.IS_ITERATOR) const INTERRUPTED = !!(options && options.INTERRUPTED) const fn = bind(unboundFunction, that) let iterator, iterFn, index, length, result, next, step const stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal', condition) return new Result(true, condition) } const callFn = function (value) { if (AS_ENTRIES) { anObject(value) return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]) } return INTERRUPTED ? fn(value, stop) : fn(value) } if (IS_ITERATOR) { iterator = iterable } else { iterFn = getIteratorMethod(iterable) if (!iterFn) throw TypeError(tryToString(iterable) + ' is not iterable') // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]) if (result && isPrototypeOf(ResultPrototype, result)) return result } return new Result(false) } iterator = getIterator(iterable, iterFn) } next = iterator.next while (!(step = call(next, iterator)).done) { try { result = callFn(step.value) } catch (error) { iteratorClose(iterator, 'throw', error) } if (typeof result === 'object' && result && isPrototypeOf(ResultPrototype, result)) return result } return new Result(false) } /***/ }, /***/ 9212: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const call = __webpack_require__(6916) const anObject = __webpack_require__(9670) const getMethod = __webpack_require__(8173) module.exports = function (iterator, kind, value) { let innerResult, innerError anObject(iterator) try { innerResult = getMethod(iterator, 'return') if (!innerResult) { if (kind === 'throw') throw value return value } innerResult = call(innerResult, iterator) } catch (error) { innerError = true innerResult = error } if (kind === 'throw') throw value if (innerError) throw innerResult anObject(innerResult) return value } /***/ }, /***/ 3383: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const fails = __webpack_require__(7293) const isCallable = __webpack_require__(614) const create = __webpack_require__(30) const getPrototypeOf = __webpack_require__(9518) const redefine = __webpack_require__(1320) const wellKnownSymbol = __webpack_require__(5112) const IS_PURE = __webpack_require__(1913) const ITERATOR = wellKnownSymbol('iterator') let BUGGY_SAFARI_ITERATORS = false // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object let IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator /* eslint-disable es/no-array-prototype-keys -- safe */ if ([].keys) { arrayIterator = [].keys() // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)) if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype } } const NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () { const test = {} // FF44- legacy iterators case return IteratorPrototype[ITERATOR].call(test) !== test }) if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {} else if (IS_PURE) IteratorPrototype = create(IteratorPrototype) // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable(IteratorPrototype[ITERATOR])) { redefine(IteratorPrototype, ITERATOR, function () { return this }) } module.exports = { IteratorPrototype, BUGGY_SAFARI_ITERATORS } /***/ }, /***/ 7497: /***/ function (module) { module.exports = {} /***/ }, /***/ 6244: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const toLength = __webpack_require__(7466) // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike module.exports = function (obj) { return toLength(obj.length) } /***/ }, /***/ 5948: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const bind = __webpack_require__(9974) const getOwnPropertyDescriptor = (__webpack_require__(1236).f) let macrotask = (__webpack_require__(261).set) const IS_IOS = __webpack_require__(6833) const IS_IOS_PEBBLE = __webpack_require__(1528) const IS_WEBOS_WEBKIT = __webpack_require__(1036) const IS_NODE = __webpack_require__(5268) const MutationObserver = global.MutationObserver || global.WebKitMutationObserver const document = global.document const process = global.process const Promise = global.Promise // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` const queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask') const queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value let flush, head, last, notify, toggle, node, promise, then // modern engines have queueMicrotask method if (!queueMicrotask) { flush = function () { let parent, fn if (IS_NODE && (parent = process.domain)) parent.exit() while (head) { fn = head.fn head = head.next try { fn() } catch (error) { if (head) notify() else last = undefined throw error } } last = undefined if (parent) parent.enter() } // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898 if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) { toggle = true node = document.createTextNode('') new MutationObserver(flush).observe(node, { characterData: true }) notify = function () { node.data = toggle = !toggle } // environments with maybe non-completely correct, but existent Promise } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 promise = Promise.resolve(undefined) // workaround of WebKit ~ iOS Safari 10.1 bug promise.constructor = Promise then = bind(promise.then, promise) notify = function () { then(flush) } // Node.js without promises } else if (IS_NODE) { notify = function () { process.nextTick(flush) } // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { // strange IE + webpack dev server bug - use .bind(global) macrotask = bind(macrotask, global) notify = function () { macrotask(flush) } } } module.exports = queueMicrotask || function (fn) { const task = { fn, next: undefined } if (last) last.next = task if (!head) { head = task notify() } last = task } /***/ }, /***/ 3366: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) module.exports = global.Promise /***/ }, /***/ 133: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable es/no-symbol -- required for testing */ const V8_VERSION = __webpack_require__(7392) const fails = __webpack_require__(7293) // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { const symbol = Symbol() // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41 }) /***/ }, /***/ 8536: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isCallable = __webpack_require__(614) const inspectSource = __webpack_require__(2788) const WeakMap = global.WeakMap module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap)) /***/ }, /***/ 8523: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const aCallable = __webpack_require__(9662) const PromiseCapability = function (C) { let resolve, reject this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor') resolve = $$resolve reject = $$reject }) this.resolve = aCallable(resolve) this.reject = aCallable(reject) } // `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability module.exports.f = function (C) { return new PromiseCapability(C) } /***/ }, /***/ 6277: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const toString = __webpack_require__(1340) module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument) } /***/ }, /***/ 3929: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isRegExp = __webpack_require__(7850) const TypeError = global.TypeError module.exports = function (it) { if (isRegExp(it)) { throw TypeError("The method doesn't accept regular expressions") } return it } /***/ }, /***/ 7023: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const globalIsFinite = global.isFinite // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite // eslint-disable-next-line es/no-number-isfinite -- safe module.exports = Number.isFinite || function isFinite (it) { return typeof it === 'number' && globalIsFinite(it) } /***/ }, /***/ 1574: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const DESCRIPTORS = __webpack_require__(9781) const uncurryThis = __webpack_require__(1702) const call = __webpack_require__(6916) const fails = __webpack_require__(7293) const objectKeys = __webpack_require__(1956) const getOwnPropertySymbolsModule = __webpack_require__(5181) const propertyIsEnumerableModule = __webpack_require__(5296) const toObject = __webpack_require__(7908) const IndexedObject = __webpack_require__(8361) // eslint-disable-next-line es/no-object-assign -- safe const $assign = Object.assign // eslint-disable-next-line es/no-object-defineproperty -- required for testing const defineProperty = Object.defineProperty const concat = uncurryThis([].concat) // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign module.exports = !$assign || fails(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', { enumerable: true, get: function () { defineProperty(this, 'b', { value: 3, enumerable: false }) } }), { b: 2 })).b !== 1) return true // should work with symbols and should have deterministic property order (V8 bug) const A = {} const B = {} // eslint-disable-next-line es/no-symbol -- safe const symbol = Symbol() const alphabet = 'abcdefghijklmnopqrst' A[symbol] = 7 alphabet.split('').forEach(function (chr) { B[chr] = chr }) return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet }) ? function assign (target, source) { // eslint-disable-line no-unused-vars -- required for `.length` const T = toObject(target) const argumentsLength = arguments.length let index = 1 const getOwnPropertySymbols = getOwnPropertySymbolsModule.f const propertyIsEnumerable = propertyIsEnumerableModule.f while (argumentsLength > index) { const S = IndexedObject(arguments[index++]) const keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S) const length = keys.length let j = 0 var key while (length > j) { key = keys[j++] if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key] } } return T } : $assign /***/ }, /***/ 30: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* global ActiveXObject -- old IE, WSH */ const anObject = __webpack_require__(9670) const defineProperties = __webpack_require__(6048) const enumBugKeys = __webpack_require__(748) const hiddenKeys = __webpack_require__(3501) const html = __webpack_require__(490) const documentCreateElement = __webpack_require__(317) const sharedKey = __webpack_require__(6200) const GT = '>' const LT = '<' const PROTOTYPE = 'prototype' const SCRIPT = 'script' const IE_PROTO = sharedKey('IE_PROTO') const EmptyConstructor = function () { /* empty */ } const scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT } // Create object with fake `null` prototype: use ActiveX Object with cleared prototype const NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')) activeXDocument.close() const temp = activeXDocument.parentWindow.Object activeXDocument = null // avoid memory leak return temp } // Create object with fake `null` prototype: use iframe Object with cleared prototype const NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug const iframe = documentCreateElement('iframe') const JS = 'java' + SCRIPT + ':' let iframeDocument iframe.style.display = 'none' html.appendChild(iframe) // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS) iframeDocument = iframe.contentWindow.document iframeDocument.open() iframeDocument.write(scriptTag('document.F=Object')) iframeDocument.close() return iframeDocument.F } // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug let activeXDocument let NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile') } catch (error) { /* ignore */ } NullProtoObject = typeof document !== 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument) // WSH let length = enumBugKeys.length while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]] return NullProtoObject() } hiddenKeys[IE_PROTO] = true // `Object.create` method // https://tc39.es/ecma262/#sec-object.create module.exports = Object.create || function create (O, Properties) { let result if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O) result = new EmptyConstructor() EmptyConstructor[PROTOTYPE] = null // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O } else result = NullProtoObject() return Properties === undefined ? result : defineProperties(result, Properties) } /***/ }, /***/ 6048: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const definePropertyModule = __webpack_require__(3070) const anObject = __webpack_require__(9670) const toIndexedObject = __webpack_require__(5656) const objectKeys = __webpack_require__(1956) // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties (O, Properties) { anObject(O) const props = toIndexedObject(Properties) const keys = objectKeys(Properties) const length = keys.length let index = 0 let key while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]) return O } /***/ }, /***/ 3070: /***/ function (__unused_webpack_module, exports, __webpack_require__) { const global = __webpack_require__(7854) const DESCRIPTORS = __webpack_require__(9781) const IE8_DOM_DEFINE = __webpack_require__(4664) const anObject = __webpack_require__(9670) const toPropertyKey = __webpack_require__(4948) const TypeError = global.TypeError // eslint-disable-next-line es/no-object-defineproperty -- safe const $defineProperty = Object.defineProperty // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? $defineProperty : function defineProperty (O, P, Attributes) { anObject(O) P = toPropertyKey(P) anObject(Attributes) if (IE8_DOM_DEFINE) { try { return $defineProperty(O, P, Attributes) } catch (error) { /* empty */ } } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported') if ('value' in Attributes) O[P] = Attributes.value return O } /***/ }, /***/ 1236: /***/ function (__unused_webpack_module, exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const call = __webpack_require__(6916) const propertyIsEnumerableModule = __webpack_require__(5296) const createPropertyDescriptor = __webpack_require__(9114) const toIndexedObject = __webpack_require__(5656) const toPropertyKey = __webpack_require__(4948) const hasOwn = __webpack_require__(2597) const IE8_DOM_DEFINE = __webpack_require__(4664) // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe const $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor (O, P) { O = toIndexedObject(O) P = toPropertyKey(P) if (IE8_DOM_DEFINE) { try { return $getOwnPropertyDescriptor(O, P) } catch (error) { /* empty */ } } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]) } /***/ }, /***/ 1156: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable es/no-object-getownpropertynames -- safe */ const classof = __webpack_require__(4326) const toIndexedObject = __webpack_require__(5656) const $getOwnPropertyNames = (__webpack_require__(8006).f) const arraySlice = __webpack_require__(206) const windowNames = typeof window === 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [] const getWindowNames = function (it) { try { return $getOwnPropertyNames(it) } catch (error) { return arraySlice(windowNames) } } // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window module.exports.f = function getOwnPropertyNames (it) { return windowNames && classof(it) == 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)) } /***/ }, /***/ 8006: /***/ function (__unused_webpack_module, exports, __webpack_require__) { const internalObjectKeys = __webpack_require__(6324) const enumBugKeys = __webpack_require__(748) const hiddenKeys = enumBugKeys.concat('length', 'prototype') // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames (O) { return internalObjectKeys(O, hiddenKeys) } /***/ }, /***/ 5181: /***/ function (__unused_webpack_module, exports) { // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols /***/ }, /***/ 9518: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const hasOwn = __webpack_require__(2597) const isCallable = __webpack_require__(614) const toObject = __webpack_require__(7908) const sharedKey = __webpack_require__(6200) const CORRECT_PROTOTYPE_GETTER = __webpack_require__(8544) const IE_PROTO = sharedKey('IE_PROTO') const Object = global.Object const ObjectPrototype = Object.prototype // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { const object = toObject(O) if (hasOwn(object, IE_PROTO)) return object[IE_PROTO] const constructor = object.constructor if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype } return object instanceof Object ? ObjectPrototype : null } /***/ }, /***/ 7976: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) module.exports = uncurryThis({}.isPrototypeOf) /***/ }, /***/ 6324: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const hasOwn = __webpack_require__(2597) const toIndexedObject = __webpack_require__(5656) const indexOf = (__webpack_require__(1318).indexOf) const hiddenKeys = __webpack_require__(3501) const push = uncurryThis([].push) module.exports = function (object, names) { const O = toIndexedObject(object) let i = 0 const result = [] let key for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key) // Don't enum bug & hidden keys while (names.length > i) { if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key) } } return result } /***/ }, /***/ 1956: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const internalObjectKeys = __webpack_require__(6324) const enumBugKeys = __webpack_require__(748) // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe module.exports = Object.keys || function keys (O) { return internalObjectKeys(O, enumBugKeys) } /***/ }, /***/ 5296: /***/ function (__unused_webpack_module, exports) { 'use strict' const $propertyIsEnumerable = {}.propertyIsEnumerable // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor // Nashorn ~ JDK8 bug const NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1) // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable (V) { const descriptor = getOwnPropertyDescriptor(this, V) return !!descriptor && descriptor.enumerable } : $propertyIsEnumerable /***/ }, /***/ 7674: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable no-proto -- safe */ const uncurryThis = __webpack_require__(1702) const anObject = __webpack_require__(9670) const aPossiblePrototype = __webpack_require__(6077) // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? (function () { let CORRECT_SETTER = false const test = {} let setter try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set) setter(test, []) CORRECT_SETTER = test instanceof Array } catch (error) { /* empty */ } return function setPrototypeOf (O, proto) { anObject(O) aPossiblePrototype(proto) if (CORRECT_SETTER) setter(O, proto) else O.__proto__ = proto return O } }()) : undefined) /***/ }, /***/ 4699: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const uncurryThis = __webpack_require__(1702) const objectKeys = __webpack_require__(1956) const toIndexedObject = __webpack_require__(5656) const $propertyIsEnumerable = (__webpack_require__(5296).f) const propertyIsEnumerable = uncurryThis($propertyIsEnumerable) const push = uncurryThis([].push) // `Object.{ entries, values }` methods implementation const createMethod = function (TO_ENTRIES) { return function (it) { const O = toIndexedObject(it) const keys = objectKeys(O) const length = keys.length let i = 0 const result = [] let key while (length > i) { key = keys[i++] if (!DESCRIPTORS || propertyIsEnumerable(O, key)) { push(result, TO_ENTRIES ? [key, O[key]] : O[key]) } } return result } } module.exports = { // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries entries: createMethod(true), // `Object.values` method // https://tc39.es/ecma262/#sec-object.values values: createMethod(false) } /***/ }, /***/ 288: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const TO_STRING_TAG_SUPPORT = __webpack_require__(1694) const classof = __webpack_require__(648) // `Object.prototype.toString` method implementation // https://tc39.es/ecma262/#sec-object.prototype.tostring module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString () { return '[object ' + classof(this) + ']' } /***/ }, /***/ 2140: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const call = __webpack_require__(6916) const isCallable = __webpack_require__(614) const isObject = __webpack_require__(111) const TypeError = global.TypeError // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive module.exports = function (input, pref) { let fn, val if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val throw TypeError("Can't convert object to primitive value") } /***/ }, /***/ 3887: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const getBuiltIn = __webpack_require__(5005) const uncurryThis = __webpack_require__(1702) const getOwnPropertyNamesModule = __webpack_require__(8006) const getOwnPropertySymbolsModule = __webpack_require__(5181) const anObject = __webpack_require__(9670) const concat = uncurryThis([].concat) // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys (it) { const keys = getOwnPropertyNamesModule.f(anObject(it)) const getOwnPropertySymbols = getOwnPropertySymbolsModule.f return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys } /***/ }, /***/ 857: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) module.exports = global /***/ }, /***/ 2534: /***/ function (module) { module.exports = function (exec) { try { return { error: false, value: exec() } } catch (error) { return { error: true, value: error } } } /***/ }, /***/ 9478: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const anObject = __webpack_require__(9670) const isObject = __webpack_require__(111) const newPromiseCapability = __webpack_require__(8523) module.exports = function (C, x) { anObject(C) if (isObject(x) && x.constructor === C) return x const promiseCapability = newPromiseCapability.f(C) const resolve = promiseCapability.resolve resolve(x) return promiseCapability.promise } /***/ }, /***/ 2248: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const redefine = __webpack_require__(1320) module.exports = function (target, src, options) { for (const key in src) redefine(target, key, src[key], options) return target } /***/ }, /***/ 1320: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const isCallable = __webpack_require__(614) const hasOwn = __webpack_require__(2597) const createNonEnumerableProperty = __webpack_require__(8880) const setGlobal = __webpack_require__(3505) const inspectSource = __webpack_require__(2788) const InternalStateModule = __webpack_require__(9909) const CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(6530).CONFIGURABLE) const getInternalState = InternalStateModule.get const enforceInternalState = InternalStateModule.enforce const TEMPLATE = String(String).split('String'); (module.exports = function (O, key, value, options) { const unsafe = options ? !!options.unsafe : false let simple = options ? !!options.enumerable : false const noTargetGet = options ? !!options.noTargetGet : false let name = options && options.name !== undefined ? options.name : key let state if (isCallable(value)) { if (String(name).slice(0, 7) === 'Symbol(') { name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']' } if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { createNonEnumerableProperty(value, 'name', name) } state = enforceInternalState(value) if (!state.source) { state.source = TEMPLATE.join(typeof name === 'string' ? name : '') } } if (O === global) { if (simple) O[key] = value else setGlobal(key, value) return } else if (!unsafe) { delete O[key] } else if (!noTargetGet && O[key]) { simple = true } if (simple) O[key] = value else createNonEnumerableProperty(O, key, value) // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString () { return isCallable(this) && getInternalState(this).source || inspectSource(this) }) /***/ }, /***/ 7651: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const call = __webpack_require__(6916) const anObject = __webpack_require__(9670) const isCallable = __webpack_require__(614) const classof = __webpack_require__(4326) const regexpExec = __webpack_require__(2261) const TypeError = global.TypeError // `RegExpExec` abstract operation // https://tc39.es/ecma262/#sec-regexpexec module.exports = function (R, S) { const exec = R.exec if (isCallable(exec)) { const result = call(exec, R, S) if (result !== null) anObject(result) return result } if (classof(R) === 'RegExp') return call(regexpExec, R, S) throw TypeError('RegExp#exec called on incompatible receiver') } /***/ }, /***/ 2261: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */ /* eslint-disable regexp/no-useless-quantifier -- testing */ const call = __webpack_require__(6916) const uncurryThis = __webpack_require__(1702) const toString = __webpack_require__(1340) const regexpFlags = __webpack_require__(7066) const stickyHelpers = __webpack_require__(2999) const shared = __webpack_require__(2309) const create = __webpack_require__(30) const getInternalState = (__webpack_require__(9909).get) const UNSUPPORTED_DOT_ALL = __webpack_require__(9441) const UNSUPPORTED_NCG = __webpack_require__(7168) const nativeReplace = shared('native-string-replace', String.prototype.replace) const nativeExec = RegExp.prototype.exec let patchedExec = nativeExec const charAt = uncurryThis(''.charAt) const indexOf = uncurryThis(''.indexOf) const replace = uncurryThis(''.replace) const stringSlice = uncurryThis(''.slice) const UPDATES_LAST_INDEX_WRONG = (function () { const re1 = /a/ const re2 = /b*/g call(nativeExec, re1, 'a') call(nativeExec, re2, 'a') return re1.lastIndex !== 0 || re2.lastIndex !== 0 })() const UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET // nonparticipating capturing group, copied from es5-shim's String#split patch. const NPCG_INCLUDED = /()??/.exec('')[1] !== undefined const PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG if (PATCH) { // eslint-disable-next-line max-statements -- TODO patchedExec = function exec (string) { const re = this const state = getInternalState(re) const str = toString(string) const raw = state.raw let result, reCopy, lastIndex, match, i, object, group if (raw) { raw.lastIndex = re.lastIndex result = call(patchedExec, raw, str) re.lastIndex = raw.lastIndex return result } const groups = state.groups const sticky = UNSUPPORTED_Y && re.sticky let flags = call(regexpFlags, re) let source = re.source let charsAdded = 0 let strCopy = str if (sticky) { flags = replace(flags, 'y', '') if (indexOf(flags, 'g') === -1) { flags += 'g' } strCopy = stringSlice(str, re.lastIndex) // Support anchored sticky behavior. if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) { source = '(?: ' + source + ')' strCopy = ' ' + strCopy charsAdded++ } // ^(? + rx + ) is needed, in combination with some str slicing, to // simulate the 'y' flag. reCopy = new RegExp('^(?:' + source + ')', flags) } if (NPCG_INCLUDED) { reCopy = new RegExp('^' + source + '$(?!\\s)', flags) } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex match = call(nativeExec, sticky ? reCopy : re, strCopy) if (sticky) { if (match) { match.input = stringSlice(match.input, charsAdded) match[0] = stringSlice(match[0], charsAdded) match.index = re.lastIndex re.lastIndex += match[0].length } else re.lastIndex = 0 } else if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex } if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ call(nativeReplace, match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined } }) } if (match && groups) { match.groups = object = create(null) for (i = 0; i < groups.length; i++) { group = groups[i] object[group[0]] = match[group[1]] } } return match } } module.exports = patchedExec /***/ }, /***/ 7066: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const anObject = __webpack_require__(9670) // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags module.exports = function () { const that = anObject(this) let result = '' if (that.global) result += 'g' if (that.ignoreCase) result += 'i' if (that.multiline) result += 'm' if (that.dotAll) result += 's' if (that.unicode) result += 'u' if (that.sticky) result += 'y' return result } /***/ }, /***/ 2999: /***/ function (__unused_webpack_module, exports, __webpack_require__) { const fails = __webpack_require__(7293) const global = __webpack_require__(7854) // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError const $RegExp = global.RegExp exports.UNSUPPORTED_Y = fails(function () { const re = $RegExp('a', 'y') re.lastIndex = 2 return re.exec('abcd') != null }) exports.BROKEN_CARET = fails(function () { // https://bugzilla.mozilla.org/show_bug.cgi?id=773687 const re = $RegExp('^r', 'gy') re.lastIndex = 2 return re.exec('str') != null }) /***/ }, /***/ 9441: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) const global = __webpack_require__(7854) // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError const $RegExp = global.RegExp module.exports = fails(function () { const re = $RegExp('.', 's') return !(re.dotAll && re.exec('\n') && re.flags === 's') }) /***/ }, /***/ 7168: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) const global = __webpack_require__(7854) // babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError const $RegExp = global.RegExp module.exports = fails(function () { const re = $RegExp('(?b)', 'g') return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc' }) /***/ }, /***/ 4488: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const TypeError = global.TypeError // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it) return it } /***/ }, /***/ 3505: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) // eslint-disable-next-line es/no-object-defineproperty -- safe const defineProperty = Object.defineProperty module.exports = function (key, value) { try { defineProperty(global, key, { value, configurable: true, writable: true }) } catch (error) { global[key] = value } return value } /***/ }, /***/ 6340: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const getBuiltIn = __webpack_require__(5005) const definePropertyModule = __webpack_require__(3070) const wellKnownSymbol = __webpack_require__(5112) const DESCRIPTORS = __webpack_require__(9781) const SPECIES = wellKnownSymbol('species') module.exports = function (CONSTRUCTOR_NAME) { const Constructor = getBuiltIn(CONSTRUCTOR_NAME) const defineProperty = definePropertyModule.f if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineProperty(Constructor, SPECIES, { configurable: true, get: function () { return this } }) } } /***/ }, /***/ 8003: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const defineProperty = (__webpack_require__(3070).f) const hasOwn = __webpack_require__(2597) const wellKnownSymbol = __webpack_require__(5112) const TO_STRING_TAG = wellKnownSymbol('toStringTag') module.exports = function (it, TAG, STATIC) { if (it && !hasOwn(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }) } } /***/ }, /***/ 6200: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const shared = __webpack_require__(2309) const uid = __webpack_require__(9711) const keys = shared('keys') module.exports = function (key) { return keys[key] || (keys[key] = uid(key)) } /***/ }, /***/ 5465: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const setGlobal = __webpack_require__(3505) const SHARED = '__core-js_shared__' const store = global[SHARED] || setGlobal(SHARED, {}) module.exports = store /***/ }, /***/ 2309: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const IS_PURE = __webpack_require__(1913) const store = __webpack_require__(5465); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}) })('versions', []).push({ version: '3.19.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }) /***/ }, /***/ 6707: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const anObject = __webpack_require__(9670) const aConstructor = __webpack_require__(9483) const wellKnownSymbol = __webpack_require__(5112) const SPECIES = wellKnownSymbol('species') // `SpeciesConstructor` abstract operation // https://tc39.es/ecma262/#sec-speciesconstructor module.exports = function (O, defaultConstructor) { const C = anObject(O).constructor let S return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S) } /***/ }, /***/ 3429: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const fails = __webpack_require__(7293) // check the existence of a method, lowercase // of a tag and escaping quotes in arguments module.exports = function (METHOD_NAME) { return fails(function () { const test = ''[METHOD_NAME]('"') return test !== test.toLowerCase() || test.split('"').length > 3 }) } /***/ }, /***/ 8710: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const toIntegerOrInfinity = __webpack_require__(9303) const toString = __webpack_require__(1340) const requireObjectCoercible = __webpack_require__(4488) const charAt = uncurryThis(''.charAt) const charCodeAt = uncurryThis(''.charCodeAt) const stringSlice = uncurryThis(''.slice) const createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { const S = toString(requireObjectCoercible($this)) const position = toIntegerOrInfinity(pos) const size = S.length let first, second if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined first = charCodeAt(S, position) return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000 } } module.exports = { // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat codeAt: createMethod(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod(true) } /***/ }, /***/ 8415: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const toIntegerOrInfinity = __webpack_require__(9303) const toString = __webpack_require__(1340) const requireObjectCoercible = __webpack_require__(4488) const RangeError = global.RangeError // `String.prototype.repeat` method implementation // https://tc39.es/ecma262/#sec-string.prototype.repeat module.exports = function repeat (count) { let str = toString(requireObjectCoercible(this)) let result = '' let n = toIntegerOrInfinity(count) if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions') for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str return result } /***/ }, /***/ 6091: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const PROPER_FUNCTION_NAME = (__webpack_require__(6530).PROPER) const fails = __webpack_require__(7293) const whitespaces = __webpack_require__(1361) const non = '\u200B\u0085\u180E' // check that a method works with the correct list // of whitespaces and has a correct name module.exports = function (METHOD_NAME) { return fails(function () { return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME) }) } /***/ }, /***/ 3111: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) const requireObjectCoercible = __webpack_require__(4488) const toString = __webpack_require__(1340) const whitespaces = __webpack_require__(1361) const replace = uncurryThis(''.replace) const whitespace = '[' + whitespaces + ']' const ltrim = RegExp('^' + whitespace + whitespace + '*') const rtrim = RegExp(whitespace + whitespace + '*$') // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation const createMethod = function (TYPE) { return function ($this) { let string = toString(requireObjectCoercible($this)) if (TYPE & 1) string = replace(string, ltrim, '') if (TYPE & 2) string = replace(string, rtrim, '') return string } } module.exports = { // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimstart start: createMethod(1), // `String.prototype.{ trimRight, trimEnd }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimend end: createMethod(2), // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim trim: createMethod(3) } /***/ }, /***/ 261: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const apply = __webpack_require__(2104) const bind = __webpack_require__(9974) const isCallable = __webpack_require__(614) const hasOwn = __webpack_require__(2597) const fails = __webpack_require__(7293) const html = __webpack_require__(490) const arraySlice = __webpack_require__(206) const createElement = __webpack_require__(317) const IS_IOS = __webpack_require__(6833) const IS_NODE = __webpack_require__(5268) let set = global.setImmediate let clear = global.clearImmediate const process = global.process const Dispatch = global.Dispatch const Function = global.Function const MessageChannel = global.MessageChannel const String = global.String let counter = 0 const queue = {} const ONREADYSTATECHANGE = 'onreadystatechange' let location, defer, channel, port try { // Deno throws a ReferenceError on `location` access without `--location` flag location = global.location } catch (error) { /* empty */ } const run = function (id) { if (hasOwn(queue, id)) { const fn = queue[id] delete queue[id] fn() } } const runner = function (id) { return function () { run(id) } } const listener = function (event) { run(event.data) } const post = function (id) { // old engines have not location.origin global.postMessage(String(id), location.protocol + '//' + location.host) } // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!set || !clear) { set = function setImmediate (fn) { const args = arraySlice(arguments, 1) queue[++counter] = function () { apply(isCallable(fn) ? fn : Function(fn), undefined, args) } defer(counter) return counter } clear = function clearImmediate (id) { delete queue[id] } // Node.js 0.8- if (IS_NODE) { defer = function (id) { process.nextTick(runner(id)) } // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(runner(id)) } // Browsers with MessageChannel, includes WebWorkers // except iOS - https://github.com/zloirock/core-js/issues/624 } else if (MessageChannel && !IS_IOS) { channel = new MessageChannel() port = channel.port2 channel.port1.onmessage = listener defer = bind(port.postMessage, port) // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if ( global.addEventListener && isCallable(global.postMessage) && !global.importScripts && location && location.protocol !== 'file:' && !fails(post) ) { defer = post global.addEventListener('message', listener, false) // IE8- } else if (ONREADYSTATECHANGE in createElement('script')) { defer = function (id) { html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this) run(id) } } // Rest old browsers } else { defer = function (id) { setTimeout(runner(id), 0) } } } module.exports = { set, clear } /***/ }, /***/ 863: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) // `thisNumberValue` abstract operation // https://tc39.es/ecma262/#sec-thisnumbervalue module.exports = uncurryThis(1.0.valueOf) /***/ }, /***/ 1400: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const toIntegerOrInfinity = __webpack_require__(9303) const max = Math.max const min = Math.min // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { const integer = toIntegerOrInfinity(index) return integer < 0 ? max(integer + length, 0) : min(integer, length) } /***/ }, /***/ 7067: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const toIntegerOrInfinity = __webpack_require__(9303) const toLength = __webpack_require__(7466) const RangeError = global.RangeError // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex module.exports = function (it) { if (it === undefined) return 0 const number = toIntegerOrInfinity(it) const length = toLength(number) if (number !== length) throw RangeError('Wrong length or index') return length } /***/ }, /***/ 5656: /***/ function (module, __unused_webpack_exports, __webpack_require__) { // toObject with fallback for non-array-like ES3 strings const IndexedObject = __webpack_require__(8361) const requireObjectCoercible = __webpack_require__(4488) module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)) } /***/ }, /***/ 9303: /***/ function (module) { const ceil = Math.ceil const floor = Math.floor // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity module.exports = function (argument) { const number = +argument // eslint-disable-next-line no-self-compare -- safe return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number) } /***/ }, /***/ 7466: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const toIntegerOrInfinity = __webpack_require__(9303) const min = Math.min // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0 // 2 ** 53 - 1 == 9007199254740991 } /***/ }, /***/ 7908: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const requireObjectCoercible = __webpack_require__(4488) const Object = global.Object // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)) } /***/ }, /***/ 4590: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const toPositiveInteger = __webpack_require__(3002) const RangeError = global.RangeError module.exports = function (it, BYTES) { const offset = toPositiveInteger(it) if (offset % BYTES) throw RangeError('Wrong offset') return offset } /***/ }, /***/ 3002: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const toIntegerOrInfinity = __webpack_require__(9303) const RangeError = global.RangeError module.exports = function (it) { const result = toIntegerOrInfinity(it) if (result < 0) throw RangeError("The argument can't be less than 0") return result } /***/ }, /***/ 7593: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const call = __webpack_require__(6916) const isObject = __webpack_require__(111) const isSymbol = __webpack_require__(2190) const getMethod = __webpack_require__(8173) const ordinaryToPrimitive = __webpack_require__(2140) const wellKnownSymbol = __webpack_require__(5112) const TypeError = global.TypeError const TO_PRIMITIVE = wellKnownSymbol('toPrimitive') // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input const exoticToPrim = getMethod(input, TO_PRIMITIVE) let result if (exoticToPrim) { if (pref === undefined) pref = 'default' result = call(exoticToPrim, input, pref) if (!isObject(result) || isSymbol(result)) return result throw TypeError("Can't convert object to primitive value") } if (pref === undefined) pref = 'number' return ordinaryToPrimitive(input, pref) } /***/ }, /***/ 4948: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const toPrimitive = __webpack_require__(7593) const isSymbol = __webpack_require__(2190) // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey module.exports = function (argument) { const key = toPrimitive(argument, 'string') return isSymbol(key) ? key : key + '' } /***/ }, /***/ 1694: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const wellKnownSymbol = __webpack_require__(5112) const TO_STRING_TAG = wellKnownSymbol('toStringTag') const test = {} test[TO_STRING_TAG] = 'z' module.exports = String(test) === '[object z]' /***/ }, /***/ 1340: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const classof = __webpack_require__(648) const String = global.String module.exports = function (argument) { if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string') return String(argument) } /***/ }, /***/ 6330: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const String = global.String module.exports = function (argument) { try { return String(argument) } catch (error) { return 'Object' } } /***/ }, /***/ 9843: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const call = __webpack_require__(6916) const DESCRIPTORS = __webpack_require__(9781) const TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(3832) const ArrayBufferViewCore = __webpack_require__(2094) const ArrayBufferModule = __webpack_require__(2091) const anInstance = __webpack_require__(5787) const createPropertyDescriptor = __webpack_require__(9114) const createNonEnumerableProperty = __webpack_require__(8880) const isIntegralNumber = __webpack_require__(5988) const toLength = __webpack_require__(7466) const toIndex = __webpack_require__(7067) const toOffset = __webpack_require__(4590) const toPropertyKey = __webpack_require__(4948) const hasOwn = __webpack_require__(2597) const classof = __webpack_require__(648) const isObject = __webpack_require__(111) const isSymbol = __webpack_require__(2190) const create = __webpack_require__(30) const isPrototypeOf = __webpack_require__(7976) const setPrototypeOf = __webpack_require__(7674) const getOwnPropertyNames = (__webpack_require__(8006).f) const typedArrayFrom = __webpack_require__(7321) const forEach = (__webpack_require__(2092).forEach) const setSpecies = __webpack_require__(6340) const definePropertyModule = __webpack_require__(3070) const getOwnPropertyDescriptorModule = __webpack_require__(1236) const InternalStateModule = __webpack_require__(9909) const inheritIfRequired = __webpack_require__(9587) const getInternalState = InternalStateModule.get const setInternalState = InternalStateModule.set const nativeDefineProperty = definePropertyModule.f const nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f const round = Math.round const RangeError = global.RangeError const ArrayBuffer = ArrayBufferModule.ArrayBuffer const ArrayBufferPrototype = ArrayBuffer.prototype const DataView = ArrayBufferModule.DataView const NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS const TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR const TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG const TypedArray = ArrayBufferViewCore.TypedArray const TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype const aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor const isTypedArray = ArrayBufferViewCore.isTypedArray const BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT' const WRONG_LENGTH = 'Wrong length' const fromList = function (C, list) { aTypedArrayConstructor(C) let index = 0 const length = list.length const result = new C(length) while (length > index) result[index] = list[index++] return result } const addGetter = function (it, key) { nativeDefineProperty(it, key, { get: function () { return getInternalState(this)[key] } }) } const isArrayBuffer = function (it) { let klass return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer' } const isTypedArrayIndex = function (target, key) { return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0 } const wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor (target, key) { key = toPropertyKey(key) return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key) } const wrappedDefineProperty = function defineProperty (target, key, descriptor) { key = toPropertyKey(key) if (isTypedArrayIndex(target, key) && isObject(descriptor) && hasOwn(descriptor, 'value') && !hasOwn(descriptor, 'get') && !hasOwn(descriptor, 'set') && // TODO: add validation descriptor w/o calling accessors !descriptor.configurable && (!hasOwn(descriptor, 'writable') || descriptor.writable) && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable) ) { target[key] = descriptor.value return target } return nativeDefineProperty(target, key, descriptor) } if (DESCRIPTORS) { if (!NATIVE_ARRAY_BUFFER_VIEWS) { getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor definePropertyModule.f = wrappedDefineProperty addGetter(TypedArrayPrototype, 'buffer') addGetter(TypedArrayPrototype, 'byteOffset') addGetter(TypedArrayPrototype, 'byteLength') addGetter(TypedArrayPrototype, 'length') } $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, { getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor, defineProperty: wrappedDefineProperty }) module.exports = function (TYPE, wrapper, CLAMPED) { const BYTES = TYPE.match(/\d+$/)[0] / 8 const CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array' const GETTER = 'get' + TYPE const SETTER = 'set' + TYPE const NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME] let TypedArrayConstructor = NativeTypedArrayConstructor let TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype const exported = {} const getter = function (that, index) { const data = getInternalState(that) return data.view[GETTER](index * BYTES + data.byteOffset, true) } const setter = function (that, index, value) { const data = getInternalState(that) if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF data.view[SETTER](index * BYTES + data.byteOffset, value, true) } const addElement = function (that, index) { nativeDefineProperty(that, index, { get: function () { return getter(this, index) }, set: function (value) { return setter(this, index, value) }, enumerable: true }) } if (!NATIVE_ARRAY_BUFFER_VIEWS) { TypedArrayConstructor = wrapper(function (that, data, offset, $length) { anInstance(that, TypedArrayConstructorPrototype) let index = 0 let byteOffset = 0 let buffer, byteLength, length if (!isObject(data)) { length = toIndex(data) byteLength = length * BYTES buffer = new ArrayBuffer(byteLength) } else if (isArrayBuffer(data)) { buffer = data byteOffset = toOffset(offset, BYTES) const $len = data.byteLength if ($length === undefined) { if ($len % BYTES) throw RangeError(WRONG_LENGTH) byteLength = $len - byteOffset if (byteLength < 0) throw RangeError(WRONG_LENGTH) } else { byteLength = toLength($length) * BYTES if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH) } length = byteLength / BYTES } else if (isTypedArray(data)) { return fromList(TypedArrayConstructor, data) } else { return call(typedArrayFrom, TypedArrayConstructor, data) } setInternalState(that, { buffer, byteOffset, byteLength, length, view: new DataView(buffer) }) while (index < length) addElement(that, index++) }) if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray) TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype) } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) { TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { anInstance(dummy, TypedArrayConstructorPrototype) return inheritIfRequired((function () { if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data)) if (isArrayBuffer(data)) { return $length !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== undefined ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data) } if (isTypedArray(data)) return fromList(TypedArrayConstructor, data) return call(typedArrayFrom, TypedArrayConstructor, data) }()), dummy, TypedArrayConstructor) }) if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray) forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { if (!(key in TypedArrayConstructor)) { createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]) } }) TypedArrayConstructor.prototype = TypedArrayConstructorPrototype } if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor) } createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor) if (TYPED_ARRAY_TAG) { createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME) } exported[CONSTRUCTOR_NAME] = TypedArrayConstructor $({ global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported) if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES) } if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES) } setSpecies(CONSTRUCTOR_NAME) } } else module.exports = function () { /* empty */ } /***/ }, /***/ 3832: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable no-new -- required for testing */ const global = __webpack_require__(7854) const fails = __webpack_require__(7293) const checkCorrectnessOfIteration = __webpack_require__(7072) const NATIVE_ARRAY_BUFFER_VIEWS = (__webpack_require__(2094).NATIVE_ARRAY_BUFFER_VIEWS) const ArrayBuffer = global.ArrayBuffer const Int8Array = global.Int8Array module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () { Int8Array(1) }) || !fails(function () { new Int8Array(-1) }) || !checkCorrectnessOfIteration(function (iterable) { new Int8Array() new Int8Array(null) new Int8Array(1.5) new Int8Array(iterable) }, true) || fails(function () { // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1 }) /***/ }, /***/ 3074: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const arrayFromConstructorAndList = __webpack_require__(7745) const typedArraySpeciesConstructor = __webpack_require__(6304) module.exports = function (instance, list) { return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list) } /***/ }, /***/ 7321: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const bind = __webpack_require__(9974) const call = __webpack_require__(6916) const aConstructor = __webpack_require__(9483) const toObject = __webpack_require__(7908) const lengthOfArrayLike = __webpack_require__(6244) const getIterator = __webpack_require__(8554) const getIteratorMethod = __webpack_require__(1246) const isArrayIteratorMethod = __webpack_require__(7659) const aTypedArrayConstructor = (__webpack_require__(2094).aTypedArrayConstructor) module.exports = function from (source /* , mapfn, thisArg */) { const C = aConstructor(this) let O = toObject(source) const argumentsLength = arguments.length let mapfn = argumentsLength > 1 ? arguments[1] : undefined const mapping = mapfn !== undefined const iteratorMethod = getIteratorMethod(O) let i, length, result, step, iterator, next if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { iterator = getIterator(O, iteratorMethod) next = iterator.next O = [] while (!(step = call(next, iterator)).done) { O.push(step.value) } } if (mapping && argumentsLength > 2) { mapfn = bind(mapfn, arguments[2]) } length = lengthOfArrayLike(O) result = new (aTypedArrayConstructor(C))(length) for (i = 0; length > i; i++) { result[i] = mapping ? mapfn(O[i], i) : O[i] } return result } /***/ }, /***/ 6304: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const ArrayBufferViewCore = __webpack_require__(2094) const speciesConstructor = __webpack_require__(6707) const TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR const aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor // a part of `TypedArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#typedarray-species-create module.exports = function (originalArray) { return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR])) } /***/ }, /***/ 9711: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const uncurryThis = __webpack_require__(1702) let id = 0 const postfix = Math.random() const toString = uncurryThis(1.0.toString) module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36) } /***/ }, /***/ 3307: /***/ function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable es/no-symbol -- required for testing */ const NATIVE_SYMBOL = __webpack_require__(133) module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator === 'symbol' /***/ }, /***/ 6061: /***/ function (__unused_webpack_module, exports, __webpack_require__) { const wellKnownSymbol = __webpack_require__(5112) exports.f = wellKnownSymbol /***/ }, /***/ 5112: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const shared = __webpack_require__(2309) const hasOwn = __webpack_require__(2597) const uid = __webpack_require__(9711) const NATIVE_SYMBOL = __webpack_require__(133) const USE_SYMBOL_AS_UID = __webpack_require__(3307) const WellKnownSymbolsStore = shared('wks') const Symbol = global.Symbol const symbolFor = Symbol && Symbol.for const createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] === 'string')) { const description = 'Symbol.' + name if (NATIVE_SYMBOL && hasOwn(Symbol, name)) { WellKnownSymbolsStore[name] = Symbol[name] } else if (USE_SYMBOL_AS_UID && symbolFor) { WellKnownSymbolsStore[name] = symbolFor(description) } else { WellKnownSymbolsStore[name] = createWellKnownSymbol(description) } } return WellKnownSymbolsStore[name] } /***/ }, /***/ 1361: /***/ function (module) { // a string of all valid unicode whitespaces module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' /***/ }, /***/ 9170: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const isPrototypeOf = __webpack_require__(7976) const getPrototypeOf = __webpack_require__(9518) const setPrototypeOf = __webpack_require__(7674) const copyConstructorProperties = __webpack_require__(9920) const create = __webpack_require__(30) const createNonEnumerableProperty = __webpack_require__(8880) const createPropertyDescriptor = __webpack_require__(9114) const clearErrorStack = __webpack_require__(7741) const installErrorCause = __webpack_require__(8340) const iterate = __webpack_require__(408) const normalizeStringArgument = __webpack_require__(6277) const ERROR_STACK_INSTALLABLE = __webpack_require__(2914) const Error = global.Error const push = [].push const $AggregateError = function AggregateError (errors, message /* , options */) { let that = isPrototypeOf(AggregateErrorPrototype, this) ? this : create(AggregateErrorPrototype) const options = arguments.length > 2 ? arguments[2] : undefined if (setPrototypeOf) { that = setPrototypeOf(new Error(undefined), getPrototypeOf(that)) } createNonEnumerableProperty(that, 'message', normalizeStringArgument(message, '')) if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1)) installErrorCause(that, options) const errorsArray = [] iterate(errors, push, { that: errorsArray }) createNonEnumerableProperty(that, 'errors', errorsArray) return that } if (setPrototypeOf) setPrototypeOf($AggregateError, Error) else copyConstructorProperties($AggregateError, Error) var AggregateErrorPrototype = $AggregateError.prototype = create(Error.prototype, { constructor: createPropertyDescriptor(1, $AggregateError), message: createPropertyDescriptor(1, ''), name: createPropertyDescriptor(1, 'AggregateError') }) // `AggregateError` constructor // https://tc39.es/ecma262/#sec-aggregate-error-constructor $({ global: true }, { AggregateError: $AggregateError }) /***/ }, /***/ 2222: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const fails = __webpack_require__(7293) const isArray = __webpack_require__(3157) const isObject = __webpack_require__(111) const toObject = __webpack_require__(7908) const lengthOfArrayLike = __webpack_require__(6244) const createProperty = __webpack_require__(6135) const arraySpeciesCreate = __webpack_require__(5417) const arrayMethodHasSpeciesSupport = __webpack_require__(1194) const wellKnownSymbol = __webpack_require__(5112) const V8_VERSION = __webpack_require__(7392) const IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable') const MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF const MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded' const TypeError = global.TypeError // We can't use this feature detection in V8 since it causes // deoptimization and serious performance degradation // https://github.com/zloirock/core-js/issues/679 const IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { const array = [] array[IS_CONCAT_SPREADABLE] = false return array.concat()[0] !== array }) const SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat') const isConcatSpreadable = function (O) { if (!isObject(O)) return false const spreadable = O[IS_CONCAT_SPREADABLE] return spreadable !== undefined ? !!spreadable : isArray(O) } const FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species $({ target: 'Array', proto: true, forced: FORCED }, { // eslint-disable-next-line no-unused-vars -- required for `.length` concat: function concat (arg) { const O = toObject(this) const A = arraySpeciesCreate(O, 0) let n = 0 let i, k, length, len, E for (i = -1, length = arguments.length; i < length; i++) { E = i === -1 ? O : arguments[i] if (isConcatSpreadable(E)) { len = lengthOfArrayLike(E) if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED) for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]) } else { if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED) createProperty(A, n++, E) } } A.length = n return A } }) /***/ }, /***/ 545: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const copyWithin = __webpack_require__(1048) const addToUnscopables = __webpack_require__(1223) // `Array.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-array.prototype.copywithin $({ target: 'Array', proto: true }, { copyWithin }) // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('copyWithin') /***/ }, /***/ 3290: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const fill = __webpack_require__(1285) const addToUnscopables = __webpack_require__(1223) // `Array.prototype.fill` method // https://tc39.es/ecma262/#sec-array.prototype.fill $({ target: 'Array', proto: true }, { fill }) // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('fill') /***/ }, /***/ 7327: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const $filter = (__webpack_require__(2092).filter) const arrayMethodHasSpeciesSupport = __webpack_require__(1194) const HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter') // `Array.prototype.filter` method // https://tc39.es/ecma262/#sec-array.prototype.filter // with adding support of @@species $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { filter: function filter (callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined) } }) /***/ }, /***/ 1038: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const from = __webpack_require__(8457) const checkCorrectnessOfIteration = __webpack_require__(7072) const INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { // eslint-disable-next-line es/no-array-from -- required for testing Array.from(iterable) }) // `Array.from` method // https://tc39.es/ecma262/#sec-array.from $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { from }) /***/ }, /***/ 6699: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const $includes = (__webpack_require__(1318).includes) const addToUnscopables = __webpack_require__(1223) // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes $({ target: 'Array', proto: true }, { includes: function includes (el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined) } }) // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('includes') /***/ }, /***/ 6992: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const toIndexedObject = __webpack_require__(5656) const addToUnscopables = __webpack_require__(1223) const Iterators = __webpack_require__(7497) const InternalStateModule = __webpack_require__(9909) const defineIterator = __webpack_require__(654) const ARRAY_ITERATOR = 'Array Iterator' const setInternalState = InternalStateModule.set const getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR) // `Array.prototype.entries` method // https://tc39.es/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.es/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.es/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.es/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind // kind }) // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { const state = getInternalState(this) const target = state.target const kind = state.kind const index = state.index++ if (!target || index >= target.length) { state.target = undefined return { value: undefined, done: true } } if (kind == 'keys') return { value: index, done: false } if (kind == 'values') return { value: target[index], done: false } return { value: [index, target[index]], done: false } }, 'values') // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys') addToUnscopables('values') addToUnscopables('entries') /***/ }, /***/ 9600: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const uncurryThis = __webpack_require__(1702) const IndexedObject = __webpack_require__(8361) const toIndexedObject = __webpack_require__(5656) const arrayMethodIsStrict = __webpack_require__(9341) const un$Join = uncurryThis([].join) const ES3_STRINGS = IndexedObject != Object const STRICT_METHOD = arrayMethodIsStrict('join', ',') // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, { join: function join (separator) { return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator) } }) /***/ }, /***/ 1249: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const $map = (__webpack_require__(2092).map) const arrayMethodHasSpeciesSupport = __webpack_require__(1194) const HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map') // `Array.prototype.map` method // https://tc39.es/ecma262/#sec-array.prototype.map // with adding support of @@species $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { map: function map (callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined) } }) /***/ }, /***/ 7042: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const isArray = __webpack_require__(3157) const isConstructor = __webpack_require__(4411) const isObject = __webpack_require__(111) const toAbsoluteIndex = __webpack_require__(1400) const lengthOfArrayLike = __webpack_require__(6244) const toIndexedObject = __webpack_require__(5656) const createProperty = __webpack_require__(6135) const wellKnownSymbol = __webpack_require__(5112) const arrayMethodHasSpeciesSupport = __webpack_require__(1194) const un$Slice = __webpack_require__(206) const HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice') const SPECIES = wellKnownSymbol('species') const Array = global.Array const max = Math.max // `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { slice: function slice (start, end) { const O = toIndexedObject(this) const length = lengthOfArrayLike(O) let k = toAbsoluteIndex(start, length) const fin = toAbsoluteIndex(end === undefined ? length : end, length) // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible let Constructor, result, n if (isArray(O)) { Constructor = O.constructor // cross-realm fallback if (isConstructor(Constructor) && (Constructor === Array || isArray(Constructor.prototype))) { Constructor = undefined } else if (isObject(Constructor)) { Constructor = Constructor[SPECIES] if (Constructor === null) Constructor = undefined } if (Constructor === Array || Constructor === undefined) { return un$Slice(O, k, fin) } } result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)) for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]) result.length = n return result } }) /***/ }, /***/ 2707: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const uncurryThis = __webpack_require__(1702) const aCallable = __webpack_require__(9662) const toObject = __webpack_require__(7908) const lengthOfArrayLike = __webpack_require__(6244) const toString = __webpack_require__(1340) const fails = __webpack_require__(7293) const internalSort = __webpack_require__(4362) const arrayMethodIsStrict = __webpack_require__(9341) const FF = __webpack_require__(8886) const IE_OR_EDGE = __webpack_require__(256) const V8 = __webpack_require__(7392) const WEBKIT = __webpack_require__(8008) const test = [] const un$Sort = uncurryThis(test.sort) const push = uncurryThis(test.push) // IE8- const FAILS_ON_UNDEFINED = fails(function () { test.sort(undefined) }) // V8 bug const FAILS_ON_NULL = fails(function () { test.sort(null) }) // Old WebKit const STRICT_METHOD = arrayMethodIsStrict('sort') const STABLE_SORT = !fails(function () { // feature detection can be too slow, so check engines versions if (V8) return V8 < 70 if (FF && FF > 3) return if (IE_OR_EDGE) return true if (WEBKIT) return WEBKIT < 603 let result = '' let code, chr, value, index // generate an array with more 512 elements (Chakra and old V8 fails only in this case) for (code = 65; code < 76; code++) { chr = String.fromCharCode(code) switch (code) { case 66: case 69: case 70: case 72: value = 3; break case 68: case 71: value = 4; break default: value = 2 } for (index = 0; index < 47; index++) { test.push({ k: chr + index, v: value }) } } test.sort(function (a, b) { return b.v - a.v }) for (index = 0; index < test.length; index++) { chr = test[index].k.charAt(0) if (result.charAt(result.length - 1) !== chr) result += chr } return result !== 'DGBEFHACIJK' }) const FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT const getSortCompare = function (comparefn) { return function (x, y) { if (y === undefined) return -1 if (x === undefined) return 1 if (comparefn !== undefined) return +comparefn(x, y) || 0 return toString(x) > toString(y) ? 1 : -1 } } // `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort $({ target: 'Array', proto: true, forced: FORCED }, { sort: function sort (comparefn) { if (comparefn !== undefined) aCallable(comparefn) const array = toObject(this) if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn) const items = [] const arrayLength = lengthOfArrayLike(array) let itemsLength, index for (index = 0; index < arrayLength; index++) { if (index in array) push(items, array[index]) } internalSort(items, getSortCompare(comparefn)) itemsLength = items.length index = 0 while (index < itemsLength) array[index] = items[index++] while (index < arrayLength) delete array[index++] return array } }) /***/ }, /***/ 561: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const toAbsoluteIndex = __webpack_require__(1400) const toIntegerOrInfinity = __webpack_require__(9303) const lengthOfArrayLike = __webpack_require__(6244) const toObject = __webpack_require__(7908) const arraySpeciesCreate = __webpack_require__(5417) const createProperty = __webpack_require__(6135) const arrayMethodHasSpeciesSupport = __webpack_require__(1194) const HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice') const TypeError = global.TypeError const max = Math.max const min = Math.min const MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF const MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded' // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice (start, deleteCount /* , ...items */) { const O = toObject(this) const len = lengthOfArrayLike(O) const actualStart = toAbsoluteIndex(start, len) const argumentsLength = arguments.length let insertCount, actualDeleteCount, A, k, from, to if (argumentsLength === 0) { insertCount = actualDeleteCount = 0 } else if (argumentsLength === 1) { insertCount = 0 actualDeleteCount = len - actualStart } else { insertCount = argumentsLength - 2 actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart) } if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED) } A = arraySpeciesCreate(O, actualDeleteCount) for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k if (from in O) createProperty(A, k, O[from]) } A.length = actualDeleteCount if (insertCount < actualDeleteCount) { for (k = actualStart; k < len - actualDeleteCount; k++) { from = k + actualDeleteCount to = k + insertCount if (from in O) O[to] = O[from] else delete O[to] } for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1] } else if (insertCount > actualDeleteCount) { for (k = len - actualDeleteCount; k > actualStart; k--) { from = k + actualDeleteCount - 1 to = k + insertCount - 1 if (from in O) O[to] = O[from] else delete O[to] } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2] } O.length = len - actualDeleteCount + insertCount return A } }) /***/ }, /***/ 6078: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const hasOwn = __webpack_require__(2597) const redefine = __webpack_require__(1320) const dateToPrimitive = __webpack_require__(8709) const wellKnownSymbol = __webpack_require__(5112) const TO_PRIMITIVE = wellKnownSymbol('toPrimitive') const DatePrototype = Date.prototype // `Date.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive if (!hasOwn(DatePrototype, TO_PRIMITIVE)) { redefine(DatePrototype, TO_PRIMITIVE, dateToPrimitive) } /***/ }, /***/ 8309: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const FUNCTION_NAME_EXISTS = (__webpack_require__(6530).EXISTS) const uncurryThis = __webpack_require__(1702) const defineProperty = (__webpack_require__(3070).f) const FunctionPrototype = Function.prototype const functionToString = uncurryThis(FunctionPrototype.toString) const nameRE = /^\s*function ([^ (]*)/ const regExpExec = uncurryThis(nameRE.exec) const NAME = 'name' // Function instances `.name` property // https://tc39.es/ecma262/#sec-function-instances-name if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) { defineProperty(FunctionPrototype, NAME, { configurable: true, get: function () { try { return regExpExec(nameRE, functionToString(this))[1] } catch (error) { return '' } } }) } /***/ }, /***/ 5837: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const global = __webpack_require__(7854) // `globalThis` object // https://tc39.es/ecma262/#sec-globalthis $({ global: true }, { globalThis: global }) /***/ }, /***/ 1532: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const collection = __webpack_require__(7710) const collectionStrong = __webpack_require__(5631) // `Map` constructor // https://tc39.es/ecma262/#sec-map-objects collection('Map', function (init) { return function Map () { return init(this, arguments.length ? arguments[0] : undefined) } }, collectionStrong) /***/ }, /***/ 4256: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const log = Math.log const LN2 = Math.LN2 // `Math.log2` method // https://tc39.es/ecma262/#sec-math.log2 $({ target: 'Math', stat: true }, { log2: function log2 (x) { return log(x) / LN2 } }) /***/ }, /***/ 9653: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const DESCRIPTORS = __webpack_require__(9781) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const isForced = __webpack_require__(4705) const redefine = __webpack_require__(1320) const hasOwn = __webpack_require__(2597) const inheritIfRequired = __webpack_require__(9587) const isPrototypeOf = __webpack_require__(7976) const isSymbol = __webpack_require__(2190) const toPrimitive = __webpack_require__(7593) const fails = __webpack_require__(7293) const getOwnPropertyNames = (__webpack_require__(8006).f) const getOwnPropertyDescriptor = (__webpack_require__(1236).f) const defineProperty = (__webpack_require__(3070).f) const thisNumberValue = __webpack_require__(863) const trim = (__webpack_require__(3111).trim) const NUMBER = 'Number' const NativeNumber = global[NUMBER] const NumberPrototype = NativeNumber.prototype const TypeError = global.TypeError const arraySlice = uncurryThis(''.slice) const charCodeAt = uncurryThis(''.charCodeAt) // `ToNumeric` abstract operation // https://tc39.es/ecma262/#sec-tonumeric const toNumeric = function (value) { const primValue = toPrimitive(value, 'number') return typeof primValue === 'bigint' ? primValue : toNumber(primValue) } // `ToNumber` abstract operation // https://tc39.es/ecma262/#sec-tonumber var toNumber = function (argument) { let it = toPrimitive(argument, 'number') let first, third, radix, maxCode, digits, length, index, code if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number') if (typeof it === 'string' && it.length > 2) { it = trim(it) first = charCodeAt(it, 0) if (first === 43 || first === 45) { third = charCodeAt(it, 2) if (third === 88 || third === 120) return NaN // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { switch (charCodeAt(it, 1)) { case 66: case 98: radix = 2; maxCode = 49; break // fast equal of /^0b[01]+$/i case 79: case 111: radix = 8; maxCode = 55; break // fast equal of /^0o[0-7]+$/i default: return +it } digits = arraySlice(it, 2) length = digits.length for (index = 0; index < length; index++) { code = charCodeAt(digits, index) // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) return NaN } return parseInt(digits, radix) } } return +it } // `Number` constructor // https://tc39.es/ecma262/#sec-number-constructor if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { const NumberWrapper = function Number (value) { const n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)) const dummy = this // check on 1..constructor(foo) case return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy) }) ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n } for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES2015 (in case, if modules with ES2015 Number statics required before): 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' + // ESNext 'fromString,range' ).split(','), j = 0, key; keys.length > j; j++) { if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) { defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)) } } NumberWrapper.prototype = NumberPrototype NumberPrototype.constructor = NumberWrapper redefine(global, NUMBER, NumberWrapper) } /***/ }, /***/ 3299: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) // `Number.EPSILON` constant // https://tc39.es/ecma262/#sec-number.epsilon $({ target: 'Number', stat: true }, { EPSILON: Math.pow(2, -52) }) /***/ }, /***/ 5192: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const numberIsFinite = __webpack_require__(7023) // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite $({ target: 'Number', stat: true }, { isFinite: numberIsFinite }) /***/ }, /***/ 3161: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const isIntegralNumber = __webpack_require__(5988) // `Number.isInteger` method // https://tc39.es/ecma262/#sec-number.isinteger $({ target: 'Number', stat: true }, { isInteger: isIntegralNumber }) /***/ }, /***/ 6977: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const toIntegerOrInfinity = __webpack_require__(9303) const thisNumberValue = __webpack_require__(863) const $repeat = __webpack_require__(8415) const fails = __webpack_require__(7293) const RangeError = global.RangeError const String = global.String const floor = Math.floor const repeat = uncurryThis($repeat) const stringSlice = uncurryThis(''.slice) const un$ToFixed = uncurryThis(1.0.toFixed) const pow = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc) } const log = function (x) { let n = 0 let x2 = x while (x2 >= 4096) { n += 12 x2 /= 4096 } while (x2 >= 2) { n += 1 x2 /= 2 } return n } const multiply = function (data, n, c) { let index = -1 let c2 = c while (++index < 6) { c2 += n * data[index] data[index] = c2 % 1e7 c2 = floor(c2 / 1e7) } } const divide = function (data, n) { let index = 6 let c = 0 while (--index >= 0) { c += data[index] data[index] = floor(c / n) c = (c % n) * 1e7 } } const dataToString = function (data) { let index = 6 let s = '' while (--index >= 0) { if (s !== '' || index === 0 || data[index] !== 0) { const t = String(data[index]) s = s === '' ? t : s + repeat('0', 7 - t.length) + t } } return s } const FORCED = fails(function () { return un$ToFixed(0.00008, 3) !== '0.000' || un$ToFixed(0.9, 0) !== '1' || un$ToFixed(1.255, 2) !== '1.25' || un$ToFixed(1000000000000000128.0, 0) !== '1000000000000000128' }) || !fails(function () { // V8 ~ Android 4.3- un$ToFixed({}) }) // `Number.prototype.toFixed` method // https://tc39.es/ecma262/#sec-number.prototype.tofixed $({ target: 'Number', proto: true, forced: FORCED }, { toFixed: function toFixed (fractionDigits) { let number = thisNumberValue(this) const fractDigits = toIntegerOrInfinity(fractionDigits) const data = [0, 0, 0, 0, 0, 0] let sign = '' let result = '0' let e, z, j, k if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits') // eslint-disable-next-line no-self-compare -- NaN check if (number != number) return 'NaN' if (number <= -1e21 || number >= 1e21) return String(number) if (number < 0) { sign = '-' number = -number } if (number > 1e-21) { e = log(number * pow(2, 69, 1)) - 69 z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1) z *= 0x10000000000000 e = 52 - e if (e > 0) { multiply(data, 0, z) j = fractDigits while (j >= 7) { multiply(data, 1e7, 0) j -= 7 } multiply(data, pow(10, j, 1), 0) j = e - 1 while (j >= 23) { divide(data, 1 << 23) j -= 23 } divide(data, 1 << j) multiply(data, 1, 1) divide(data, 2) result = dataToString(data) } else { multiply(data, 0, z) multiply(data, 1 << -e, 0) result = dataToString(data) + repeat('0', fractDigits) } } if (fractDigits > 0) { k = result.length result = sign + (k <= fractDigits ? '0.' + repeat('0', fractDigits - k) + result : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits)) } else { result = sign + result } return result } }) /***/ }, /***/ 9601: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const assign = __webpack_require__(1574) // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign // eslint-disable-next-line es/no-object-assign -- required for testing $({ target: 'Object', stat: true, forced: Object.assign !== assign }, { assign }) /***/ }, /***/ 3371: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const FREEZING = __webpack_require__(6677) const fails = __webpack_require__(7293) const isObject = __webpack_require__(111) const onFreeze = (__webpack_require__(2423).onFreeze) // eslint-disable-next-line es/no-object-freeze -- safe const $freeze = Object.freeze const FAILS_ON_PRIMITIVES = fails(function () { $freeze(1) }) // `Object.freeze` method // https://tc39.es/ecma262/#sec-object.freeze $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { freeze: function freeze (it) { return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it } }) /***/ }, /***/ 5003: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const fails = __webpack_require__(7293) const toIndexedObject = __webpack_require__(5656) const nativeGetOwnPropertyDescriptor = (__webpack_require__(1236).f) const DESCRIPTORS = __webpack_require__(9781) const FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1) }) const FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor (it, key) { return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key) } }) /***/ }, /***/ 9337: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const DESCRIPTORS = __webpack_require__(9781) const ownKeys = __webpack_require__(3887) const toIndexedObject = __webpack_require__(5656) const getOwnPropertyDescriptorModule = __webpack_require__(1236) const createProperty = __webpack_require__(6135) // `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors (object) { const O = toIndexedObject(object) const getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f const keys = ownKeys(O) const result = {} let index = 0 let key, descriptor while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]) if (descriptor !== undefined) createProperty(result, key, descriptor) } return result } }) /***/ }, /***/ 489: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const fails = __webpack_require__(7293) const toObject = __webpack_require__(7908) const nativeGetPrototypeOf = __webpack_require__(9518) const CORRECT_PROTOTYPE_GETTER = __webpack_require__(8544) const FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1) }) // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { getPrototypeOf: function getPrototypeOf (it) { return nativeGetPrototypeOf(toObject(it)) } }) /***/ }, /***/ 7941: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const toObject = __webpack_require__(7908) const nativeKeys = __webpack_require__(1956) const fails = __webpack_require__(7293) const FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1) }) // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { keys: function keys (it) { return nativeKeys(toObject(it)) } }) /***/ }, /***/ 1539: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const TO_STRING_TAG_SUPPORT = __webpack_require__(1694) const redefine = __webpack_require__(1320) const toString = __webpack_require__(288) // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { redefine(Object.prototype, 'toString', toString, { unsafe: true }) } /***/ }, /***/ 2479: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const $values = (__webpack_require__(4699).values) // `Object.values` method // https://tc39.es/ecma262/#sec-object.values $({ target: 'Object', stat: true }, { values: function values (O) { return $values(O) } }) /***/ }, /***/ 7922: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const call = __webpack_require__(6916) const aCallable = __webpack_require__(9662) const newPromiseCapabilityModule = __webpack_require__(8523) const perform = __webpack_require__(2534) const iterate = __webpack_require__(408) // `Promise.allSettled` method // https://tc39.es/ecma262/#sec-promise.allsettled $({ target: 'Promise', stat: true }, { allSettled: function allSettled (iterable) { const C = this const capability = newPromiseCapabilityModule.f(C) const resolve = capability.resolve const reject = capability.reject const result = perform(function () { const promiseResolve = aCallable(C.resolve) const values = [] let counter = 0 let remaining = 1 iterate(iterable, function (promise) { const index = counter++ let alreadyCalled = false remaining++ call(promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return alreadyCalled = true values[index] = { status: 'fulfilled', value } --remaining || resolve(values) }, function (error) { if (alreadyCalled) return alreadyCalled = true values[index] = { status: 'rejected', reason: error } --remaining || resolve(values) }) }) --remaining || resolve(values) }) if (result.error) reject(result.value) return capability.promise } }) /***/ }, /***/ 4668: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const aCallable = __webpack_require__(9662) const getBuiltIn = __webpack_require__(5005) const call = __webpack_require__(6916) const newPromiseCapabilityModule = __webpack_require__(8523) const perform = __webpack_require__(2534) const iterate = __webpack_require__(408) const PROMISE_ANY_ERROR = 'No one promise resolved' // `Promise.any` method // https://tc39.es/ecma262/#sec-promise.any $({ target: 'Promise', stat: true }, { any: function any (iterable) { const C = this const AggregateError = getBuiltIn('AggregateError') const capability = newPromiseCapabilityModule.f(C) const resolve = capability.resolve const reject = capability.reject const result = perform(function () { const promiseResolve = aCallable(C.resolve) const errors = [] let counter = 0 let remaining = 1 let alreadyResolved = false iterate(iterable, function (promise) { const index = counter++ let alreadyRejected = false remaining++ call(promiseResolve, C, promise).then(function (value) { if (alreadyRejected || alreadyResolved) return alreadyResolved = true resolve(value) }, function (error) { if (alreadyRejected || alreadyResolved) return alreadyRejected = true errors[index] = error --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)) }) }) --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR)) }) if (result.error) reject(result.value) return capability.promise } }) /***/ }, /***/ 7727: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const IS_PURE = __webpack_require__(1913) const NativePromise = __webpack_require__(3366) const fails = __webpack_require__(7293) const getBuiltIn = __webpack_require__(5005) const isCallable = __webpack_require__(614) const speciesConstructor = __webpack_require__(6707) const promiseResolve = __webpack_require__(9478) const redefine = __webpack_require__(1320) // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 const NON_GENERIC = !!NativePromise && fails(function () { NativePromise.prototype.finally.call({ then: function () { /* empty */ } }, function () { /* empty */ }) }) // `Promise.prototype.finally` method // https://tc39.es/ecma262/#sec-promise.prototype.finally $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { finally: function (onFinally) { const C = speciesConstructor(this, getBuiltIn('Promise')) const isFunction = isCallable(onFinally) return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x }) } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e }) } : onFinally ) } }) // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then` if (!IS_PURE && isCallable(NativePromise)) { const method = getBuiltIn('Promise').prototype.finally if (NativePromise.prototype.finally !== method) { redefine(NativePromise.prototype, 'finally', method, { unsafe: true }) } } /***/ }, /***/ 8674: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const IS_PURE = __webpack_require__(1913) const global = __webpack_require__(7854) const getBuiltIn = __webpack_require__(5005) const call = __webpack_require__(6916) const NativePromise = __webpack_require__(3366) const redefine = __webpack_require__(1320) const redefineAll = __webpack_require__(2248) const setPrototypeOf = __webpack_require__(7674) const setToStringTag = __webpack_require__(8003) const setSpecies = __webpack_require__(6340) const aCallable = __webpack_require__(9662) const isCallable = __webpack_require__(614) const isObject = __webpack_require__(111) const anInstance = __webpack_require__(5787) const inspectSource = __webpack_require__(2788) const iterate = __webpack_require__(408) const checkCorrectnessOfIteration = __webpack_require__(7072) const speciesConstructor = __webpack_require__(6707) const task = (__webpack_require__(261).set) const microtask = __webpack_require__(5948) const promiseResolve = __webpack_require__(9478) const hostReportErrors = __webpack_require__(842) const newPromiseCapabilityModule = __webpack_require__(8523) const perform = __webpack_require__(2534) const InternalStateModule = __webpack_require__(9909) const isForced = __webpack_require__(4705) const wellKnownSymbol = __webpack_require__(5112) const IS_BROWSER = __webpack_require__(7871) const IS_NODE = __webpack_require__(5268) const V8_VERSION = __webpack_require__(7392) const SPECIES = wellKnownSymbol('species') const PROMISE = 'Promise' const getInternalState = InternalStateModule.get const setInternalState = InternalStateModule.set const getInternalPromiseState = InternalStateModule.getterFor(PROMISE) const NativePromisePrototype = NativePromise && NativePromise.prototype let PromiseConstructor = NativePromise let PromisePrototype = NativePromisePrototype const TypeError = global.TypeError const document = global.document const process = global.process let newPromiseCapability = newPromiseCapabilityModule.f const newGenericPromiseCapability = newPromiseCapability const DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent) const NATIVE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent) const UNHANDLED_REJECTION = 'unhandledrejection' const REJECTION_HANDLED = 'rejectionhandled' const PENDING = 0 const FULFILLED = 1 const REJECTED = 2 const HANDLED = 1 const UNHANDLED = 2 let SUBCLASSING = false let Internal, OwnPromiseCapability, PromiseWrapper, nativeThen const FORCED = isForced(PROMISE, function () { const PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor) const GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor) // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // We can't detect it synchronously, so just check versions if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true // We need Promise#finally in the pure version for preventing prototype pollution if (IS_PURE && !PromisePrototype.finally) return true // We can't use @@species feature detection in V8 since it causes // deoptimization and performance degradation // https://github.com/zloirock/core-js/issues/679 if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false // Detect correctness of subclassing with @@species support const promise = new PromiseConstructor(function (resolve) { resolve(1) }) const FakePromise = function (exec) { exec(function () { /* empty */ }, function () { /* empty */ }) } const constructor = promise.constructor = {} constructor[SPECIES] = FakePromise SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise if (!SUBCLASSING) return true // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT }) const INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { PromiseConstructor.all(iterable).catch(function () { /* empty */ }) }) // helpers const isThenable = function (it) { let then return isObject(it) && isCallable(then = it.then) ? then : false } const notify = function (state, isReject) { if (state.notified) return state.notified = true const chain = state.reactions microtask(function () { const value = state.value const ok = state.state == FULFILLED let index = 0 // variable length - can't use forEach while (chain.length > index) { const reaction = chain[index++] const handler = ok ? reaction.ok : reaction.fail const resolve = reaction.resolve const reject = reaction.reject const domain = reaction.domain var result, then, exited try { if (handler) { if (!ok) { if (state.rejection === UNHANDLED) onHandleUnhandled(state) state.rejection = HANDLED } if (handler === true) result = value else { if (domain) domain.enter() result = handler(value) // can throw if (domain) { domain.exit() exited = true } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')) } else if (then = isThenable(result)) { call(then, result, resolve, reject) } else resolve(result) } else reject(value) } catch (error) { if (domain && !exited) domain.exit() reject(error) } } state.reactions = [] state.notified = false if (isReject && !state.rejection) onUnhandled(state) }) } const dispatchEvent = function (name, promise, reason) { let event, handler if (DISPATCH_EVENT) { event = document.createEvent('Event') event.promise = promise event.reason = reason event.initEvent(name, false, true) global.dispatchEvent(event) } else event = { promise, reason } if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event) else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason) } var onUnhandled = function (state) { call(task, global, function () { const promise = state.facade const value = state.value const IS_UNHANDLED = isUnhandled(state) let result if (IS_UNHANDLED) { result = perform(function () { if (IS_NODE) { process.emit('unhandledRejection', value, promise) } else dispatchEvent(UNHANDLED_REJECTION, promise, value) }) // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED if (result.error) throw result.value } }) } var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent } var onHandleUnhandled = function (state) { call(task, global, function () { const promise = state.facade if (IS_NODE) { process.emit('rejectionHandled', promise) } else dispatchEvent(REJECTION_HANDLED, promise, state.value) }) } const bind = function (fn, state, unwrap) { return function (value) { fn(state, value, unwrap) } } const internalReject = function (state, value, unwrap) { if (state.done) return state.done = true if (unwrap) state = unwrap state.value = value state.state = REJECTED notify(state, true) } const internalResolve = function (state, value, unwrap) { if (state.done) return state.done = true if (unwrap) state = unwrap try { if (state.facade === value) throw TypeError("Promise can't be resolved itself") const then = isThenable(value) if (then) { microtask(function () { const wrapper = { done: false } try { call(then, value, bind(internalResolve, wrapper, state), bind(internalReject, wrapper, state) ) } catch (error) { internalReject(wrapper, error, state) } }) } else { state.value = value state.state = FULFILLED notify(state, false) } } catch (error) { internalReject({ done: false }, error, state) } } // constructor polyfill if (FORCED) { // 25.4.3.1 Promise(executor) PromiseConstructor = function Promise (executor) { anInstance(this, PromisePrototype) aCallable(executor) call(Internal, this) const state = getInternalState(this) try { executor(bind(internalResolve, state), bind(internalReject, state)) } catch (error) { internalReject(state, error) } } PromisePrototype = PromiseConstructor.prototype // eslint-disable-next-line no-unused-vars -- required for `.length` Internal = function Promise (executor) { setInternalState(this, { type: PROMISE, done: false, notified: false, parent: false, reactions: [], rejection: false, state: PENDING, value: undefined }) } Internal.prototype = redefineAll(PromisePrototype, { // `Promise.prototype.then` method // https://tc39.es/ecma262/#sec-promise.prototype.then then: function then (onFulfilled, onRejected) { const state = getInternalPromiseState(this) const reactions = state.reactions const reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)) reaction.ok = isCallable(onFulfilled) ? onFulfilled : true reaction.fail = isCallable(onRejected) && onRejected reaction.domain = IS_NODE ? process.domain : undefined state.parent = true reactions[reactions.length] = reaction if (state.state != PENDING) notify(state, false) return reaction.promise }, // `Promise.prototype.catch` method // https://tc39.es/ecma262/#sec-promise.prototype.catch catch: function (onRejected) { return this.then(undefined, onRejected) } }) OwnPromiseCapability = function () { const promise = new Internal() const state = getInternalState(promise) this.promise = promise this.resolve = bind(internalResolve, state) this.reject = bind(internalReject, state) } newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C) } if (!IS_PURE && isCallable(NativePromise) && NativePromisePrototype !== Object.prototype) { nativeThen = NativePromisePrototype.then if (!SUBCLASSING) { // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs redefine(NativePromisePrototype, 'then', function then (onFulfilled, onRejected) { const that = this return new PromiseConstructor(function (resolve, reject) { call(nativeThen, that, resolve, reject) }).then(onFulfilled, onRejected) // https://github.com/zloirock/core-js/issues/640 }, { unsafe: true }) // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` redefine(NativePromisePrototype, 'catch', PromisePrototype.catch, { unsafe: true }) } // make `.constructor === Promise` work for native promise-based APIs try { delete NativePromisePrototype.constructor } catch (error) { /* empty */ } // make `instanceof Promise` work for native promise-based APIs if (setPrototypeOf) { setPrototypeOf(NativePromisePrototype, PromisePrototype) } } } $({ global: true, wrap: true, forced: FORCED }, { Promise: PromiseConstructor }) setToStringTag(PromiseConstructor, PROMISE, false, true) setSpecies(PROMISE) PromiseWrapper = getBuiltIn(PROMISE) // statics $({ target: PROMISE, stat: true, forced: FORCED }, { // `Promise.reject` method // https://tc39.es/ecma262/#sec-promise.reject reject: function reject (r) { const capability = newPromiseCapability(this) call(capability.reject, undefined, r) return capability.promise } }) $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, { // `Promise.resolve` method // https://tc39.es/ecma262/#sec-promise.resolve resolve: function resolve (x) { return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x) } }) $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, { // `Promise.all` method // https://tc39.es/ecma262/#sec-promise.all all: function all (iterable) { const C = this const capability = newPromiseCapability(C) const resolve = capability.resolve const reject = capability.reject const result = perform(function () { const $promiseResolve = aCallable(C.resolve) const values = [] let counter = 0 let remaining = 1 iterate(iterable, function (promise) { const index = counter++ let alreadyCalled = false remaining++ call($promiseResolve, C, promise).then(function (value) { if (alreadyCalled) return alreadyCalled = true values[index] = value --remaining || resolve(values) }, reject) }) --remaining || resolve(values) }) if (result.error) reject(result.value) return capability.promise }, // `Promise.race` method // https://tc39.es/ecma262/#sec-promise.race race: function race (iterable) { const C = this const capability = newPromiseCapability(C) const reject = capability.reject const result = perform(function () { const $promiseResolve = aCallable(C.resolve) iterate(iterable, function (promise) { call($promiseResolve, C, promise).then(capability.resolve, reject) }) }) if (result.error) reject(result.value) return capability.promise } }) /***/ }, /***/ 2419: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const getBuiltIn = __webpack_require__(5005) const apply = __webpack_require__(2104) const bind = __webpack_require__(7065) const aConstructor = __webpack_require__(9483) const anObject = __webpack_require__(9670) const isObject = __webpack_require__(111) const create = __webpack_require__(30) const fails = __webpack_require__(7293) const nativeConstruct = getBuiltIn('Reflect', 'construct') const ObjectPrototype = Object.prototype const push = [].push // `Reflect.construct` method // https://tc39.es/ecma262/#sec-reflect.construct // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it const NEW_TARGET_BUG = fails(function () { function F () { /* empty */ } return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F) }) const ARGS_BUG = !fails(function () { nativeConstruct(function () { /* empty */ }) }) const FORCED = NEW_TARGET_BUG || ARGS_BUG $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, { construct: function construct (Target, args /* , newTarget */) { aConstructor(Target) anObject(args) const newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]) if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget) if (Target == newTarget) { // w/o altered newTarget, optimization for 0-4 arguments switch (args.length) { case 0: return new Target() case 1: return new Target(args[0]) case 2: return new Target(args[0], args[1]) case 3: return new Target(args[0], args[1], args[2]) case 4: return new Target(args[0], args[1], args[2], args[3]) } // w/o altered newTarget, lot of arguments case const $args = [null] apply(push, $args, args) return new (apply(bind, Target, $args))() } // with altered newTarget, not support built-in constructors const proto = newTarget.prototype const instance = create(isObject(proto) ? proto : ObjectPrototype) const result = apply(Target, instance, args) return isObject(result) ? result : instance } }) /***/ }, /***/ 4916: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const exec = __webpack_require__(2261) // `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { exec }) /***/ }, /***/ 2087: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const DESCRIPTORS = __webpack_require__(9781) const objectDefinePropertyModule = __webpack_require__(3070) const regExpFlags = __webpack_require__(7066) const fails = __webpack_require__(7293) const RegExpPrototype = RegExp.prototype const FORCED = DESCRIPTORS && fails(function () { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call({ dotAll: true, sticky: true }) !== 'sy' }) // `RegExp.prototype.flags` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags if (FORCED) { objectDefinePropertyModule.f(RegExpPrototype, 'flags', { configurable: true, get: regExpFlags }) } /***/ }, /***/ 9714: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const uncurryThis = __webpack_require__(1702) const PROPER_FUNCTION_NAME = (__webpack_require__(6530).PROPER) const redefine = __webpack_require__(1320) const anObject = __webpack_require__(9670) const isPrototypeOf = __webpack_require__(7976) const $toString = __webpack_require__(1340) const fails = __webpack_require__(7293) const regExpFlags = __webpack_require__(7066) const TO_STRING = 'toString' const RegExpPrototype = RegExp.prototype const n$ToString = RegExpPrototype[TO_STRING] const getFlags = uncurryThis(regExpFlags) const NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b' }) // FF44- RegExp#toString has a wrong name const INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { redefine(RegExp.prototype, TO_STRING, function toString () { const R = anObject(this) const p = $toString(R.source) const rf = R.flags const f = $toString(rf === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf) return '/' + p + '/' + f }, { unsafe: true }) } /***/ }, /***/ 189: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const collection = __webpack_require__(7710) const collectionStrong = __webpack_require__(5631) // `Set` constructor // https://tc39.es/ecma262/#sec-set-objects collection('Set', function (init) { return function Set () { return init(this, arguments.length ? arguments[0] : undefined) } }, collectionStrong) /***/ }, /***/ 9841: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const codeAt = (__webpack_require__(8710).codeAt) // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat $({ target: 'String', proto: true }, { codePointAt: function codePointAt (pos) { return codeAt(this, pos) } }) /***/ }, /***/ 4953: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const toAbsoluteIndex = __webpack_require__(1400) const RangeError = global.RangeError const fromCharCode = String.fromCharCode // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing const $fromCodePoint = String.fromCodePoint const join = uncurryThis([].join) // length should be 1, old FF problem const INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1 // `String.fromCodePoint` method // https://tc39.es/ecma262/#sec-string.fromcodepoint $({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, { // eslint-disable-next-line no-unused-vars -- required for `.length` fromCodePoint: function fromCodePoint (x) { const elements = [] const length = arguments.length let i = 0 let code while (length > i) { code = +arguments[i++] if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point') elements[i] = code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00) } return join(elements, '') } }) /***/ }, /***/ 2023: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const uncurryThis = __webpack_require__(1702) const notARegExp = __webpack_require__(3929) const requireObjectCoercible = __webpack_require__(4488) const toString = __webpack_require__(1340) const correctIsRegExpLogic = __webpack_require__(4964) const stringIndexOf = uncurryThis(''.indexOf) // `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { includes: function includes (searchString /* , position = 0 */) { return !!~stringIndexOf( toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined ) } }) /***/ }, /***/ 8734: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const createHTML = __webpack_require__(4230) const forcedStringHTMLMethod = __webpack_require__(3429) // `String.prototype.italics` method // https://tc39.es/ecma262/#sec-string.prototype.italics $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('italics') }, { italics: function italics () { return createHTML(this, 'i', '', '') } }) /***/ }, /***/ 8783: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const charAt = (__webpack_require__(8710).charAt) const toString = __webpack_require__(1340) const InternalStateModule = __webpack_require__(9909) const defineIterator = __webpack_require__(654) const STRING_ITERATOR = 'String Iterator' const setInternalState = InternalStateModule.set const getInternalState = InternalStateModule.getterFor(STRING_ITERATOR) // `String.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: toString(iterated), index: 0 }) // `%StringIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next }, function next () { const state = getInternalState(this) const string = state.string const index = state.index let point if (index >= string.length) return { value: undefined, done: true } point = charAt(string, index) state.index += point.length return { value: point, done: false } }) /***/ }, /***/ 9254: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const createHTML = __webpack_require__(4230) const forcedStringHTMLMethod = __webpack_require__(3429) // `String.prototype.link` method // https://tc39.es/ecma262/#sec-string.prototype.link $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('link') }, { link: function link (url) { return createHTML(this, 'a', 'href', url) } }) /***/ }, /***/ 6373: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' /* eslint-disable es/no-string-prototype-matchall -- safe */ const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const call = __webpack_require__(6916) const uncurryThis = __webpack_require__(1702) const createIteratorConstructor = __webpack_require__(4994) const requireObjectCoercible = __webpack_require__(4488) const toLength = __webpack_require__(7466) const toString = __webpack_require__(1340) const anObject = __webpack_require__(9670) const classof = __webpack_require__(4326) const isPrototypeOf = __webpack_require__(7976) const isRegExp = __webpack_require__(7850) const regExpFlags = __webpack_require__(7066) const getMethod = __webpack_require__(8173) const redefine = __webpack_require__(1320) const fails = __webpack_require__(7293) const wellKnownSymbol = __webpack_require__(5112) const speciesConstructor = __webpack_require__(6707) const advanceStringIndex = __webpack_require__(1530) const regExpExec = __webpack_require__(7651) const InternalStateModule = __webpack_require__(9909) const IS_PURE = __webpack_require__(1913) const MATCH_ALL = wellKnownSymbol('matchAll') const REGEXP_STRING = 'RegExp String' const REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator' const setInternalState = InternalStateModule.set const getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR) const RegExpPrototype = RegExp.prototype const TypeError = global.TypeError const getFlags = uncurryThis(regExpFlags) const stringIndexOf = uncurryThis(''.indexOf) const un$MatchAll = uncurryThis(''.matchAll) const WORKS_WITH_NON_GLOBAL_REGEX = !!un$MatchAll && !fails(function () { un$MatchAll('a', /./) }) const $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator (regexp, string, $global, fullUnicode) { setInternalState(this, { type: REGEXP_STRING_ITERATOR, regexp, string, global: $global, unicode: fullUnicode, done: false }) }, REGEXP_STRING, function next () { const state = getInternalState(this) if (state.done) return { value: undefined, done: true } const R = state.regexp const S = state.string const match = regExpExec(R, S) if (match === null) return { value: undefined, done: state.done = true } if (state.global) { if (toString(match[0]) === '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode) return { value: match, done: false } } state.done = true return { value: match, done: false } }) const $matchAll = function (string) { const R = anObject(this) const S = toString(string) let C, flagsValue, flags, matcher, $global, fullUnicode C = speciesConstructor(R, RegExp) flagsValue = R.flags if (flagsValue === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype)) { flagsValue = getFlags(R) } flags = flagsValue === undefined ? '' : toString(flagsValue) matcher = new C(C === RegExp ? R.source : R, flags) $global = !!~stringIndexOf(flags, 'g') fullUnicode = !!~stringIndexOf(flags, 'u') matcher.lastIndex = toLength(R.lastIndex) return new $RegExpStringIterator(matcher, S, $global, fullUnicode) } // `String.prototype.matchAll` method // https://tc39.es/ecma262/#sec-string.prototype.matchall $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { matchAll: function matchAll (regexp) { const O = requireObjectCoercible(this) let flags, S, matcher, rx if (regexp != null) { if (isRegExp(regexp)) { flags = toString(requireObjectCoercible('flags' in RegExpPrototype ? regexp.flags : getFlags(regexp) )) if (!~stringIndexOf(flags, 'g')) throw TypeError('`.matchAll` does not allow non-global regexes') } if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp) matcher = getMethod(regexp, MATCH_ALL) if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll if (matcher) return call(matcher, regexp, O) } else if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp) S = toString(O) rx = new RegExp(regexp, 'g') return IS_PURE ? call($matchAll, rx, S) : rx[MATCH_ALL](S) } }) IS_PURE || MATCH_ALL in RegExpPrototype || redefine(RegExpPrototype, MATCH_ALL, $matchAll) /***/ }, /***/ 4723: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const call = __webpack_require__(6916) const fixRegExpWellKnownSymbolLogic = __webpack_require__(7007) const anObject = __webpack_require__(9670) const toLength = __webpack_require__(7466) const toString = __webpack_require__(1340) const requireObjectCoercible = __webpack_require__(4488) const getMethod = __webpack_require__(8173) const advanceStringIndex = __webpack_require__(1530) const regExpExec = __webpack_require__(7651) // @@match logic fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) { return [ // `String.prototype.match` method // https://tc39.es/ecma262/#sec-string.prototype.match function match (regexp) { const O = requireObjectCoercible(this) const matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH) return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O)) }, // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (string) { const rx = anObject(this) const S = toString(string) const res = maybeCallNative(nativeMatch, rx, S) if (res.done) return res.value if (!rx.global) return regExpExec(rx, S) const fullUnicode = rx.unicode rx.lastIndex = 0 const A = [] let n = 0 let result while ((result = regExpExec(rx, S)) !== null) { const matchStr = toString(result[0]) A[n] = matchStr if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode) n++ } return n === 0 ? null : A } ] }) /***/ }, /***/ 2481: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const $ = __webpack_require__(2109) const repeat = __webpack_require__(8415) // `String.prototype.repeat` method // https://tc39.es/ecma262/#sec-string.prototype.repeat $({ target: 'String', proto: true }, { repeat }) /***/ }, /***/ 5306: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const apply = __webpack_require__(2104) const call = __webpack_require__(6916) const uncurryThis = __webpack_require__(1702) const fixRegExpWellKnownSymbolLogic = __webpack_require__(7007) const fails = __webpack_require__(7293) const anObject = __webpack_require__(9670) const isCallable = __webpack_require__(614) const toIntegerOrInfinity = __webpack_require__(9303) const toLength = __webpack_require__(7466) const toString = __webpack_require__(1340) const requireObjectCoercible = __webpack_require__(4488) const advanceStringIndex = __webpack_require__(1530) const getMethod = __webpack_require__(8173) const getSubstitution = __webpack_require__(647) const regExpExec = __webpack_require__(7651) const wellKnownSymbol = __webpack_require__(5112) const REPLACE = wellKnownSymbol('replace') const max = Math.max const min = Math.min const concat = uncurryThis([].concat) const push = uncurryThis([].push) const stringIndexOf = uncurryThis(''.indexOf) const stringSlice = uncurryThis(''.slice) const maybeToString = function (it) { return it === undefined ? it : String(it) } // IE <= 11 replaces $0 with the whole match, as if it was $& // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0 const REPLACE_KEEPS_$0 = (function () { // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing return 'a'.replace(/./, '$0') === '$0' })() // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string const REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () { if (/./[REPLACE]) { return /./[REPLACE]('a', '$0') === '' } return false })() const REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { const re = /./ re.exec = function () { const result = [] result.groups = { a: '7' } return result } // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive return ''.replace(re, '$') !== '7' }) // @@replace logic fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) { const UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0' return [ // `String.prototype.replace` method // https://tc39.es/ecma262/#sec-string.prototype.replace function replace (searchValue, replaceValue) { const O = requireObjectCoercible(this) const replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE) return replacer ? call(replacer, searchValue, O, replaceValue) : call(nativeReplace, toString(O), searchValue, replaceValue) }, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { const rx = anObject(this) const S = toString(string) if ( typeof replaceValue === 'string' && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, '$<') === -1 ) { const res = maybeCallNative(nativeReplace, rx, S, replaceValue) if (res.done) return res.value } const functionalReplace = isCallable(replaceValue) if (!functionalReplace) replaceValue = toString(replaceValue) const global = rx.global if (global) { var fullUnicode = rx.unicode rx.lastIndex = 0 } const results = [] while (true) { var result = regExpExec(rx, S) if (result === null) break push(results, result) if (!global) break const matchStr = toString(result[0]) if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode) } let accumulatedResult = '' let nextSourcePosition = 0 for (let i = 0; i < results.length; i++) { result = results[i] const matched = toString(result[0]) const position = max(min(toIntegerOrInfinity(result.index), S.length), 0) const captures = [] // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. for (let j = 1; j < result.length; j++) push(captures, maybeToString(result[j])) const namedCaptures = result.groups if (functionalReplace) { const replacerArgs = concat([matched], captures, position, S) if (namedCaptures !== undefined) push(replacerArgs, namedCaptures) var replacement = toString(apply(replaceValue, undefined, replacerArgs)) } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue) } if (position >= nextSourcePosition) { accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement nextSourcePosition = position + matched.length } } return accumulatedResult + stringSlice(S, nextSourcePosition) } ] }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE) /***/ }, /***/ 3123: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const apply = __webpack_require__(2104) const call = __webpack_require__(6916) const uncurryThis = __webpack_require__(1702) const fixRegExpWellKnownSymbolLogic = __webpack_require__(7007) const isRegExp = __webpack_require__(7850) const anObject = __webpack_require__(9670) const requireObjectCoercible = __webpack_require__(4488) const speciesConstructor = __webpack_require__(6707) const advanceStringIndex = __webpack_require__(1530) const toLength = __webpack_require__(7466) const toString = __webpack_require__(1340) const getMethod = __webpack_require__(8173) const arraySlice = __webpack_require__(206) const callRegExpExec = __webpack_require__(7651) const regexpExec = __webpack_require__(2261) const stickyHelpers = __webpack_require__(2999) const fails = __webpack_require__(7293) const UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y const MAX_UINT32 = 0xFFFFFFFF const min = Math.min const $push = [].push const exec = uncurryThis(/./.exec) const push = uncurryThis($push) const stringSlice = uncurryThis(''.slice) // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper const SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { // eslint-disable-next-line regexp/no-empty-group -- required for testing const re = /(?:)/ const originalExec = re.exec re.exec = function () { return originalExec.apply(this, arguments) } const result = 'ab'.split(re) return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b' }) // @@split logic fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) { let internalSplit if ( 'abbc'.split(/(b)*/)[1] == 'c' || // eslint-disable-next-line regexp/no-empty-group -- required for testing 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing '.'.split(/()()/).length > 1 || ''.split(/.?/).length ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { const string = toString(requireObjectCoercible(this)) const lim = limit === undefined ? MAX_UINT32 : limit >>> 0 if (lim === 0) return [] if (separator === undefined) return [string] // If `separator` is not a regex, use native split if (!isRegExp(separator)) { return call(nativeSplit, string, separator, lim) } const output = [] const flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : '') let lastLastIndex = 0 // Make `global` and avoid `lastIndex` issues by working with a copy const separatorCopy = new RegExp(separator.source, flags + 'g') let match, lastIndex, lastLength while (match = call(regexpExec, separatorCopy, string)) { lastIndex = separatorCopy.lastIndex if (lastIndex > lastLastIndex) { push(output, stringSlice(string, lastLastIndex, match.index)) if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1)) lastLength = match[0].length lastLastIndex = lastIndex if (output.length >= lim) break } if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++ // Avoid an infinite loop } if (lastLastIndex === string.length) { if (lastLength || !exec(separatorCopy, '')) push(output, '') } else push(output, stringSlice(string, lastLastIndex)) return output.length > lim ? arraySlice(output, 0, lim) : output } // Chakra, V8 } else if ('0'.split(undefined, 0).length) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit) } } else internalSplit = nativeSplit return [ // `String.prototype.split` method // https://tc39.es/ecma262/#sec-string.prototype.split function split (separator, limit) { const O = requireObjectCoercible(this) const splitter = separator == undefined ? undefined : getMethod(separator, SPLIT) return splitter ? call(splitter, separator, O, limit) : call(internalSplit, toString(O), separator, limit) }, // `RegExp.prototype[@@split]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (string, limit) { const rx = anObject(this) const S = toString(string) const res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit) if (res.done) return res.value const C = speciesConstructor(rx, RegExp) const unicodeMatching = rx.unicode const flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (UNSUPPORTED_Y ? 'g' : 'y') // ^(? + rx + ) is needed, in combination with some S slicing, to // simulate the 'y' flag. const splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags) const lim = limit === undefined ? MAX_UINT32 : limit >>> 0 if (lim === 0) return [] if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [] let p = 0 let q = 0 const A = [] while (q < S.length) { splitter.lastIndex = UNSUPPORTED_Y ? 0 : q const z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S) var e if ( z === null || (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching) } else { push(A, stringSlice(S, p, q)) if (A.length === lim) return A for (let i = 1; i <= z.length - 1; i++) { push(A, z[i]) if (A.length === lim) return A } q = p = e } } push(A, stringSlice(S, p)) return A } ] }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y) /***/ }, /***/ 7397: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const createHTML = __webpack_require__(4230) const forcedStringHTMLMethod = __webpack_require__(3429) // `String.prototype.strike` method // https://tc39.es/ecma262/#sec-string.prototype.strike $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('strike') }, { strike: function strike () { return createHTML(this, 'strike', '', '') } }) /***/ }, /***/ 3210: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const $trim = (__webpack_require__(3111).trim) const forcedStringTrimMethod = __webpack_require__(6091) // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { trim: function trim () { return $trim(this) } }) /***/ }, /***/ 1817: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' // `Symbol.prototype.description` getter // https://tc39.es/ecma262/#sec-symbol.prototype.description const $ = __webpack_require__(2109) const DESCRIPTORS = __webpack_require__(9781) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const hasOwn = __webpack_require__(2597) const isCallable = __webpack_require__(614) const isPrototypeOf = __webpack_require__(7976) const toString = __webpack_require__(1340) const defineProperty = (__webpack_require__(3070).f) const copyConstructorProperties = __webpack_require__(9920) const NativeSymbol = global.Symbol const SymbolPrototype = NativeSymbol && NativeSymbol.prototype if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) || // Safari 12 bug NativeSymbol().description !== undefined )) { const EmptyStringDescriptionStore = {} // wrap Symbol constructor for correct work with undefined description const SymbolWrapper = function Symbol () { const description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]) const result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description) if (description === '') EmptyStringDescriptionStore[result] = true return result } copyConstructorProperties(SymbolWrapper, NativeSymbol) SymbolWrapper.prototype = SymbolPrototype SymbolPrototype.constructor = SymbolWrapper const NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)' const symbolToString = uncurryThis(SymbolPrototype.toString) const symbolValueOf = uncurryThis(SymbolPrototype.valueOf) const regexp = /^Symbol\((.*)\)[^)]+$/ const replace = uncurryThis(''.replace) const stringSlice = uncurryThis(''.slice) defineProperty(SymbolPrototype, 'description', { configurable: true, get: function description () { const symbol = symbolValueOf(this) const string = symbolToString(symbol) if (hasOwn(EmptyStringDescriptionStore, symbol)) return '' const desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1') return desc === '' ? undefined : desc } }) $({ global: true, forced: true }, { Symbol: SymbolWrapper }) } /***/ }, /***/ 2165: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const defineWellKnownSymbol = __webpack_require__(7235) // `Symbol.iterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.iterator defineWellKnownSymbol('iterator') /***/ }, /***/ 2526: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const global = __webpack_require__(7854) const getBuiltIn = __webpack_require__(5005) const apply = __webpack_require__(2104) const call = __webpack_require__(6916) const uncurryThis = __webpack_require__(1702) const IS_PURE = __webpack_require__(1913) const DESCRIPTORS = __webpack_require__(9781) const NATIVE_SYMBOL = __webpack_require__(133) const fails = __webpack_require__(7293) const hasOwn = __webpack_require__(2597) const isArray = __webpack_require__(3157) const isCallable = __webpack_require__(614) const isObject = __webpack_require__(111) const isPrototypeOf = __webpack_require__(7976) const isSymbol = __webpack_require__(2190) const anObject = __webpack_require__(9670) const toObject = __webpack_require__(7908) const toIndexedObject = __webpack_require__(5656) const toPropertyKey = __webpack_require__(4948) const $toString = __webpack_require__(1340) const createPropertyDescriptor = __webpack_require__(9114) const nativeObjectCreate = __webpack_require__(30) const objectKeys = __webpack_require__(1956) const getOwnPropertyNamesModule = __webpack_require__(8006) const getOwnPropertyNamesExternal = __webpack_require__(1156) const getOwnPropertySymbolsModule = __webpack_require__(5181) const getOwnPropertyDescriptorModule = __webpack_require__(1236) const definePropertyModule = __webpack_require__(3070) const propertyIsEnumerableModule = __webpack_require__(5296) const arraySlice = __webpack_require__(206) const redefine = __webpack_require__(1320) const shared = __webpack_require__(2309) const sharedKey = __webpack_require__(6200) const hiddenKeys = __webpack_require__(3501) const uid = __webpack_require__(9711) const wellKnownSymbol = __webpack_require__(5112) const wrappedWellKnownSymbolModule = __webpack_require__(6061) const defineWellKnownSymbol = __webpack_require__(7235) const setToStringTag = __webpack_require__(8003) const InternalStateModule = __webpack_require__(9909) const $forEach = (__webpack_require__(2092).forEach) const HIDDEN = sharedKey('hidden') const SYMBOL = 'Symbol' const PROTOTYPE = 'prototype' const TO_PRIMITIVE = wellKnownSymbol('toPrimitive') const setInternalState = InternalStateModule.set const getInternalState = InternalStateModule.getterFor(SYMBOL) const ObjectPrototype = Object[PROTOTYPE] let $Symbol = global.Symbol let SymbolPrototype = $Symbol && $Symbol[PROTOTYPE] const TypeError = global.TypeError const QObject = global.QObject const $stringify = getBuiltIn('JSON', 'stringify') const nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f const nativeDefineProperty = definePropertyModule.f const nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f const nativePropertyIsEnumerable = propertyIsEnumerableModule.f const push = uncurryThis([].push) const AllSymbols = shared('symbols') const ObjectPrototypeSymbols = shared('op-symbols') const StringToSymbolRegistry = shared('string-to-symbol-registry') const SymbolToStringRegistry = shared('symbol-to-string-registry') const WellKnownSymbolsStore = shared('wks') // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 let USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 const setSymbolDescriptor = DESCRIPTORS && fails(function () { return nativeObjectCreate(nativeDefineProperty({}, 'a', { get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a } })).a != 7 }) ? function (O, P, Attributes) { const ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P) if (ObjectPrototypeDescriptor) delete ObjectPrototype[P] nativeDefineProperty(O, P, Attributes) if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor) } } : nativeDefineProperty const wrap = function (tag, description) { const symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype) setInternalState(symbol, { type: SYMBOL, tag, description }) if (!DESCRIPTORS) symbol.description = description return symbol } const $defineProperty = function defineProperty (O, P, Attributes) { if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes) anObject(O) const key = toPropertyKey(P) anObject(Attributes) if (hasOwn(AllSymbols, key)) { if (!Attributes.enumerable) { if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})) O[HIDDEN][key] = true } else { if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }) } return setSymbolDescriptor(O, key, Attributes) } return nativeDefineProperty(O, key, Attributes) } const $defineProperties = function defineProperties (O, Properties) { anObject(O) const properties = toIndexedObject(Properties) const keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)) $forEach(keys, function (key) { if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]) }) return O } const $create = function create (O, Properties) { return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties) } var $propertyIsEnumerable = function propertyIsEnumerable (V) { const P = toPropertyKey(V) const enumerable = call(nativePropertyIsEnumerable, this, P) if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true } const $getOwnPropertyDescriptor = function getOwnPropertyDescriptor (O, P) { const it = toIndexedObject(O) const key = toPropertyKey(P) if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return const descriptor = nativeGetOwnPropertyDescriptor(it, key) if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true } return descriptor } const $getOwnPropertyNames = function getOwnPropertyNames (O) { const names = nativeGetOwnPropertyNames(toIndexedObject(O)) const result = [] $forEach(names, function (key) { if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key) }) return result } var $getOwnPropertySymbols = function getOwnPropertySymbols (O) { const IS_OBJECT_PROTOTYPE = O === ObjectPrototype const names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)) const result = [] $forEach(names, function (key) { if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) { push(result, AllSymbols[key]) } }) return result } // `Symbol` constructor // https://tc39.es/ecma262/#sec-symbol-constructor if (!NATIVE_SYMBOL) { $Symbol = function Symbol () { if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor') const description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]) const tag = uid(description) const setter = function (value) { if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value) if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)) } if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }) return wrap(tag, description) } SymbolPrototype = $Symbol[PROTOTYPE] redefine(SymbolPrototype, 'toString', function toString () { return getInternalState(this).tag }) redefine($Symbol, 'withoutSetter', function (description) { return wrap(uid(description), description) }) propertyIsEnumerableModule.f = $propertyIsEnumerable definePropertyModule.f = $defineProperty getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames getOwnPropertySymbolsModule.f = $getOwnPropertySymbols wrappedWellKnownSymbolModule.f = function (name) { return wrap(wellKnownSymbol(name), name) } if (DESCRIPTORS) { // https://github.com/tc39/proposal-Symbol-description nativeDefineProperty(SymbolPrototype, 'description', { configurable: true, get: function description () { return getInternalState(this).description } }) if (!IS_PURE) { redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }) } } } $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { Symbol: $Symbol }) $forEach(objectKeys(WellKnownSymbolsStore), function (name) { defineWellKnownSymbol(name) }) $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { // `Symbol.for` method // https://tc39.es/ecma262/#sec-symbol.for for: function (key) { const string = $toString(key) if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string] const symbol = $Symbol(string) StringToSymbolRegistry[string] = symbol SymbolToStringRegistry[symbol] = string return symbol }, // `Symbol.keyFor` method // https://tc39.es/ecma262/#sec-symbol.keyfor keyFor: function keyFor (sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol') if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym] }, useSetter: function () { USE_SETTER = true }, useSimple: function () { USE_SETTER = false } }) $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { // `Object.create` method // https://tc39.es/ecma262/#sec-object.create create: $create, // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty defineProperty: $defineProperty, // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties defineProperties: $defineProperties, // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors getOwnPropertyDescriptor: $getOwnPropertyDescriptor }) $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames, // `Object.getOwnPropertySymbols` method // https://tc39.es/ecma262/#sec-object.getownpropertysymbols getOwnPropertySymbols: $getOwnPropertySymbols }) // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1) }) }, { getOwnPropertySymbols: function getOwnPropertySymbols (it) { return getOwnPropertySymbolsModule.f(toObject(it)) } }) // `JSON.stringify` method behavior with symbols // https://tc39.es/ecma262/#sec-json.stringify if ($stringify) { const FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () { const symbol = $Symbol() // MS Edge converts symbol values to JSON as {} return $stringify([symbol]) != '[null]' || // WebKit converts symbol values to JSON as null $stringify({ a: symbol }) != '{}' || // V8 throws on boxed symbols $stringify(Object(symbol)) != '{}' }) $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, { // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify (it, replacer, space) { const args = arraySlice(arguments) const $replacer = replacer if (!isObject(replacer) && it === undefined || isSymbol(it)) return // IE8 returns string on undefined if (!isArray(replacer)) { replacer = function (key, value) { if (isCallable($replacer)) value = call($replacer, this, key, value) if (!isSymbol(value)) return value } } args[1] = replacer return apply($stringify, null, args) } }) } // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive if (!SymbolPrototype[TO_PRIMITIVE]) { const valueOf = SymbolPrototype.valueOf // eslint-disable-next-line no-unused-vars -- required for .length redefine(SymbolPrototype, TO_PRIMITIVE, function (hint) { // TODO: improve hint logic return call(valueOf, this) }) } // `Symbol.prototype[@@toStringTag]` property // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag($Symbol, SYMBOL) hiddenKeys[HIDDEN] = true /***/ }, /***/ 6649: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const defineWellKnownSymbol = __webpack_require__(7235) // `Symbol.toPrimitive` well-known symbol // https://tc39.es/ecma262/#sec-symbol.toprimitive defineWellKnownSymbol('toPrimitive') /***/ }, /***/ 2990: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const uncurryThis = __webpack_require__(1702) const ArrayBufferViewCore = __webpack_require__(2094) const $ArrayCopyWithin = __webpack_require__(1048) const u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin exportTypedArrayMethod('copyWithin', function copyWithin (target, start /* , end */) { return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined) }) /***/ }, /***/ 8927: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $every = (__webpack_require__(2092).every) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.every` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.every exportTypedArrayMethod('every', function every (callbackfn /* , thisArg */) { return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 3105: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const call = __webpack_require__(6916) const $fill = __webpack_require__(1285) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.fill` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill exportTypedArrayMethod('fill', function fill (value /* , start, end */) { const length = arguments.length return call( $fill, aTypedArray(this), value, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined ) }) /***/ }, /***/ 5035: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $filter = (__webpack_require__(2092).filter) const fromSpeciesAndList = __webpack_require__(3074) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.filter` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter exportTypedArrayMethod('filter', function filter (callbackfn /* , thisArg */) { const list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) return fromSpeciesAndList(this, list) }) /***/ }, /***/ 7174: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $findIndex = (__webpack_require__(2092).findIndex) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.findIndex` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex exportTypedArrayMethod('findIndex', function findIndex (predicate /* , thisArg */) { return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 4345: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $find = (__webpack_require__(2092).find) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.find` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.find exportTypedArrayMethod('find', function find (predicate /* , thisArg */) { return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 4197: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Float32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Float32', function (init) { return function Float32Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 6495: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Float64Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Float64', function (init) { return function Float64Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 2846: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $forEach = (__webpack_require__(2092).forEach) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.forEach` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach exportTypedArrayMethod('forEach', function forEach (callbackfn /* , thisArg */) { $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 8145: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(3832) const exportTypedArrayStaticMethod = (__webpack_require__(2094).exportTypedArrayStaticMethod) const typedArrayFrom = __webpack_require__(7321) // `%TypedArray%.from` method // https://tc39.es/ecma262/#sec-%typedarray%.from exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) /***/ }, /***/ 4731: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $includes = (__webpack_require__(1318).includes) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.includes` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes exportTypedArrayMethod('includes', function includes (searchElement /* , fromIndex */) { return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 7209: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $indexOf = (__webpack_require__(1318).indexOf) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.indexOf` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof exportTypedArrayMethod('indexOf', function indexOf (searchElement /* , fromIndex */) { return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 5109: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Int16Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Int16', function (init) { return function Int16Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 5125: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Int32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Int32', function (init) { return function Int32Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 7145: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Int8Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Int8', function (init) { return function Int8Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 6319: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const PROPER_FUNCTION_NAME = (__webpack_require__(6530).PROPER) const ArrayBufferViewCore = __webpack_require__(2094) const ArrayIterators = __webpack_require__(6992) const wellKnownSymbol = __webpack_require__(5112) const ITERATOR = wellKnownSymbol('iterator') const Uint8Array = global.Uint8Array const arrayValues = uncurryThis(ArrayIterators.values) const arrayKeys = uncurryThis(ArrayIterators.keys) const arrayEntries = uncurryThis(ArrayIterators.entries) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR] const PROPER_ARRAY_VALUES_NAME = !!nativeTypedArrayIterator && nativeTypedArrayIterator.name === 'values' const typedArrayValues = function values () { return arrayValues(aTypedArray(this)) } // `%TypedArray%.prototype.entries` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries exportTypedArrayMethod('entries', function entries () { return arrayEntries(aTypedArray(this)) }) // `%TypedArray%.prototype.keys` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys exportTypedArrayMethod('keys', function keys () { return arrayKeys(aTypedArray(this)) }) // `%TypedArray%.prototype.values` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values exportTypedArrayMethod('values', typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME) // `%TypedArray%.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator exportTypedArrayMethod(ITERATOR, typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME) /***/ }, /***/ 8867: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const uncurryThis = __webpack_require__(1702) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const $join = uncurryThis([].join) // `%TypedArray%.prototype.join` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join exportTypedArrayMethod('join', function join (separator) { return $join(aTypedArray(this), separator) }) /***/ }, /***/ 7789: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const apply = __webpack_require__(2104) const $lastIndexOf = __webpack_require__(6583) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof exportTypedArrayMethod('lastIndexOf', function lastIndexOf (searchElement /* , fromIndex */) { const length = arguments.length return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]) }) /***/ }, /***/ 3739: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $map = (__webpack_require__(2092).map) const typedArraySpeciesConstructor = __webpack_require__(6304) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.map` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.map exportTypedArrayMethod('map', function map (mapfn /* , thisArg */) { return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { return new (typedArraySpeciesConstructor(O))(length) }) }) /***/ }, /***/ 4483: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $reduceRight = (__webpack_require__(3671).right) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.reduceRicht` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright exportTypedArrayMethod('reduceRight', function reduceRight (callbackfn /* , initialValue */) { const length = arguments.length return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 9368: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $reduce = (__webpack_require__(3671).left) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.reduce` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce exportTypedArrayMethod('reduce', function reduce (callbackfn /* , initialValue */) { const length = arguments.length return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 2056: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const floor = Math.floor // `%TypedArray%.prototype.reverse` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse exportTypedArrayMethod('reverse', function reverse () { const that = this let length = aTypedArray(that).length const middle = floor(length / 2) let index = 0 let value while (index < middle) { value = that[index] that[index++] = that[--length] that[length] = value } return that }) /***/ }, /***/ 3462: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const ArrayBufferViewCore = __webpack_require__(2094) const lengthOfArrayLike = __webpack_require__(6244) const toOffset = __webpack_require__(4590) const toObject = __webpack_require__(7908) const fails = __webpack_require__(7293) const RangeError = global.RangeError const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const FORCED = fails(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).set({}) }) // `%TypedArray%.prototype.set` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set exportTypedArrayMethod('set', function set (arrayLike /* , offset */) { aTypedArray(this) const offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1) const length = this.length const src = toObject(arrayLike) const len = lengthOfArrayLike(src) let index = 0 if (len + offset > length) throw RangeError('Wrong length') while (index < len) this[offset + index] = src[index++] }, FORCED) /***/ }, /***/ 678: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const typedArraySpeciesConstructor = __webpack_require__(6304) const fails = __webpack_require__(7293) const arraySlice = __webpack_require__(206) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const FORCED = fails(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).slice() }) // `%TypedArray%.prototype.slice` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.slice exportTypedArrayMethod('slice', function slice (start, end) { const list = arraySlice(aTypedArray(this), start, end) const C = typedArraySpeciesConstructor(this) let index = 0 const length = list.length const result = new C(length) while (length > index) result[index] = list[index++] return result }, FORCED) /***/ }, /***/ 7462: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const $some = (__webpack_require__(2092).some) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.some` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.some exportTypedArrayMethod('some', function some (callbackfn /* , thisArg */) { return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined) }) /***/ }, /***/ 3824: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const fails = __webpack_require__(7293) const aCallable = __webpack_require__(9662) const internalSort = __webpack_require__(4362) const ArrayBufferViewCore = __webpack_require__(2094) const FF = __webpack_require__(8886) const IE_OR_EDGE = __webpack_require__(256) const V8 = __webpack_require__(7392) const WEBKIT = __webpack_require__(8008) const Array = global.Array const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const Uint16Array = global.Uint16Array const un$Sort = Uint16Array && uncurryThis(Uint16Array.prototype.sort) // WebKit const ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails(function () { un$Sort(new Uint16Array(2), null) }) && fails(function () { un$Sort(new Uint16Array(2), {}) })) const STABLE_SORT = !!un$Sort && !fails(function () { // feature detection can be too slow, so check engines versions if (V8) return V8 < 74 if (FF) return FF < 67 if (IE_OR_EDGE) return true if (WEBKIT) return WEBKIT < 602 const array = new Uint16Array(516) const expected = Array(516) let index, mod for (index = 0; index < 516; index++) { mod = index % 4 array[index] = 515 - index expected[index] = index - 2 * mod + 3 } un$Sort(array, function (a, b) { return (a / 4 | 0) - (b / 4 | 0) }) for (index = 0; index < 516; index++) { if (array[index] !== expected[index]) return true } }) const getSortCompare = function (comparefn) { return function (x, y) { if (comparefn !== undefined) return +comparefn(x, y) || 0 // eslint-disable-next-line no-self-compare -- NaN check if (y !== y) return -1 // eslint-disable-next-line no-self-compare -- NaN check if (x !== x) return 1 if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1 return x > y } } // `%TypedArray%.prototype.sort` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort exportTypedArrayMethod('sort', function sort (comparefn) { if (comparefn !== undefined) aCallable(comparefn) if (STABLE_SORT) return un$Sort(this, comparefn) return internalSort(aTypedArray(this), getSortCompare(comparefn)) }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS) /***/ }, /***/ 5021: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const ArrayBufferViewCore = __webpack_require__(2094) const toLength = __webpack_require__(7466) const toAbsoluteIndex = __webpack_require__(1400) const typedArraySpeciesConstructor = __webpack_require__(6304) const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod // `%TypedArray%.prototype.subarray` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray exportTypedArrayMethod('subarray', function subarray (begin, end) { const O = aTypedArray(this) const length = O.length const beginIndex = toAbsoluteIndex(begin, length) const C = typedArraySpeciesConstructor(O) return new C( O.buffer, O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) ) }) /***/ }, /***/ 2974: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const global = __webpack_require__(7854) const apply = __webpack_require__(2104) const ArrayBufferViewCore = __webpack_require__(2094) const fails = __webpack_require__(7293) const arraySlice = __webpack_require__(206) const Int8Array = global.Int8Array const aTypedArray = ArrayBufferViewCore.aTypedArray const exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod const $toLocaleString = [].toLocaleString // iOS Safari 6.x fails here const TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () { $toLocaleString.call(new Int8Array(1)) }) const FORCED = fails(function () { return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString() }) || !fails(function () { Int8Array.prototype.toLocaleString.call([1, 2]) }) // `%TypedArray%.prototype.toLocaleString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring exportTypedArrayMethod('toLocaleString', function toLocaleString () { return apply( $toLocaleString, TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this), arraySlice(arguments) ) }, FORCED) /***/ }, /***/ 5016: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const exportTypedArrayMethod = (__webpack_require__(2094).exportTypedArrayMethod) const fails = __webpack_require__(7293) const global = __webpack_require__(7854) const uncurryThis = __webpack_require__(1702) const Uint8Array = global.Uint8Array const Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {} let arrayToString = [].toString const join = uncurryThis([].join) if (fails(function () { arrayToString.call({}) })) { arrayToString = function toString () { return join(this) } } const IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString // `%TypedArray%.prototype.toString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tostring exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD) /***/ }, /***/ 8255: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Uint16Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Uint16', function (init) { return function Uint16Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 9135: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Uint32Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Uint32', function (init) { return function Uint32Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 2472: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Uint8Array` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Uint8', function (init) { return function Uint8Array (data, byteOffset, length) { return init(this, data, byteOffset, length) } }) /***/ }, /***/ 9743: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const createTypedArrayConstructor = __webpack_require__(9843) // `Uint8ClampedArray` constructor // https://tc39.es/ecma262/#sec-typedarray-objects createTypedArrayConstructor('Uint8', function (init) { return function Uint8ClampedArray (data, byteOffset, length) { return init(this, data, byteOffset, length) } }, true) /***/ }, /***/ 8628: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__(9170) /***/ }, /***/ 5743: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__(5837) /***/ }, /***/ 7314: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__(7922) /***/ }, /***/ 6290: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__(4668) /***/ }, /***/ 7479: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const newPromiseCapabilityModule = __webpack_require__(8523) const perform = __webpack_require__(2534) // `Promise.try` method // https://github.com/tc39/proposal-promise-try $({ target: 'Promise', stat: true }, { try: function (callbackfn) { const promiseCapability = newPromiseCapabilityModule.f(this) const result = perform(callbackfn); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value) return promiseCapability.promise } }) /***/ }, /***/ 3728: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove from `core-js@4` __webpack_require__(6373) /***/ }, /***/ 4747: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const DOMIterables = __webpack_require__(8324) const DOMTokenListPrototype = __webpack_require__(8509) const forEach = __webpack_require__(8533) const createNonEnumerableProperty = __webpack_require__(8880) const handlePrototype = function (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype && CollectionPrototype.forEach !== forEach) { try { createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach) } catch (error) { CollectionPrototype.forEach = forEach } } } for (const COLLECTION_NAME in DOMIterables) { if (DOMIterables[COLLECTION_NAME]) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype) } } handlePrototype(DOMTokenListPrototype) /***/ }, /***/ 3948: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const global = __webpack_require__(7854) const DOMIterables = __webpack_require__(8324) const DOMTokenListPrototype = __webpack_require__(8509) const ArrayIteratorMethods = __webpack_require__(6992) const createNonEnumerableProperty = __webpack_require__(8880) const wellKnownSymbol = __webpack_require__(5112) const ITERATOR = wellKnownSymbol('iterator') const TO_STRING_TAG = wellKnownSymbol('toStringTag') const ArrayValues = ArrayIteratorMethods.values const handlePrototype = function (CollectionPrototype, COLLECTION_NAME) { if (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[ITERATOR] !== ArrayValues) { try { createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues) } catch (error) { CollectionPrototype[ITERATOR] = ArrayValues } } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME) } if (DOMIterables[COLLECTION_NAME]) { for (const METHOD_NAME in ArrayIteratorMethods) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) { try { createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]) } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME] } } } } } } for (const COLLECTION_NAME in DOMIterables) { handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME) } handlePrototype(DOMTokenListPrototype, 'DOMTokenList') /***/ }, /***/ 3753: /***/ function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 'use strict' const $ = __webpack_require__(2109) const call = __webpack_require__(6916) // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson $({ target: 'URL', proto: true, enumerable: true }, { toJSON: function toJSON () { return call(URL.prototype.toString, this) } }) /***/ }, /***/ 1150: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const parent = __webpack_require__(7633) __webpack_require__(3948) module.exports = parent /***/ }, /***/ 251: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const objectKeys = __webpack_require__(2215) const isArguments = __webpack_require__(2584) const is = __webpack_require__(609) const isRegex = __webpack_require__(8420) const flags = __webpack_require__(2847) const isDate = __webpack_require__(8923) const getTime = Date.prototype.getTime function deepEqual (actual, expected, options) { const opts = options || {} // 7.1. All identical values are equivalent, as determined by ===. if (opts.strict ? is(actual, expected) : actual === expected) { return true } // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==. if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) { return opts.strict ? is(actual, expected) : actual == expected } /* * 7.4. For all other Object pairs, including Array objects, equivalence is * determined by having the same number of owned properties (as verified * with Object.prototype.hasOwnProperty.call), the same set of keys * (although not necessarily the same order), equivalent values for every * corresponding key, and an identical 'prototype' property. Note: this * accounts for both named and indexed properties on Arrays. */ // eslint-disable-next-line no-use-before-define return objEquiv(actual, expected, opts) } function isUndefinedOrNull (value) { return value === null || value === undefined } function isBuffer (x) { if (!x || typeof x !== 'object' || typeof x.length !== 'number') { return false } if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { return false } if (x.length > 0 && typeof x[0] !== 'number') { return false } return true } function objEquiv (a, b, opts) { /* eslint max-statements: [2, 50] */ let i, key if (typeof a !== typeof b) { return false } if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false } // an identical 'prototype' property. if (a.prototype !== b.prototype) { return false } if (isArguments(a) !== isArguments(b)) { return false } const aIsRegex = isRegex(a) const bIsRegex = isRegex(b) if (aIsRegex !== bIsRegex) { return false } if (aIsRegex || bIsRegex) { return a.source === b.source && flags(a) === flags(b) } if (isDate(a) && isDate(b)) { return getTime.call(a) === getTime.call(b) } const aIsBuffer = isBuffer(a) const bIsBuffer = isBuffer(b) if (aIsBuffer !== bIsBuffer) { return false } if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here if (a.length !== b.length) { return false } for (i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false } } return true } if (typeof a !== typeof b) { return false } try { var ka = objectKeys(a) var kb = objectKeys(b) } catch (e) { // happens when one is a string literal and the other isn't return false } // having the same number of owned properties (keys incorporates hasOwnProperty) if (ka.length !== kb.length) { return false } // the same set of keys (although not necessarily the same order), ka.sort() kb.sort() // ~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { if (ka[i] != kb[i]) { return false } } // equivalent values for every corresponding key, and ~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i] if (!deepEqual(a[key], b[key], opts)) { return false } } return true } module.exports = deepEqual /***/ }, /***/ 4289: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const keys = __webpack_require__(2215) const hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol' const toStr = Object.prototype.toString const concat = Array.prototype.concat const origDefineProperty = Object.defineProperty const isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]' } const arePropertyDescriptorsSupported = function () { const obj = {} try { origDefineProperty(obj, 'x', { enumerable: false, value: obj }) // eslint-disable-next-line no-unused-vars, no-restricted-syntax for (const _ in obj) { // jscs:ignore disallowUnusedVariables return false } return obj.x === obj } catch (e) { /* this is IE 8. */ return false } } const supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported() const defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value, writable: true }) } else { object[name] = value } } const defineProperties = function (object, map) { const predicates = arguments.length > 2 ? arguments[2] : {} let props = keys(map) if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)) } for (let i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]) } } defineProperties.supportsDescriptors = !!supportsDescriptors module.exports = defineProperties /***/ }, /***/ 8091: /***/ function (module) { 'use strict' /** * Code refactored from Mozilla Developer Network: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign */ function assign (target, firstSource) { if (target === undefined || target === null) { throw new TypeError('Cannot convert first argument to object') } const to = Object(target) for (let i = 1; i < arguments.length; i++) { const nextSource = arguments[i] if (nextSource === undefined || nextSource === null) { continue } const keysArray = Object.keys(Object(nextSource)) for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { const nextKey = keysArray[nextIndex] const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey) if (desc !== undefined && desc.enumerable) { to[nextKey] = nextSource[nextKey] } } } return to } function polyfill () { if (!Object.assign) { Object.defineProperty(Object, 'assign', { enumerable: false, configurable: true, writable: true, value: assign }) } } module.exports = { assign, polyfill } /***/ }, /***/ 7187: /***/ function (module) { 'use strict' // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. const R = typeof Reflect === 'object' ? Reflect : null const ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply (target, receiver, args) { return Function.prototype.apply.call(target, receiver, args) } let ReflectOwnKeys if (R && typeof R.ownKeys === 'function') { ReflectOwnKeys = R.ownKeys } else if (Object.getOwnPropertySymbols) { ReflectOwnKeys = function ReflectOwnKeys (target) { return Object.getOwnPropertyNames(target) .concat(Object.getOwnPropertySymbols(target)) } } else { ReflectOwnKeys = function ReflectOwnKeys (target) { return Object.getOwnPropertyNames(target) } } function ProcessEmitWarning (warning) { if (console && console.warn) console.warn(warning) } const NumberIsNaN = Number.isNaN || function NumberIsNaN (value) { return value !== value } function EventEmitter () { EventEmitter.init.call(this) } module.exports = EventEmitter module.exports.once = once // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter EventEmitter.prototype._events = undefined EventEmitter.prototype._eventsCount = 0 EventEmitter.prototype._maxListeners = undefined // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. let defaultMaxListeners = 10 function checkListener (listener) { if (typeof listener !== 'function') { throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener) } } Object.defineProperty(EventEmitter, 'defaultMaxListeners', { enumerable: true, get: function () { return defaultMaxListeners }, set: function (arg) { if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.') } defaultMaxListeners = arg } }) EventEmitter.init = function () { if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { this._events = Object.create(null) this._eventsCount = 0 } this._maxListeners = this._maxListeners || undefined } // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function setMaxListeners (n) { if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.') } this._maxListeners = n return this } function _getMaxListeners (that) { if (that._maxListeners === undefined) { return EventEmitter.defaultMaxListeners } return that._maxListeners } EventEmitter.prototype.getMaxListeners = function getMaxListeners () { return _getMaxListeners(this) } EventEmitter.prototype.emit = function emit (type) { const args = [] for (var i = 1; i < arguments.length; i++) args.push(arguments[i]) let doError = (type === 'error') const events = this._events if (events !== undefined) { doError = (doError && events.error === undefined) } else if (!doError) { return false } // If there is no 'error' event listener then throw. if (doError) { let er if (args.length > 0) { er = args[0] } if (er instanceof Error) { // Note: The comments on the `throw` lines are intentional, they show // up in Node's output if this results in an unhandled exception. throw er // Unhandled 'error' event } // At least give some kind of context to the user const err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')) err.context = er throw err // Unhandled 'error' event } const handler = events[type] if (handler === undefined) { return false } if (typeof handler === 'function') { ReflectApply(handler, this, args) } else { const len = handler.length const listeners = arrayClone(handler, len) for (var i = 0; i < len; ++i) { ReflectApply(listeners[i], this, args) } } return true } function _addListener (target, type, listener, prepend) { let m let events let existing checkListener(listener) events = target._events if (events === undefined) { events = target._events = Object.create(null) target._eventsCount = 0 } else { // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (events.newListener !== undefined) { target.emit('newListener', type, listener.listener ? listener.listener : listener) // Re-assign `events` because a newListener handler could have caused the // this._events to be assigned to a new object events = target._events } existing = events[type] } if (existing === undefined) { // Optimize the case of one listener. Don't need the extra array object. existing = events[type] = listener ++target._eventsCount } else { if (typeof existing === 'function') { // Adding the second element, need to change to array. existing = events[type] = prepend ? [listener, existing] : [existing, listener] // If we've already got an array, just append. } else if (prepend) { existing.unshift(listener) } else { existing.push(listener) } // Check for listener leak m = _getMaxListeners(target) if (m > 0 && existing.length > m && !existing.warned) { existing.warned = true // No error code for this since it is a Warning // eslint-disable-next-line no-restricted-syntax const w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit') w.name = 'MaxListenersExceededWarning' w.emitter = target w.type = type w.count = existing.length ProcessEmitWarning(w) } } return target } EventEmitter.prototype.addListener = function addListener (type, listener) { return _addListener(this, type, listener, false) } EventEmitter.prototype.on = EventEmitter.prototype.addListener EventEmitter.prototype.prependListener = function prependListener (type, listener) { return _addListener(this, type, listener, true) } function onceWrapper () { if (!this.fired) { this.target.removeListener(this.type, this.wrapFn) this.fired = true if (arguments.length === 0) { return this.listener.call(this.target) } return this.listener.apply(this.target, arguments) } } function _onceWrap (target, type, listener) { const state = { fired: false, wrapFn: undefined, target, type, listener } const wrapped = onceWrapper.bind(state) wrapped.listener = listener state.wrapFn = wrapped return wrapped } EventEmitter.prototype.once = function once (type, listener) { checkListener(listener) this.on(type, _onceWrap(this, type, listener)) return this } EventEmitter.prototype.prependOnceListener = function prependOnceListener (type, listener) { checkListener(listener) this.prependListener(type, _onceWrap(this, type, listener)) return this } // Emits a 'removeListener' event if and only if the listener was removed. EventEmitter.prototype.removeListener = function removeListener (type, listener) { let list, events, position, i, originalListener checkListener(listener) events = this._events if (events === undefined) { return this } list = events[type] if (list === undefined) { return this } if (list === listener || list.listener === listener) { if (--this._eventsCount === 0) { this._events = Object.create(null) } else { delete events[type] if (events.removeListener) { this.emit('removeListener', type, list.listener || listener) } } } else if (typeof list !== 'function') { position = -1 for (i = list.length - 1; i >= 0; i--) { if (list[i] === listener || list[i].listener === listener) { originalListener = list[i].listener position = i break } } if (position < 0) { return this } if (position === 0) { list.shift() } else { spliceOne(list, position) } if (list.length === 1) { events[type] = list[0] } if (events.removeListener !== undefined) { this.emit('removeListener', type, originalListener || listener) } } return this } EventEmitter.prototype.off = EventEmitter.prototype.removeListener EventEmitter.prototype.removeAllListeners = function removeAllListeners (type) { let listeners, events, i events = this._events if (events === undefined) { return this } // not listening for removeListener, no need to emit if (events.removeListener === undefined) { if (arguments.length === 0) { this._events = Object.create(null) this._eventsCount = 0 } else if (events[type] !== undefined) { if (--this._eventsCount === 0) { this._events = Object.create(null) } else { delete events[type] } } return this } // emit removeListener for all listeners on all events if (arguments.length === 0) { const keys = Object.keys(events) let key for (i = 0; i < keys.length; ++i) { key = keys[i] if (key === 'removeListener') continue this.removeAllListeners(key) } this.removeAllListeners('removeListener') this._events = Object.create(null) this._eventsCount = 0 return this } listeners = events[type] if (typeof listeners === 'function') { this.removeListener(type, listeners) } else if (listeners !== undefined) { // LIFO order for (i = listeners.length - 1; i >= 0; i--) { this.removeListener(type, listeners[i]) } } return this } function _listeners (target, type, unwrap) { const events = target._events if (events === undefined) { return [] } const evlistener = events[type] if (evlistener === undefined) { return [] } if (typeof evlistener === 'function') { return unwrap ? [evlistener.listener || evlistener] : [evlistener] } return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length) } EventEmitter.prototype.listeners = function listeners (type) { return _listeners(this, type, true) } EventEmitter.prototype.rawListeners = function rawListeners (type) { return _listeners(this, type, false) } EventEmitter.listenerCount = function (emitter, type) { if (typeof emitter.listenerCount === 'function') { return emitter.listenerCount(type) } else { return listenerCount.call(emitter, type) } } EventEmitter.prototype.listenerCount = listenerCount function listenerCount (type) { const events = this._events if (events !== undefined) { const evlistener = events[type] if (typeof evlistener === 'function') { return 1 } else if (evlistener !== undefined) { return evlistener.length } } return 0 } EventEmitter.prototype.eventNames = function eventNames () { return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [] } function arrayClone (arr, n) { const copy = new Array(n) for (let i = 0; i < n; ++i) { copy[i] = arr[i] } return copy } function spliceOne (list, index) { for (; index + 1 < list.length; index++) { list[index] = list[index + 1] } list.pop() } function unwrapListeners (arr) { const ret = new Array(arr.length) for (let i = 0; i < ret.length; ++i) { ret[i] = arr[i].listener || arr[i] } return ret } function once (emitter, name) { return new Promise(function (resolve, reject) { function errorListener (err) { emitter.removeListener(name, resolver) reject(err) } function resolver () { if (typeof emitter.removeListener === 'function') { emitter.removeListener('error', errorListener) } resolve([].slice.call(arguments)) }; eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }) if (name !== 'error') { addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }) } }) } function addErrorHandlerIfEventEmitter (emitter, handler, flags) { if (typeof emitter.on === 'function') { eventTargetAgnosticAddListener(emitter, 'error', handler, flags) } } function eventTargetAgnosticAddListener (emitter, name, listener, flags) { if (typeof emitter.on === 'function') { if (flags.once) { emitter.once(name, listener) } else { emitter.on(name, listener) } } else if (typeof emitter.addEventListener === 'function') { // EventTarget does not have `error` event semantics like Node // EventEmitters, we do not listen for `error` events here. emitter.addEventListener(name, function wrapListener (arg) { // IE does not have builtin `{ once: true }` support so we // have to do it manually. if (flags.once) { emitter.removeEventListener(name, wrapListener) } listener(arg) }) } else { throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter) } } /***/ }, /***/ 2536: /***/ function (module, __unused_webpack_exports, __webpack_require__) { const ___EXPOSE_LOADER_IMPORT___ = __webpack_require__(4275) const ___EXPOSE_LOADER_GET_GLOBAL_THIS___ = __webpack_require__(7672) const ___EXPOSE_LOADER_GLOBAL_THIS___ = ___EXPOSE_LOADER_GET_GLOBAL_THIS___ if (typeof ___EXPOSE_LOADER_GLOBAL_THIS___.pdfMake === 'undefined') ___EXPOSE_LOADER_GLOBAL_THIS___.pdfMake = ___EXPOSE_LOADER_IMPORT___ module.exports = ___EXPOSE_LOADER_IMPORT___ /***/ }, /***/ 7672: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' // eslint-disable-next-line func-names module.exports = (function () { if (typeof globalThis === 'object') { return globalThis } let g try { // This works if eval is allowed (see CSP) // eslint-disable-next-line no-new-func g = this || new Function('return this')() } catch (e) { // This works if the window reference is available if (typeof window === 'object') { return window } // This works if the self reference is available if (typeof self === 'object') { return self } // This works if the global reference is available if (typeof __webpack_require__.g !== 'undefined') { return __webpack_require__.g } } return g }()) /***/ }, /***/ 9804: /***/ function (module) { const hasOwn = Object.prototype.hasOwnProperty const toString = Object.prototype.toString module.exports = function forEach (obj, fn, ctx) { if (toString.call(fn) !== '[object Function]') { throw new TypeError('iterator must be a function') } const l = obj.length if (l === +l) { for (let i = 0; i < l; i++) { fn.call(ctx, obj[i], i, obj) } } else { for (const k in obj) { if (hasOwn.call(obj, k)) { fn.call(ctx, obj[k], k, obj) } } } } /***/ }, /***/ 7648: /***/ function (module) { 'use strict' /* eslint no-invalid-this: 1 */ const ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ' const slice = Array.prototype.slice const toStr = Object.prototype.toString const funcType = '[object Function]' module.exports = function bind (that) { const target = this if (typeof target !== 'function' || toStr.call(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target) } const args = slice.call(arguments, 1) let bound const binder = function () { if (this instanceof bound) { const result = target.apply( this, args.concat(slice.call(arguments)) ) if (Object(result) === result) { return result } return this } else { return target.apply( that, args.concat(slice.call(arguments)) ) } } const boundLength = Math.max(0, target.length - args.length) const boundArgs = [] for (let i = 0; i < boundLength; i++) { boundArgs.push('$' + i) } bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder) if (target.prototype) { const Empty = function Empty () {} Empty.prototype = target.prototype bound.prototype = new Empty() Empty.prototype = null } return bound } /***/ }, /***/ 8612: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const implementation = __webpack_require__(7648) module.exports = Function.prototype.bind || implementation /***/ }, /***/ 210: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' let undefined const $SyntaxError = SyntaxError const $Function = Function const $TypeError = TypeError // eslint-disable-next-line consistent-return const getEvalledConstructor = function (expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')() } catch (e) {} } let $gOPD = Object.getOwnPropertyDescriptor if ($gOPD) { try { $gOPD({}, '') } catch (e) { $gOPD = null // this is IE 8, which has a broken gOPD } } const throwTypeError = function () { throw new $TypeError() } const ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee // IE 8 does not throw here return throwTypeError } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get } catch (gOPDthrows) { return throwTypeError } } }()) : throwTypeError const hasSymbols = __webpack_require__(1405)() const getProto = Object.getPrototypeOf || function (x) { return x.__proto__ } // eslint-disable-line no-proto const needsEval = {} const TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array) const INTRINSICS = { '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': Object, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%ReferenceError%': ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet } const doEval = function doEval (name) { let value if (name === '%AsyncFunction%') { value = getEvalledConstructor('async function () {}') } else if (name === '%GeneratorFunction%') { value = getEvalledConstructor('function* () {}') } else if (name === '%AsyncGeneratorFunction%') { value = getEvalledConstructor('async function* () {}') } else if (name === '%AsyncGenerator%') { const fn = doEval('%AsyncGeneratorFunction%') if (fn) { value = fn.prototype } } else if (name === '%AsyncIteratorPrototype%') { const gen = doEval('%AsyncGenerator%') if (gen) { value = getProto(gen.prototype) } } INTRINSICS[name] = value return value } const LEGACY_ALIASES = { '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], '%ArrayProto_values%': ['Array', 'prototype', 'values'], '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], '%BooleanPrototype%': ['Boolean', 'prototype'], '%DataViewPrototype%': ['DataView', 'prototype'], '%DatePrototype%': ['Date', 'prototype'], '%ErrorPrototype%': ['Error', 'prototype'], '%EvalErrorPrototype%': ['EvalError', 'prototype'], '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], '%FunctionPrototype%': ['Function', 'prototype'], '%Generator%': ['GeneratorFunction', 'prototype'], '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], '%JSONParse%': ['JSON', 'parse'], '%JSONStringify%': ['JSON', 'stringify'], '%MapPrototype%': ['Map', 'prototype'], '%NumberPrototype%': ['Number', 'prototype'], '%ObjectPrototype%': ['Object', 'prototype'], '%ObjProto_toString%': ['Object', 'prototype', 'toString'], '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], '%PromisePrototype%': ['Promise', 'prototype'], '%PromiseProto_then%': ['Promise', 'prototype', 'then'], '%Promise_all%': ['Promise', 'all'], '%Promise_reject%': ['Promise', 'reject'], '%Promise_resolve%': ['Promise', 'resolve'], '%RangeErrorPrototype%': ['RangeError', 'prototype'], '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], '%RegExpPrototype%': ['RegExp', 'prototype'], '%SetPrototype%': ['Set', 'prototype'], '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], '%StringPrototype%': ['String', 'prototype'], '%SymbolPrototype%': ['Symbol', 'prototype'], '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], '%TypedArrayPrototype%': ['TypedArray', 'prototype'], '%TypeErrorPrototype%': ['TypeError', 'prototype'], '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], '%URIErrorPrototype%': ['URIError', 'prototype'], '%WeakMapPrototype%': ['WeakMap', 'prototype'], '%WeakSetPrototype%': ['WeakSet', 'prototype'] } const bind = __webpack_require__(8612) const hasOwn = __webpack_require__(7642) const $concat = bind.call(Function.call, Array.prototype.concat) const $spliceApply = bind.call(Function.apply, Array.prototype.splice) const $replace = bind.call(Function.call, String.prototype.replace) const $strSlice = bind.call(Function.call, String.prototype.slice) /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ const rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g const reEscapeChar = /\\(\\)?/g /** Used to match backslashes in property paths. */ const stringToPath = function stringToPath (string) { const first = $strSlice(string, 0, 1) const last = $strSlice(string, -1) if (first === '%' && last !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`') } else if (last === '%' && first !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`') } const result = [] $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match }) return result } /* end adaptation */ const getBaseIntrinsic = function getBaseIntrinsic (name, allowMissing) { let intrinsicName = name let alias if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName] intrinsicName = '%' + alias[0] + '%' } if (hasOwn(INTRINSICS, intrinsicName)) { let value = INTRINSICS[intrinsicName] if (value === needsEval) { value = doEval(intrinsicName) } if (typeof value === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!') } return { alias, name: intrinsicName, value } } throw new $SyntaxError('intrinsic ' + name + ' does not exist!') } module.exports = function GetIntrinsic (name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string') } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean') } const parts = stringToPath(name) let intrinsicBaseName = parts.length > 0 ? parts[0] : '' const intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing) let intrinsicRealName = intrinsic.name let value = intrinsic.value let skipFurtherCaching = false const alias = intrinsic.alias if (alias) { intrinsicBaseName = alias[0] $spliceApply(parts, $concat([0, 1], alias)) } for (let i = 1, isOwn = true; i < parts.length; i += 1) { const part = parts[i] const first = $strSlice(part, 0, 1) const last = $strSlice(part, -1) if ( ( (first === '"' || first === "'" || first === '`') || (last === '"' || last === "'" || last === '`') ) && first !== last ) { throw new $SyntaxError('property names with quotes must have matching quotes') } if (part === 'constructor' || !isOwn) { skipFurtherCaching = true } intrinsicBaseName += '.' + part intrinsicRealName = '%' + intrinsicBaseName + '%' if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName] } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.') } return void undefined } if ($gOPD && (i + 1) >= parts.length) { const desc = $gOPD(value, part) isOwn = !!desc // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { value = desc.get } else { value = value[part] } } else { isOwn = hasOwn(value, part) value = value[part] } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value } } } return value } /***/ }, /***/ 1405: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const origSymbol = typeof Symbol !== 'undefined' && Symbol const hasSymbolSham = __webpack_require__(5419) module.exports = function hasNativeSymbols () { if (typeof origSymbol !== 'function') { return false } if (typeof Symbol !== 'function') { return false } if (typeof origSymbol('foo') !== 'symbol') { return false } if (typeof Symbol('bar') !== 'symbol') { return false } return hasSymbolSham() } /***/ }, /***/ 5419: /***/ function (module) { 'use strict' /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols () { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false } if (typeof Symbol.iterator === 'symbol') { return true } const obj = {} let sym = Symbol('test') const symObj = Object(sym) if (typeof sym === 'string') { return false } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } const symVal = 42 obj[sym] = symVal for (sym in obj) { return false } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false } const syms = Object.getOwnPropertySymbols(obj) if (syms.length !== 1 || syms[0] !== sym) { return false } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false } if (typeof Object.getOwnPropertyDescriptor === 'function') { const descriptor = Object.getOwnPropertyDescriptor(obj, sym) if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false } } return true } /***/ }, /***/ 6410: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const hasSymbols = __webpack_require__(5419) module.exports = function hasToStringTagShams () { return hasSymbols() && !!Symbol.toStringTag } /***/ }, /***/ 7642: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const bind = __webpack_require__(8612) module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty) /***/ }, /***/ 688: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // Multibyte codec. In this scheme, a character is represented by 1 or more bytes. // Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. // To save memory and loading time, we read table files only when requested. exports._dbcs = DBCSCodec const UNASSIGNED = -1 const GB18030_CODE = -2 const SEQ_START = -10 const NODE_START = -1000 const UNASSIGNED_NODE = new Array(0x100) const DEF_CHAR = -1 for (let i = 0; i < 0x100; i++) { UNASSIGNED_NODE[i] = UNASSIGNED } // Class DBCSCodec reads and initializes mapping tables. function DBCSCodec (codecOptions, iconv) { this.encodingName = codecOptions.encodingName if (!codecOptions) { throw new Error('DBCS codec is called without the data.') } if (!codecOptions.table) { throw new Error("Encoding '" + this.encodingName + "' has no data.") } // Load tables. const mappingTable = codecOptions.table() // Decode tables: MBCS -> Unicode. // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. // Trie root is decodeTables[0]. // Values: >= 0 -> unicode character code. can be > 0xFFFF // == UNASSIGNED -> unknown/unassigned sequence. // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. // <= NODE_START -> index of the next node in our trie to process next byte. // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. this.decodeTables = [] this.decodeTables[0] = UNASSIGNED_NODE.slice(0) // Create root node. // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. this.decodeTableSeq = [] // Actual mapping tables consist of chunks. Use them to fill up decode tables. for (var i = 0; i < mappingTable.length; i++) { this._addDecodeChunk(mappingTable[i]) } // Load & create GB18030 tables when needed. if (typeof codecOptions.gb18030 === 'function') { this.gb18030 = codecOptions.gb18030() // Load GB18030 ranges. // Add GB18030 common decode nodes. const commonThirdByteNodeIdx = this.decodeTables.length this.decodeTables.push(UNASSIGNED_NODE.slice(0)) const commonFourthByteNodeIdx = this.decodeTables.length this.decodeTables.push(UNASSIGNED_NODE.slice(0)) // Fill out the tree const firstByteNode = this.decodeTables[0] for (var i = 0x81; i <= 0xFE; i++) { const secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]] for (var j = 0x30; j <= 0x39; j++) { if (secondByteNode[j] === UNASSIGNED) { secondByteNode[j] = NODE_START - commonThirdByteNodeIdx } else if (secondByteNode[j] > NODE_START) { throw new Error('gb18030 decode tables conflict at byte 2') } const thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]] for (let k = 0x81; k <= 0xFE; k++) { if (thirdByteNode[k] === UNASSIGNED) { thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { continue } else if (thirdByteNode[k] > NODE_START) { throw new Error('gb18030 decode tables conflict at byte 3') } const fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]] for (let l = 0x30; l <= 0x39; l++) { if (fourthByteNode[l] === UNASSIGNED) { fourthByteNode[l] = GB18030_CODE } } } } } } this.defaultCharUnicode = iconv.defaultCharUnicode // Encode tables: Unicode -> DBCS. // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). // == UNASSIGNED -> no conversion found. Output a default char. // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. this.encodeTable = [] // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key // means end of sequence (needed when one sequence is a strict subsequence of another). // Objects are kept separately from encodeTable to increase performance. this.encodeTableSeq = [] // Some chars can be decoded, but need not be encoded. const skipEncodeChars = {} if (codecOptions.encodeSkipVals) { for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { const val = codecOptions.encodeSkipVals[i] if (typeof val === 'number') { skipEncodeChars[val] = true } else { for (var j = val.from; j <= val.to; j++) { skipEncodeChars[j] = true } } } } // Use decode trie to recursively fill out encode tables. this._fillEncodeTable(0, 0, skipEncodeChars) // Add more encoding pairs when needed. if (codecOptions.encodeAdd) { for (const uChar in codecOptions.encodeAdd) { if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) { this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]) } } } this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)] if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'] if (this.defCharSB === UNASSIGNED) this.defCharSB = '?'.charCodeAt(0) } DBCSCodec.prototype.encoder = DBCSEncoder DBCSCodec.prototype.decoder = DBCSDecoder // Decoder helpers DBCSCodec.prototype._getDecodeTrieNode = function (addr) { const bytes = [] for (; addr > 0; addr >>>= 8) { bytes.push(addr & 0xFF) } if (bytes.length == 0) { bytes.push(0) } let node = this.decodeTables[0] for (let i = bytes.length - 1; i > 0; i--) { // Traverse nodes deeper into the trie. const val = node[bytes[i]] if (val == UNASSIGNED) { // Create new node. node[bytes[i]] = NODE_START - this.decodeTables.length this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)) } else if (val <= NODE_START) { // Existing node. node = this.decodeTables[NODE_START - val] } else { throw new Error('Overwrite byte in ' + this.encodingName + ', addr: ' + addr.toString(16)) } } return node } DBCSCodec.prototype._addDecodeChunk = function (chunk) { // First element of chunk is the hex mbcs code where we start. let curAddr = parseInt(chunk[0], 16) // Choose the decoding node where we'll write our chars. const writeTable = this._getDecodeTrieNode(curAddr) curAddr = curAddr & 0xFF // Write all other elements of the chunk to the table. for (let k = 1; k < chunk.length; k++) { const part = chunk[k] if (typeof part === 'string') { // String, write as-is. for (var l = 0; l < part.length;) { const code = part.charCodeAt(l++) if (code >= 0xD800 && code < 0xDC00) { // Decode surrogate const codeTrail = part.charCodeAt(l++) if (codeTrail >= 0xDC00 && codeTrail < 0xE000) { writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00) } else { throw new Error('Incorrect surrogate pair in ' + this.encodingName + ' at chunk ' + chunk[0]) } } else if (code > 0x0FF0 && code <= 0x0FFF) { // Character sequence (our own encoding used) const len = 0xFFF - code + 2 const seq = [] for (let m = 0; m < len; m++) { seq.push(part.charCodeAt(l++)) } // Simple variation: don't support surrogates or subsequences in seq. writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length this.decodeTableSeq.push(seq) } else { writeTable[curAddr++] = code } // Basic char } } else if (typeof part === 'number') { // Integer, meaning increasing sequence starting with prev character. let charCode = writeTable[curAddr - 1] + 1 for (var l = 0; l < part; l++) { writeTable[curAddr++] = charCode++ } } else { throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + ' at chunk ' + chunk[0]) } } if (curAddr > 0xFF) { throw new Error('Incorrect chunk in ' + this.encodingName + ' at addr ' + chunk[0] + ': too long' + curAddr) } } // Encoder helpers DBCSCodec.prototype._getEncodeBucket = function (uCode) { const high = uCode >> 8 // This could be > 0xFF because of astral characters. if (this.encodeTable[high] === undefined) { this.encodeTable[high] = UNASSIGNED_NODE.slice(0) } // Create bucket on demand. return this.encodeTable[high] } DBCSCodec.prototype._setEncodeChar = function (uCode, dbcsCode) { const bucket = this._getEncodeBucket(uCode) const low = uCode & 0xFF if (bucket[low] <= SEQ_START) { this.encodeTableSeq[SEQ_START - bucket[low]][DEF_CHAR] = dbcsCode } // There's already a sequence, set a single-char subsequence of it. else if (bucket[low] == UNASSIGNED) { bucket[low] = dbcsCode } } DBCSCodec.prototype._setEncodeSequence = function (seq, dbcsCode) { // Get the root of character tree according to first character of the sequence. let uCode = seq[0] const bucket = this._getEncodeBucket(uCode) const low = uCode & 0xFF let node if (bucket[low] <= SEQ_START) { // There's already a sequence with - use it. node = this.encodeTableSeq[SEQ_START - bucket[low]] } else { // There was no sequence object - allocate a new one. node = {} if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low] // If a char was set before - make it a single-char subsequence. bucket[low] = SEQ_START - this.encodeTableSeq.length this.encodeTableSeq.push(node) } // Traverse the character tree, allocating new nodes as needed. for (let j = 1; j < seq.length - 1; j++) { const oldVal = node[uCode] if (typeof oldVal === 'object') { node = oldVal } else { node = node[uCode] = {} if (oldVal !== undefined) { node[DEF_CHAR] = oldVal } } } // Set the leaf to given dbcsCode. uCode = seq[seq.length - 1] node[uCode] = dbcsCode } DBCSCodec.prototype._fillEncodeTable = function (nodeIdx, prefix, skipEncodeChars) { const node = this.decodeTables[nodeIdx] let hasValues = false const subNodeEmpty = {} for (let i = 0; i < 0x100; i++) { const uCode = node[i] const mbCode = prefix + i if (skipEncodeChars[mbCode]) { continue } if (uCode >= 0) { this._setEncodeChar(uCode, mbCode) hasValues = true } else if (uCode <= NODE_START) { const subNodeIdx = NODE_START - uCode if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). const newPrefix = (mbCode << 8) >>> 0 // NOTE: '>>> 0' keeps 32-bit num positive. if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) { hasValues = true } else { subNodeEmpty[subNodeIdx] = true } } } else if (uCode <= SEQ_START) { this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode) hasValues = true } } return hasValues } // == Encoder ================================================================== function DBCSEncoder (options, codec) { // Encoder state this.leadSurrogate = -1 this.seqObj = undefined // Static data this.encodeTable = codec.encodeTable this.encodeTableSeq = codec.encodeTableSeq this.defaultCharSingleByte = codec.defCharSB this.gb18030 = codec.gb18030 } DBCSEncoder.prototype.write = function (str) { const newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)) let leadSurrogate = this.leadSurrogate let seqObj = this.seqObj; let nextChar = -1 let i = 0; let j = 0 while (true) { // 0. Get next character. if (nextChar === -1) { if (i == str.length) break var uCode = str.charCodeAt(i++) } else { var uCode = nextChar nextChar = -1 } // 1. Handle surrogates. if (uCode >= 0xD800 && uCode < 0xE000) { // Char is one of surrogates. if (uCode < 0xDC00) { // We've got lead surrogate. if (leadSurrogate === -1) { leadSurrogate = uCode continue } else { leadSurrogate = uCode // Double lead surrogate found. uCode = UNASSIGNED } } else { // We've got trail surrogate. if (leadSurrogate !== -1) { uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00) leadSurrogate = -1 } else { // Incomplete surrogate pair - only trail surrogate found. uCode = UNASSIGNED } } } else if (leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. nextChar = uCode; uCode = UNASSIGNED // Write an error, then current char. leadSurrogate = -1 } // 2. Convert uCode character. var dbcsCode = UNASSIGNED if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence let resCode = seqObj[uCode] if (typeof resCode === 'object') { // Sequence continues. seqObj = resCode continue } else if (typeof resCode === 'number') { // Sequence finished. Write it. dbcsCode = resCode } else if (resCode == undefined) { // Current character is not part of the sequence. // Try default character for this sequence resCode = seqObj[DEF_CHAR] if (resCode !== undefined) { dbcsCode = resCode // Found. Write it. nextChar = uCode // Current character will be written too in the next iteration. } else { // TODO: What if we have no default? (resCode == undefined) // Then, we should write first char of the sequence as-is and try the rest recursively. // Didn't do it for now because no encoding has this situation yet. // Currently, just skip the sequence and write current char. } } seqObj = undefined } else if (uCode >= 0) { // Regular character const subtable = this.encodeTable[uCode >> 8] if (subtable !== undefined) { dbcsCode = subtable[uCode & 0xFF] } if (dbcsCode <= SEQ_START) { // Sequence start seqObj = this.encodeTableSeq[SEQ_START - dbcsCode] continue } if (dbcsCode == UNASSIGNED && this.gb18030) { // Use GB18030 algorithm to find character(s) to write. const idx = findIdx(this.gb18030.uChars, uCode) if (idx != -1) { var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]) newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600 newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260 newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10 newBuf[j++] = 0x30 + dbcsCode continue } } } // 3. Write dbcsCode character. if (dbcsCode === UNASSIGNED) { dbcsCode = this.defaultCharSingleByte } if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode } else if (dbcsCode < 0x10000) { newBuf[j++] = dbcsCode >> 8 // high byte newBuf[j++] = dbcsCode & 0xFF // low byte } else if (dbcsCode < 0x1000000) { newBuf[j++] = dbcsCode >> 16 newBuf[j++] = (dbcsCode >> 8) & 0xFF newBuf[j++] = dbcsCode & 0xFF } else { newBuf[j++] = dbcsCode >>> 24 newBuf[j++] = (dbcsCode >>> 16) & 0xFF newBuf[j++] = (dbcsCode >>> 8) & 0xFF newBuf[j++] = dbcsCode & 0xFF } } this.seqObj = seqObj this.leadSurrogate = leadSurrogate return newBuf.slice(0, j) } DBCSEncoder.prototype.end = function () { if (this.leadSurrogate === -1 && this.seqObj === undefined) { return } // All clean. Most often case. const newBuf = Buffer.alloc(10); let j = 0 if (this.seqObj) { // We're in the sequence. const dbcsCode = this.seqObj[DEF_CHAR] if (dbcsCode !== undefined) { // Write beginning of the sequence. if (dbcsCode < 0x100) { newBuf[j++] = dbcsCode } else { newBuf[j++] = dbcsCode >> 8 // high byte newBuf[j++] = dbcsCode & 0xFF // low byte } } else { // See todo above. } this.seqObj = undefined } if (this.leadSurrogate !== -1) { // Incomplete surrogate pair - only lead surrogate found. newBuf[j++] = this.defaultCharSingleByte this.leadSurrogate = -1 } return newBuf.slice(0, j) } // Export for testing DBCSEncoder.prototype.findIdx = findIdx // == Decoder ================================================================== function DBCSDecoder (options, codec) { // Decoder state this.nodeIdx = 0 this.prevBytes = [] // Static data this.decodeTables = codec.decodeTables this.decodeTableSeq = codec.decodeTableSeq this.defaultCharUnicode = codec.defaultCharUnicode this.gb18030 = codec.gb18030 } DBCSDecoder.prototype.write = function (buf) { const newBuf = Buffer.alloc(buf.length * 2) let nodeIdx = this.nodeIdx const prevBytes = this.prevBytes; const prevOffset = this.prevBytes.length let seqStart = -this.prevBytes.length // idx of the start of current parsed sequence. var uCode for (var i = 0, j = 0; i < buf.length; i++) { const curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset] // Lookup in current trie node. var uCode = this.decodeTables[nodeIdx][curByte] if (uCode >= 0) { // Normal character, just use it. } else if (uCode === UNASSIGNED) { // Unknown char. // TODO: Callback with seq. uCode = this.defaultCharUnicode.charCodeAt(0) i = seqStart // Skip one byte ('i' will be incremented by the for loop) and try to parse again. } else if (uCode === GB18030_CODE) { if (i >= 3) { var ptr = (buf[i - 3] - 0x81) * 12600 + (buf[i - 2] - 0x30) * 1260 + (buf[i - 1] - 0x81) * 10 + (curByte - 0x30) } else { var ptr = (prevBytes[i - 3 + prevOffset] - 0x81) * 12600 + (((i - 2 >= 0) ? buf[i - 2] : prevBytes[i - 2 + prevOffset]) - 0x30) * 1260 + (((i - 1 >= 0) ? buf[i - 1] : prevBytes[i - 1 + prevOffset]) - 0x81) * 10 + (curByte - 0x30) } const idx = findIdx(this.gb18030.gbChars, ptr) uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx] } else if (uCode <= NODE_START) { // Go to next trie node. nodeIdx = NODE_START - uCode continue } else if (uCode <= SEQ_START) { // Output a sequence of chars. const seq = this.decodeTableSeq[SEQ_START - uCode] for (let k = 0; k < seq.length - 1; k++) { uCode = seq[k] newBuf[j++] = uCode & 0xFF newBuf[j++] = uCode >> 8 } uCode = seq[seq.length - 1] } else { throw new Error('iconv-lite internal error: invalid decoding table value ' + uCode + ' at ' + nodeIdx + '/' + curByte) } // Write the character to buffer, handling higher planes using surrogate pair. if (uCode >= 0x10000) { uCode -= 0x10000 const uCodeLead = 0xD800 | (uCode >> 10) newBuf[j++] = uCodeLead & 0xFF newBuf[j++] = uCodeLead >> 8 uCode = 0xDC00 | (uCode & 0x3FF) } newBuf[j++] = uCode & 0xFF newBuf[j++] = uCode >> 8 // Reset trie node. nodeIdx = 0; seqStart = i + 1 } this.nodeIdx = nodeIdx this.prevBytes = (seqStart >= 0) ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)) return newBuf.slice(0, j).toString('ucs2') } DBCSDecoder.prototype.end = function () { let ret = '' // Try to parse all remaining chars. while (this.prevBytes.length > 0) { // Skip 1 character in the buffer. ret += this.defaultCharUnicode const bytesArr = this.prevBytes.slice(1) // Parse remaining as usual. this.prevBytes = [] this.nodeIdx = 0 if (bytesArr.length > 0) { ret += this.write(bytesArr) } } this.prevBytes = [] this.nodeIdx = 0 return ret } // Binary search for GB18030. Returns largest i such that table[i] <= val. function findIdx (table, val) { if (table[0] > val) { return -1 } let l = 0; let r = table.length while (l < r - 1) { // always table[l] <= val < table[r] const mid = l + ((r - l + 1) >> 1) if (table[mid] <= val) { l = mid } else { r = mid } } return l } /***/ }, /***/ 5990: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' // Description of supported double byte encodings and aliases. // Tables are not require()-d until they are needed to speed up library load. // require()-s are direct to support Browserify. module.exports = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html shiftjis: { type: '_dbcs', table: function () { return __webpack_require__(7014) }, encodeAdd: { '\u00a5': 0x5C, '\u203E': 0x7E }, encodeSkipVals: [{ from: 0xED40, to: 0xF940 }] }, csshiftjis: 'shiftjis', mskanji: 'shiftjis', sjis: 'shiftjis', windows31j: 'shiftjis', ms31j: 'shiftjis', xsjis: 'shiftjis', windows932: 'shiftjis', ms932: 'shiftjis', 932: 'shiftjis', cp932: 'shiftjis', eucjp: { type: '_dbcs', table: function () { return __webpack_require__(5633) }, encodeAdd: { '\u00a5': 0x5C, '\u203E': 0x7E } }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 gb2312: 'cp936', gb231280: 'cp936', gb23121980: 'cp936', csgb2312: 'cp936', csiso58gb231280: 'cp936', euccn: 'cp936', // Microsoft's CP936 is a subset and approximation of GBK. windows936: 'cp936', ms936: 'cp936', 936: 'cp936', cp936: { type: '_dbcs', table: function () { return __webpack_require__(3336) } }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. gbk: { type: '_dbcs', table: function () { return (__webpack_require__(3336).concat)(__webpack_require__(4346)) } }, xgbk: 'gbk', isoir58: 'gbk', // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 gb18030: { type: '_dbcs', table: function () { return (__webpack_require__(3336).concat)(__webpack_require__(4346)) }, gb18030: function () { return __webpack_require__(6258) }, encodeSkipVals: [0x80], encodeAdd: { '€': 0xA2E3 } }, chinese: 'gb18030', // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. windows949: 'cp949', ms949: 'cp949', 949: 'cp949', cp949: { type: '_dbcs', table: function () { return __webpack_require__(7348) } }, cseuckr: 'cp949', csksc56011987: 'cp949', euckr: 'cp949', isoir149: 'cp949', korean: 'cp949', ksc56011987: 'cp949', ksc56011989: 'cp949', ksc5601: 'cp949', // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. windows950: 'cp950', ms950: 'cp950', 950: 'cp950', cp950: { type: '_dbcs', table: function () { return __webpack_require__(4284) } }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. big5: 'big5hkscs', big5hkscs: { type: '_dbcs', table: function () { return (__webpack_require__(4284).concat)(__webpack_require__(3480)) }, encodeSkipVals: [ // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce ] }, cnbig5: 'big5hkscs', csbig5: 'big5hkscs', xxbig5: 'big5hkscs' } /***/ }, /***/ 6934: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' // Update this array if you add/rename/remove files in this directory. // We support Browserify by skipping automatic module discovery and requiring modules directly. const modules = [ __webpack_require__(1025), __webpack_require__(7688), __webpack_require__(1279), __webpack_require__(758), __webpack_require__(9068), __webpack_require__(3769), __webpack_require__(7018), __webpack_require__(688), __webpack_require__(5990) ] // Put all encoding/alias/codec definitions to single object and export it. for (let i = 0; i < modules.length; i++) { const module = modules[i] for (const enc in module) { if (Object.prototype.hasOwnProperty.call(module, enc)) { exports[enc] = module[enc] } } } /***/ }, /***/ 1025: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // Export Node.js internal encodings. module.exports = { // Encodings utf8: { type: '_internal', bomAware: true }, cesu8: { type: '_internal', bomAware: true }, unicode11utf8: 'utf8', ucs2: { type: '_internal', bomAware: true }, utf16le: 'ucs2', binary: { type: '_internal' }, base64: { type: '_internal' }, hex: { type: '_internal' }, // Codec. _internal: InternalCodec } // ------------------------------------------------------------------------------ function InternalCodec (codecOptions, iconv) { this.enc = codecOptions.encodingName this.bomAware = codecOptions.bomAware if (this.enc === 'base64') { this.encoder = InternalEncoderBase64 } else if (this.enc === 'cesu8') { this.enc = 'utf8' // Use utf8 for decoding. this.encoder = InternalEncoderCesu8 // Add decoder for versions of Node not supporting CESU-8 if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { this.decoder = InternalDecoderCesu8 this.defaultCharUnicode = iconv.defaultCharUnicode } } } InternalCodec.prototype.encoder = InternalEncoder InternalCodec.prototype.decoder = InternalDecoder // ------------------------------------------------------------------------------ // We use node.js internal decoder. Its signature is the same as ours. const StringDecoder = (__webpack_require__(2553)/* .StringDecoder */ .s) if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. { StringDecoder.prototype.end = function () {} } function InternalDecoder (options, codec) { this.decoder = new StringDecoder(codec.enc) } InternalDecoder.prototype.write = function (buf) { if (!Buffer.isBuffer(buf)) { buf = Buffer.from(buf) } return this.decoder.write(buf) } InternalDecoder.prototype.end = function () { return this.decoder.end() } // ------------------------------------------------------------------------------ // Encoder is mostly trivial function InternalEncoder (options, codec) { this.enc = codec.enc } InternalEncoder.prototype.write = function (str) { return Buffer.from(str, this.enc) } InternalEncoder.prototype.end = function () { } // ------------------------------------------------------------------------------ // Except base64 encoder, which must keep its state. function InternalEncoderBase64 (options, codec) { this.prevStr = '' } InternalEncoderBase64.prototype.write = function (str) { str = this.prevStr + str const completeQuads = str.length - (str.length % 4) this.prevStr = str.slice(completeQuads) str = str.slice(0, completeQuads) return Buffer.from(str, 'base64') } InternalEncoderBase64.prototype.end = function () { return Buffer.from(this.prevStr, 'base64') } // ------------------------------------------------------------------------------ // CESU-8 encoder is also special. function InternalEncoderCesu8 (options, codec) { } InternalEncoderCesu8.prototype.write = function (str) { const buf = Buffer.alloc(str.length * 3); let bufIdx = 0 for (let i = 0; i < str.length; i++) { const charCode = str.charCodeAt(i) // Naive implementation, but it works because CESU-8 is especially easy // to convert from UTF-16 (which all JS strings are encoded in). if (charCode < 0x80) { buf[bufIdx++] = charCode } else if (charCode < 0x800) { buf[bufIdx++] = 0xC0 + (charCode >>> 6) buf[bufIdx++] = 0x80 + (charCode & 0x3f) } else { // charCode will always be < 0x10000 in javascript. buf[bufIdx++] = 0xE0 + (charCode >>> 12) buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f) buf[bufIdx++] = 0x80 + (charCode & 0x3f) } } return buf.slice(0, bufIdx) } InternalEncoderCesu8.prototype.end = function () { } // ------------------------------------------------------------------------------ // CESU-8 decoder is not implemented in Node v4.0+ function InternalDecoderCesu8 (options, codec) { this.acc = 0 this.contBytes = 0 this.accBytes = 0 this.defaultCharUnicode = codec.defaultCharUnicode } InternalDecoderCesu8.prototype.write = function (buf) { let acc = this.acc; let contBytes = this.contBytes; let accBytes = this.accBytes let res = '' for (let i = 0; i < buf.length; i++) { const curByte = buf[i] if ((curByte & 0xC0) !== 0x80) { // Leading byte if (contBytes > 0) { // Previous code is invalid res += this.defaultCharUnicode contBytes = 0 } if (curByte < 0x80) { // Single-byte code res += String.fromCharCode(curByte) } else if (curByte < 0xE0) { // Two-byte code acc = curByte & 0x1F contBytes = 1; accBytes = 1 } else if (curByte < 0xF0) { // Three-byte code acc = curByte & 0x0F contBytes = 2; accBytes = 1 } else { // Four or more are not supported for CESU-8. res += this.defaultCharUnicode } } else { // Continuation byte if (contBytes > 0) { // We're waiting for it. acc = (acc << 6) | (curByte & 0x3f) contBytes--; accBytes++ if (contBytes === 0) { // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) if (accBytes === 2 && acc < 0x80 && acc > 0) { res += this.defaultCharUnicode } else if (accBytes === 3 && acc < 0x800) { res += this.defaultCharUnicode } else // Actually add character. { res += String.fromCharCode(acc) } } } else { // Unexpected continuation byte res += this.defaultCharUnicode } } } this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes return res } InternalDecoderCesu8.prototype.end = function () { let res = 0 if (this.contBytes > 0) { res += this.defaultCharUnicode } return res } /***/ }, /***/ 9068: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that // correspond to encoded bytes (if 128 - then lower half is ASCII). exports._sbcs = SBCSCodec function SBCSCodec (codecOptions, iconv) { if (!codecOptions) { throw new Error('SBCS codec is called without the data.') } // Prepare char buffer for decoding. if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) { throw new Error("Encoding '" + codecOptions.type + "' has incorrect 'chars' (must be of len 128 or 256)") } if (codecOptions.chars.length === 128) { let asciiString = '' for (var i = 0; i < 128; i++) { asciiString += String.fromCharCode(i) } codecOptions.chars = asciiString + codecOptions.chars } this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2') // Encoding buffer. const encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)) for (var i = 0; i < codecOptions.chars.length; i++) { encodeBuf[codecOptions.chars.charCodeAt(i)] = i } this.encodeBuf = encodeBuf } SBCSCodec.prototype.encoder = SBCSEncoder SBCSCodec.prototype.decoder = SBCSDecoder function SBCSEncoder (options, codec) { this.encodeBuf = codec.encodeBuf } SBCSEncoder.prototype.write = function (str) { const buf = Buffer.alloc(str.length) for (let i = 0; i < str.length; i++) { buf[i] = this.encodeBuf[str.charCodeAt(i)] } return buf } SBCSEncoder.prototype.end = function () { } function SBCSDecoder (options, codec) { this.decodeBuf = codec.decodeBuf } SBCSDecoder.prototype.write = function (buf) { // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. const decodeBuf = this.decodeBuf const newBuf = Buffer.alloc(buf.length * 2) let idx1 = 0; let idx2 = 0 for (let i = 0; i < buf.length; i++) { idx1 = buf[i] * 2; idx2 = i * 2 newBuf[idx2] = decodeBuf[idx1] newBuf[idx2 + 1] = decodeBuf[idx1 + 1] } return newBuf.toString('ucs2') } SBCSDecoder.prototype.end = function () { } /***/ }, /***/ 7018: /***/ function (module) { 'use strict' // Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. module.exports = { 437: 'cp437', 737: 'cp737', 775: 'cp775', 850: 'cp850', 852: 'cp852', 855: 'cp855', 856: 'cp856', 857: 'cp857', 858: 'cp858', 860: 'cp860', 861: 'cp861', 862: 'cp862', 863: 'cp863', 864: 'cp864', 865: 'cp865', 866: 'cp866', 869: 'cp869', 874: 'windows874', 922: 'cp922', 1046: 'cp1046', 1124: 'cp1124', 1125: 'cp1125', 1129: 'cp1129', 1133: 'cp1133', 1161: 'cp1161', 1162: 'cp1162', 1163: 'cp1163', 1250: 'windows1250', 1251: 'windows1251', 1252: 'windows1252', 1253: 'windows1253', 1254: 'windows1254', 1255: 'windows1255', 1256: 'windows1256', 1257: 'windows1257', 1258: 'windows1258', 28591: 'iso88591', 28592: 'iso88592', 28593: 'iso88593', 28594: 'iso88594', 28595: 'iso88595', 28596: 'iso88596', 28597: 'iso88597', 28598: 'iso88598', 28599: 'iso88599', 28600: 'iso885910', 28601: 'iso885911', 28603: 'iso885913', 28604: 'iso885914', 28605: 'iso885915', 28606: 'iso885916', windows874: { type: '_sbcs', chars: '€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����' }, win874: 'windows874', cp874: 'windows874', windows1250: { type: '_sbcs', chars: '€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙' }, win1250: 'windows1250', cp1250: 'windows1250', windows1251: { type: '_sbcs', chars: 'ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя' }, win1251: 'windows1251', cp1251: 'windows1251', windows1252: { type: '_sbcs', chars: '€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' }, win1252: 'windows1252', cp1252: 'windows1252', windows1253: { type: '_sbcs', chars: '€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�' }, win1253: 'windows1253', cp1253: 'windows1253', windows1254: { type: '_sbcs', chars: '€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ' }, win1254: 'windows1254', cp1254: 'windows1254', windows1255: { type: '_sbcs', chars: '€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�' }, win1255: 'windows1255', cp1255: 'windows1255', windows1256: { type: '_sbcs', chars: '€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے' }, win1256: 'windows1256', cp1256: 'windows1256', windows1257: { type: '_sbcs', chars: '€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙' }, win1257: 'windows1257', cp1257: 'windows1257', windows1258: { type: '_sbcs', chars: '€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ' }, win1258: 'windows1258', cp1258: 'windows1258', iso88591: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' }, cp28591: 'iso88591', iso88592: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙' }, cp28592: 'iso88592', iso88593: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙' }, cp28593: 'iso88593', iso88594: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙' }, cp28594: 'iso88594', iso88595: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ' }, cp28595: 'iso88595', iso88596: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������' }, cp28596: 'iso88596', iso88597: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�' }, cp28597: 'iso88597', iso88598: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�' }, cp28598: 'iso88598', iso88599: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ' }, cp28599: 'iso88599', iso885910: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ' }, cp28600: 'iso885910', iso885911: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����' }, cp28601: 'iso885911', iso885913: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’' }, cp28603: 'iso885913', iso885914: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ' }, cp28604: 'iso885914', iso885915: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' }, cp28605: 'iso885915', iso885916: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ' }, cp28606: 'iso885916', cp437: { type: '_sbcs', chars: 'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, ibm437: 'cp437', csibm437: 'cp437', cp737: { type: '_sbcs', chars: 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ' }, ibm737: 'cp737', csibm737: 'cp737', cp775: { type: '_sbcs', chars: 'ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ ' }, ibm775: 'cp775', csibm775: 'cp775', cp850: { type: '_sbcs', chars: 'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ' }, ibm850: 'cp850', csibm850: 'cp850', cp852: { type: '_sbcs', chars: 'ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ ' }, ibm852: 'cp852', csibm852: 'cp852', cp855: { type: '_sbcs', chars: 'ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ ' }, ibm855: 'cp855', csibm855: 'cp855', cp856: { type: '_sbcs', chars: 'אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ ' }, ibm856: 'cp856', csibm856: 'cp856', cp857: { type: '_sbcs', chars: 'ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ ' }, ibm857: 'cp857', csibm857: 'cp857', cp858: { type: '_sbcs', chars: 'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ' }, ibm858: 'cp858', csibm858: 'cp858', cp860: { type: '_sbcs', chars: 'ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, ibm860: 'cp860', csibm860: 'cp860', cp861: { type: '_sbcs', chars: 'ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, ibm861: 'cp861', csibm861: 'cp861', cp862: { type: '_sbcs', chars: 'אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, ibm862: 'cp862', csibm862: 'cp862', cp863: { type: '_sbcs', chars: 'ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, ibm863: 'cp863', csibm863: 'cp863', cp864: { type: '_sbcs', chars: "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" }, ibm864: 'cp864', csibm864: 'cp864', cp865: { type: '_sbcs', chars: 'ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, ibm865: 'cp865', csibm865: 'cp865', cp866: { type: '_sbcs', chars: 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ' }, ibm866: 'cp866', csibm866: 'cp866', cp869: { type: '_sbcs', chars: '������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ ' }, ibm869: 'cp869', csibm869: 'cp869', cp922: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ' }, ibm922: 'cp922', csibm922: 'cp922', cp1046: { type: '_sbcs', chars: 'ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�' }, ibm1046: 'cp1046', csibm1046: 'cp1046', cp1124: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ' }, ibm1124: 'cp1124', csibm1124: 'cp1124', cp1125: { type: '_sbcs', chars: 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ ' }, ibm1125: 'cp1125', csibm1125: 'cp1125', cp1129: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ' }, ibm1129: 'cp1129', csibm1129: 'cp1129', cp1133: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�' }, ibm1133: 'cp1133', csibm1133: 'cp1133', cp1161: { type: '_sbcs', chars: '��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ ' }, ibm1161: 'cp1161', csibm1161: 'cp1161', cp1162: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����' }, ibm1162: 'cp1162', csibm1162: 'cp1162', cp1163: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ' }, ibm1163: 'cp1163', csibm1163: 'cp1163', maccroatian: { type: '_sbcs', chars: 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ' }, maccyrillic: { type: '_sbcs', chars: 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤' }, macgreek: { type: '_sbcs', chars: 'Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�' }, maciceland: { type: '_sbcs', chars: 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ' }, macroman: { type: '_sbcs', chars: 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ' }, macromania: { type: '_sbcs', chars: 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ' }, macthai: { type: '_sbcs', chars: '«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����' }, macturkish: { type: '_sbcs', chars: 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ' }, macukraine: { type: '_sbcs', chars: 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤' }, koi8r: { type: '_sbcs', chars: '─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ' }, koi8u: { type: '_sbcs', chars: '─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ' }, koi8ru: { type: '_sbcs', chars: '─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ' }, koi8t: { type: '_sbcs', chars: 'қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ' }, armscii8: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�' }, rk1048: { type: '_sbcs', chars: 'ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя' }, tcvn: { type: '_sbcs', chars: "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" }, georgianacademy: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ' }, georgianps: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ' }, pt154: { type: '_sbcs', chars: 'ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя' }, viscii: { type: '_sbcs', chars: "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" }, iso646cn: { type: '_sbcs', chars: "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, iso646jp: { type: '_sbcs', chars: "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" }, hproman8: { type: '_sbcs', chars: '€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�' }, macintosh: { type: '_sbcs', chars: 'ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ' }, ascii: { type: '_sbcs', chars: '��������������������������������������������������������������������������������������������������������������������������������' }, tis620: { type: '_sbcs', chars: '���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����' } } /***/ }, /***/ 3769: /***/ function (module) { 'use strict' // Manually added data to be used by sbcs codec in addition to generated one. module.exports = { // Not supported by iconv, not sure why. 10029: 'maccenteuro', maccenteuro: { type: '_sbcs', chars: 'ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ' }, 808: 'cp808', ibm808: 'cp808', cp808: { type: '_sbcs', chars: 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ ' }, mik: { type: '_sbcs', chars: 'АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ' }, cp720: { type: '_sbcs', chars: '\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0' }, // Aliases of generated encodings. ascii8bit: 'ascii', usascii: 'ascii', ansix34: 'ascii', ansix341968: 'ascii', ansix341986: 'ascii', csascii: 'ascii', cp367: 'ascii', ibm367: 'ascii', isoir6: 'ascii', iso646us: 'ascii', iso646irv: 'ascii', us: 'ascii', latin1: 'iso88591', latin2: 'iso88592', latin3: 'iso88593', latin4: 'iso88594', latin5: 'iso88599', latin6: 'iso885910', latin7: 'iso885913', latin8: 'iso885914', latin9: 'iso885915', latin10: 'iso885916', csisolatin1: 'iso88591', csisolatin2: 'iso88592', csisolatin3: 'iso88593', csisolatin4: 'iso88594', csisolatincyrillic: 'iso88595', csisolatinarabic: 'iso88596', csisolatingreek: 'iso88597', csisolatinhebrew: 'iso88598', csisolatin5: 'iso88599', csisolatin6: 'iso885910', l1: 'iso88591', l2: 'iso88592', l3: 'iso88593', l4: 'iso88594', l5: 'iso88599', l6: 'iso885910', l7: 'iso885913', l8: 'iso885914', l9: 'iso885915', l10: 'iso885916', isoir14: 'iso646jp', isoir57: 'iso646cn', isoir100: 'iso88591', isoir101: 'iso88592', isoir109: 'iso88593', isoir110: 'iso88594', isoir144: 'iso88595', isoir127: 'iso88596', isoir126: 'iso88597', isoir138: 'iso88598', isoir148: 'iso88599', isoir157: 'iso885910', isoir166: 'tis620', isoir179: 'iso885913', isoir199: 'iso885914', isoir203: 'iso885915', isoir226: 'iso885916', cp819: 'iso88591', ibm819: 'iso88591', cyrillic: 'iso88595', arabic: 'iso88596', arabic8: 'iso88596', ecma114: 'iso88596', asmo708: 'iso88596', greek: 'iso88597', greek8: 'iso88597', ecma118: 'iso88597', elot928: 'iso88597', hebrew: 'iso88598', hebrew8: 'iso88598', turkish: 'iso88599', turkish8: 'iso88599', thai: 'iso885911', thai8: 'iso885911', celtic: 'iso885914', celtic8: 'iso885914', isoceltic: 'iso885914', tis6200: 'tis620', tis62025291: 'tis620', tis62025330: 'tis620', 10000: 'macroman', 10006: 'macgreek', 10007: 'maccyrillic', 10079: 'maciceland', 10081: 'macturkish', cspc8codepage437: 'cp437', cspc775baltic: 'cp775', cspc850multilingual: 'cp850', cspcp852: 'cp852', cspc862latinhebrew: 'cp862', cpgr: 'cp869', msee: 'cp1250', mscyrl: 'cp1251', msansi: 'cp1252', msgreek: 'cp1253', msturk: 'cp1254', mshebr: 'cp1255', msarab: 'cp1256', winbaltrim: 'cp1257', cp20866: 'koi8r', 20866: 'koi8r', ibm878: 'koi8r', cskoi8r: 'koi8r', cp21866: 'koi8u', 21866: 'koi8u', ibm1168: 'koi8u', strk10482002: 'rk1048', tcvn5712: 'tcvn', tcvn57121: 'tcvn', gb198880: 'iso646cn', cn: 'iso646cn', csiso14jisc6220ro: 'iso646jp', jisc62201969ro: 'iso646jp', jp: 'iso646jp', cshproman8: 'hproman8', r8: 'hproman8', roman8: 'hproman8', xroman8: 'hproman8', ibm1051: 'hproman8', mac: 'macintosh', csmacintosh: 'macintosh' } /***/ }, /***/ 1279: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js // == UTF16-BE codec. ========================================================== exports.utf16be = Utf16BECodec function Utf16BECodec () { } Utf16BECodec.prototype.encoder = Utf16BEEncoder Utf16BECodec.prototype.decoder = Utf16BEDecoder Utf16BECodec.prototype.bomAware = true // -- Encoding function Utf16BEEncoder () { } Utf16BEEncoder.prototype.write = function (str) { const buf = Buffer.from(str, 'ucs2') for (let i = 0; i < buf.length; i += 2) { const tmp = buf[i]; buf[i] = buf[i + 1]; buf[i + 1] = tmp } return buf } Utf16BEEncoder.prototype.end = function () { } // -- Decoding function Utf16BEDecoder () { this.overflowByte = -1 } Utf16BEDecoder.prototype.write = function (buf) { if (buf.length == 0) { return '' } const buf2 = Buffer.alloc(buf.length + 1) let i = 0; let j = 0 if (this.overflowByte !== -1) { buf2[0] = buf[0] buf2[1] = this.overflowByte i = 1; j = 2 } for (; i < buf.length - 1; i += 2, j += 2) { buf2[j] = buf[i + 1] buf2[j + 1] = buf[i] } this.overflowByte = (i == buf.length - 1) ? buf[buf.length - 1] : -1 return buf2.slice(0, j).toString('ucs2') } Utf16BEDecoder.prototype.end = function () { this.overflowByte = -1 } // == UTF-16 codec ============================================================= // Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. // Defaults to UTF-16LE, as it's prevalent and default in Node. // http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le // Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); // Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). exports.utf16 = Utf16Codec function Utf16Codec (codecOptions, iconv) { this.iconv = iconv } Utf16Codec.prototype.encoder = Utf16Encoder Utf16Codec.prototype.decoder = Utf16Decoder // -- Encoding (pass-through) function Utf16Encoder (options, codec) { options = options || {} if (options.addBOM === undefined) { options.addBOM = true } this.encoder = codec.iconv.getEncoder('utf-16le', options) } Utf16Encoder.prototype.write = function (str) { return this.encoder.write(str) } Utf16Encoder.prototype.end = function () { return this.encoder.end() } // -- Decoding function Utf16Decoder (options, codec) { this.decoder = null this.initialBufs = [] this.initialBufsLen = 0 this.options = options || {} this.iconv = codec.iconv } Utf16Decoder.prototype.write = function (buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf) this.initialBufsLen += buf.length if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) { return '' } // We have enough bytes -> detect endianness. const encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) this.decoder = this.iconv.getDecoder(encoding, this.options) let resStr = '' for (let i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } this.initialBufs.length = this.initialBufsLen = 0 return resStr } return this.decoder.write(buf) } Utf16Decoder.prototype.end = function () { if (!this.decoder) { const encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) this.decoder = this.iconv.getDecoder(encoding, this.options) let resStr = '' for (let i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } const trail = this.decoder.end() if (trail) { resStr += trail } this.initialBufs.length = this.initialBufsLen = 0 return resStr } return this.decoder.end() } function detectEncoding (bufs, defaultEncoding) { const b = [] let charsProcessed = 0 let asciiCharsLE = 0; let asciiCharsBE = 0 // Number of ASCII chars when decoded as LE or BE. outer_loop: for (let i = 0; i < bufs.length; i++) { const buf = bufs[i] for (let j = 0; j < buf.length; j++) { b.push(buf[j]) if (b.length === 2) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le' if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be' } if (b[0] === 0 && b[1] !== 0) asciiCharsBE++ if (b[0] !== 0 && b[1] === 0) asciiCharsLE++ b.length = 0 charsProcessed++ if (charsProcessed >= 100) { break outer_loop } } } } // Make decisions. // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. // So, we count ASCII as if it was LE or BE, and decide from that. if (asciiCharsBE > asciiCharsLE) return 'utf-16be' if (asciiCharsBE < asciiCharsLE) return 'utf-16le' // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-16le' } /***/ }, /***/ 7688: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // == UTF32-LE/BE codec. ========================================================== exports._utf32 = Utf32Codec function Utf32Codec (codecOptions, iconv) { this.iconv = iconv this.bomAware = true this.isLE = codecOptions.isLE } exports.utf32le = { type: '_utf32', isLE: true } exports.utf32be = { type: '_utf32', isLE: false } // Aliases exports.ucs4le = 'utf32le' exports.ucs4be = 'utf32be' Utf32Codec.prototype.encoder = Utf32Encoder Utf32Codec.prototype.decoder = Utf32Decoder // -- Encoding function Utf32Encoder (options, codec) { this.isLE = codec.isLE this.highSurrogate = 0 } Utf32Encoder.prototype.write = function (str) { const src = Buffer.from(str, 'ucs2') let dst = Buffer.alloc(src.length * 2) const write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE let offset = 0 for (let i = 0; i < src.length; i += 2) { const code = src.readUInt16LE(i) const isHighSurrogate = (code >= 0xD800 && code < 0xDC00) const isLowSurrogate = (code >= 0xDC00 && code < 0xE000) if (this.highSurrogate) { if (isHighSurrogate || !isLowSurrogate) { // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character // (technically wrong, but expected by some applications, like Windows file names). write32.call(dst, this.highSurrogate, offset) offset += 4 } else { // Create 32-bit value from high and low surrogates; const codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000 write32.call(dst, codepoint, offset) offset += 4 this.highSurrogate = 0 continue } } if (isHighSurrogate) { this.highSurrogate = code } else { // Even if the current character is a low surrogate, with no previous high surrogate, we'll // encode it as a semi-invalid stand-alone character for the same reasons expressed above for // unpaired high surrogates. write32.call(dst, code, offset) offset += 4 this.highSurrogate = 0 } } if (offset < dst.length) { dst = dst.slice(0, offset) } return dst } Utf32Encoder.prototype.end = function () { // Treat any leftover high surrogate as a semi-valid independent character. if (!this.highSurrogate) { return } const buf = Buffer.alloc(4) if (this.isLE) { buf.writeUInt32LE(this.highSurrogate, 0) } else { buf.writeUInt32BE(this.highSurrogate, 0) } this.highSurrogate = 0 return buf } // -- Decoding function Utf32Decoder (options, codec) { this.isLE = codec.isLE this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0) this.overflow = [] } Utf32Decoder.prototype.write = function (src) { if (src.length === 0) { return '' } let i = 0 let codepoint = 0 const dst = Buffer.alloc(src.length + 4) let offset = 0 const isLE = this.isLE const overflow = this.overflow const badChar = this.badChar if (overflow.length > 0) { for (; i < src.length && overflow.length < 4; i++) { overflow.push(src[i]) } if (overflow.length === 4) { // NOTE: codepoint is a signed int32 and can be negative. // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). if (isLE) { codepoint = overflow[i] | (overflow[i + 1] << 8) | (overflow[i + 2] << 16) | (overflow[i + 3] << 24) } else { codepoint = overflow[i + 3] | (overflow[i + 2] << 8) | (overflow[i + 1] << 16) | (overflow[i] << 24) } overflow.length = 0 offset = _writeCodepoint(dst, offset, codepoint, badChar) } } // Main loop. Should be as optimized as possible. for (; i < src.length - 3; i += 4) { // NOTE: codepoint is a signed int32 and can be negative. if (isLE) { codepoint = src[i] | (src[i + 1] << 8) | (src[i + 2] << 16) | (src[i + 3] << 24) } else { codepoint = src[i + 3] | (src[i + 2] << 8) | (src[i + 1] << 16) | (src[i] << 24) } offset = _writeCodepoint(dst, offset, codepoint, badChar) } // Keep overflowing bytes. for (; i < src.length; i++) { overflow.push(src[i]) } return dst.slice(0, offset).toString('ucs2') } function _writeCodepoint (dst, offset, codepoint, badChar) { // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. if (codepoint < 0 || codepoint > 0x10FFFF) { // Not a valid Unicode codepoint codepoint = badChar } // Ephemeral Planes: Write high surrogate. if (codepoint >= 0x10000) { codepoint -= 0x10000 const high = 0xD800 | (codepoint >> 10) dst[offset++] = high & 0xff dst[offset++] = high >> 8 // Low surrogate is written below. var codepoint = 0xDC00 | (codepoint & 0x3FF) } // Write BMP char or low surrogate. dst[offset++] = codepoint & 0xff dst[offset++] = codepoint >> 8 return offset }; Utf32Decoder.prototype.end = function () { this.overflow.length = 0 } // == UTF-32 Auto codec ============================================================= // Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. // Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 // Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); // Encoder prepends BOM (which can be overridden with (addBOM: false}). exports.utf32 = Utf32AutoCodec exports.ucs4 = 'utf32' function Utf32AutoCodec (options, iconv) { this.iconv = iconv } Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder // -- Encoding function Utf32AutoEncoder (options, codec) { options = options || {} if (options.addBOM === undefined) { options.addBOM = true } this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options) } Utf32AutoEncoder.prototype.write = function (str) { return this.encoder.write(str) } Utf32AutoEncoder.prototype.end = function () { return this.encoder.end() } // -- Decoding function Utf32AutoDecoder (options, codec) { this.decoder = null this.initialBufs = [] this.initialBufsLen = 0 this.options = options || {} this.iconv = codec.iconv } Utf32AutoDecoder.prototype.write = function (buf) { if (!this.decoder) { // Codec is not chosen yet. Accumulate initial bytes. this.initialBufs.push(buf) this.initialBufsLen += buf.length if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) { return '' } // We have enough bytes -> detect endianness. const encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) this.decoder = this.iconv.getDecoder(encoding, this.options) let resStr = '' for (let i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } this.initialBufs.length = this.initialBufsLen = 0 return resStr } return this.decoder.write(buf) } Utf32AutoDecoder.prototype.end = function () { if (!this.decoder) { const encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding) this.decoder = this.iconv.getDecoder(encoding, this.options) let resStr = '' for (let i = 0; i < this.initialBufs.length; i++) { resStr += this.decoder.write(this.initialBufs[i]) } const trail = this.decoder.end() if (trail) { resStr += trail } this.initialBufs.length = this.initialBufsLen = 0 return resStr } return this.decoder.end() } function detectEncoding (bufs, defaultEncoding) { const b = [] let charsProcessed = 0 let invalidLE = 0; let invalidBE = 0 // Number of invalid chars when decoded as LE or BE. let bmpCharsLE = 0; let bmpCharsBE = 0 // Number of BMP chars when decoded as LE or BE. outer_loop: for (let i = 0; i < bufs.length; i++) { const buf = bufs[i] for (let j = 0; j < buf.length; j++) { b.push(buf[j]) if (b.length === 4) { if (charsProcessed === 0) { // Check BOM first. if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { return 'utf-32le' } if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { return 'utf-32be' } } if (b[0] !== 0 || b[1] > 0x10) invalidBE++ if (b[3] !== 0 || b[2] > 0x10) invalidLE++ if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++ if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++ b.length = 0 charsProcessed++ if (charsProcessed >= 100) { break outer_loop } } } } // Make decisions. if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be' if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le' // Couldn't decide (likely all zeros or not enough data). return defaultEncoding || 'utf-32le' } /***/ }, /***/ 758: /***/ function (__unused_webpack_module, exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 // See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 exports.utf7 = Utf7Codec exports.unicode11utf7 = 'utf7' // Alias UNICODE-1-1-UTF-7 function Utf7Codec (codecOptions, iconv) { this.iconv = iconv }; Utf7Codec.prototype.encoder = Utf7Encoder Utf7Codec.prototype.decoder = Utf7Decoder Utf7Codec.prototype.bomAware = true // -- Encoding const nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g function Utf7Encoder (options, codec) { this.iconv = codec.iconv } Utf7Encoder.prototype.write = function (str) { // Naive implementation. // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". return Buffer.from(str.replace(nonDirectChars, function (chunk) { return '+' + (chunk === '+' ? '' : this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + '-' }.bind(this))) } Utf7Encoder.prototype.end = function () { } // -- Decoding function Utf7Decoder (options, codec) { this.iconv = codec.iconv this.inBase64 = false this.base64Accum = '' } const base64Regex = /[A-Za-z0-9\/+]/ const base64Chars = [] for (let i = 0; i < 256; i++) { base64Chars[i] = base64Regex.test(String.fromCharCode(i)) } const plusChar = '+'.charCodeAt(0) const minusChar = '-'.charCodeAt(0) const andChar = '&'.charCodeAt(0) Utf7Decoder.prototype.write = function (buf) { let res = ''; let lastI = 0 let inBase64 = this.inBase64 let base64Accum = this.base64Accum // The decoder is more involved as we must handle chunks in stream. for (let i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '+' if (buf[i] == plusChar) { res += this.iconv.decode(buf.slice(lastI, i), 'ascii') // Write direct chars. lastI = i + 1 inBase64 = true } } else { // We decode base64. if (!base64Chars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "+-" -> "+" res += '+' } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), 'ascii') res += this.iconv.decode(Buffer.from(b64str, 'base64'), 'utf16-be') } if (buf[i] != minusChar) // Minus is absorbed after base64. { i-- } lastI = i + 1 inBase64 = false base64Accum = '' } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), 'ascii') // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), 'ascii') const canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded) res += this.iconv.decode(Buffer.from(b64str, 'base64'), 'utf16-be') } this.inBase64 = inBase64 this.base64Accum = base64Accum return res } Utf7Decoder.prototype.end = function () { let res = '' if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), 'utf16-be') } this.inBase64 = false this.base64Accum = '' return res } // UTF-7-IMAP codec. // RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) // Differences: // * Base64 part is started by "&" instead of "+" // * Direct characters are 0x20-0x7E, except "&" (0x26) // * In Base64, "," is used instead of "/" // * Base64 must not be used to represent direct characters. // * No implicit shift back from Base64 (should always end with '-') // * String must end in non-shifted position. // * "-&" while in base64 is not allowed. exports.utf7imap = Utf7IMAPCodec function Utf7IMAPCodec (codecOptions, iconv) { this.iconv = iconv }; Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder Utf7IMAPCodec.prototype.bomAware = true // -- Encoding function Utf7IMAPEncoder (options, codec) { this.iconv = codec.iconv this.inBase64 = false this.base64Accum = Buffer.alloc(6) this.base64AccumIdx = 0 } Utf7IMAPEncoder.prototype.write = function (str) { let inBase64 = this.inBase64 const base64Accum = this.base64Accum let base64AccumIdx = this.base64AccumIdx const buf = Buffer.alloc(str.length * 5 + 10); let bufIdx = 0 for (let i = 0; i < str.length; i++) { const uChar = str.charCodeAt(i) if (uChar >= 0x20 && uChar <= 0x7E) { // Direct character or '&'. if (inBase64) { if (base64AccumIdx > 0) { bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx) base64AccumIdx = 0 } buf[bufIdx++] = minusChar // Write '-', then go to direct mode. inBase64 = false } if (!inBase64) { buf[bufIdx++] = uChar // Write direct character if (uChar === andChar) // Ampersand -> '&-' { buf[bufIdx++] = minusChar } } } else { // Non-direct character if (!inBase64) { buf[bufIdx++] = andChar // Write '&', then go to base64 mode. inBase64 = true } if (inBase64) { base64Accum[base64AccumIdx++] = uChar >> 8 base64Accum[base64AccumIdx++] = uChar & 0xFF if (base64AccumIdx == base64Accum.length) { bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx) base64AccumIdx = 0 } } } } this.inBase64 = inBase64 this.base64AccumIdx = base64AccumIdx return buf.slice(0, bufIdx) } Utf7IMAPEncoder.prototype.end = function () { const buf = Buffer.alloc(10); let bufIdx = 0 if (this.inBase64) { if (this.base64AccumIdx > 0) { bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx) this.base64AccumIdx = 0 } buf[bufIdx++] = minusChar // Write '-', then go to direct mode. this.inBase64 = false } return buf.slice(0, bufIdx) } // -- Decoding function Utf7IMAPDecoder (options, codec) { this.iconv = codec.iconv this.inBase64 = false this.base64Accum = '' } const base64IMAPChars = base64Chars.slice() base64IMAPChars[','.charCodeAt(0)] = true Utf7IMAPDecoder.prototype.write = function (buf) { let res = ''; let lastI = 0 let inBase64 = this.inBase64 let base64Accum = this.base64Accum // The decoder is more involved as we must handle chunks in stream. // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). for (let i = 0; i < buf.length; i++) { if (!inBase64) { // We're in direct mode. // Write direct chars until '&' if (buf[i] == andChar) { res += this.iconv.decode(buf.slice(lastI, i), 'ascii') // Write direct chars. lastI = i + 1 inBase64 = true } } else { // We decode base64. if (!base64IMAPChars[buf[i]]) { // Base64 ended. if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" res += '&' } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), 'ascii').replace(/,/g, '/') res += this.iconv.decode(Buffer.from(b64str, 'base64'), 'utf16-be') } if (buf[i] != minusChar) // Minus may be absorbed after base64. { i-- } lastI = i + 1 inBase64 = false base64Accum = '' } } } if (!inBase64) { res += this.iconv.decode(buf.slice(lastI), 'ascii') // Write direct chars. } else { var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), 'ascii').replace(/,/g, '/') const canBeDecoded = b64str.length - (b64str.length % 8) // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. base64Accum = b64str.slice(canBeDecoded) // The rest will be decoded in future. b64str = b64str.slice(0, canBeDecoded) res += this.iconv.decode(Buffer.from(b64str, 'base64'), 'utf16-be') } this.inBase64 = inBase64 this.base64Accum = base64Accum return res } Utf7IMAPDecoder.prototype.end = function () { let res = '' if (this.inBase64 && this.base64Accum.length > 0) { res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), 'utf16-be') } this.inBase64 = false this.base64Accum = '' return res } /***/ }, /***/ 5395: /***/ function (__unused_webpack_module, exports) { 'use strict' const BOMChar = '\uFEFF' exports.PrependBOM = PrependBOMWrapper function PrependBOMWrapper (encoder, options) { this.encoder = encoder this.addBOM = true } PrependBOMWrapper.prototype.write = function (str) { if (this.addBOM) { str = BOMChar + str this.addBOM = false } return this.encoder.write(str) } PrependBOMWrapper.prototype.end = function () { return this.encoder.end() } // ------------------------------------------------------------------------------ exports.StripBOM = StripBOMWrapper function StripBOMWrapper (decoder, options) { this.decoder = decoder this.pass = false this.options = options || {} } StripBOMWrapper.prototype.write = function (buf) { let res = this.decoder.write(buf) if (this.pass || !res) { return res } if (res[0] === BOMChar) { res = res.slice(1) if (typeof this.options.stripBOM === 'function') { this.options.stripBOM() } } this.pass = true return res } StripBOMWrapper.prototype.end = function () { return this.decoder.end() } /***/ }, /***/ 4914: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) const bomHandling = __webpack_require__(5395) const iconv = module.exports // All codecs and aliases are kept here, keyed by encoding name/alias. // They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. iconv.encodings = null // Characters emitted in case of error. iconv.defaultCharUnicode = '�' iconv.defaultCharSingleByte = '?' // Public API. iconv.encode = function encode (str, encoding, options) { str = '' + (str || '') // Ensure string. const encoder = iconv.getEncoder(encoding, options) const res = encoder.write(str) const trail = encoder.end() return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res } iconv.decode = function decode (buf, encoding, options) { if (typeof buf === 'string') { if (!iconv.skipDecodeWarning) { console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding') iconv.skipDecodeWarning = true } buf = Buffer.from('' + (buf || ''), 'binary') // Ensure buffer. } const decoder = iconv.getDecoder(encoding, options) const res = decoder.write(buf) const trail = decoder.end() return trail ? (res + trail) : res } iconv.encodingExists = function encodingExists (enc) { try { iconv.getCodec(enc) return true } catch (e) { return false } } // Legacy aliases to convert functions iconv.toEncoding = iconv.encode iconv.fromEncoding = iconv.decode // Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. iconv._codecDataCache = {} iconv.getCodec = function getCodec (encoding) { if (!iconv.encodings) { iconv.encodings = __webpack_require__(6934) } // Lazy load all encoding definitions. // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. let enc = iconv._canonicalizeEncoding(encoding) // Traverse iconv.encodings to find actual codec. const codecOptions = {} while (true) { let codec = iconv._codecDataCache[enc] if (codec) { return codec } const codecDef = iconv.encodings[enc] switch (typeof codecDef) { case 'string': // Direct alias to other encoding. enc = codecDef break case 'object': // Alias with options. Can be layered. for (const key in codecDef) { codecOptions[key] = codecDef[key] } if (!codecOptions.encodingName) { codecOptions.encodingName = enc } enc = codecDef.type break case 'function': // Codec itself. if (!codecOptions.encodingName) { codecOptions.encodingName = enc } // The codec function must load all tables and return object with .encoder and .decoder methods. // It'll be called only once (for each different options object). codec = new codecDef(codecOptions, iconv) iconv._codecDataCache[codecOptions.encodingName] = codec // Save it to be reused later. return codec default: throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')") } } } iconv._canonicalizeEncoding = function (encoding) { // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. return ('' + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, '') } iconv.getEncoder = function getEncoder (encoding, options) { const codec = iconv.getCodec(encoding) let encoder = new codec.encoder(options, codec) if (codec.bomAware && options && options.addBOM) { encoder = new bomHandling.PrependBOM(encoder, options) } return encoder } iconv.getDecoder = function getDecoder (encoding, options) { const codec = iconv.getCodec(encoding) let decoder = new codec.decoder(options, codec) if (codec.bomAware && !(options && options.stripBOM === false)) { decoder = new bomHandling.StripBOM(decoder, options) } return decoder } // Streaming API // NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add // up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. // If you would like to enable it explicitly, please add the following code to your app: // > iconv.enableStreamingAPI(require('stream')); iconv.enableStreamingAPI = function enableStreamingAPI (stream_module) { if (iconv.supportsStreams) { return } // Dependency-inject stream module to create IconvLite stream classes. const streams = __webpack_require__(8044)(stream_module) // Not public API yet, but expose the stream classes. iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream // Streaming API. iconv.encodeStream = function encodeStream (encoding, options) { return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options) } iconv.decodeStream = function decodeStream (encoding, options) { return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options) } iconv.supportsStreams = true } // Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). let stream_module try { stream_module = __webpack_require__(5832) } catch (e) {} if (stream_module && stream_module.Transform) { iconv.enableStreamingAPI(stream_module) } else { // In rare cases where 'stream' module is not available by default, throw a helpful exception. iconv.encodeStream = iconv.decodeStream = function () { throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.") } } if (false) {} /***/ }, /***/ 8044: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const Buffer = (__webpack_require__(7103).Buffer) // NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), // we opt to dependency-inject it instead of creating a hard dependency. module.exports = function (stream_module) { const Transform = stream_module.Transform // == Encoder stream ======================================================= function IconvLiteEncoderStream (conv, options) { this.conv = conv options = options || {} options.decodeStrings = false // We accept only strings, so we don't need to decode them. Transform.call(this, options) } IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteEncoderStream } }) IconvLiteEncoderStream.prototype._transform = function (chunk, encoding, done) { if (typeof chunk !== 'string') { return done(new Error('Iconv encoding stream needs strings as its input.')) } try { const res = this.conv.write(chunk) if (res && res.length) this.push(res) done() } catch (e) { done(e) } } IconvLiteEncoderStream.prototype._flush = function (done) { try { const res = this.conv.end() if (res && res.length) this.push(res) done() } catch (e) { done(e) } } IconvLiteEncoderStream.prototype.collect = function (cb) { const chunks = [] this.on('error', cb) this.on('data', function (chunk) { chunks.push(chunk) }) this.on('end', function () { cb(null, Buffer.concat(chunks)) }) return this } // == Decoder stream ======================================================= function IconvLiteDecoderStream (conv, options) { this.conv = conv options = options || {} options.encoding = this.encoding = 'utf8' // We output strings. Transform.call(this, options) } IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { constructor: { value: IconvLiteDecoderStream } }) IconvLiteDecoderStream.prototype._transform = function (chunk, encoding, done) { if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) { return done(new Error('Iconv decoding stream needs buffers as its input.')) } try { const res = this.conv.write(chunk) if (res && res.length) this.push(res, this.encoding) done() } catch (e) { done(e) } } IconvLiteDecoderStream.prototype._flush = function (done) { try { const res = this.conv.end() if (res && res.length) this.push(res, this.encoding) done() } catch (e) { done(e) } } IconvLiteDecoderStream.prototype.collect = function (cb) { let res = '' this.on('error', cb) this.on('data', function (chunk) { res += chunk }) this.on('end', function () { cb(null, res) }) return this } return { IconvLiteEncoderStream, IconvLiteDecoderStream } } /***/ }, /***/ 645: /***/ function (__unused_webpack_module, exports) { /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { let e, m const eLen = (nBytes * 8) - mLen - 1 const eMax = (1 << eLen) - 1 const eBias = eMax >> 1 let nBits = -7 let i = isLE ? (nBytes - 1) : 0 const d = isLE ? -1 : 1 let s = buffer[offset + i] i += d e = s & ((1 << (-nBits)) - 1) s >>= (-nBits) nBits += eLen for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} m = e & ((1 << (-nBits)) - 1) e >>= (-nBits) nBits += mLen for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { e = 1 - eBias } else if (e === eMax) { return m ? NaN : ((s ? -1 : 1) * Infinity) } else { m = m + Math.pow(2, mLen) e = e - eBias } return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { let e, m, c let eLen = (nBytes * 8) - mLen - 1 const eMax = (1 << eLen) - 1 const eBias = eMax >> 1 const rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) let i = isLE ? 0 : (nBytes - 1) const d = isLE ? 1 : -1 const s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 value = Math.abs(value) if (isNaN(value) || value === Infinity) { m = isNaN(value) ? 1 : 0 e = eMax } else { e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { e-- c *= 2 } if (e + eBias >= 1) { value += rt / c } else { value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { e++ c /= 2 } if (e + eBias >= eMax) { m = 0 e = eMax } else if (e + eBias >= 1) { m = ((value * c) - 1) * Math.pow(2, mLen) e = e + eBias } else { m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) e = 0 } } for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m eLen += mLen for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} buffer[offset + i - d] |= s * 128 } /***/ }, /***/ 5717: /***/ function (module) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits (ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } } } else { // old school shim for old browsers module.exports = function inherits (ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor const TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }, /***/ 2584: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const hasToStringTag = __webpack_require__(6410)() const callBound = __webpack_require__(1924) const $toString = callBound('Object.prototype.toString') const isStandardArguments = function isArguments (value) { if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) { return false } return $toString(value) === '[object Arguments]' } const isLegacyArguments = function isArguments (value) { if (isStandardArguments(value)) { return true } return value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && $toString(value) !== '[object Array]' && $toString(value.callee) === '[object Function]' } const supportsStandardArguments = (function () { return isStandardArguments(arguments) }()) isStandardArguments.isLegacyArguments = isLegacyArguments // for tests module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments /***/ }, /***/ 8923: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const getDay = Date.prototype.getDay const tryDateObject = function tryDateGetDayCall (value) { try { getDay.call(value) return true } catch (e) { return false } } const toStr = Object.prototype.toString const dateClass = '[object Date]' const hasToStringTag = __webpack_require__(6410)() module.exports = function isDateObject (value) { if (typeof value !== 'object' || value === null) { return false } return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass } /***/ }, /***/ 8662: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const toStr = Object.prototype.toString const fnToStr = Function.prototype.toString const isFnRegex = /^\s*(?:function)?\*/ const hasToStringTag = __webpack_require__(6410)() const getProto = Object.getPrototypeOf const getGeneratorFunc = function () { // eslint-disable-line consistent-return if (!hasToStringTag) { return false } try { return Function('return function*() {}')() } catch (e) { } } let GeneratorFunction module.exports = function isGeneratorFunction (fn) { if (typeof fn !== 'function') { return false } if (isFnRegex.test(fnToStr.call(fn))) { return true } if (!hasToStringTag) { const str = toStr.call(fn) return str === '[object GeneratorFunction]' } if (!getProto) { return false } if (typeof GeneratorFunction === 'undefined') { const generatorFunc = getGeneratorFunc() GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false } return getProto(fn) === GeneratorFunction } /***/ }, /***/ 8611: /***/ function (module) { 'use strict' /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN (value) { return value !== value } /***/ }, /***/ 360: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const callBind = __webpack_require__(5559) const define = __webpack_require__(4289) const implementation = __webpack_require__(8611) const getPolyfill = __webpack_require__(9415) const shim = __webpack_require__(6743) const polyfill = callBind(getPolyfill(), Number) /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ define(polyfill, { getPolyfill, implementation, shim }) module.exports = polyfill /***/ }, /***/ 9415: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const implementation = __webpack_require__(8611) module.exports = function getPolyfill () { if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) { return Number.isNaN } return implementation } /***/ }, /***/ 6743: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const define = __webpack_require__(4289) const getPolyfill = __webpack_require__(9415) /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN () { const polyfill = getPolyfill() define(Number, { isNaN: polyfill }, { isNaN: function testIsNaN () { return Number.isNaN !== polyfill } }) return polyfill } /***/ }, /***/ 8420: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const callBound = __webpack_require__(1924) const hasToStringTag = __webpack_require__(6410)() let has let $exec let isRegexMarker let badStringifier if (hasToStringTag) { has = callBound('Object.prototype.hasOwnProperty') $exec = callBound('RegExp.prototype.exec') isRegexMarker = {} const throwRegexMarker = function () { throw isRegexMarker } badStringifier = { toString: throwRegexMarker, valueOf: throwRegexMarker } if (typeof Symbol.toPrimitive === 'symbol') { badStringifier[Symbol.toPrimitive] = throwRegexMarker } } const $toString = callBound('Object.prototype.toString') const gOPD = Object.getOwnPropertyDescriptor const regexClass = '[object RegExp]' module.exports = hasToStringTag // eslint-disable-next-line consistent-return ? function isRegex (value) { if (!value || typeof value !== 'object') { return false } const descriptor = gOPD(value, 'lastIndex') const hasLastIndexDataProperty = descriptor && has(descriptor, 'value') if (!hasLastIndexDataProperty) { return false } try { $exec(value, badStringifier) } catch (e) { return e === isRegexMarker } } : function isRegex (value) { // In older browsers, typeof regex incorrectly returns 'function' if (!value || (typeof value !== 'object' && typeof value !== 'function')) { return false } return $toString(value) === regexClass } /***/ }, /***/ 5692: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const forEach = __webpack_require__(9804) const availableTypedArrays = __webpack_require__(3083) const callBound = __webpack_require__(1924) const $toString = callBound('Object.prototype.toString') const hasToStringTag = __webpack_require__(6410)() const g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis const typedArrays = availableTypedArrays() const $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf (array, value) { for (let i = 0; i < array.length; i += 1) { if (array[i] === value) { return i } } return -1 } const $slice = callBound('String.prototype.slice') const toStrTags = {} const gOPD = __webpack_require__(882) const getPrototypeOf = Object.getPrototypeOf // require('getprototypeof'); if (hasToStringTag && gOPD && getPrototypeOf) { forEach(typedArrays, function (typedArray) { const arr = new g[typedArray]() if (Symbol.toStringTag in arr) { const proto = getPrototypeOf(arr) let descriptor = gOPD(proto, Symbol.toStringTag) if (!descriptor) { const superProto = getPrototypeOf(proto) descriptor = gOPD(superProto, Symbol.toStringTag) } toStrTags[typedArray] = descriptor.get } }) } const tryTypedArrays = function tryAllTypedArrays (value) { let anyTrue = false forEach(toStrTags, function (getter, typedArray) { if (!anyTrue) { try { anyTrue = getter.call(value) === typedArray } catch (e) { /**/ } } }) return anyTrue } module.exports = function isTypedArray (value) { if (!value || typeof value !== 'object') { return false } if (!hasToStringTag || !(Symbol.toStringTag in value)) { const tag = $slice($toString(value), 8, -1) return $indexOf(typedArrays, tag) > -1 } if (!gOPD) { return false } return tryTypedArrays(value) } /***/ }, /***/ 4244: /***/ function (module) { 'use strict' const numberIsNaN = function (value) { return value !== value } module.exports = function is (a, b) { if (a === 0 && b === 0) { return 1 / a === 1 / b } if (a === b) { return true } if (numberIsNaN(a) && numberIsNaN(b)) { return true } return false } /***/ }, /***/ 609: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const define = __webpack_require__(4289) const callBind = __webpack_require__(5559) const implementation = __webpack_require__(4244) const getPolyfill = __webpack_require__(5624) const shim = __webpack_require__(2281) const polyfill = callBind(getPolyfill(), Object) define(polyfill, { getPolyfill, implementation, shim }) module.exports = polyfill /***/ }, /***/ 5624: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const implementation = __webpack_require__(4244) module.exports = function getPolyfill () { return typeof Object.is === 'function' ? Object.is : implementation } /***/ }, /***/ 2281: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const getPolyfill = __webpack_require__(5624) const define = __webpack_require__(4289) module.exports = function shimObjectIs () { const polyfill = getPolyfill() define(Object, { is: polyfill }, { is: function testObjectIs () { return Object.is !== polyfill } }) return polyfill } /***/ }, /***/ 8987: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' let keysShim if (!Object.keys) { // modified from https://github.com/es-shims/es5-shim const has = Object.prototype.hasOwnProperty const toStr = Object.prototype.toString const isArgs = __webpack_require__(1414) // eslint-disable-line global-require const isEnumerable = Object.prototype.propertyIsEnumerable const hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString') const hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype') const dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ] const equalsConstructorPrototype = function (o) { const ctor = o.constructor return ctor && ctor.prototype === o } const excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true } const hasAutomationEqualityBug = (function () { /* global window */ if (typeof window === 'undefined') { return false } for (const k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]) } catch (e) { return true } } } catch (e) { return true } } return false }()) const equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o) } try { return equalsConstructorPrototype(o) } catch (e) { return false } } keysShim = function keys (object) { const isObject = object !== null && typeof object === 'object' const isFunction = toStr.call(object) === '[object Function]' const isArguments = isArgs(object) const isString = isObject && toStr.call(object) === '[object String]' const theKeys = [] if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object') } const skipProto = hasProtoEnumBug && isFunction if (isString && object.length > 0 && !has.call(object, 0)) { for (let i = 0; i < object.length; ++i) { theKeys.push(String(i)) } } if (isArguments && object.length > 0) { for (let j = 0; j < object.length; ++j) { theKeys.push(String(j)) } } else { for (const name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)) } } } if (hasDontEnumBug) { const skipConstructor = equalsConstructorPrototypeIfNotBuggy(object) for (let k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]) } } } return theKeys } } module.exports = keysShim /***/ }, /***/ 2215: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const slice = Array.prototype.slice const isArgs = __webpack_require__(1414) const origKeys = Object.keys const keysShim = origKeys ? function keys (o) { return origKeys(o) } : __webpack_require__(8987) const originalKeys = Object.keys keysShim.shim = function shimObjectKeys () { if (Object.keys) { const keysWorksWithArguments = (function () { // Safari 5.0 bug const args = Object.keys(arguments) return args && args.length === arguments.length }(1, 2)) if (!keysWorksWithArguments) { Object.keys = function keys (object) { // eslint-disable-line func-name-matching if (isArgs(object)) { return originalKeys(slice.call(object)) } return originalKeys(object) } } } else { Object.keys = keysShim } return Object.keys || keysShim } module.exports = keysShim /***/ }, /***/ 1414: /***/ function (module) { 'use strict' const toStr = Object.prototype.toString module.exports = function isArguments (value) { const str = toStr.call(value) let isArgs = str === '[object Arguments]' if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]' } return isArgs } /***/ }, /***/ 4155: /***/ function (module) { // shim for using process in browser const process = module.exports = {} // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. let cachedSetTimeout let cachedClearTimeout function defaultSetTimout () { throw new Error('setTimeout has not been defined') } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined') } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout } else { cachedSetTimeout = defaultSetTimout } } catch (e) { cachedSetTimeout = defaultSetTimout } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout } else { cachedClearTimeout = defaultClearTimeout } } catch (e) { cachedClearTimeout = defaultClearTimeout } }()) function runTimeout (fun) { if (cachedSetTimeout === setTimeout) { // normal enviroments in sane situations return setTimeout(fun, 0) } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout return setTimeout(fun, 0) } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0) } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0) } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0) } } } function runClearTimeout (marker) { if (cachedClearTimeout === clearTimeout) { // normal enviroments in sane situations return clearTimeout(marker) } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout return clearTimeout(marker) } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker) } catch (e) { try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker) } catch (e) { // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker) } } } let queue = [] let draining = false let currentQueue let queueIndex = -1 function cleanUpNextTick () { if (!draining || !currentQueue) { return } draining = false if (currentQueue.length) { queue = currentQueue.concat(queue) } else { queueIndex = -1 } if (queue.length) { drainQueue() } } function drainQueue () { if (draining) { return } const timeout = runTimeout(cleanUpNextTick) draining = true let len = queue.length while (len) { currentQueue = queue queue = [] while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run() } } queueIndex = -1 len = queue.length } currentQueue = null draining = false runClearTimeout(timeout) } process.nextTick = function (fun) { const args = new Array(arguments.length - 1) if (arguments.length > 1) { for (let i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i] } } queue.push(new Item(fun, args)) if (queue.length === 1 && !draining) { runTimeout(drainQueue) } } // v8 likes predictible objects function Item (fun, array) { this.fun = fun this.array = array } Item.prototype.run = function () { this.fun.apply(null, this.array) } process.title = 'browser' process.browser = true process.env = {} process.argv = [] process.version = '' // empty string to avoid regexp issues process.versions = {} function noop () {} process.on = noop process.addListener = noop process.once = noop process.off = noop process.removeListener = noop process.removeAllListeners = noop process.emit = noop process.prependListener = noop process.prependOnceListener = noop process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported') } process.cwd = function () { return '/' } process.chdir = function (dir) { throw new Error('process.chdir is not supported') } process.umask = function () { return 0 } /***/ }, /***/ 5666: /***/ function (module) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ const runtime = (function (exports) { 'use strict' const Op = Object.prototype const hasOwn = Op.hasOwnProperty let undefined // More compressible than void 0. const $Symbol = typeof Symbol === 'function' ? Symbol : {} const iteratorSymbol = $Symbol.iterator || '@@iterator' const asyncIteratorSymbol = $Symbol.asyncIterator || '@@asyncIterator' const toStringTagSymbol = $Symbol.toStringTag || '@@toStringTag' function define (obj, key, value) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }) return obj[key] } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, '') } catch (err) { define = function (obj, key, value) { return obj[key] = value } } function wrap (innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. const protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator const generator = Object.create(protoGenerator.prototype) const context = new Context(tryLocsList || []) // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context) return generator } exports.wrap = wrap // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch (fn, obj, arg) { try { return { type: 'normal', arg: fn.call(obj, arg) } } catch (err) { return { type: 'throw', arg: err } } } const GenStateSuspendedStart = 'suspendedStart' const GenStateSuspendedYield = 'suspendedYield' const GenStateExecuting = 'executing' const GenStateCompleted = 'completed' // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. const ContinueSentinel = {} // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator () {} function GeneratorFunction () {} function GeneratorFunctionPrototype () {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. let IteratorPrototype = {} define(IteratorPrototype, iteratorSymbol, function () { return this }) const getProto = Object.getPrototypeOf const NativeIteratorPrototype = getProto && getProto(getProto(values([]))) if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype } const Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype) GeneratorFunction.prototype = GeneratorFunctionPrototype define(Gp, 'constructor', GeneratorFunctionPrototype) define(GeneratorFunctionPrototype, 'constructor', GeneratorFunction) GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, 'GeneratorFunction' ) // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods (prototype) { ['next', 'throw', 'return'].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg) }) }) } exports.isGeneratorFunction = function (genFun) { const ctor = typeof genFun === 'function' && genFun.constructor return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === 'GeneratorFunction' : false } exports.mark = function (genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) } else { genFun.__proto__ = GeneratorFunctionPrototype define(genFun, toStringTagSymbol, 'GeneratorFunction') } genFun.prototype = Object.create(Gp) return genFun } // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function (arg) { return { __await: arg } } function AsyncIterator (generator, PromiseImpl) { function invoke (method, arg, resolve, reject) { const record = tryCatch(generator[method], generator, arg) if (record.type === 'throw') { reject(record.arg) } else { const result = record.arg const value = result.value if (value && typeof value === 'object' && hasOwn.call(value, '__await')) { return PromiseImpl.resolve(value.__await).then(function (value) { invoke('next', value, resolve, reject) }, function (err) { invoke('throw', err, resolve, reject) }) } return PromiseImpl.resolve(value).then(function (unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped resolve(result) }, function (error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke('throw', error, resolve, reject) }) } } let previousPromise function enqueue (method, arg) { function callInvokeWithMethodAndArg () { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject) }) } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg() } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue } defineIteratorMethods(AsyncIterator.prototype) define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this }) exports.AsyncIterator = AsyncIterator // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise const iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ) return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function (result) { return result.done ? result.value : iter.next() }) } function makeInvokeMethod (innerFn, self, context) { let state = GenStateSuspendedStart return function invoke (method, arg) { if (state === GenStateExecuting) { throw new Error('Generator is already running') } if (state === GenStateCompleted) { if (method === 'throw') { throw arg } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult() } context.method = method context.arg = arg while (true) { const delegate = context.delegate if (delegate) { const delegateResult = maybeInvokeDelegate(delegate, context) if (delegateResult) { if (delegateResult === ContinueSentinel) continue return delegateResult } } if (context.method === 'next') { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg } else if (context.method === 'throw') { if (state === GenStateSuspendedStart) { state = GenStateCompleted throw context.arg } context.dispatchException(context.arg) } else if (context.method === 'return') { context.abrupt('return', context.arg) } state = GenStateExecuting const record = tryCatch(innerFn, self, context) if (record.type === 'normal') { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield if (record.arg === ContinueSentinel) { continue } return { value: record.arg, done: context.done } } else if (record.type === 'throw') { state = GenStateCompleted // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = 'throw' context.arg = record.arg } } } } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate (delegate, context) { const method = delegate.iterator[context.method] if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null if (context.method === 'throw') { // Note: ["return"] must be used for ES3 parsing compatibility. if (delegate.iterator.return) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = 'return' context.arg = undefined maybeInvokeDelegate(delegate, context) if (context.method === 'throw') { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel } } context.method = 'throw' context.arg = new TypeError( "The iterator does not provide a 'throw' method") } return ContinueSentinel } const record = tryCatch(method, delegate.iterator, context.arg) if (record.type === 'throw') { context.method = 'throw' context.arg = record.arg context.delegate = null return ContinueSentinel } const info = record.arg if (! info) { context.method = 'throw' context.arg = new TypeError('iterator result is not an object') context.delegate = null return ContinueSentinel } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== 'return') { context.method = 'next' context.arg = undefined } } else { // Re-yield the result returned by the delegate method. return info } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null return ContinueSentinel } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp) define(Gp, toStringTagSymbol, 'Generator') // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. define(Gp, iteratorSymbol, function () { return this }) define(Gp, 'toString', function () { return '[object Generator]' }) function pushTryEntry (locs) { const entry = { tryLoc: locs[0] } if (1 in locs) { entry.catchLoc = locs[1] } if (2 in locs) { entry.finallyLoc = locs[2] entry.afterLoc = locs[3] } this.tryEntries.push(entry) } function resetTryEntry (entry) { const record = entry.completion || {} record.type = 'normal' delete record.arg entry.completion = record } function Context (tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: 'root' }] tryLocsList.forEach(pushTryEntry, this) this.reset(true) } exports.keys = function (object) { const keys = [] for (const key in object) { keys.push(key) } keys.reverse() // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next () { while (keys.length) { const key = keys.pop() if (key in object) { next.value = key next.done = false return next } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true return next } } function values (iterable) { if (iterable) { const iteratorMethod = iterable[iteratorSymbol] if (iteratorMethod) { return iteratorMethod.call(iterable) } if (typeof iterable.next === 'function') { return iterable } if (!isNaN(iterable.length)) { let i = -1; const next = function next () { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i] next.done = false return next } } next.value = undefined next.done = true return next } return next.next = next } } // Return an iterator with no values. return { next: doneResult } } exports.values = values function doneResult () { return { value: undefined, done: true } } Context.prototype = { constructor: Context, reset: function (skipTempReset) { this.prev = 0 this.next = 0 // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined this.done = false this.delegate = null this.method = 'next' this.arg = undefined this.tryEntries.forEach(resetTryEntry) if (!skipTempReset) { for (const name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === 't' && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined } } } }, stop: function () { this.done = true const rootEntry = this.tryEntries[0] const rootRecord = rootEntry.completion if (rootRecord.type === 'throw') { throw rootRecord.arg } return this.rval }, dispatchException: function (exception) { if (this.done) { throw exception } const context = this function handle (loc, caught) { record.type = 'throw' record.arg = exception context.next = loc if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = 'next' context.arg = undefined } return !! caught } for (let i = this.tryEntries.length - 1; i >= 0; --i) { const entry = this.tryEntries[i] var record = entry.completion if (entry.tryLoc === 'root') { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle('end') } if (entry.tryLoc <= this.prev) { const hasCatch = hasOwn.call(entry, 'catchLoc') const hasFinally = hasOwn.call(entry, 'finallyLoc') if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true) } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc) } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true) } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc) } } else { throw new Error('try statement without catch or finally') } } } }, abrupt: function (type, arg) { for (let i = this.tryEntries.length - 1; i >= 0; --i) { const entry = this.tryEntries[i] if (entry.tryLoc <= this.prev && hasOwn.call(entry, 'finallyLoc') && this.prev < entry.finallyLoc) { var finallyEntry = entry break } } if (finallyEntry && (type === 'break' || type === 'continue') && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null } const record = finallyEntry ? finallyEntry.completion : {} record.type = type record.arg = arg if (finallyEntry) { this.method = 'next' this.next = finallyEntry.finallyLoc return ContinueSentinel } return this.complete(record) }, complete: function (record, afterLoc) { if (record.type === 'throw') { throw record.arg } if (record.type === 'break' || record.type === 'continue') { this.next = record.arg } else if (record.type === 'return') { this.rval = this.arg = record.arg this.method = 'return' this.next = 'end' } else if (record.type === 'normal' && afterLoc) { this.next = afterLoc } return ContinueSentinel }, finish: function (finallyLoc) { for (let i = this.tryEntries.length - 1; i >= 0; --i) { const entry = this.tryEntries[i] if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc) resetTryEntry(entry) return ContinueSentinel } } }, catch: function (tryLoc) { for (let i = this.tryEntries.length - 1; i >= 0; --i) { const entry = this.tryEntries[i] if (entry.tryLoc === tryLoc) { const record = entry.completion if (record.type === 'throw') { var thrown = record.arg resetTryEntry(entry) } return thrown } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error('illegal catch attempt') }, delegateYield: function (iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName, nextLoc } if (this.method === 'next') { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined } return ContinueSentinel } } // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. true ? module.exports : 0 )) try { regeneratorRuntime = runtime } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, in modern engines // we can explicitly access globalThis. In older engines we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. if (typeof globalThis === 'object') { globalThis.regeneratorRuntime = runtime } else { Function('r', 'regeneratorRuntime = r')(runtime) } } /***/ }, /***/ 3697: /***/ function (module) { 'use strict' const $Object = Object const $TypeError = TypeError module.exports = function flags () { if (this != null && this !== $Object(this)) { throw new $TypeError('RegExp.prototype.flags getter called on non-object') } let result = '' if (this.global) { result += 'g' } if (this.ignoreCase) { result += 'i' } if (this.multiline) { result += 'm' } if (this.dotAll) { result += 's' } if (this.unicode) { result += 'u' } if (this.sticky) { result += 'y' } return result } /***/ }, /***/ 2847: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const define = __webpack_require__(4289) const callBind = __webpack_require__(5559) const implementation = __webpack_require__(3697) const getPolyfill = __webpack_require__(1721) const shim = __webpack_require__(2753) const flagsBound = callBind(implementation) define(flagsBound, { getPolyfill, implementation, shim }) module.exports = flagsBound /***/ }, /***/ 1721: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const implementation = __webpack_require__(3697) const supportsDescriptors = (__webpack_require__(4289).supportsDescriptors) const $gOPD = Object.getOwnPropertyDescriptor const $TypeError = TypeError module.exports = function getPolyfill () { if (!supportsDescriptors) { throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors') } if ((/a/mig).flags === 'gim') { const descriptor = $gOPD(RegExp.prototype, 'flags') if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') { return descriptor.get } } return implementation } /***/ }, /***/ 2753: /***/ function (module, __unused_webpack_exports, __webpack_require__) { 'use strict' const supportsDescriptors = (__webpack_require__(4289).supportsDescriptors) const getPolyfill = __webpack_require__(1721) const gOPD = Object.getOwnPropertyDescriptor const defineProperty = Object.defineProperty const TypeErr = TypeError const getProto = Object.getPrototypeOf const regex = /a/ module.exports = function shimFlags () { if (!supportsDescriptors || !getProto) { throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors') } const polyfill = getPolyfill() const proto = getProto(regex) const descriptor = gOPD(proto, 'flags') if (!descriptor || descriptor.get !== polyfill) { defineProperty(proto, 'flags', { configurable: true, enumerable: false, get: polyfill }) } return polyfill } /***/ }, /***/ 6099: /***/ function (__unused_webpack_module, exports, __webpack_require__) { /* provided dependency */ const Buffer = __webpack_require__(8823).Buffer ;(function (sax) { // wrapper for non-node envs sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } sax.SAXParser = SAXParser sax.SAXStream = SAXStream sax.createStream = createStream // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), // since that's the earliest that a buffer overrun could occur. This way, checks are // as rare as required, but as often as necessary to ensure never crossing this bound. // Furthermore, buffers are only tested at most once per write(), so passing a very // large string into write() might have undesirable effects, but this is manageable by // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme // edge case, result in creating at most one complete copy of the string passed in. // Set to Infinity to have unlimited buffers. sax.MAX_BUFFER_LENGTH = 64 * 1024 const buffers = [ 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', 'procInstName', 'procInstBody', 'entity', 'attribName', 'attribValue', 'cdata', 'script' ] sax.EVENTS = [ 'text', 'processinginstruction', 'sgmldeclaration', 'doctype', 'comment', 'opentagstart', 'attribute', 'opentag', 'closetag', 'opencdata', 'cdata', 'closecdata', 'error', 'end', 'ready', 'script', 'opennamespace', 'closenamespace' ] function SAXParser (strict, opt) { if (!(this instanceof SAXParser)) { return new SAXParser(strict, opt) } const parser = this clearBuffers(parser) parser.q = parser.c = '' parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH parser.opt = opt || {} parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' parser.tags = [] parser.closed = parser.closedRoot = parser.sawRoot = false parser.tag = parser.error = null parser.strict = !!strict parser.noscript = !!(strict || parser.opt.noscript) parser.state = S.BEGIN parser.strictEntities = parser.opt.strictEntities parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) parser.attribList = [] // namespaces form a prototype chain. // it always points at the current tag, // which protos to its parent tag. if (parser.opt.xmlns) { parser.ns = Object.create(rootNS) } // mostly just for error reporting parser.trackPosition = parser.opt.position !== false if (parser.trackPosition) { parser.position = parser.line = parser.column = 0 } emit(parser, 'onready') } if (!Object.create) { Object.create = function (o) { function F () {} F.prototype = o const newf = new F() return newf } } if (!Object.keys) { Object.keys = function (o) { const a = [] for (const i in o) if (o.hasOwnProperty(i)) a.push(i) return a } } function checkBufferLength (parser) { const maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) let maxActual = 0 for (let i = 0, l = buffers.length; i < l; i++) { const len = parser[buffers[i]].length if (len > maxAllowed) { // Text/cdata nodes can get big, and since they're buffered, // we can get here under normal conditions. // Avoid issues by emitting the text node now, // so at least it won't get any bigger. switch (buffers[i]) { case 'textNode': closeText(parser) break case 'cdata': emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' break case 'script': emitNode(parser, 'onscript', parser.script) parser.script = '' break default: error(parser, 'Max buffer length exceeded: ' + buffers[i]) } } maxActual = Math.max(maxActual, len) } // schedule the next check for the earliest possible buffer overrun. const m = sax.MAX_BUFFER_LENGTH - maxActual parser.bufferCheckPosition = m + parser.position } function clearBuffers (parser) { for (let i = 0, l = buffers.length; i < l; i++) { parser[buffers[i]] = '' } } function flushBuffers (parser) { closeText(parser) if (parser.cdata !== '') { emitNode(parser, 'oncdata', parser.cdata) parser.cdata = '' } if (parser.script !== '') { emitNode(parser, 'onscript', parser.script) parser.script = '' } } SAXParser.prototype = { end: function () { end(this) }, write, resume: function () { this.error = null; return this }, close: function () { return this.write(null) }, flush: function () { flushBuffers(this) } } let Stream try { Stream = (__webpack_require__(2830).Stream) } catch (ex) { Stream = function () {} } const streamWraps = sax.EVENTS.filter(function (ev) { return ev !== 'error' && ev !== 'end' }) function createStream (strict, opt) { return new SAXStream(strict, opt) } function SAXStream (strict, opt) { if (!(this instanceof SAXStream)) { return new SAXStream(strict, opt) } Stream.apply(this) this._parser = new SAXParser(strict, opt) this.writable = true this.readable = true const me = this this._parser.onend = function () { me.emit('end') } this._parser.onerror = function (er) { me.emit('error', er) // if didn't throw, then means error was handled. // go ahead and clear error, so we can write again. me._parser.error = null } this._decoder = null streamWraps.forEach(function (ev) { Object.defineProperty(me, 'on' + ev, { get: function () { return me._parser['on' + ev] }, set: function (h) { if (!h) { me.removeAllListeners(ev) me._parser['on' + ev] = h return h } me.on(ev, h) }, enumerable: true, configurable: false }) }) } SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } }) SAXStream.prototype.write = function (data) { if (typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function' && Buffer.isBuffer(data)) { if (!this._decoder) { const SD = (__webpack_require__(2553)/* .StringDecoder */ .s) this._decoder = new SD('utf8') } data = this._decoder.write(data) } this._parser.write(data.toString()) this.emit('data', data) return true } SAXStream.prototype.end = function (chunk) { if (chunk && chunk.length) { this.write(chunk) } this._parser.end() return true } SAXStream.prototype.on = function (ev, handler) { const me = this if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { me._parser['on' + ev] = function () { const args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) args.splice(0, 0, ev) me.emit.apply(me, args) } } return Stream.prototype.on.call(me, ev, handler) } // this really needs to be replaced with character classes. // XML allows all manner of ridiculous numbers and digits. const CDATA = '[CDATA[' const DOCTYPE = 'DOCTYPE' const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' const XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } // http://www.w3.org/TR/REC-xml/#NT-NameStartChar // This implementation works on strings, a single character at a time // as such, it cannot ever support astral-plane characters (10000-EFFFF) // without a significant breaking change to either this parser, or the // JavaScript language. Implementation of an emoji-capable xml parser // is left as an exercise for the reader. const nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ const nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ const entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ const entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ function isWhitespace (c) { return c === ' ' || c === '\n' || c === '\r' || c === '\t' } function isQuote (c) { return c === '"' || c === '\'' } function isAttribEnd (c) { return c === '>' || isWhitespace(c) } function isMatch (regex, c) { return regex.test(c) } function notMatch (regex, c) { return !isMatch(regex, c) } var S = 0 sax.STATE = { BEGIN: S++, // leading byte order mark or whitespace BEGIN_WHITESPACE: S++, // leading whitespace TEXT: S++, // general stuff TEXT_ENTITY: S++, // & and such. OPEN_WAKA: S++, // < SGML_DECL: S++, // SCRIPT: S++, //