From 0fd989f72633c5dfb462fbde3b69c9760c07b88b Mon Sep 17 00:00:00 2001 From: Josh North Date: Thu, 17 Jun 2021 20:03:13 -0400 Subject: [PATCH] fix pdf prints on all options --- inc/header.inc.php | 4 +- js/pdfmake.js | 50468 ++++++++++++++++++++++++++++++++++++++++ js/pdfmake.min.js | 4 +- js/pdfmake.min.js.map | 1 + js/vfs_fonts.js | 2 +- reports.php | 41 +- 6 files changed, 50506 insertions(+), 14 deletions(-) create mode 100644 js/pdfmake.js mode change 100755 => 100644 js/pdfmake.min.js create mode 100644 js/pdfmake.min.js.map mode change 100755 => 100644 js/vfs_fonts.js diff --git a/inc/header.inc.php b/inc/header.inc.php index 0bd02e1..28fd42f 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -120,8 +120,8 @@ - - + + diff --git a/js/pdfmake.js b/js/pdfmake.js new file mode 100644 index 0000000..c6041b9 --- /dev/null +++ b/js/pdfmake.js @@ -0,0 +1,50468 @@ +/*! pdfmake v0.1.36, @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 { + var a = factory(); + for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; + } +})(typeof self !== 'undefined' ? self : this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 122); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function isString(variable) { + return typeof variable === 'string' || variable instanceof String; +} + +function isNumber(variable) { + return typeof variable === 'number' || variable instanceof Number; +} + +function isBoolean(variable) { + return typeof variable === 'boolean'; +} + +function isArray(variable) { + return Array.isArray(variable); +} + +function isFunction(variable) { + return typeof variable === 'function'; +} + +function isObject(variable) { + return variable !== null && typeof variable === 'object'; +} + +function isNull(variable) { + return variable === null; +} + +function isUndefined(variable) { + return variable === undefined; +} + +function pack() { + var result = {}; + + for (var i = 0, l = arguments.length; i < l; i++) { + var obj = arguments[i]; + + if (obj) { + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + result[key] = obj[key]; + } + } + } + } + + return result; +} + +function offsetVector(vector, x, y) { + switch (vector.type) { + case 'ellipse': + case 'rect': + vector.x += x; + vector.y += y; + break; + case 'line': + vector.x1 += x; + vector.x2 += x; + vector.y1 += y; + vector.y2 += y; + break; + case 'polyline': + for (var i = 0, l = vector.points.length; i < l; i++) { + vector.points[i].x += x; + vector.points[i].y += y; + } + break; + } +} + +function fontStringify(key, val) { + if (key === 'font') { + return 'font'; + } + return val; +} + +module.exports = { + isString: isString, + isNumber: isNumber, + isBoolean: isBoolean, + isArray: isArray, + isFunction: isFunction, + isObject: isObject, + isNull: isNull, + isUndefined: isUndefined, + pack: pack, + fontStringify: fontStringify, + offsetVector: offsetVector +}; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + + + +var base64 = __webpack_require__(124) +var ieee754 = __webpack_require__(125) +var isArray = __webpack_require__(76) + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use 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+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() + +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } + + return that +} + +/** + * 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) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} + +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, 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(null, value, encodingOrOffset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} + +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} + +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) + + var actual = that.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') + that = that.slice(0, actual) + } + + return that +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer + + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} + +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} + +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().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) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var 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 (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + 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 utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var 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 coersion 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 + } + } +} + +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var 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 () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +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 () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + 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 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var 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 (isNaN(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 (Buffer.TYPED_ARRAY_SUPPORT && + 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) { + var indexSize = 1 + var arrLength = arr.length + var 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) + } + } + + var i + if (dir) { + var 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--) { + var found = true + for (var 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 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(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 latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, 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 + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var 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' + + var 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': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(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) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + 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 +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var 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". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var 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 + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + 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 = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + 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 = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var 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) + + var i = byteLength + var mul = 1 + var 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) { + 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) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + 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) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + 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 = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var 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) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var 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 (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + 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) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + 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) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + 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) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + 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 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +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) { + 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) { + 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 (!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('sourceStart out of bounds') + 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 + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + 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 (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + 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) + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // 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 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).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 stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var 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) { + var byteArray = [] + for (var 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) { + var c, hi, lo + var byteArray = [] + for (var 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) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.3' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(10); +var core = __webpack_require__(2); +var ctx = __webpack_require__(20); +var hide = __webpack_require__(13); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && key in exports) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } +}; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(65)('wks'); +var uid = __webpack_require__(38); +var Symbol = __webpack_require__(10).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(19)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(14); +var IE8_DOM_DEFINE = __webpack_require__(95); +var toPrimitive = __webpack_require__(58); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(5) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Buffer, __dirname) { + +function VirtualFileSystem() { + this.fileSystem = {}; + this.baseSystem = {}; +} + +VirtualFileSystem.prototype.readFileSync = function (filename) { + filename = fixFilename(filename); + + var base64content = this.baseSystem[filename]; + if (base64content) { + return new Buffer(base64content, 'base64'); + } + + var content = this.fileSystem[filename]; + if (content) { + return content; + } + + throw 'File \'' + filename + '\' not found in virtual file system'; +}; + +VirtualFileSystem.prototype.writeFileSync = function (filename, content) { + this.fileSystem[fixFilename(filename)] = content; +}; + +VirtualFileSystem.prototype.bindFS = function (data) { + this.baseSystem = data || {}; +}; + + +function fixFilename(filename) { + if (filename.indexOf(__dirname) === 0) { + filename = filename.substring(__dirname.length); + } + + if (filename.indexOf('/') === 0) { + filename = filename.substring(1); + } + + return filename; +} + +module.exports = new VirtualFileSystem(); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer, "/")) + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var 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. + +var cachedSetTimeout; +var 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); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var 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; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var 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) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var 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; }; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var NumberT, PropertyDescriptor; + + NumberT = __webpack_require__(22).Number; + + exports.resolveLength = function(length, stream, parent) { + var 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; + }; + + PropertyDescriptor = (function() { + function PropertyDescriptor(opts) { + var key, val; + if (opts == null) { + opts = {}; + } + this.enumerable = true; + this.configurable = true; + for (key in opts) { + val = opts[key]; + this[key] = val; + } + } + + return PropertyDescriptor; + + })(); + + exports.PropertyDescriptor = PropertyDescriptor; + +}).call(this); + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var createDesc = __webpack_require__(27); +module.exports = __webpack_require__(5) ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(9); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +// 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. + +module.exports = Stream; + +var EE = __webpack_require__(31).EventEmitter; +var inherits = __webpack_require__(21); + +inherits(Stream, EE); +Stream.Readable = __webpack_require__(45); +Stream.Writable = __webpack_require__(146); +Stream.Duplex = __webpack_require__(147); +Stream.Transform = __webpack_require__(148); +Stream.PassThrough = __webpack_require__(149); + +// Backwards-compat with node 0.4.x +Stream.Stream = Stream; + + + +// old-style streams. Note that the pipe method (the only relevant +// part of this class) is overridden in the Readable class. + +function Stream() { + EE.call(this); +} + +Stream.prototype.pipe = function(dest, options) { + var source = this; + + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); + } + } + } + + source.on('data', ondata); + + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + + dest.on('drain', ondrain); + + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend); + source.on('close', onclose); + } + + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + + dest.end(); + } + + + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + + if (typeof dest.destroy === 'function') dest.destroy(); + } + + // don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, 'error') === 0) { + throw er; // Unhandled stream error in pipe. + } + } + + source.on('error', onerror); + dest.on('error', onerror); + + // remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata); + dest.removeListener('drain', ondrain); + + source.removeListener('end', onend); + source.removeListener('close', onclose); + + source.removeListener('error', onerror); + dest.removeListener('error', onerror); + + source.removeListener('end', cleanup); + source.removeListener('close', cleanup); + + dest.removeListener('close', cleanup); + } + + source.on('end', cleanup); + source.on('close', cleanup); + + dest.on('close', cleanup); + + dest.emit('pipe', source); + + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest; +}; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + + + +/**/ + +var processNextTick = __webpack_require__(32).nextTick; +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = __webpack_require__(25); +util.inherits = __webpack_require__(21); +/**/ + +var Readable = __webpack_require__(83); +var Writable = __webpack_require__(46); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + processNextTick(cb, err); +}; + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(54); +var defined = __webpack_require__(56); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(97); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, 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) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var DecodeStream, Fixed, NumberT, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + + DecodeStream = __webpack_require__(51); + + NumberT = (function() { + function NumberT(type, endian) { + this.type = type; + this.endian = endian != null ? endian : 'BE'; + this.fn = this.type; + if (this.type[this.type.length - 1] !== '8') { + this.fn += this.endian; + } + } + + NumberT.prototype.size = function() { + return DecodeStream.TYPES[this.type]; + }; + + NumberT.prototype.decode = function(stream) { + return stream['read' + this.fn](); + }; + + NumberT.prototype.encode = function(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'); + + Fixed = (function(_super) { + __extends(Fixed, _super); + + function Fixed(size, endian, fracBits) { + if (fracBits == null) { + fracBits = size >> 1; + } + Fixed.__super__.constructor.call(this, "Int" + size, endian); + this._point = 1 << fracBits; + } + + Fixed.prototype.decode = function(stream) { + return Fixed.__super__.decode.call(this, stream) / this._point; + }; + + Fixed.prototype.encode = function(stream, val) { + return Fixed.__super__.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'); + +}).call(this); + + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(207)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(61)(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.12.6 + +/* +PDFObject - converts JavaScript types into their corrisponding PDF types. +By Devon Govett + */ + +(function() { + var PDFObject, PDFReference; + + PDFObject = (function() { + var escapable, escapableRe, pad, swapBytes; + + function PDFObject() {} + + pad = function(str, length) { + return (Array(length + 1).join('0') + str).slice(-length); + }; + + escapableRe = /[\n\r\t\b\f\(\)\\]/g; + + escapable = { + '\n': '\\n', + '\r': '\\r', + '\t': '\\t', + '\b': '\\b', + '\f': '\\f', + '\\': '\\\\', + '(': '\\(', + ')': '\\)' + }; + + swapBytes = function(buff) { + var a, i, j, l, ref; + l = buff.length; + if (l & 0x01) { + throw new Error("Buffer length must be even"); + } else { + for (i = j = 0, ref = l - 1; j < ref; i = j += 2) { + a = buff[i]; + buff[i] = buff[i + 1]; + buff[i + 1] = a; + } + } + return buff; + }; + + PDFObject.convert = function(object) { + var e, i, isUnicode, items, j, key, out, ref, string, val; + if (typeof object === 'string') { + return '/' + object; + } else if (object instanceof String) { + string = object; + isUnicode = false; + for (i = j = 0, ref = string.length; j < ref; i = j += 1) { + if (string.charCodeAt(i) > 0x7f) { + isUnicode = true; + break; + } + } + if (isUnicode) { + string = swapBytes(new Buffer('\ufeff' + string, 'utf16le')).toString('binary'); + } + string = string.replace(escapableRe, function(c) { + return escapable[c]; + }); + return '(' + string + ')'; + } else if (Buffer.isBuffer(object)) { + return '<' + object.toString('hex') + '>'; + } else if (object instanceof PDFReference) { + return object.toString(); + } else if (object instanceof Date) { + return '(D:' + 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)'; + } else if (Array.isArray(object)) { + items = ((function() { + var k, len, results; + results = []; + for (k = 0, len = object.length; k < len; k++) { + e = object[k]; + results.push(PDFObject.convert(e)); + } + return results; + })()).join(' '); + return '[' + items + ']'; + } else if ({}.toString.call(object) === '[object Object]') { + out = ['<<']; + for (key in object) { + val = object[key]; + out.push('/' + key + ' ' + PDFObject.convert(val)); + } + out.push('>>'); + return out.join('\n'); + } else if (typeof object === 'number') { + return PDFObject.number(object); + } else { + return '' + object; + } + }; + + PDFObject.number = function(n) { + if (n > -1e21 && n < 1e21) { + return Math.round(n * 1e6) / 1e6; + } + throw new Error("unsupported number: " + n); + }; + + return PDFObject; + + })(); + + module.exports = PDFObject; + + PDFReference = __webpack_require__(87); + +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(201); +var global = __webpack_require__(10); +var hide = __webpack_require__(13); +var Iterators = __webpack_require__(23); +var TO_STRING_TAG = __webpack_require__(4)('toStringTag'); + +var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + + 'TextTrackList,TouchList').split(','); + +for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(101); +var enumBugKeys = __webpack_require__(66); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(56); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +// 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. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +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. +EventEmitter.defaultMaxListeners = 10; + +// 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(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + err.context = er; + throw err; + } + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + args = Array.prototype.slice.call(arguments, 1); + handler.apply(this, args); + } + } else if (isObject(handler)) { + args = Array.prototype.slice.call(arguments, 1); + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.prototype.listenerCount = function(type) { + if (this._events) { + var evlistener = this._events[type]; + + if (isFunction(evlistener)) + return 1; + else if (evlistener) + return evlistener.length; + } + return 0; +}; + +EventEmitter.listenerCount = function(emitter, type) { + return emitter.listenerCount(type); +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(1) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var 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') + } + var 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) +} + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +var 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, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { continue; } + + if (typeof source !== 'object') { + throw new TypeError(source + 'must be non-object'); + } + + for (var 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; +}; + + +var 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 (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + // Join array of chunks to single array. + flattenChunks: function (chunks) { + var 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; + } +}; + +var fnUntyped = { + arraySet: function (dest, src, src_offs, len, dest_offs) { + for (var 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); + + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(14); +var dPs = __webpack_require__(100); +var enumBugKeys = __webpack_require__(66); +var IE_PROTO = __webpack_require__(64)('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(96)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(205).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(63); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(6).f; +var has = __webpack_require__(18); +var TAG = __webpack_require__(4)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(38)('meta'); +var isObject = __webpack_require__(9); +var has = __webpack_require__(18); +var setDesc = __webpack_require__(6).f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(19)(function () { + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); +}; +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, META)) { + // 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 + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function (it, create) { + if (!has(it, META)) { + // 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 + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(20); +var call = __webpack_require__(111); +var isArrayIter = __webpack_require__(112); +var anObject = __webpack_require__(14); +var toLength = __webpack_require__(37); +var getIterFn = __webpack_require__(67); +var BREAK = {}; +var RETURN = {}; +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isString = __webpack_require__(0).isString; +var isNumber = __webpack_require__(0).isNumber; +var isObject = __webpack_require__(0).isObject; +var isArray = __webpack_require__(0).isArray; +var LineBreaker = __webpack_require__(78); + +var LEADING = /^(\s)+/g; +var TRAILING = /(\s)+$/g; + +/** + * Creates an instance of TextTools - text measurement utility + * + * @constructor + * @param {FontProvider} fontProvider + */ +function TextTools(fontProvider) { + this.fontProvider = fontProvider; +} + +/** + * Converts an array of strings (or inline-definition-objects) into a collection + * of inlines and calculated minWidth/maxWidth. + * and their min/max widths + * @param {Object} textArray - an array of inline-definition-objects (or strings) + * @param {Object} styleContextStack current style stack + * @return {Object} collection of inlines, minWidth, maxWidth + */ +TextTools.prototype.buildInlines = function (textArray, styleContextStack) { + var measured = measure(this.fontProvider, textArray, styleContextStack); + + var minWidth = 0, + maxWidth = 0, + currentLineWidth; + + measured.forEach(function (inline) { + minWidth = Math.max(minWidth, inline.width - inline.leadingCut - inline.trailingCut); + + if (!currentLineWidth) { + currentLineWidth = {width: 0, leadingCut: inline.leadingCut, trailingCut: 0}; + } + + currentLineWidth.width += inline.width; + currentLineWidth.trailingCut = inline.trailingCut; + + maxWidth = Math.max(maxWidth, getTrimmedWidth(currentLineWidth)); + + if (inline.lineEnd) { + currentLineWidth = null; + } + }); + + if (getStyleProperty({}, styleContextStack, 'noWrap', false)) { + minWidth = maxWidth; + } + + return { + items: measured, + minWidth: minWidth, + maxWidth: maxWidth + }; + + function getTrimmedWidth(item) { + return Math.max(0, item.width - item.leadingCut - item.trailingCut); + } +}; + +/** + * Returns size of the specified string (without breaking it) using the current style + * @param {String} text text to be measured + * @param {Object} styleContextStack current style stack + * @return {Object} size of the specified string + */ +TextTools.prototype.sizeOfString = function (text, styleContextStack) { + text = text ? text.toString().replace(/\t/g, ' ') : ''; + + //TODO: refactor - extract from measure + var fontName = getStyleProperty({}, styleContextStack, 'font', 'Roboto'); + var fontSize = getStyleProperty({}, styleContextStack, 'fontSize', 12); + var fontFeatures = getStyleProperty({}, styleContextStack, 'fontFeatures', null); + var bold = getStyleProperty({}, styleContextStack, 'bold', false); + var italics = getStyleProperty({}, styleContextStack, 'italics', false); + var lineHeight = getStyleProperty({}, styleContextStack, 'lineHeight', 1); + var characterSpacing = getStyleProperty({}, styleContextStack, 'characterSpacing', 0); + + var font = this.fontProvider.provideFont(fontName, bold, italics); + + return { + width: widthOfString(text, font, fontSize, characterSpacing, fontFeatures), + height: font.lineHeight(fontSize) * lineHeight, + fontSize: fontSize, + lineHeight: lineHeight, + ascender: font.ascender / 1000 * fontSize, + descender: font.descender / 1000 * fontSize + }; +}; + +TextTools.prototype.widthOfString = function (text, font, fontSize, characterSpacing, fontFeatures) { + return widthOfString(text, font, fontSize, characterSpacing, fontFeatures); +}; + +function splitWords(text, noWrap) { + var results = []; + text = text.replace(/\t/g, ' '); + + if (noWrap) { + results.push({text: text}); + return results; + } + + var breaker = new LineBreaker(text); + var last = 0; + var bk; + + while (bk = breaker.nextBreak()) { + var word = text.slice(last, bk.position); + + if (bk.required || word.match(/\r?\n$|\r$/)) { // new line + word = word.replace(/\r?\n$|\r$/, ''); + results.push({text: word, lineEnd: true}); + } else { + results.push({text: word}); + } + + last = bk.position; + } + + return results; +} + +function copyStyle(source, destination) { + destination = destination || {}; + source = source || {}; //TODO: default style + + for (var key in source) { + if (key != 'text' && source.hasOwnProperty(key)) { + destination[key] = source[key]; + } + } + + return destination; +} + +function normalizeTextArray(array, styleContextStack) { + function flatten(array) { + return array.reduce(function (prev, cur) { + var current = isArray(cur.text) ? flatten(cur.text) : cur; + var more = [].concat(current).some(Array.isArray); + return prev.concat(more ? flatten(current) : current); + }, []); + } + + var results = []; + + if (!isArray(array)) { + array = [array]; + } + + array = flatten(array); + + for (var i = 0, l = array.length; i < l; i++) { + var item = array[i]; + var style = null; + var words; + + var noWrap = getStyleProperty(item || {}, styleContextStack, 'noWrap', false); + if (isObject(item)) { + words = splitWords(normalizeString(item.text), noWrap); + style = copyStyle(item); + } else { + words = splitWords(normalizeString(item), noWrap); + } + + for (var i2 = 0, l2 = words.length; i2 < l2; i2++) { + var result = { + text: words[i2].text + }; + + if (words[i2].lineEnd) { + result.lineEnd = true; + } + + copyStyle(style, result); + + results.push(result); + } + } + + return results; +} + +function normalizeString(value) { + if (value === undefined || value === null) { + return ''; + } else if (isNumber(value)) { + return value.toString(); + } else if (isString(value)) { + return value; + } else { + return value.toString(); + } +} + +function getStyleProperty(item, styleContextStack, property, defaultValue) { + var value; + + if (item[property] !== undefined && item[property] !== null) { + // item defines this property + return item[property]; + } + + if (!styleContextStack) { + return defaultValue; + } + + styleContextStack.auto(item, function () { + value = styleContextStack.getProperty(property); + }); + + if (value !== null && value !== undefined) { + return value; + } else { + return defaultValue; + } +} + +function measure(fontProvider, textArray, styleContextStack) { + var normalized = normalizeTextArray(textArray, styleContextStack); + + if (normalized.length) { + var leadingIndent = getStyleProperty(normalized[0], styleContextStack, 'leadingIndent', 0); + + if (leadingIndent) { + normalized[0].leadingCut = -leadingIndent; + normalized[0].leadingIndent = leadingIndent; + } + } + + normalized.forEach(function (item) { + var fontName = getStyleProperty(item, styleContextStack, 'font', 'Roboto'); + var fontSize = getStyleProperty(item, styleContextStack, 'fontSize', 12); + var fontFeatures = getStyleProperty(item, styleContextStack, 'fontFeatures', null); + var bold = getStyleProperty(item, styleContextStack, 'bold', false); + var italics = getStyleProperty(item, styleContextStack, 'italics', false); + var color = getStyleProperty(item, styleContextStack, 'color', 'black'); + var decoration = getStyleProperty(item, styleContextStack, 'decoration', null); + var decorationColor = getStyleProperty(item, styleContextStack, 'decorationColor', null); + var decorationStyle = getStyleProperty(item, styleContextStack, 'decorationStyle', null); + var background = getStyleProperty(item, styleContextStack, 'background', null); + var lineHeight = getStyleProperty(item, styleContextStack, 'lineHeight', 1); + var characterSpacing = getStyleProperty(item, styleContextStack, 'characterSpacing', 0); + var link = getStyleProperty(item, styleContextStack, 'link', null); + var linkToPage = getStyleProperty(item, styleContextStack, 'linkToPage', null); + var noWrap = getStyleProperty(item, styleContextStack, 'noWrap', null); + var preserveLeadingSpaces = getStyleProperty(item, styleContextStack, 'preserveLeadingSpaces', false); + + var font = fontProvider.provideFont(fontName, bold, italics); + + item.width = widthOfString(item.text, font, fontSize, characterSpacing, fontFeatures); + item.height = font.lineHeight(fontSize) * lineHeight; + + var leadingSpaces = item.text.match(LEADING); + + if (!item.leadingCut) { + item.leadingCut = 0; + } + + if (leadingSpaces && !preserveLeadingSpaces) { + item.leadingCut += widthOfString(leadingSpaces[0], font, fontSize, characterSpacing, fontFeatures); + } + + var trailingSpaces = item.text.match(TRAILING); + if (trailingSpaces) { + item.trailingCut = widthOfString(trailingSpaces[0], font, fontSize, characterSpacing, fontFeatures); + } else { + item.trailingCut = 0; + } + + item.alignment = getStyleProperty(item, styleContextStack, 'alignment', 'left'); + item.font = font; + item.fontSize = fontSize; + item.fontFeatures = fontFeatures; + item.characterSpacing = characterSpacing; + item.color = color; + item.decoration = decoration; + item.decorationColor = decorationColor; + item.decorationStyle = decorationStyle; + item.background = background; + item.link = link; + item.linkToPage = linkToPage; + item.noWrap = noWrap; + }); + + return normalized; +} + +function widthOfString(text, font, fontSize, characterSpacing, fontFeatures) { + return font.widthOfString(text, fontSize, fontFeatures) + ((characterSpacing || 0) * (text.length - 1)); +} + +module.exports = TextTools; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +// Generated by CoffeeScript 1.7.1 +var UnicodeTrie, inflate; + +inflate = __webpack_require__(79); + +UnicodeTrie = (function() { + var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET; + + SHIFT_1 = 6 + 5; + + SHIFT_2 = 5; + + SHIFT_1_2 = SHIFT_1 - SHIFT_2; + + OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1; + + INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2; + + INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1; + + INDEX_SHIFT = 2; + + DATA_BLOCK_LENGTH = 1 << SHIFT_2; + + DATA_MASK = DATA_BLOCK_LENGTH - 1; + + LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2; + + LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2; + + INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH; + + UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH; + + UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; + + INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH; + + DATA_GRANULARITY = 1 << INDEX_SHIFT; + + function UnicodeTrie(data) { + var isBuffer, uncompressedLength, view; + isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function'; + if (isBuffer || data instanceof Uint8Array) { + if (isBuffer) { + this.highStart = data.readUInt32BE(0); + this.errorValue = data.readUInt32BE(4); + uncompressedLength = data.readUInt32BE(8); + data = data.slice(12); + } else { + view = new DataView(data.buffer); + this.highStart = view.getUint32(0); + this.errorValue = view.getUint32(4); + uncompressedLength = view.getUint32(8); + data = data.subarray(12); + } + data = inflate(data, new Uint8Array(uncompressedLength)); + data = inflate(data, new Uint8Array(uncompressedLength)); + this.data = new Uint32Array(data.buffer); + } else { + this.data = data.data, this.highStart = data.highStart, this.errorValue = data.errorValue; + } + } + + UnicodeTrie.prototype.get = function(codePoint) { + var index; + if (codePoint < 0 || codePoint > 0x10ffff) { + return this.errorValue; + } + if (codePoint < 0xd800 || (codePoint > 0xdbff && codePoint <= 0xffff)) { + index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK); + return this.data[index]; + } + if (codePoint <= 0xffff) { + index = (this.data[LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK); + return this.data[index]; + } + if (codePoint < this.highStart) { + 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; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isString = __webpack_require__(0).isString; + +function buildColumnWidths(columns, availableWidth) { + var autoColumns = [], + autoMin = 0, autoMax = 0, + starColumns = [], + starMaxMin = 0, + starMaxMax = 0, + fixedColumns = [], + initial_availableWidth = availableWidth; + + columns.forEach(function (column) { + if (isAutoColumn(column)) { + autoColumns.push(column); + autoMin += column._minWidth; + autoMax += column._maxWidth; + } else if (isStarColumn(column)) { + starColumns.push(column); + starMaxMin = Math.max(starMaxMin, column._minWidth); + starMaxMax = Math.max(starMaxMax, column._maxWidth); + } else { + fixedColumns.push(column); + } + }); + + fixedColumns.forEach(function (col) { + // width specified as % + if (isString(col.width) && /\d+%/.test(col.width)) { + col.width = parseFloat(col.width) * initial_availableWidth / 100; + } + if (col.width < (col._minWidth) && col.elasticWidth) { + col._calcWidth = col._minWidth; + } else { + col._calcWidth = col.width; + } + + availableWidth -= col._calcWidth; + }); + + // http://www.freesoft.org/CIE/RFC/1942/18.htm + // http://www.w3.org/TR/CSS2/tables.html#width-layout + // http://dev.w3.org/csswg/css3-tables-algorithms/Overview.src.htm + var minW = autoMin + starMaxMin * starColumns.length; + var maxW = autoMax + starMaxMax * starColumns.length; + if (minW >= availableWidth) { + // case 1 - there's no way to fit all columns within available width + // that's actually pretty bad situation with PDF as we have no horizontal scroll + // no easy workaround (unless we decide, in the future, to split single words) + // currently we simply use minWidths for all columns + autoColumns.forEach(function (col) { + col._calcWidth = col._minWidth; + }); + + starColumns.forEach(function (col) { + col._calcWidth = starMaxMin; // starMaxMin already contains padding + }); + } else { + if (maxW < availableWidth) { + // case 2 - we can fit rest of the table within available space + autoColumns.forEach(function (col) { + col._calcWidth = col._maxWidth; + availableWidth -= col._calcWidth; + }); + } else { + // maxW is too large, but minW fits within available width + var W = availableWidth - minW; + var D = maxW - minW; + + autoColumns.forEach(function (col) { + var d = col._maxWidth - col._minWidth; + col._calcWidth = col._minWidth + d * W / D; + availableWidth -= col._calcWidth; + }); + } + + if (starColumns.length > 0) { + var starSize = availableWidth / starColumns.length; + + starColumns.forEach(function (col) { + col._calcWidth = starSize; + }); + } + } +} + +function isAutoColumn(column) { + return column.width === 'auto'; +} + +function isStarColumn(column) { + return column.width === null || column.width === undefined || column.width === '*' || column.width === 'star'; +} + +//TODO: refactor and reuse in measureTable +function measureMinMax(columns) { + var result = {min: 0, max: 0}; + + var maxStar = {min: 0, max: 0}; + var starCount = 0; + + for (var i = 0, l = columns.length; i < l; i++) { + var c = columns[i]; + + if (isStarColumn(c)) { + maxStar.min = Math.max(maxStar.min, c._minWidth); + maxStar.max = Math.max(maxStar.max, c._maxWidth); + starCount++; + } else if (isAutoColumn(c)) { + result.min += c._minWidth; + result.max += c._maxWidth; + } else { + result.min += ((c.width !== undefined && c.width) || c._minWidth); + result.max += ((c.width !== undefined && c.width) || c._maxWidth); + } + } + + if (starCount) { + result.min += starCount * maxStar.min; + result.max += starCount * maxStar.max; + } + + return result; +} + +/** + * Calculates column widths + * @private + */ +module.exports = { + buildColumnWidths: buildColumnWidths, + measureMinMax: measureMinMax, + isAutoColumn: isAutoColumn, + isStarColumn: isStarColumn +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(83); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = __webpack_require__(46); +exports.Duplex = __webpack_require__(16); +exports.Transform = __webpack_require__(86); +exports.PassThrough = __webpack_require__(145); + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// 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. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + + + +/**/ + +var processNextTick = __webpack_require__(32).nextTick; +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* */ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +/**/ +var Duplex; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = __webpack_require__(25); +util.inherits = __webpack_require__(21); +/**/ + +/**/ +var internalUtil = { + deprecate: __webpack_require__(144) +}; +/**/ + +/**/ +var Stream = __webpack_require__(84); +/**/ + +/**/ + +var Buffer = __webpack_require__(33).Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +var destroyImpl = __webpack_require__(85); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || __webpack_require__(16); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + + return object && object._writableState instanceof WritableState; + } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} + +function Writable(options) { + Duplex = Duplex || __webpack_require__(16); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + processNextTick(cb, er); + // this can emit finish, and it will always happen + // after error + processNextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + processNextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; + } else { + state.corkedRequestsFree = corkReq; + } +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11), __webpack_require__(142).setImmediate, __webpack_require__(7))) + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Buffer = __webpack_require__(33).Buffer; + +var isEncoding = Buffer.isEncoding || function (encoding) { + encoding = '' + encoding; + switch (encoding && encoding.toLowerCase()) { + case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw': + return true; + default: + return false; + } +}; + +function _normalizeEncoding(enc) { + if (!enc) return 'utf8'; + var retried; + while (true) { + switch (enc) { + case 'utf8': + case 'utf-8': + return 'utf8'; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return 'utf16le'; + case 'latin1': + case 'binary': + return 'latin1'; + case 'base64': + case 'ascii': + case 'hex': + return enc; + default: + if (retried) return; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); + return nenc || enc; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +exports.StringDecoder = StringDecoder; +function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case 'utf16le': + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case 'utf8': + this.fillLast = utf8FillLast; + nb = 4; + break; + case 'base64': + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer.allocUnsafe(nb); +} + +StringDecoder.prototype.write = function (buf) { + if (buf.length === 0) return ''; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === undefined) return ''; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ''; +}; + +StringDecoder.prototype.end = utf8End; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +StringDecoder.prototype.fillLast = function (buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return -1; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +function utf8CheckIncomplete(self, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 1; + return nb; + } + if (--j < i) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self.lastNeed = nb - 2; + return nb; + } + if (--j < i) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0;else self.lastNeed = nb - 3; + } + return nb; + } + return 0; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'.repeat(p); + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'.repeat(p + 1); + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'.repeat(p + 2); + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf, p); + if (r !== undefined) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString('utf8', i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString('utf8', i, end); +} + +// For UTF-8, a replacement character for each buffered byte of a (partial) +// character needs to be added to the output. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed); + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString('utf16le', i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 0xD800 && c <= 0xDBFF) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString('utf16le', i, buf.length - 1); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString('utf16le', 0, end); + } + return r; +} + +function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString('base64', i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString('base64', i, buf.length - n); +} + +function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed); + return r; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var Buffer = __webpack_require__(1).Buffer; +var Transform = __webpack_require__(15).Transform; +var binding = __webpack_require__(150); +var util = __webpack_require__(49); +var assert = __webpack_require__(88).ok; +var kMaxLength = __webpack_require__(1).kMaxLength; +var 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 +var bkeys = Object.keys(binding); +for (var bk = 0; bk < bkeys.length; bk++) { + var bkey = bkeys[bk]; + if (bkey.match(/^Z/)) { + Object.defineProperty(exports, bkey, { + enumerable: true, value: binding[bkey], writable: false + }); + } +} + +// translation table for return codes. +var 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 +}; + +var ckeys = Object.keys(codes); +for (var ck = 0; ck < ckeys.length; ck++) { + var 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) { + var buffers = []; + var nread = 0; + + engine.on('error', onError); + engine.on('end', onEnd); + + engine.end(buffer); + flow(); + + function flow() { + var chunk; + while (null !== (chunk = engine.read())) { + 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() { + var buf; + var 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'); + + var 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) { + var _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); + + var 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; + + var error = new Error(message); + error.errno = errno; + error.code = exports.codes[errno]; + self.emit('error', error); + }; + + var level = exports.Z_DEFAULT_COMPRESSION; + if (typeof opts.level === 'number') level = opts.level; + + var 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) { + var 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) { + var _this2 = this; + + var 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) { + var flushFlag; + var ws = this._writableState; + var ending = ws.ending || ws.ended; + var 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) { + var availInBefore = chunk && chunk.length; + var availOutBefore = this._chunkSize - this._offset; + var inOff = 0; + + var self = this; + + var async = typeof cb === 'function'; + + if (!async) { + var buffers = []; + var nread = 0; + + var 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); + } + + var buf = Buffer.concat(buffers, nread); + _close(this); + + return buf; + } + + assert(this._handle, 'zlib binding closed'); + var 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; + + var have = availOutBefore - availOutAfter; + assert(have >= 0, 'have should not go down'); + + if (have > 0) { + var 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; + + var 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); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {// 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. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = __webpack_require__(151); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = __webpack_require__(152); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(11))) + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.12.6 +(function() { + var EmbeddedFont, PDFFont, StandardFont, fontkit; + + fontkit = __webpack_require__(167); + + PDFFont = (function() { + PDFFont.open = function(document, src, family, id) { + var font; + if (typeof src === 'string') { + if (StandardFont.isStandardFont(src)) { + return new StandardFont(document, src, id); + } + font = fontkit.openSync(src, family); + } else if (Buffer.isBuffer(src)) { + font = fontkit.create(src, family); + } else if (src instanceof Uint8Array) { + font = fontkit.create(new Buffer(src), family); + } else if (src instanceof ArrayBuffer) { + font = fontkit.create(new Buffer(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); + }; + + function PDFFont() { + throw new Error('Cannot construct a PDFFont directly.'); + } + + PDFFont.prototype.encode = function(text) { + throw new Error('Must be implemented by subclasses'); + }; + + PDFFont.prototype.widthOfString = function(text) { + throw new Error('Must be implemented by subclasses'); + }; + + PDFFont.prototype.ref = function() { + return this.dictionary != null ? this.dictionary : this.dictionary = this.document.ref(); + }; + + PDFFont.prototype.finalize = function() { + if (this.embedded || (this.dictionary == null)) { + return; + } + this.embed(); + return this.embedded = true; + }; + + PDFFont.prototype.embed = function() { + throw new Error('Must be implemented by subclasses'); + }; + + PDFFont.prototype.lineHeight = function(size, includeGap) { + var gap; + if (includeGap == null) { + includeGap = false; + } + gap = includeGap ? this.lineGap : 0; + return (this.ascender + gap - this.descender) / 1000 * size; + }; + + return PDFFont; + + })(); + + module.exports = PDFFont; + + StandardFont = __webpack_require__(292); + + EmbeddedFont = __webpack_require__(294); + +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.7.1 +(function() { + var DecodeStream, iconv; + + try { + iconv = __webpack_require__(52); + } catch (_error) {} + + DecodeStream = (function() { + var key; + + function DecodeStream(buffer) { + this.buffer = buffer; + this.pos = 0; + this.length = this.buffer.length; + } + + DecodeStream.TYPES = { + UInt8: 1, + UInt16: 2, + UInt24: 3, + UInt32: 4, + Int8: 1, + Int16: 2, + Int24: 3, + Int32: 4, + Float: 4, + Double: 8 + }; + + for (key in Buffer.prototype) { + if (key.slice(0, 4) === 'read') { + (function(key) { + var bytes; + bytes = DecodeStream.TYPES[key.replace(/read|[BL]E/g, '')]; + return DecodeStream.prototype[key] = function() { + var ret; + ret = this.buffer[key](this.pos); + this.pos += bytes; + return ret; + }; + })(key); + } + } + + DecodeStream.prototype.readString = function(length, encoding) { + var buf, byte, i, _i, _ref; + if (encoding == null) { + encoding = 'ascii'; + } + switch (encoding) { + case 'utf16le': + case 'ucs2': + case 'utf8': + case 'ascii': + return this.buffer.toString(encoding, this.pos, this.pos += length); + case 'utf16be': + buf = new Buffer(this.readBuffer(length)); + for (i = _i = 0, _ref = buf.length - 1; _i < _ref; i = _i += 2) { + 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 (_error) {} + } + return buf; + } + }; + + DecodeStream.prototype.readBuffer = function(length) { + return this.buffer.slice(this.pos, this.pos += length); + }; + + DecodeStream.prototype.readUInt24BE = function() { + return (this.readUInt16BE() << 8) + this.readUInt8(); + }; + + DecodeStream.prototype.readUInt24LE = function() { + return this.readUInt16LE() + (this.readUInt8() << 16); + }; + + DecodeStream.prototype.readInt24BE = function() { + return (this.readInt16BE() << 8) + this.readUInt8(); + }; + + DecodeStream.prototype.readInt24LE = function() { + return this.readUInt16LE() + (this.readInt8() << 16); + }; + + return DecodeStream; + + })(); + + module.exports = DecodeStream; + +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +// Some environments don't have global Buffer (e.g. React Native). +// Solution would be installing npm modules "buffer" and "stream" explicitly. +var Buffer = __webpack_require__(1).Buffer; + +var bomHandling = __webpack_require__(170), + 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. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var 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 = new Buffer("" + (buf || ""), "binary"); // Ensure buffer. + } + + var decoder = iconv.getDecoder(encoding, options); + + var res = decoder.write(buf); + var 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__(171); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = (''+encoding).toLowerCase().replace(/[^0-9a-z]|:\d{4}$/g, ""); + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + + var 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 (var 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.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + 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) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); + + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + + return decoder; +} + + +// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. +var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; +if (nodeVer) { + + // Load streaming support in Node v0.10+ + var nodeVerArr = nodeVer.split(".").map(Number); + if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { + __webpack_require__(185)(iconv); + } + + // Load Node primitive extensions. + __webpack_require__(186)(iconv); +} + +if (false) { + console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11))) + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +module.exports = [["0","\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]] + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(55); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(35); +var createDesc = __webpack_require__(27); +var toIObject = __webpack_require__(17); +var toPrimitive = __webpack_require__(58); +var has = __webpack_require__(18); +var IE8_DOM_DEFINE = __webpack_require__(95); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(5) ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { /* empty */ } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(9); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(3); +var core = __webpack_require__(2); +var fails = __webpack_require__(19); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(200), __esModule: true }; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(62); +var $export = __webpack_require__(3); +var redefine = __webpack_require__(99); +var hide = __webpack_require__(13); +var has = __webpack_require__(18); +var Iterators = __webpack_require__(23); +var $iterCreate = __webpack_require__(203); +var setToStringTag = __webpack_require__(39); +var getPrototypeOf = __webpack_require__(206); +var ITERATOR = __webpack_require__(4)('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = (!BUGGY && $native) || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(65)('keys'); +var uid = __webpack_require__(38); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(10); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); +module.exports = function (key) { + return store[key] || (store[key] = {}); +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(68); +var ITERATOR = __webpack_require__(4)('iterator'); +var Iterators = __webpack_require__(23); +module.exports = __webpack_require__(2).getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(55); +var TAG = __webpack_require__(4)('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _iterator = __webpack_require__(103); + +var _iterator2 = _interopRequireDefault(_iterator); + +var _symbol = __webpack_require__(216); + +var _symbol2 = _interopRequireDefault(_symbol); + +var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof(obj); +} : function (obj) { + return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); +}; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(4); + + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(10); +var core = __webpack_require__(2); +var LIBRARY = __webpack_require__(62); +var wksExt = __webpack_require__(70); +var defineProperty = __webpack_require__(6).f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports) { + + + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(223), __esModule: true }; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(9); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function TraversalTracker() { + this.events = {}; +} + +TraversalTracker.prototype.startTracking = function (event, callback) { + var callbacks = this.events[event] || (this.events[event] = []); + + if (callbacks.indexOf(callback) < 0) { + callbacks.push(callback); + } +}; + +TraversalTracker.prototype.stopTracking = function (event, callback) { + var callbacks = this.events[event]; + + if (!callbacks) { + return; + } + + var index = callbacks.indexOf(callback); + if (index >= 0) { + callbacks.splice(index, 1); + } +}; + +TraversalTracker.prototype.emit = function (event) { + var args = Array.prototype.slice.call(arguments, 1); + var callbacks = this.events[event]; + + if (!callbacks) { + return; + } + + callbacks.forEach(function (callback) { + callback.apply(this, args); + }); +}; + +TraversalTracker.prototype.auto = function (event, callback, innerFunction) { + this.startTracking(event, callback); + innerFunction(); + this.stopTracking(event, callback); +}; + +module.exports = TraversalTracker; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var AI, AL, BA, BK, CB, CI_BRK, CJ, CP_BRK, CR, DI_BRK, ID, IN_BRK, LF, LineBreaker, NL, NS, PR_BRK, SA, SG, SP, UnicodeTrie, WJ, XX, base64, characterClasses, classTrie, data, fs, pairTable, _ref, _ref1; + + UnicodeTrie = __webpack_require__(43); + + + + base64 = __webpack_require__(131); + + _ref = __webpack_require__(132), BK = _ref.BK, CR = _ref.CR, LF = _ref.LF, NL = _ref.NL, CB = _ref.CB, BA = _ref.BA, SP = _ref.SP, WJ = _ref.WJ, SP = _ref.SP, BK = _ref.BK, LF = _ref.LF, NL = _ref.NL, AI = _ref.AI, AL = _ref.AL, SA = _ref.SA, SG = _ref.SG, XX = _ref.XX, CJ = _ref.CJ, ID = _ref.ID, NS = _ref.NS, characterClasses = _ref.characterClasses; + + _ref1 = __webpack_require__(133), DI_BRK = _ref1.DI_BRK, IN_BRK = _ref1.IN_BRK, CI_BRK = _ref1.CI_BRK, CP_BRK = _ref1.CP_BRK, PR_BRK = _ref1.PR_BRK, pairTable = _ref1.pairTable; + + data = base64.toByteArray("AA4IAAAAAAAAAhqg5VV7NJtZvz7fTC8zU5deplUlMrQoWqmqahD5So0aipYWrUhVFSVBQ10iSTtUtW6nKDVF6k7d75eQfEUbFcQ9KiFS90tQEolcP23nrLPmO+esr/+f39rr/a293t/e7/P8nmfvlz0O6RvrBJADtbBNaD88IOKTOmOrCqhu9zE770vc1pBV/xL5dxj2V7Zj4FGSomFKStCWNlV7hG1VabZfZ1LaHbFrRwzzLjzPoi1UHDnlV/lWbhgIIJvLBp/pu7AHEdRnIY+ROdXxg4fNpMdTxVnnm08OjozejAVsBqwqz8kddGRlRxsd8c55dNZoPuex6a7Dt6L0NNb03sqgTlR2/OT7eTt0Y0WnpUXxLsp5SMANc4DsmX4zJUBQvznwexm9tsMH+C9uRYMPOd96ZHB29NZjCIM2nfO7tsmQveX3l2r7ft0N4/SRJ7kO6Y8ZCaeuUQ4gMTZ67cp7TgxvlNDsPgOBdZi2YTam5Q7m3+00l+XG7PrDe6YoPmHgK+yLih7fAR16ZFCeD9WvOVt+gfNW/KT5/M6rb/9KERt+N1lad5RneVjzxXHsLofuU+TvrEsr3+26sVz5WJh6L/svoPK3qepFH9bysDljWtD1F7KrxzW1i9r+e/NLxV/acts7zuo304J9+t3Pd6Y6u8f3EAqxNRgv5DZjaI3unyvkvHPya/v3mWVYOC38qBq11+yHZ2bAyP1HbkV92vdno7r2lxz9UwCdCJVfd14NLcpO2CadHS/XPJ9doXgz5vLv/1OBVS3gX0D9n6LiNIDfpilO9RsLgZ2W/wIy8W/Rh93jfoz4qmRV2xElv6p2lRXQdO6/Cv8f5nGn3u0wLXjhnvClabL1o+7yvIpvLfT/xsKG30y/sTvq30ia9Czxp9dr9v/e7Yn/O0QJXxxBOJmceP/DBFa1q1v6oudn/e6qc/37dUoNvnYL4plQ9OoneYOh/r8fOFm7yl7FETHY9dXd5K2n/qEc53dOEe1TTJcvCfp1dpTC334l0vyaFL6mttNEbFjzO+ZV2mLk0qc3BrxJ4d9gweMmjRorxb7vic0rSq6D4wzAyFWas1TqPE0sLI8XLAryC8tPChaN3ALEZSWmtB34SyZcxXYn/E4Tg0LeMIPhgPKD9zyHGMxxhxnDDih7eI86xECTM8zodUCdgffUmRh4rQ8zyA6ow/Aei+01a8OMfziQQ+GAEkhwN/cqUFYAVzA9ex4n6jgtsiMvXf5BtXxEU4hSphvx3v8+9au8eEekEEpkrkne/zB1M+HAPuXIz3paxKlfe8aDMfGWAX6Md6PuuAdKHFVH++Ed5LEji94Z5zeiJIxbmWeN7rr1/ZcaBl5/nimdHsHgIH/ssyLUXZ4fDQ46HnBb+hQqG8yNiKRrXL/b1IPYDUsu3dFKtRMcjqlRvONd4xBvOufx2cUHuk8pmG1D7PyOQmUmluisVFS9OWS8fPIe8LiCtjwJKnEC9hrS9uKmISI3Wa5+vdXUG9dtyfr7g/oJv2wbzeZU838G6mEvntUb3SVV/fBZ6H/sL+lElzeRrHy2Xbe7UWX1q5sgOQ81rv+2baej4fP4m5Mf/GkoxfDtT3++KP7do9Jn26aa6xAhCf5L9RZVfkWKCcjI1eYbm2plvTEqkDxKC402bGzXCYaGnuALHabBT1dFLuOSB7RorOPEhZah1NjZIgR/UFGfK3p1ElYnevOMBDLURdpIjrI+qZk4sffGbRFiXuEmdFjiAODlQCJvIaB1rW61Ljg3y4eS4LAcSgDxxZQs0DYa15wA032Z+lGUfpoyOrFo3mg1sRQtN/fHHCx3TrM8eTrldMbYisDLXbUDoXMLejSq0fUNuO1muX0gEa8vgyegkqiqqbC3W0S4cC9Kmt8MuS/hFO7Xei3f8rSvIjeveMM7kxjUixOrl6gJshe4JU7PhOHpfrRYvu7yoAZKa3Buyk2J+K5W+nNTz1nhJDhRUfDJLiUXxjxXCJeeaOe/r7HlBP/uURc/5efaZEPxr55Qj39rfTLkugUGyMrwo7HAglfEjDriehF1jXtwJkPoiYkYQ5aoXSA7qbCBGKq5hwtu2VkpI9xVDop/1xrC52eiIvCoPWx4lLl40jm9upvycVPfpaH9/o2D4xKXpeNjE2HPQRS+3RFaYTc4Txw7Dvq5X6JBRwzs9mvoB49BK6b+XgsZVJYiInTlSXZ+62FT18mkFVcPKCJsoF5ahb19WheZLUYsSwdrrVM3aQ2XE6SzU2xHDS6iWkodk5AF6F8WUNmmushi8aVpMPwiIfEiQWo3CApONDRjrhDiVnkaFsaP5rjIJkmsN6V26li5LNM3JxGSyKgomknTyyrhcnwv9Qcqaq5utAh44W30SWo8Q0XHKR0glPF4fWst1FUCnk2woFq3iy9fAbzcjJ8fvSjgKVOfn14RDqyQuIgaGJZuswTywdCFSa89SakMf6fe+9KaQMYQlKxiJBczuPSho4wmBjdA+ag6QUOr2GdpcbSl51Ay6khhBt5UXdrnxc7ZGMxCvz96A4oLocxh2+px+1zkyLacCGrxnPzTRSgrLKpStFpH5ppKWm7PgMKZtwgytKLOjbGCOQLTm+KOowqa1sdut9raj1CZFkZD0jbaKNLpJUarSH5Qknx1YiOxdA5L6d5sfI/unmkSF65Ic/AvtXt98Pnrdwl5vgppQ3dYzWFwknZsy6xh2llmLxpegF8ayLwniknlXRHiF4hzzrgB8jQ4wdIqcaHCEAxyJwCeGkXPBZYSrrGa4vMwZvNN9aK0F4JBOK9mQ8g8EjEbIQVwvfS2D8GuCYsdqwqSWbQrfWdTRUJMqmpnWPax4Z7E137I6brHbvjpPlfNZpF1d7PP7HB/MPHcHVKTMhLO4f3CZcaccZEOiS2DpKiQB5KXDJ+Ospcz4qTRCRxgrKEQIgUkKLTKKwskdx2DWo3bg3PEoB5h2nA24olwfKSR+QR6TAvEDi/0czhUT59RZmO1MGeKGeEfuOSPWfL+XKmhqpZmOVR9mJVNDPKOS49Lq+Um10YsBybzDMtemlPCOJEtE8zaXhsaqEs9bngSJGhlOTTMlCXly9Qv5cRN3PVLK7zoMptutf7ihutrQ/Xj7VqeCdUwleTTKklOI8Wep9h7fCY0kVtDtIWKnubWAvbNZtsRRqOYl802vebPEkZRSZc6wXOfPtpPtN5HI63EUFfsy7U/TLr8NkIzaY3vx4A28x765XZMzRZTpMk81YIMuwJ5+/zoCuZj1wGnaHObxa5rpKZj4WhT670maRw04w0e3cZW74Z0aZe2n05hjZaxm6urenz8Ef5O6Yu1J2aqYAlqsCXs5ZB5o1JJ5l3xkTVr8rJQ09NLsBqRRDT2IIjOPmcJa6xQ1R5yGP9jAsj23xYDTezdyqG8YWZ7vJBIWK56K+iDgcHimiQOTIasNSua1fOBxsKMMEKd15jxTl+3CyvGCR+UyRwuSI2XuwRIPoNNclPihfJhaq2mKkNijwYLY6feqohktukmI3KDvOpN7ItCqHHhNuKlxMfBAEO5LjW2RKh6lE5Hd1dtAOopac/Z4FdsNsjMhXz/ug8JGmbVJTA+VOBJXdrYyJcIn5+OEeoK8kWEWF+wdG8ZtZHKSquWDtDVyhFPkRVqguKFkLkKCz46hcU1SUY9oJ2Sk+dmq0kglqk4kqKT1CV9JDELPjK1WsWGkEXF87g9P98e5ff0mIupm/w6vc3kCeq04X5bgJQlcMFRjlFWmSk+kssXCAVikfeAlMuzpUvCSdXiG+dc6KrIiLxxhbEVuKf7vW7KmDQI95bZe3H9mN3/77F6fZ2Yx/F9yClllj8gXpLWLpd5+v90iOaFa9sd7Pvx0lNa1o1+bkiZ69wCiC2x9UIb6/boBCuNMB/HYR0RC6+FD9Oe5qrgQl6JbXtkaYn0wkdNhROLqyhv6cKvyMj1Fvs2o3OOKoMYTubGENLfY5F6H9d8wX1cnINsvz+wZFQu3zhWVlwJvwBEp69Dqu/ZnkBf3nIfbx4TK7zOVJH5sGJX+IMwkn1vVBn38GbpTg9bJnMcTOb5F6Ci5gOn9Fcy6Qzcu+FL6mYJJ+f2ZZJGda1VqruZ0JRXItp8X0aTjIcJgzdaXlha7q7kV4ebrMsunfsRyRa9qYuryBHA0hc1KVsKdE+oI0ljLmSAyMze8lWmc5/lQ18slyTVC/vADTc+SNM5++gztTBLz4m0aVUKcfgOEExuKVomJ7XQDZuziMDjG6JP9tgR7JXZTeo9RGetW/Xm9/TgPJpTgHACPOGvmy2mDm9fl09WeMm9sQUAXP3Su2uApeCwJVT5iWCXDgmcuTsFgU9Nm6/PusJzSbDQIMfl6INY/OAEvZRN54BSSXUClM51im6Wn9VhVamKJmzOaFJErgJcs0etFZ40LIF3EPkjFTjGmAhsd174NnOwJW8TdJ1Dja+E6Wa6FVS22Haj1DDA474EesoMP5nbspAPJLWJ8rYcP1DwCslhnn+gTFm+sS9wY+U6SogAa9tiwpoxuaFeqm2OK+uozR6SfiLCOPz36LiDlzXr6UWd7BpY6mlrNANkTOeme5EgnnAkQRTGo9T6iYxbUKfGJcI9B+ub2PcyUOgpwXbOf3bHFWtygD7FYbRhb+vkzi87dB0JeXl/vBpBUz93VtqZi7AL7C1VowTF+tGmyurw7DBcktc+UMY0E10Jw4URojf8NdaNpN6E1q4+Oz+4YePtMLy8FPRP"); + + classTrie = new UnicodeTrie(data); + + LineBreaker = (function() { + var Break, mapClass, mapFirst; + + function LineBreaker(string) { + this.string = string; + this.pos = 0; + this.lastPos = 0; + this.curClass = null; + this.nextClass = null; + } + + LineBreaker.prototype.nextCodePoint = function() { + var code, next; + code = this.string.charCodeAt(this.pos++); + next = this.string.charCodeAt(this.pos); + if ((0xd800 <= code && code <= 0xdbff) && (0xdc00 <= next && next <= 0xdfff)) { + this.pos++; + return ((code - 0xd800) * 0x400) + (next - 0xdc00) + 0x10000; + } + return code; + }; + + mapClass = function(c) { + switch (c) { + case AI: + return AL; + case SA: + case SG: + case XX: + return AL; + case CJ: + return NS; + default: + return c; + } + }; + + mapFirst = function(c) { + switch (c) { + case LF: + case NL: + return BK; + case CB: + return BA; + case SP: + return WJ; + default: + return c; + } + }; + + LineBreaker.prototype.nextCharClass = function(first) { + if (first == null) { + first = false; + } + return mapClass(classTrie.get(this.nextCodePoint())); + }; + + Break = (function() { + function Break(position, required) { + this.position = position; + this.required = required != null ? required : false; + } + + return Break; + + })(); + + LineBreaker.prototype.nextBreak = function() { + var cur, lastClass, shouldBreak; + if (this.curClass == null) { + this.curClass = mapFirst(this.nextCharClass()); + } + while (this.pos < this.string.length) { + this.lastPos = this.pos; + lastClass = this.nextClass; + this.nextClass = this.nextCharClass(); + if (this.curClass === BK || (this.curClass === CR && this.nextClass !== LF)) { + this.curClass = mapFirst(mapClass(this.nextClass)); + return new Break(this.lastPos, true); + } + cur = (function() { + switch (this.nextClass) { + case SP: + return this.curClass; + case BK: + case LF: + case NL: + return BK; + case CR: + return CR; + case CB: + return BA; + } + }).call(this); + if (cur != null) { + this.curClass = cur; + if (this.nextClass === CB) { + return new Break(this.lastPos); + } + continue; + } + shouldBreak = false; + switch (pairTable[this.curClass][this.nextClass]) { + case DI_BRK: + shouldBreak = true; + break; + case IN_BRK: + shouldBreak = lastClass === SP; + break; + case CI_BRK: + shouldBreak = lastClass === SP; + if (!shouldBreak) { + continue; + } + break; + case CP_BRK: + if (lastClass !== SP) { + continue; + } + } + this.curClass = this.nextClass; + if (shouldBreak) { + return new Break(this.lastPos); + } + } + if (this.pos >= this.string.length) { + if (this.lastPos < this.string.length) { + this.lastPos = this.string.length; + return new Break(this.string.length); + } else { + return null; + } + } + }; + + return LineBreaker; + + })(); + + module.exports = LineBreaker; + +}).call(this); + + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + +var TINF_OK = 0; +var TINF_DATA_ERROR = -3; + +function Tree() { + this.table = new Uint16Array(16); /* table of code length counts */ + this.trans = new Uint16Array(288); /* code -> symbol translation table */ +} + +function Data(source, dest) { + this.source = source; + this.sourceIndex = 0; + this.tag = 0; + this.bitcount = 0; + + this.dest = dest; + this.destLen = 0; + + this.ltree = new Tree(); /* dynamic length/symbol tree */ + this.dtree = new Tree(); /* dynamic distance tree */ +} + +/* --------------------------------------------------- * + * -- uninitialized global data (static structures) -- * + * --------------------------------------------------- */ + +var sltree = new Tree(); +var sdtree = new Tree(); + +/* extra bits and base tables for length codes */ +var length_bits = new Uint8Array(30); +var length_base = new Uint16Array(30); + +/* extra bits and base tables for distance codes */ +var dist_bits = new Uint8Array(30); +var dist_base = new Uint16Array(30); + +/* special ordering of code length codes */ +var clcidx = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, + 10, 5, 11, 4, 12, 3, 13, 2, + 14, 1, 15 +]); + +/* used by tinf_decode_trees, avoids allocations every call */ +var code_tree = new Tree(); +var lengths = new Uint8Array(288 + 32); + +/* ----------------------- * + * -- utility functions -- * + * ----------------------- */ + +/* build extra bits and base tables */ +function tinf_build_bits_base(bits, base, delta, first) { + var i, sum; + + /* build bits table */ + for (i = 0; i < delta; ++i) bits[i] = 0; + for (i = 0; i < 30 - delta; ++i) bits[i + delta] = i / delta | 0; + + /* build base table */ + for (sum = first, i = 0; i < 30; ++i) { + base[i] = sum; + sum += 1 << bits[i]; + } +} + +/* build the fixed huffman trees */ +function tinf_build_fixed_trees(lt, dt) { + var i; + + /* build fixed length tree */ + for (i = 0; i < 7; ++i) lt.table[i] = 0; + + lt.table[7] = 24; + lt.table[8] = 152; + lt.table[9] = 112; + + for (i = 0; i < 24; ++i) lt.trans[i] = 256 + i; + for (i = 0; i < 144; ++i) lt.trans[24 + i] = i; + for (i = 0; i < 8; ++i) lt.trans[24 + 144 + i] = 280 + i; + for (i = 0; i < 112; ++i) lt.trans[24 + 144 + 8 + i] = 144 + i; + + /* build fixed distance tree */ + for (i = 0; i < 5; ++i) dt.table[i] = 0; + + dt.table[5] = 32; + + for (i = 0; i < 32; ++i) dt.trans[i] = i; +} + +/* given an array of code lengths, build a tree */ +var offs = new Uint16Array(16); + +function tinf_build_tree(t, lengths, off, num) { + var i, sum; + + /* clear code length count table */ + for (i = 0; i < 16; ++i) t.table[i] = 0; + + /* scan symbol lengths, and sum code length counts */ + for (i = 0; i < num; ++i) t.table[lengths[off + i]]++; + + t.table[0] = 0; + + /* compute offset table for distribution sort */ + for (sum = 0, i = 0; i < 16; ++i) { + offs[i] = sum; + sum += t.table[i]; + } + + /* create code->symbol translation table (symbols sorted by code) */ + for (i = 0; i < num; ++i) { + if (lengths[off + i]) t.trans[offs[lengths[off + i]]++] = i; + } +} + +/* ---------------------- * + * -- decode functions -- * + * ---------------------- */ + +/* get one bit from source stream */ +function tinf_getbit(d) { + /* check if tag is empty */ + if (!d.bitcount--) { + /* load next tag */ + d.tag = d.source[d.sourceIndex++]; + d.bitcount = 7; + } + + /* shift bit out of tag */ + var bit = d.tag & 1; + d.tag >>>= 1; + + return bit; +} + +/* read a num bit value from a stream and add base */ +function tinf_read_bits(d, num, base) { + if (!num) + return base; + + while (d.bitcount < 24) { + d.tag |= d.source[d.sourceIndex++] << d.bitcount; + d.bitcount += 8; + } + + var val = d.tag & (0xffff >>> (16 - num)); + d.tag >>>= num; + d.bitcount -= num; + return val + base; +} + +/* given a data stream and a tree, decode a symbol */ +function tinf_decode_symbol(d, t) { + while (d.bitcount < 24) { + d.tag |= d.source[d.sourceIndex++] << d.bitcount; + d.bitcount += 8; + } + + var sum = 0, cur = 0, len = 0; + var tag = d.tag; + + /* get more bits while code value is above sum */ + do { + cur = 2 * cur + (tag & 1); + tag >>>= 1; + ++len; + + sum += t.table[len]; + cur -= t.table[len]; + } while (cur >= 0); + + d.tag = tag; + d.bitcount -= len; + + return t.trans[sum + cur]; +} + +/* given a data stream, decode dynamic trees from it */ +function tinf_decode_trees(d, lt, dt) { + var hlit, hdist, hclen; + var i, num, length; + + /* get 5 bits HLIT (257-286) */ + hlit = tinf_read_bits(d, 5, 257); + + /* get 5 bits HDIST (1-32) */ + hdist = tinf_read_bits(d, 5, 1); + + /* get 4 bits HCLEN (4-19) */ + hclen = tinf_read_bits(d, 4, 4); + + for (i = 0; i < 19; ++i) lengths[i] = 0; + + /* read code lengths for code length alphabet */ + for (i = 0; i < hclen; ++i) { + /* get 3 bits code length (0-7) */ + var clen = tinf_read_bits(d, 3, 0); + lengths[clcidx[i]] = clen; + } + + /* build code length tree */ + tinf_build_tree(code_tree, lengths, 0, 19); + + /* decode code lengths for the dynamic trees */ + for (num = 0; num < hlit + hdist;) { + var sym = tinf_decode_symbol(d, code_tree); + + switch (sym) { + case 16: + /* copy previous code length 3-6 times (read 2 bits) */ + var prev = lengths[num - 1]; + for (length = tinf_read_bits(d, 2, 3); length; --length) { + lengths[num++] = prev; + } + break; + case 17: + /* repeat code length 0 for 3-10 times (read 3 bits) */ + for (length = tinf_read_bits(d, 3, 3); length; --length) { + lengths[num++] = 0; + } + break; + case 18: + /* repeat code length 0 for 11-138 times (read 7 bits) */ + for (length = tinf_read_bits(d, 7, 11); length; --length) { + lengths[num++] = 0; + } + break; + default: + /* values 0-15 represent the actual code lengths */ + lengths[num++] = sym; + break; + } + } + + /* build dynamic trees */ + tinf_build_tree(lt, lengths, 0, hlit); + tinf_build_tree(dt, lengths, hlit, hdist); +} + +/* ----------------------------- * + * -- block inflate functions -- * + * ----------------------------- */ + +/* given a stream and two trees, inflate a block of data */ +function tinf_inflate_block_data(d, lt, dt) { + while (1) { + var sym = tinf_decode_symbol(d, lt); + + /* check for end of block */ + if (sym === 256) { + return TINF_OK; + } + + if (sym < 256) { + d.dest[d.destLen++] = sym; + } else { + var length, dist, offs; + var i; + + sym -= 257; + + /* possibly get more bits from length code */ + length = tinf_read_bits(d, length_bits[sym], length_base[sym]); + + dist = tinf_decode_symbol(d, dt); + + /* possibly get more bits from distance code */ + offs = d.destLen - tinf_read_bits(d, dist_bits[dist], dist_base[dist]); + + /* copy match */ + for (i = offs; i < offs + length; ++i) { + d.dest[d.destLen++] = d.dest[i]; + } + } + } +} + +/* inflate an uncompressed block of data */ +function tinf_inflate_uncompressed_block(d) { + var length, invlength; + var i; + + /* unread from bitbuffer */ + while (d.bitcount > 8) { + d.sourceIndex--; + d.bitcount -= 8; + } + + /* get length */ + length = d.source[d.sourceIndex + 1]; + length = 256 * length + d.source[d.sourceIndex]; + + /* get one's complement of length */ + invlength = d.source[d.sourceIndex + 3]; + invlength = 256 * invlength + d.source[d.sourceIndex + 2]; + + /* check length */ + if (length !== (~invlength & 0x0000ffff)) + return TINF_DATA_ERROR; + + d.sourceIndex += 4; + + /* copy block */ + for (i = length; i; --i) + d.dest[d.destLen++] = d.source[d.sourceIndex++]; + + /* make sure we start next block on a byte boundary */ + d.bitcount = 0; + + return TINF_OK; +} + +/* inflate stream from source to dest */ +function tinf_uncompress(source, dest) { + var d = new Data(source, dest); + var bfinal, btype, res; + + do { + /* read final block flag */ + bfinal = tinf_getbit(d); + + /* read block type (2 bits) */ + btype = tinf_read_bits(d, 2, 0); + + /* decompress block */ + switch (btype) { + case 0: + /* decompress uncompressed block */ + res = tinf_inflate_uncompressed_block(d); + break; + case 1: + /* decompress block with fixed huffman trees */ + res = tinf_inflate_block_data(d, sltree, sdtree); + break; + case 2: + /* decompress block with dynamic huffman trees */ + tinf_decode_trees(d, d.ltree, d.dtree); + res = tinf_inflate_block_data(d, d.ltree, d.dtree); + break; + default: + res = TINF_DATA_ERROR; + } + + if (res !== TINF_OK) + throw new Error('Data error'); + + } while (!bfinal); + + if (d.destLen < d.dest.length) { + if (typeof d.dest.slice === 'function') + return d.dest.slice(0, d.destLen); + else + return d.dest.subarray(0, d.destLen); + } + + return d.dest; +} + +/* -------------------- * + * -- initialization -- * + * -------------------- */ + +/* build fixed huffman trees */ +tinf_build_fixed_trees(sltree, sdtree); + +/* build extra bits and base tables */ +tinf_build_bits_base(length_bits, length_base, 4, 3); +tinf_build_bits_base(dist_bits, dist_base, 2, 1); + +/* fix a special case */ +length_bits[28] = 0; +length_base[28] = 258; + +module.exports = tinf_uncompress; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isString = __webpack_require__(0).isString; +var isArray = __webpack_require__(0).isArray; +var isUndefined = __webpack_require__(0).isUndefined; +var isNull = __webpack_require__(0).isNull; + +/** + * Creates an instance of StyleContextStack used for style inheritance and style overrides + * + * @constructor + * @this {StyleContextStack} + * @param {Object} named styles dictionary + * @param {Object} optional default style definition + */ +function StyleContextStack(styleDictionary, defaultStyle) { + this.defaultStyle = defaultStyle || {}; + this.styleDictionary = styleDictionary; + this.styleOverrides = []; +} + +/** + * Creates cloned version of current stack + * @return {StyleContextStack} current stack snapshot + */ +StyleContextStack.prototype.clone = function () { + var stack = new StyleContextStack(this.styleDictionary, this.defaultStyle); + + this.styleOverrides.forEach(function (item) { + stack.styleOverrides.push(item); + }); + + return stack; +}; + +/** + * Pushes style-name or style-overrides-object onto the stack for future evaluation + * + * @param {String|Object} styleNameOrOverride style-name (referring to styleDictionary) or + * a new dictionary defining overriding properties + */ +StyleContextStack.prototype.push = function (styleNameOrOverride) { + this.styleOverrides.push(styleNameOrOverride); +}; + +/** + * Removes last style-name or style-overrides-object from the stack + * + * @param {Number} howMany - optional number of elements to be popped (if not specified, + * one element will be removed from the stack) + */ +StyleContextStack.prototype.pop = function (howMany) { + howMany = howMany || 1; + + while (howMany-- > 0) { + this.styleOverrides.pop(); + } +}; + +/** + * Creates a set of named styles or/and a style-overrides-object based on the item, + * pushes those elements onto the stack for future evaluation and returns the number + * of elements pushed, so they can be easily poped then. + * + * @param {Object} item - an object with optional style property and/or style overrides + * @return the number of items pushed onto the stack + */ +StyleContextStack.prototype.autopush = function (item) { + if (isString(item)) { + return 0; + } + + var styleNames = []; + + if (item.style) { + if (isArray(item.style)) { + styleNames = item.style; + } else { + styleNames = [item.style]; + } + } + + for (var i = 0, l = styleNames.length; i < l; i++) { + this.push(styleNames[i]); + } + + var styleProperties = [ + 'font', + 'fontSize', + 'fontFeatures', + 'bold', + 'italics', + 'alignment', + 'color', + 'columnGap', + 'fillColor', + 'decoration', + 'decorationStyle', + 'decorationColor', + 'background', + 'lineHeight', + 'characterSpacing', + 'noWrap', + 'markerColor', + 'leadingIndent' + //'tableCellPadding' + // 'cellBorder', + // 'headerCellBorder', + // 'oddRowCellBorder', + // 'evenRowCellBorder', + // 'tableBorder' + ]; + var styleOverrideObject = {}; + var pushStyleOverrideObject = false; + + styleProperties.forEach(function (key) { + if (!isUndefined(item[key]) && !isNull(item[key])) { + styleOverrideObject[key] = item[key]; + pushStyleOverrideObject = true; + } + }); + + if (pushStyleOverrideObject) { + this.push(styleOverrideObject); + } + + return styleNames.length + (pushStyleOverrideObject ? 1 : 0); +}; + +/** + * Automatically pushes elements onto the stack, using autopush based on item, + * executes callback and then pops elements back. Returns value returned by callback + * + * @param {Object} item - an object with optional style property and/or style overrides + * @param {Function} function to be called between autopush and pop + * @return {Object} value returned by callback + */ +StyleContextStack.prototype.auto = function (item, callback) { + var pushedItems = this.autopush(item); + var result = callback(); + + if (pushedItems > 0) { + this.pop(pushedItems); + } + + return result; +}; + +/** + * Evaluates stack and returns value of a named property + * + * @param {String} property - property name + * @return property value or null if not found + */ +StyleContextStack.prototype.getProperty = function (property) { + if (this.styleOverrides) { + for (var i = this.styleOverrides.length - 1; i >= 0; i--) { + var item = this.styleOverrides[i]; + + if (isString(item)) { + // named-style-override + var style = this.styleDictionary[item]; + if (style && !isUndefined(style[property]) && !isNull(style[property])) { + return style[property]; + } + } else if (!isUndefined(item[property]) && !isNull(item[property])) { + // style-overrides-object + return item[property]; + } + } + } + + return this.defaultStyle && this.defaultStyle[property]; +}; + +module.exports = StyleContextStack; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var TraversalTracker = __webpack_require__(77); +var isString = __webpack_require__(0).isString; + +/** + * Creates an instance of DocumentContext - a store for current x, y positions and available width/height. + * It facilitates column divisions and vertical sync + */ +function DocumentContext(pageSize, pageMargins) { + this.pages = []; + + this.pageMargins = pageMargins; + + this.x = pageMargins.left; + this.availableWidth = pageSize.width - pageMargins.left - pageMargins.right; + this.availableHeight = 0; + this.page = -1; + + this.snapshots = []; + + this.endingCell = null; + + this.tracker = new TraversalTracker(); + + this.addPage(pageSize); + + this.hasBackground = false; +} + +DocumentContext.prototype.beginColumnGroup = function () { + this.snapshots.push({ + x: this.x, + y: this.y, + availableHeight: this.availableHeight, + availableWidth: this.availableWidth, + page: this.page, + bottomMost: { + x: this.x, + y: this.y, + availableHeight: this.availableHeight, + availableWidth: this.availableWidth, + page: this.page + }, + endingCell: this.endingCell, + lastColumnWidth: this.lastColumnWidth + }); + + this.lastColumnWidth = 0; +}; + +DocumentContext.prototype.beginColumn = function (width, offset, endingCell) { + var saved = this.snapshots[this.snapshots.length - 1]; + + this.calculateBottomMost(saved); + + this.endingCell = endingCell; + this.page = saved.page; + this.x = this.x + this.lastColumnWidth + (offset || 0); + this.y = saved.y; + this.availableWidth = width; //saved.availableWidth - offset; + this.availableHeight = saved.availableHeight; + + this.lastColumnWidth = width; +}; + +DocumentContext.prototype.calculateBottomMost = function (destContext) { + if (this.endingCell) { + this.saveContextInEndingCell(this.endingCell); + this.endingCell = null; + } else { + destContext.bottomMost = bottomMostContext(this, destContext.bottomMost); + } +}; + +DocumentContext.prototype.markEnding = function (endingCell) { + this.page = endingCell._columnEndingContext.page; + this.x = endingCell._columnEndingContext.x; + this.y = endingCell._columnEndingContext.y; + this.availableWidth = endingCell._columnEndingContext.availableWidth; + this.availableHeight = endingCell._columnEndingContext.availableHeight; + this.lastColumnWidth = endingCell._columnEndingContext.lastColumnWidth; +}; + +DocumentContext.prototype.saveContextInEndingCell = function (endingCell) { + endingCell._columnEndingContext = { + page: this.page, + x: this.x, + y: this.y, + availableHeight: this.availableHeight, + availableWidth: this.availableWidth, + lastColumnWidth: this.lastColumnWidth + }; +}; + +DocumentContext.prototype.completeColumnGroup = function (height) { + var saved = this.snapshots.pop(); + + this.calculateBottomMost(saved); + + this.endingCell = null; + this.x = saved.x; + + var y = saved.bottomMost.y; + if (height) { + if (saved.page === saved.bottomMost.page) { + if ((saved.y + height) > y) { + y = saved.y + height; + } + } else { + y += height; + } + } + + this.y = y; + this.page = saved.bottomMost.page; + this.availableWidth = saved.availableWidth; + this.availableHeight = saved.bottomMost.availableHeight; + if (height) { + this.availableHeight -= (y - saved.bottomMost.y); + } + this.lastColumnWidth = saved.lastColumnWidth; +}; + +DocumentContext.prototype.addMargin = function (left, right) { + this.x += left; + this.availableWidth -= left + (right || 0); +}; + +DocumentContext.prototype.moveDown = function (offset) { + this.y += offset; + this.availableHeight -= offset; + + return this.availableHeight > 0; +}; + +DocumentContext.prototype.initializePage = function () { + this.y = this.pageMargins.top; + this.availableHeight = this.getCurrentPage().pageSize.height - this.pageMargins.top - this.pageMargins.bottom; + this.pageSnapshot().availableWidth = this.getCurrentPage().pageSize.width - this.pageMargins.left - this.pageMargins.right; +}; + +DocumentContext.prototype.pageSnapshot = function () { + if (this.snapshots[0]) { + return this.snapshots[0]; + } else { + return this; + } +}; + +DocumentContext.prototype.moveTo = function (x, y) { + if (x !== undefined && x !== null) { + this.x = x; + this.availableWidth = this.getCurrentPage().pageSize.width - this.x - this.pageMargins.right; + } + if (y !== undefined && y !== null) { + this.y = y; + this.availableHeight = this.getCurrentPage().pageSize.height - this.y - this.pageMargins.bottom; + } +}; + +DocumentContext.prototype.beginDetachedBlock = function () { + this.snapshots.push({ + x: this.x, + y: this.y, + availableHeight: this.availableHeight, + availableWidth: this.availableWidth, + page: this.page, + endingCell: this.endingCell, + lastColumnWidth: this.lastColumnWidth + }); +}; + +DocumentContext.prototype.endDetachedBlock = function () { + var saved = this.snapshots.pop(); + + this.x = saved.x; + this.y = saved.y; + this.availableWidth = saved.availableWidth; + this.availableHeight = saved.availableHeight; + this.page = saved.page; + this.endingCell = saved.endingCell; + this.lastColumnWidth = saved.lastColumnWidth; +}; + +function pageOrientation(pageOrientationString, currentPageOrientation) { + if (pageOrientationString === undefined) { + return currentPageOrientation; + } else if (isString(pageOrientationString) && (pageOrientationString.toLowerCase() === 'landscape')) { + return 'landscape'; + } else { + return 'portrait'; + } +} + +var getPageSize = function (currentPage, newPageOrientation) { + + newPageOrientation = pageOrientation(newPageOrientation, currentPage.pageSize.orientation); + + if (newPageOrientation !== currentPage.pageSize.orientation) { + return { + orientation: newPageOrientation, + width: currentPage.pageSize.height, + height: currentPage.pageSize.width + }; + } else { + return { + orientation: currentPage.pageSize.orientation, + width: currentPage.pageSize.width, + height: currentPage.pageSize.height + }; + } + +}; + + +DocumentContext.prototype.moveToNextPage = function (pageOrientation) { + var nextPageIndex = this.page + 1; + + var prevPage = this.page; + var prevY = this.y; + + var createNewPage = nextPageIndex >= this.pages.length; + if (createNewPage) { + var currentAvailableWidth = this.availableWidth; + var currentPageOrientation = this.getCurrentPage().pageSize.orientation; + + var pageSize = getPageSize(this.getCurrentPage(), pageOrientation); + this.addPage(pageSize); + + if (currentPageOrientation === pageSize.orientation) { + this.availableWidth = currentAvailableWidth; + } + } else { + this.page = nextPageIndex; + this.initializePage(); + } + + return { + newPageCreated: createNewPage, + prevPage: prevPage, + prevY: prevY, + y: this.y + }; +}; + + +DocumentContext.prototype.addPage = function (pageSize) { + var page = {items: [], pageSize: pageSize}; + this.pages.push(page); + this.page = this.pages.length - 1; + this.initializePage(); + + this.tracker.emit('pageAdded'); + + return page; +}; + +DocumentContext.prototype.getCurrentPage = function () { + if (this.page < 0 || this.page >= this.pages.length) { + return null; + } + + return this.pages[this.page]; +}; + +DocumentContext.prototype.getCurrentPosition = function () { + var pageSize = this.getCurrentPage().pageSize; + var innerHeight = pageSize.height - this.pageMargins.top - this.pageMargins.bottom; + var innerWidth = pageSize.width - this.pageMargins.left - this.pageMargins.right; + + return { + pageNumber: this.page + 1, + pageOrientation: pageSize.orientation, + pageInnerHeight: innerHeight, + pageInnerWidth: innerWidth, + left: this.x, + top: this.y, + verticalRatio: ((this.y - this.pageMargins.top) / innerHeight), + horizontalRatio: ((this.x - this.pageMargins.left) / innerWidth) + }; +}; + +function bottomMostContext(c1, c2) { + var r; + + if (c1.page > c2.page) { + r = c1; + } else if (c2.page > c1.page) { + r = c2; + } else { + r = (c1.y > c2.y) ? c1 : c2; + } + + return { + page: r.page, + x: r.x, + y: r.y, + availableHeight: r.availableHeight, + availableWidth: r.availableWidth + }; +} + +module.exports = DocumentContext; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates an instance of Line + * + * @constructor + * @this {Line} + * @param {Number} Maximum width this line can have + */ +function Line(maxWidth) { + this.maxWidth = maxWidth; + this.leadingCut = 0; + this.trailingCut = 0; + this.inlineWidths = 0; + this.inlines = []; +} + +Line.prototype.getAscenderHeight = function () { + var y = 0; + + this.inlines.forEach(function (inline) { + y = Math.max(y, inline.font.ascender / 1000 * inline.fontSize); + }); + return y; +}; + +Line.prototype.hasEnoughSpaceForInline = function (inline) { + if (this.inlines.length === 0) { + return true; + } + if (this.newLineForced) { + return false; + } + + return this.inlineWidths + inline.width - this.leadingCut - (inline.trailingCut || 0) <= this.maxWidth; +}; + +Line.prototype.addInline = function (inline) { + if (this.inlines.length === 0) { + this.leadingCut = inline.leadingCut || 0; + } + this.trailingCut = inline.trailingCut || 0; + + inline.x = this.inlineWidths - this.leadingCut; + + this.inlines.push(inline); + this.inlineWidths += inline.width; + + if (inline.lineEnd) { + this.newLineForced = true; + } +}; + +Line.prototype.getWidth = function () { + return this.inlineWidths - this.leadingCut - this.trailingCut; +}; + +/** + * Returns line height + * @return {Number} + */ +Line.prototype.getHeight = function () { + var max = 0; + + this.inlines.forEach(function (item) { + max = Math.max(max, item.height || 0); + }); + + return max; +}; + +module.exports = Line; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global, process) {// 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. + + + +/**/ + +var processNextTick = __webpack_require__(32).nextTick; +/**/ + +module.exports = Readable; + +/**/ +var isArray = __webpack_require__(76); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = __webpack_require__(31).EventEmitter; + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = __webpack_require__(84); +/**/ + +/**/ + +var Buffer = __webpack_require__(33).Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/**/ + +/**/ +var util = __webpack_require__(25); +util.inherits = __webpack_require__(21); +/**/ + +/**/ +var debugUtil = __webpack_require__(139); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = __webpack_require__(140); +var destroyImpl = __webpack_require__(85); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} + +function ReadableState(options, stream) { + Duplex = Duplex || __webpack_require__(16); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = __webpack_require__(47).StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || __webpack_require__(16); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; + } + + Stream.call(this); +} + +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + } +}); + +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; + +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } + } + + return needMoreData(state); +} + +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state); +} + +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = __webpack_require__(47).StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; + + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); + } + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } + + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; + } + + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; + + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; + + var state = this._readableState; + var paused = false; + + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + + _this.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var 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) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var 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) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7), __webpack_require__(11))) + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(31).EventEmitter; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/**/ + +var processNextTick = __webpack_require__(32).nextTick; +/**/ + +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; + + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + processNextTick(emitErrorNT, this, err); + } + return this; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + processNextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); + } + }); + + return this; +} + +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } +} + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy +}; + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"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. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + + + +module.exports = Transform; + +var Duplex = __webpack_require__(16); + +/**/ +var util = __webpack_require__(25); +util.inherits = __webpack_require__(21); +/**/ + +util.inherits(Transform, Duplex); + +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } + + ts.writechunk = null; + ts.writecb = null; + + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); + + cb(er); + + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); +} + +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; + + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.12.6 + +/* +PDFReference - represents a reference to another object in the PDF object heirarchy +By Devon Govett + */ + +(function() { + var PDFObject, PDFReference, stream, zlib, + bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + zlib = __webpack_require__(48); + + stream = __webpack_require__(15); + + PDFReference = (function(superClass) { + extend(PDFReference, superClass); + + function PDFReference(document, id, data) { + this.document = document; + this.id = id; + this.data = data != null ? data : {}; + this.finalize = bind(this.finalize, this); + PDFReference.__super__.constructor.call(this, { + decodeStrings: false + }); + this.gen = 0; + this.deflate = null; + this.compress = this.document.compress && !this.data.Filter; + this.uncompressedLength = 0; + this.chunks = []; + } + + PDFReference.prototype.initDeflate = function() { + this.data.Filter = 'FlateDecode'; + this.deflate = zlib.createDeflate(); + this.deflate.on('data', (function(_this) { + return function(chunk) { + _this.chunks.push(chunk); + return _this.data.Length += chunk.length; + }; + })(this)); + return this.deflate.on('end', this.finalize); + }; + + PDFReference.prototype._write = function(chunk, encoding, callback) { + var base; + if (!Buffer.isBuffer(chunk)) { + chunk = new Buffer(chunk + '\n', 'binary'); + } + this.uncompressedLength += chunk.length; + if ((base = this.data).Length == null) { + base.Length = 0; + } + if (this.compress) { + if (!this.deflate) { + this.initDeflate(); + } + this.deflate.write(chunk); + } else { + this.chunks.push(chunk); + this.data.Length += chunk.length; + } + return callback(); + }; + + PDFReference.prototype.end = function(chunk) { + PDFReference.__super__.end.apply(this, arguments); + if (this.deflate) { + return this.deflate.end(); + } else { + return this.finalize(); + } + }; + + PDFReference.prototype.finalize = function() { + var chunk, i, len, ref; + this.offset = this.document._offset; + this.document._write(this.id + " " + this.gen + " obj"); + this.document._write(PDFObject.convert(this.data)); + if (this.chunks.length) { + this.document._write('stream'); + ref = this.chunks; + for (i = 0, len = ref.length; i < len; i++) { + chunk = ref[i]; + this.document._write(chunk); + } + this.chunks.length = 0; + this.document._write('\nendstream'); + } + this.document._write('endobj'); + return this.document._refEnd(this); + }; + + PDFReference.prototype.toString = function() { + return this.id + " " + this.gen + " R"; + }; + + return PDFReference; + + })(stream.Writable); + + module.exports = PDFReference; + + PDFObject = __webpack_require__(26); + +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +// compare and isBuffer 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; + } + + var x = a.length; + var y = b.length; + + for (var 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; +} +function isBuffer(b) { + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { + return global.Buffer.isBuffer(b); + } + return !!(b != null && b._isBuffer); +} + +// based on node assert, original notice: + +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// 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. + +var util = __webpack_require__(49); +var hasOwn = Object.prototype.hasOwnProperty; +var pSlice = Array.prototype.slice; +var functionsHaveNames = (function () { + return function foo() {}.name === 'foo'; +}()); +function pToString (obj) { + return Object.prototype.toString.call(obj); +} +function isView(arrbuf) { + if (isBuffer(arrbuf)) { + return false; + } + if (typeof global.ArrayBuffer !== 'function') { + return false; + } + if (typeof ArrayBuffer.isView === 'function') { + return ArrayBuffer.isView(arrbuf); + } + if (!arrbuf) { + return false; + } + if (arrbuf instanceof DataView) { + return true; + } + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { + return true; + } + return false; +} +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +var regex = /\s*function\s+([^\(\s]*)\s*/; +// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js +function getName(func) { + if (!util.isFunction(func)) { + return; + } + if (functionsHaveNames) { + return func.name; + } + var str = func.toString(); + var match = str.match(regex); + return match && match[1]; +} +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = getName(stackStartFunction); + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function truncate(s, n) { + if (typeof s === 'string') { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} +function inspect(something) { + if (functionsHaveNames || !util.isFunction(something)) { + return util.inspect(something); + } + var rawname = getName(something); + var name = rawname ? ': ' + rawname : ''; + return '[Function' + name + ']'; +} +function getMessage(self) { + return truncate(inspect(self.actual), 128) + ' ' + + self.operator + ' ' + + truncate(inspect(self.expected), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. 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 fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; + +function _deepEqual(actual, expected, strict, memos) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if (isBuffer(actual) && isBuffer(expected)) { + return compare(actual, expected) === 0; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if ((actual === null || typeof actual !== 'object') && + (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; + + // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (isView(actual) && isView(expected) && + pToString(actual) === pToString(expected) && + !(actual instanceof Float32Array || + actual instanceof Float64Array)) { + return compare(new Uint8Array(actual.buffer), + new Uint8Array(expected.buffer)) === 0; + + // 7.5 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. + } else if (isBuffer(actual) !== isBuffer(expected)) { + return false; + } else { + memos = memos || {actual: [], expected: []}; + + var actualIndex = memos.actual.indexOf(actual); + if (actualIndex !== -1) { + if (actualIndex === memos.expected.indexOf(expected)) { + return true; + } + } + + memos.actual.push(actual); + memos.expected.push(expected); + + return objEquiv(actual, expected, strict, memos); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b, strict, actualVisitedObjects) { + if (a === null || a === undefined || b === null || b === undefined) + return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) + return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) + return false; + var aIsArgs = isArguments(a); + var bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b, strict); + } + var ka = objectKeys(a); + var kb = objectKeys(b); + var key, i; + // 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], strict, actualVisitedObjects)) + return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +assert.notDeepStrictEqual = notDeepStrictEqual; +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + } +} + + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } + + try { + if (actual instanceof expected) { + return true; + } + } catch (e) { + // Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; +} + +function _tryBlock(block) { + var error; + try { + block(); + } catch (e) { + error = e; + } + return error; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (typeof block !== 'function') { + throw new TypeError('"block" argument must be a function'); + } + + if (typeof expected === 'string') { + message = expected; + expected = null; + } + + actual = _tryBlock(block); + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + var userProvidedMessage = typeof message === 'string'; + var isUnwantedException = !shouldThrow && util.isError(actual); + var isUnexpectedException = !shouldThrow && actual && !expected; + + if ((isUnwantedException && + userProvidedMessage && + expectedException(actual, expected)) || + isUnexpectedException) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws(true, block, error, message); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { + _throws(false, block, error, message); +}; + +assert.ifError = function(err) { if (err) throw err; }; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"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) { + var s1 = (adler & 0xffff) |0, + s2 = ((adler >>> 16) & 0xffff) |0, + 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; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"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() { + var c, table = []; + + for (var n = 0; n < 256; n++) { + c = n; + for (var 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. +var crcTable = makeTable(); + + +function crc32(crc, buf, len, pos) { + var t = crcTable, + end = pos + len; + + crc ^= -1; + + for (var i = pos; i < end; i++) { + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF]; + } + + return (crc ^ (-1)); // >>> 0; +} + + +module.exports = crc32; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports) { + +module.exports = [["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc",""],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93]] + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +module.exports = [["0","\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]] + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var ArrayT, NumberT, utils; + + NumberT = __webpack_require__(22).Number; + + utils = __webpack_require__(12); + + ArrayT = (function() { + function ArrayT(type, length, lengthType) { + this.type = type; + this.length = length; + this.lengthType = lengthType != null ? lengthType : 'count'; + } + + ArrayT.prototype.decode = function(stream, parent) { + var ctx, i, length, pos, res, target, _i; + pos = stream.pos; + res = []; + ctx = parent; + if (this.length != null) { + length = utils.resolveLength(this.length, stream, parent); + } + if (this.length instanceof NumberT) { + 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') { + target = length != null ? stream.pos + length : (parent != null ? parent._length : void 0) ? parent._startOffset + parent._length : stream.length; + while (stream.pos < target) { + res.push(this.type.decode(stream, ctx)); + } + } else { + for (i = _i = 0; _i < length; i = _i += 1) { + res.push(this.type.decode(stream, ctx)); + } + } + return res; + }; + + ArrayT.prototype.size = function(array, ctx) { + var item, size, _i, _len; + if (!array) { + return this.type.size(null, ctx) * utils.resolveLength(this.length, null, ctx); + } + size = 0; + if (this.length instanceof NumberT) { + size += this.length.size(); + ctx = { + parent: ctx + }; + } + for (_i = 0, _len = array.length; _i < _len; _i++) { + item = array[_i]; + size += this.type.size(item, ctx); + } + return size; + }; + + ArrayT.prototype.encode = function(stream, array, parent) { + var ctx, i, item, ptr, _i, _len; + ctx = parent; + if (this.length instanceof NumberT) { + ctx = { + pointers: [], + startOffset: stream.pos, + parent: parent + }; + ctx.pointerOffset = stream.pos + this.size(array, ctx); + this.length.encode(stream, array.length); + } + for (_i = 0, _len = array.length; _i < _len; _i++) { + item = array[_i]; + this.type.encode(stream, item, ctx); + } + if (this.length instanceof NumberT) { + i = 0; + while (i < ctx.pointers.length) { + ptr = ctx.pointers[i++]; + ptr.type.encode(stream, ptr.val); + } + } + }; + + return ArrayT; + + })(); + + module.exports = ArrayT; + +}).call(this); + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var Struct, utils; + + utils = __webpack_require__(12); + + Struct = (function() { + function Struct(fields) { + this.fields = fields != null ? fields : {}; + } + + Struct.prototype.decode = function(stream, parent, length) { + var res, _ref; + if (length == null) { + length = 0; + } + res = this._setup(stream, parent, length); + this._parseFields(stream, res, this.fields); + if ((_ref = this.process) != null) { + _ref.call(res, stream); + } + return res; + }; + + Struct.prototype._setup = function(stream, parent, length) { + var res; + res = {}; + Object.defineProperties(res, { + parent: { + value: parent + }, + _startOffset: { + value: stream.pos + }, + _currentOffset: { + value: 0, + writable: true + }, + _length: { + value: length + } + }); + return res; + }; + + Struct.prototype._parseFields = function(stream, res, fields) { + var key, type, val; + for (key in fields) { + type = fields[key]; + if (typeof type === 'function') { + val = type.call(res, res); + } else { + val = type.decode(stream, res); + } + if (val !== void 0) { + if (val instanceof utils.PropertyDescriptor) { + Object.defineProperty(res, key, val); + } else { + res[key] = val; + } + } + res._currentOffset = stream.pos - res._startOffset; + } + }; + + Struct.prototype.size = function(val, parent, includePointers) { + var ctx, key, size, type, _ref; + if (val == null) { + val = {}; + } + if (includePointers == null) { + includePointers = true; + } + ctx = { + parent: parent, + val: val, + pointerSize: 0 + }; + size = 0; + _ref = this.fields; + for (key in _ref) { + type = _ref[key]; + if (type.size != null) { + size += type.size(val[key], ctx); + } + } + if (includePointers) { + size += ctx.pointerSize; + } + return size; + }; + + Struct.prototype.encode = function(stream, val, parent) { + var ctx, i, key, ptr, type, _ref, _ref1; + if ((_ref = this.preEncode) != null) { + _ref.call(val, stream); + } + ctx = { + pointers: [], + startOffset: stream.pos, + parent: parent, + val: val, + pointerSize: 0 + }; + ctx.pointerOffset = stream.pos + this.size(val, ctx, false); + _ref1 = this.fields; + for (key in _ref1) { + type = _ref1[key]; + if (type.encode != null) { + type.encode(stream, val[key], ctx); + } + } + i = 0; + while (i < ctx.pointers.length) { + ptr = ctx.pointers[i++]; + ptr.type.encode(stream, ptr.val, ptr.parent); + } + }; + + return Struct; + + })(); + + module.exports = Struct; + +}).call(this); + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(5) && !__webpack_require__(19)(function () { + return Object.defineProperty(__webpack_require__(96)('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(9); +var document = __webpack_require__(10).document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(13); + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(6); +var anObject = __webpack_require__(14); +var getKeys = __webpack_require__(29); + +module.exports = __webpack_require__(5) ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(18); +var toIObject = __webpack_require__(17); +var arrayIndexOf = __webpack_require__(204)(false); +var IE_PROTO = __webpack_require__(64)('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(63); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { "default": __webpack_require__(215), __esModule: true }; + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(55); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(101); +var hiddenKeys = __webpack_require__(66).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +var _defineProperty = __webpack_require__(74); + +var _defineProperty2 = _interopRequireDefault(_defineProperty); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + (0, _defineProperty2.default)(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(6).f; +var create = __webpack_require__(36); +var redefineAll = __webpack_require__(109); +var ctx = __webpack_require__(20); +var anInstance = __webpack_require__(110); +var forOf = __webpack_require__(41); +var $iterDefine = __webpack_require__(61); +var step = __webpack_require__(98); +var setSpecies = __webpack_require__(228); +var DESCRIPTORS = __webpack_require__(5); +var fastKey = __webpack_require__(40).fastKey; +var validate = __webpack_require__(75); +var SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = validate(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + validate(this, NAME); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(validate(this, NAME), key); + } + }); + if (DESCRIPTORS) dP(C.prototype, 'size', { + get: function () { + return validate(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function (iterated, kind) { + this._t = validate(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if (kind == 'keys') return step(0, entry.k); + if (kind == 'values') return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +var hide = __webpack_require__(13); +module.exports = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key]; + else hide(target, key, src[key]); + } return target; +}; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports) { + +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(14); +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(23); +var ITERATOR = __webpack_require__(4)('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(10); +var $export = __webpack_require__(3); +var meta = __webpack_require__(40); +var fails = __webpack_require__(19); +var hide = __webpack_require__(13); +var redefineAll = __webpack_require__(109); +var forOf = __webpack_require__(41); +var anInstance = __webpack_require__(110); +var isObject = __webpack_require__(9); +var setToStringTag = __webpack_require__(39); +var dP = __webpack_require__(6).f; +var each = __webpack_require__(229)(0); +var DESCRIPTORS = __webpack_require__(5); + +module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME, '_c'); + target._c = new Base(); + if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); + }); + each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { + var IS_ADDER = KEY == 'add' || KEY == 'set'; + if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { + anInstance(this, C, KEY); + if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; + var result = this._c[KEY](a === 0 ? 0 : a, b); + return IS_ADDER ? this : result; + }); + }); + IS_WEAK || dP(C.prototype, 'size', { + get: function () { + return this._c.size; + } + }); + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F, O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(68); +var from = __webpack_require__(233); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(3); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = new Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); +}; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(3); +var aFunction = __webpack_require__(97); +var ctx = __webpack_require__(20); +var forOf = __webpack_require__(41); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + aFunction(this); + mapping = mapFn !== undefined; + if (mapping) aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = ctx(mapFn, arguments[2], 2); + forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + forOf(source, false, A.push, A); + } + return new this(A); + } }); +}; + + +/***/ }), +/* 117 */ +/***/ (function(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. +*/ + +var BrotliInput = __webpack_require__(118).BrotliInput; +var BrotliOutput = __webpack_require__(118).BrotliOutput; +var BrotliBitReader = __webpack_require__(285); +var BrotliDictionary = __webpack_require__(119); +var HuffmanCode = __webpack_require__(120).HuffmanCode; +var BrotliBuildHuffmanTable = __webpack_require__(120).BrotliBuildHuffmanTable; +var Context = __webpack_require__(289); +var Prefix = __webpack_require__(290); +var Transform = __webpack_require__(291); + +var kDefaultCodeLength = 8; +var kCodeLengthRepeatCode = 16; +var kNumLiteralCodes = 256; +var kNumInsertAndCopyCodes = 704; +var kNumBlockLengthCodes = 26; +var kLiteralContextBits = 6; +var kDistanceContextBits = 2; + +var HUFFMAN_TABLE_BITS = 8; +var HUFFMAN_TABLE_MASK = 0xff; +/* Maximum possible Huffman table size for an alphabet size of 704, max code + * length 15 and root table bits 8. */ +var HUFFMAN_MAX_TABLE_SIZE = 1080; + +var CODE_LENGTH_CODES = 18; +var kCodeLengthCodeOrder = new Uint8Array([ + 1, 2, 3, 4, 0, 5, 17, 6, 16, 7, 8, 9, 10, 11, 12, 13, 14, 15, +]); + +var NUM_DISTANCE_SHORT_CODES = 16; +var kDistanceShortCodeIndexOffset = new Uint8Array([ + 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 +]); + +var kDistanceShortCodeValueOffset = new Int8Array([ + 0, 0, 0, 0, -1, 1, -2, 2, -3, 3, -1, 1, -2, 2, -3, 3 +]); + +var 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) { + var 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)) { + var 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) { + var out = new MetaBlockLength; + var size_nibbles; + var size_bytes; + var 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++) { + var 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) { + var 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) { + var start_index = index; + + var 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) { + var symbol = 0; + var prev_code_len = kDefaultCodeLength; + var repeat = 0; + var repeat_code_len = 0; + var space = 32768; + + var table = []; + for (var 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) { + var 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 { + var extra_bits = code_len - 14; + var old_repeat; + var repeat_delta; + var 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 (var 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) { + var table_size = 0; + var simple_code_or_skip; + var 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; + var max_bits_counter = alphabet_size - 1; + var max_bits = 0; + var symbols = new Int32Array(4); + var 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; + var code_length_code_lengths = new Uint8Array(CODE_LENGTH_CODES); + var space = 32; + var num_codes = 0; + /* Static Huffman code for the code length code lengths */ + var 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) { + var code_len_idx = kCodeLengthCodeOrder[i]; + var 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) { + var code; + var nbits; + code = ReadSymbol(table, index, br); + nbits = Prefix.kBlockLengthPrefixCode[code].nbits; + return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits); +} + +function TranslateShortCodes(code, ringbuffer, index) { + var 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) { + var value = v[index]; + var i = index; + for (; i; --i) v[i] = v[i - 1]; + v[0] = value; +} + +function InverseMoveToFrontTransform(v, v_len) { + var mtf = new Uint8Array(256); + var i; + for (i = 0; i < 256; ++i) { + mtf[i] = i; + } + for (i = 0; i < v_len; ++i) { + var 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) { + var i; + var table_size; + var 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) { + var out = { num_htrees: null, context_map: null }; + var use_rle_for_zeros; + var max_run_length_prefix = 0; + var table; + var i; + + br.readMoreInput(); + var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1; + + var 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) { + var 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) { + var ringbuffer = tree_type * 2; + var index = tree_type; + var type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br); + var 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) { + var rb_size = ringbuffer_mask + 1; + var rb_pos = pos & ringbuffer_mask; + var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK; + var 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) { + var 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) { + var new_bit_pos = (br.bit_pos_ + 7) & ~7; + var pad_bits = br.readBits(new_bit_pos - br.bit_pos_); + return pad_bits == 0; +} + +function BrotliDecompressedSize(buffer) { + var input = new BrotliInput(buffer); + var br = new BrotliBitReader(input); + DecodeWindowBits(br); + var out = DecodeMetaBlockLength(br); + return out.meta_block_length; +} + +exports.BrotliDecompressedSize = BrotliDecompressedSize; + +function BrotliDecompressBuffer(buffer, output_size) { + var input = new BrotliInput(buffer); + + if (output_size == null) { + output_size = BrotliDecompressedSize(buffer); + } + + var output_buffer = new Uint8Array(output_size); + var 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) { + var i; + var pos = 0; + var input_end = 0; + var window_bits = 0; + var max_backward_distance; + var max_distance = 0; + var ringbuffer_size; + var ringbuffer_mask; + var ringbuffer; + var ringbuffer_end; + /* This ring buffer holds a few past copy distances that will be used by */ + /* some special distance codes. */ + var dist_rb = [ 16, 15, 11, 4 ]; + var dist_rb_idx = 0; + /* The previous 2 bytes used for context. */ + var prev_byte1 = 0; + var prev_byte2 = 0; + var hgroup = [new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0), new HuffmanTreeGroup(0, 0)]; + var block_type_trees; + var block_len_trees; + var 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 */ + var 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 (var 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) { + var meta_block_remaining_len = 0; + var is_uncompressed; + var block_length = [ 1 << 28, 1 << 28, 1 << 28 ]; + var block_type = [ 0 ]; + var num_block_types = [ 1, 1, 1 ]; + var block_type_rb = [ 0, 1, 0, 1, 0, 1 ]; + var block_type_rb_index = [ 0 ]; + var distance_postfix_bits; + var num_direct_distance_codes; + var distance_postfix_mask; + var num_distance_codes; + var context_map = null; + var context_modes = null; + var num_literal_htrees; + var dist_context_map = null; + var num_dist_htrees; + var context_offset = 0; + var context_map_slice = null; + var literal_htree_index = 0; + var dist_context_offset = 0; + var dist_context_map_slice = null; + var dist_htree_index = 0; + var context_lookup_offset1 = 0; + var 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(); + + var _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. */ + var 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); + } + + var _o1 = DecodeContextMap(num_block_types[0] << kLiteralContextBits, br); + num_literal_htrees = _o1.num_htrees; + context_map = _o1.context_map; + + var _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]; + var word_id = distance - max_distance - 1; + var shift = BrotliDictionary.sizeBitsByLength[copy_length]; + var mask = (1 << shift) - 1; + var word_idx = word_id & mask; + var transform_idx = word_id >> shift; + offset += word_idx * copy_length; + if (transform_idx < Transform.kNumTransforms) { + var 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 (var _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); +} + +exports.BrotliDecompress = BrotliDecompress; + +BrotliDictionary.init(); + + +/***/ }), +/* 118 */ +/***/ (function(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 (var p = 0; p < count; p++) + buf[i + p] = this.buffer[this.pos + p]; + + this.pos += count; + return count; +} + +exports.BrotliInput = 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.BrotliOutput = BrotliOutput; + + +/***/ }), +/* 119 */ +/***/ (function(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. +*/ + +var data = __webpack_require__(286); +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; + + +/***/ }), +/* 120 */ +/***/ (function(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.HuffmanCode = HuffmanCode; + +var 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) { + var 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) { + var left = 1 << (len - root_bits); + while (len < MAX_LENGTH) { + left -= count[len]; + if (left <= 0) break; + ++len; + left <<= 1; + } + return len - root_bits; +} + +exports.BrotliBuildHuffmanTable = function(root_table, table, root_bits, code_lengths, code_lengths_size) { + var start_table = table; + var code; /* current table entry */ + var len; /* current code length */ + var symbol; /* symbol index in original or sorted table */ + var key; /* reversed prefix code */ + var step; /* step size to replicate values in current table */ + var low; /* low bits for current root entry */ + var mask; /* mask for low bits */ + var table_bits; /* key length of current table */ + var table_size; /* size of current table */ + var total_size; /* sum of root table size and 2nd level table sizes */ + var sorted; /* symbols sorted by code length */ + var count = new Int32Array(MAX_LENGTH + 1); /* number of codes of each length */ + var 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; +} + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.12.6 + +/* +PDFImage - embeds images in PDF documents +By Devon Govett + */ + +(function() { + var Data, JPEG, PDFImage, PNG, fs; + + fs = __webpack_require__(8); + + Data = __webpack_require__(298); + + JPEG = __webpack_require__(299); + + PNG = __webpack_require__(300); + + PDFImage = (function() { + function PDFImage() {} + + PDFImage.open = function(src, label) { + var data, match; + if (Buffer.isBuffer(src)) { + data = src; + } else if (src instanceof ArrayBuffer) { + data = new Buffer(new Uint8Array(src)); + } else { + if (match = /^data:.+;base64,(.*)$/.exec(src)) { + data = new Buffer(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 PNG(data, label); + } else { + throw new Error('Unknown image format.'); + } + }; + + return PDFImage; + + })(); + + module.exports = PDFImage; + +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {module.exports = global["pdfMake"] = __webpack_require__(123); +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Buffer, global) { + +var PdfPrinter = __webpack_require__(126); +var isFunction = __webpack_require__(0).isFunction; +var FileSaver = __webpack_require__(306); +var saveAs = FileSaver.saveAs; + +var defaultClientFonts = { + Roboto: { + normal: 'Roboto-Regular.ttf', + bold: 'Roboto-Medium.ttf', + italics: 'Roboto-Italic.ttf', + bolditalics: 'Roboto-MediumItalic.ttf' + } +}; + +function Document(docDefinition, tableLayouts, fonts, vfs) { + this.docDefinition = docDefinition; + this.tableLayouts = tableLayouts || null; + this.fonts = fonts || defaultClientFonts; + this.vfs = vfs; +} + +function canCreatePdf() { + // Ensure the browser provides the level of support needed + if (!Object.keys) { + return false; + } + return true; +} + +Document.prototype._createDoc = function (options, callback) { + options = options || {}; + if (this.tableLayouts) { + options.tableLayouts = this.tableLayouts; + } + + var printer = new PdfPrinter(this.fonts); + __webpack_require__(8).bindFS(this.vfs); // bind virtual file system to file system + + var doc = printer.createPdfKitDocument(this.docDefinition, options); + var chunks = []; + var result; + + doc.on('readable', function () { + var chunk; + while ((chunk = doc.read(9007199254740991)) !== null) { + chunks.push(chunk); + } + }); + doc.on('end', function () { + result = Buffer.concat(chunks); + callback(result, doc._pdfMakePages); + }); + doc.end(); +}; + +Document.prototype._getPages = function (options, cb) { + if (!cb) { + throw '_getPages is an async method and needs a callback argument'; + } + this._createDoc(options, function (ignoreBuffer, pages) { + cb(pages); + }); +}; + +Document.prototype._bufferToBlob = function (buffer) { + var blob; + try { + blob = new Blob([buffer], {type: 'application/pdf'}); + } catch (e) { + // Old browser which can't handle it without making it an byte array (ie10) + if (e.name === 'InvalidStateError') { + var byteArray = new Uint8Array(buffer); + blob = new Blob([byteArray.buffer], {type: 'application/pdf'}); + } + } + + if (!blob) { + throw 'Could not generate blob'; + } + + return blob; +}; + +Document.prototype._openWindow = function () { + // we have to open the window immediately and store the reference + // otherwise popup blockers will stop us + var win = window.open('', '_blank'); + if (win === null) { + throw 'Open PDF in new window blocked by browser'; + } + + return win; +}; + +Document.prototype._openPdf = function (options, win) { + if (!win) { + win = this._openWindow(); + } + try { + this.getBlob(function (result) { + var urlCreator = window.URL || window.webkitURL; + var pdfUrl = urlCreator.createObjectURL(result); + win.location.href = pdfUrl; + }, options); + } catch (e) { + win.close(); + throw e; + } +}; + +Document.prototype.open = function (options, win) { + options = options || {}; + options.autoPrint = false; + win = win || null; + + this._openPdf(options, win); +}; + + +Document.prototype.print = function (options, win) { + options = options || {}; + options.autoPrint = true; + win = win || null; + + this._openPdf(options, win); +}; + +Document.prototype.download = function (defaultFileName, cb, options) { + if (isFunction(defaultFileName)) { + cb = defaultFileName; + defaultFileName = null; + } + + defaultFileName = defaultFileName || 'file.pdf'; + this.getBlob(function (result) { + saveAs(result, defaultFileName); + + if (isFunction(cb)) { + cb(); + } + }, options); +}; + +Document.prototype.getBase64 = function (cb, options) { + if (!cb) { + throw 'getBase64 is an async method and needs a callback argument'; + } + this.getBuffer(function (buffer) { + cb(buffer.toString('base64')); + }, options); +}; + +Document.prototype.getDataUrl = function (cb, options) { + if (!cb) { + throw 'getDataUrl is an async method and needs a callback argument'; + } + this.getBuffer(function (buffer) { + cb('data:application/pdf;base64,' + buffer.toString('base64')); + }, options); +}; + +Document.prototype.getBlob = function (cb, options) { + if (!cb) { + throw 'getBlob is an async method and needs a callback argument'; + } + var that = this; + this.getBuffer(function (result) { + var blob = that._bufferToBlob(result); + cb(blob); + }, options); +}; + +Document.prototype.getBuffer = function (cb, options) { + if (!cb) { + throw 'getBuffer is an async method and needs a callback argument'; + } + this._createDoc(options, function (buffer) { + cb(buffer); + }); +}; + +module.exports = { + createPdf: function (docDefinition) { + if (!canCreatePdf()) { + throw 'Your browser does not provide the level of support needed'; + } + return new Document(docDefinition, global.pdfMake.tableLayouts, global.pdfMake.fonts, global.pdfMake.vfs); + } +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer, __webpack_require__(7))) + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var 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 placeHoldersCount (b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} + +function byteLength (b64) { + // base64 is 4/3 + up to two characters of the original data + return (b64.length * 3 / 4) - placeHoldersCount(b64) +} + +function toByteArray (b64) { + var i, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + + arr = new Arr((len * 3 / 4) - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0; i < l; 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[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = 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) { + var tmp + var output = [] + for (var 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) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var 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] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') +} + + +/***/ }), +/* 125 */ +/***/ (function(module, exports) { + +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var 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) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var 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 +} + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*eslint no-unused-vars: ["error", {"args": "none"}]*/ + + +var FontProvider = __webpack_require__(127); +var LayoutBuilder = __webpack_require__(128); +var PdfKit = __webpack_require__(138); +var sizes = __webpack_require__(303); +var ImageMeasure = __webpack_require__(304); +var textDecorator = __webpack_require__(305); +var TextTools = __webpack_require__(42); +var isFunction = __webpack_require__(0).isFunction; +var isString = __webpack_require__(0).isString; +var isNumber = __webpack_require__(0).isNumber; +var isBoolean = __webpack_require__(0).isBoolean; +var isArray = __webpack_require__(0).isArray; + +//////////////////////////////////////// +// PdfPrinter + +/** + * @class Creates an instance of a PdfPrinter which turns document definition into a pdf + * + * @param {Object} fontDescriptors font definition dictionary + * + * @example + * var fontDescriptors = { + * Roboto: { + * normal: 'fonts/Roboto-Regular.ttf', + * bold: 'fonts/Roboto-Medium.ttf', + * italics: 'fonts/Roboto-Italic.ttf', + * bolditalics: 'fonts/Roboto-MediumItalic.ttf' + * } + * }; + * + * var printer = new PdfPrinter(fontDescriptors); + */ +function PdfPrinter(fontDescriptors) { + this.fontDescriptors = fontDescriptors; +} + +/** + * Executes layout engine for the specified document and renders it into a pdfkit document + * ready to be saved. + * + * @param {Object} docDefinition document definition + * @param {Object} docDefinition.content an array describing the pdf structure (for more information take a look at the examples in the /examples folder) + * @param {Object} [docDefinition.defaultStyle] default (implicit) style definition + * @param {Object} [docDefinition.styles] dictionary defining all styles which can be used in the document + * @param {Object} [docDefinition.pageSize] page size (pdfkit units, A4 dimensions by default) + * @param {Number} docDefinition.pageSize.width width + * @param {Number} docDefinition.pageSize.height height + * @param {Object} [docDefinition.pageMargins] page margins (pdfkit units) + * @param {Number} docDefinition.maxPagesNumber maximum number of pages to render + * + * @example + * + * var docDefinition = { + * info: { + * title: 'awesome Document', + * author: 'john doe', + * subject: 'subject of document', + * keywords: 'keywords for document', + * }, + * content: [ + * 'First paragraph', + * 'Second paragraph, this time a little bit longer', + * { text: 'Third paragraph, slightly bigger font size', fontSize: 20 }, + * { text: 'Another paragraph using a named style', style: 'header' }, + * { text: ['playing with ', 'inlines' ] }, + * { text: ['and ', { text: 'restyling ', bold: true }, 'them'] }, + * ], + * styles: { + * header: { fontSize: 30, bold: true } + * } + * } + * + * var pdfKitDoc = printer.createPdfKitDocument(docDefinition); + * + * pdfKitDoc.pipe(fs.createWriteStream('sample.pdf')); + * pdfKitDoc.end(); + * + * @return {Object} a pdfKit document object which can be saved or encode to data-url + */ +PdfPrinter.prototype.createPdfKitDocument = function (docDefinition, options) { + options = options || {}; + + var pageSize = fixPageSize(docDefinition.pageSize, docDefinition.pageOrientation); + var compressPdf = isBoolean(docDefinition.compress) ? docDefinition.compress : true; + + this.pdfKitDoc = new PdfKit({size: [pageSize.width, pageSize.height], autoFirstPage: false, compress: compressPdf}); + setMetadata(docDefinition, this.pdfKitDoc); + + this.fontProvider = new FontProvider(this.fontDescriptors, this.pdfKitDoc); + + docDefinition.images = docDefinition.images || {}; + + var builder = new LayoutBuilder(pageSize, fixPageMargins(docDefinition.pageMargins || 40), new ImageMeasure(this.pdfKitDoc, docDefinition.images)); + + registerDefaultTableLayouts(builder); + if (options.tableLayouts) { + builder.registerTableLayouts(options.tableLayouts); + } + + var pages = builder.layoutDocument(docDefinition.content, this.fontProvider, docDefinition.styles || {}, docDefinition.defaultStyle || {fontSize: 12, font: 'Roboto'}, docDefinition.background, docDefinition.header, docDefinition.footer, docDefinition.images, docDefinition.watermark, docDefinition.pageBreakBefore); + var maxNumberPages = docDefinition.maxPagesNumber || -1; + if (isNumber(maxNumberPages) && maxNumberPages > -1) { + pages = pages.slice(0, maxNumberPages); + } + + // if pageSize.height is set to Infinity, calculate the actual height of the page that + // was laid out using the height of each of the items in the page. + if (pageSize.height === Infinity) { + var pageHeight = calculatePageHeight(pages, docDefinition.pageMargins); + this.pdfKitDoc.options.size = [pageSize.width, pageHeight]; + } + + renderPages(pages, this.fontProvider, this.pdfKitDoc, options.progressCallback); + + if (options.autoPrint) { + var printActionRef = this.pdfKitDoc.ref({ + Type: 'Action', + S: 'Named', + N: 'Print' + }); + this.pdfKitDoc._root.data.OpenAction = printActionRef; + printActionRef.end(); + } + return this.pdfKitDoc; +}; + +function setMetadata(docDefinition, pdfKitDoc) { + // PDF standard has these properties reserved: Title, Author, Subject, Keywords, + // Creator, Producer, CreationDate, ModDate, Trapped. + // To keep the pdfmake api consistent, the info field are defined lowercase. + // Custom properties don't contain a space. + function standardizePropertyKey(key) { + var standardProperties = ['Title', 'Author', 'Subject', 'Keywords', + 'Creator', 'Producer', 'CreationDate', 'ModDate', 'Trapped']; + var standardizedKey = key.charAt(0).toUpperCase() + key.slice(1); + if (standardProperties.indexOf(standardizedKey) !== -1) { + return standardizedKey; + } + + return key.replace(/\s+/g, ''); + } + + pdfKitDoc.info.Producer = 'pdfmake'; + pdfKitDoc.info.Creator = 'pdfmake'; + + if (docDefinition.info) { + for (var key in docDefinition.info) { + var value = docDefinition.info[key]; + if (value) { + key = standardizePropertyKey(key); + pdfKitDoc.info[key] = value; + } + } + } +} + +function calculatePageHeight(pages, margins) { + function getItemHeight(item) { + if (isFunction(item.item.getHeight)) { + return item.item.getHeight(); + } else if (item.item._height) { + return item.item._height; + } else { + // TODO: add support for next item types + return 0; + } + } + + var fixedMargins = fixPageMargins(margins || 40); + var height = fixedMargins.top + fixedMargins.bottom; + pages.forEach(function (page) { + page.items.forEach(function (item) { + height += getItemHeight(item); + }); + }); + return height; +} + +function fixPageSize(pageSize, pageOrientation) { + function isNeedSwapPageSizes(pageOrientation) { + if (isString(pageOrientation)) { + pageOrientation = pageOrientation.toLowerCase(); + return ((pageOrientation === 'portrait') && (size.width > size.height)) || + ((pageOrientation === 'landscape') && (size.width < size.height)); + } + return false; + } + + // if pageSize.height is set to auto, set the height to infinity so there are no page breaks. + if (pageSize && pageSize.height === 'auto') { + pageSize.height = Infinity; + } + + var size = pageSize2widthAndHeight(pageSize || 'A4'); + if (isNeedSwapPageSizes(pageOrientation)) { // swap page sizes + size = {width: size.height, height: size.width}; + } + size.orientation = size.width > size.height ? 'landscape' : 'portrait'; + return size; +} + +function fixPageMargins(margin) { + if (!margin) { + return null; + } + + if (isNumber(margin)) { + margin = {left: margin, right: margin, top: margin, bottom: margin}; + } else if (isArray(margin)) { + if (margin.length === 2) { + margin = {left: margin[0], top: margin[1], right: margin[0], bottom: margin[1]}; + } else if (margin.length === 4) { + margin = {left: margin[0], top: margin[1], right: margin[2], bottom: margin[3]}; + } else { + throw 'Invalid pageMargins definition'; + } + } + + return margin; +} + +function registerDefaultTableLayouts(layoutBuilder) { + layoutBuilder.registerTableLayouts({ + noBorders: { + hLineWidth: function (i) { + return 0; + }, + vLineWidth: function (i) { + return 0; + }, + paddingLeft: function (i) { + return i && 4 || 0; + }, + paddingRight: function (i, node) { + return (i < node.table.widths.length - 1) ? 4 : 0; + } + }, + headerLineOnly: { + hLineWidth: function (i, node) { + if (i === 0 || i === node.table.body.length) { + return 0; + } + return (i === node.table.headerRows) ? 2 : 0; + }, + vLineWidth: function (i) { + return 0; + }, + paddingLeft: function (i) { + return i === 0 ? 0 : 8; + }, + paddingRight: function (i, node) { + return (i === node.table.widths.length - 1) ? 0 : 8; + } + }, + lightHorizontalLines: { + hLineWidth: function (i, node) { + if (i === 0 || i === node.table.body.length) { + return 0; + } + return (i === node.table.headerRows) ? 2 : 1; + }, + vLineWidth: function (i) { + return 0; + }, + hLineColor: function (i) { + return i === 1 ? 'black' : '#aaa'; + }, + paddingLeft: function (i) { + return i === 0 ? 0 : 8; + }, + paddingRight: function (i, node) { + return (i === node.table.widths.length - 1) ? 0 : 8; + } + } + }); +} + +function pageSize2widthAndHeight(pageSize) { + if (isString(pageSize)) { + var size = sizes[pageSize.toUpperCase()]; + if (!size) { + throw 'Page size ' + pageSize + ' not recognized'; + } + return {width: size[0], height: size[1]}; + } + + return pageSize; +} + +function updatePageOrientationInOptions(currentPage, pdfKitDoc) { + var previousPageOrientation = pdfKitDoc.options.size[0] > pdfKitDoc.options.size[1] ? 'landscape' : 'portrait'; + + if (currentPage.pageSize.orientation !== previousPageOrientation) { + var width = pdfKitDoc.options.size[0]; + var height = pdfKitDoc.options.size[1]; + pdfKitDoc.options.size = [height, width]; + } +} + +function renderPages(pages, fontProvider, pdfKitDoc, progressCallback) { + pdfKitDoc._pdfMakePages = pages; + pdfKitDoc.addPage(); + + var totalItems = 0; + if (progressCallback) { + pages.forEach(function (page) { + totalItems += page.items.length; + }); + } + + var renderedItems = 0; + progressCallback = progressCallback || function () {}; + + for (var i = 0; i < pages.length; i++) { + if (i > 0) { + updatePageOrientationInOptions(pages[i], pdfKitDoc); + pdfKitDoc.addPage(pdfKitDoc.options); + } + + var page = pages[i]; + for (var ii = 0, il = page.items.length; ii < il; ii++) { + var item = page.items[ii]; + switch (item.type) { + case 'vector': + renderVector(item.item, pdfKitDoc); + break; + case 'line': + renderLine(item.item, item.item.x, item.item.y, pdfKitDoc); + break; + case 'image': + renderImage(item.item, item.item.x, item.item.y, pdfKitDoc); + break; + case 'beginClip': + beginClip(item.item, pdfKitDoc); + break; + case 'endClip': + endClip(pdfKitDoc); + break; + } + renderedItems++; + progressCallback(renderedItems / totalItems); + } + if (page.watermark) { + renderWatermark(page, pdfKitDoc); + } + } +} + +function renderLine(line, x, y, pdfKitDoc) { + if (line._pageNodeRef) { + var newWidth; + var diffWidth; + var textTools = new TextTools(null); + var pageNumber = line._pageNodeRef.positions[0].pageNumber.toString(); + + line.inlines[0].text = pageNumber; + line.inlines[0].linkToPage = pageNumber; + newWidth = textTools.widthOfString(line.inlines[0].text, line.inlines[0].font, line.inlines[0].fontSize, line.inlines[0].characterSpacing, line.inlines[0].fontFeatures); + diffWidth = line.inlines[0].width - newWidth; + line.inlines[0].width = newWidth; + + switch (line.inlines[0].alignment) { + case 'right': + line.inlines[0].x += diffWidth; + break; + case 'center': + line.inlines[0].x += diffWidth / 2; + break; + } + } + + x = x || 0; + y = y || 0; + + var lineHeight = line.getHeight(); + var ascenderHeight = line.getAscenderHeight(); + var descent = lineHeight - ascenderHeight; + + textDecorator.drawBackground(line, x, y, pdfKitDoc); + + //TODO: line.optimizeInlines(); + for (var i = 0, l = line.inlines.length; i < l; i++) { + var inline = line.inlines[i]; + var shiftToBaseline = lineHeight - ((inline.font.ascender / 1000) * inline.fontSize) - descent; + var options = { + lineBreak: false, + textWidth: inline.width, + characterSpacing: inline.characterSpacing, + wordCount: 1, + link: inline.link + }; + + if (inline.fontFeatures) { + options.features = inline.fontFeatures; + } + + pdfKitDoc.fill(inline.color || 'black'); + + pdfKitDoc._font = inline.font; + pdfKitDoc.fontSize(inline.fontSize); + pdfKitDoc.text(inline.text, x + inline.x, y + shiftToBaseline, options); + + if (inline.linkToPage) { + var _ref = pdfKitDoc.ref({Type: 'Action', S: 'GoTo', D: [inline.linkToPage, 0, 0]}).end(); + pdfKitDoc.annotate(x + inline.x, y + shiftToBaseline, inline.width, inline.height, {Subtype: 'Link', Dest: [inline.linkToPage - 1, 'XYZ', null, null, null]}); + } + + } + + textDecorator.drawDecorations(line, x, y, pdfKitDoc); +} + +function renderWatermark(page, pdfKitDoc) { + var watermark = page.watermark; + + pdfKitDoc.fill(watermark.color); + pdfKitDoc.opacity(watermark.opacity); + + pdfKitDoc.save(); + + var angle = Math.atan2(pdfKitDoc.page.height, pdfKitDoc.page.width) * -180 / Math.PI; + pdfKitDoc.rotate(angle, {origin: [pdfKitDoc.page.width / 2, pdfKitDoc.page.height / 2]}); + + var x = pdfKitDoc.page.width / 2 - watermark.size.size.width / 2; + var y = pdfKitDoc.page.height / 2 - watermark.size.size.height / 4; + + pdfKitDoc._font = watermark.font; + pdfKitDoc.fontSize(watermark.size.fontSize); + pdfKitDoc.text(watermark.text, x, y, {lineBreak: false}); + + pdfKitDoc.restore(); +} + +function renderVector(vector, pdfKitDoc) { + //TODO: pdf optimization (there's no need to write all properties everytime) + pdfKitDoc.lineWidth(vector.lineWidth || 1); + if (vector.dash) { + pdfKitDoc.dash(vector.dash.length, {space: vector.dash.space || vector.dash.length, phase: vector.dash.phase || 0}); + } else { + pdfKitDoc.undash(); + } + pdfKitDoc.lineJoin(vector.lineJoin || 'miter'); + pdfKitDoc.lineCap(vector.lineCap || 'butt'); + + //TODO: clipping + + switch (vector.type) { + case 'ellipse': + pdfKitDoc.ellipse(vector.x, vector.y, vector.r1, vector.r2); + break; + case 'rect': + if (vector.r) { + pdfKitDoc.roundedRect(vector.x, vector.y, vector.w, vector.h, vector.r); + } else { + pdfKitDoc.rect(vector.x, vector.y, vector.w, vector.h); + } + + if (vector.linearGradient) { + var gradient = pdfKitDoc.linearGradient(vector.x, vector.y, vector.x + vector.w, vector.y); + var step = 1 / (vector.linearGradient.length - 1); + + for (var i = 0; i < vector.linearGradient.length; i++) { + gradient.stop(i * step, vector.linearGradient[i]); + } + + vector.color = gradient; + } + break; + case 'line': + pdfKitDoc.moveTo(vector.x1, vector.y1); + pdfKitDoc.lineTo(vector.x2, vector.y2); + break; + case 'polyline': + if (vector.points.length === 0) { + break; + } + + pdfKitDoc.moveTo(vector.points[0].x, vector.points[0].y); + for (var i = 1, l = vector.points.length; i < l; i++) { + pdfKitDoc.lineTo(vector.points[i].x, vector.points[i].y); + } + + if (vector.points.length > 1) { + var p1 = vector.points[0]; + var pn = vector.points[vector.points.length - 1]; + + if (vector.closePath || p1.x === pn.x && p1.y === pn.y) { + pdfKitDoc.closePath(); + } + } + break; + case 'path': + pdfKitDoc.path(vector.d); + break; + } + + if (vector.color && vector.lineColor) { + pdfKitDoc.fillColor(vector.color, vector.fillOpacity || 1); + pdfKitDoc.strokeColor(vector.lineColor, vector.strokeOpacity || 1); + pdfKitDoc.fillAndStroke(); + } else if (vector.color) { + pdfKitDoc.fillColor(vector.color, vector.fillOpacity || 1); + pdfKitDoc.fill(); + } else { + pdfKitDoc.strokeColor(vector.lineColor || 'black', vector.strokeOpacity || 1); + pdfKitDoc.stroke(); + } +} + +function renderImage(image, x, y, pdfKitDoc) { + pdfKitDoc.image(image.image, image.x, image.y, {width: image._width, height: image._height}); + if (image.link) { + pdfKitDoc.link(image.x, image.y, image._width, image._height, image.link); + } +} + +function beginClip(rect, pdfKitDoc) { + pdfKitDoc.save(); + pdfKitDoc.addContent('' + rect.x + ' ' + rect.y + ' ' + rect.width + ' ' + rect.height + ' re'); + pdfKitDoc.clip(); +} + +function endClip(pdfKitDoc) { + pdfKitDoc.restore(); +} + +module.exports = PdfPrinter; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isArray = __webpack_require__(0).isArray; + +function typeName(bold, italics) { + var type = 'normal'; + if (bold && italics) { + type = 'bolditalics'; + } else if (bold) { + type = 'bold'; + } else if (italics) { + type = 'italics'; + } + return type; +} + +function FontProvider(fontDescriptors, pdfKitDoc) { + this.fonts = {}; + this.pdfKitDoc = pdfKitDoc; + this.fontCache = {}; + + for (var font in fontDescriptors) { + if (fontDescriptors.hasOwnProperty(font)) { + var fontDef = fontDescriptors[font]; + + this.fonts[font] = { + normal: fontDef.normal, + bold: fontDef.bold, + italics: fontDef.italics, + bolditalics: fontDef.bolditalics + }; + } + } +} + +FontProvider.prototype.provideFont = function (familyName, bold, italics) { + var type = typeName(bold, italics); + if (!this.fonts[familyName] || !this.fonts[familyName][type]) { + throw new Error('Font \'' + familyName + '\' in style \'' + type + '\' is not defined in the font section of the document definition.'); + } + + this.fontCache[familyName] = this.fontCache[familyName] || {}; + + if (!this.fontCache[familyName][type]) { + var def = this.fonts[familyName][type]; + if (!isArray(def)) { + def = [def]; + } + this.fontCache[familyName][type] = this.pdfKitDoc.font.apply(this.pdfKitDoc, def)._font; + } + + return this.fontCache[familyName][type]; +}; + +module.exports = FontProvider; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var TraversalTracker = __webpack_require__(77); +var DocPreprocessor = __webpack_require__(129); +var DocMeasure = __webpack_require__(130); +var DocumentContext = __webpack_require__(81); +var PageElementWriter = __webpack_require__(135); +var ColumnCalculator = __webpack_require__(44); +var TableProcessor = __webpack_require__(137); +var Line = __webpack_require__(82); +var isString = __webpack_require__(0).isString; +var isArray = __webpack_require__(0).isArray; +var pack = __webpack_require__(0).pack; +var offsetVector = __webpack_require__(0).offsetVector; +var fontStringify = __webpack_require__(0).fontStringify; +var isFunction = __webpack_require__(0).isFunction; +var TextTools = __webpack_require__(42); +var StyleContextStack = __webpack_require__(80); + +function addAll(target, otherArray) { + otherArray.forEach(function (item) { + target.push(item); + }); +} + +/** + * Creates an instance of LayoutBuilder - layout engine which turns document-definition-object + * into a set of pages, lines, inlines and vectors ready to be rendered into a PDF + * + * @param {Object} pageSize - an object defining page width and height + * @param {Object} pageMargins - an object defining top, left, right and bottom margins + */ +function LayoutBuilder(pageSize, pageMargins, imageMeasure) { + this.pageSize = pageSize; + this.pageMargins = pageMargins; + this.tracker = new TraversalTracker(); + this.imageMeasure = imageMeasure; + this.tableLayouts = {}; +} + +LayoutBuilder.prototype.registerTableLayouts = function (tableLayouts) { + this.tableLayouts = pack(this.tableLayouts, tableLayouts); +}; + +/** + * Executes layout engine on document-definition-object and creates an array of pages + * containing positioned Blocks, Lines and inlines + * + * @param {Object} docStructure document-definition-object + * @param {Object} fontProvider font provider + * @param {Object} styleDictionary dictionary with style definitions + * @param {Object} defaultStyle default style definition + * @return {Array} an array of pages + */ +LayoutBuilder.prototype.layoutDocument = function (docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark, pageBreakBeforeFct) { + + function addPageBreaksIfNecessary(linearNodeList, pages) { + + if (!isFunction(pageBreakBeforeFct)) { + return false; + } + + linearNodeList = linearNodeList.filter(function (node) { + return node.positions.length > 0; + }); + + linearNodeList.forEach(function (node) { + var nodeInfo = {}; + [ + 'id', 'text', 'ul', 'ol', 'table', 'image', 'qr', 'canvas', 'columns', + 'headlineLevel', 'style', 'pageBreak', 'pageOrientation', + 'width', 'height' + ].forEach(function (key) { + if (node[key] !== undefined) { + nodeInfo[key] = node[key]; + } + }); + nodeInfo.startPosition = node.positions[0]; + nodeInfo.pageNumbers = node.positions.map(function (node) { + return node.pageNumber; + }).filter(function (element, position, array) { + return array.indexOf(element) === position; + }); + nodeInfo.pages = pages.length; + nodeInfo.stack = isArray(node.stack); + + node.nodeInfo = nodeInfo; + }); + + return linearNodeList.some(function (node, index, followingNodeList) { + if (node.pageBreak !== 'before' && !node.pageBreakCalculated) { + node.pageBreakCalculated = true; + var pageNumber = node.nodeInfo.pageNumbers[0]; + + var followingNodesOnPage = followingNodeList.slice(index + 1).filter(function (node0) { + return node0.nodeInfo.pageNumbers.indexOf(pageNumber) > -1; + }); + + var nodesOnNextPage = followingNodeList.slice(index + 1).filter(function (node0) { + return node0.nodeInfo.pageNumbers.indexOf(pageNumber + 1) > -1; + }); + + var previousNodesOnPage = followingNodeList.slice(0, index).filter(function (node0) { + return node0.nodeInfo.pageNumbers.indexOf(pageNumber) > -1; + }); + + if ( + pageBreakBeforeFct( + node.nodeInfo, + followingNodesOnPage.map(function (node) { + return node.nodeInfo; + }), + nodesOnNextPage.map(function (node) { + return node.nodeInfo; + }), + previousNodesOnPage.map(function (node) { + return node.nodeInfo; + }))) { + node.pageBreak = 'before'; + return true; + } + } + }); + } + + this.docPreprocessor = new DocPreprocessor(); + this.docMeasure = new DocMeasure(fontProvider, styleDictionary, defaultStyle, this.imageMeasure, this.tableLayouts, images); + + + function resetXYs(result) { + result.linearNodeList.forEach(function (node) { + node.resetXY(); + }); + } + + var result = this.tryLayoutDocument(docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark); + while (addPageBreaksIfNecessary(result.linearNodeList, result.pages)) { + resetXYs(result); + result = this.tryLayoutDocument(docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark); + } + + return result.pages; +}; + +LayoutBuilder.prototype.tryLayoutDocument = function (docStructure, fontProvider, styleDictionary, defaultStyle, background, header, footer, images, watermark, pageBreakBeforeFct) { + + this.linearNodeList = []; + docStructure = this.docPreprocessor.preprocessDocument(docStructure); + docStructure = this.docMeasure.measureDocument(docStructure); + + this.writer = new PageElementWriter( + new DocumentContext(this.pageSize, this.pageMargins), this.tracker); + + var _this = this; + this.writer.context().tracker.startTracking('pageAdded', function () { + _this.addBackground(background); + }); + + this.addBackground(background); + this.processNode(docStructure); + this.addHeadersAndFooters(header, footer); + if (watermark != null) { + this.addWatermark(watermark, fontProvider, defaultStyle); + } + + return {pages: this.writer.context().pages, linearNodeList: this.linearNodeList}; +}; + + +LayoutBuilder.prototype.addBackground = function (background) { + var backgroundGetter = isFunction(background) ? background : function () { + return background; + }; + + var pageBackground = backgroundGetter(this.writer.context().page + 1); + + if (pageBackground) { + var pageSize = this.writer.context().getCurrentPage().pageSize; + this.writer.beginUnbreakableBlock(pageSize.width, pageSize.height); + pageBackground = this.docPreprocessor.preprocessDocument(pageBackground); + this.processNode(this.docMeasure.measureDocument(pageBackground)); + this.writer.commitUnbreakableBlock(0, 0); + this.writer.context().hasBackground = true; + } +}; + +LayoutBuilder.prototype.addStaticRepeatable = function (headerOrFooter, sizeFunction) { + this.addDynamicRepeatable(function () { + return JSON.parse(JSON.stringify(headerOrFooter)); // copy to new object + }, sizeFunction); +}; + +LayoutBuilder.prototype.addDynamicRepeatable = function (nodeGetter, sizeFunction) { + var pages = this.writer.context().pages; + + for (var pageIndex = 0, l = pages.length; pageIndex < l; pageIndex++) { + this.writer.context().page = pageIndex; + + var node = nodeGetter(pageIndex + 1, l, this.writer.context().pages[pageIndex].pageSize); + + if (node) { + var sizes = sizeFunction(this.writer.context().getCurrentPage().pageSize, this.pageMargins); + this.writer.beginUnbreakableBlock(sizes.width, sizes.height); + node = this.docPreprocessor.preprocessDocument(node); + this.processNode(this.docMeasure.measureDocument(node)); + this.writer.commitUnbreakableBlock(sizes.x, sizes.y); + } + } +}; + +LayoutBuilder.prototype.addHeadersAndFooters = function (header, footer) { + var headerSizeFct = function (pageSize, pageMargins) { + return { + x: 0, + y: 0, + width: pageSize.width, + height: pageMargins.top + }; + }; + + var footerSizeFct = function (pageSize, pageMargins) { + return { + x: 0, + y: pageSize.height - pageMargins.bottom, + width: pageSize.width, + height: pageMargins.bottom + }; + }; + + if (isFunction(header)) { + this.addDynamicRepeatable(header, headerSizeFct); + } else if (header) { + this.addStaticRepeatable(header, headerSizeFct); + } + + if (isFunction(footer)) { + this.addDynamicRepeatable(footer, footerSizeFct); + } else if (footer) { + this.addStaticRepeatable(footer, footerSizeFct); + } +}; + +LayoutBuilder.prototype.addWatermark = function (watermark, fontProvider, defaultStyle) { + if (isString(watermark)) { + watermark = {'text': watermark}; + } + + if (!watermark.text) { // empty watermark text + return; + } + + watermark.font = watermark.font || defaultStyle.font || 'Roboto'; + watermark.color = watermark.color || 'black'; + watermark.opacity = watermark.opacity || 0.6; + watermark.bold = watermark.bold || false; + watermark.italics = watermark.italics || false; + + var watermarkObject = { + text: watermark.text, + font: fontProvider.provideFont(watermark.font, watermark.bold, watermark.italics), + size: getSize(this.pageSize, watermark, fontProvider), + color: watermark.color, + opacity: watermark.opacity + }; + + var pages = this.writer.context().pages; + for (var i = 0, l = pages.length; i < l; i++) { + pages[i].watermark = watermarkObject; + } + + function getSize(pageSize, watermark, fontProvider) { + var width = pageSize.width; + var height = pageSize.height; + var targetWidth = Math.sqrt(width * width + height * height) * 0.8; /* page diagonal * sample factor */ + var textTools = new TextTools(fontProvider); + var styleContextStack = new StyleContextStack(null, {font: watermark.font, bold: watermark.bold, italics: watermark.italics}); + var size; + + /** + * Binary search the best font size. + * Initial bounds [0, 1000] + * Break when range < 1 + */ + var a = 0; + var b = 1000; + var c = (a + b) / 2; + while (Math.abs(a - b) > 1) { + styleContextStack.push({ + fontSize: c + }); + size = textTools.sizeOfString(watermark.text, styleContextStack); + if (size.width > targetWidth) { + b = c; + c = (a + b) / 2; + } else if (size.width < targetWidth) { + a = c; + c = (a + b) / 2; + } + styleContextStack.pop(); + } + /* + End binary search + */ + return {size: size, fontSize: c}; + } +}; + +function decorateNode(node) { + var x = node.x, y = node.y; + node.positions = []; + + if (isArray(node.canvas)) { + node.canvas.forEach(function (vector) { + var x = vector.x, y = vector.y, x1 = vector.x1, y1 = vector.y1, x2 = vector.x2, y2 = vector.y2; + vector.resetXY = function () { + vector.x = x; + vector.y = y; + vector.x1 = x1; + vector.y1 = y1; + vector.x2 = x2; + vector.y2 = y2; + }; + }); + } + + node.resetXY = function () { + node.x = x; + node.y = y; + if (isArray(node.canvas)) { + node.canvas.forEach(function (vector) { + vector.resetXY(); + }); + } + }; +} + +LayoutBuilder.prototype.processNode = function (node) { + var self = this; + + this.linearNodeList.push(node); + decorateNode(node); + + applyMargins(function () { + var unbreakable = node.unbreakable; + if (unbreakable) { + self.writer.beginUnbreakableBlock(); + } + + var absPosition = node.absolutePosition; + if (absPosition) { + self.writer.context().beginDetachedBlock(); + self.writer.context().moveTo(absPosition.x || 0, absPosition.y || 0); + } + + var relPosition = node.relativePosition; + if (relPosition) { + self.writer.context().beginDetachedBlock(); + self.writer.context().moveTo((relPosition.x || 0) + self.writer.context().x, (relPosition.y || 0) + self.writer.context().y); + } + + if (node.stack) { + self.processVerticalContainer(node); + } else if (node.columns) { + self.processColumns(node); + } else if (node.ul) { + self.processList(false, node); + } else if (node.ol) { + self.processList(true, node); + } else if (node.table) { + self.processTable(node); + } else if (node.text !== undefined) { + self.processLeaf(node); + } else if (node.toc) { + self.processToc(node); + } else if (node.image) { + self.processImage(node); + } else if (node.canvas) { + self.processCanvas(node); + } else if (node.qr) { + self.processQr(node); + } else if (!node._span) { + throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify); + } + + if (absPosition || relPosition) { + self.writer.context().endDetachedBlock(); + } + + if (unbreakable) { + self.writer.commitUnbreakableBlock(); + } + }); + + function applyMargins(callback) { + var margin = node._margin; + + if (node.pageBreak === 'before') { + self.writer.moveToNextPage(node.pageOrientation); + } + + if (margin) { + self.writer.context().moveDown(margin[1]); + self.writer.context().addMargin(margin[0], margin[2]); + } + + callback(); + + if (margin) { + self.writer.context().addMargin(-margin[0], -margin[2]); + self.writer.context().moveDown(margin[3]); + } + + if (node.pageBreak === 'after') { + self.writer.moveToNextPage(node.pageOrientation); + } + } +}; + +// vertical container +LayoutBuilder.prototype.processVerticalContainer = function (node) { + var self = this; + node.stack.forEach(function (item) { + self.processNode(item); + addAll(node.positions, item.positions); + + //TODO: paragraph gap + }); +}; + +// columns +LayoutBuilder.prototype.processColumns = function (columnNode) { + var columns = columnNode.columns; + var availableWidth = this.writer.context().availableWidth; + var gaps = gapArray(columnNode._gap); + + if (gaps) { + availableWidth -= (gaps.length - 1) * columnNode._gap; + } + + ColumnCalculator.buildColumnWidths(columns, availableWidth); + var result = this.processRow(columns, columns, gaps); + addAll(columnNode.positions, result.positions); + + + function gapArray(gap) { + if (!gap) { + return null; + } + + var gaps = []; + gaps.push(0); + + for (var i = columns.length - 1; i > 0; i--) { + gaps.push(gap); + } + + return gaps; + } +}; + +LayoutBuilder.prototype.processRow = function (columns, widths, gaps, tableBody, tableRow, height) { + var self = this; + var pageBreaks = [], positions = []; + + this.tracker.auto('pageChanged', storePageBreakData, function () { + widths = widths || columns; + + self.writer.context().beginColumnGroup(); + + for (var i = 0, l = columns.length; i < l; i++) { + var column = columns[i]; + var width = widths[i]._calcWidth; + var leftOffset = colLeftOffset(i); + + if (column.colSpan && column.colSpan > 1) { + for (var j = 1; j < column.colSpan; j++) { + width += widths[++i]._calcWidth + gaps[i]; + } + } + + self.writer.context().beginColumn(width, leftOffset, getEndingCell(column, i)); + if (!column._span) { + self.processNode(column); + addAll(positions, column.positions); + } else if (column._columnEndingContext) { + // row-span ending + self.writer.context().markEnding(column); + } + } + + self.writer.context().completeColumnGroup(height); + }); + + return {pageBreaks: pageBreaks, positions: positions}; + + function storePageBreakData(data) { + var pageDesc; + + for (var i = 0, l = pageBreaks.length; i < l; i++) { + var desc = pageBreaks[i]; + if (desc.prevPage === data.prevPage) { + pageDesc = desc; + break; + } + } + + if (!pageDesc) { + pageDesc = data; + pageBreaks.push(pageDesc); + } + pageDesc.prevY = Math.max(pageDesc.prevY, data.prevY); + pageDesc.y = Math.min(pageDesc.y, data.y); + } + + function colLeftOffset(i) { + if (gaps && gaps.length > i) { + return gaps[i]; + } + return 0; + } + + function getEndingCell(column, columnIndex) { + if (column.rowSpan && column.rowSpan > 1) { + var endingRow = tableRow + column.rowSpan - 1; + if (endingRow >= tableBody.length) { + throw 'Row span for column ' + columnIndex + ' (with indexes starting from 0) exceeded row count'; + } + return tableBody[endingRow][columnIndex]; + } + + return null; + } +}; + +// lists +LayoutBuilder.prototype.processList = function (orderedList, node) { + var self = this, + items = orderedList ? node.ol : node.ul, + gapSize = node._gapSize; + + this.writer.context().addMargin(gapSize.width); + + var nextMarker; + this.tracker.auto('lineAdded', addMarkerToFirstLeaf, function () { + items.forEach(function (item) { + nextMarker = item.listMarker; + self.processNode(item); + addAll(node.positions, item.positions); + }); + }); + + this.writer.context().addMargin(-gapSize.width); + + function addMarkerToFirstLeaf(line) { + // I'm not very happy with the way list processing is implemented + // (both code and algorithm should be rethinked) + if (nextMarker) { + var marker = nextMarker; + nextMarker = null; + + if (marker.canvas) { + var vector = marker.canvas[0]; + + offsetVector(vector, -marker._minWidth, 0); + self.writer.addVector(vector); + } else if (marker._inlines) { + var markerLine = new Line(self.pageSize.width); + markerLine.addInline(marker._inlines[0]); + markerLine.x = -marker._minWidth; + markerLine.y = line.getAscenderHeight() - markerLine.getAscenderHeight(); + self.writer.addLine(markerLine, true); + } + } + } +}; + +// tables +LayoutBuilder.prototype.processTable = function (tableNode) { + var processor = new TableProcessor(tableNode); + + processor.beginTable(this.writer); + + var rowHeights = tableNode.table.heights; + for (var i = 0, l = tableNode.table.body.length; i < l; i++) { + processor.beginRow(i, this.writer); + + var height; + if (isFunction(rowHeights)) { + height = rowHeights(i); + } else if (isArray(rowHeights)) { + height = rowHeights[i]; + } else { + height = rowHeights; + } + + if (height === 'auto') { + height = undefined; + } + + var result = this.processRow(tableNode.table.body[i], tableNode.table.widths, tableNode._offsets.offsets, tableNode.table.body, i, height); + addAll(tableNode.positions, result.positions); + + processor.endRow(i, this.writer, result.pageBreaks); + } + + processor.endTable(this.writer); +}; + +// leafs (texts) +LayoutBuilder.prototype.processLeaf = function (node) { + var line = this.buildNextLine(node); + var currentHeight = (line) ? line.getHeight() : 0; + var maxHeight = node.maxHeight || -1; + + if (node._tocItemRef) { + line._pageNodeRef = node._tocItemRef; + } + + if (node._pageRef) { + line._pageNodeRef = node._pageRef._nodeRef; + } + + while (line && (maxHeight === -1 || currentHeight < maxHeight)) { + var positions = this.writer.addLine(line); + node.positions.push(positions); + line = this.buildNextLine(node); + if (line) { + currentHeight += line.getHeight(); + } + } +}; + +LayoutBuilder.prototype.processToc = function (node) { + if (node.toc.title) { + this.processNode(node.toc.title); + } + this.processNode(node.toc._table); +}; + +LayoutBuilder.prototype.buildNextLine = function (textNode) { + + function cloneInline(inline) { + var newInline = inline.constructor(); + for (var key in inline) { + newInline[key] = inline[key]; + } + return newInline; + } + + if (!textNode._inlines || textNode._inlines.length === 0) { + return null; + } + + var line = new Line(this.writer.context().availableWidth); + var textTools = new TextTools(null); + + while (textNode._inlines && textNode._inlines.length > 0 && line.hasEnoughSpaceForInline(textNode._inlines[0])) { + var inline = textNode._inlines.shift(); + + if (!inline.noWrap && inline.text.length > 1 && inline.width > line.maxWidth) { + var widthPerChar = inline.width / inline.text.length; + var maxChars = Math.floor(line.maxWidth / widthPerChar); + if (maxChars < 1) { + maxChars = 1; + } + if (maxChars < inline.text.length) { + var newInline = cloneInline(inline); + + newInline.text = inline.text.substr(maxChars); + inline.text = inline.text.substr(0, maxChars); + + newInline.width = textTools.widthOfString(newInline.text, newInline.font, newInline.fontSize, newInline.characterSpacing, newInline.fontFeatures); + inline.width = textTools.widthOfString(inline.text, inline.font, inline.fontSize, inline.characterSpacing, inline.fontFeatures); + + textNode._inlines.unshift(newInline); + } + } + + line.addInline(inline); + } + + line.lastLineInParagraph = textNode._inlines.length === 0; + + return line; +}; + +// images +LayoutBuilder.prototype.processImage = function (node) { + var position = this.writer.addImage(node); + node.positions.push(position); +}; + +LayoutBuilder.prototype.processCanvas = function (node) { + var height = node._minHeight; + + if (node.absolutePosition === undefined && this.writer.context().availableHeight < height) { + // TODO: support for canvas larger than a page + // TODO: support for other overflow methods + + this.writer.moveToNextPage(); + } + + this.writer.alignCanvas(node); + + node.canvas.forEach(function (vector) { + var position = this.writer.addVector(vector); + node.positions.push(position); + }, this); + + this.writer.context().moveDown(height); +}; + +LayoutBuilder.prototype.processQr = function (node) { + var position = this.writer.addQr(node); + node.positions.push(position); +}; + +module.exports = LayoutBuilder; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Buffer) { + +var isString = __webpack_require__(0).isString; +var isNumber = __webpack_require__(0).isNumber; +var isBoolean = __webpack_require__(0).isBoolean; +var isArray = __webpack_require__(0).isArray; +var isUndefined = __webpack_require__(0).isUndefined; +var fontStringify = __webpack_require__(0).fontStringify; + +function DocPreprocessor() { + +} + +DocPreprocessor.prototype.preprocessDocument = function (docStructure) { + this.tocs = []; + this.nodeReferences = []; + return this.preprocessNode(docStructure); +}; + +DocPreprocessor.prototype.preprocessNode = function (node) { + // expand shortcuts and casting values + if (isArray(node)) { + node = {stack: node}; + } else if (isString(node)) { + node = {text: node}; + } else if (isNumber(node) || isBoolean(node)) { + node = {text: node.toString()}; + } else if (node === null) { + node = {text: ''}; + } else if (Object.keys(node).length === 0) { // empty object + node = {text: ''}; + } + + if (node.columns) { + return this.preprocessColumns(node); + } else if (node.stack) { + return this.preprocessVerticalContainer(node); + } else if (node.ul) { + return this.preprocessList(node); + } else if (node.ol) { + return this.preprocessList(node); + } else if (node.table) { + return this.preprocessTable(node); + } else if (node.text !== undefined) { + return this.preprocessText(node); + } else if (node.toc) { + return this.preprocessToc(node); + } else if (node.image) { + return this.preprocessImage(node); + } else if (node.canvas) { + return this.preprocessCanvas(node); + } else if (node.qr) { + return this.preprocessQr(node); + } else if (node.pageReference || node.textReference) { + return this.preprocessText(node); + } else { + throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify); + } +}; + +DocPreprocessor.prototype.preprocessColumns = function (node) { + var columns = node.columns; + + for (var i = 0, l = columns.length; i < l; i++) { + columns[i] = this.preprocessNode(columns[i]); + } + + return node; +}; + +DocPreprocessor.prototype.preprocessVerticalContainer = function (node) { + var items = node.stack; + + for (var i = 0, l = items.length; i < l; i++) { + items[i] = this.preprocessNode(items[i]); + } + + return node; +}; + +DocPreprocessor.prototype.preprocessList = function (node) { + var items = node.ul || node.ol; + + for (var i = 0, l = items.length; i < l; i++) { + items[i] = this.preprocessNode(items[i]); + } + + return node; +}; + +DocPreprocessor.prototype.preprocessTable = function (node) { + var col, row, cols, rows; + + for (col = 0, cols = node.table.body[0].length; col < cols; col++) { + for (row = 0, rows = node.table.body.length; row < rows; row++) { + var rowData = node.table.body[row]; + var data = rowData[col]; + if (data !== undefined) { + if (data === null) { // transform to object + data = ''; + } + if (!data._span) { + rowData[col] = this.preprocessNode(data); + } + } + } + } + + return node; +}; + +DocPreprocessor.prototype.preprocessText = function (node) { + if (node.tocItem) { + if (!isArray(node.tocItem)) { + node.tocItem = [node.tocItem]; + } + + for (var i = 0, l = node.tocItem.length; i < l; i++) { + if (!isString(node.tocItem[i])) { + node.tocItem[i] = '_default_'; + } + + var tocItemId = node.tocItem[i]; + + if (!this.tocs[tocItemId]) { + this.tocs[tocItemId] = {toc: {_items: [], _pseudo: true}}; + } + + this.tocs[tocItemId].toc._items.push(node); + } + } + + if (node.id) { + if (this.nodeReferences[node.id]) { + if (!this.nodeReferences[node.id]._pseudo) { + throw "Node id '" + node.id + "' already exists"; + } + + this.nodeReferences[node.id]._nodeRef = node; + this.nodeReferences[node.id]._pseudo = false; + } else { + this.nodeReferences[node.id] = {_nodeRef: node}; + } + } + + if (node.pageReference) { + if (!this.nodeReferences[node.pageReference]) { + this.nodeReferences[node.pageReference] = {_nodeRef: {}, _pseudo: true}; + } + node.text = '00000'; + node._pageRef = this.nodeReferences[node.pageReference]; + } + + if (node.textReference) { + if (!this.nodeReferences[node.textReference]) { + this.nodeReferences[node.textReference] = {_nodeRef: {}, _pseudo: true}; + } + + node.text = ''; + node._textRef = this.nodeReferences[node.textReference]; + } + + if (node.text && node.text.text) { + node.text = [this.preprocessNode(node.text)]; + } + + return node; +}; + +DocPreprocessor.prototype.preprocessToc = function (node) { + if (!node.toc.id) { + node.toc.id = '_default_'; + } + + node.toc.title = node.toc.title ? this.preprocessNode(node.toc.title) : null; + node.toc._items = []; + + if (this.tocs[node.toc.id]) { + if (!this.tocs[node.toc.id].toc._pseudo) { + throw "TOC '" + node.toc.id + "' already exists"; + } + + node.toc._items = this.tocs[node.toc.id].toc._items; + } + + this.tocs[node.toc.id] = node; + + return node; +}; + +DocPreprocessor.prototype.preprocessImage = function (node) { + if (!isUndefined(node.image.type) && !isUndefined(node.image.data) && (node.image.type === 'Buffer') && isArray(node.image.data)) { + node.image = Buffer.from(node.image.data); + } + return node; +}; + +DocPreprocessor.prototype.preprocessCanvas = function (node) { + return node; +}; + +DocPreprocessor.prototype.preprocessQr = function (node) { + return node; +}; + +module.exports = DocPreprocessor; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*eslint no-unused-vars: ["error", {"args": "none"}]*/ + + + +var TextTools = __webpack_require__(42); +var StyleContextStack = __webpack_require__(80); +var ColumnCalculator = __webpack_require__(44); +var isString = __webpack_require__(0).isString; +var isNumber = __webpack_require__(0).isNumber; +var isObject = __webpack_require__(0).isObject; +var isArray = __webpack_require__(0).isArray; +var fontStringify = __webpack_require__(0).fontStringify; +var pack = __webpack_require__(0).pack; +var qrEncoder = __webpack_require__(134); + +/** + * @private + */ +function DocMeasure(fontProvider, styleDictionary, defaultStyle, imageMeasure, tableLayouts, images) { + this.textTools = new TextTools(fontProvider); + this.styleStack = new StyleContextStack(styleDictionary, defaultStyle); + this.imageMeasure = imageMeasure; + this.tableLayouts = tableLayouts; + this.images = images; + this.autoImageIndex = 1; +} + +/** + * Measures all nodes and sets min/max-width properties required for the second + * layout-pass. + * @param {Object} docStructure document-definition-object + * @return {Object} document-measurement-object + */ +DocMeasure.prototype.measureDocument = function (docStructure) { + return this.measureNode(docStructure); +}; + +DocMeasure.prototype.measureNode = function (node) { + + var self = this; + + return this.styleStack.auto(node, function () { + // TODO: refactor + rethink whether this is the proper way to handle margins + node._margin = getNodeMargin(node); + + if (node.columns) { + return extendMargins(self.measureColumns(node)); + } else if (node.stack) { + return extendMargins(self.measureVerticalContainer(node)); + } else if (node.ul) { + return extendMargins(self.measureUnorderedList(node)); + } else if (node.ol) { + return extendMargins(self.measureOrderedList(node)); + } else if (node.table) { + return extendMargins(self.measureTable(node)); + } else if (node.text !== undefined) { + return extendMargins(self.measureLeaf(node)); + } else if (node.toc) { + return extendMargins(self.measureToc(node)); + } else if (node.image) { + return extendMargins(self.measureImage(node)); + } else if (node.canvas) { + return extendMargins(self.measureCanvas(node)); + } else if (node.qr) { + return extendMargins(self.measureQr(node)); + } else { + throw 'Unrecognized document structure: ' + JSON.stringify(node, fontStringify); + } + }); + + function extendMargins(node) { + var margin = node._margin; + + if (margin) { + node._minWidth += margin[0] + margin[2]; + node._maxWidth += margin[0] + margin[2]; + } + + return node; + } + + function getNodeMargin() { + + function processSingleMargins(node, currentMargin) { + if (node.marginLeft || node.marginTop || node.marginRight || node.marginBottom) { + return [ + node.marginLeft || currentMargin[0] || 0, + node.marginTop || currentMargin[1] || 0, + node.marginRight || currentMargin[2] || 0, + node.marginBottom || currentMargin[3] || 0 + ]; + } + return currentMargin; + } + + function flattenStyleArray(styleArray) { + var flattenedStyles = {}; + for (var i = styleArray.length - 1; i >= 0; i--) { + var styleName = styleArray[i]; + var style = self.styleStack.styleDictionary[styleName]; + for (var key in style) { + if (style.hasOwnProperty(key)) { + flattenedStyles[key] = style[key]; + } + } + } + return flattenedStyles; + } + + function convertMargin(margin) { + if (isNumber(margin)) { + margin = [margin, margin, margin, margin]; + } else if (isArray(margin)) { + if (margin.length === 2) { + margin = [margin[0], margin[1], margin[0], margin[1]]; + } + } + return margin; + } + + var margin = [undefined, undefined, undefined, undefined]; + + if (node.style) { + var styleArray = isArray(node.style) ? node.style : [node.style]; + var flattenedStyleArray = flattenStyleArray(styleArray); + + if (flattenedStyleArray) { + margin = processSingleMargins(flattenedStyleArray, margin); + } + + if (flattenedStyleArray.margin) { + margin = convertMargin(flattenedStyleArray.margin); + } + } + + margin = processSingleMargins(node, margin); + + if (node.margin) { + margin = convertMargin(node.margin); + } + + if (margin[0] === undefined && margin[1] === undefined && margin[2] === undefined && margin[3] === undefined) { + return null; + } else { + return margin; + } + } +}; + +DocMeasure.prototype.convertIfBase64Image = function (node) { + if (/^data:image\/(jpeg|jpg|png);base64,/.test(node.image)) { + var label = '$$pdfmake$$' + this.autoImageIndex++; + this.images[label] = node.image; + node.image = label; + } +}; + +DocMeasure.prototype.measureImage = function (node) { + if (this.images) { + this.convertIfBase64Image(node); + } + + var imageSize = this.imageMeasure.measureImage(node.image); + + if (node.fit) { + var factor = (imageSize.width / imageSize.height > node.fit[0] / node.fit[1]) ? node.fit[0] / imageSize.width : node.fit[1] / imageSize.height; + node._width = node._minWidth = node._maxWidth = imageSize.width * factor; + node._height = imageSize.height * factor; + } else { + node._width = node._minWidth = node._maxWidth = node.width || imageSize.width; + node._height = node.height || (imageSize.height * node._width / imageSize.width); + + if (isNumber(node.maxWidth) && node.maxWidth < node._width) { + node._width = node._minWidth = node._maxWidth = node.maxWidth; + node._height = node._width * imageSize.height / imageSize.width; + } + + if (isNumber(node.maxHeight) && node.maxHeight < node._height) { + node._height = node.maxHeight; + node._width = node._minWidth = node._maxWidth = node._height * imageSize.width / imageSize.height; + } + + if (isNumber(node.minWidth) && node.minWidth > node._width) { + node._width = node._minWidth = node._maxWidth = node.minWidth; + node._height = node._width * imageSize.height / imageSize.width; + } + + if (isNumber(node.minHeight) && node.minHeight > node._height) { + node._height = node.minHeight; + node._width = node._minWidth = node._maxWidth = node._height * imageSize.width / imageSize.height; + } + } + + node._alignment = this.styleStack.getProperty('alignment'); + return node; +}; + +DocMeasure.prototype.measureLeaf = function (node) { + + if (node._textRef && node._textRef._nodeRef.text) { + node.text = node._textRef._nodeRef.text; + } + + // Make sure style properties of the node itself are considered when building inlines. + // We could also just pass [node] to buildInlines, but that fails for bullet points. + var styleStack = this.styleStack.clone(); + styleStack.push(node); + + var data = this.textTools.buildInlines(node.text, styleStack); + + node._inlines = data.items; + node._minWidth = data.minWidth; + node._maxWidth = data.maxWidth; + + return node; +}; + +DocMeasure.prototype.measureToc = function (node) { + if (node.toc.title) { + node.toc.title = this.measureNode(node.toc.title); + } + + var body = []; + var textStyle = node.toc.textStyle || {}; + var numberStyle = node.toc.numberStyle || textStyle; + var textMargin = node.toc.textMargin || [0, 0, 0, 0]; + for (var i = 0, l = node.toc._items.length; i < l; i++) { + var item = node.toc._items[i]; + var lineStyle = node.toc._items[i].tocStyle || textStyle; + var lineMargin = node.toc._items[i].tocMargin || textMargin; + body.push([ + {text: item.text, alignment: 'left', style: lineStyle, margin: lineMargin}, + {text: '00000', alignment: 'right', _tocItemRef: item, style: numberStyle, margin: [0, lineMargin[1], 0, lineMargin[3]]} + ]); + } + + + node.toc._table = { + table: { + dontBreakRows: true, + widths: ['*', 'auto'], + body: body + }, + layout: 'noBorders' + }; + + node.toc._table = this.measureNode(node.toc._table); + + return node; +}; + +DocMeasure.prototype.measureVerticalContainer = function (node) { + var items = node.stack; + + node._minWidth = 0; + node._maxWidth = 0; + + for (var i = 0, l = items.length; i < l; i++) { + items[i] = this.measureNode(items[i]); + + node._minWidth = Math.max(node._minWidth, items[i]._minWidth); + node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth); + } + + return node; +}; + +DocMeasure.prototype.gapSizeForList = function () { + return this.textTools.sizeOfString('9. ', this.styleStack); +}; + +DocMeasure.prototype.buildUnorderedMarker = function (styleStack, gapSize, type) { + function buildDisc(gapSize, color) { + // TODO: ascender-based calculations + var radius = gapSize.fontSize / 6; + return { + canvas: [{ + x: radius, + y: (gapSize.height / gapSize.lineHeight) + gapSize.descender - gapSize.fontSize / 3, + r1: radius, + r2: radius, + type: 'ellipse', + color: color + }] + }; + } + + function buildSquare(gapSize, color) { + // TODO: ascender-based calculations + var size = gapSize.fontSize / 3; + return { + canvas: [{ + x: 0, + y: (gapSize.height / gapSize.lineHeight) + gapSize.descender - (gapSize.fontSize / 3) - (size / 2), + h: size, + w: size, + type: 'rect', + color: color + }] + }; + } + + function buildCircle(gapSize, color) { + // TODO: ascender-based calculations + var radius = gapSize.fontSize / 6; + return { + canvas: [{ + x: radius, + y: (gapSize.height / gapSize.lineHeight) + gapSize.descender - gapSize.fontSize / 3, + r1: radius, + r2: radius, + type: 'ellipse', + lineColor: color + }] + }; + } + + var marker; + var color = styleStack.getProperty('markerColor') || styleStack.getProperty('color') || 'black'; + + switch (type) { + case 'circle': + marker = buildCircle(gapSize, color); + break; + + case 'square': + marker = buildSquare(gapSize, color); + break; + + case 'none': + marker = {}; + break; + + case 'disc': + default: + marker = buildDisc(gapSize, color); + break; + } + + marker._minWidth = marker._maxWidth = gapSize.width; + marker._minHeight = marker._maxHeight = gapSize.height; + + return marker; +}; + +DocMeasure.prototype.buildOrderedMarker = function (counter, styleStack, type, separator) { + function prepareAlpha(counter) { + function toAlpha(num) { + return (num >= 26 ? toAlpha((num / 26 >> 0) - 1) : '') + 'abcdefghijklmnopqrstuvwxyz'[num % 26 >> 0]; + } + + if (counter < 1) { + return counter.toString(); + } + + return toAlpha(counter - 1); + } + + function prepareRoman(counter) { + if (counter < 1 || counter > 4999) { + return counter.toString(); + } + var num = counter; + var lookup = {M: 1000, CM: 900, D: 500, CD: 400, C: 100, XC: 90, L: 50, XL: 40, X: 10, IX: 9, V: 5, IV: 4, I: 1}, roman = '', i; + for (i in lookup) { + while (num >= lookup[i]) { + roman += i; + num -= lookup[i]; + } + } + return roman; + } + + function prepareDecimal(counter) { + return counter.toString(); + } + + var counterText; + switch (type) { + case 'none': + counterText = null; + break; + + case 'upper-alpha': + counterText = prepareAlpha(counter).toUpperCase(); + break; + + case 'lower-alpha': + counterText = prepareAlpha(counter); + break; + + case 'upper-roman': + counterText = prepareRoman(counter); + break; + + case 'lower-roman': + counterText = prepareRoman(counter).toLowerCase(); + break; + + case 'decimal': + default: + counterText = prepareDecimal(counter); + break; + } + + if (counterText === null) { + return {}; + } + + if (separator) { + if (isArray(separator)) { + if (separator[0]) { + counterText = separator[0] + counterText; + } + + if (separator[1]) { + counterText += separator[1]; + } + counterText += ' '; + } else { + counterText += separator + ' '; + } + } + + var textArray = {text: counterText}; + var markerColor = styleStack.getProperty('markerColor'); + if (markerColor) { + textArray.color = markerColor; + } + + return {_inlines: this.textTools.buildInlines(textArray, styleStack).items}; +}; + +DocMeasure.prototype.measureUnorderedList = function (node) { + var style = this.styleStack.clone(); + var items = node.ul; + node.type = node.type || 'disc'; + node._gapSize = this.gapSizeForList(); + node._minWidth = 0; + node._maxWidth = 0; + + for (var i = 0, l = items.length; i < l; i++) { + var item = items[i] = this.measureNode(items[i]); + + if (!item.ol && !item.ul) { + item.listMarker = this.buildUnorderedMarker(style, node._gapSize, item.listType || node.type); + } + + node._minWidth = Math.max(node._minWidth, items[i]._minWidth + node._gapSize.width); + node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth + node._gapSize.width); + } + + return node; +}; + +DocMeasure.prototype.measureOrderedList = function (node) { + var style = this.styleStack.clone(); + var items = node.ol; + node.type = node.type || 'decimal'; + node.separator = node.separator || '.'; + node.reversed = node.reversed || false; + if (!node.start) { + node.start = node.reversed ? items.length : 1; + } + node._gapSize = this.gapSizeForList(); + node._minWidth = 0; + node._maxWidth = 0; + + var counter = node.start; + for (var i = 0, l = items.length; i < l; i++) { + var item = items[i] = this.measureNode(items[i]); + + if (!item.ol && !item.ul) { + item.listMarker = this.buildOrderedMarker(item.counter || counter, style, item.listType || node.type, node.separator); + if (item.listMarker._inlines) { + node._gapSize.width = Math.max(node._gapSize.width, item.listMarker._inlines[0].width); + } + } // TODO: else - nested lists numbering + + node._minWidth = Math.max(node._minWidth, items[i]._minWidth); + node._maxWidth = Math.max(node._maxWidth, items[i]._maxWidth); + + if (node.reversed) { + counter--; + } else { + counter++; + } + } + + node._minWidth += node._gapSize.width; + node._maxWidth += node._gapSize.width; + + for (var i = 0, l = items.length; i < l; i++) { + var item = items[i]; + if (!item.ol && !item.ul) { + item.listMarker._minWidth = item.listMarker._maxWidth = node._gapSize.width; + } + } + + return node; +}; + +DocMeasure.prototype.measureColumns = function (node) { + var columns = node.columns; + node._gap = this.styleStack.getProperty('columnGap') || 0; + + for (var i = 0, l = columns.length; i < l; i++) { + columns[i] = this.measureNode(columns[i]); + } + + var measures = ColumnCalculator.measureMinMax(columns); + + var numGaps = (columns.length > 0) ? (columns.length - 1) : 0; + node._minWidth = measures.min + node._gap * numGaps; + node._maxWidth = measures.max + node._gap * numGaps; + + return node; +}; + +DocMeasure.prototype.measureTable = function (node) { + extendTableWidths(node); + node._layout = getLayout(this.tableLayouts); + node._offsets = getOffsets(node._layout); + + var colSpans = []; + var col, row, cols, rows; + + for (col = 0, cols = node.table.body[0].length; col < cols; col++) { + var c = node.table.widths[col]; + c._minWidth = 0; + c._maxWidth = 0; + + for (row = 0, rows = node.table.body.length; row < rows; row++) { + var rowData = node.table.body[row]; + var data = rowData[col]; + if (data === undefined) { + console.error('Malformed table row ', rowData, 'in node ', node); + throw 'Malformed table row, a cell is undefined.'; + } + if (data === null) { // transform to object + data = ''; + } + + if (!data._span) { + data = rowData[col] = this.styleStack.auto(data, measureCb(this, data)); + + if (data.colSpan && data.colSpan > 1) { + markSpans(rowData, col, data.colSpan); + colSpans.push({col: col, span: data.colSpan, minWidth: data._minWidth, maxWidth: data._maxWidth}); + } else { + c._minWidth = Math.max(c._minWidth, data._minWidth); + c._maxWidth = Math.max(c._maxWidth, data._maxWidth); + } + } + + if (data.rowSpan && data.rowSpan > 1) { + markVSpans(node.table, row, col, data.rowSpan); + } + } + } + + extendWidthsForColSpans(); + + var measures = ColumnCalculator.measureMinMax(node.table.widths); + + node._minWidth = measures.min + node._offsets.total; + node._maxWidth = measures.max + node._offsets.total; + + return node; + + function measureCb(_this, data) { + return function () { + if (isObject(data)) { + data.fillColor = _this.styleStack.getProperty('fillColor'); + } + return _this.measureNode(data); + }; + } + + function getLayout(tableLayouts) { + var layout = node.layout; + + if (isString(layout)) { + layout = tableLayouts[layout]; + } + + var defaultLayout = { + hLineWidth: function (i, node) { + return 1; + }, + vLineWidth: function (i, node) { + return 1; + }, + hLineColor: function (i, node) { + return 'black'; + }, + vLineColor: function (i, node) { + return 'black'; + }, + paddingLeft: function (i, node) { + return 4; + }, + paddingRight: function (i, node) { + return 4; + }, + paddingTop: function (i, node) { + return 2; + }, + paddingBottom: function (i, node) { + return 2; + }, + fillColor: function (i, node) { + return null; + }, + defaultBorder: true + }; + + return pack(defaultLayout, layout); + } + + function getOffsets(layout) { + var offsets = []; + var totalOffset = 0; + var prevRightPadding = 0; + + for (var i = 0, l = node.table.widths.length; i < l; i++) { + var lOffset = prevRightPadding + layout.vLineWidth(i, node) + layout.paddingLeft(i, node); + offsets.push(lOffset); + totalOffset += lOffset; + prevRightPadding = layout.paddingRight(i, node); + } + + totalOffset += prevRightPadding + layout.vLineWidth(node.table.widths.length, node); + + return { + total: totalOffset, + offsets: offsets + }; + } + + function extendWidthsForColSpans() { + var q, j; + + for (var i = 0, l = colSpans.length; i < l; i++) { + var span = colSpans[i]; + + var currentMinMax = getMinMax(span.col, span.span, node._offsets); + var minDifference = span.minWidth - currentMinMax.minWidth; + var maxDifference = span.maxWidth - currentMinMax.maxWidth; + + if (minDifference > 0) { + q = minDifference / span.span; + + for (j = 0; j < span.span; j++) { + node.table.widths[span.col + j]._minWidth += q; + } + } + + if (maxDifference > 0) { + q = maxDifference / span.span; + + for (j = 0; j < span.span; j++) { + node.table.widths[span.col + j]._maxWidth += q; + } + } + } + } + + function getMinMax(col, span, offsets) { + var result = {minWidth: 0, maxWidth: 0}; + + for (var i = 0; i < span; i++) { + result.minWidth += node.table.widths[col + i]._minWidth + (i ? offsets.offsets[col + i] : 0); + result.maxWidth += node.table.widths[col + i]._maxWidth + (i ? offsets.offsets[col + i] : 0); + } + + return result; + } + + function markSpans(rowData, col, span) { + for (var i = 1; i < span; i++) { + rowData[col + i] = { + _span: true, + _minWidth: 0, + _maxWidth: 0, + rowSpan: rowData[col].rowSpan + }; + } + } + + function markVSpans(table, row, col, span) { + for (var i = 1; i < span; i++) { + table.body[row + i][col] = { + _span: true, + _minWidth: 0, + _maxWidth: 0, + fillColor: table.body[row][col].fillColor + }; + } + } + + function extendTableWidths(node) { + if (!node.table.widths) { + node.table.widths = 'auto'; + } + + if (isString(node.table.widths)) { + node.table.widths = [node.table.widths]; + + while (node.table.widths.length < node.table.body[0].length) { + node.table.widths.push(node.table.widths[node.table.widths.length - 1]); + } + } + + for (var i = 0, l = node.table.widths.length; i < l; i++) { + var w = node.table.widths[i]; + if (isNumber(w) || isString(w)) { + node.table.widths[i] = {width: w}; + } + } + } +}; + +DocMeasure.prototype.measureCanvas = function (node) { + var w = 0, h = 0; + + for (var i = 0, l = node.canvas.length; i < l; i++) { + var vector = node.canvas[i]; + + switch (vector.type) { + case 'ellipse': + w = Math.max(w, vector.x + vector.r1); + h = Math.max(h, vector.y + vector.r2); + break; + case 'rect': + w = Math.max(w, vector.x + vector.w); + h = Math.max(h, vector.y + vector.h); + break; + case 'line': + w = Math.max(w, vector.x1, vector.x2); + h = Math.max(h, vector.y1, vector.y2); + break; + case 'polyline': + for (var i2 = 0, l2 = vector.points.length; i2 < l2; i2++) { + w = Math.max(w, vector.points[i2].x); + h = Math.max(h, vector.points[i2].y); + } + break; + } + } + + node._minWidth = node._maxWidth = w; + node._minHeight = node._maxHeight = h; + node._alignment = this.styleStack.getProperty('alignment'); + + return node; +}; + +DocMeasure.prototype.measureQr = function (node) { + node = qrEncoder.measure(node); + node._alignment = this.styleStack.getProperty('alignment'); + return node; +}; + +module.exports = DocMeasure; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + var PLUS_URL_SAFE = '-'.charCodeAt(0) + var SLASH_URL_SAFE = '_'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS || + code === PLUS_URL_SAFE) + return 62 // '+' + if (code === SLASH || + code === SLASH_URL_SAFE) + return 63 // '/' + if (code < NUMBER) + return -1 //no match + if (code < NUMBER + 10) + return code - NUMBER + 26 + 26 + if (code < UPPER + 26) + return code - UPPER + if (code < LOWER + 26) + return code - LOWER + 26 + } + + function b64ToByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + + if (b64.length % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 +}( false ? (this.base64js = {}) : exports)) + + +/***/ }), +/* 132 */ +/***/ (function(module, exports) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var AI, AL, B2, BA, BB, BK, CB, CJ, CL, CM, CP, CR, EX, GL, H2, H3, HL, HY, ID, IN, IS, JL, JT, JV, LF, NL, NS, NU, OP, PO, PR, QU, RI, SA, SG, SP, SY, WJ, XX, ZW; + + exports.OP = OP = 0; + + exports.CL = CL = 1; + + exports.CP = CP = 2; + + exports.QU = QU = 3; + + exports.GL = GL = 4; + + exports.NS = NS = 5; + + exports.EX = EX = 6; + + exports.SY = SY = 7; + + exports.IS = IS = 8; + + exports.PR = PR = 9; + + exports.PO = PO = 10; + + exports.NU = NU = 11; + + exports.AL = AL = 12; + + exports.HL = HL = 13; + + exports.ID = ID = 14; + + exports.IN = IN = 15; + + exports.HY = HY = 16; + + exports.BA = BA = 17; + + exports.BB = BB = 18; + + exports.B2 = B2 = 19; + + exports.ZW = ZW = 20; + + exports.CM = CM = 21; + + exports.WJ = WJ = 22; + + exports.H2 = H2 = 23; + + exports.H3 = H3 = 24; + + exports.JL = JL = 25; + + exports.JV = JV = 26; + + exports.JT = JT = 27; + + exports.RI = RI = 28; + + exports.AI = AI = 29; + + exports.BK = BK = 30; + + exports.CB = CB = 31; + + exports.CJ = CJ = 32; + + exports.CR = CR = 33; + + exports.LF = LF = 34; + + exports.NL = NL = 35; + + exports.SA = SA = 36; + + exports.SG = SG = 37; + + exports.SP = SP = 38; + + exports.XX = XX = 39; + +}).call(this); + + +/***/ }), +/* 133 */ +/***/ (function(module, exports) { + +// Generated by CoffeeScript 1.7.1 +(function() { + var CI_BRK, CP_BRK, DI_BRK, IN_BRK, PR_BRK; + + exports.DI_BRK = DI_BRK = 0; + + exports.IN_BRK = IN_BRK = 1; + + exports.CI_BRK = CI_BRK = 2; + + exports.CP_BRK = CP_BRK = 3; + + exports.PR_BRK = PR_BRK = 4; + + exports.pairTable = [[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], [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, DI_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, 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, DI_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], [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, 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], [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, DI_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, 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, DI_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, PR_BRK, PR_BRK, IN_BRK, IN_BRK, IN_BRK, PR_BRK, PR_BRK, PR_BRK, DI_BRK, DI_BRK, IN_BRK, DI_BRK, DI_BRK, DI_BRK, DI_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, 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, DI_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], [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, DI_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, 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, DI_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], [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], [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], [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, 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, 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, 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, DI_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, 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, DI_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], [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], [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, DI_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, 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], [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], [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], [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, 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, 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, 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, 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, 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, DI_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]]; + +}).call(this); + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*eslint no-unused-vars: ["error", {"args": "none"}]*/ +/*eslint no-redeclare: "off"*/ + + +/* qr.js -- QR code generator in Javascript (revision 2011-01-19) + * Written by Kang Seonghoon . + * + * This source code is in the public domain; if your jurisdiction does not + * recognize the public domain the terms of Creative Commons CC0 license + * apply. In the other words, you can always do what you want. + */ + + +// per-version information (cf. JIS X 0510:2004 pp. 30--36, 71) +// +// [0]: the degree of generator polynomial by ECC levels +// [1]: # of code blocks by ECC levels +// [2]: left-top positions of alignment patterns +// +// the number in this table (in particular, [0]) does not exactly match with +// the numbers in the specficiation. see augumenteccs below for the reason. +var VERSIONS = [ + null, + [[10, 7, 17, 13], [1, 1, 1, 1], []], + [[16, 10, 28, 22], [1, 1, 1, 1], [4, 16]], + [[26, 15, 22, 18], [1, 1, 2, 2], [4, 20]], + [[18, 20, 16, 26], [2, 1, 4, 2], [4, 24]], + [[24, 26, 22, 18], [2, 1, 4, 4], [4, 28]], + [[16, 18, 28, 24], [4, 2, 4, 4], [4, 32]], + [[18, 20, 26, 18], [4, 2, 5, 6], [4, 20, 36]], + [[22, 24, 26, 22], [4, 2, 6, 6], [4, 22, 40]], + [[22, 30, 24, 20], [5, 2, 8, 8], [4, 24, 44]], + [[26, 18, 28, 24], [5, 4, 8, 8], [4, 26, 48]], + [[30, 20, 24, 28], [5, 4, 11, 8], [4, 28, 52]], + [[22, 24, 28, 26], [8, 4, 11, 10], [4, 30, 56]], + [[22, 26, 22, 24], [9, 4, 16, 12], [4, 32, 60]], + [[24, 30, 24, 20], [9, 4, 16, 16], [4, 24, 44, 64]], + [[24, 22, 24, 30], [10, 6, 18, 12], [4, 24, 46, 68]], + [[28, 24, 30, 24], [10, 6, 16, 17], [4, 24, 48, 72]], + [[28, 28, 28, 28], [11, 6, 19, 16], [4, 28, 52, 76]], + [[26, 30, 28, 28], [13, 6, 21, 18], [4, 28, 54, 80]], + [[26, 28, 26, 26], [14, 7, 25, 21], [4, 28, 56, 84]], + [[26, 28, 28, 30], [16, 8, 25, 20], [4, 32, 60, 88]], + [[26, 28, 30, 28], [17, 8, 25, 23], [4, 26, 48, 70, 92]], + [[28, 28, 24, 30], [17, 9, 34, 23], [4, 24, 48, 72, 96]], + [[28, 30, 30, 30], [18, 9, 30, 25], [4, 28, 52, 76, 100]], + [[28, 30, 30, 30], [20, 10, 32, 27], [4, 26, 52, 78, 104]], + [[28, 26, 30, 30], [21, 12, 35, 29], [4, 30, 56, 82, 108]], + [[28, 28, 30, 28], [23, 12, 37, 34], [4, 28, 56, 84, 112]], + [[28, 30, 30, 30], [25, 12, 40, 34], [4, 32, 60, 88, 116]], + [[28, 30, 30, 30], [26, 13, 42, 35], [4, 24, 48, 72, 96, 120]], + [[28, 30, 30, 30], [28, 14, 45, 38], [4, 28, 52, 76, 100, 124]], + [[28, 30, 30, 30], [29, 15, 48, 40], [4, 24, 50, 76, 102, 128]], + [[28, 30, 30, 30], [31, 16, 51, 43], [4, 28, 54, 80, 106, 132]], + [[28, 30, 30, 30], [33, 17, 54, 45], [4, 32, 58, 84, 110, 136]], + [[28, 30, 30, 30], [35, 18, 57, 48], [4, 28, 56, 84, 112, 140]], + [[28, 30, 30, 30], [37, 19, 60, 51], [4, 32, 60, 88, 116, 144]], + [[28, 30, 30, 30], [38, 19, 63, 53], [4, 28, 52, 76, 100, 124, 148]], + [[28, 30, 30, 30], [40, 20, 66, 56], [4, 22, 48, 74, 100, 126, 152]], + [[28, 30, 30, 30], [43, 21, 70, 59], [4, 26, 52, 78, 104, 130, 156]], + [[28, 30, 30, 30], [45, 22, 74, 62], [4, 30, 56, 82, 108, 134, 160]], + [[28, 30, 30, 30], [47, 24, 77, 65], [4, 24, 52, 80, 108, 136, 164]], + [[28, 30, 30, 30], [49, 25, 81, 68], [4, 28, 56, 84, 112, 140, 168]]]; + +// mode constants (cf. Table 2 in JIS X 0510:2004 p. 16) +var MODE_TERMINATOR = 0; +var MODE_NUMERIC = 1, MODE_ALPHANUMERIC = 2, MODE_OCTET = 4, MODE_KANJI = 8; + +// validation regexps +var NUMERIC_REGEXP = /^\d*$/; +var ALPHANUMERIC_REGEXP = /^[A-Za-z0-9 $%*+\-./:]*$/; +var ALPHANUMERIC_OUT_REGEXP = /^[A-Z0-9 $%*+\-./:]*$/; + +// ECC levels (cf. Table 22 in JIS X 0510:2004 p. 45) +var ECCLEVEL_L = 1, ECCLEVEL_M = 0, ECCLEVEL_Q = 3, ECCLEVEL_H = 2; + +// GF(2^8)-to-integer mapping with a reducing polynomial x^8+x^4+x^3+x^2+1 +// invariant: GF256_MAP[GF256_INVMAP[i]] == i for all i in [1,256) +var GF256_MAP = [], GF256_INVMAP = [-1]; +for (var i = 0, v = 1; i < 255; ++i) { + GF256_MAP.push(v); + GF256_INVMAP[v] = i; + v = (v * 2) ^ (v >= 128 ? 0x11d : 0); +} + +// generator polynomials up to degree 30 +// (should match with polynomials in JIS X 0510:2004 Appendix A) +// +// generator polynomial of degree K is product of (x-\alpha^0), (x-\alpha^1), +// ..., (x-\alpha^(K-1)). by convention, we omit the K-th coefficient (always 1) +// from the result; also other coefficients are written in terms of the exponent +// to \alpha to avoid the redundant calculation. (see also calculateecc below.) +var GF256_GENPOLY = [[]]; +for (var i = 0; i < 30; ++i) { + var prevpoly = GF256_GENPOLY[i], poly = []; + for (var j = 0; j <= i; ++j) { + var a = (j < i ? GF256_MAP[prevpoly[j]] : 0); + var b = GF256_MAP[(i + (prevpoly[j - 1] || 0)) % 255]; + poly.push(GF256_INVMAP[a ^ b]); + } + GF256_GENPOLY.push(poly); +} + +// alphanumeric character mapping (cf. Table 5 in JIS X 0510:2004 p. 19) +var ALPHANUMERIC_MAP = {}; +for (var i = 0; i < 45; ++i) { + ALPHANUMERIC_MAP['0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'.charAt(i)] = i; +} + +// mask functions in terms of row # and column # +// (cf. Table 20 in JIS X 0510:2004 p. 42) +/*jshint unused: false */ +var MASKFUNCS = [ + function (i, j) { + return (i + j) % 2 === 0; + }, + function (i, j) { + return i % 2 === 0; + }, + function (i, j) { + return j % 3 === 0; + }, + function (i, j) { + return (i + j) % 3 === 0; + }, + function (i, j) { + return (((i / 2) | 0) + ((j / 3) | 0)) % 2 === 0; + }, + function (i, j) { + return (i * j) % 2 + (i * j) % 3 === 0; + }, + function (i, j) { + return ((i * j) % 2 + (i * j) % 3) % 2 === 0; + }, + function (i, j) { + return ((i + j) % 2 + (i * j) % 3) % 2 === 0; + }]; + +// returns true when the version information has to be embeded. +var needsverinfo = function (ver) { + return ver > 6; +}; + +// returns the size of entire QR code for given version. +var getsizebyver = function (ver) { + return 4 * ver + 17; +}; + +// returns the number of bits available for code words in this version. +var nfullbits = function (ver) { + /* + * |<--------------- n --------------->| + * | |<----- n-17 ---->| | + * +-------+ ///+-------+ ---- + * | | ///| | ^ + * | 9x9 | @@@@@ ///| 9x8 | | + * | | # # # @5x5@ # # # | | | + * +-------+ @@@@@ +-------+ | + * # ---| + * ^ | + * # | + * @@@@@ @@@@@ @@@@@ | n + * @5x5@ @5x5@ @5x5@ n-17 + * @@@@@ @@@@@ @@@@@ | | + * # | | + * ////// v | + * //////# ---| + * +-------+ @@@@@ @@@@@ | + * | | @5x5@ @5x5@ | + * | 8x9 | @@@@@ @@@@@ | + * | | v + * +-------+ ---- + * + * when the entire code has n^2 modules and there are m^2-3 alignment + * patterns, we have: + * - 225 (= 9x9 + 9x8 + 8x9) modules for finder patterns and + * format information; + * - 2n-34 (= 2(n-17)) modules for timing patterns; + * - 36 (= 3x6 + 6x3) modules for version information, if any; + * - 25m^2-75 (= (m^2-3)(5x5)) modules for alignment patterns + * if any, but 10m-20 (= 2(m-2)x5) of them overlaps with + * timing patterns. + */ + var v = VERSIONS[ver]; + var nbits = 16 * ver * ver + 128 * ver + 64; // finder, timing and format info. + if (needsverinfo(ver)) + nbits -= 36; // version information + if (v[2].length) { // alignment patterns + nbits -= 25 * v[2].length * v[2].length - 10 * v[2].length - 55; + } + return nbits; +}; + +// returns the number of bits available for data portions (i.e. excludes ECC +// bits but includes mode and length bits) in this version and ECC level. +var ndatabits = function (ver, ecclevel) { + var nbits = nfullbits(ver) & ~7; // no sub-octet code words + var v = VERSIONS[ver]; + nbits -= 8 * v[0][ecclevel] * v[1][ecclevel]; // ecc bits + return nbits; +}; + +// returns the number of bits required for the length of data. +// (cf. Table 3 in JIS X 0510:2004 p. 16) +var ndatalenbits = function (ver, mode) { + switch (mode) { + case MODE_NUMERIC: + return (ver < 10 ? 10 : ver < 27 ? 12 : 14); + case MODE_ALPHANUMERIC: + return (ver < 10 ? 9 : ver < 27 ? 11 : 13); + case MODE_OCTET: + return (ver < 10 ? 8 : 16); + case MODE_KANJI: + return (ver < 10 ? 8 : ver < 27 ? 10 : 12); + } +}; + +// returns the maximum length of data possible in given configuration. +var getmaxdatalen = function (ver, mode, ecclevel) { + var nbits = ndatabits(ver, ecclevel) - 4 - ndatalenbits(ver, mode); // 4 for mode bits + switch (mode) { + case MODE_NUMERIC: + return ((nbits / 10) | 0) * 3 + (nbits % 10 < 4 ? 0 : nbits % 10 < 7 ? 1 : 2); + case MODE_ALPHANUMERIC: + return ((nbits / 11) | 0) * 2 + (nbits % 11 < 6 ? 0 : 1); + case MODE_OCTET: + return (nbits / 8) | 0; + case MODE_KANJI: + return (nbits / 13) | 0; + } +}; + +// checks if the given data can be encoded in given mode, and returns +// the converted data for the further processing if possible. otherwise +// returns null. +// +// this function does not check the length of data; it is a duty of +// encode function below (as it depends on the version and ECC level too). +var validatedata = function (mode, data) { + switch (mode) { + case MODE_NUMERIC: + if (!data.match(NUMERIC_REGEXP)) + return null; + return data; + + case MODE_ALPHANUMERIC: + if (!data.match(ALPHANUMERIC_REGEXP)) + return null; + return data.toUpperCase(); + + case MODE_OCTET: + if (typeof data === 'string') { // encode as utf-8 string + var newdata = []; + for (var i = 0; i < data.length; ++i) { + var ch = data.charCodeAt(i); + if (ch < 0x80) { + newdata.push(ch); + } else if (ch < 0x800) { + newdata.push(0xc0 | (ch >> 6), + 0x80 | (ch & 0x3f)); + } else if (ch < 0x10000) { + newdata.push(0xe0 | (ch >> 12), + 0x80 | ((ch >> 6) & 0x3f), + 0x80 | (ch & 0x3f)); + } else { + newdata.push(0xf0 | (ch >> 18), + 0x80 | ((ch >> 12) & 0x3f), + 0x80 | ((ch >> 6) & 0x3f), + 0x80 | (ch & 0x3f)); + } + } + return newdata; + } else { + return data; + } + } +}; + +// returns the code words (sans ECC bits) for given data and configurations. +// requires data to be preprocessed by validatedata. no length check is +// performed, and everything has to be checked before calling this function. +var encode = function (ver, mode, data, maxbuflen) { + var buf = []; + var bits = 0, remaining = 8; + var datalen = data.length; + + // this function is intentionally no-op when n=0. + var pack = function (x, n) { + if (n >= remaining) { + buf.push(bits | (x >> (n -= remaining))); + while (n >= 8) + buf.push((x >> (n -= 8)) & 255); + bits = 0; + remaining = 8; + } + if (n > 0) + bits |= (x & ((1 << n) - 1)) << (remaining -= n); + }; + + var nlenbits = ndatalenbits(ver, mode); + pack(mode, 4); + pack(datalen, nlenbits); + + switch (mode) { + case MODE_NUMERIC: + for (var i = 2; i < datalen; i += 3) { + pack(parseInt(data.substring(i - 2, i + 1), 10), 10); + } + pack(parseInt(data.substring(i - 2), 10), [0, 4, 7][datalen % 3]); + break; + + case MODE_ALPHANUMERIC: + for (var i = 1; i < datalen; i += 2) { + pack(ALPHANUMERIC_MAP[data.charAt(i - 1)] * 45 + + ALPHANUMERIC_MAP[data.charAt(i)], 11); + } + if (datalen % 2 == 1) { + pack(ALPHANUMERIC_MAP[data.charAt(i - 1)], 6); + } + break; + + case MODE_OCTET: + for (var i = 0; i < datalen; ++i) { + pack(data[i], 8); + } + break; + } + + // final bits. it is possible that adding terminator causes the buffer + // to overflow, but then the buffer truncated to the maximum size will + // be valid as the truncated terminator mode bits and padding is + // identical in appearance (cf. JIS X 0510:2004 sec 8.4.8). + pack(MODE_TERMINATOR, 4); + if (remaining < 8) + buf.push(bits); + + // the padding to fill up the remaining space. we should not add any + // words when the overflow already occurred. + while (buf.length + 1 < maxbuflen) + buf.push(0xec, 0x11); + if (buf.length < maxbuflen) + buf.push(0xec); + return buf; +}; + +// calculates ECC code words for given code words and generator polynomial. +// +// this is quite similar to CRC calculation as both Reed-Solomon and CRC use +// the certain kind of cyclic codes, which is effectively the division of +// zero-augumented polynomial by the generator polynomial. the only difference +// is that Reed-Solomon uses GF(2^8), instead of CRC's GF(2), and Reed-Solomon +// uses the different generator polynomial than CRC's. +var calculateecc = function (poly, genpoly) { + var modulus = poly.slice(0); + var polylen = poly.length, genpolylen = genpoly.length; + for (var i = 0; i < genpolylen; ++i) + modulus.push(0); + for (var i = 0; i < polylen; ) { + var quotient = GF256_INVMAP[modulus[i++]]; + if (quotient >= 0) { + for (var j = 0; j < genpolylen; ++j) { + modulus[i + j] ^= GF256_MAP[(quotient + genpoly[j]) % 255]; + } + } + } + return modulus.slice(polylen); +}; + +// auguments ECC code words to given code words. the resulting words are +// ready to be encoded in the matrix. +// +// the much of actual augumenting procedure follows JIS X 0510:2004 sec 8.7. +// the code is simplified using the fact that the size of each code & ECC +// blocks is almost same; for example, when we have 4 blocks and 46 data words +// the number of code words in those blocks are 11, 11, 12, 12 respectively. +var augumenteccs = function (poly, nblocks, genpoly) { + var subsizes = []; + var subsize = (poly.length / nblocks) | 0, subsize0 = 0; + var pivot = nblocks - poly.length % nblocks; + for (var i = 0; i < pivot; ++i) { + subsizes.push(subsize0); + subsize0 += subsize; + } + for (var i = pivot; i < nblocks; ++i) { + subsizes.push(subsize0); + subsize0 += subsize + 1; + } + subsizes.push(subsize0); + + var eccs = []; + for (var i = 0; i < nblocks; ++i) { + eccs.push(calculateecc(poly.slice(subsizes[i], subsizes[i + 1]), genpoly)); + } + + var result = []; + var nitemsperblock = (poly.length / nblocks) | 0; + for (var i = 0; i < nitemsperblock; ++i) { + for (var j = 0; j < nblocks; ++j) { + result.push(poly[subsizes[j] + i]); + } + } + for (var j = pivot; j < nblocks; ++j) { + result.push(poly[subsizes[j + 1] - 1]); + } + for (var i = 0; i < genpoly.length; ++i) { + for (var j = 0; j < nblocks; ++j) { + result.push(eccs[j][i]); + } + } + return result; +}; + +// auguments BCH(p+q,q) code to the polynomial over GF(2), given the proper +// genpoly. the both input and output are in binary numbers, and unlike +// calculateecc genpoly should include the 1 bit for the highest degree. +// +// actual polynomials used for this procedure are as follows: +// - p=10, q=5, genpoly=x^10+x^8+x^5+x^4+x^2+x+1 (JIS X 0510:2004 Appendix C) +// - p=18, q=6, genpoly=x^12+x^11+x^10+x^9+x^8+x^5+x^2+1 (ibid. Appendix D) +var augumentbch = function (poly, p, genpoly, q) { + var modulus = poly << q; + for (var i = p - 1; i >= 0; --i) { + if ((modulus >> (q + i)) & 1) + modulus ^= genpoly << i; + } + return (poly << q) | modulus; +}; + +// creates the base matrix for given version. it returns two matrices, one of +// them is the actual one and the another represents the "reserved" portion +// (e.g. finder and timing patterns) of the matrix. +// +// some entries in the matrix may be undefined, rather than 0 or 1. this is +// intentional (no initialization needed!), and putdata below will fill +// the remaining ones. +var makebasematrix = function (ver) { + var v = VERSIONS[ver], n = getsizebyver(ver); + var matrix = [], reserved = []; + for (var i = 0; i < n; ++i) { + matrix.push([]); + reserved.push([]); + } + + var blit = function (y, x, h, w, bits) { + for (var i = 0; i < h; ++i) { + for (var j = 0; j < w; ++j) { + matrix[y + i][x + j] = (bits[i] >> j) & 1; + reserved[y + i][x + j] = 1; + } + } + }; + + // finder patterns and a part of timing patterns + // will also mark the format information area (not yet written) as reserved. + blit(0, 0, 9, 9, [0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x17f, 0x00, 0x40]); + blit(n - 8, 0, 8, 9, [0x100, 0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x7f]); + blit(0, n - 8, 9, 8, [0xfe, 0x82, 0xba, 0xba, 0xba, 0x82, 0xfe, 0x00, 0x00]); + + // the rest of timing patterns + for (var i = 9; i < n - 8; ++i) { + matrix[6][i] = matrix[i][6] = ~i & 1; + reserved[6][i] = reserved[i][6] = 1; + } + + // alignment patterns + var aligns = v[2], m = aligns.length; + for (var i = 0; i < m; ++i) { + var minj = (i === 0 || i === m - 1 ? 1 : 0), maxj = (i === 0 ? m - 1 : m); + for (var j = minj; j < maxj; ++j) { + blit(aligns[i], aligns[j], 5, 5, [0x1f, 0x11, 0x15, 0x11, 0x1f]); + } + } + + // version information + if (needsverinfo(ver)) { + var code = augumentbch(ver, 6, 0x1f25, 12); + var k = 0; + for (var i = 0; i < 6; ++i) { + for (var j = 0; j < 3; ++j) { + matrix[i][(n - 11) + j] = matrix[(n - 11) + j][i] = (code >> k++) & 1; + reserved[i][(n - 11) + j] = reserved[(n - 11) + j][i] = 1; + } + } + } + + return {matrix: matrix, reserved: reserved}; +}; + +// fills the data portion (i.e. unmarked in reserved) of the matrix with given +// code words. the size of code words should be no more than available bits, +// and remaining bits are padded to 0 (cf. JIS X 0510:2004 sec 8.7.3). +var putdata = function (matrix, reserved, buf) { + var n = matrix.length; + var k = 0, dir = -1; + for (var i = n - 1; i >= 0; i -= 2) { + if (i == 6) + --i; // skip the entire timing pattern column + var jj = (dir < 0 ? n - 1 : 0); + for (var j = 0; j < n; ++j) { + for (var ii = i; ii > i - 2; --ii) { + if (!reserved[jj][ii]) { + // may overflow, but (undefined >> x) + // is 0 so it will auto-pad to zero. + matrix[jj][ii] = (buf[k >> 3] >> (~k & 7)) & 1; + ++k; + } + } + jj += dir; + } + dir = -dir; + } + return matrix; +}; + +// XOR-masks the data portion of the matrix. repeating the call with the same +// arguments will revert the prior call (convenient in the matrix evaluation). +var maskdata = function (matrix, reserved, mask) { + var maskf = MASKFUNCS[mask]; + var n = matrix.length; + for (var i = 0; i < n; ++i) { + for (var j = 0; j < n; ++j) { + if (!reserved[i][j]) + matrix[i][j] ^= maskf(i, j); + } + } + return matrix; +}; + +// puts the format information. +var putformatinfo = function (matrix, reserved, ecclevel, mask) { + var n = matrix.length; + var code = augumentbch((ecclevel << 3) | mask, 5, 0x537, 10) ^ 0x5412; + for (var i = 0; i < 15; ++i) { + var r = [0, 1, 2, 3, 4, 5, 7, 8, n - 7, n - 6, n - 5, n - 4, n - 3, n - 2, n - 1][i]; + var c = [n - 1, n - 2, n - 3, n - 4, n - 5, n - 6, n - 7, n - 8, 7, 5, 4, 3, 2, 1, 0][i]; + matrix[r][8] = matrix[8][c] = (code >> i) & 1; + // we don't have to mark those bits reserved; always done + // in makebasematrix above. + } + return matrix; +}; + +// evaluates the resulting matrix and returns the score (lower is better). +// (cf. JIS X 0510:2004 sec 8.8.2) +// +// the evaluation procedure tries to avoid the problematic patterns naturally +// occuring from the original matrix. for example, it penaltizes the patterns +// which just look like the finder pattern which will confuse the decoder. +// we choose the mask which results in the lowest score among 8 possible ones. +// +// note: zxing seems to use the same procedure and in many cases its choice +// agrees to ours, but sometimes it does not. practically it doesn't matter. +var evaluatematrix = function (matrix) { + // N1+(k-5) points for each consecutive row of k same-colored modules, + // where k >= 5. no overlapping row counts. + var PENALTY_CONSECUTIVE = 3; + // N2 points for each 2x2 block of same-colored modules. + // overlapping block does count. + var PENALTY_TWOBYTWO = 3; + // N3 points for each pattern with >4W:1B:1W:3B:1W:1B or + // 1B:1W:3B:1W:1B:>4W, or their multiples (e.g. highly unlikely, + // but 13W:3B:3W:9B:3W:3B counts). + var PENALTY_FINDERLIKE = 40; + // N4*k points for every (5*k)% deviation from 50% black density. + // i.e. k=1 for 55~60% and 40~45%, k=2 for 60~65% and 35~40%, etc. + var PENALTY_DENSITY = 10; + + var evaluategroup = function (groups) { // assumes [W,B,W,B,W,...,B,W] + var score = 0; + for (var i = 0; i < groups.length; ++i) { + if (groups[i] >= 5) + score += PENALTY_CONSECUTIVE + (groups[i] - 5); + } + for (var i = 5; i < groups.length; i += 2) { + var p = groups[i]; + if (groups[i - 1] == p && groups[i - 2] == 3 * p && groups[i - 3] == p && + groups[i - 4] == p && (groups[i - 5] >= 4 * p || groups[i + 1] >= 4 * p)) { + // this part differs from zxing... + score += PENALTY_FINDERLIKE; + } + } + return score; + }; + + var n = matrix.length; + var score = 0, nblacks = 0; + for (var i = 0; i < n; ++i) { + var row = matrix[i]; + var groups; + + // evaluate the current row + groups = [0]; // the first empty group of white + for (var j = 0; j < n; ) { + var k; + for (k = 0; j < n && row[j]; ++k) + ++j; + groups.push(k); + for (k = 0; j < n && !row[j]; ++k) + ++j; + groups.push(k); + } + score += evaluategroup(groups); + + // evaluate the current column + groups = [0]; + for (var j = 0; j < n; ) { + var k; + for (k = 0; j < n && matrix[j][i]; ++k) + ++j; + groups.push(k); + for (k = 0; j < n && !matrix[j][i]; ++k) + ++j; + groups.push(k); + } + score += evaluategroup(groups); + + // check the 2x2 box and calculate the density + var nextrow = matrix[i + 1] || []; + nblacks += row[0]; + for (var j = 1; j < n; ++j) { + var p = row[j]; + nblacks += p; + // at least comparison with next row should be strict... + if (row[j - 1] == p && nextrow[j] === p && nextrow[j - 1] === p) { + score += PENALTY_TWOBYTWO; + } + } + } + + score += PENALTY_DENSITY * ((Math.abs(nblacks / n / n - 0.5) / 0.05) | 0); + return score; +}; + +// returns the fully encoded QR code matrix which contains given data. +// it also chooses the best mask automatically when mask is -1. +var generate = function (data, ver, mode, ecclevel, mask) { + var v = VERSIONS[ver]; + var buf = encode(ver, mode, data, ndatabits(ver, ecclevel) >> 3); + buf = augumenteccs(buf, v[1][ecclevel], GF256_GENPOLY[v[0][ecclevel]]); + + var result = makebasematrix(ver); + var matrix = result.matrix, reserved = result.reserved; + putdata(matrix, reserved, buf); + + if (mask < 0) { + // find the best mask + maskdata(matrix, reserved, 0); + putformatinfo(matrix, reserved, ecclevel, 0); + var bestmask = 0, bestscore = evaluatematrix(matrix); + maskdata(matrix, reserved, 0); + for (mask = 1; mask < 8; ++mask) { + maskdata(matrix, reserved, mask); + putformatinfo(matrix, reserved, ecclevel, mask); + var score = evaluatematrix(matrix); + if (bestscore > score) { + bestscore = score; + bestmask = mask; + } + maskdata(matrix, reserved, mask); + } + mask = bestmask; + } + + maskdata(matrix, reserved, mask); + putformatinfo(matrix, reserved, ecclevel, mask); + return matrix; +}; + +// the public interface is trivial; the options available are as follows: +// +// - version: an integer in [1,40]. when omitted (or -1) the smallest possible +// version is chosen. +// - mode: one of 'numeric', 'alphanumeric', 'octet'. when omitted the smallest +// possible mode is chosen. +// - eccLevel: one of 'L', 'M', 'Q', 'H'. defaults to 'L'. +// - mask: an integer in [0,7]. when omitted (or -1) the best mask is chosen. +// + +function generateFrame(data, options) { + var MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC, + 'octet': MODE_OCTET}; + var ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q, + 'H': ECCLEVEL_H}; + + options = options || {}; + var ver = options.version || -1; + var ecclevel = ECCLEVELS[(options.eccLevel || 'L').toUpperCase()]; + var mode = options.mode ? MODES[options.mode.toLowerCase()] : -1; + var mask = 'mask' in options ? options.mask : -1; + + if (mode < 0) { + if (typeof data === 'string') { + if (data.match(NUMERIC_REGEXP)) { + mode = MODE_NUMERIC; + } else if (data.match(ALPHANUMERIC_OUT_REGEXP)) { + // while encode supports case-insensitive encoding, we restrict the data to be uppercased when auto-selecting the mode. + mode = MODE_ALPHANUMERIC; + } else { + mode = MODE_OCTET; + } + } else { + mode = MODE_OCTET; + } + } else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC || + mode == MODE_OCTET)) { + throw 'invalid or unsupported mode'; + } + + data = validatedata(mode, data); + if (data === null) + throw 'invalid data format'; + + if (ecclevel < 0 || ecclevel > 3) + throw 'invalid ECC level'; + + if (ver < 0) { + for (ver = 1; ver <= 40; ++ver) { + if (data.length <= getmaxdatalen(ver, mode, ecclevel)) + break; + } + if (ver > 40) + throw 'too large data for the Qr format'; + } else if (ver < 1 || ver > 40) { + throw 'invalid Qr version! should be between 1 and 40'; + } + + if (mask != -1 && (mask < 0 || mask > 8)) + throw 'invalid mask'; + //console.log('version:', ver, 'mode:', mode, 'ECC:', ecclevel, 'mask:', mask ) + return generate(data, ver, mode, ecclevel, mask); +} + + +// options +// - modulesize: a number. this is a size of each modules in pixels, and +// defaults to 5px. +// - margin: a number. this is a size of margin in *modules*, and defaults to +// 4 (white modules). the specficiation mandates the margin no less than 4 +// modules, so it is better not to alter this value unless you know what +// you're doing. +function buildCanvas(data, options) { + + var canvas = []; + var background = options.background || '#fff'; + var foreground = options.foreground || '#000'; + //var margin = options.margin || 4; + var matrix = generateFrame(data, options); + var n = matrix.length; + var modSize = Math.floor(options.fit ? options.fit / n : 5); + var size = n * modSize; + + canvas.push({ + type: 'rect', + x: 0, y: 0, w: size, h: size, lineWidth: 0, color: background + }); + + for (var i = 0; i < n; ++i) { + for (var j = 0; j < n; ++j) { + if (matrix[i][j]) { + canvas.push({ + type: 'rect', + x: modSize * j, + y: modSize * i, + w: modSize, + h: modSize, + lineWidth: 0, + color: foreground + }); + } + } + } + + return { + canvas: canvas, + size: size + }; + +} + +function measure(node) { + var cd = buildCanvas(node.qr, node); + node._canvas = cd.canvas; + node._width = node._height = node._minWidth = node._maxWidth = node._minHeight = node._maxHeight = cd.size; + return node; +} + +module.exports = { + measure: measure +}; + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ElementWriter = __webpack_require__(136); + +/** + * Creates an instance of PageElementWriter - an extended ElementWriter + * which can handle: + * - page-breaks (it adds new pages when there's not enough space left), + * - repeatable fragments (like table-headers, which are repeated everytime + * a page-break occurs) + * - transactions (used for unbreakable-blocks when we want to make sure + * whole block will be rendered on the same page) + */ +function PageElementWriter(context, tracker) { + this.transactionLevel = 0; + this.repeatables = []; + this.tracker = tracker; + this.writer = new ElementWriter(context, tracker); +} + +function fitOnPage(self, addFct) { + var position = addFct(self); + if (!position) { + self.moveToNextPage(); + position = addFct(self); + } + return position; +} + +PageElementWriter.prototype.addLine = function (line, dontUpdateContextPosition, index) { + return fitOnPage(this, function (self) { + return self.writer.addLine(line, dontUpdateContextPosition, index); + }); +}; + +PageElementWriter.prototype.addImage = function (image, index) { + return fitOnPage(this, function (self) { + return self.writer.addImage(image, index); + }); +}; + +PageElementWriter.prototype.addQr = function (qr, index) { + return fitOnPage(this, function (self) { + return self.writer.addQr(qr, index); + }); +}; + +PageElementWriter.prototype.addVector = function (vector, ignoreContextX, ignoreContextY, index) { + return this.writer.addVector(vector, ignoreContextX, ignoreContextY, index); +}; + +PageElementWriter.prototype.beginClip = function (width, height) { + return this.writer.beginClip(width, height); +}; + +PageElementWriter.prototype.endClip = function () { + return this.writer.endClip(); +}; + +PageElementWriter.prototype.alignCanvas = function (node) { + this.writer.alignCanvas(node); +}; + +PageElementWriter.prototype.addFragment = function (fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition) { + if (!this.writer.addFragment(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition)) { + this.moveToNextPage(); + this.writer.addFragment(fragment, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition); + } +}; + +PageElementWriter.prototype.moveToNextPage = function (pageOrientation) { + + var nextPage = this.writer.context.moveToNextPage(pageOrientation); + + if (nextPage.newPageCreated) { + this.repeatables.forEach(function (rep) { + this.writer.addFragment(rep, true); + }, this); + } else { + this.repeatables.forEach(function (rep) { + this.writer.context.moveDown(rep.height); + }, this); + } + + this.writer.tracker.emit('pageChanged', { + prevPage: nextPage.prevPage, + prevY: nextPage.prevY, + y: nextPage.y + }); +}; + +PageElementWriter.prototype.beginUnbreakableBlock = function (width, height) { + if (this.transactionLevel++ === 0) { + this.originalX = this.writer.context.x; + this.writer.pushContext(width, height); + } +}; + +PageElementWriter.prototype.commitUnbreakableBlock = function (forcedX, forcedY) { + if (--this.transactionLevel === 0) { + var unbreakableContext = this.writer.context; + this.writer.popContext(); + + var nbPages = unbreakableContext.pages.length; + if (nbPages > 0) { + // no support for multi-page unbreakableBlocks + var fragment = unbreakableContext.pages[0]; + fragment.xOffset = forcedX; + fragment.yOffset = forcedY; + + //TODO: vectors can influence height in some situations + if (nbPages > 1) { + // on out-of-context blocs (headers, footers, background) height should be the whole DocumentContext height + if (forcedX !== undefined || forcedY !== undefined) { + fragment.height = unbreakableContext.getCurrentPage().pageSize.height - unbreakableContext.pageMargins.top - unbreakableContext.pageMargins.bottom; + } else { + fragment.height = this.writer.context.getCurrentPage().pageSize.height - this.writer.context.pageMargins.top - this.writer.context.pageMargins.bottom; + for (var i = 0, l = this.repeatables.length; i < l; i++) { + fragment.height -= this.repeatables[i].height; + } + } + } else { + fragment.height = unbreakableContext.y; + } + + if (forcedX !== undefined || forcedY !== undefined) { + this.writer.addFragment(fragment, true, true, true); + } else { + this.addFragment(fragment); + } + } + } +}; + +PageElementWriter.prototype.currentBlockToRepeatable = function () { + var unbreakableContext = this.writer.context; + var rep = {items: []}; + + unbreakableContext.pages[0].items.forEach(function (item) { + rep.items.push(item); + }); + + rep.xOffset = this.originalX; + + //TODO: vectors can influence height in some situations + rep.height = unbreakableContext.y; + + return rep; +}; + +PageElementWriter.prototype.pushToRepeatables = function (rep) { + this.repeatables.push(rep); +}; + +PageElementWriter.prototype.popFromRepeatables = function () { + this.repeatables.pop(); +}; + +PageElementWriter.prototype.context = function () { + return this.writer.context; +}; + +module.exports = PageElementWriter; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Line = __webpack_require__(82); +var isNumber = __webpack_require__(0).isNumber; +var pack = __webpack_require__(0).pack; +var offsetVector = __webpack_require__(0).offsetVector; +var DocumentContext = __webpack_require__(81); + +/** + * Creates an instance of ElementWriter - a line/vector writer, which adds + * elements to current page and sets their positions based on the context + */ +function ElementWriter(context, tracker) { + this.context = context; + this.contextStack = []; + this.tracker = tracker; +} + +function addPageItem(page, item, index) { + if (index === null || index === undefined || index < 0 || index > page.items.length) { + page.items.push(item); + } else { + page.items.splice(index, 0, item); + } +} + +ElementWriter.prototype.addLine = function (line, dontUpdateContextPosition, index) { + var height = line.getHeight(); + var context = this.context; + var page = context.getCurrentPage(), + position = this.getCurrentPositionOnPage(); + + if (context.availableHeight < height || !page) { + return false; + } + + line.x = context.x + (line.x || 0); + line.y = context.y + (line.y || 0); + + this.alignLine(line); + + addPageItem(page, { + type: 'line', + item: line + }, index); + this.tracker.emit('lineAdded', line); + + if (!dontUpdateContextPosition) { + context.moveDown(height); + } + + return position; +}; + +ElementWriter.prototype.alignLine = function (line) { + var width = this.context.availableWidth; + var lineWidth = line.getWidth(); + + var alignment = line.inlines && line.inlines.length > 0 && line.inlines[0].alignment; + + var offset = 0; + switch (alignment) { + case 'right': + offset = width - lineWidth; + break; + case 'center': + offset = (width - lineWidth) / 2; + break; + } + + if (offset) { + line.x = (line.x || 0) + offset; + } + + if (alignment === 'justify' && + !line.newLineForced && + !line.lastLineInParagraph && + line.inlines.length > 1) { + var additionalSpacing = (width - lineWidth) / (line.inlines.length - 1); + + for (var i = 1, l = line.inlines.length; i < l; i++) { + offset = i * additionalSpacing; + + line.inlines[i].x += offset; + line.inlines[i].justifyShift = additionalSpacing; + } + } +}; + +ElementWriter.prototype.addImage = function (image, index) { + var context = this.context; + var page = context.getCurrentPage(), + position = this.getCurrentPositionOnPage(); + + if (!page || (image.absolutePosition === undefined && context.availableHeight < image._height && page.items.length > 0)) { + return false; + } + + if (image._x === undefined) { + image._x = image.x || 0; + } + + image.x = context.x + image._x; + image.y = context.y; + + this.alignImage(image); + + addPageItem(page, { + type: 'image', + item: image + }, index); + + context.moveDown(image._height); + + return position; +}; + +ElementWriter.prototype.addQr = function (qr, index) { + var context = this.context; + var page = context.getCurrentPage(), + position = this.getCurrentPositionOnPage(); + + if (!page || (qr.absolutePosition === undefined && context.availableHeight < qr._height)) { + return false; + } + + if (qr._x === undefined) { + qr._x = qr.x || 0; + } + + qr.x = context.x + qr._x; + qr.y = context.y; + + this.alignImage(qr); + + for (var i = 0, l = qr._canvas.length; i < l; i++) { + var vector = qr._canvas[i]; + vector.x += qr.x; + vector.y += qr.y; + this.addVector(vector, true, true, index); + } + + context.moveDown(qr._height); + + return position; +}; + +ElementWriter.prototype.alignImage = function (image) { + var width = this.context.availableWidth; + var imageWidth = image._minWidth; + var offset = 0; + switch (image._alignment) { + case 'right': + offset = width - imageWidth; + break; + case 'center': + offset = (width - imageWidth) / 2; + break; + } + + if (offset) { + image.x = (image.x || 0) + offset; + } +}; + +ElementWriter.prototype.alignCanvas = function (node) { + var width = this.context.availableWidth; + var canvasWidth = node._minWidth; + var offset = 0; + switch (node._alignment) { + case 'right': + offset = width - canvasWidth; + break; + case 'center': + offset = (width - canvasWidth) / 2; + break; + } + if (offset) { + node.canvas.forEach(function (vector) { + offsetVector(vector, offset, 0); + }); + } +}; + +ElementWriter.prototype.addVector = function (vector, ignoreContextX, ignoreContextY, index) { + var context = this.context; + var page = context.getCurrentPage(), + position = this.getCurrentPositionOnPage(); + + if (page) { + offsetVector(vector, ignoreContextX ? 0 : context.x, ignoreContextY ? 0 : context.y); + addPageItem(page, { + type: 'vector', + item: vector + }, index); + return position; + } +}; + +ElementWriter.prototype.beginClip = function (width, height) { + var ctx = this.context; + var page = ctx.getCurrentPage(); + page.items.push({ + type: 'beginClip', + item: {x: ctx.x, y: ctx.y, width: width, height: height} + }); + return true; +}; + +ElementWriter.prototype.endClip = function () { + var ctx = this.context; + var page = ctx.getCurrentPage(); + page.items.push({ + type: 'endClip' + }); + return true; +}; + +function cloneLine(line) { + var result = new Line(line.maxWidth); + + for (var key in line) { + if (line.hasOwnProperty(key)) { + result[key] = line[key]; + } + } + + return result; +} + +ElementWriter.prototype.addFragment = function (block, useBlockXOffset, useBlockYOffset, dontUpdateContextPosition) { + var ctx = this.context; + var page = ctx.getCurrentPage(); + + if (!useBlockXOffset && block.height > ctx.availableHeight) { + return false; + } + + block.items.forEach(function (item) { + switch (item.type) { + case 'line': + var l = cloneLine(item.item); + + l.x = (l.x || 0) + (useBlockXOffset ? (block.xOffset || 0) : ctx.x); + l.y = (l.y || 0) + (useBlockYOffset ? (block.yOffset || 0) : ctx.y); + + page.items.push({ + type: 'line', + item: l + }); + break; + + case 'vector': + var v = pack(item.item); + + offsetVector(v, useBlockXOffset ? (block.xOffset || 0) : ctx.x, useBlockYOffset ? (block.yOffset || 0) : ctx.y); + page.items.push({ + type: 'vector', + item: v + }); + break; + + case 'image': + var img = pack(item.item); + + img.x = (img.x || 0) + (useBlockXOffset ? (block.xOffset || 0) : ctx.x); + img.y = (img.y || 0) + (useBlockYOffset ? (block.yOffset || 0) : ctx.y); + + page.items.push({ + type: 'image', + item: img + }); + break; + } + }); + + if (!dontUpdateContextPosition) { + ctx.moveDown(block.height); + } + + return true; +}; + +/** + * Pushes the provided context onto the stack or creates a new one + * + * pushContext(context) - pushes the provided context and makes it current + * pushContext(width, height) - creates and pushes a new context with the specified width and height + * pushContext() - creates a new context for unbreakable blocks (with current availableWidth and full-page-height) + */ +ElementWriter.prototype.pushContext = function (contextOrWidth, height) { + if (contextOrWidth === undefined) { + height = this.context.getCurrentPage().height - this.context.pageMargins.top - this.context.pageMargins.bottom; + contextOrWidth = this.context.availableWidth; + } + + if (isNumber(contextOrWidth)) { + contextOrWidth = new DocumentContext({width: contextOrWidth, height: height}, {left: 0, right: 0, top: 0, bottom: 0}); + } + + this.contextStack.push(this.context); + this.context = contextOrWidth; +}; + +ElementWriter.prototype.popContext = function () { + this.context = this.contextStack.pop(); +}; + +ElementWriter.prototype.getCurrentPositionOnPage = function () { + return (this.contextStack[0] || this.context).getCurrentPosition(); +}; + + +module.exports = ElementWriter; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ColumnCalculator = __webpack_require__(44); +var isFunction = __webpack_require__(0).isFunction; + +function TableProcessor(tableNode) { + this.tableNode = tableNode; +} + +TableProcessor.prototype.beginTable = function (writer) { + var tableNode; + var availableWidth; + var self = this; + + tableNode = this.tableNode; + this.offsets = tableNode._offsets; + this.layout = tableNode._layout; + + availableWidth = writer.context().availableWidth - this.offsets.total; + ColumnCalculator.buildColumnWidths(tableNode.table.widths, availableWidth); + + this.tableWidth = tableNode._offsets.total + getTableInnerContentWidth(); + this.rowSpanData = prepareRowSpanData(); + this.cleanUpRepeatables = false; + + this.headerRows = tableNode.table.headerRows || 0; + this.rowsWithoutPageBreak = this.headerRows + (tableNode.table.keepWithHeaderRows || 0); + this.dontBreakRows = tableNode.table.dontBreakRows || false; + + if (this.rowsWithoutPageBreak) { + writer.beginUnbreakableBlock(); + } + + // update the border properties of all cells before drawing any lines + prepareCellBorders(this.tableNode.table.body); + + this.drawHorizontalLine(0, writer); + + function getTableInnerContentWidth() { + var width = 0; + + tableNode.table.widths.forEach(function (w) { + width += w._calcWidth; + }); + + return width; + } + + function prepareRowSpanData() { + var rsd = []; + var x = 0; + var lastWidth = 0; + + rsd.push({left: 0, rowSpan: 0}); + + for (var i = 0, l = self.tableNode.table.body[0].length; i < l; i++) { + var paddings = self.layout.paddingLeft(i, self.tableNode) + self.layout.paddingRight(i, self.tableNode); + var lBorder = self.layout.vLineWidth(i, self.tableNode); + lastWidth = paddings + lBorder + self.tableNode.table.widths[i]._calcWidth; + rsd[rsd.length - 1].width = lastWidth; + x += lastWidth; + rsd.push({left: x, rowSpan: 0, width: 0}); + } + + return rsd; + } + + // Iterate through all cells. If the current cell is the start of a + // rowSpan/colSpan, update the border property of the cells on its + // bottom/right accordingly. This is needed since each iteration of the + // line-drawing loops draws lines for a single cell, not for an entire + // rowSpan/colSpan. + function prepareCellBorders(body) { + for (var rowIndex = 0; rowIndex < body.length; rowIndex++) { + var row = body[rowIndex]; + + for (var colIndex = 0; colIndex < row.length; colIndex++) { + var cell = row[colIndex]; + + if (cell.border) { + var rowSpan = cell.rowSpan || 1; + var colSpan = cell.colSpan || 1; + + for (var rowOffset = 0; rowOffset < rowSpan; rowOffset++) { + // set left border + if (cell.border[0] !== undefined && rowOffset > 0) { + setBorder(rowIndex + rowOffset, colIndex, 0, cell.border[0]); + } + + // set right border + if (cell.border[2] !== undefined) { + setBorder(rowIndex + rowOffset, colIndex + colSpan - 1, 2, cell.border[2]); + } + } + + for (var colOffset = 0; colOffset < colSpan; colOffset++) { + // set top border + if (cell.border[1] !== undefined && colOffset > 0) { + setBorder(rowIndex, colIndex + colOffset, 1, cell.border[1]); + } + + // set bottom border + if (cell.border[3] !== undefined) { + setBorder(rowIndex + rowSpan - 1, colIndex + colOffset, 3, cell.border[3]); + } + } + } + } + } + + // helper function to set the border for a given cell + function setBorder(rowIndex, colIndex, borderIndex, borderValue) { + var cell = body[rowIndex][colIndex]; + cell.border = cell.border || {}; + cell.border[borderIndex] = borderValue; + } + } +}; + +TableProcessor.prototype.onRowBreak = function (rowIndex, writer) { + var self = this; + return function () { + var offset = self.rowPaddingTop + (!self.headerRows ? self.topLineWidth : 0); + writer.context().availableHeight -= self.reservedAtBottom; + writer.context().moveDown(offset); + }; +}; + +TableProcessor.prototype.beginRow = function (rowIndex, writer) { + this.topLineWidth = this.layout.hLineWidth(rowIndex, this.tableNode); + this.rowPaddingTop = this.layout.paddingTop(rowIndex, this.tableNode); + this.bottomLineWidth = this.layout.hLineWidth(rowIndex + 1, this.tableNode); + this.rowPaddingBottom = this.layout.paddingBottom(rowIndex, this.tableNode); + + this.rowCallback = this.onRowBreak(rowIndex, writer); + writer.tracker.startTracking('pageChanged', this.rowCallback); + if (this.dontBreakRows) { + writer.beginUnbreakableBlock(); + } + this.rowTopY = writer.context().y; + this.reservedAtBottom = this.bottomLineWidth + this.rowPaddingBottom; + + writer.context().availableHeight -= this.reservedAtBottom; + + writer.context().moveDown(this.rowPaddingTop); +}; + +TableProcessor.prototype.drawHorizontalLine = function (lineIndex, writer, overrideY) { + var lineWidth = this.layout.hLineWidth(lineIndex, this.tableNode); + if (lineWidth) { + var offset = lineWidth / 2; + var currentLine = null; + var body = this.tableNode.table.body; + + for (var i = 0, l = this.rowSpanData.length; i < l; i++) { + var data = this.rowSpanData[i]; + var shouldDrawLine = !data.rowSpan; + + // draw only if the current cell requires a top border or the cell in the + // row above requires a bottom border + if (shouldDrawLine && i < l - 1) { + var topBorder = false, bottomBorder = false; + + // the current cell + if (lineIndex < body.length) { + var cell = body[lineIndex][i]; + topBorder = cell.border ? cell.border[1] : this.layout.defaultBorder; + } + + // the cell in the row above + if (lineIndex > 0) { + var cellAbove = body[lineIndex - 1][i]; + bottomBorder = cellAbove.border ? cellAbove.border[3] : this.layout.defaultBorder; + } + + shouldDrawLine = topBorder || bottomBorder; + } + + if (!currentLine && shouldDrawLine) { + currentLine = {left: data.left, width: 0}; + } + + if (shouldDrawLine) { + currentLine.width += (data.width || 0); + } + + var y = (overrideY || 0) + offset; + + if (!shouldDrawLine || i === l - 1) { + if (currentLine && currentLine.width) { + writer.addVector({ + type: 'line', + x1: currentLine.left, + x2: currentLine.left + currentLine.width, + y1: y, + y2: y, + lineWidth: lineWidth, + lineColor: isFunction(this.layout.hLineColor) ? this.layout.hLineColor(lineIndex, this.tableNode) : this.layout.hLineColor + }, false, overrideY); + currentLine = null; + } + } + } + + writer.context().moveDown(lineWidth); + } +}; + +TableProcessor.prototype.drawVerticalLine = function (x, y0, y1, vLineIndex, writer) { + var width = this.layout.vLineWidth(vLineIndex, this.tableNode); + if (width === 0) { + return; + } + writer.addVector({ + type: 'line', + x1: x + width / 2, + x2: x + width / 2, + y1: y0, + y2: y1, + lineWidth: width, + lineColor: isFunction(this.layout.vLineColor) ? this.layout.vLineColor(vLineIndex, this.tableNode) : this.layout.vLineColor + }, false, true); +}; + +TableProcessor.prototype.endTable = function (writer) { + if (this.cleanUpRepeatables) { + writer.popFromRepeatables(); + this.headerRepeatableHeight = null; + } +}; + +TableProcessor.prototype.endRow = function (rowIndex, writer, pageBreaks) { + var l, i; + var self = this; + writer.tracker.stopTracking('pageChanged', this.rowCallback); + writer.context().moveDown(this.layout.paddingBottom(rowIndex, this.tableNode)); + writer.context().availableHeight += this.reservedAtBottom; + + var endingPage = writer.context().page; + var endingY = writer.context().y; + + var xs = getLineXs(); + + var ys = []; + + var hasBreaks = pageBreaks && pageBreaks.length > 0; + var body = this.tableNode.table.body; + + ys.push({ + y0: this.rowTopY, + page: hasBreaks ? pageBreaks[0].prevPage : endingPage + }); + + if (hasBreaks) { + for (i = 0, l = pageBreaks.length; i < l; i++) { + var pageBreak = pageBreaks[i]; + ys[ys.length - 1].y1 = pageBreak.prevY; + + ys.push({y0: pageBreak.y, page: pageBreak.prevPage + 1}); + + if (this.headerRepeatableHeight) { + ys[ys.length - 1].y0 += this.headerRepeatableHeight; + } + } + } + + ys[ys.length - 1].y1 = endingY; + + var skipOrphanePadding = (ys[0].y1 - ys[0].y0 === this.rowPaddingTop); + for (var yi = (skipOrphanePadding ? 1 : 0), yl = ys.length; yi < yl; yi++) { + var willBreak = yi < ys.length - 1; + var rowBreakWithoutHeader = (yi > 0 && !this.headerRows); + var hzLineOffset = rowBreakWithoutHeader ? 0 : this.topLineWidth; + var y1 = ys[yi].y0; + var y2 = ys[yi].y1; + + if (willBreak) { + y2 = y2 + this.rowPaddingBottom; + } + + if (writer.context().page != ys[yi].page) { + writer.context().page = ys[yi].page; + + //TODO: buggy, availableHeight should be updated on every pageChanged event + // TableProcessor should be pageChanged listener, instead of processRow + this.reservedAtBottom = 0; + } + + for (i = 0, l = xs.length; i < l; i++) { + var leftBorder = false, rightBorder = false; + var colIndex = xs[i].index; + + // the current cell + if (colIndex < body[rowIndex].length) { + var cell = body[rowIndex][colIndex]; + leftBorder = cell.border ? cell.border[0] : this.layout.defaultBorder; + } + + // the cell from before column + if (colIndex > 0) { + var cell = body[rowIndex][colIndex - 1]; + rightBorder = cell.border ? cell.border[2] : this.layout.defaultBorder; + } + + if (leftBorder || rightBorder) { + this.drawVerticalLine(xs[i].x, y1 - hzLineOffset, y2 + this.bottomLineWidth, xs[i].index, writer); + } + + if (i < l - 1) { + var fillColor = body[rowIndex][colIndex].fillColor; + if (!fillColor) { + fillColor = isFunction(this.layout.fillColor) ? this.layout.fillColor(rowIndex, this.tableNode, colIndex) : this.layout.fillColor; + } + if (fillColor) { + var wBorder = (leftBorder || rightBorder) ? this.layout.vLineWidth(colIndex, this.tableNode) : 0; + var xf = xs[i].x + wBorder; + var yf = this.dontBreakRows ? y1 : y1 - hzLineOffset; + writer.addVector({ + type: 'rect', + x: xf, + y: yf, + w: xs[i + 1].x - xf, + h: y2 + this.bottomLineWidth - yf, + lineWidth: 0, + color: fillColor + }, false, true, writer.context().hasBackground ? 1 : 0); + } + } + } + + if (willBreak && this.layout.hLineWhenBroken !== false) { + this.drawHorizontalLine(rowIndex + 1, writer, y2); + } + if (rowBreakWithoutHeader && this.layout.hLineWhenBroken !== false) { + this.drawHorizontalLine(rowIndex, writer, y1); + } + } + + writer.context().page = endingPage; + writer.context().y = endingY; + + var row = this.tableNode.table.body[rowIndex]; + for (i = 0, l = row.length; i < l; i++) { + if (row[i].rowSpan) { + this.rowSpanData[i].rowSpan = row[i].rowSpan; + + // fix colSpans + if (row[i].colSpan && row[i].colSpan > 1) { + for (var j = 1; j < row[i].rowSpan; j++) { + this.tableNode.table.body[rowIndex + j][i]._colSpan = row[i].colSpan; + } + } + } + + if (this.rowSpanData[i].rowSpan > 0) { + this.rowSpanData[i].rowSpan--; + } + } + + this.drawHorizontalLine(rowIndex + 1, writer); + + if (this.headerRows && rowIndex === this.headerRows - 1) { + this.headerRepeatable = writer.currentBlockToRepeatable(); + } + + if (this.dontBreakRows) { + writer.tracker.auto('pageChanged', + function () { + if (!self.headerRows && self.layout.hLineWhenBroken !== false) { + self.drawHorizontalLine(rowIndex, writer); + } + }, + function () { + writer.commitUnbreakableBlock(); + } + ); + } + + if (this.headerRepeatable && (rowIndex === (this.rowsWithoutPageBreak - 1) || rowIndex === this.tableNode.table.body.length - 1)) { + this.headerRepeatableHeight = this.headerRepeatable.height; + writer.commitUnbreakableBlock(); + writer.pushToRepeatables(this.headerRepeatable); + this.cleanUpRepeatables = true; + this.headerRepeatable = null; + } + + function getLineXs() { + var result = []; + var cols = 0; + + for (var i = 0, l = self.tableNode.table.body[rowIndex].length; i < l; i++) { + if (!cols) { + result.push({x: self.rowSpanData[i].left, index: i}); + + var item = self.tableNode.table.body[rowIndex][i]; + cols = (item._colSpan || item.colSpan || 0); + } + if (cols > 0) { + cols--; + } + } + + result.push({x: self.rowSpanData[self.rowSpanData.length - 1].left, index: self.rowSpanData.length - 1}); + + return result; + } +}; + +module.exports = TableProcessor; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {// Generated by CoffeeScript 1.12.6 + +/* +PDFDocument - represents an entire PDF document +By Devon Govett + */ + +(function() { + var PDFDocument, PDFObject, PDFPage, PDFReference, fs, stream, + extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, + hasProp = {}.hasOwnProperty; + + stream = __webpack_require__(15); + + fs = __webpack_require__(8); + + PDFObject = __webpack_require__(26); + + PDFReference = __webpack_require__(87); + + PDFPage = __webpack_require__(161); + + PDFDocument = (function(superClass) { + var mixin; + + extend(PDFDocument, superClass); + + function PDFDocument(options1) { + var key, ref1, ref2, val; + this.options = options1 != null ? options1 : {}; + PDFDocument.__super__.constructor.apply(this, arguments); + this.version = 1.3; + this.compress = (ref1 = this.options.compress) != null ? ref1 : true; + this._pageBuffer = []; + this._pageBufferStart = 0; + this._offsets = []; + this._waiting = 0; + this._ended = false; + this._offset = 0; + this._root = this.ref({ + Type: 'Catalog', + Pages: this.ref({ + Type: 'Pages', + Count: 0, + Kids: [] + }) + }); + this.page = null; + this.initColor(); + this.initVector(); + this.initFonts(); + this.initText(); + this.initImages(); + this.info = { + Producer: 'PDFKit', + Creator: 'PDFKit', + CreationDate: new Date() + }; + if (this.options.info) { + ref2 = this.options.info; + for (key in ref2) { + val = ref2[key]; + this.info[key] = val; + } + } + this._write("%PDF-" + this.version); + this._write("%\xFF\xFF\xFF\xFF"); + if (this.options.autoFirstPage !== false) { + this.addPage(); + } + } + + mixin = function(methods) { + var method, name, results; + results = []; + for (name in methods) { + method = methods[name]; + results.push(PDFDocument.prototype[name] = method); + } + return results; + }; + + mixin(__webpack_require__(162)); + + mixin(__webpack_require__(164)); + + mixin(__webpack_require__(166)); + + mixin(__webpack_require__(295)); + + mixin(__webpack_require__(297)); + + mixin(__webpack_require__(302)); + + PDFDocument.prototype.addPage = function(options) { + var pages; + if (options == null) { + options = this.options; + } + if (!this.options.bufferPages) { + this.flushPages(); + } + this.page = new PDFPage(this, options); + this._pageBuffer.push(this.page); + pages = this._root.data.Pages.data; + pages.Kids.push(this.page.dictionary); + pages.Count++; + this.x = this.page.margins.left; + this.y = this.page.margins.top; + this._ctm = [1, 0, 0, 1, 0, 0]; + this.transform(1, 0, 0, -1, 0, this.page.height); + this.emit('pageAdded'); + return this; + }; + + PDFDocument.prototype.bufferedPageRange = function() { + return { + start: this._pageBufferStart, + count: this._pageBuffer.length + }; + }; + + PDFDocument.prototype.switchToPage = function(n) { + var page; + if (!(page = this._pageBuffer[n - this._pageBufferStart])) { + throw new Error("switchToPage(" + n + ") out of bounds, current buffer covers pages " + this._pageBufferStart + " to " + (this._pageBufferStart + this._pageBuffer.length - 1)); + } + return this.page = page; + }; + + PDFDocument.prototype.flushPages = function() { + var i, len, page, pages; + pages = this._pageBuffer; + this._pageBuffer = []; + this._pageBufferStart += pages.length; + for (i = 0, len = pages.length; i < len; i++) { + page = pages[i]; + page.end(); + } + }; + + PDFDocument.prototype.ref = function(data) { + var ref; + ref = new PDFReference(this, this._offsets.length + 1, data); + this._offsets.push(null); + this._waiting++; + return ref; + }; + + PDFDocument.prototype._read = function() {}; + + PDFDocument.prototype._write = function(data) { + if (!Buffer.isBuffer(data)) { + data = new Buffer(data + '\n', 'binary'); + } + this.push(data); + return this._offset += data.length; + }; + + PDFDocument.prototype.addContent = function(data) { + this.page.write(data); + return this; + }; + + PDFDocument.prototype._refEnd = function(ref) { + this._offsets[ref.id - 1] = ref.offset; + if (--this._waiting === 0 && this._ended) { + this._finalize(); + return this._ended = false; + } + }; + + PDFDocument.prototype.write = function(filename, fn) { + var err; + 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); + }; + + PDFDocument.prototype.output = function(fn) { + throw new Error('PDFDocument#output is deprecated, and has been removed from PDFKit. Please pipe the document into a Node stream.'); + }; + + PDFDocument.prototype.end = function() { + var font, key, name, ref1, ref2, val; + this.flushPages(); + this._info = this.ref(); + ref1 = this.info; + for (key in ref1) { + val = ref1[key]; + if (typeof val === 'string') { + val = new String(val); + } + this._info.data[key] = val; + } + this._info.end(); + ref2 = this._fontFamilies; + for (name in ref2) { + font = ref2[name]; + font.finalize(); + } + this._root.end(); + this._root.data.Pages.end(); + if (this._waiting === 0) { + return this._finalize(); + } else { + return this._ended = true; + } + }; + + PDFDocument.prototype._finalize = function(fn) { + var i, len, offset, ref1, xRefOffset; + xRefOffset = this._offset; + this._write("xref"); + this._write("0 " + (this._offsets.length + 1)); + this._write("0000000000 65535 f "); + ref1 = this._offsets; + for (i = 0, len = ref1.length; i < len; i++) { + offset = ref1[i]; + offset = ('0000000000' + offset).slice(-10); + this._write(offset + ' 00000 n '); + } + this._write('trailer'); + this._write(PDFObject.convert({ + Size: this._offsets.length + 1, + Root: this._root, + Info: this._info + })); + this._write('startxref'); + this._write("" + xRefOffset); + this._write('%%EOF'); + return this.push(null); + }; + + PDFDocument.prototype.toString = function() { + return "[object PDFDocument]"; + }; + + return PDFDocument; + + })(stream.Readable); + + module.exports = PDFDocument; + +}).call(this); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer)) + +/***/ }), +/* 139 */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = __webpack_require__(33).Buffer; +var util = __webpack_require__(141); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); +} + +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); + + this.head = null; + this.tail = null; + this.length = 0; + } + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} + +/***/ }), +/* 141 */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var apply = Function.prototype.apply; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { + if (timeout) { + timeout.close(); + } +}; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(window, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// setimmediate attaches itself to the global object +__webpack_require__(143); +// On some exotic environments, it's not clear which object `setimmeidate` was +// able to install onto. Search each possibility in the same order as the +// `setimmediate` library. +exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || + (typeof global !== "undefined" && global.setImmediate) || + (this && this.setImmediate); +exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || + (typeof global !== "undefined" && global.clearImmediate) || + (this && this.clearImmediate); + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { + "use strict"; + + if (global.setImmediate) { + return; + } + + var nextHandle = 1; // Spec says greater than zero + var tasksByHandle = {}; + var currentlyRunningATask = false; + var doc = global.document; + var registerImmediate; + + function setImmediate(callback) { + // Callback can either be a function or a string + if (typeof callback !== "function") { + callback = new Function("" + callback); + } + // Copy function arguments + var args = new Array(arguments.length - 1); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i + 1]; + } + // Store and register the task + var task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; + } + + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + + function run(task) { + var callback = task.callback; + var args = task.args; + switch (args.length) { + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; + } + } + + function runIfPresent(handle) { + // From the spec: "Wait until any invocations of this algorithm started before this one have completed." + // So if we're currently running a task, we'll need to delay this invocation. + if (currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // "too much recursion" error. + setTimeout(runIfPresent, 0, handle); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + run(task); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + + function installNextTickImplementation() { + registerImmediate = function(handle) { + process.nextTick(function () { runIfPresent(handle); }); + }; + } + + function canUsePostMessage() { + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `global.postMessage` means something completely different and can't be used for this purpose. + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage("", "*"); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + + function installPostMessageImplementation() { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + + var messagePrefix = "setImmediate$" + Math.random() + "$"; + var onGlobalMessage = function(event) { + if (event.source === global && + typeof event.data === "string" && + event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + + if (global.addEventListener) { + global.addEventListener("message", onGlobalMessage, false); + } else { + global.attachEvent("onmessage", onGlobalMessage); + } + + registerImmediate = function(handle) { + global.postMessage(messagePrefix + handle, "*"); + }; + } + + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + + registerImmediate = function(handle) { + channel.port2.postMessage(handle); + }; + } + + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + registerImmediate = function(handle) { + // Create a