(window["webpackjsonp"] = window["webpackjsonp"] || []).push([[68],{ /***/ 330: /***/ (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__(331) var ieee754 = __webpack_require__(332) var isarray = __webpack_require__(333) 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(this, __webpack_require__(18))) /***/ }), /***/ 331: /***/ (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 getlens (b64) { var len = b64.length if (len % 4 > 0) { throw new error('invalid string. length must be a multiple of 4') } // trim off extra bytes after placeholder bytes are found // see: https://github.com/beatgammit/base64-js/issues/42 var validlen = b64.indexof('=') if (validlen === -1) validlen = len var placeholderslen = validlen === len ? 0 : 4 - (validlen % 4) return [validlen, placeholderslen] } // base64 is 4/3 + up to two characters of the original data function bytelength (b64) { var lens = getlens(b64) var validlen = lens[0] var placeholderslen = lens[1] return ((validlen + placeholderslen) * 3 / 4) - placeholderslen } function _bytelength (b64, validlen, placeholderslen) { return ((validlen + placeholderslen) * 3 / 4) - placeholderslen } function tobytearray (b64) { var tmp var lens = getlens(b64) var validlen = lens[0] var placeholderslen = lens[1] var arr = new arr(_bytelength(b64, validlen, placeholderslen)) var curbyte = 0 // if there are placeholders, only get up to the last complete 4 chars var len = placeholderslen > 0 ? validlen - 4 : validlen var i for (i = 0; i < len; i += 4) { tmp = (revlookup[b64.charcodeat(i)] << 18) | (revlookup[b64.charcodeat(i + 1)] << 12) | (revlookup[b64.charcodeat(i + 2)] << 6) | revlookup[b64.charcodeat(i + 3)] arr[curbyte++] = (tmp >> 16) & 0xff arr[curbyte++] = (tmp >> 8) & 0xff arr[curbyte++] = tmp & 0xff } if (placeholderslen === 2) { tmp = (revlookup[b64.charcodeat(i)] << 2) | (revlookup[b64.charcodeat(i + 1)] >> 4) arr[curbyte++] = tmp & 0xff } if (placeholderslen === 1) { tmp = (revlookup[b64.charcodeat(i)] << 10) | (revlookup[b64.charcodeat(i + 1)] << 4) | (revlookup[b64.charcodeat(i + 2)] >> 2) arr[curbyte++] = (tmp >> 8) & 0xff arr[curbyte++] = tmp & 0xff } return arr } function triplettobase64 (num) { return lookup[num >> 18 & 0x3f] + lookup[num >> 12 & 0x3f] + lookup[num >> 6 & 0x3f] + lookup[num & 0x3f] } function encodechunk (uint8, start, end) { 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 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] parts.push( lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3f] + '==' ) } else if (extrabytes === 2) { tmp = (uint8[len - 2] << 8) + uint8[len - 1] parts.push( lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3f] + lookup[(tmp << 2) & 0x3f] + '=' ) } return parts.join('') } /***/ }) }]);