From 31b062152eaa9aa977403f6c7f308a8e51548961 Mon Sep 17 00:00:00 2001 From: Alan K Date: Tue, 10 Jun 2014 14:53:04 -0400 Subject: [PATCH] v0.0.11 --- bower.json | 2 +- dist/filer.js | 1479 +++++++++++++++++++++++++++++++++++++++++++-- dist/filer.min.js | 12 +- package.json | 2 +- 4 files changed, 1427 insertions(+), 68 deletions(-) diff --git a/bower.json b/bower.json index e7e8ff3..cba5d92 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "filer", - "version": "0.0.10", + "version": "0.0.11", "main": "dist/filer.js", "devDependencies": { "mocha": "1.17.1", diff --git a/dist/filer.js b/dist/filer.js index c89b3d6..0be847f 100644 --- a/dist/filer.js +++ b/dist/filer.js @@ -966,7 +966,7 @@ }()); }).call(this,_dereq_("FWaASH")) -},{"FWaASH":6}],2:[function(_dereq_,module,exports){ +},{"FWaASH":9}],2:[function(_dereq_,module,exports){ // Based on https://github.com/diy/intercom.js/blob/master/lib/events.js // Copyright 2012 DIY Co Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 @@ -1359,7 +1359,7 @@ Intercom.getInstance = (function() { module.exports = Intercom; -},{"../src/shared.js":56,"./eventemitter.js":2}],4:[function(_dereq_,module,exports){ +},{"../src/shared.js":59,"./eventemitter.js":2}],4:[function(_dereq_,module,exports){ // Cherry-picked bits of underscore.js, lodash.js /** @@ -1944,7 +1944,1366 @@ function b64_enc (data) { module.exports = request; }).call(this,_dereq_("buffer").Buffer) -},{}],6:[function(_dereq_,module,exports){ +},{"buffer":6}],6:[function(_dereq_,module,exports){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +var base64 = _dereq_('base64-js') +var ieee754 = _dereq_('ieee754') + +exports.Buffer = Buffer +exports.SlowBuffer = Buffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 + +/** + * If `Buffer._useTypedArrays`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (compatible down to IE6) + */ +Buffer._useTypedArrays = (function () { + // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+, + // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding + // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support + // because we need to be able to add all the node Buffer API methods. This is an issue + // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438 + try { + var buf = new ArrayBuffer(0) + var arr = new Uint8Array(buf) + arr.foo = function () { return 42 } + return 42 === arr.foo() && + typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray` + } catch (e) { + return false + } +})() + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (subject, encoding, noZero) { + if (!(this instanceof Buffer)) + return new Buffer(subject, encoding, noZero) + + var type = typeof subject + + // Workaround: node's base64 implementation allows for non-padded strings + // while base64-js does not. + if (encoding === 'base64' && type === 'string') { + subject = stringtrim(subject) + while (subject.length % 4 !== 0) { + subject = subject + '=' + } + } + + // Find the length + var length + if (type === 'number') + length = coerce(subject) + else if (type === 'string') + length = Buffer.byteLength(subject, encoding) + else if (type === 'object') + length = coerce(subject.length) // assume that object is array-like + else + throw new Error('First argument needs to be a number, array or string.') + + var buf + if (Buffer._useTypedArrays) { + // Preferred: Return an augmented `Uint8Array` instance for best performance + buf = Buffer._augment(new Uint8Array(length)) + } else { + // Fallback: Return THIS instance of Buffer (created by `new`) + buf = this + buf.length = length + buf._isBuffer = true + } + + var i + if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') { + // Speed optimization -- use set if we're copying from a typed array + buf._set(subject) + } else if (isArrayish(subject)) { + // Treat array-ish objects as a byte array + for (i = 0; i < length; i++) { + if (Buffer.isBuffer(subject)) + buf[i] = subject.readUInt8(i) + else + buf.writeInt8(subject[i], i) + } + } else if (type === 'string') { + buf.write(subject, 0, encoding) + } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) { + for (i = 0; i < length; i++) { + buf[i] = 0 + } + } + + return buf +} + +// STATIC METHODS +// ============== + +Buffer.isEncoding = function (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.isBuffer = function (b) { + return !!(b !== null && b !== undefined && b._isBuffer) +} + +Buffer.byteLength = function (str, encoding) { + var ret + str = str.toString() + switch (encoding || 'utf8') { + case 'hex': + ret = str.length / 2 + break + case 'utf8': + case 'utf-8': + ret = utf8ToBytes(str).length + break + case 'ascii': + case 'binary': + case 'raw': + ret = str.length + break + case 'base64': + ret = base64ToBytes(str).length + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = str.length * 2 + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.concat = function (list, totalLength) { + assert(isArray(list), 'Usage: Buffer.concat(list[, length])') + + if (list.length === 0) { + return new Buffer(0) + } else if (list.length === 1) { + return list[0] + } + + var i + if (totalLength === undefined) { + totalLength = 0 + for (i = 0; i < list.length; i++) { + totalLength += list[i].length + } + } + + var buf = new Buffer(totalLength) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +Buffer.compare = function (a, b) { + assert(Buffer.isBuffer(a) && Buffer.isBuffer(b), 'Arguments must be Buffers') + var x = a.length + var y = b.length + for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {} + if (i !== len) { + x = a[i] + y = b[i] + } + if (x < y) { + return -1 + } + if (y < x) { + return 1 + } + return 0 +} + +// BUFFER INSTANCE METHODS +// ======================= + +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 + assert(strLen % 2 === 0, 'Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var byte = parseInt(string.substr(i * 2, 2), 16) + assert(!isNaN(byte), 'Invalid hex string') + buf[offset + i] = byte + } + return i +} + +function utf8Write (buf, string, offset, length) { + var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length) + return charsWritten +} + +function asciiWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length) + return charsWritten +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length) + return charsWritten +} + +function utf16leWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length) + return charsWritten +} + +Buffer.prototype.write = function (string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length + length = undefined + } + } else { // legacy + var swap = encoding + encoding = offset + offset = length + length = swap + } + + offset = Number(offset) || 0 + var remaining = this.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + encoding = String(encoding || 'utf8').toLowerCase() + + var ret + switch (encoding) { + case 'hex': + ret = hexWrite(this, string, offset, length) + break + case 'utf8': + case 'utf-8': + ret = utf8Write(this, string, offset, length) + break + case 'ascii': + ret = asciiWrite(this, string, offset, length) + break + case 'binary': + ret = binaryWrite(this, string, offset, length) + break + case 'base64': + ret = base64Write(this, string, offset, length) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leWrite(this, string, offset, length) + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.prototype.toString = function (encoding, start, end) { + var self = this + + encoding = String(encoding || 'utf8').toLowerCase() + start = Number(start) || 0 + end = (end === undefined) ? self.length : Number(end) + + // Fastpath empty strings + if (end === start) + return '' + + var ret + switch (encoding) { + case 'hex': + ret = hexSlice(self, start, end) + break + case 'utf8': + case 'utf-8': + ret = utf8Slice(self, start, end) + break + case 'ascii': + ret = asciiSlice(self, start, end) + break + case 'binary': + ret = binarySlice(self, start, end) + break + case 'base64': + ret = base64Slice(self, start, end) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leSlice(self, start, end) + break + default: + throw new Error('Unknown encoding') + } + return ret +} + +Buffer.prototype.toJSON = function () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +Buffer.prototype.equals = function (b) { + assert(Buffer.isBuffer(b), 'Argument must be a Buffer') + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.compare = function (b) { + assert(Buffer.isBuffer(b), 'Argument must be a Buffer') + return Buffer.compare(this, b) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function (target, target_start, start, end) { + var source = this + + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (!target_start) target_start = 0 + + // Copy 0 bytes; we're done + if (end === start) return + if (target.length === 0 || source.length === 0) return + + // Fatal error conditions + assert(end >= start, 'sourceEnd < sourceStart') + assert(target_start >= 0 && target_start < target.length, + 'targetStart out of bounds') + assert(start >= 0 && start < source.length, 'sourceStart out of bounds') + assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) + end = this.length + if (target.length - target_start < end - start) + end = target.length - target_start + start + + var len = end - start + + if (len < 100 || !Buffer._useTypedArrays) { + for (var i = 0; i < len; i++) { + target[i + target_start] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), target_start) + } +} + +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) { + var res = '' + var tmp = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + if (buf[i] <= 0x7F) { + res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) + tmp = '' + } else { + tmp += '%' + buf[i].toString(16) + } + } + + return res + decodeUtf8Char(tmp) +} + +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]) + } + return ret +} + +function binarySlice (buf, start, end) { + return asciiSlice(buf, start, end) +} + +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 (start, end) { + var len = this.length + start = clamp(start, len, 0) + end = clamp(end, len, len) + + if (Buffer._useTypedArrays) { + return Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + var newBuf = new Buffer(sliceLen, undefined, true) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + return newBuf + } +} + +// `get` will be removed in Node 0.13+ +Buffer.prototype.get = function (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` will be removed in Node 0.13+ +Buffer.prototype.set = function (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +Buffer.prototype.readUInt8 = function (offset, noAssert) { + if (!noAssert) { + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'Trying to read beyond buffer length') + } + + if (offset >= this.length) + return + + return this[offset] +} + +function readUInt16 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val + if (littleEndian) { + val = buf[offset] + if (offset + 1 < len) + val |= buf[offset + 1] << 8 + } else { + val = buf[offset] << 8 + if (offset + 1 < len) + val |= buf[offset + 1] + } + return val +} + +Buffer.prototype.readUInt16LE = function (offset, noAssert) { + return readUInt16(this, offset, true, noAssert) +} + +Buffer.prototype.readUInt16BE = function (offset, noAssert) { + return readUInt16(this, offset, false, noAssert) +} + +function readUInt32 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val + if (littleEndian) { + if (offset + 2 < len) + val = buf[offset + 2] << 16 + if (offset + 1 < len) + val |= buf[offset + 1] << 8 + val |= buf[offset] + if (offset + 3 < len) + val = val + (buf[offset + 3] << 24 >>> 0) + } else { + if (offset + 1 < len) + val = buf[offset + 1] << 16 + if (offset + 2 < len) + val |= buf[offset + 2] << 8 + if (offset + 3 < len) + val |= buf[offset + 3] + val = val + (buf[offset] << 24 >>> 0) + } + return val +} + +Buffer.prototype.readUInt32LE = function (offset, noAssert) { + return readUInt32(this, offset, true, noAssert) +} + +Buffer.prototype.readUInt32BE = function (offset, noAssert) { + return readUInt32(this, offset, false, noAssert) +} + +Buffer.prototype.readInt8 = function (offset, noAssert) { + if (!noAssert) { + assert(offset !== undefined && offset !== null, + 'missing offset') + assert(offset < this.length, 'Trying to read beyond buffer length') + } + + if (offset >= this.length) + return + + var neg = this[offset] & 0x80 + if (neg) + return (0xff - this[offset] + 1) * -1 + else + return this[offset] +} + +function readInt16 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val = readUInt16(buf, offset, littleEndian, true) + var neg = val & 0x8000 + if (neg) + return (0xffff - val + 1) * -1 + else + return val +} + +Buffer.prototype.readInt16LE = function (offset, noAssert) { + return readInt16(this, offset, true, noAssert) +} + +Buffer.prototype.readInt16BE = function (offset, noAssert) { + return readInt16(this, offset, false, noAssert) +} + +function readInt32 (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + var len = buf.length + if (offset >= len) + return + + var val = readUInt32(buf, offset, littleEndian, true) + var neg = val & 0x80000000 + if (neg) + return (0xffffffff - val + 1) * -1 + else + return val +} + +Buffer.prototype.readInt32LE = function (offset, noAssert) { + return readInt32(this, offset, true, noAssert) +} + +Buffer.prototype.readInt32BE = function (offset, noAssert) { + return readInt32(this, offset, false, noAssert) +} + +function readFloat (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset + 3 < buf.length, 'Trying to read beyond buffer length') + } + + return ieee754.read(buf, offset, littleEndian, 23, 4) +} + +Buffer.prototype.readFloatLE = function (offset, noAssert) { + return readFloat(this, offset, true, noAssert) +} + +Buffer.prototype.readFloatBE = function (offset, noAssert) { + return readFloat(this, offset, false, noAssert) +} + +function readDouble (buf, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset + 7 < buf.length, 'Trying to read beyond buffer length') + } + + return ieee754.read(buf, offset, littleEndian, 52, 8) +} + +Buffer.prototype.readDoubleLE = function (offset, noAssert) { + return readDouble(this, offset, true, noAssert) +} + +Buffer.prototype.readDoubleBE = function (offset, noAssert) { + return readDouble(this, offset, false, noAssert) +} + +Buffer.prototype.writeUInt8 = function (value, offset, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'trying to write beyond buffer length') + verifuint(value, 0xff) + } + + if (offset >= this.length) return + + this[offset] = value + return offset + 1 +} + +function writeUInt16 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'trying to write beyond buffer length') + verifuint(value, 0xffff) + } + + var len = buf.length + if (offset >= len) + return + + for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) { + buf[offset + i] = + (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } + return offset + 2 +} + +Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) { + return writeUInt16(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) { + return writeUInt16(this, value, offset, false, noAssert) +} + +function writeUInt32 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'trying to write beyond buffer length') + verifuint(value, 0xffffffff) + } + + var len = buf.length + if (offset >= len) + return + + for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) { + buf[offset + i] = + (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } + return offset + 4 +} + +Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) { + return writeUInt32(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) { + return writeUInt32(this, value, offset, false, noAssert) +} + +Buffer.prototype.writeInt8 = function (value, offset, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset < this.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7f, -0x80) + } + + if (offset >= this.length) + return + + if (value >= 0) + this.writeUInt8(value, offset, noAssert) + else + this.writeUInt8(0xff + value + 1, offset, noAssert) + return offset + 1 +} + +function writeInt16 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 1 < buf.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7fff, -0x8000) + } + + var len = buf.length + if (offset >= len) + return + + if (value >= 0) + writeUInt16(buf, value, offset, littleEndian, noAssert) + else + writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert) + return offset + 2 +} + +Buffer.prototype.writeInt16LE = function (value, offset, noAssert) { + return writeInt16(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeInt16BE = function (value, offset, noAssert) { + return writeInt16(this, value, offset, false, noAssert) +} + +function writeInt32 (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') + verifsint(value, 0x7fffffff, -0x80000000) + } + + var len = buf.length + if (offset >= len) + return + + if (value >= 0) + writeUInt32(buf, value, offset, littleEndian, noAssert) + else + writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert) + return offset + 4 +} + +Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { + return writeInt32(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeInt32BE = function (value, offset, noAssert) { + return writeInt32(this, value, offset, false, noAssert) +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 3 < buf.length, 'Trying to write beyond buffer length') + verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + + var len = buf.length + if (offset >= len) + return + + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + assert(value !== undefined && value !== null, 'missing value') + assert(typeof littleEndian === 'boolean', 'missing or invalid endian') + assert(offset !== undefined && offset !== null, 'missing offset') + assert(offset + 7 < buf.length, + 'Trying to write beyond buffer length') + verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + + var len = buf.length + if (offset >= len) + return + + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + assert(end >= start, 'end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + assert(start >= 0 && start < this.length, 'start out of bounds') + assert(end >= 0 && end <= this.length, 'end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +Buffer.prototype.inspect = function () { + var out = [] + var len = this.length + for (var i = 0; i < len; i++) { + out[i] = toHex(this[i]) + if (i === exports.INSPECT_MAX_BYTES) { + out[i + 1] = '...' + break + } + } + return '' +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function () { + if (typeof Uint8Array !== 'undefined') { + if (Buffer._useTypedArrays) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new Error('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function (arr) { + arr._isBuffer = true + + // save reference to original Uint8Array get/set methods before overwriting + arr._get = arr.get + arr._set = arr.set + + // deprecated, will be removed in node 0.13+ + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +// slice(start, end) +function clamp (index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue + index = ~~index; // Coerce to integer. + if (index >= len) return len + if (index >= 0) return index + index += len + if (index >= 0) return index + return 0 +} + +function coerce (length) { + // Coerce length to a number (possibly NaN), round up + // in case it's fractional (e.g. 123.456) then do a + // double negate to coerce a NaN to 0. Easy, right? + length = ~~Math.ceil(+length) + return length < 0 ? 0 : length +} + +function isArray (subject) { + return (Array.isArray || function (subject) { + return Object.prototype.toString.call(subject) === '[object Array]' + })(subject) +} + +function isArrayish (subject) { + return isArray(subject) || Buffer.isBuffer(subject) || + subject && typeof subject === 'object' && + typeof subject.length === 'number' +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + var b = str.charCodeAt(i) + if (b <= 0x7F) { + byteArray.push(b) + } else { + var start = i + if (b >= 0xD800 && b <= 0xDFFF) i++ + var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%') + for (var j = 0; j < h.length; j++) { + byteArray.push(parseInt(h[j], 16)) + } + } + } + return byteArray +} + +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) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(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 decodeUtf8Char (str) { + try { + return decodeURIComponent(str) + } catch (err) { + return String.fromCharCode(0xFFFD) // UTF 8 invalid char + } +} + +/* + * We have to make sure that the value is a valid integer. This means that it + * is non-negative. It has no fractional component and that it does not + * exceed the maximum allowed value. + */ +function verifuint (value, max) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value >= 0, 'specified a negative value for writing an unsigned value') + assert(value <= max, 'value is larger than maximum value for type') + assert(Math.floor(value) === value, 'value has a fractional component') +} + +function verifsint (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value <= max, 'value larger than maximum allowed value') + assert(value >= min, 'value smaller than minimum allowed value') + assert(Math.floor(value) === value, 'value has a fractional component') +} + +function verifIEEE754 (value, max, min) { + assert(typeof value === 'number', 'cannot write a non-number as a number') + assert(value <= max, 'value larger than maximum allowed value') + assert(value >= min, 'value smaller than minimum allowed value') +} + +function assert (test, message) { + if (!test) throw new Error(message || 'Failed assertion') +} + +},{"base64-js":7,"ieee754":8}],7:[function(_dereq_,module,exports){ +var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +;(function (exports) { + 'use strict'; + + var Arr = (typeof Uint8Array !== 'undefined') + ? Uint8Array + : Array + + var ZERO = '0'.charCodeAt(0) + var PLUS = '+'.charCodeAt(0) + var SLASH = '/'.charCodeAt(0) + var NUMBER = '0'.charCodeAt(0) + var LOWER = 'a'.charCodeAt(0) + var UPPER = 'A'.charCodeAt(0) + + function decode (elt) { + var code = elt.charCodeAt(0) + if (code === PLUS) + return 62 // '+' + if (code === SLASH) + 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 + } + + module.exports.toByteArray = b64ToByteArray + module.exports.fromByteArray = uint8ToBase64 +}()) + +},{}],8:[function(_dereq_,module,exports){ +exports.read = function(buffer, offset, isLE, mLen, nBytes) { + var e, m, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + nBits = -7, + i = isLE ? (nBytes - 1) : 0, + d = isLE ? -1 : 1, + 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, + eLen = nBytes * 8 - mLen - 1, + eMax = (1 << eLen) - 1, + eBias = eMax >> 1, + rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), + i = isLE ? 0 : (nBytes - 1), + d = isLE ? 1 : -1, + 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; +}; + +},{}],9:[function(_dereq_,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -2009,7 +3368,7 @@ process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; -},{}],7:[function(_dereq_,module,exports){ +},{}],10:[function(_dereq_,module,exports){ 'use strict'; // private property var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; @@ -2081,7 +3440,7 @@ exports.decode = function(input, utf8) { }; -},{}],8:[function(_dereq_,module,exports){ +},{}],11:[function(_dereq_,module,exports){ 'use strict'; function CompressedObject() { this.compressedSize = 0; @@ -2111,7 +3470,7 @@ CompressedObject.prototype = { }; module.exports = CompressedObject; -},{}],9:[function(_dereq_,module,exports){ +},{}],12:[function(_dereq_,module,exports){ 'use strict'; exports.STORE = { magic: "\x00\x00", @@ -2126,7 +3485,7 @@ exports.STORE = { }; exports.DEFLATE = _dereq_('./flate'); -},{"./flate":12}],10:[function(_dereq_,module,exports){ +},{"./flate":15}],13:[function(_dereq_,module,exports){ 'use strict'; var utils = _dereq_('./utils'); @@ -2235,7 +3594,7 @@ DataReader.prototype = { }; module.exports = DataReader; -},{"./utils":22}],11:[function(_dereq_,module,exports){ +},{"./utils":25}],14:[function(_dereq_,module,exports){ 'use strict'; exports.base64 = false; exports.binary = false; @@ -2243,7 +3602,7 @@ exports.dir = false; exports.date = null; exports.compression = null; -},{}],12:[function(_dereq_,module,exports){ +},{}],15:[function(_dereq_,module,exports){ 'use strict'; var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined'); @@ -2259,7 +3618,7 @@ exports.uncompress = function(input) { return pako.inflateRaw(input); }; -},{"pako":25}],13:[function(_dereq_,module,exports){ +},{"pako":28}],16:[function(_dereq_,module,exports){ 'use strict'; /** Usage: @@ -2314,7 +3673,7 @@ JSZip.base64 = _dereq_('./base64'); JSZip.compressions = _dereq_('./compressions'); module.exports = JSZip; -},{"./base64":7,"./compressions":9,"./defaults":11,"./load":14,"./object":17,"./support":20,"./utils":22}],14:[function(_dereq_,module,exports){ +},{"./base64":10,"./compressions":12,"./defaults":14,"./load":17,"./object":20,"./support":23,"./utils":25}],17:[function(_dereq_,module,exports){ 'use strict'; var base64 = _dereq_('./base64'); var ZipEntries = _dereq_('./zipEntries'); @@ -2340,7 +3699,7 @@ module.exports = function(data, options) { return this; }; -},{"./base64":7,"./zipEntries":23}],15:[function(_dereq_,module,exports){ +},{"./base64":10,"./zipEntries":26}],18:[function(_dereq_,module,exports){ (function (Buffer){ 'use strict'; module.exports = function(data, encoding){ @@ -2350,7 +3709,7 @@ module.exports.test = function(b){ return Buffer.isBuffer(b); }; }).call(this,_dereq_("buffer").Buffer) -},{}],16:[function(_dereq_,module,exports){ +},{"buffer":6}],19:[function(_dereq_,module,exports){ 'use strict'; var Uint8ArrayReader = _dereq_('./uint8ArrayReader'); @@ -2372,7 +3731,7 @@ NodeBufferReader.prototype.readData = function(size) { }; module.exports = NodeBufferReader; -},{"./uint8ArrayReader":21}],17:[function(_dereq_,module,exports){ +},{"./uint8ArrayReader":24}],20:[function(_dereq_,module,exports){ 'use strict'; var support = _dereq_('./support'); var utils = _dereq_('./utils'); @@ -3291,7 +4650,7 @@ var out = { }; module.exports = out; -},{"./base64":7,"./compressedObject":8,"./compressions":9,"./defaults":11,"./nodeBuffer":15,"./signature":18,"./support":20,"./utils":22}],18:[function(_dereq_,module,exports){ +},{"./base64":10,"./compressedObject":11,"./compressions":12,"./defaults":14,"./nodeBuffer":18,"./signature":21,"./support":23,"./utils":25}],21:[function(_dereq_,module,exports){ 'use strict'; exports.LOCAL_FILE_HEADER = "PK\x03\x04"; exports.CENTRAL_FILE_HEADER = "PK\x01\x02"; @@ -3300,7 +4659,7 @@ exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07"; exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06"; exports.DATA_DESCRIPTOR = "PK\x07\x08"; -},{}],19:[function(_dereq_,module,exports){ +},{}],22:[function(_dereq_,module,exports){ 'use strict'; var DataReader = _dereq_('./dataReader'); var utils = _dereq_('./utils'); @@ -3338,7 +4697,7 @@ StringReader.prototype.readData = function(size) { }; module.exports = StringReader; -},{"./dataReader":10,"./utils":22}],20:[function(_dereq_,module,exports){ +},{"./dataReader":13,"./utils":25}],23:[function(_dereq_,module,exports){ (function (Buffer){ 'use strict'; exports.base64 = true; @@ -3376,7 +4735,7 @@ else { } }).call(this,_dereq_("buffer").Buffer) -},{}],21:[function(_dereq_,module,exports){ +},{"buffer":6}],24:[function(_dereq_,module,exports){ 'use strict'; var DataReader = _dereq_('./dataReader'); @@ -3421,7 +4780,7 @@ Uint8ArrayReader.prototype.readData = function(size) { }; module.exports = Uint8ArrayReader; -},{"./dataReader":10}],22:[function(_dereq_,module,exports){ +},{"./dataReader":13}],25:[function(_dereq_,module,exports){ 'use strict'; var support = _dereq_('./support'); var compressions = _dereq_('./compressions'); @@ -3774,7 +5133,7 @@ exports.isRegExp = function (object) { }; -},{"./compressions":9,"./nodeBuffer":15,"./support":20}],23:[function(_dereq_,module,exports){ +},{"./compressions":12,"./nodeBuffer":18,"./support":23}],26:[function(_dereq_,module,exports){ 'use strict'; var StringReader = _dereq_('./stringReader'); var NodeBufferReader = _dereq_('./nodeBufferReader'); @@ -3972,7 +5331,7 @@ ZipEntries.prototype = { // }}} end of ZipEntries module.exports = ZipEntries; -},{"./nodeBufferReader":16,"./signature":18,"./stringReader":19,"./support":20,"./uint8ArrayReader":21,"./utils":22,"./zipEntry":24}],24:[function(_dereq_,module,exports){ +},{"./nodeBufferReader":19,"./signature":21,"./stringReader":22,"./support":23,"./uint8ArrayReader":24,"./utils":25,"./zipEntry":27}],27:[function(_dereq_,module,exports){ 'use strict'; var StringReader = _dereq_('./stringReader'); var utils = _dereq_('./utils'); @@ -4225,7 +5584,7 @@ ZipEntry.prototype = { }; module.exports = ZipEntry; -},{"./compressedObject":8,"./object":17,"./stringReader":19,"./utils":22}],25:[function(_dereq_,module,exports){ +},{"./compressedObject":11,"./object":20,"./stringReader":22,"./utils":25}],28:[function(_dereq_,module,exports){ // Top level file is just a mixin of submodules & constants 'use strict'; @@ -4240,7 +5599,7 @@ var pako = {}; assign(pako, deflate, inflate, constants); module.exports = pako; -},{"./lib/deflate":26,"./lib/inflate":27,"./lib/utils/common":28,"./lib/zlib/constants":31}],26:[function(_dereq_,module,exports){ +},{"./lib/deflate":29,"./lib/inflate":30,"./lib/utils/common":31,"./lib/zlib/constants":34}],29:[function(_dereq_,module,exports){ 'use strict'; @@ -4602,7 +5961,7 @@ exports.Deflate = Deflate; exports.deflate = deflate; exports.deflateRaw = deflateRaw; exports.gzip = gzip; -},{"./utils/common":28,"./utils/strings":29,"./zlib/deflate.js":33,"./zlib/messages":38,"./zlib/zstream":40}],27:[function(_dereq_,module,exports){ +},{"./utils/common":31,"./utils/strings":32,"./zlib/deflate.js":36,"./zlib/messages":41,"./zlib/zstream":43}],30:[function(_dereq_,module,exports){ 'use strict'; @@ -4968,7 +6327,7 @@ exports.inflate = inflate; exports.inflateRaw = inflateRaw; exports.ungzip = inflate; -},{"./utils/common":28,"./utils/strings":29,"./zlib/constants":31,"./zlib/gzheader":34,"./zlib/inflate.js":36,"./zlib/messages":38,"./zlib/zstream":40}],28:[function(_dereq_,module,exports){ +},{"./utils/common":31,"./utils/strings":32,"./zlib/constants":34,"./zlib/gzheader":37,"./zlib/inflate.js":39,"./zlib/messages":41,"./zlib/zstream":43}],31:[function(_dereq_,module,exports){ 'use strict'; @@ -5071,7 +6430,7 @@ exports.setTyped = function (on) { }; exports.setTyped(TYPED_OK); -},{}],29:[function(_dereq_,module,exports){ +},{}],32:[function(_dereq_,module,exports){ // String encode/decode helpers 'use strict'; @@ -5258,7 +6617,7 @@ exports.utf8border = function(buf, max) { return (pos + _utf8len[buf[pos]] > max) ? pos : max; }; -},{"./common":28}],30:[function(_dereq_,module,exports){ +},{"./common":31}],33:[function(_dereq_,module,exports){ 'use strict'; // Note: adler32 takes 12% for level 0 and 2% for level 6. @@ -5291,7 +6650,7 @@ function adler32(adler, buf, len, pos) { module.exports = adler32; -},{}],31:[function(_dereq_,module,exports){ +},{}],34:[function(_dereq_,module,exports){ module.exports = { /* Allowed flush values; see deflate() and inflate() below for details */ @@ -5339,7 +6698,7 @@ module.exports = { Z_DEFLATED: 8 //Z_NULL: null // Use -1 or null inline, depending on var type }; -},{}],32:[function(_dereq_,module,exports){ +},{}],35:[function(_dereq_,module,exports){ 'use strict'; // Note: we can't get significant speed boost here. @@ -5381,7 +6740,7 @@ function crc32(crc, buf, len, pos) { module.exports = crc32; -},{}],33:[function(_dereq_,module,exports){ +},{}],36:[function(_dereq_,module,exports){ 'use strict'; var utils = _dereq_('../utils/common'); @@ -7147,7 +8506,7 @@ exports.deflatePending = deflatePending; exports.deflatePrime = deflatePrime; exports.deflateTune = deflateTune; */ -},{"../utils/common":28,"./adler32":30,"./crc32":32,"./messages":38,"./trees":39}],34:[function(_dereq_,module,exports){ +},{"../utils/common":31,"./adler32":33,"./crc32":35,"./messages":41,"./trees":42}],37:[function(_dereq_,module,exports){ 'use strict'; @@ -7188,7 +8547,7 @@ function GZheader() { } module.exports = GZheader; -},{}],35:[function(_dereq_,module,exports){ +},{}],38:[function(_dereq_,module,exports){ 'use strict'; // See state defs from inflate.js @@ -7515,7 +8874,7 @@ module.exports = function inflate_fast(strm, start) { return; }; -},{}],36:[function(_dereq_,module,exports){ +},{}],39:[function(_dereq_,module,exports){ 'use strict'; @@ -9019,7 +10378,7 @@ exports.inflateSync = inflateSync; exports.inflateSyncPoint = inflateSyncPoint; exports.inflateUndermine = inflateUndermine; */ -},{"../utils/common":28,"./adler32":30,"./crc32":32,"./inffast":35,"./inftrees":37}],37:[function(_dereq_,module,exports){ +},{"../utils/common":31,"./adler32":33,"./crc32":35,"./inffast":38,"./inftrees":40}],40:[function(_dereq_,module,exports){ 'use strict'; @@ -9346,7 +10705,7 @@ module.exports = function inflate_table(type, lens, lens_index, codes, table, ta opts.bits = root; return 0; }; -},{"../utils/common":28}],38:[function(_dereq_,module,exports){ +},{"../utils/common":31}],41:[function(_dereq_,module,exports){ 'use strict'; module.exports = { @@ -9360,7 +10719,7 @@ module.exports = { '-5': 'buffer error', /* Z_BUF_ERROR (-5) */ '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ }; -},{}],39:[function(_dereq_,module,exports){ +},{}],42:[function(_dereq_,module,exports){ 'use strict'; @@ -10560,7 +11919,7 @@ exports._tr_stored_block = _tr_stored_block; exports._tr_flush_block = _tr_flush_block; exports._tr_tally = _tr_tally; exports._tr_align = _tr_align; -},{"../utils/common":28}],40:[function(_dereq_,module,exports){ +},{"../utils/common":31}],43:[function(_dereq_,module,exports){ 'use strict'; @@ -10590,7 +11949,7 @@ function ZStream() { } module.exports = ZStream; -},{}],41:[function(_dereq_,module,exports){ +},{}],44:[function(_dereq_,module,exports){ var O_READ = 'READ'; var O_WRITE = 'WRITE'; var O_CREATE = 'CREATE'; @@ -10671,7 +12030,7 @@ module.exports = { } }; -},{}],42:[function(_dereq_,module,exports){ +},{}],45:[function(_dereq_,module,exports){ var MODE_FILE = _dereq_('./constants.js').MODE_FILE; module.exports = function DirectoryEntry(id, type) { @@ -10679,7 +12038,7 @@ module.exports = function DirectoryEntry(id, type) { this.type = type || MODE_FILE; }; -},{"./constants.js":41}],43:[function(_dereq_,module,exports){ +},{"./constants.js":44}],46:[function(_dereq_,module,exports){ (function (Buffer){ // Adapt encodings to work with Buffer or Uint8Array, they expect the latter function decode(buf) { @@ -10696,7 +12055,7 @@ module.exports = { }; }).call(this,_dereq_("buffer").Buffer) -},{}],44:[function(_dereq_,module,exports){ +},{"buffer":6}],47:[function(_dereq_,module,exports){ var errors = {}; [ /** @@ -10790,7 +12149,7 @@ var errors = {}; module.exports = errors; -},{}],45:[function(_dereq_,module,exports){ +},{}],48:[function(_dereq_,module,exports){ (function (Buffer){ var _ = _dereq_('../../lib/nodash.js'); @@ -12798,7 +14157,7 @@ module.exports = { }; }).call(this,_dereq_("buffer").Buffer) -},{"../../lib/nodash.js":4,"../constants.js":41,"../directory-entry.js":42,"../encoding.js":43,"../errors.js":44,"../node.js":49,"../open-file-description.js":50,"../path.js":51,"../stats.js":60,"../super-node.js":61}],46:[function(_dereq_,module,exports){ +},{"../../lib/nodash.js":4,"../constants.js":44,"../directory-entry.js":45,"../encoding.js":46,"../errors.js":47,"../node.js":52,"../open-file-description.js":53,"../path.js":54,"../stats.js":63,"../super-node.js":64,"buffer":6}],49:[function(_dereq_,module,exports){ var _ = _dereq_('../../lib/nodash.js'); var isNullPath = _dereq_('../path.js').isNull; @@ -13095,7 +14454,7 @@ FileSystem.prototype.Shell = function(options) { module.exports = FileSystem; -},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":41,"../errors.js":44,"../fs-watcher.js":47,"../path.js":51,"../providers/index.js":52,"../shared.js":56,"../shell/shell.js":59,"./implementation.js":45}],47:[function(_dereq_,module,exports){ +},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":44,"../errors.js":47,"../fs-watcher.js":50,"../path.js":54,"../providers/index.js":55,"../shared.js":59,"../shell/shell.js":62,"./implementation.js":48}],50:[function(_dereq_,module,exports){ var EventEmitter = _dereq_('../lib/eventemitter.js'); var isNullPath = _dereq_('./path.js').isNull; var Intercom = _dereq_('../lib/intercom.js'); @@ -13148,7 +14507,7 @@ FSWatcher.prototype.constructor = FSWatcher; module.exports = FSWatcher; -},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":51}],48:[function(_dereq_,module,exports){ +},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":54}],51:[function(_dereq_,module,exports){ (function (Buffer){ module.exports = { FileSystem: _dereq_('./filesystem/interface.js'), @@ -13158,7 +14517,7 @@ module.exports = { }; }).call(this,_dereq_("buffer").Buffer) -},{"./errors.js":44,"./filesystem/interface.js":46,"./path.js":51}],49:[function(_dereq_,module,exports){ +},{"./errors.js":47,"./filesystem/interface.js":49,"./path.js":54,"buffer":6}],52:[function(_dereq_,module,exports){ var MODE_FILE = _dereq_('./constants.js').MODE_FILE; var guid = _dereq_('./shared.js').guid; @@ -13180,7 +14539,7 @@ module.exports = function Node(id, mode, size, atime, ctime, mtime, flags, xattr this.data = guid(); // id for data object }; -},{"./constants.js":41,"./shared.js":56}],50:[function(_dereq_,module,exports){ +},{"./constants.js":44,"./shared.js":59}],53:[function(_dereq_,module,exports){ module.exports = function OpenFileDescription(path, id, flags, position) { this.path = path; this.id = id; @@ -13188,7 +14547,7 @@ module.exports = function OpenFileDescription(path, id, flags, position) { this.position = position; }; -},{}],51:[function(_dereq_,module,exports){ +},{}],54:[function(_dereq_,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -13414,7 +14773,7 @@ module.exports = { isNull: isNull }; -},{}],52:[function(_dereq_,module,exports){ +},{}],55:[function(_dereq_,module,exports){ var IndexedDB = _dereq_('./indexeddb.js'); var WebSQL = _dereq_('./websql.js'); var Memory = _dereq_('./memory.js'); @@ -13451,7 +14810,7 @@ module.exports = { }()) }; -},{"./indexeddb.js":53,"./memory.js":54,"./websql.js":55}],53:[function(_dereq_,module,exports){ +},{"./indexeddb.js":56,"./memory.js":57,"./websql.js":58}],56:[function(_dereq_,module,exports){ (function(global) { var FILE_SYSTEM_NAME = _dereq_('../constants.js').FILE_SYSTEM_NAME; var FILE_STORE_NAME = _dereq_('../constants.js').FILE_STORE_NAME; @@ -13583,7 +14942,7 @@ module.exports = { }(this)); -},{"../constants.js":41,"../errors.js":44}],54:[function(_dereq_,module,exports){ +},{"../constants.js":44,"../errors.js":47}],57:[function(_dereq_,module,exports){ var FILE_SYSTEM_NAME = _dereq_('../constants.js').FILE_SYSTEM_NAME; var asyncCallback = _dereq_('../../lib/async.js').nextTick; @@ -13672,7 +15031,7 @@ Memory.prototype.getReadWriteContext = function() { module.exports = Memory; -},{"../../lib/async.js":1,"../constants.js":41}],55:[function(_dereq_,module,exports){ +},{"../../lib/async.js":1,"../constants.js":44}],58:[function(_dereq_,module,exports){ (function(global) { var FILE_SYSTEM_NAME = _dereq_('../constants.js').FILE_SYSTEM_NAME; var FILE_STORE_NAME = _dereq_('../constants.js').FILE_STORE_NAME; @@ -13835,7 +15194,7 @@ module.exports = Memory; }(this)); -},{"../constants.js":41,"../errors.js":44,"../shared.js":56}],56:[function(_dereq_,module,exports){ +},{"../constants.js":44,"../errors.js":47,"../shared.js":59}],59:[function(_dereq_,module,exports){ function guid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); @@ -13863,7 +15222,7 @@ module.exports = { nop: nop }; -},{}],57:[function(_dereq_,module,exports){ +},{}],60:[function(_dereq_,module,exports){ var defaults = _dereq_('../constants.js').ENVIRONMENT; module.exports = function Environment(env) { @@ -13880,7 +15239,7 @@ module.exports = function Environment(env) { }; }; -},{"../constants.js":41}],58:[function(_dereq_,module,exports){ +},{"../constants.js":44}],61:[function(_dereq_,module,exports){ var request = _dereq_('request'); module.exports.download = function(uri, callback) { @@ -13904,7 +15263,7 @@ module.exports.download = function(uri, callback) { }); }; -},{"request":5}],59:[function(_dereq_,module,exports){ +},{"request":5}],62:[function(_dereq_,module,exports){ var Path = _dereq_('../path.js'); var Errors = _dereq_('../errors.js'); var Environment = _dereq_('./environment.js'); @@ -14508,7 +15867,7 @@ Shell.prototype.zip = function(zipfile, paths, options, callback) { module.exports = Shell; -},{"../../lib/async.js":1,"../encoding.js":43,"../errors.js":44,"../path.js":51,"./environment.js":57,"./network.js":58,"jszip":13}],60:[function(_dereq_,module,exports){ +},{"../../lib/async.js":1,"../encoding.js":46,"../errors.js":47,"../path.js":54,"./environment.js":60,"./network.js":61,"jszip":16}],63:[function(_dereq_,module,exports){ var Constants = _dereq_('./constants.js'); function Stats(fileNode, devName) { @@ -14545,7 +15904,7 @@ function() { module.exports = Stats; -},{"./constants.js":41}],61:[function(_dereq_,module,exports){ +},{"./constants.js":44}],64:[function(_dereq_,module,exports){ var Constants = _dereq_('./constants.js'); var guid = _dereq_('./shared.js').guid; @@ -14560,6 +15919,6 @@ module.exports = function SuperNode(atime, ctime, mtime) { this.rnode = guid(); // root node id (randomly generated) }; -},{"./constants.js":41,"./shared.js":56}]},{},[48]) -(48) +},{"./constants.js":44,"./shared.js":59}]},{},[51]) +(51) }); \ No newline at end of file diff --git a/dist/filer.min.js b/dist/filer.min.js index 9e38916..d14ce75 100644 --- a/dist/filer.min.js +++ b/dist/filer.min.js @@ -1,6 +1,6 @@ -/*! filer 0.0.9 2014-06-09 */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Filer=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(e,n){(function(e){(function(){function r(t){var e=!1;return function(){if(e)throw Error("Callback was already called.");e=!0,t.apply(i,arguments)}}var i,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){return i.async=o,a};var s=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;t.length>n;n+=1)e(t[n],n,t)},u=function(t,e){if(t.map)return t.map(e);var n=[];return s(t,function(t,r,i){n.push(e(t,r,i))}),n},c=function(t,e,n){return t.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},f=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e};void 0!==e&&e.nextTick?(a.nextTick=e.nextTick,a.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeof setImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,e,n){if(n=n||function(){},!t.length)return n();var i=0;s(t,function(o){e(o,r(function(e){e?(n(e),n=function(){}):(i+=1,i>=t.length&&n(null))}))})},a.forEach=a.each,a.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)return n();var r=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,e,n,r){var i=l(e);i.apply(null,[t,n,r])},a.forEachLimit=a.eachLimit;var l=function(t){return function(e,n,r){if(r=r||function(){},!e.length||0>=t)return r();var i=0,o=0,a=0;(function s(){if(i>=e.length)return r();for(;t>a&&e.length>o;)o+=1,a+=1,n(e[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=e.length?r():s())})})()}},d=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.each].concat(e))}},h=function(t,e){return function(){var n=Array.prototype.slice.call(arguments);return e.apply(null,[l(t)].concat(n))}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.eachSeries].concat(e))}},m=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n,r){i[t.index]=r,e(n)})},function(t){r(t,i)})};a.map=d(m),a.mapSeries=p(m),a.mapLimit=function(t,e,n,r){return g(e)(t,n,r)};var g=function(t){return h(t,m)};a.reduce=function(t,e,n,r){a.eachSeries(t,function(t,r){n(e,t,function(t,n){e=n,r(t)})},function(t){r(t,e)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,e,n,r){var i=u(t,function(t){return t}).reverse();a.reduce(i,e,n,r)},a.foldr=a.reduceRight;var v=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n&&i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.filter=d(v),a.filterSeries=p(v),a.select=a.filter,a.selectSeries=a.filterSeries;var _=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n||i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.reject=d(_),a.rejectSeries=p(_);var y=function(t,e,n,r){t(e,function(t,e){n(t,function(n){n?(r(t),r=function(){}):e()})},function(){r()})};a.detect=d(y),a.detectSeries=p(y),a.some=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t&&(n(!0),n=function(){}),r()})},function(){n(!1)})},a.any=a.some,a.every=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t||(n(!1),n=function(){}),r()})},function(){n(!0)})},a.all=a.every,a.sortBy=function(t,e,n){a.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){if(t)return n(t);var r=function(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0};n(null,u(e.sort(r),function(t){return t.value}))})},a.auto=function(t,e){e=e||function(){};var n=f(t);if(!n.length)return e(null);var r={},i=[],o=function(t){i.unshift(t)},u=function(t){for(var e=0;i.length>e;e+=1)if(i[e]===t)return i.splice(e,1),void 0},l=function(){s(i.slice(0),function(t){t()})};o(function(){f(r).length===n.length&&(e(null,r),e=function(){})}),s(n,function(n){var i=t[n]instanceof Function?[t[n]]:t[n],d=function(t){var i=Array.prototype.slice.call(arguments,1);if(1>=i.length&&(i=i[0]),t){var o={};s(f(r),function(t){o[t]=r[t]}),o[n]=i,e(t,o),e=function(){}}else r[n]=i,a.setImmediate(l)},h=i.slice(0,Math.abs(i.length-1))||[],p=function(){return c(h,function(t,e){return t&&r.hasOwnProperty(e)},!0)&&!r.hasOwnProperty(n)};if(p())i[i.length-1](d,r);else{var m=function(){p()&&(u(m),i[i.length-1](d,r))};o(m)}})},a.waterfall=function(t,e){if(e=e||function(){},t.constructor!==Array){var n=Error("First argument to waterfall must be an array of functions");return e(n)}if(!t.length)return e();var r=function(t){return function(n){if(n)e.apply(null,arguments),e=function(){};else{var i=Array.prototype.slice.call(arguments,1),o=t.next();o?i.push(r(o)):i.push(e),a.setImmediate(function(){t.apply(null,i)})}}};r(a.iterator(t))()};var b=function(t,e,n){if(n=n||function(){},e.constructor===Array)t.map(e,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),e.call(null,t,n)})},n);else{var r={};t.each(f(e),function(t,n){e[t](function(e){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),r[t]=i,n(e)})},function(t){n(t,r)})}};a.parallel=function(t,e){b({map:a.map,each:a.each},t,e)},a.parallelLimit=function(t,e,n){b({map:g(e),each:l(e)},t,n)},a.series=function(t,e){if(e=e||function(){},t.constructor===Array)a.mapSeries(t,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),e.call(null,t,n)})},e);else{var n={};a.eachSeries(f(t),function(e,r){t[e](function(t){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),n[e]=i,r(t)})},function(t){e(t,n)})}},a.iterator=function(t){var e=function(n){var r=function(){return t.length&&t[n].apply(null,arguments),r.next()};return r.next=function(){return t.length-1>n?e(n+1):null},r};return e(0)},a.apply=function(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e.concat(Array.prototype.slice.call(arguments)))}};var w=function(t,e,n,r){var i=[];t(e,function(t,e){n(t,function(t,n){i=i.concat(n||[]),e(t)})},function(t){r(t,i)})};a.concat=d(w),a.concatSeries=p(w),a.whilst=function(t,e,n){t()?e(function(r){return r?n(r):(a.whilst(t,e,n),void 0)}):n()},a.doWhilst=function(t,e,n){t(function(r){return r?n(r):(e()?a.doWhilst(t,e,n):n(),void 0)})},a.until=function(t,e,n){t()?n():e(function(r){return r?n(r):(a.until(t,e,n),void 0)})},a.doUntil=function(t,e,n){t(function(r){return r?n(r):(e()?n():a.doUntil(t,e,n),void 0)})},a.queue=function(t,e){function n(t,n,r,i){n.constructor!==Array&&(n=[n]),s(n,function(n){var o={data:n,callback:"function"==typeof i?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===e&&t.saturated(),a.setImmediate(t.process)})}void 0===e&&(e=1);var i=0,o={tasks:[],concurrency:e,saturated:null,empty:null,drain:null,push:function(t,e){n(o,t,!1,e)},unshift:function(t,e){n(o,t,!0,e)},process:function(){if(o.concurrency>i&&o.tasks.length){var e=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var n=function(){i-=1,e.callback&&e.callback.apply(e,arguments),o.drain&&0===o.tasks.length+i&&o.drain(),o.process()},a=r(n);t(e.data,a)}},length:function(){return o.tasks.length},running:function(){return i}};return o},a.cargo=function(t,e){var n=!1,r=[],i={tasks:r,payload:e,saturated:null,empty:null,drain:null,push:function(t,n){t.constructor!==Array&&(t=[t]),s(t,function(t){r.push({data:t,callback:"function"==typeof n?n:null}),i.saturated&&r.length===e&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&i.drain(),void 0;var a="number"==typeof e?r.splice(0,e):r.splice(0),c=u(a,function(t){return t.data});i.empty&&i.empty(),n=!0,t(c,function(){n=!1;var t=arguments;s(a,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var E=function(t){return function(e){var n=Array.prototype.slice.call(arguments,1);e.apply(null,n.concat([function(e){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&s(n,function(e){console[t](e)}))}]))}};a.log=E("log"),a.dir=E("dir"),a.memoize=function(t,e){var n={},r={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in n?o.apply(null,n[a]):a in r?r[a].push(o):(r[a]=[o],t.apply(null,i.concat([function(){n[a]=arguments;var t=r[a];delete r[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=n,i.unmemoized=t,i},a.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},a.times=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.map(r,e,n)},a.timesSeries=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.mapSeries(r,e,n)},a.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var e=this,n=Array.prototype.slice.call(arguments),r=n.pop();a.reduce(t,n,function(t,n,r){n.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);r(t,e)}]))},function(t,n){r.apply(e,[t].concat(n))})}};var x=function(t,e){var n=function(){var n=this,r=Array.prototype.slice.call(arguments),i=r.pop();return t(e,function(t,e){t.apply(n,r.concat([e]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return n.apply(this,r)}return n};a.applyEach=d(x),a.applyEachSeries=p(x),a.forever=function(t,e){function n(r){if(r){if(e)return e(r);throw r}t(n)}n()},t!==void 0&&t.amd?t([],function(){return a}):n!==void 0&&n.exports?n.exports=a:i.async=a})()}).call(this,e("FWaASH"))},{FWaASH:6}],2:[function(t,e){function n(t,e){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1);return e}var r=function(){};r.createInterface=function(t){var e={};return e.on=function(e,n){this[t]===void 0&&(this[t]={}),this[t].hasOwnProperty(e)||(this[t][e]=[]),this[t][e].push(n)},e.off=function(e,r){void 0!==this[t]&&this[t].hasOwnProperty(e)&&n(r,this[t][e])},e.trigger=function(e){if(this[t]!==void 0&&this[t].hasOwnProperty(e))for(var n=Array.prototype.slice.call(arguments,1),r=0;this[t][e].length>r;r++)this[t][e][r].apply(this[t][e][r],n)},e.removeAllListeners=function(e){if(void 0!==this[t]){var n=this;n[t][e].forEach(function(t){n.off(e,t)})}},e};var i=r.createInterface("_handlers");r.prototype._on=i.on,r.prototype._off=i.off,r.prototype._trigger=i.trigger;var o=r.createInterface("handlers");r.prototype.on=function(){o.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=o.off,r.prototype.trigger=o.trigger,r.prototype.removeAllListeners=o.removeAllListeners,e.exports=r},{}],3:[function(t,e){function n(t,e){var n=0;return function(){var r=Date.now();r-n>t&&(n=r,e.apply(this,arguments))}}function r(t,e){if(void 0!==t&&t||(t={}),"object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function i(){var t=this,e=Date.now();this.origin=a(),this.lastMessage=e,this.receivedIDs={},this.previousValues={};var n=function(){t._onStorageEvent.apply(t,arguments)};"undefined"!=typeof window&&"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",n):window.addEventListener("storage",n,!1))}var o=t("./eventemitter.js"),a=t("../src/shared.js").guid,s=function(t){return t===void 0||t.localStorage===void 0?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(this);i.prototype._transaction=function(t){function e(){if(!a){var l=Date.now(),d=0|s.getItem(f);if(d&&r>l-d)return u||(o._on("storage",e),u=!0),c=setTimeout(e,i),void 0;a=!0,s.setItem(f,l),t(),n()}}function n(){u&&o._off("storage",e),c&&clearTimeout(c),s.removeItem(f)}var r=1e3,i=20,o=this,a=!1,u=!1,c=null;e()},i.prototype._cleanup_emit=n(100,function(){var t=this;t._transaction(function(){var t,e=Date.now(),n=e-l,r=0;try{t=JSON.parse(s.getItem(u)||"[]")}catch(i){t=[]}for(var o=t.length-1;o>=0;o--)n>t[o].timestamp&&(t.splice(o,1),r++);r>0&&s.setItem(u,JSON.stringify(t))})}),i.prototype._cleanup_once=n(100,function(){var t=this;t._transaction(function(){var e,n;Date.now();var r=0;try{n=JSON.parse(s.getItem(c)||"{}")}catch(i){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],r++);r>0&&s.setItem(c,JSON.stringify(n))})}),i.prototype._once_expired=function(t,e){if(!e)return!0;if(!e.hasOwnProperty(t))return!0;if("object"!=typeof e[t])return!0;var n=e[t].ttl||d,r=Date.now(),i=e[t].timestamp;return r-n>i},i.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=s.getItem(e);return n===this.previousValues[e]?!1:(this.previousValues[e]=n,!0)},i.prototype._onStorageEvent=function(t){t=t||window.event;var e=this;this._localStorageChanged(t,u)&&this._transaction(function(){var t,n=Date.now(),r=s.getItem(u);try{t=JSON.parse(r||"[]")}catch(i){t=[]}for(var o=0;t.length>o;o++)if(t[o].origin!==e.origin&&!(t[o].timestampr;r++)if(e.call(n,t[r],r,t)===v)return}else{var o=o(t);for(r=0,i=o.length;i>r;r++)if(e.call(n,t[o[r]],o[r],t)===v)return}}function a(t,e,n){e||(e=i);var r=!1;return null==t?r:h&&t.some===h?t.some(e,n):(o(t,function(t,i,o){return r||(r=e.call(n,t,i,o))?v:void 0}),!!r)}function s(t,e){return null==t?!1:d&&t.indexOf===d?-1!=t.indexOf(e):a(t,function(t){return t===e})}function u(t){this.value=t}function c(t){return t&&"object"==typeof t&&!Array.isArray(t)&&m.call(t,"__wrapped__")?t:new u(t)}var f=Array.prototype,l=f.forEach,d=f.indexOf,h=f.some,p=Object.prototype,m=p.hasOwnProperty,g=Object.keys,v={},_=g||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)n(t,r)&&e.push(r);return e};u.prototype.has=function(t){return n(this.value,t)},u.prototype.contains=function(t){return s(this.value,t)},u.prototype.size=function(){return r(this.value)},e.exports=c},{}],5:[function(t,e){(function(t){function n(t,e){if("function"!=typeof e)throw Error("Bad callback given: "+e);if(!t)throw Error("No options given");var a=t.onResponse;if(t="string"==typeof t?{uri:t}:JSON.parse(JSON.stringify(t)),t.onResponse=a,t.verbose&&(n.log=o()),t.url&&(t.uri=t.url,delete t.url),!t.uri&&""!==t.uri)throw Error("options.uri is a required argument");if("string"!=typeof t.uri)throw Error("options.uri must be a string");for(var s=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],c=0;s.length>c;c++)if(t[s[c]])throw Error("options."+s[c]+" is not supported");if(t.callback=e,t.method=t.method||"GET",t.headers=t.headers||{},t.body=t.body||null,t.timeout=t.timeout||n.DEFAULT_TIMEOUT,t.headers.host)throw Error("Options.headers.host is not supported");t.json&&(t.headers.accept=t.headers.accept||"application/json","GET"!==t.method&&(t.headers["content-type"]="application/json"),"boolean"!=typeof t.json?t.body=JSON.stringify(t.json):"string"!=typeof t.body&&(t.body=JSON.stringify(t.body)));var f=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")};if(t.qs){var l="string"==typeof t.qs?t.qs:f(t.qs);t.uri=-1!==t.uri.indexOf("?")?t.uri+"&"+l:t.uri+"?"+l}var d=function(t){var e={};e.boundry="-------------------------------"+Math.floor(1e9*Math.random());var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push("--"+e.boundry+"\n"+'Content-Disposition: form-data; name="'+r+'"'+"\n"+"\n"+t[r]+"\n");return n.push("--"+e.boundry+"--"),e.body=n.join(""),e.length=e.body.length,e.type="multipart/form-data; boundary="+e.boundry,e};if(t.form){if("string"==typeof t.form)throw"form name unsupported";if("POST"===t.method){var h=(t.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(t.headers["content-type"]=h,h){case"application/x-www-form-urlencoded":t.body=f(t.form).replace(/%20/g,"+");break;case"multipart/form-data":var p=d(t.form);t.body=p.body,t.headers["content-type"]=p.type;break;default:throw Error("unsupported encoding:"+h)}}}return t.onResponse=t.onResponse||i,t.onResponse===!0&&(t.onResponse=e,t.callback=i),!t.headers.authorization&&t.auth&&(t.headers.authorization="Basic "+u(t.auth.username+":"+t.auth.password)),r(t)}function r(e){function r(){d=!0;var t=Error("ETIMEDOUT");return t.code="ETIMEDOUT",t.duration=e.timeout,n.log.error("Timeout",{id:f._id,milliseconds:e.timeout}),e.callback(t,f)}function i(){if(d)return n.log.debug("Ignoring timed out state change",{state:f.readyState,id:f.id});if(n.log.debug("State change",{state:f.readyState,id:f.id,timed_out:d}),f.readyState===c.OPENED){n.log.debug("Request started",{id:f.id});for(var t in e.headers)f.setRequestHeader(t,e.headers[t])}else f.readyState===c.HEADERS_RECEIVED?o():f.readyState===c.LOADING?(o(),a()):f.readyState===c.DONE&&(o(),a(),u())}function o(){if(!g.response){if(g.response=!0,n.log.debug("Got response",{id:f.id,status:f.status}),clearTimeout(f.timeoutTimer),f.statusCode=f.status,h&&0==f.statusCode){var t=Error("CORS request rejected: "+e.uri);return t.cors="rejected",g.loading=!0,g.end=!0,e.callback(t,f)}e.onResponse(null,f)}}function a(){g.loading||(g.loading=!0,n.log.debug("Response body loading",{id:f.id}))}function u(){if(!g.end){if(g.end=!0,n.log.debug("Request done",{id:f.id}),null===e.encoding)f.body=new t(new Uint8Array(f.response));else if(f.body=f.responseText,e.json)try{f.body=JSON.parse(f.responseText)}catch(r){return e.callback(r,f)}e.callback(null,f,f.body)}}var f=new c,d=!1,h=s(e.uri),p="withCredentials"in f;if(l+=1,f.seq_id=l,f.id=l+": "+e.method+" "+e.uri,f._id=f.id,h&&!p){var m=Error("Browser does not support cross-origin request: "+e.uri);return m.cors="unsupported",e.callback(m,f)}f.timeoutTimer=setTimeout(r,e.timeout);var g={response:!1,loading:!1,end:!1};return f.onreadystatechange=i,f.open(e.method,e.uri,!0),null===e.encoding&&(f.responseType="arraybuffer"),h&&(f.withCredentials=!!e.withCredentials),f.send(e.body),f}function i(){}function o(){var t,e,n={},r=["trace","debug","info","warn","error"];for(e=0;r.length>e;e++)t=r[e],n[t]=i,"undefined"!=typeof console&&console&&console[t]&&(n[t]=a(console,t));return n}function a(t,e){function n(n,r){return"object"==typeof r&&(n+=" "+JSON.stringify(r)),t[e].call(t,n)}return n}function s(t){var e,n=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{e=location.href}catch(r){e=document.createElement("a"),e.href="",e=e.href}var i=n.exec(e.toLowerCase())||[],o=n.exec(t.toLowerCase()),a=!(!o||o[1]==i[1]&&o[2]==i[2]&&(o[3]||("http:"===o[1]?80:443))==(i[3]||("http:"===i[1]?80:443)));return a}function u(t){var e,n,r,i,o,a,s,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,l=0,d="",h=[];if(!t)return t;do e=t.charCodeAt(f++),n=t.charCodeAt(f++),r=t.charCodeAt(f++),u=e<<16|n<<8|r,i=63&u>>18,o=63&u>>12,a=63&u>>6,s=63&u,h[l++]=c.charAt(i)+c.charAt(o)+c.charAt(a)+c.charAt(s);while(t.length>f);switch(d=h.join(""),t.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d}var c=XMLHttpRequest;if(!c)throw Error("missing XMLHttpRequest");n.log={trace:i,debug:i,info:i,warn:i,error:i};var f=18e4,l=0;n.withCredentials=!1,n.DEFAULT_TIMEOUT=f,n.defaults=function(t){var e=function(e){var n=function(n,r){n="string"==typeof n?{uri:n}:JSON.parse(JSON.stringify(n));for(var i in t)void 0===n[i]&&(n[i]=t[i]);return e(n,r)};return n},r=e(n);return r.get=e(n.get),r.post=e(n.post),r.put=e(n.put),r.head=e(n.head),r};var d=["get","put","post","head"];d.forEach(function(t){var e=t.toUpperCase(),r=t.toLowerCase();n[r]=function(t){"string"==typeof t?t={method:e,uri:t}:(t=JSON.parse(JSON.stringify(t)),t.method=e);var r=[t].concat(Array.prototype.slice.apply(arguments,[1]));return n.apply(this,r)}}),n.couch=function(t,e){function r(t,n,r){if(t)return e(t,n,r);if((200>n.statusCode||n.statusCode>299)&&r.error){t=Error("CouchDB error: "+(r.error.reason||r.error.error));for(var i in r)t[i]=r[i];return e(t,n,r)}return e(t,n,r)}"string"==typeof t&&(t={uri:t}),t.json=!0,t.body&&(t.json=t.body),delete t.body,e=e||i;var o=n(t,r);return o},e.exports=n}).call(this,t("buffer").Buffer)},{}],6:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],7:[function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(t){for(var e,n,i,o,a,s,u,c="",f=0;t.length>f;)e=t.charCodeAt(f++),n=t.charCodeAt(f++),i=t.charCodeAt(f++),o=e>>2,a=(3&e)<<4|n>>4,s=(15&n)<<2|i>>6,u=63&i,isNaN(n)?s=u=64:isNaN(i)&&(u=64),c=c+r.charAt(o)+r.charAt(a)+r.charAt(s)+r.charAt(u);return c},n.decode=function(t){var e,n,i,o,a,s,u,c="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");t.length>f;)o=r.indexOf(t.charAt(f++)),a=r.indexOf(t.charAt(f++)),s=r.indexOf(t.charAt(f++)),u=r.indexOf(t.charAt(f++)),e=o<<2|a>>4,n=(15&a)<<4|s>>2,i=(3&s)<<6|u,c+=String.fromCharCode(e),64!=s&&(c+=String.fromCharCode(n)),64!=u&&(c+=String.fromCharCode(i));return c}},{}],8:[function(t,e){"use strict";function n(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}n.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},e.exports=n},{}],9:[function(t,e,n){"use strict";n.STORE={magic:"\0\0",compress:function(t){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},n.DEFLATE=t("./flate")},{"./flate":12}],10:[function(t,e){"use strict";function n(){this.data=null,this.length=0,this.index=0}var r=t("./utils");n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(t>this.length||0>t)throw Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return r.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date((127&t>>25)+1980,(15&t>>21)-1,31&t>>16,31&t>>11,63&t>>5,(31&t)<<1)}},e.exports=n},{"./utils":22}],11:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.date=null,n.compression=null},{}],12:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako");n.uncompressInputType=r?"uint8array":"array",n.compressInputType=r?"uint8array":"array",n.magic="\b\0",n.compress=function(t){return i.deflateRaw(t)},n.uncompress=function(t){return i.inflateRaw(t)}},{pako:25}],13:[function(t,e){"use strict";function n(t,e){return this instanceof n?(this.files={},this.root="",t&&this.load(t,e),this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t},void 0):new n(t,e)}n.prototype=t("./object"),n.prototype.load=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.utils=t("./utils"),n.base64=t("./base64"),n.compressions=t("./compressions"),e.exports=n},{"./base64":7,"./compressions":9,"./defaults":11,"./load":14,"./object":17,"./support":20,"./utils":22}],14:[function(t,e){"use strict";var n=t("./base64"),r=t("./zipEntries");e.exports=function(t,e){var i,o,a,s;for(e=e||{},e.base64&&(t=n.decode(t)),o=new r(t,e),i=o.files,a=0;i.length>a;a++)s=i[a],this.file(s.fileName,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir});return this}},{"./base64":7,"./zipEntries":23}],15:[function(t,e){(function(t){"use strict";e.exports=function(e,n){return new t(e,n)},e.exports.test=function(e){return t.isBuffer(e)}}).call(this,t("buffer").Buffer)},{}],16:[function(t,e){"use strict";function n(t){this.data=t,this.length=this.data.length,this.index=0}var r=t("./uint8ArrayReader");n.prototype=new r,n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./uint8ArrayReader":21}],17:[function(t,e){"use strict";var n,r,i=t("./support"),o=t("./utils"),a=t("./signature"),s=t("./defaults"),u=t("./base64"),c=t("./compressions"),f=t("./compressedObject"),l=t("./nodeBuffer");i.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8"));var d=function(t){if(t._data instanceof f&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===o.getTypeOf(t._data))){var e=t._data;t._data=new Uint8Array(e.length),0!==e.length&&t._data.set(e,0)}return t._data},h=function(t){var e=d(t),r=o.getTypeOf(e);if("string"===r){if(!t.options.binary){if(n)return n.encode(e);if(i.nodebuffer)return l(e,"utf-8")}return t.asBinary()}return e},p=function(t){var e=d(this);return null===e||e===void 0?"":(this.options.base64&&(e=u.decode(e)),e=t&&this.options.binary?S.utf8decode(e):o.transformTo("string",e),t||this.options.binary||(e=S.utf8encode(e)),e)},m=function(t,e,n){this.name=t,this._data=e,this.options=n};m.prototype={asText:function(){return p.call(this,!0)},asBinary:function(){return p.call(this,!1)},asNodeBuffer:function(){var t=h(this);return o.transformTo("nodebuffer",t)},asUint8Array:function(){var t=h(this);return o.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var g=function(t,e){var n,r="";for(n=0;e>n;n++)r+=String.fromCharCode(255&t),t>>>=8;return r},v=function(){var t,e,n={};for(t=0;arguments.length>t;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&n[e]===void 0&&(n[e]=arguments[t][e]);return n},_=function(t){return t=t||{},t.base64!==!0||null!==t.binary&&void 0!==t.binary||(t.binary=!0),t=v(t,s),t.date=t.date||new Date,null!==t.compression&&(t.compression=t.compression.toUpperCase()),t},y=function(t,e,n){var r=o.getTypeOf(e);if(n=_(n),n.dir||null===e||e===void 0)n.base64=!1,n.binary=!1,e=null;else if("string"===r)n.binary&&!n.base64&&n.optimizedBinaryString!==!0&&(e=o.string2binary(e));else{if(n.base64=!1,n.binary=!0,!(r||e instanceof f))throw Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===r&&(e=o.transformTo("uint8array",e))}var i=new m(t,e,n);return this.files[t]=i,i},b=function(t){return"/"!=t.slice(-1)&&(t+="/"),this.files[t]||y.call(this,t,null,{dir:!0}),this.files[t]},w=function(t,e){var n,r=new f;return t._data instanceof f?(r.uncompressedSize=t._data.uncompressedSize,r.crc32=t._data.crc32,0===r.uncompressedSize||t.options.dir?(e=c.STORE,r.compressedContent="",r.crc32=0):t._data.compressionMethod===e.magic?r.compressedContent=t._data.getCompressedContent():(n=t._data.getContent(),r.compressedContent=e.compress(o.transformTo(e.compressInputType,n)))):(n=h(t),(!n||0===n.length||t.options.dir)&&(e=c.STORE,n=""),r.uncompressedSize=n.length,r.crc32=this.crc32(n),r.compressedContent=e.compress(o.transformTo(e.compressInputType,n))),r.compressedSize=r.compressedContent.length,r.compressionMethod=e.magic,r},E=function(t,e,n,r){var i,o,s=(n.compressedContent,this.utf8encode(e.name)),u=s!==e.name,c=e.options,f="",l="";i=c.date.getHours(),i<<=6,i|=c.date.getMinutes(),i<<=5,i|=c.date.getSeconds()/2,o=c.date.getFullYear()-1980,o<<=4,o|=c.date.getMonth()+1,o<<=5,o|=c.date.getDate(),u&&(l=g(1,1)+g(this.crc32(s),4)+s,f+="up"+g(l.length,2)+l);var d="";d+="\n\0",d+=u?"\0\b":"\0\0",d+=n.compressionMethod,d+=g(i,2),d+=g(o,2),d+=g(n.crc32,4),d+=g(n.compressedSize,4),d+=g(n.uncompressedSize,4),d+=g(s.length,2),d+=g(f.length,2);var h=a.LOCAL_FILE_HEADER+d+s+f,p=a.CENTRAL_FILE_HEADER+"\0"+d+"\0\0"+"\0\0"+"\0\0"+(e.options.dir===!0?"\0\0\0":"\0\0\0\0")+g(r,4)+s+f;return{fileRecord:h,dirRecord:p,compressedObject:n}},x=function(){this.data=[]};x.prototype={append:function(t){t=o.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}};var k=function(t){this.data=new Uint8Array(t),this.index=0};k.prototype={append:function(t){0!==t.length&&(t=o.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}};var S={load:function(){throw Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var e,n,r,i,o=[];for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],i=new m(r.name,r._data,v(r.options)),n=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(n,i)&&o.push(i));return o},file:function(t,e,n){if(1===arguments.length){if(o.isRegExp(t)){var r=t;return this.filter(function(t,e){return!e.options.dir&&r.test(t)})}return this.filter(function(e,n){return!n.options.dir&&e===t})[0]||null}return t=this.root+t,y.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(o.isRegExp(t))return this.filter(function(e,n){return n.options.dir&&t.test(e) -});var e=this.root+t,n=b.call(this,e),r=this.clone();return r.root=n.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!=t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.options.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),r=0;n.length>r;r++)delete this.files[n[r].name];return this},generate:function(t){t=v(t||{},{base64:!0,compression:"STORE",type:"base64"}),o.checkSupport(t.type);var e,n,r=[],i=0,s=0;for(var f in this.files)if(this.files.hasOwnProperty(f)){var l=this.files[f],d=l.options.compression||t.compression.toUpperCase(),h=c[d];if(!h)throw Error(d+" is not a valid compression method !");var p=w.call(this,l,h),m=E.call(this,f,l,p,i);i+=m.fileRecord.length+p.compressedSize,s+=m.dirRecord.length,r.push(m)}var _="";_=a.CENTRAL_DIRECTORY_END+"\0\0"+"\0\0"+g(r.length,2)+g(r.length,2)+g(s,4)+g(i,4)+"\0\0";var y=t.type.toLowerCase();for(e="uint8array"===y||"arraybuffer"===y||"blob"===y||"nodebuffer"===y?new k(i+s+_.length):new x(i+s+_.length),n=0;r.length>n;n++)e.append(r[n].fileRecord),e.append(r[n].compressedObject.compressedContent);for(n=0;r.length>n;n++)e.append(r[n].dirRecord);e.append(_);var b=e.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return o.transformTo(t.type.toLowerCase(),b);case"blob":return o.arrayBuffer2Blob(o.transformTo("arraybuffer",b));case"base64":return t.base64?u.encode(b):b;default:return b}},crc32:function(t,e){if(t===void 0||!t.length)return 0;var n="string"!==o.getTypeOf(t),r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];e===void 0&&(e=0);var i=0,a=0,s=0;e=-1^e;for(var u=0,c=t.length;c>u;u++)s=n?t[u]:t.charCodeAt(u),a=255&(e^s),i=r[a],e=e>>>8^i;return-1^e},utf8encode:function(t){if(n){var e=n.encode(t);return o.transformTo("string",e)}if(i.nodebuffer)return o.transformTo("string",l(t,"utf-8"));for(var r=[],a=0,s=0;t.length>s;s++){var u=t.charCodeAt(s);128>u?r[a++]=String.fromCharCode(u):u>127&&2048>u?(r[a++]=String.fromCharCode(192|u>>6),r[a++]=String.fromCharCode(128|63&u)):(r[a++]=String.fromCharCode(224|u>>12),r[a++]=String.fromCharCode(128|63&u>>6),r[a++]=String.fromCharCode(128|63&u))}return r.join("")},utf8decode:function(t){var e=[],n=0,a=o.getTypeOf(t),s="string"!==a,u=0,c=0,f=0,l=0;if(r)return r.decode(o.transformTo("uint8array",t));if(i.nodebuffer)return o.transformTo("nodebuffer",t).toString("utf-8");for(;t.length>u;)c=s?t[u]:t.charCodeAt(u),128>c?(e[n++]=String.fromCharCode(c),u++):c>191&&224>c?(f=s?t[u+1]:t.charCodeAt(u+1),e[n++]=String.fromCharCode((31&c)<<6|63&f),u+=2):(f=s?t[u+1]:t.charCodeAt(u+1),l=s?t[u+2]:t.charCodeAt(u+2),e[n++]=String.fromCharCode((15&c)<<12|(63&f)<<6|63&l),u+=3);return e.join("")}};e.exports=S},{"./base64":7,"./compressedObject":8,"./compressions":9,"./defaults":11,"./nodeBuffer":15,"./signature":18,"./support":20,"./utils":22}],18:[function(t,e,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],19:[function(t,e){"use strict";function n(t,e){this.data=t,e||(this.data=i.string2binary(this.data)),this.length=this.data.length,this.index=0}var r=t("./dataReader"),i=t("./utils");n.prototype=new r,n.prototype.byteAt=function(t){return this.data.charCodeAt(t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":10,"./utils":22}],20:[function(t,e,n){(function(t){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=t!==void 0,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var e=new ArrayBuffer(0);try{n.blob=0===new Blob([e],{type:"application/zip"}).size}catch(r){try{var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new i;o.append(e),n.blob=0===o.getBlob("application/zip").size}catch(r){n.blob=!1}}}}).call(this,t("buffer").Buffer)},{}],21:[function(t,e){"use strict";function n(t){t&&(this.data=t,this.length=this.data.length,this.index=0)}var r=t("./dataReader");n.prototype=new r,n.prototype.byteAt=function(t){return this.data[t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),r=t.charCodeAt(2),i=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o;return-1},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.subarray(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":10}],22:[function(t,e,n){"use strict";function r(t){return t}function i(t,e){for(var n=0;t.length>n;++n)e[n]=255&t.charCodeAt(n);return e}function o(t){var e=65536,r=[],i=t.length,o=n.getTypeOf(t),a=0,s=!0;try{switch(o){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,c(0))}}catch(u){s=!1}if(!s){for(var f="",l=0;t.length>l;l++)f+=String.fromCharCode(t[l]);return f}for(;i>a&&e>1;)try{"array"===o||"nodebuffer"===o?r.push(String.fromCharCode.apply(null,t.slice(a,Math.min(a+e,i)))):r.push(String.fromCharCode.apply(null,t.subarray(a,Math.min(a+e,i)))),a+=e}catch(u){e=Math.floor(e/2)}return r.join("")}function a(t,e){for(var n=0;t.length>n;n++)e[n]=t[n];return e}var s=t("./support"),u=t("./compressions"),c=t("./nodeBuffer");n.string2binary=function(t){for(var e="",n=0;t.length>n;n++)e+=String.fromCharCode(255&t.charCodeAt(n));return e},n.string2Uint8Array=function(t){return n.transformTo("uint8array",t)},n.uint8Array2String=function(t){return n.transformTo("string",t)},n.string2Blob=function(t){var e=n.transformTo("arraybuffer",t);return n.arrayBuffer2Blob(e)},n.arrayBuffer2Blob=function(t){n.checkSupport("blob");try{return new Blob([t],{type:"application/zip"})}catch(e){try{var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=new r;return i.append(t),i.getBlob("application/zip")}catch(e){throw Error("Bug : can't construct the Blob.")}}};var f={};f.string={string:r,array:function(t){return i(t,Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return i(t,new Uint8Array(t.length))},nodebuffer:function(t){return i(t,c(t.length))}},f.array={string:o,array:r,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return c(t)}},f.arraybuffer={string:function(t){return o(new Uint8Array(t))},array:function(t){return a(new Uint8Array(t),Array(t.byteLength))},arraybuffer:r,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return c(new Uint8Array(t))}},f.uint8array={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:r,nodebuffer:function(t){return c(t)}},f.nodebuffer={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return a(t,new Uint8Array(t.length))},nodebuffer:r},n.transformTo=function(t,e){if(e||(e=""),!t)return e;n.checkSupport(t);var r=n.getTypeOf(e),i=f[r][t](e);return i},n.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&c.test(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(t){var e=s[t.toLowerCase()];if(!e)throw Error(t+" is not supported by this browser")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(t){var e,n,r="";for(n=0;(t||"").length>n;n++)e=t.charCodeAt(n),r+="\\x"+(16>e?"0":"")+e.toString(16).toUpperCase();return r},n.findCompression=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},{"./compressions":9,"./nodeBuffer":15,"./support":20}],23:[function(t,e){"use strict";function n(t,e){this.files=[],this.loadOptions=e,t&&this.load(t)}var r=t("./stringReader"),i=t("./nodeBufferReader"),o=t("./uint8ArrayReader"),a=t("./utils"),s=t("./signature"),u=t("./zipEntry"),c=t("./support");n.prototype={checkSignature:function(t){var e=this.reader.readString(4);if(e!==t)throw Error("Corrupted zip or bug : unexpected signature ("+a.pretty(e)+", expected "+a.pretty(t)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,r=this.zip64EndOfCentralSize-44,i=0;r>i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readString(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;this.files.length>t;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===s.CENTRAL_FILE_HEADER;)t=new u({zip64:this.zip64},this.loadOptions),t.readCentralPart(this.reader),this.files.push(t)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(-1===t)throw Error("Corrupted zip : can't find end of central directory");if(this.reader.setIndex(t),this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),-1===t)throw Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(t){var e=a.getTypeOf(t);this.reader="string"!==e||c.uint8array?"nodebuffer"===e?new i(t):new o(a.transformTo("uint8array",t)):new r(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=n},{"./nodeBufferReader":16,"./signature":18,"./stringReader":19,"./support":20,"./uint8ArrayReader":21,"./utils":22,"./zipEntry":24}],24:[function(t,e){"use strict";function n(t,e){this.options=t,this.loadOptions=e}var r=t("./stringReader"),i=t("./utils"),o=t("./compressedObject"),a=t("./object");n.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(t,e,n){return function(){var r=t.index;t.setIndex(e);var i=t.readData(n);return t.setIndex(r),i}},prepareContent:function(t,e,n,r,o){return function(){var t=i.transformTo(r.uncompressInputType,this.getCompressedContent()),e=r.uncompress(t);if(e.length!==o)throw Error("Bug : uncompressed data size mismatch");return e}},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(n),-1==this.compressedSize||-1==this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(e=i.findCompression(this.compressionMethod),null===e)throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new o,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throw Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readString(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=new r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,n,r,i=t.index;for(this.extraFields=this.extraFields||{};t.index0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&16>e.windowBits&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==h)throw Error(c[n]);e.header&&a.deflateSetHeader(this.strm,e.header)};_.prototype.push=function(t,e){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?d:l,i.input="string"==typeof t?u.string2buf(t):t,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new s.Buf8(o),i.next_out=0,i.avail_out=o),n=a.deflate(i,r),n!==p&&n!==h)return this.onEnd(n),this.ended=!0,!1;(0===i.avail_out||0===i.avail_in&&r===d)&&("string"===this.options.to?this.onData(u.buf2binstring(s.shrinkBuf(i.output,i.next_out))):this.onData(s.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&n!==p);return r===d?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===h):!0},_.prototype.onData=function(t){this.chunks.push(t)},_.prototype.onEnd=function(t){t===h&&(this.result="string"===this.options.to?this.chunks.join(""):s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=_,n.deflate=r,n.deflateRaw=i,n.gzip=o},{"./utils/common":28,"./utils/strings":29,"./zlib/deflate.js":33,"./zlib/messages":38,"./zlib/zstream":40}],27:[function(t,e,n){"use strict";function r(t,e){var n=new d(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}var o=t("./zlib/inflate.js"),a=t("./utils/common"),s=t("./utils/strings"),u=t("./zlib/constants"),c=t("./zlib/messages"),f=t("./zlib/zstream"),l=t("./zlib/gzheader"),d=function(t){this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&16>e.windowBits&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&16>e.windowBits)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&48>e.windowBits&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw Error(c[n]);this.header=new l,o.inflateGetHeader(this.strm,this.header)};d.prototype.push=function(t,e){var n,r,i,c,f,l=this.strm,d=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,l.input="string"==typeof t?s.binstring2buf(t):t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new a.Buf8(d),l.next_out=0,l.avail_out=d),n=o.inflate(l,u.Z_NO_FLUSH),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;l.next_out&&(0===l.avail_out||n===u.Z_STREAM_END||0===l.avail_in&&r===u.Z_FINISH)&&("string"===this.options.to?(i=s.utf8border(l.output,l.next_out),c=l.next_out-i,f=s.buf2string(l.output,i),l.next_out=c,l.avail_out=d-c,c&&a.arraySet(l.output,l.output,i,c,0),this.onData(f)):this.onData(a.shrinkBuf(l.output,l.next_out)))}while((l.avail_in>0||0===l.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(r=u.Z_FINISH),r===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):!0},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===u.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=d,n.inflate=r,n.inflateRaw=i,n.ungzip=r},{"./utils/common":28,"./utils/strings":29,"./zlib/constants":31,"./zlib/gzheader":34,"./zlib/inflate.js":36,"./zlib/messages":38,"./zlib/zstream":40}],28:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return t.set(e.subarray(n,n+r),i),void 0;for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;n>e;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;n>e;e++)o=t[e],a.set(o,i),i+=o.length;return a}},o={arraySet:function(t,e,n,r,i){for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],29:[function(t,e,n){"use strict";function r(t,e){if(65537>e&&(t.subarray&&a||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;e>r;r++)n+=String.fromCharCode(t[r]);return n}var i=t("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(s){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){a=!1}for(var u=new i.Buf8(256),c=0;256>c;c++)u[c]=c>=252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;u[254]=u[254]=1,n.string2buf=function(t){var e,n,r,o,a,s=t.length,u=0;for(o=0;s>o;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),u+=128>n?1:2048>n?2:65536>n?3:4;for(e=new i.Buf8(u),a=0,o=0;u>a;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),128>n?e[a++]=n:2048>n?(e[a++]=192|n>>>6,e[a++]=128|63&n):65536>n?(e[a++]=224|n>>>12,e[a++]=128|63&n>>>6,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|63&n>>>12,e[a++]=128|63&n>>>6,e[a++]=128|63&n);return e},n.buf2binstring=function(t){return r(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;r>n;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,o,a,s=e||t.length,c=Array(2*s);for(i=0,n=0;s>n;)if(o=t[n++],128>o)c[i++]=o;else if(a=u[o],a>4)c[i++]=65533,n+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&s>n;)o=o<<6|63&t[n++],a--;a>1?c[i++]=65533:65536>o?c[i++]=o:(o-=65536,c[i++]=55296|1023&o>>10,c[i++]=56320|1023&o)}return r(c,i)},n.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return 0>n?e:0===n?e:n+u[t[n]]>e?n:e}},{"./common":28}],30:[function(t,e){"use strict";function n(t,e,n,r){for(var i=0|65535&t,o=0|65535&t>>>16,a=0;0!==n;){a=n>2e3?2e3:n,n-=a;do i=0|i+e[r++],o=0|o+i;while(--a);i%=65521,o%=65521}return 0|(i|o<<16)}e.exports=n},{}],31:[function(t,e){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],32:[function(t,e){"use strict";function n(){for(var t,e=[],n=0;256>n;n++){t=n;for(var r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,a=r+n;t=-1^t;for(var s=r;a>s;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}var i=n();e.exports=r},{}],33:[function(t,e,n){"use strict";function r(t,e){return t.msg=N[e],e}function i(t){return(t<<1)-(t>4?9:0)}function o(t){for(var e=t.length;--e>=0;)t[e]=0}function a(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(I.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function s(t,e){T._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,a(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function c(t,e){t.pending_buf[t.pending++]=255&e>>>8,t.pending_buf[t.pending++]=255&e}function f(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,I.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=R(t.adler,e,i,n):2===t.state.wrap&&(t.adler=C(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function l(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-ce?t.strstart-(t.w_size-ce):0,c=t.window,f=t.w_mask,l=t.prev,d=t.strstart+ue,h=c[o+a-1],p=c[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,c[n+a]===p&&c[n+a-1]===h&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do;while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&d>o);if(r=ue-(d-o),o=d-ue,r>a){if(t.match_start=e,a=r,r>=s)break;h=c[o+a-1],p=c[o+a]}}while((e=l[e&f])>u&&0!==--i);return t.lookahead>=a?a:t.lookahead}function d(t){var e,n,r,i,o,a=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-ce)){I.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,n=t.hash_size,e=n;do r=t.head[--e],t.head[e]=r>=a?r-a:0;while(--n);n=a,e=n;do r=t.prev[--e],t.prev[e]=r>=a?r-a:0;while(--n);i+=a}if(0===t.strm.avail_in)break;if(n=f(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=se)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.lookahead+t.insert)););}while(ce>t.lookahead&&0!==t.strm.avail_in)}function h(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(1>=t.lookahead){if(d(t),0===t.lookahead&&e===D)return _e;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,s(t,!1),0===t.strm.avail_out))return _e;if(t.strstart-t.block_start>=t.w_size-ce&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=0,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.strstart>t.block_start&&(s(t,!1),0===t.strm.avail_out)?_e:_e}function p(t,e){for(var n,r;;){if(ce>t.lookahead){if(d(t),ce>t.lookahead&&e===D)return _e;if(0===t.lookahead)break}if(n=0,t.lookahead>=se&&(t.ins_h=(t.ins_h<=se)if(r=T._tr_tally(t,t.strstart-t.match_start,t.match_length-se),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=se){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<t.strstart?t.strstart:se-1,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function m(t,e){for(var n,r,i;;){if(ce>t.lookahead){if(d(t),ce>t.lookahead&&e===D)return _e;if(0===t.lookahead)break}if(n=0,t.lookahead>=se&&(t.ins_h=(t.ins_h<=t.match_length&&(t.strategy===Y||t.match_length===se&&t.strstart-t.match_start>4096)&&(t.match_length=se-1)),t.prev_length>=se&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-se,r=T._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-se),t.lookahead-=t.prev_length-1,t.prev_length-=2;do i>=++t.strstart&&(t.ins_h=(t.ins_h<t.strstart?t.strstart:se-1,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function g(t,e){for(var n,r,i,o,a=t.window;;){if(ue>=t.lookahead){if(d(t),ue>=t.lookahead&&e===D)return _e;if(0===t.lookahead)break -}if(t.match_length=0,t.lookahead>=se&&t.strstart>0&&(i=t.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=t.strstart+ue;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&o>i);t.match_length=ue-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=se?(n=T._tr_tally(t,1,t.match_length-se),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=0,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function v(t,e){for(var n;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===D)return _e;break}if(t.match_length=0,n=T._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(s(t,!1),0===t.strm.avail_out))return _e}return t.insert=0,e===j?(s(t,!0),0===t.strm.avail_out?be:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?_e:ye}function _(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=O[t.level].max_lazy,t.good_match=O[t.level].good_length,t.nice_match=O[t.level].nice_length,t.max_chain_length=O[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=se-1,t.match_available=0,t.ins_h=0}function y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=J,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new I.Buf16(2*oe),this.dyn_dtree=new I.Buf16(2*(2*re+1)),this.bl_tree=new I.Buf16(2*(2*ie+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new I.Buf16(ae+1),this.heap=new I.Buf16(2*ne+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new I.Buf16(2*ne+1),o(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function b(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=K,e=t.state,e.pending=0,e.pending_out=0,0>e.wrap&&(e.wrap=-e.wrap),e.status=e.wrap?le:ge,t.adler=2===e.wrap?0:1,e.last_flush=D,T._tr_init(e),F):r(t,P)}function w(t){var e=b(t);return e===F&&_(t.state),e}function E(t,e){return t&&t.state?2!==t.state.wrap?P:(t.state.gzhead=e,F):P}function x(t,e,n,i,o,a){if(!t)return P;var s=1;if(e===Z&&(e=6),0>i?(s=0,i=-i):i>15&&(s=2,i-=16),1>o||o>G||n!==J||8>i||i>15||0>e||e>9||0>a||a>W)return r(t,P);8===i&&(i=9);var u=new y;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=i,u.w_size=1<>1,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=a,u.method=n,w(t)}function k(t,e){return x(t,e,J,Q,$,q)}function S(t,e){var n,s,f,l;if(!t||!t.state||e>B||0>e)return t?r(t,P):P;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===ve&&e!==j)return r(t,0===t.avail_out?V:P);if(s.strm=t,n=s.last_flush,s.last_flush=e,s.status===le)if(2===s.wrap)t.adler=0,u(s,31),u(s,139),u(s,8),s.gzhead?(u(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),u(s,255&s.gzhead.time),u(s,255&s.gzhead.time>>8),u(s,255&s.gzhead.time>>16),u(s,255&s.gzhead.time>>24),u(s,9===s.level?2:s.strategy>=X||2>s.level?4:0),u(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(u(s,255&s.gzhead.extra.length),u(s,255&s.gzhead.extra.length>>8)),s.gzhead.hcrc&&(t.adler=C(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=de):(u(s,0),u(s,0),u(s,0),u(s,0),u(s,0),u(s,9===s.level?2:s.strategy>=X||2>s.level?4:0),u(s,Ee),s.status=ge);else{var d=J+(s.w_bits-8<<4)<<8,h=-1;h=s.strategy>=X||2>s.level?0:6>s.level?1:6===s.level?2:3,d|=h<<6,0!==s.strstart&&(d|=fe),d+=31-d%31,s.status=ge,c(s,d),0!==s.strstart&&(c(s,t.adler>>>16),c(s,65535&t.adler)),t.adler=1}if(s.status===de)if(s.gzhead.extra){for(f=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),a(t),f=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=he)}else s.status=he;if(s.status===he)if(s.gzhead.name){f=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),a(t),f=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexf&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),0===l&&(s.gzindex=0,s.status=pe)}else s.status=pe;if(s.status===pe)if(s.gzhead.comment){f=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>f&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),a(t),f=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexf&&(t.adler=C(t.adler,s.pending_buf,s.pending-f,f)),0===l&&(s.status=me)}else s.status=me;if(s.status===me&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&a(t),s.pending+2<=s.pending_buf_size&&(u(s,255&t.adler),u(s,255&t.adler>>8),t.adler=0,s.status=ge)):s.status=ge),0!==s.pending){if(a(t),0===t.avail_out)return s.last_flush=-1,F}else if(0===t.avail_in&&i(e)<=i(n)&&e!==j)return r(t,V);if(s.status===ve&&0!==t.avail_in)return r(t,V);if(0!==t.avail_in||0!==s.lookahead||e!==D&&s.status!==ve){var p=s.strategy===X?v(s,e):s.strategy===H?g(s,e):O[s.level].func(s,e);if((p===be||p===we)&&(s.status=ve),p===_e||p===be)return 0===t.avail_out&&(s.last_flush=-1),F;if(p===ye&&(e===z?T._tr_align(s):e!==B&&(T._tr_stored_block(s,0,0,!1),e===L&&(o(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),a(t),0===t.avail_out))return s.last_flush=-1,F}return e!==j?F:0>=s.wrap?M:(2===s.wrap?(u(s,255&t.adler),u(s,255&t.adler>>8),u(s,255&t.adler>>16),u(s,255&t.adler>>24),u(s,255&t.total_in),u(s,255&t.total_in>>8),u(s,255&t.total_in>>16),u(s,255&t.total_in>>24)):(c(s,t.adler>>>16),c(s,65535&t.adler)),a(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?F:M)}function A(t){var e;return t&&t.state?(e=t.state.status,e!==le&&e!==de&&e!==he&&e!==pe&&e!==me&&e!==ge&&e!==ve?r(t,P):(t.state=null,e===ge?r(t,U):F)):P}var O,I=t("../utils/common"),T=t("./trees"),R=t("./adler32"),C=t("./crc32"),N=t("./messages"),D=0,z=1,L=3,j=4,B=5,F=0,M=1,P=-2,U=-3,V=-5,Z=-1,Y=1,X=2,H=3,W=4,q=0,K=2,J=8,G=9,Q=15,$=8,te=29,ee=256,ne=ee+1+te,re=30,ie=19,oe=2*ne+1,ae=15,se=3,ue=258,ce=ue+se+1,fe=32,le=42,de=69,he=73,pe=91,me=103,ge=113,ve=666,_e=1,ye=2,be=3,we=4,Ee=3,xe=function(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i};O=[new xe(0,0,0,0,h),new xe(4,4,8,4,p),new xe(4,5,16,8,p),new xe(4,6,32,32,p),new xe(4,4,16,16,m),new xe(8,16,32,32,m),new xe(8,16,128,128,m),new xe(8,32,128,256,m),new xe(32,128,258,1024,m),new xe(32,258,258,4096,m)],n.deflateInit=k,n.deflateInit2=x,n.deflateReset=w,n.deflateResetKeep=b,n.deflateSetHeader=E,n.deflate=S,n.deflateEnd=A,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":28,"./adler32":30,"./crc32":32,"./messages":38,"./trees":39}],34:[function(t,e){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=n},{}],35:[function(t,e){"use strict";var n=30,r=12;e.exports=function(t,e){var i,o,a,s,u,c,f,l,d,h,p,m,g,v,_,y,b,w,E,x,k,S,A,O,I;i=t.state,o=t.next_in,O=t.input,a=o+(t.avail_in-5),s=t.next_out,I=t.output,u=s-(e-t.avail_out),c=s+(t.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,h=i.wnext,p=i.window,m=i.hold,g=i.bits,v=i.lencode,_=i.distcode,y=(1<g&&(m+=O[o++]<>>24,m>>>=E,g-=E,E=255&w>>>16,0===E)I[s++]=65535&w;else{if(!(16&E)){if(0===(64&E)){w=v[(65535&w)+(m&(1<g&&(m+=O[o++]<>>=E,g-=E),15>g&&(m+=O[o++]<>>24,m>>>=E,g-=E,E=255&w>>>16,!(16&E)){if(0===(64&E)){w=_[(65535&w)+(m&(1<g&&(m+=O[o++]<g&&(m+=O[o++]<f){t.msg="invalid distance too far back",i.mode=n;break t}if(m>>>=E,g-=E,E=s-u,k>E){if(E=k-E,E>d&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(S=0,A=p,0===h){if(S+=l-E,x>E){x-=E;do I[s++]=p[S++];while(--E);S=s-k,A=I}}else if(E>h){if(S+=l+h-E,E-=h,x>E){x-=E;do I[s++]=p[S++];while(--E);if(S=0,x>h){E=h,x-=E;do I[s++]=p[S++];while(--E);S=s-k,A=I}}}else if(S+=h-E,x>E){x-=E;do I[s++]=p[S++];while(--E);S=s-k,A=I}for(;x>2;)I[s++]=A[S++],I[s++]=A[S++],I[s++]=A[S++],x-=3;x&&(I[s++]=A[S++],x>1&&(I[s++]=A[S++]))}else{S=s-k;do I[s++]=I[S++],I[s++]=I[S++],I[s++]=I[S++],x-=3;while(x>2);x&&(I[s++]=I[S++],x>1&&(I[s++]=I[S++]))}break}}break}}while(a>o&&c>s);x=g>>3,o-=x,g-=x<<3,m&=(1<o?5+(a-o):5-(o-a),t.avail_out=c>s?257+(c-s):257-(s-c),i.hold=m,i.bits=g}},{}],36:[function(t,e,n){"use strict";function r(t){return(255&t>>>24)+(65280&t>>>8)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=j,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new v.Buf32(pe),e.distcode=e.distdyn=new v.Buf32(me),e.sane=1,e.back=-1,I):C}function a(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):C}function s(t,e){var n,r;return t&&t.state?(r=t.state,0>e?(n=0,e=-e):(n=(e>>4)+1,48>e&&(e&=15)),e&&(8>e||e>15)?C:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,a(t))):C}function u(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=s(t,e),n!==I&&(t.state=null),n):C}function c(t){return u(t,ve)}function f(t){if(_e){var e;for(m=new v.Buf32(512),g=new v.Buf32(32),e=0;144>e;)t.lens[e++]=8;for(;256>e;)t.lens[e++]=9;for(;280>e;)t.lens[e++]=7;for(;288>e;)t.lens[e++]=8;for(w(x,t.lens,0,288,m,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;w(k,t.lens,0,32,g,0,t.work,{bits:5}),_e=!1}t.lencode=m,t.lenbits=9,t.distcode=g,t.distbits=5}function l(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(v.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),v.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(v.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveh;){if(0===u)break t;u--,d+=i[a++]<>>8,n.check=y(n.check,Oe,2,0),d=0,h=0,n.mode=B;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",n.mode=le;break}if((15&d)!==L){t.msg="unknown compression method",n.mode=le;break}if(d>>>=4,h-=4,Ee=(15&d)+8,0===n.wbits)n.wbits=Ee;else if(Ee>n.wbits){t.msg="invalid window size",n.mode=le;break}n.dmax=1<h;){if(0===u)break t;u--,d+=i[a++]<>8),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0,n.mode=F;case F:for(;32>h;){if(0===u)break t;u--,d+=i[a++]<>>8,Oe[2]=255&d>>>16,Oe[3]=255&d>>>24,n.check=y(n.check,Oe,4,0)),d=0,h=0,n.mode=M;case M:for(;16>h;){if(0===u)break t;u--,d+=i[a++]<>8),512&n.flags&&(Oe[0]=255&d,Oe[1]=255&d>>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0,n.mode=P;case P:if(1024&n.flags){for(;16>h;){if(0===u)break t;u--,d+=i[a++]<>>8,n.check=y(n.check,Oe,2,0)),d=0,h=0}else n.head&&(n.head.extra=null);n.mode=U;case U:if(1024&n.flags&&(g=n.length,g>u&&(g=u),g&&(n.head&&(Ee=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),v.arraySet(n.head.extra,i,a,g,Ee)),512&n.flags&&(n.check=y(n.check,i,g,a)),u-=g,a+=g,n.length-=g),n.length))break t;n.length=0,n.mode=V;case V:if(2048&n.flags){if(0===u)break t;g=0;do Ee=i[a+g++],n.head&&Ee&&65536>n.length&&(n.head.name+=String.fromCharCode(Ee));while(Ee&&u>g);if(512&n.flags&&(n.check=y(n.check,i,g,a)),u-=g,a+=g,Ee)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=Z;case Z:if(4096&n.flags){if(0===u)break t;g=0;do Ee=i[a+g++],n.head&&Ee&&65536>n.length&&(n.head.comment+=String.fromCharCode(Ee));while(Ee&&u>g);if(512&n.flags&&(n.check=y(n.check,i,g,a)),u-=g,a+=g,Ee)break t}else n.head&&(n.head.comment=null);n.mode=Y;case Y:if(512&n.flags){for(;16>h;){if(0===u)break t;u--,d+=i[a++]<>9,n.head.done=!0),t.adler=n.check=0,n.mode=W;break;case X:for(;32>h;){if(0===u)break t;u--,d+=i[a++]<>>=7&h,h-=7&h,n.mode=ue;break}for(;3>h;){if(0===u)break t;u--,d+=i[a++]<>>=1,h-=1,3&d){case 0:n.mode=K;break;case 1:if(f(n),n.mode=ee,e===O){d>>>=2,h-=2;break t}break;case 2:n.mode=Q;break;case 3:t.msg="invalid block type",n.mode=le}d>>>=2,h-=2;break;case K:for(d>>>=7&h,h-=7&h;32>h;){if(0===u)break t;u--,d+=i[a++]<>>16)){t.msg="invalid stored block lengths",n.mode=le;break}if(n.length=65535&d,d=0,h=0,n.mode=J,e===O)break t;case J:n.mode=G;case G:if(g=n.length){if(g>u&&(g=u),g>c&&(g=c),0===g)break t;v.arraySet(o,i,a,g,s),u-=g,a+=g,c-=g,s+=g,n.length-=g;break}n.mode=W;break;case Q:for(;14>h;){if(0===u)break t;u--,d+=i[a++]<>>=5,h-=5,n.ndist=(31&d)+1,d>>>=5,h-=5,n.ncode=(15&d)+4,d>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=le;break}n.have=0,n.mode=$;case $:for(;n.haveh;){if(0===u)break t;u--,d+=i[a++]<>>=3,h-=3}for(;19>n.have;)n.lens[Ie[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,ke={bits:n.lenbits},xe=w(E,n.lens,0,19,n.lencode,0,n.work,ke),n.lenbits=ke.bits,xe){t.msg="invalid code lengths set",n.mode=le;break}n.have=0,n.mode=te;case te:for(;n.have>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ge);){if(0===u)break t;u--,d+=i[a++]<_e)d>>>=ge,h-=ge,n.lens[n.have++]=_e;else{if(16===_e){for(Se=ge+2;Se>h;){if(0===u)break t;u--,d+=i[a++]<>>=ge,h-=ge,0===n.have){t.msg="invalid bit length repeat",n.mode=le;break}Ee=n.lens[n.have-1],g=3+(3&d),d>>>=2,h-=2}else if(17===_e){for(Se=ge+3;Se>h;){if(0===u)break t;u--,d+=i[a++]<>>=ge,h-=ge,Ee=0,g=3+(7&d),d>>>=3,h-=3}else{for(Se=ge+7;Se>h;){if(0===u)break t;u--,d+=i[a++]<>>=ge,h-=ge,Ee=0,g=11+(127&d),d>>>=7,h-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=le;break}for(;g--;)n.lens[n.have++]=Ee}}if(n.mode===le)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=le;break}if(n.lenbits=9,ke={bits:n.lenbits},xe=w(x,n.lens,0,n.nlen,n.lencode,0,n.work,ke),n.lenbits=ke.bits,xe){t.msg="invalid literal/lengths set",n.mode=le;break}if(n.distbits=6,n.distcode=n.distdyn,ke={bits:n.distbits},xe=w(k,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,ke),n.distbits=ke.bits,xe){t.msg="invalid distances set",n.mode=le;break}if(n.mode=ee,e===O)break t;case ee:n.mode=ne;case ne:if(u>=6&&c>=258){t.next_out=s,t.avail_out=c,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,b(t,m),s=t.next_out,o=t.output,c=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,d=n.hold,h=n.bits,n.mode===W&&(n.back=-1);break}for(n.back=0;Ae=n.lencode[d&(1<>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ge);){if(0===u)break t;u--,d+=i[a++]<>ye)],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ye+ge);){if(0===u)break t;u--,d+=i[a++]<>>=ye,h-=ye,n.back+=ye}if(d>>>=ge,h-=ge,n.back+=ge,n.length=_e,0===ve){n.mode=se;break}if(32&ve){n.back=-1,n.mode=W;break}if(64&ve){t.msg="invalid literal/length code",n.mode=le;break}n.extra=15&ve,n.mode=re;case re:if(n.extra){for(Se=n.extra;Se>h;){if(0===u)break t;u--,d+=i[a++]<>>=n.extra,h-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ie;case ie:for(;Ae=n.distcode[d&(1<>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ge);){if(0===u)break t;u--,d+=i[a++]<>ye)],ge=Ae>>>24,ve=255&Ae>>>16,_e=65535&Ae,!(h>=ye+ge);){if(0===u)break t;u--,d+=i[a++]<>>=ye,h-=ye,n.back+=ye}if(d>>>=ge,h-=ge,n.back+=ge,64&ve){t.msg="invalid distance code",n.mode=le;break}n.offset=_e,n.extra=15&ve,n.mode=oe;case oe:if(n.extra){for(Se=n.extra;Se>h;){if(0===u)break t;u--,d+=i[a++]<>>=n.extra,h-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=le;break}n.mode=ae;case ae:if(0===c)break t;if(g=m-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=le;break}g>n.wnext?(g-=n.wnext,pe=n.wsize-g):pe=n.wnext-g,g>n.length&&(g=n.length),me=n.window}else me=o,pe=s-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do o[s++]=me[pe++];while(--g);0===n.length&&(n.mode=ne);break;case se:if(0===c)break t;o[s++]=n.length,c--,n.mode=ne;break;case ue:if(n.wrap){for(;32>h;){if(0===u)break t;u--,d|=i[a++]<h;){if(0===u)break t;u--,d+=i[a++]<n.mode&&(ue>n.mode||e!==S))&&l(t,t.output,t.next_out,m-t.avail_out)?(n.mode=de,D):(p-=t.avail_in,m-=t.avail_out,t.total_in+=p,t.total_out+=m,n.total+=m,n.wrap&&m&&(t.adler=n.check=n.flags?y(n.check,o,m,t.next_out-m):_(n.check,o,m,t.next_out-m)),t.data_type=n.bits+(n.last?64:0)+(n.mode===W?128:0)+(n.mode===ee||n.mode===J?256:0),(0===p&&0===m||e===S)&&xe===I&&(xe=z),xe)}function h(t){if(!t||!t.state)return C;var e=t.state;return e.window&&(e.window=null),t.state=null,I}function p(t,e){var n;return t&&t.state?(n=t.state,0===(2&n.wrap)?C:(n.head=e,e.done=!1,I)):C}var m,g,v=t("../utils/common"),_=t("./adler32"),y=t("./crc32"),b=t("./inffast"),w=t("./inftrees"),E=0,x=1,k=2,S=4,A=5,O=6,I=0,T=1,R=2,C=-2,N=-3,D=-4,z=-5,L=8,j=1,B=2,F=3,M=4,P=5,U=6,V=7,Z=8,Y=9,X=10,H=11,W=12,q=13,K=14,J=15,G=16,Q=17,$=18,te=19,ee=20,ne=21,re=22,ie=23,oe=24,ae=25,se=26,ue=27,ce=28,fe=29,le=30,de=31,he=32,pe=852,me=592,ge=15,ve=ge,_e=!0;n.inflateReset=a,n.inflateReset2=s,n.inflateResetKeep=o,n.inflateInit=c,n.inflateInit2=u,n.inflate=d,n.inflateEnd=h,n.inflateGetHeader=p,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":28,"./adler32":30,"./crc32":32,"./inffast":35,"./inftrees":37}],37:[function(t,e){"use strict";var n=t("../utils/common"),r=15,i=852,o=592,a=0,s=1,u=2,c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,h,p,m,g,v,_){var y,b,w,E,x,k,S,A,O,I=_.bits,T=0,R=0,C=0,N=0,D=0,z=0,L=0,j=0,B=0,F=0,M=null,P=0,U=new n.Buf16(r+1),V=new n.Buf16(r+1),Z=null,Y=0;for(T=0;r>=T;T++)U[T]=0;for(R=0;p>R;R++)U[e[h+R]]++;for(D=I,N=r;N>=1&&0===U[N];N--);if(D>N&&(D=N),0===N)return m[g++]=20971520,m[g++]=20971520,_.bits=1,0;for(C=1;N>C&&0===U[C];C++);for(C>D&&(D=C),j=1,T=1;r>=T;T++)if(j<<=1,j-=U[T],0>j)return-1;if(j>0&&(t===a||1!==N))return-1;for(V[1]=0,T=1;r>T;T++)V[T+1]=V[T]+U[T];for(R=0;p>R;R++)0!==e[h+R]&&(v[V[e[h+R]]++]=R);switch(t){case a:M=Z=v,k=19;break;case s:M=c,P-=257,Z=f,Y-=257,k=256;break;default:M=l,Z=d,k=-1}if(F=0,R=0,T=C,x=g,z=D,L=0,w=-1,B=1<i||t===u&&B>o)return 1;for(var X=0;;){X++,S=T-L,k>v[R]?(A=0,O=v[R]):v[R]>k?(A=Z[Y+v[R]],O=M[P+v[R]]):(A=96,O=0),y=1<>L)+b]=0|(S<<24|A<<16|O);while(0!==b);for(y=1<>=1;if(0!==y?(F&=y-1,F+=y):F=0,R++,0===--U[T]){if(T===N)break;T=e[h+v[R]]}if(T>D&&(F&E)!==w){for(0===L&&(L=D),x+=C,z=T-L,j=1<z+L&&(j-=U[z+L],!(0>=j));)z++,j<<=1;if(B+=1<i||t===u&&B>o)return 1;w=F&E,m[w]=0|(D<<24|z<<16|x-g)}}return 0!==F&&(m[x+F]=0|(T-L<<24|64<<16)),_.bits=D,0}},{"../utils/common":28}],38:[function(t,e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],39:[function(t,e,n){"use strict";function r(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t){return 256>t?ae[t]:ae[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=255&e>>>8}function a(t,e,n){t.bi_valid>W-n?(t.bi_buf|=65535&e<>W-t.bi_valid,t.bi_valid+=n-W):(t.bi_buf|=65535&e<>>=1,n<<=1;while(--e>0);return n>>>1}function c(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function f(t,e){var n,r,i,o,a,s,u=e.dyn_tree,c=e.max_code,f=e.stat_desc.static_tree,l=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;H>=o;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;X>n;n++)r=t.heap[n],o=u[2*u[2*r+1]+1]+1,o>p&&(o=p,m++),u[2*r+1]=o,r>c||(t.bl_count[o]++,a=0,r>=h&&(a=d[r-h]),s=u[2*r],t.opt_len+=s*(o+a),l&&(t.static_len+=s*(f[2*r+1]+a)));if(0!==m){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)i=t.heap[--n],i>c||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}function l(t,e,n){var r,i,o=Array(H+1),a=0;for(r=1;H>=r;r++)o[r]=a=a+n[r-1]<<1;for(i=0;e>=i;i++){var s=t[2*i+1];0!==s&&(t[2*i]=u(o[s]++,s))}}function d(){var t,e,n,r,i,o=Array(H+1);for(n=0,r=0;P-1>r;r++)for(ue[r]=n,t=0;1<<$[r]>t;t++)se[n++]=r;for(se[n-1]=r,i=0,r=0;16>r;r++)for(ce[r]=i,t=0;1<t;t++)ae[i++]=r;for(i>>=7;Z>r;r++)for(ce[r]=i<<7,t=0;1<t;t++)ae[256+i++]=r;for(e=0;H>=e;e++)o[e]=0;for(t=0;143>=t;)ie[2*t+1]=8,t++,o[8]++;for(;255>=t;)ie[2*t+1]=9,t++,o[9]++;for(;279>=t;)ie[2*t+1]=7,t++,o[7]++;for(;287>=t;)ie[2*t+1]=8,t++,o[8]++;for(l(ie,V+1,o),t=0;Z>t;t++)oe[2*t+1]=5,oe[2*t]=u(t,5);fe=new he(ie,$,U+1,V,H),le=new he(oe,te,0,Z,H),de=new he(Array(0),ee,0,Y,q)}function h(t){var e;for(e=0;V>e;e++)t.dyn_ltree[2*e]=0;for(e=0;Z>e;e++)t.dyn_dtree[2*e]=0;for(e=0;Y>e;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*K]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function p(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,n,r){p(t),r&&(o(t,n),o(t,~n)),R.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function g(t,e,n,r){var i=2*e,o=2*n;return t[i]=i&&(t.heap_len>i&&g(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!g(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function _(t,e,n){var r,o,u,c,f=0;if(0!==t.last_lit)do r=t.pending_buf[t.d_buf+2*f]<<8|t.pending_buf[t.d_buf+2*f+1],o=t.pending_buf[t.l_buf+f],f++,0===r?s(t,o,e):(u=se[o],s(t,u+U+1,e),c=$[u],0!==c&&(o-=ue[u],a(t,o,c)),r--,u=i(r),s(t,u,n),c=te[u],0!==c&&(r-=ce[u],a(t,r,c)));while(t.last_lit>f);s(t,K,e)}function y(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,c=-1;for(t.heap_len=0,t.heap_max=X,n=0;u>n;n++)0!==o[2*n]?(t.heap[++t.heap_len]=c=n,t.depth[n]=0):o[2*n+1]=0;for(;2>t.heap_len;)i=t.heap[++t.heap_len]=2>c?++c:0,o[2*i]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=c,n=t.heap_len>>1;n>=1;n--)v(t,o,n);i=u;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],v(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,v(t,o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],f(t,e),l(o,c,t.bl_count)}function b(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;n>=r;r++)i=a,a=e[2*(r+1)+1],u>++s&&i===a||(c>s?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[2*J]++):10>=s?t.bl_tree[2*G]++:t.bl_tree[2*Q]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function w(t,e,n){var r,i,o=-1,u=e[1],c=0,f=7,l=4;for(0===u&&(f=138,l=3),r=0;n>=r;r++)if(i=u,u=e[2*(r+1)+1],!(f>++c&&i===u)){if(l>c){do s(t,i,t.bl_tree);while(0!==--c)}else 0!==i?(i!==o&&(s(t,i,t.bl_tree),c--),s(t,J,t.bl_tree),a(t,c-3,2)):10>=c?(s(t,G,t.bl_tree),a(t,c-3,3)):(s(t,Q,t.bl_tree),a(t,c-11,7));c=0,o=i,0===u?(f=138,l=3):i===u?(f=6,l=3):(f=7,l=4)}}function E(t){var e;for(b(t,t.dyn_ltree,t.l_desc.max_code),b(t,t.dyn_dtree,t.d_desc.max_code),y(t,t.bl_desc),e=Y-1;e>=3&&0===t.bl_tree[2*ne[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function x(t,e,n,r){var i;for(a(t,e-257,5),a(t,n-1,5),a(t,r-4,4),i=0;r>i;i++)a(t,t.bl_tree[2*ne[i]+1],3);w(t,t.dyn_ltree,e-1),w(t,t.dyn_dtree,n-1)}function k(t){var e,n=4093624447;for(e=0;31>=e;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return N;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return D;for(e=32;U>e;e++)if(0!==t.dyn_ltree[2*e])return D;return N}function S(t){me||(d(),me=!0),t.l_desc=new pe(t.dyn_ltree,fe),t.d_desc=new pe(t.dyn_dtree,le),t.bl_desc=new pe(t.bl_tree,de),t.bi_buf=0,t.bi_valid=0,h(t)}function A(t,e,n,r){a(t,(L<<1)+(r?1:0),3),m(t,e,n,!0)}function O(t){a(t,j<<1,3),s(t,K,ie),c(t)}function I(t,e,n,r){var i,o,s=0;t.level>0?(t.strm.data_type===z&&(t.strm.data_type=k(t)),y(t,t.l_desc),y(t,t.d_desc),s=E(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,i>=o&&(i=o)):i=o=n+5,i>=n+4&&-1!==e?A(t,e,n,r):t.strategy===C||o===i?(a(t,(j<<1)+(r?1:0),3),_(t,ie,oe)):(a(t,(B<<1)+(r?1:0),3),x(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),_(t,t.dyn_ltree,t.dyn_dtree)),h(t),r&&p(t)}function T(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=255&e>>>8,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(se[n]+U+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var R=t("../utils/common"),C=4,N=0,D=1,z=2,L=0,j=1,B=2,F=3,M=258,P=29,U=256,V=U+1+P,Z=30,Y=19,X=2*V+1,H=15,W=16,q=7,K=256,J=16,G=17,Q=18,$=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],te=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ee=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],re=512,ie=Array(2*(V+2));r(ie);var oe=Array(2*Z);r(oe);var ae=Array(re);r(ae);var se=Array(M-F+1);r(se);var ue=Array(P);r(ue);var ce=Array(Z);r(ce);var fe,le,de,he=function(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length},pe=function(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e},me=!1;n._tr_init=S,n._tr_stored_block=A,n._tr_flush_block=I,n._tr_tally=T,n._tr_align=O},{"../utils/common":28}],40:[function(t,e){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},{}],41:[function(t,e){var n="READ",r="WRITE",i="CREATE",o="EXCLUSIVE",a="TRUNCATE",s="APPEND",u="CREATE",c="REPLACE";e.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",O_READ:n,O_WRITE:r,O_CREATE:i,O_EXCLUSIVE:o,O_TRUNCATE:a,O_APPEND:s,O_FLAGS:{r:[n],"r+":[n,r],w:[r,i,a],"w+":[r,n,i,a],wx:[r,i,o,a],"wx+":[r,n,i,o,a],a:[r,i,s],"a+":[r,n,i,s],ax:[r,i,o,s],"ax+":[r,n,i,o,s]},XATTR_CREATE:u,XATTR_REPLACE:c,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}}},{}],42:[function(t,e){var n=t("./constants.js").MODE_FILE;e.exports=function(t,e){this.id=t,this.type=e||n}},{"./constants.js":41}],43:[function(t,e){(function(t){function n(t){return t.toString("utf8")}function r(e){return new t(e,"utf8")}e.exports={encode:r,decode:n}}).call(this,t("buffer").Buffer)},{}],44:[function(t,e){var n={};["-1:UNKNOWN:unknown error","0:OK:success","1:EOF:end of file","2:EADDRINFO:getaddrinfo error","3:EACCES:permission denied","4:EAGAIN:resource temporarily unavailable","5:EADDRINUSE:address already in use","6:EADDRNOTAVAIL:address not available","7:EAFNOSUPPORT:address family not supported","8:EALREADY:connection already in progress","9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","11:ECONNABORTED:software caused connection abort","12:ECONNREFUSED:connection refused","13:ECONNRESET:connection reset by peer","14:EDESTADDRREQ:destination address required","15:EFAULT:bad address in system call argument","16:EHOSTUNREACH:host is unreachable","17:EINTR:interrupted system call","18:EINVAL:invalid argument","19:EISCONN:socket is already connected","20:EMFILE:too many open files","21:EMSGSIZE:message too long","22:ENETDOWN:network is down","23:ENETUNREACH:network is unreachable","24:ENFILE:file table overflow","25:ENOBUFS:no buffer space available","26:ENOMEM:not enough memory","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","29:ENONET:machine is not on the network","31:ENOTCONN:socket is not connected","32:ENOTSOCK:socket operation on non-socket","33:ENOTSUP:operation not supported on socket","34:ENOENT:no such file or directory","35:ENOSYS:function not implemented","36:EPIPE:broken pipe","37:EPROTO:protocol error","38:EPROTONOSUPPORT:protocol not supported","39:EPROTOTYPE:protocol wrong type for socket","40:ETIMEDOUT:connection timed out","41:ECHARSET:invalid Unicode character","42:EAIFAMNOSUPPORT:address family for hostname not supported","44:EAISERVICE:servname not supported for ai_socktype","45:EAISOCKTYPE:ai_socktype not supported","46:ESHUTDOWN:cannot send after transport endpoint shutdown","47:EEXIST:file already exists","48:ESRCH:no such process","49:ENAMETOOLONG:name too long","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","52:EXDEV:cross-device link not permitted","53:ENOTEMPTY:directory not empty","54:ENOSPC:no space left on device","55:EIO:i/o error","56:EROFS:read-only file system","57:ENODEV:no such device","58:ESPIPE:invalid seek","59:ECANCELED:operation canceled","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(t){function e(t){this.message=t||o -}t=t.split(":");var r=t[0],i=t[1],o=t[2],a=e.prototype=Error();a.errno=r,a.code=i,a.constructor=e,n[i]=n[r]=e}),e.exports=n},{}],45:[function(t,e){(function(n){function r(t){return function(e,n){e?t(e):t(null,n)}}function i(t,e,n,r,i){function o(n){t.changes.push({event:"change",path:e}),i(n)}var a=t.flags;he(a).contains(Be)&&delete r.ctime,he(a).contains(je)&&delete r.mtime;var s=!1;r.ctime&&(n.ctime=r.ctime,n.atime=r.ctime,s=!0),r.atime&&(n.atime=r.atime,s=!0),r.mtime&&(n.mtime=r.mtime,s=!0),s?t.put(n.id,n,o):o()}function o(t,e,n,r){function o(n,i){n?r(n):i.mode!==Ee?r(new Me.ENOTDIR("a component of the path prefix is not a directory")):(l=i,a(t,e,s))}function s(e,n){!e&&n?r(new Me.EEXIST("path name already exists")):!e||e instanceof Me.ENOENT?t.get(l.data,u):r(e)}function u(e,i){e?r(e):(d=i,h=new Ze(void 0,n),h.nlinks+=1,t.put(h.id,h,f))}function c(e){if(e)r(e);else{var n=Date.now();i(t,m,h,{mtime:n,ctime:n},r)}}function f(e){e?r(e):(d[p]=new Pe(h.id,n),t.put(l.data,d,c))}if(n!==Ee&&n!==we)return r(new Me.EINVAL("mode must be a directory or file"));e=me(e);var l,d,h,p=ve(e),m=ge(e);a(t,m,o)}function a(t,e,n){function r(e,r){e?n(e):r&&r.mode===ke&&r.rnode?t.get(r.rnode,i):n(new Me.EFILESYSTEMERROR)}function i(t,e){t?n(t):e?n(null,e):n(new Me.ENOENT)}function o(e,r){e?n(e):r.mode===Ee&&r.data?t.get(r.data,s):n(new Me.ENOTDIR("a component of the path prefix is not a directory"))}function s(e,r){if(e)n(e);else if(he(r).has(f)){var i=r[f].id;t.get(i,u)}else n(new Me.ENOENT)}function u(t,e){t?n(t):e.mode==xe?(d++,d>Oe?n(new Me.ELOOP):c(e.data)):n(null,e)}function c(e){e=me(e),l=ge(e),f=ve(e),Se==f?t.get(Ae,r):a(t,l,o)}if(e=me(e),!e)return n(new Me.ENOENT("path is an empty string"));var f=ve(e),l=ge(e),d=0;Se==f?t.get(Ae,r):a(t,l,o)}function s(t,e,n,r,o,s){function u(e,a){function u(e){e?s(e):i(t,c,a,{ctime:Date.now()},s)}a?a.xattrs[n]:null,e?s(e):o===ze&&a.xattrs.hasOwnProperty(n)?s(new Me.EEXIST("attribute already exists")):o!==Le||a.xattrs.hasOwnProperty(n)?(a.xattrs[n]=r,t.put(a.id,a,u)):s(new Me.ENOATTR)}var c;"string"==typeof e?(c=e,a(t,e,u)):"object"==typeof e&&"string"==typeof e.id?(c=e.path,t.get(e.id,u)):s(new Me.EINVAL("path or file descriptor of wrong type"))}function u(t,e){function n(n,i){!n&&i?e(new Me.EEXIST):!n||n instanceof Me.ENOENT?(o=new Ve,t.put(o.id,o,r)):e(n)}function r(n){n?e(n):(a=new Ze(o.rnode,Ee),a.nlinks+=1,t.put(a.id,a,i))}function i(n){n?e(n):(s={},t.put(a.data,s,e))}var o,a,s;t.get(Ae,n)}function c(t,e,n){function r(e,r){!e&&r?n(new Me.EEXIST):!e||e instanceof Me.ENOENT?a(t,g,o):n(e)}function o(e,r){e?n(e):(h=r,t.get(h.data,s))}function s(e,r){e?n(e):(p=r,l=new Ze(void 0,Ee),l.nlinks+=1,t.put(l.id,l,u))}function u(e){e?n(e):(d={},t.put(l.data,d,f))}function c(e){if(e)n(e);else{var r=Date.now();i(t,g,h,{mtime:r,ctime:r},n)}}function f(e){e?n(e):(p[m]=new Pe(l.id,Ee),t.put(h.data,p,c))}e=me(e);var l,d,h,p,m=ve(e),g=ge(e);a(t,e,r)}function f(t,e,n){function r(e,r){e?n(e):(m=r,t.get(m.data,o))}function o(e,r){e?n(e):Se==v?n(new Me.EBUSY):he(r).has(v)?(g=r,h=g[v].id,t.get(h,s)):n(new Me.ENOENT)}function s(e,r){e?n(e):r.mode!=Ee?n(new Me.ENOTDIR):(h=r,t.get(h.data,u))}function u(t,e){t?n(t):(p=e,he(p).size()>0?n(new Me.ENOTEMPTY):f())}function c(e){if(e)n(e);else{var r=Date.now();i(t,_,m,{mtime:r,ctime:r},l)}}function f(){delete g[v],t.put(m.data,g,c)}function l(e){e?n(e):t.delete(h.id,d)}function d(e){e?n(e):t.delete(h.data,n)}e=me(e);var h,p,m,g,v=ve(e),_=ge(e);a(t,_,r)}function l(t,e,r,o){function s(e,n){e?o(e):(v=n,t.get(v.data,u))}function u(e,n){e?o(e):(_=n,he(_).has(E)?he(r).contains(Ce)?o(new Me.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists")):(y=_[E],y.type==Ee&&he(r).contains(Te)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):t.get(y.id,c)):he(r).contains(Re)?d():o(new Me.ENOENT("O_CREATE is not set and the named file does not exist")))}function c(t,e){if(t)o(t);else{var n=e;n.mode==xe?(k++,k>Oe?o(new Me.ELOOP):f(n.data)):l(void 0,n)}}function f(n){n=me(n),x=ge(n),E=ve(n),Se==E&&(he(r).contains(Te)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):a(t,e,l)),a(t,x,s)}function l(t,e){t?o(t):(b=e,o(null,b))}function d(){b=new Ze(void 0,we),b.nlinks+=1,t.put(b.id,b,h)}function h(e){e?o(e):(w=new n(0),w.fill(0),t.put(b.data,w,m))}function p(e){if(e)o(e);else{var n=Date.now();i(t,x,v,{mtime:n,ctime:n},g)}}function m(e){e?o(e):(_[E]=new Pe(b.id,we),t.put(v.data,_,p))}function g(t){t?o(t):o(null,b)}e=me(e);var v,_,y,b,w,E=ve(e),x=ge(e),k=0;Se==E?he(r).contains(Te)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):a(t,e,l):a(t,x,s)}function d(t,e,r,o,a,s){function u(t){t?s(t):s(null,a)}function c(n){if(n)s(n);else{var r=Date.now();i(t,e.path,d,{mtime:r,ctime:r},u)}}function f(e){e?s(e):t.put(d.id,d,c)}function l(i,u){if(i)s(i);else{d=u;var c=new n(a);c.fill(0),r.copy(c,0,o,o+a),e.position=a,d.size=a,d.version+=1,t.put(d.data,c,f)}}var d;t.get(e.id,l)}function h(t,e,r,o,a,s,u){function c(t){t?u(t):u(null,a)}function f(n){if(n)u(n);else{var r=Date.now();i(t,e.path,p,{mtime:r,ctime:r},c)}}function l(e){e?u(e):t.put(p.id,p,f)}function d(i,c){if(i)u(i);else{m=c;var f=void 0!==s&&null!==s?s:e.position,d=Math.max(m.length,f+a),h=new n(d);h.fill(0),m&&m.copy(h),r.copy(h,f,o,o+a),void 0===s&&(e.position+=a),p.size=d,p.version+=1,t.put(p.data,h,l)}}function h(e,n){e?u(e):(p=n,t.get(p.data,d))}var p,m;t.get(e.id,h)}function p(t,e,n,r,i,o,a){function s(t,s){if(t)a(t);else{f=s;var u=void 0!==o&&null!==o?o:e.position;i=u+i>n.length?i-u:i,f.copy(n,r,u,u+i),void 0===o&&(e.position+=i),a(null,i)}}function u(e,n){e?a(e):(c=n,t.get(c.data,s))}var c,f;t.get(e.id,u)}function m(t,e,n){e=me(e),ve(e),a(t,e,r(n))}function g(t,e,n){t.get(e.id,r(n))}function v(t,e,n){function i(e,r){e?n(e):(s=r,t.get(s.data,o))}function o(e,i){e?n(e):(u=i,he(u).has(c)?t.get(u[c].id,r(n)):n(new Me.ENOENT("a component of the path does not name an existing file")))}e=me(e);var s,u,c=ve(e),f=ge(e);Se==c?a(t,e,r(n)):a(t,f,i)}function _(t,e,n,r){function o(e){e?r(e):i(t,n,y,{ctime:Date.now()},r)}function s(e,n){e?r(e):(y=n,y.nlinks+=1,t.put(y.id,y,o))}function u(e){e?r(e):t.get(_[b].id,s)}function c(e,n){e?r(e):(_=n,he(_).has(b)?r(new Me.EEXIST("newpath resolves to an existing file")):(_[b]=g[h],t.put(v.data,_,u)))}function f(e,n){e?r(e):(v=n,t.get(v.data,c))}function l(e,n){e?r(e):(g=n,he(g).has(h)?a(t,w,f):r(new Me.ENOENT("a component of either path prefix does not exist")))}function d(e,n){e?r(e):(m=n,t.get(m.data,l))}e=me(e);var h=ve(e),p=ge(e);n=me(n);var m,g,v,_,y,b=ve(n),w=ge(n);a(t,p,d)}function y(t,e,n){function r(e){e?n(e):(delete l[h],t.put(f.data,l,function(){var e=Date.now();i(t,p,f,{mtime:e,ctime:e},n)}))}function o(e){e?n(e):t.delete(d.data,r)}function s(a,s){a?n(a):(d=s,d.nlinks-=1,1>d.nlinks?t.delete(d.id,o):t.put(d.id,d,function(){i(t,e,d,{ctime:Date.now()},r)}))}function u(e,r){e?n(e):(l=r,he(l).has(h)?t.get(l[h].id,s):n(new Me.ENOENT("a component of the path does not name an existing file")))}function c(e,r){e?n(e):(f=r,t.get(f.data,u))}e=me(e);var f,l,d,h=ve(e),p=ge(e);a(t,p,c)}function b(t,e,n){function r(t,e){if(t)n(t);else{s=e;var r=Object.keys(s);n(null,r)}}function i(e,i){e?n(e):(o=i,t.get(o.data,r))}e=me(e),ve(e);var o,s;a(t,e,i)}function w(t,e,n,r){function o(e,n){e?r(e):(l=n,t.get(l.data,s))}function s(t,e){t?r(t):(d=e,he(d).has(p)?r(new Me.EEXIST):u())}function u(){h=new Ze(void 0,xe),h.nlinks+=1,h.size=e.length,h.data=e,t.put(h.id,h,f)}function c(e){if(e)r(e);else{var n=Date.now();i(t,m,l,{mtime:n,ctime:n},r)}}function f(e){e?r(e):(d[p]=new Pe(h.id,xe),t.put(l.data,d,c))}n=me(n);var l,d,h,p=ve(n),m=ge(n);Se==p?r(new Me.EEXIST):a(t,m,o)}function E(t,e,n){function r(e,r){e?n(e):(s=r,t.get(s.data,i))}function i(e,r){e?n(e):(u=r,he(u).has(c)?t.get(u[c].id,o):n(new Me.ENOENT("a component of the path does not name an existing file")))}function o(t,e){t?n(t):e.mode!=xe?n(new Me.EINVAL("path not a symbolic link")):n(null,e.data)}e=me(e);var s,u,c=ve(e),f=ge(e);a(t,f,r)}function x(t,e,r,o){function s(e,n){e?o(e):n.mode==Ee?o(new Me.EISDIR):(l=n,t.get(l.data,u))}function u(e,i){if(e)o(e);else{var a=new n(r);a.fill(0),i&&i.copy(a),t.put(l.data,a,f)}}function c(n){if(n)o(n);else{var r=Date.now();i(t,e,l,{mtime:r,ctime:r},o)}}function f(e){e?o(e):(l.size=r,l.version+=1,t.put(l.id,l,c))}e=me(e);var l;0>r?o(new Me.EINVAL("length cannot be negative")):a(t,e,s)}function k(t,e,r,o){function a(e,n){e?o(e):n.mode==Ee?o(new Me.EISDIR):(f=n,t.get(f.data,s))}function s(e,i){if(e)o(e);else{var a;i?a=i.slice(0,r):(a=new n(r),a.fill(0)),t.put(f.data,a,c)}}function u(n){if(n)o(n);else{var r=Date.now();i(t,e.path,f,{mtime:r,ctime:r},o)}}function c(e){e?o(e):(f.size=r,f.version+=1,t.put(f.id,f,u))}var f;0>r?o(new Me.EINVAL("length cannot be negative")):t.get(e.id,a)}function S(t,e,n,r,o){function s(a,s){a?o(a):i(t,e,s,{atime:n,ctime:r,mtime:r},o)}e=me(e),"number"!=typeof n||"number"!=typeof r?o(new Me.EINVAL("atime and mtime must be number")):0>n||0>r?o(new Me.EINVAL("atime and mtime must be positive integers")):a(t,e,s)}function A(t,e,n,r,o){function a(a,s){a?o(a):i(t,e.path,s,{atime:n,ctime:r,mtime:r},o)}"number"!=typeof n||"number"!=typeof r?o(new Me.EINVAL("atime and mtime must be a number")):0>n||0>r?o(new Me.EINVAL("atime and mtime must be positive integers")):t.get(e.id,a)}function O(t,e,n,r,i,o){e=me(e),"string"!=typeof n?o(new Me.EINVAL("attribute name must be a string")):n?null!==i&&i!==ze&&i!==Le?o(new Me.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):s(t,e,n,r,i,o):o(new Me.EINVAL("attribute name cannot be an empty string"))}function I(t,e,n,r,i,o){"string"!=typeof n?o(new Me.EINVAL("attribute name must be a string")):n?null!==i&&i!==ze&&i!==Le?o(new Me.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):s(t,e,n,r,i,o):o(new Me.EINVAL("attribute name cannot be an empty string"))}function T(t,e,n,r){function i(t,e){e?e.xattrs[n]:null,t?r(t):e.xattrs.hasOwnProperty(n)?r(null,e.xattrs[n]):r(new Me.ENOATTR)}e=me(e),"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?a(t,e,i):r(new Me.EINVAL("attribute name cannot be an empty string"))}function R(t,e,n,r){function i(t,e){e?e.xattrs[n]:null,t?r(t):e.xattrs.hasOwnProperty(n)?r(null,e.xattrs[n]):r(new Me.ENOATTR)}"string"!=typeof n?r(new Me.EINVAL):n?t.get(e.id,i):r(new Me.EINVAL("attribute name cannot be an empty string"))}function C(t,e,n,r){function o(o,a){function s(n){n?r(n):i(t,e,a,{ctime:Date.now()},r)}var u=a?a.xattrs:null;o?r(o):u.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Me.ENOATTR)}e=me(e),"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?a(t,e,o):r(new Me.EINVAL("attribute name cannot be an empty string"))}function N(t,e,n,r){function o(o,a){function s(n){n?r(n):i(t,e.path,a,{ctime:Date.now()},r)}o?r(o):a.xattrs.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Me.ENOATTR)}"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?t.get(e.id,o):r(new Me.EINVAL("attribute name cannot be an empty string"))}function D(t){return he(De).has(t)?De[t]:null}function z(t,e,n){return t?"function"==typeof t?t={encoding:e,flag:n}:"string"==typeof t&&(t={encoding:t,flag:n}):t={encoding:e,flag:n},t}function L(t,e){var n;return ye(t)?n=Error("Path must be a string without null bytes."):_e(t)||(n=Error("Path must be absolute.")),n?(e(n),!1):!0}function j(t,e,n,r,i,o){function a(e,i){if(e)o(e);else{var a;a=he(r).contains(Ne)?i.size:0;var s=new Ue(n,i.id,r,a),u=t.allocDescriptor(s);o(null,u)}}o=arguments[arguments.length-1],L(n,o)&&(r=D(r),r||o(new Me.EINVAL("flags is not valid")),l(e,n,r,a))}function B(t,e,n,r){he(t.openFiles).has(n)?(t.releaseDescriptor(n),r(null)):r(new Me.EBADF)}function F(t,e,n,r,i){L(n,i)&&o(e,n,r,i)}function M(t,e,n,i,o){o=arguments[arguments.length-1],L(n,o)&&c(e,n,r(o))}function P(t,e,n,i){L(n,i)&&f(e,n,r(i))}function U(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}L(n,r)&&m(e,n,i)}function V(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}var o=t.openFiles[n];o?g(e,o,i):r(new Me.EBADF)}function Z(t,e,n,i,o){L(n,o)&&L(i,o)&&_(e,n,i,r(o))}function Y(t,e,n,i){L(n,i)&&y(e,n,r(i))}function X(t,e,n,i,o,a,s,u){function c(t,e){u(t,e||0,i)}o=void 0===o?0:o,a=void 0===a?i.length-o:a,u=arguments[arguments.length-1];var f=t.openFiles[n];f?he(f.flags).contains(Ie)?p(e,f,i,o,a,s,r(c)):u(new Me.EBADF("descriptor does not permit reading")):u(new Me.EBADF)}function H(t,e,r,i,o){if(o=arguments[arguments.length-1],i=z(i,null,"r"),L(r,o)){var a=D(i.flag||"r");a||o(new Me.EINVAL("flags is not valid")),l(e,r,a,function(s,u){if(s)return o(s);var c=new Ue(r,u.id,a,0),f=t.allocDescriptor(c);g(e,c,function(r,a){if(r)return o(r);var s=new Ye(a,t.name),u=s.size,l=new n(u);l.fill(0),p(e,c,l,0,u,0,function(e){if(e)return o(e);t.releaseDescriptor(f);var n;n="utf8"===i.encoding?Fe.decode(l):l,o(null,n)})})})}}function W(t,e,n,i,o,a,s,u){u=arguments[arguments.length-1],o=void 0===o?0:o,a=void 0===a?i.length-o:a;var c=t.openFiles[n];c?he(c.flags).contains(Te)?a>i.length-o?u(new Me.EIO("intput buffer is too small")):h(e,c,i,o,a,s,r(u)):u(new Me.EBADF("descriptor does not permit writing")):u(new Me.EBADF)}function q(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=z(i,"utf8","w"),L(n,o)){var a=D(i.flag||"w");a||o(new Me.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Fe.encode(r)),l(e,n,a,function(i,s){if(i)return o(i);var u=new Ue(n,s.id,a,0),c=t.allocDescriptor(u);d(e,u,r,0,r.length,function(e){return e?o(e):(t.releaseDescriptor(c),o(null),void 0)})})}}function K(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=z(i,"utf8","a"),L(n,o)){var a=D(i.flag||"a");a||o(new Me.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Fe.encode(r)),l(e,n,a,function(i,s){if(i)return o(i);var u=new Ue(n,s.id,a,s.size),c=t.allocDescriptor(u);h(e,u,r,0,r.length,u.position,function(e){return e?o(e):(t.releaseDescriptor(c),o(null),void 0)})})}}function J(t,e,n,r){function i(t){r(t?!1:!0)}U(t,e,n,i)}function G(t,e,n,i,o){L(n,o)&&T(e,n,i,r(o))}function Q(t,e,n,i,o){var a=t.openFiles[n];a?R(e,a,i,r(o)):o(new Me.EBADF)}function $(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null),L(n,s)&&O(e,n,i,o,a,r(s))}function te(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null);var u=t.openFiles[n];u?he(u.flags).contains(Te)?I(e,u,i,o,a,r(s)):s(new Me.EBADF("descriptor does not permit writing")):s(new Me.EBADF)}function ee(t,e,n,i,o){L(n,o)&&C(e,n,i,r(o))}function ne(t,e,n,i,o){var a=t.openFiles[n];a?he(a.flags).contains(Te)?N(e,a,i,r(o)):o(new Me.EBADF("descriptor does not permit writing")):o(new Me.EBADF)}function re(t,e,n,r,i,o){function a(t,e){t?o(t):0>e.size+r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}var s=t.openFiles[n];s||o(new Me.EBADF),"SET"===i?0>r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?g(e,s,a):o(new Me.EINVAL("whence argument is not a proper value"))}function ie(t,e,n,i){L(n,i)&&b(e,n,r(i))}function oe(t,e,n,i,o,a){if(L(n,a)){var s=Date.now();i=i?i:s,o=o?o:s,S(e,n,i,o,r(a))}}function ae(t,e,n,i,o,a){var s=Date.now();i=i?i:s,o=o?o:s;var u=t.openFiles[n];u?he(u.flags).contains(Te)?A(e,u,i,o,r(a)):a(new Me.EBADF("descriptor does not permit writing")):a(new Me.EBADF)}function se(t,e,n,i,o){function a(t){t?o(t):y(e,n,r(o))}L(n,o)&&L(i,o)&&_(e,n,i,a)}function ue(t,e,n,i,o,a){a=arguments[arguments.length-1],L(n,a)&&L(i,a)&&w(e,n,i,r(a))}function ce(t,e,n,i){L(n,i)&&E(e,n,r(i))}function fe(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}L(n,r)&&v(e,n,i)}function le(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0,L(n,o)&&x(e,n,i,r(o))}function de(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0;var a=t.openFiles[n];a?he(a.flags).contains(Te)?k(e,a,i,r(o)):o(new Me.EBADF("descriptor does not permit writing")):o(new Me.EBADF)}var he=t("../../lib/nodash.js"),pe=t("../path.js"),me=pe.normalize,ge=pe.dirname,ve=pe.basename,_e=pe.isAbsolute,ye=pe.isNull,be=t("../constants.js"),we=be.MODE_FILE,Ee=be.MODE_DIRECTORY,xe=be.MODE_SYMBOLIC_LINK,ke=be.MODE_META,Se=be.ROOT_DIRECTORY_NAME,Ae=be.SUPER_NODE_ID,Oe=be.SYMLOOP_MAX,Ie=be.O_READ,Te=be.O_WRITE,Re=be.O_CREATE,Ce=be.O_EXCLUSIVE;be.O_TRUNCATE;var Ne=be.O_APPEND,De=be.O_FLAGS,ze=be.XATTR_CREATE,Le=be.XATTR_REPLACE,je=be.FS_NOMTIME,Be=be.FS_NOCTIME,Fe=t("../encoding.js"),Me=t("../errors.js"),Pe=t("../directory-entry.js"),Ue=t("../open-file-description.js"),Ve=t("../super-node.js"),Ze=t("../node.js"),Ye=t("../stats.js");e.exports={makeRootDirectory:u,open:j,close:B,mknod:F,mkdir:M,rmdir:P,unlink:Y,stat:U,fstat:V,link:Z,read:X,readFile:H,write:W,writeFile:q,appendFile:K,exists:J,getxattr:G,fgetxattr:Q,setxattr:$,fsetxattr:te,removexattr:ee,fremovexattr:ne,lseek:re,readdir:ie,utimes:oe,futimes:ae,rename:se,symlink:ue,readlink:ce,lstat:fe,truncate:le,ftruncate:de}}).call(this,t("buffer").Buffer)},{"../../lib/nodash.js":4,"../constants.js":41,"../directory-entry.js":42,"../encoding.js":43,"../errors.js":44,"../node.js":49,"../open-file-description.js":50,"../path.js":51,"../stats.js":60,"../super-node.js":61}],46:[function(t,e){function n(t){return"function"==typeof t?t:function(t){if(t)throw t}}function r(t,e){function n(){I.forEach(function(t){t.call(this)}.bind(S)),I=null}function r(t){if(t.length){var e=m.getInstance();t.forEach(function(t){e.emit(t.event,t.path)})}}t=t||{},e=e||a;var s=t.flags,p=t.provider||new h.Default(t.name||u),x=t.name||p.name,k=i(s).contains(c),S=this;S.readyState=l,S.name=x,S.error=null,S.stdin=_,S.stdout=y,S.stderr=b;var A={},O=w;Object.defineProperty(this,"openFiles",{get:function(){return A}}),this.allocDescriptor=function(t){var e=O++;return A[e]=t,e},this.releaseDescriptor=function(t){delete A[t]};var I=[];this.queueOrRun=function(t){var e;return f==S.readyState?t.call(S):d==S.readyState?e=new v.EFILESYSTEMERROR("unknown error"):I.push(t),e},this.watch=function(t,e,n){if(o(t))throw Error("Path must be a string without null bytes.");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||a;var r=new g;return r.start(t,!1,e.recursive),r.on("change",n),r},p.open(function(t,i){function o(t){function i(t){var e=p[t]();return e.flags=s,e.changes=[],e.close=function(){var t=e.changes;r(t),t.length=0},e}S.provider={openReadWriteContext:function(){return i("getReadWriteContext")},openReadOnlyContext:function(){return i("getReadOnlyContext")}},t?S.readyState=d:(S.readyState=f,n()),e(t,S)}if(t)return o(t);if(!k&&!i)return o(null);var a=p.getReadWriteContext();a.clear(function(t){return t?(o(t),void 0):(E.makeRootDirectory(a,o),void 0)})})}var i=t("../../lib/nodash.js"),o=t("../path.js").isNull,a=t("../shared.js").nop,s=t("../constants.js"),u=s.FILE_SYSTEM_NAME,c=s.FS_FORMAT,f=s.FS_READY,l=s.FS_PENDING,d=s.FS_ERROR,h=t("../providers/index.js"),p=t("../shell/shell.js"),m=t("../../lib/intercom.js"),g=t("../fs-watcher.js"),v=t("../errors.js"),_=s.STDIN,y=s.STDOUT,b=s.STDERR,w=s.FIRST_DESCRIPTOR,E=t("./implementation.js");r.providers=h,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(t){r.prototype[t]=function(){var e=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeof r[i],a=n(r[i]),s=e.queueOrRun(function(){function n(){s.close(),a.apply(e,arguments)}var s=e.provider.openReadWriteContext();o?r.push(n):r[i]=n;var u=[e,s].concat(r);E[t].apply(null,u)});s&&a(s)}}),r.prototype.Shell=function(t){return new p(this,t)},e.exports=r},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":41,"../errors.js":44,"../fs-watcher.js":47,"../path.js":51,"../providers/index.js":52,"../shared.js":56,"../shell/shell.js":59,"./implementation.js":45}],47:[function(t,e){function n(){function t(t){(e===t||a&&0===t.indexOf(e+"/"))&&n.trigger("change","change",t)}r.call(this);var e,n=this,a=!1;n.start=function(n,r,s){if(!e){if(i(n))throw Error("Path must be a string without null bytes.");e=n,a=s===!0;var u=o.getInstance();u.on("change",t)}},n.close=function(){var e=o.getInstance();e.off("change",t),n.removeAllListeners("change")}}var r=t("../lib/eventemitter.js"),i=t("./path.js").isNull,o=t("../lib/intercom.js");n.prototype=new r,n.prototype.constructor=n,e.exports=n},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":51}],48:[function(t,e){(function(n){e.exports={FileSystem:t("./filesystem/interface.js"),Buffer:n,Path:t("./path.js"),Errors:t("./errors.js")}}).call(this,t("buffer").Buffer)},{"./errors.js":44,"./filesystem/interface.js":46,"./path.js":51}],49:[function(t,e){var n=t("./constants.js").MODE_FILE,r=t("./shared.js").guid;e.exports=function(t,e,i,o,a,s,u,c,f,l){var d=Date.now();this.id=t||r(),this.mode=e||n,this.size=i||0,this.atime=o||d,this.ctime=a||d,this.mtime=s||d,this.flags=u||[],this.xattrs=c||{},this.nlinks=f||0,this.version=l||0,this.blksize=void 0,this.nblocks=1,this.data=r()}},{"./constants.js":41,"./shared.js":56}],50:[function(t,e){e.exports=function(t,e,n,r){this.path=t,this.id=e,this.flags=n,this.position=r}},{}],51:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var i=n>=0?arguments[n]:"/";"string"==typeof i&&i&&(t=i+"/"+t,e="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."}function o(t){var e="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),t||e||(t="."),(e?"/":"")+t}function a(){var t=Array.prototype.slice.call(arguments,0);return o(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function s(t,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;i.length>u;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")}function u(t){var e=p(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function c(t,e){var n=p(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),""===n?"/":n}function f(t){return p(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function d(t){return-1!==(""+t).indexOf("\0")?!0:!1}var h=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,p=function(t){var e=h.exec(t);return[e[1]||"",e[2]||"",e[3]||"",e[4]||""]};e.exports={normalize:o,resolve:i,join:a,relative:s,sep:"/",delimiter:":",dirname:u,basename:c,extname:f,isAbsolute:l,isNull:d}},{}],52:[function(t,e){var n=t("./indexeddb.js"),r=t("./websql.js"),i=t("./memory.js");e.exports={IndexedDB:n,WebSQL:r,Memory:i,Default:n,Fallback:function(){function t(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return n.isSupported()?n:r.isSupported()?r:(t.isSupported=function(){return!1},t)}()}},{"./indexeddb.js":53,"./memory.js":54,"./websql.js":55}],53:[function(t,e){(function(n){function r(t,e){var n=t.transaction(a,e);this.objectStore=n.objectStore(a)}function i(t){this.name=t||o,this.db=null}var o=t("../constants.js").FILE_SYSTEM_NAME,a=t("../constants.js").FILE_STORE_NAME,s=t("../constants.js").IDB_RW;t("../constants.js").IDB_RO;var u=t("../errors.js"),c=n.indexedDB||n.mozIndexedDB||n.webkitIndexedDB||n.msIndexedDB;r.prototype.clear=function(t){try{var e=this.objectStore.clear();e.onsuccess=function(){t()},e.onerror=function(e){t(e)}}catch(n){t(n)}},r.prototype.get=function(t,e){try{var n=this.objectStore.get(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},r.prototype.put=function(t,e,n){try{var r=this.objectStore.put(e,t);r.onsuccess=function(t){var e=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(i){n(i)}},r.prototype.delete=function(t,e){try{var n=this.objectStore.delete(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},i.isSupported=function(){return!!c},i.prototype.open=function(t){var e=this;if(e.db)return t(null,!1),void 0;var n=!1,r=c.open(e.name);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(a)&&e.deleteObjectStore(a),e.createObjectStore(a),n=!0},r.onsuccess=function(r){e.db=r.target.result,t(null,n)},r.onerror=function(){t(new u.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},i.prototype.getReadOnlyContext=function(){return new r(this.db,s)},i.prototype.getReadWriteContext=function(){return new r(this.db,s)},e.exports=i})(this)},{"../constants.js":41,"../errors.js":44}],54:[function(t,e){function n(t,e){this.readOnly=e,this.objectStore=t}function r(t){this.name=t||i}var i=t("../constants.js").FILE_SYSTEM_NAME,o=t("../../lib/async.js").nextTick,a=function(){var t={};return function(e){var n=!t.hasOwnProperty(e);return n&&(t[e]={}),{firstAccess:n,db:t[e]}}}();n.prototype.clear=function(t){if(this.readOnly)return o(function(){t("[MemoryContext] Error: write operation on read only context")}),void 0;var e=this.objectStore;Object.keys(e).forEach(function(t){delete e[t]}),o(t)},n.prototype.get=function(t,e){var n=this;o(function(){e(null,n.objectStore[t])})},n.prototype.put=function(t,e,n){return this.readOnly?(o(function(){n("[MemoryContext] Error: write operation on read only context")}),void 0):(this.objectStore[t]=e,o(n),void 0)},n.prototype.delete=function(t,e){return this.readOnly?(o(function(){e("[MemoryContext] Error: write operation on read only context")}),void 0):(delete this.objectStore[t],o(e),void 0)},r.isSupported=function(){return!0},r.prototype.open=function(t){var e=a(this.name);this.db=e.db,o(function(){t(null,e.firstAccess)})},r.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},e.exports=r},{"../../lib/async.js":1,"../constants.js":41}],55:[function(t,e){(function(n){function r(t,e){var n=this;this.getTransaction=function(r){return n.transaction?(r(n.transaction),void 0):(t[e?"readTransaction":"transaction"](function(t){n.transaction=t,r(t)}),void 0)}}function i(t){this.name=t||o,this.db=null}var o=t("../constants.js").FILE_SYSTEM_NAME,a=t("../constants.js").FILE_STORE_NAME,s=t("../constants.js").WSQL_VERSION,u=t("../constants.js").WSQL_SIZE,c=t("../constants.js").WSQL_DESC,f=t("../shared.js").u8toArray,l=t("../errors.js");r.prototype.clear=function(t){function e(e,n){t(n)}function n(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+a+";",[],n,e)})},r.prototype.get=function(t,e){function n(t,n){var r=0===n.rows.length?null:n.rows.item(0).data;try{r&&(r=JSON.parse(r),r.__isUint8Array&&(r=new Uint8Array(r.__array))),e(null,r)}catch(i){e(i)}}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("SELECT data FROM "+a+" WHERE id = ?;",[t],n,r)})},r.prototype.put=function(t,e,n){function r(){n(null)}function i(t,e){n(e)}"[object Uint8Array]"===Object.prototype.toString.call(e)&&(e={__isUint8Array:!0,__array:f(e)}),e=JSON.stringify(e),this.getTransaction(function(n){n.executeSql("INSERT OR REPLACE INTO "+a+" (id, data) VALUES (?, ?);",[t,e],r,i)})},r.prototype.delete=function(t,e){function n(){e(null)}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("DELETE FROM "+a+" WHERE id = ?;",[t],n,r)})},i.isSupported=function(){return!!n.openDatabase},i.prototype.open=function(t){function e(e,n){5===n.code&&t(new l.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),t(n)}function r(e){function n(e,n){var r=0===n.rows.item(0).count;t(null,r)}function r(e,n){t(n)}i.db=o,e.executeSql("SELECT COUNT(id) AS count FROM "+a+";",[],n,r)}var i=this;if(i.db)return t(null,!1),void 0;var o=n.openDatabase(i.name,s,c,u);return o?(o.transaction(function(t){function n(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+a+"_id"+" on "+a+" (id);",[],r,e)}t.executeSql("CREATE TABLE IF NOT EXISTS "+a+" (id unique, data TEXT);",[],n,e)}),void 0):(t("[WebSQL] Unable to open database."),void 0)},i.prototype.getReadOnlyContext=function(){return new r(this.db,!0)},i.prototype.getReadWriteContext=function(){return new r(this.db,!1)},e.exports=i})(this)},{"../constants.js":41,"../errors.js":44,"../shared.js":56}],56:[function(t,e){function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=0|16*Math.random(),n="x"==t?e:8|3&e;return n.toString(16)}).toUpperCase()}function r(){}function i(t){for(var e=[],n=t.length,r=0;n>r;r++)e[r]=t[r];return e}e.exports={guid:n,u8toArray:i,nop:r}},{}],57:[function(t,e){var n=t("../constants.js").ENVIRONMENT;e.exports=function(t){t=t||{},t.TMP=t.TMP||n.TMP,t.PATH=t.PATH||n.PATH,this.get=function(e){return t[e]},this.set=function(e,n){t[e]=n}}},{"../constants.js":41}],58:[function(t,e){var n=t("request");e.exports.download=function(t,e){n({url:t,method:"GET",encoding:null},function(t,n,r){var i,o;return n=n||null,i=n&&n.statusCode,(o=200!==i?{message:t||"Not found!",code:i}:null)?(e(o,null),void 0):(e(null,r),void 0)})}},{request:5}],59:[function(t,e){function n(t,e){e=e||{};var n=new o(e.env),a="/";Object.defineProperty(this,"fs",{get:function(){return t},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return n},enumerable:!0}),this.cd=function(e,n){e=r.resolve(this.cwd,e),t.stat(e,function(t,r){return t?(n(new i.ENOTDIR),void 0):("DIRECTORY"===r.type?(a=e,n()):n(new i.ENOTDIR),void 0)})},this.pwd=function(){return a}}var r=t("../path.js"),i=t("../errors.js"),o=t("./environment.js"),a=t("../../lib/async.js"),s=t("./network.js");t("../encoding.js");var u=t("jszip");n.prototype.exec=function(t,e,n){var i=this.fs;"function"==typeof e&&(n=e,e=[]),e=e||[],n=n||function(){},t=r.resolve(this.cwd,t),i.readFile(t,"utf8",function(t,r){if(t)return n(t),void 0;try{var o=Function("fs","args","callback",r);o(i,e,n)}catch(a){n(a)}})},n.prototype.touch=function(t,e,n){function i(t){a.writeFile(t,"",n)}function o(t){var r=Date.now(),i=e.date||r,o=e.date||r;a.utimes(t,i,o,n)}var a=this.fs;"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t=r.resolve(this.cwd,t),a.stat(t,function(r){r?e.updateOnly===!0?n():i(t):o(t)})},n.prototype.cat=function(t,e){function n(t,e){var n=r.resolve(this.cwd,t);o.readFile(n,"utf8",function(t,n){return t?(e(t),void 0):(s+=n+"\n",e(),void 0)})}var o=this.fs,s="";return e=e||function(){},t?(t="string"==typeof t?[t]:t,a.eachSeries(t,n,function(t){t?e(t):e(null,s.replace(/\n$/,""))}),void 0):(e(new i.EINVAL("Missing files argument")),void 0)},n.prototype.ls=function(t,e,n){function o(t,n){var i=r.resolve(this.cwd,t),u=[];s.readdir(i,function(t,c){function f(t,n){t=r.join(i,t),s.stat(t,function(a,s){if(a)return n(a),void 0;var c={path:r.basename(t),links:s.nlinks,size:s.size,modified:s.mtime,type:s.type};e.recursive&&"DIRECTORY"===s.type?o(r.join(i,c.path),function(t,e){return t?(n(t),void 0):(c.contents=e,u.push(c),n(),void 0)}):(u.push(c),n())})}return t?(n(t),void 0):(a.each(c,f,function(t){n(t,u)}),void 0)})}var s=this.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing dir argument")),void 0)},n.prototype.rm=function(t,e,n){function o(t,n){t=r.resolve(this.cwd,t),s.stat(t,function(u,c){return u?(n(u),void 0):"FILE"===c.type?(s.unlink(t,n),void 0):(s.readdir(t,function(u,c){return u?(n(u),void 0):0===c.length?(s.rmdir(t,n),void 0):e.recursive?(c=c.map(function(e){return r.join(t,e) -}),a.each(c,o,function(e){return e?(n(e),void 0):(s.rmdir(t,n),void 0)}),void 0):(n(new i.ENOTEMPTY),void 0)}),void 0)})}var s=this.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing path argument")),void 0)},n.prototype.tempDir=function(t){var e=this.fs,n=this.env.get("TMP");t=t||function(){},e.mkdir(n,function(){t(null,n)})},n.prototype.mkdirp=function(t,e){function n(t,e){o.stat(t,function(a,s){if(s){if(s.isDirectory())return e(),void 0;if(s.isFile())return e(new i.ENOTDIR),void 0}else{if(a&&"ENOENT"!==a.code)return e(a),void 0;var u=r.dirname(t);"/"===u?o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}):n(u,function(n){return n?e(n):(o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}),void 0)})}})}var o=this.fs;return e=e||function(){},t?"/"===t?(e(),void 0):(n(t,e),void 0):(e(new i.EINVAL("Missing path argument")),void 0)},n.prototype.wget=function(t,e,n){function o(){n(Error("unable to get resource"))}var a=this.fs;if("function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},!t)return n(new i.EINVAL("missing url argument")),void 0;var u=e.filename||t.split("/").pop();u=r.resolve(a.cwd,u),s.download(t,function(t,e){return t||!e?o():(a.writeFile(u,e,function(t){t?n(t):n(null,u)}),void 0)})},n.prototype.unzip=function(t,e,n){var o=this.fs,s=this;if("function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},!t)return n(new i.EINVAL("missing zipfile argument")),void 0;var c=r.resolve(this.cwd,t),f=r.resolve(e.destination||this.cwd);o.readFile(c,function(t,e){function i(t,e){t.isDirectory?s.mkdirp(t.absPath,e):o.writeFile(t.absPath,t.data,e)}if(t)return n(t);var c=new u(e),l=[];c.filter(function(t,e){var n=e.options.dir,i=n?null:e.asNodeBuffer();l.push({absPath:r.join(f,e.name),isDirectory:n,data:i})}),a.eachSeries(l,i,n)})},n.prototype.zip=function(t,e,n,o){function s(t){return t.replace(/^\//,"")}function c(t,e){d.readFile(t,function(n,r){return n?e(n):(p.file(s(t),r,{binary:!0}),e(),void 0)})}function f(t,e){d.readdir(t,function(i,o){p.folder(s(t)),n.recursive||e(),a.eachSeries(o,function(e,n){l(r.join(t,e),n)},e)})}function l(t,e){t=r.resolve(h.cwd,t),d.stat(t,function(n,r){return n?e(n):(r.isDirectory()?f(t,e):c(t,e),void 0)})}var d=this.fs,h=this;if("function"==typeof n&&(o=n,n={}),n=n||{},o=o||function(){},!t)return o(new i.EINVAL("missing zipfile argument")),void 0;if(!e)return o(new i.EINVAL("missing paths argument")),void 0;"string"==typeof e&&(e=[e]),t=r.resolve(this.cwd,t);var p=new u;d.stat(t,function(n,r){return r?o(new i.EEXIST("zipfile already exists")):(a.eachSeries(e,l,function(e){if(e)return o(e);var n;n=p.generate({type:"nodebuffer"}),d.writeFile(t,n,o)}),void 0)})},e.exports=n},{"../../lib/async.js":1,"../encoding.js":43,"../errors.js":44,"../path.js":51,"./environment.js":57,"./network.js":58,jszip:13}],60:[function(t,e){function n(t,e){this.node=t.id,this.dev=e,this.size=t.size,this.nlinks=t.nlinks,this.atime=t.atime,this.mtime=t.mtime,this.ctime=t.ctime,this.type=t.mode}var r=t("./constants.js");n.prototype.isFile=function(){return this.type===r.MODE_FILE},n.prototype.isDirectory=function(){return this.type===r.MODE_DIRECTORY},n.prototype.isSymbolicLink=function(){return this.type===r.MODE_SYMBOLIC_LINK},n.prototype.isSocket=n.prototype.isFIFO=n.prototype.isCharacterDevice=n.prototype.isBlockDevice=function(){return!1},e.exports=n},{"./constants.js":41}],61:[function(t,e){var n=t("./constants.js"),r=t("./shared.js").guid;e.exports=function(t,e,i){var o=Date.now();this.id=n.SUPER_NODE_ID,this.mode=n.MODE_META,this.atime=t||o,this.ctime=e||o,this.mtime=i||o,this.rnode=r()}},{"./constants.js":41,"./shared.js":56}]},{},[48])(48)}); \ No newline at end of file +/*! filer 0.0.10 2014-06-10 */ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Filer=t()}}(function(){var t;return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);throw Error("Cannot find module '"+a+"'")}var f=n[a]={exports:{}};t[a][0].call(f.exports,function(e){var n=t[a][1][e];return i(n?n:e)},f,f.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;r.length>a;a++)i(r[a]);return i}({1:[function(e,n){(function(e){(function(){function r(t){var e=!1;return function(){if(e)throw Error("Callback was already called.");e=!0,t.apply(i,arguments)}}var i,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){return i.async=o,a};var s=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;t.length>n;n+=1)e(t[n],n,t)},u=function(t,e){if(t.map)return t.map(e);var n=[];return s(t,function(t,r,i){n.push(e(t,r,i))}),n},f=function(t,e,n){return t.reduce?t.reduce(e,n):(s(t,function(t,r,i){n=e(n,t,r,i)}),n)},c=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e};void 0!==e&&e.nextTick?(a.nextTick=e.nextTick,a.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeof setImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,e,n){if(n=n||function(){},!t.length)return n();var i=0;s(t,function(o){e(o,r(function(e){e?(n(e),n=function(){}):(i+=1,i>=t.length&&n(null))}))})},a.forEach=a.each,a.eachSeries=function(t,e,n){if(n=n||function(){},!t.length)return n();var r=0,i=function(){e(t[r],function(e){e?(n(e),n=function(){}):(r+=1,r>=t.length?n(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,e,n,r){var i=l(e);i.apply(null,[t,n,r])},a.forEachLimit=a.eachLimit;var l=function(t){return function(e,n,r){if(r=r||function(){},!e.length||0>=t)return r();var i=0,o=0,a=0;(function s(){if(i>=e.length)return r();for(;t>a&&e.length>o;)o+=1,a+=1,n(e[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=e.length?r():s())})})()}},d=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.each].concat(e))}},h=function(t,e){return function(){var n=Array.prototype.slice.call(arguments);return e.apply(null,[l(t)].concat(n))}},p=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[a.eachSeries].concat(e))}},g=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n,r){i[t.index]=r,e(n)})},function(t){r(t,i)})};a.map=d(g),a.mapSeries=p(g),a.mapLimit=function(t,e,n,r){return m(e)(t,n,r)};var m=function(t){return h(t,g)};a.reduce=function(t,e,n,r){a.eachSeries(t,function(t,r){n(e,t,function(t,n){e=n,r(t)})},function(t){r(t,e)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,e,n,r){var i=u(t,function(t){return t}).reverse();a.reduce(i,e,n,r)},a.foldr=a.reduceRight;var v=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n&&i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.filter=d(v),a.filterSeries=p(v),a.select=a.filter,a.selectSeries=a.filterSeries;var y=function(t,e,n,r){var i=[];e=u(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){n(t.value,function(n){n||i.push(t),e()})},function(){r(u(i.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};a.reject=d(y),a.rejectSeries=p(y);var b=function(t,e,n,r){t(e,function(t,e){n(t,function(n){n?(r(t),r=function(){}):e()})},function(){r()})};a.detect=d(b),a.detectSeries=p(b),a.some=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t&&(n(!0),n=function(){}),r()})},function(){n(!1)})},a.any=a.some,a.every=function(t,e,n){a.each(t,function(t,r){e(t,function(t){t||(n(!1),n=function(){}),r()})},function(){n(!0)})},a.all=a.every,a.sortBy=function(t,e,n){a.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){if(t)return n(t);var r=function(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0};n(null,u(e.sort(r),function(t){return t.value}))})},a.auto=function(t,e){e=e||function(){};var n=c(t);if(!n.length)return e(null);var r={},i=[],o=function(t){i.unshift(t)},u=function(t){for(var e=0;i.length>e;e+=1)if(i[e]===t)return i.splice(e,1),void 0},l=function(){s(i.slice(0),function(t){t()})};o(function(){c(r).length===n.length&&(e(null,r),e=function(){})}),s(n,function(n){var i=t[n]instanceof Function?[t[n]]:t[n],d=function(t){var i=Array.prototype.slice.call(arguments,1);if(1>=i.length&&(i=i[0]),t){var o={};s(c(r),function(t){o[t]=r[t]}),o[n]=i,e(t,o),e=function(){}}else r[n]=i,a.setImmediate(l)},h=i.slice(0,Math.abs(i.length-1))||[],p=function(){return f(h,function(t,e){return t&&r.hasOwnProperty(e)},!0)&&!r.hasOwnProperty(n)};if(p())i[i.length-1](d,r);else{var g=function(){p()&&(u(g),i[i.length-1](d,r))};o(g)}})},a.waterfall=function(t,e){if(e=e||function(){},t.constructor!==Array){var n=Error("First argument to waterfall must be an array of functions");return e(n)}if(!t.length)return e();var r=function(t){return function(n){if(n)e.apply(null,arguments),e=function(){};else{var i=Array.prototype.slice.call(arguments,1),o=t.next();o?i.push(r(o)):i.push(e),a.setImmediate(function(){t.apply(null,i)})}}};r(a.iterator(t))()};var _=function(t,e,n){if(n=n||function(){},e.constructor===Array)t.map(e,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),e.call(null,t,n)})},n);else{var r={};t.each(c(e),function(t,n){e[t](function(e){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),r[t]=i,n(e)})},function(t){n(t,r)})}};a.parallel=function(t,e){_({map:a.map,each:a.each},t,e)},a.parallelLimit=function(t,e,n){_({map:m(e),each:l(e)},t,n)},a.series=function(t,e){if(e=e||function(){},t.constructor===Array)a.mapSeries(t,function(t,e){t&&t(function(t){var n=Array.prototype.slice.call(arguments,1);1>=n.length&&(n=n[0]),e.call(null,t,n)})},e);else{var n={};a.eachSeries(c(t),function(e,r){t[e](function(t){var i=Array.prototype.slice.call(arguments,1);1>=i.length&&(i=i[0]),n[e]=i,r(t)})},function(t){e(t,n)})}},a.iterator=function(t){var e=function(n){var r=function(){return t.length&&t[n].apply(null,arguments),r.next()};return r.next=function(){return t.length-1>n?e(n+1):null},r};return e(0)},a.apply=function(t){var e=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,e.concat(Array.prototype.slice.call(arguments)))}};var w=function(t,e,n,r){var i=[];t(e,function(t,e){n(t,function(t,n){i=i.concat(n||[]),e(t)})},function(t){r(t,i)})};a.concat=d(w),a.concatSeries=p(w),a.whilst=function(t,e,n){t()?e(function(r){return r?n(r):(a.whilst(t,e,n),void 0)}):n()},a.doWhilst=function(t,e,n){t(function(r){return r?n(r):(e()?a.doWhilst(t,e,n):n(),void 0)})},a.until=function(t,e,n){t()?n():e(function(r){return r?n(r):(a.until(t,e,n),void 0)})},a.doUntil=function(t,e,n){t(function(r){return r?n(r):(e()?n():a.doUntil(t,e,n),void 0)})},a.queue=function(t,e){function n(t,n,r,i){n.constructor!==Array&&(n=[n]),s(n,function(n){var o={data:n,callback:"function"==typeof i?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===e&&t.saturated(),a.setImmediate(t.process)})}void 0===e&&(e=1);var i=0,o={tasks:[],concurrency:e,saturated:null,empty:null,drain:null,push:function(t,e){n(o,t,!1,e)},unshift:function(t,e){n(o,t,!0,e)},process:function(){if(o.concurrency>i&&o.tasks.length){var e=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var n=function(){i-=1,e.callback&&e.callback.apply(e,arguments),o.drain&&0===o.tasks.length+i&&o.drain(),o.process()},a=r(n);t(e.data,a)}},length:function(){return o.tasks.length},running:function(){return i}};return o},a.cargo=function(t,e){var n=!1,r=[],i={tasks:r,payload:e,saturated:null,empty:null,drain:null,push:function(t,n){t.constructor!==Array&&(t=[t]),s(t,function(t){r.push({data:t,callback:"function"==typeof n?n:null}),i.saturated&&r.length===e&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&i.drain(),void 0;var a="number"==typeof e?r.splice(0,e):r.splice(0),f=u(a,function(t){return t.data});i.empty&&i.empty(),n=!0,t(f,function(){n=!1;var t=arguments;s(a,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var E=function(t){return function(e){var n=Array.prototype.slice.call(arguments,1);e.apply(null,n.concat([function(e){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&s(n,function(e){console[t](e)}))}]))}};a.log=E("log"),a.dir=E("dir"),a.memoize=function(t,e){var n={},r={};e=e||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=e.apply(null,i);a in n?o.apply(null,n[a]):a in r?r[a].push(o):(r[a]=[o],t.apply(null,i.concat([function(){n[a]=arguments;var t=r[a];delete r[a];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,arguments)}])))};return i.memo=n,i.unmemoized=t,i},a.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},a.times=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.map(r,e,n)},a.timesSeries=function(t,e,n){for(var r=[],i=0;t>i;i++)r.push(i);return a.mapSeries(r,e,n)},a.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var e=this,n=Array.prototype.slice.call(arguments),r=n.pop();a.reduce(t,n,function(t,n,r){n.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);r(t,e)}]))},function(t,n){r.apply(e,[t].concat(n))})}};var I=function(t,e){var n=function(){var n=this,r=Array.prototype.slice.call(arguments),i=r.pop();return t(e,function(t,e){t.apply(n,r.concat([e]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return n.apply(this,r)}return n};a.applyEach=d(I),a.applyEachSeries=p(I),a.forever=function(t,e){function n(r){if(r){if(e)return e(r);throw r}t(n)}n()},t!==void 0&&t.amd?t([],function(){return a}):n!==void 0&&n.exports?n.exports=a:i.async=a})()}).call(this,e("FWaASH"))},{FWaASH:9}],2:[function(t,e){function n(t,e){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1);return e}var r=function(){};r.createInterface=function(t){var e={};return e.on=function(e,n){this[t]===void 0&&(this[t]={}),this[t].hasOwnProperty(e)||(this[t][e]=[]),this[t][e].push(n)},e.off=function(e,r){void 0!==this[t]&&this[t].hasOwnProperty(e)&&n(r,this[t][e])},e.trigger=function(e){if(this[t]!==void 0&&this[t].hasOwnProperty(e))for(var n=Array.prototype.slice.call(arguments,1),r=0;this[t][e].length>r;r++)this[t][e][r].apply(this[t][e][r],n)},e.removeAllListeners=function(e){if(void 0!==this[t]){var n=this;n[t][e].forEach(function(t){n.off(e,t)})}},e};var i=r.createInterface("_handlers");r.prototype._on=i.on,r.prototype._off=i.off,r.prototype._trigger=i.trigger;var o=r.createInterface("handlers");r.prototype.on=function(){o.on.apply(this,arguments),Array.prototype.unshift.call(arguments,"on"),this._trigger.apply(this,arguments)},r.prototype.off=o.off,r.prototype.trigger=o.trigger,r.prototype.removeAllListeners=o.removeAllListeners,e.exports=r},{}],3:[function(t,e){function n(t,e){var n=0;return function(){var r=Date.now();r-n>t&&(n=r,e.apply(this,arguments))}}function r(t,e){if(void 0!==t&&t||(t={}),"object"==typeof e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function i(){var t=this,e=Date.now();this.origin=a(),this.lastMessage=e,this.receivedIDs={},this.previousValues={};var n=function(){t._onStorageEvent.apply(t,arguments)};"undefined"!=typeof window&&"undefined"!=typeof document&&(document.attachEvent?document.attachEvent("onstorage",n):window.addEventListener("storage",n,!1))}var o=t("./eventemitter.js"),a=t("../src/shared.js").guid,s=function(t){return t===void 0||t.localStorage===void 0?{getItem:function(){},setItem:function(){},removeItem:function(){}}:t.localStorage}(this);i.prototype._transaction=function(t){function e(){if(!a){var l=Date.now(),d=0|s.getItem(c);if(d&&r>l-d)return u||(o._on("storage",e),u=!0),f=setTimeout(e,i),void 0;a=!0,s.setItem(c,l),t(),n()}}function n(){u&&o._off("storage",e),f&&clearTimeout(f),s.removeItem(c)}var r=1e3,i=20,o=this,a=!1,u=!1,f=null;e()},i.prototype._cleanup_emit=n(100,function(){var t=this;t._transaction(function(){var t,e=Date.now(),n=e-l,r=0;try{t=JSON.parse(s.getItem(u)||"[]")}catch(i){t=[]}for(var o=t.length-1;o>=0;o--)n>t[o].timestamp&&(t.splice(o,1),r++);r>0&&s.setItem(u,JSON.stringify(t))})}),i.prototype._cleanup_once=n(100,function(){var t=this;t._transaction(function(){var e,n;Date.now();var r=0;try{n=JSON.parse(s.getItem(f)||"{}")}catch(i){n={}}for(e in n)t._once_expired(e,n)&&(delete n[e],r++);r>0&&s.setItem(f,JSON.stringify(n))})}),i.prototype._once_expired=function(t,e){if(!e)return!0;if(!e.hasOwnProperty(t))return!0;if("object"!=typeof e[t])return!0;var n=e[t].ttl||d,r=Date.now(),i=e[t].timestamp;return r-n>i},i.prototype._localStorageChanged=function(t,e){if(t&&t.key)return t.key===e;var n=s.getItem(e);return n===this.previousValues[e]?!1:(this.previousValues[e]=n,!0)},i.prototype._onStorageEvent=function(t){t=t||window.event;var e=this;this._localStorageChanged(t,u)&&this._transaction(function(){var t,n=Date.now(),r=s.getItem(u);try{t=JSON.parse(r||"[]")}catch(i){t=[]}for(var o=0;t.length>o;o++)if(t[o].origin!==e.origin&&!(t[o].timestampr;r++)if(e.call(n,t[r],r,t)===v)return}else{var o=o(t);for(r=0,i=o.length;i>r;r++)if(e.call(n,t[o[r]],o[r],t)===v)return}}function a(t,e,n){e||(e=i);var r=!1;return null==t?r:h&&t.some===h?t.some(e,n):(o(t,function(t,i,o){return r||(r=e.call(n,t,i,o))?v:void 0}),!!r)}function s(t,e){return null==t?!1:d&&t.indexOf===d?-1!=t.indexOf(e):a(t,function(t){return t===e})}function u(t){this.value=t}function f(t){return t&&"object"==typeof t&&!Array.isArray(t)&&g.call(t,"__wrapped__")?t:new u(t)}var c=Array.prototype,l=c.forEach,d=c.indexOf,h=c.some,p=Object.prototype,g=p.hasOwnProperty,m=Object.keys,v={},y=m||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)n(t,r)&&e.push(r);return e};u.prototype.has=function(t){return n(this.value,t)},u.prototype.contains=function(t){return s(this.value,t)},u.prototype.size=function(){return r(this.value)},e.exports=f},{}],5:[function(t,e){(function(t){function n(t,e){if("function"!=typeof e)throw Error("Bad callback given: "+e);if(!t)throw Error("No options given");var a=t.onResponse;if(t="string"==typeof t?{uri:t}:JSON.parse(JSON.stringify(t)),t.onResponse=a,t.verbose&&(n.log=o()),t.url&&(t.uri=t.url,delete t.url),!t.uri&&""!==t.uri)throw Error("options.uri is a required argument");if("string"!=typeof t.uri)throw Error("options.uri must be a string");for(var s=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],f=0;s.length>f;f++)if(t[s[f]])throw Error("options."+s[f]+" is not supported");if(t.callback=e,t.method=t.method||"GET",t.headers=t.headers||{},t.body=t.body||null,t.timeout=t.timeout||n.DEFAULT_TIMEOUT,t.headers.host)throw Error("Options.headers.host is not supported");t.json&&(t.headers.accept=t.headers.accept||"application/json","GET"!==t.method&&(t.headers["content-type"]="application/json"),"boolean"!=typeof t.json?t.body=JSON.stringify(t.json):"string"!=typeof t.body&&(t.body=JSON.stringify(t.body)));var c=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")};if(t.qs){var l="string"==typeof t.qs?t.qs:c(t.qs);t.uri=-1!==t.uri.indexOf("?")?t.uri+"&"+l:t.uri+"?"+l}var d=function(t){var e={};e.boundry="-------------------------------"+Math.floor(1e9*Math.random());var n=[];for(var r in t)t.hasOwnProperty(r)&&n.push("--"+e.boundry+"\n"+'Content-Disposition: form-data; name="'+r+'"'+"\n"+"\n"+t[r]+"\n");return n.push("--"+e.boundry+"--"),e.body=n.join(""),e.length=e.body.length,e.type="multipart/form-data; boundary="+e.boundry,e};if(t.form){if("string"==typeof t.form)throw"form name unsupported";if("POST"===t.method){var h=(t.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(t.headers["content-type"]=h,h){case"application/x-www-form-urlencoded":t.body=c(t.form).replace(/%20/g,"+");break;case"multipart/form-data":var p=d(t.form);t.body=p.body,t.headers["content-type"]=p.type;break;default:throw Error("unsupported encoding:"+h)}}}return t.onResponse=t.onResponse||i,t.onResponse===!0&&(t.onResponse=e,t.callback=i),!t.headers.authorization&&t.auth&&(t.headers.authorization="Basic "+u(t.auth.username+":"+t.auth.password)),r(t)}function r(e){function r(){d=!0;var t=Error("ETIMEDOUT");return t.code="ETIMEDOUT",t.duration=e.timeout,n.log.error("Timeout",{id:c._id,milliseconds:e.timeout}),e.callback(t,c)}function i(){if(d)return n.log.debug("Ignoring timed out state change",{state:c.readyState,id:c.id});if(n.log.debug("State change",{state:c.readyState,id:c.id,timed_out:d}),c.readyState===f.OPENED){n.log.debug("Request started",{id:c.id});for(var t in e.headers)c.setRequestHeader(t,e.headers[t])}else c.readyState===f.HEADERS_RECEIVED?o():c.readyState===f.LOADING?(o(),a()):c.readyState===f.DONE&&(o(),a(),u())}function o(){if(!m.response){if(m.response=!0,n.log.debug("Got response",{id:c.id,status:c.status}),clearTimeout(c.timeoutTimer),c.statusCode=c.status,h&&0==c.statusCode){var t=Error("CORS request rejected: "+e.uri);return t.cors="rejected",m.loading=!0,m.end=!0,e.callback(t,c)}e.onResponse(null,c)}}function a(){m.loading||(m.loading=!0,n.log.debug("Response body loading",{id:c.id}))}function u(){if(!m.end){if(m.end=!0,n.log.debug("Request done",{id:c.id}),null===e.encoding)c.body=new t(new Uint8Array(c.response));else if(c.body=c.responseText,e.json)try{c.body=JSON.parse(c.responseText)}catch(r){return e.callback(r,c)}e.callback(null,c,c.body)}}var c=new f,d=!1,h=s(e.uri),p="withCredentials"in c;if(l+=1,c.seq_id=l,c.id=l+": "+e.method+" "+e.uri,c._id=c.id,h&&!p){var g=Error("Browser does not support cross-origin request: "+e.uri);return g.cors="unsupported",e.callback(g,c)}c.timeoutTimer=setTimeout(r,e.timeout);var m={response:!1,loading:!1,end:!1};return c.onreadystatechange=i,c.open(e.method,e.uri,!0),null===e.encoding&&(c.responseType="arraybuffer"),h&&(c.withCredentials=!!e.withCredentials),c.send(e.body),c}function i(){}function o(){var t,e,n={},r=["trace","debug","info","warn","error"];for(e=0;r.length>e;e++)t=r[e],n[t]=i,"undefined"!=typeof console&&console&&console[t]&&(n[t]=a(console,t));return n}function a(t,e){function n(n,r){return"object"==typeof r&&(n+=" "+JSON.stringify(r)),t[e].call(t,n)}return n}function s(t){var e,n=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{e=location.href}catch(r){e=document.createElement("a"),e.href="",e=e.href}var i=n.exec(e.toLowerCase())||[],o=n.exec(t.toLowerCase()),a=!(!o||o[1]==i[1]&&o[2]==i[2]&&(o[3]||("http:"===o[1]?80:443))==(i[3]||("http:"===i[1]?80:443)));return a}function u(t){var e,n,r,i,o,a,s,u,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,d="",h=[];if(!t)return t;do e=t.charCodeAt(c++),n=t.charCodeAt(c++),r=t.charCodeAt(c++),u=e<<16|n<<8|r,i=63&u>>18,o=63&u>>12,a=63&u>>6,s=63&u,h[l++]=f.charAt(i)+f.charAt(o)+f.charAt(a)+f.charAt(s);while(t.length>c);switch(d=h.join(""),t.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d}var f=XMLHttpRequest;if(!f)throw Error("missing XMLHttpRequest");n.log={trace:i,debug:i,info:i,warn:i,error:i};var c=18e4,l=0;n.withCredentials=!1,n.DEFAULT_TIMEOUT=c,n.defaults=function(t){var e=function(e){var n=function(n,r){n="string"==typeof n?{uri:n}:JSON.parse(JSON.stringify(n));for(var i in t)void 0===n[i]&&(n[i]=t[i]);return e(n,r)};return n},r=e(n);return r.get=e(n.get),r.post=e(n.post),r.put=e(n.put),r.head=e(n.head),r};var d=["get","put","post","head"];d.forEach(function(t){var e=t.toUpperCase(),r=t.toLowerCase();n[r]=function(t){"string"==typeof t?t={method:e,uri:t}:(t=JSON.parse(JSON.stringify(t)),t.method=e);var r=[t].concat(Array.prototype.slice.apply(arguments,[1]));return n.apply(this,r)}}),n.couch=function(t,e){function r(t,n,r){if(t)return e(t,n,r);if((200>n.statusCode||n.statusCode>299)&&r.error){t=Error("CouchDB error: "+(r.error.reason||r.error.error));for(var i in r)t[i]=r[i];return e(t,n,r)}return e(t,n,r)}"string"==typeof t&&(t={uri:t}),t.json=!0,t.body&&(t.json=t.body),delete t.body,e=e||i;var o=n(t,r);return o},e.exports=n}).call(this,t("buffer").Buffer)},{buffer:6}],6:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);var i=typeof t;if("base64"===e&&"string"===i)for(t=T(t);0!==t.length%4;)t+="=";var o;if("number"===i)o=C(t);else if("string"===i)o=r.byteLength(t,e);else{if("object"!==i)throw Error("First argument needs to be a number, array or string.");o=C(t.length)}var a;r._useTypedArrays?a=r._augment(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var s;if(r._useTypedArrays&&"number"==typeof t.byteLength)a._set(t);else if(N(t))for(s=0;o>s;s++)r.isBuffer(t)?a[s]=t.readUInt8(s):a.writeInt8(t[s],s);else if("string"===i)a.write(t,0,e);else if("number"===i&&!r._useTypedArrays&&!n)for(s=0;o>s;s++)a[s]=0;return a}function i(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;Z(0===o%2,"Invalid hex string"),r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);Z(!isNaN(s),"Invalid hex string"),t[n+a]=s}return a}function o(t,e,n,r){var i=F(L(e),t,n,r);return i}function a(t,e,n,r){var i=F(B(e),t,n,r);return i}function s(t,e,n,r){return a(t,e,n,r)}function u(t,e,n,r){var i=F(j(e),t,n,r);return i}function f(t,e,n,r){var i=F(z(e),t,n,r);return i}function c(t,e,n){return 0===e&&n===t.length?Y.fromByteArray(t):Y.fromByteArray(t.slice(e,n))}function l(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)127>=t[o]?(r+=M(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+M(i)}function d(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function h(t,e,n){return d(t,e,n)}function p(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=D(t[o]);return i}function g(t,e,n){for(var r=t.slice(e,n),i="",o=0;r.length>o;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function m(t,e,n,r){r||(Z("boolean"==typeof n,"missing or invalid endian"),Z(void 0!==e&&null!==e,"missing offset"),Z(t.length>e+1,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o;return n?(o=t[e],i>e+1&&(o|=t[e+1]<<8)):(o=t[e]<<8,i>e+1&&(o|=t[e+1])),o}}function v(t,e,n,r){r||(Z("boolean"==typeof n,"missing or invalid endian"),Z(void 0!==e&&null!==e,"missing offset"),Z(t.length>e+3,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o;return n?(i>e+2&&(o=t[e+2]<<16),i>e+1&&(o|=t[e+1]<<8),o|=t[e],i>e+3&&(o+=t[e+3]<<24>>>0)):(i>e+1&&(o=t[e+1]<<16),i>e+2&&(o|=t[e+2]<<8),i>e+3&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}}function y(t,e,n,r){r||(Z("boolean"==typeof n,"missing or invalid endian"),Z(void 0!==e&&null!==e,"missing offset"),Z(t.length>e+1,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o=m(t,e,n,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(t,e,n,r){r||(Z("boolean"==typeof n,"missing or invalid endian"),Z(void 0!==e&&null!==e,"missing offset"),Z(t.length>e+3,"Trying to read beyond buffer length"));var i=t.length;if(!(e>=i)){var o=v(t,e,n,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function _(t,e,n,r){return r||(Z("boolean"==typeof n,"missing or invalid endian"),Z(t.length>e+3,"Trying to read beyond buffer length")),X.read(t,e,n,23,4)}function w(t,e,n,r){return r||(Z("boolean"==typeof n,"missing or invalid endian"),Z(t.length>e+7,"Trying to read beyond buffer length")),X.read(t,e,n,52,8)}function E(t,e,n,r,i){i||(Z(void 0!==e&&null!==e,"missing value"),Z("boolean"==typeof r,"missing or invalid endian"),Z(void 0!==n&&null!==n,"missing offset"),Z(t.length>n+1,"trying to write beyond buffer length"),U(e,65535));var o=t.length;if(!(n>=o)){for(var a=0,s=Math.min(o-n,2);s>a;a++)t[n+a]=(e&255<<8*(r?a:1-a))>>>8*(r?a:1-a);return n+2}}function I(t,e,n,r,i){i||(Z(void 0!==e&&null!==e,"missing value"),Z("boolean"==typeof r,"missing or invalid endian"),Z(void 0!==n&&null!==n,"missing offset"),Z(t.length>n+3,"trying to write beyond buffer length"),U(e,4294967295));var o=t.length;if(!(n>=o)){for(var a=0,s=Math.min(o-n,4);s>a;a++)t[n+a]=255&e>>>8*(r?a:3-a);return n+4}}function A(t,e,n,r,i){i||(Z(void 0!==e&&null!==e,"missing value"),Z("boolean"==typeof r,"missing or invalid endian"),Z(void 0!==n&&null!==n,"missing offset"),Z(t.length>n+1,"Trying to write beyond buffer length"),P(e,32767,-32768));var o=t.length;if(!(n>=o))return e>=0?E(t,e,n,r,i):E(t,65535+e+1,n,r,i),n+2}function x(t,e,n,r,i){i||(Z(void 0!==e&&null!==e,"missing value"),Z("boolean"==typeof r,"missing or invalid endian"),Z(void 0!==n&&null!==n,"missing offset"),Z(t.length>n+3,"Trying to write beyond buffer length"),P(e,2147483647,-2147483648));var o=t.length;if(!(n>=o))return e>=0?I(t,e,n,r,i):I(t,4294967295+e+1,n,r,i),n+4}function k(t,e,n,r,i){i||(Z(void 0!==e&&null!==e,"missing value"),Z("boolean"==typeof r,"missing or invalid endian"),Z(void 0!==n&&null!==n,"missing offset"),Z(t.length>n+3,"Trying to write beyond buffer length"),V(e,3.4028234663852886e38,-3.4028234663852886e38));var o=t.length;if(!(n>=o))return X.write(t,e,n,r,23,4),n+4}function S(t,e,n,r,i){i||(Z(void 0!==e&&null!==e,"missing value"),Z("boolean"==typeof r,"missing or invalid endian"),Z(void 0!==n&&null!==n,"missing offset"),Z(t.length>n+7,"Trying to write beyond buffer length"),V(e,1.7976931348623157e308,-1.7976931348623157e308));var o=t.length;if(!(n>=o))return X.write(t,e,n,r,52,8),n+8}function T(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function O(t,e,n){return"number"!=typeof t?n:(t=~~t,t>=e?e:t>=0?t:(t+=e,t>=0?t:0))}function C(t){return t=~~Math.ceil(+t),0>t?0:t}function R(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function N(t){return R(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function D(t){return 16>t?"0"+t.toString(16):t.toString(16)}function L(t){for(var e=[],n=0;t.length>n;n++){var r=t.charCodeAt(n);if(127>=r)e.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(t.slice(i,n+1)).substr(1).split("%"),a=0;o.length>a;a++)e.push(parseInt(o[a],16))}}return e}function B(t){for(var e=[],n=0;t.length>n;n++)e.push(255&t.charCodeAt(n));return e}function z(t){for(var e,n,r,i=[],o=0;t.length>o;o++)e=t.charCodeAt(o),n=e>>8,r=e%256,i.push(r),i.push(n);return i}function j(t){return Y.toByteArray(t)}function F(t,e,n,r){for(var i=0;r>i&&!(i+n>=e.length||i>=t.length);i++)e[i+n]=t[i];return i}function M(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}function U(t,e){Z("number"==typeof t,"cannot write a non-number as a number"),Z(t>=0,"specified a negative value for writing an unsigned value"),Z(e>=t,"value is larger than maximum value for type"),Z(Math.floor(t)===t,"value has a fractional component")}function P(t,e,n){Z("number"==typeof t,"cannot write a non-number as a number"),Z(e>=t,"value larger than maximum allowed value"),Z(t>=n,"value smaller than minimum allowed value"),Z(Math.floor(t)===t,"value has a fractional component")}function V(t,e,n){Z("number"==typeof t,"cannot write a non-number as a number"),Z(e>=t,"value larger than maximum allowed value"),Z(t>=n,"value smaller than minimum allowed value")}function Z(t,e){if(!t)throw Error(e||"Failed assertion")}var Y=t("base64-js"),X=t("ieee754");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(n){return!1}}(),r.isEncoding=function(t){switch((t+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(t){return!(null===t||void 0===t||!t._isBuffer)},r.byteLength=function(t,e){var n;switch(t=""+t,e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=L(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=j(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw Error("Unknown encoding")}return n},r.concat=function(t,e){if(Z(R(t),"Usage: Buffer.concat(list[, length])"),0===t.length)return new r(0);if(1===t.length)return t[0];var n;if(void 0===e)for(e=0,n=0;t.length>n;n++)e+=t[n].length;var i=new r(e),o=0;for(n=0;t.length>n;n++){var a=t[n];a.copy(i,o),o+=a.length}return i},r.compare=function(t,e){Z(r.isBuffer(t)&&r.isBuffer(e),"Arguments must be Buffers");for(var n=t.length,i=e.length,o=0,a=Math.min(n,i);a>o&&t[o]===e[o];o++);return o!==a&&(n=t[o],i=e[o]),i>n?-1:n>i?1:0},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var c=r;r=e,e=n,n=c}e=Number(e)||0;var l=this.length-e;n?(n=Number(n),n>l&&(n=l)):n=l,r=((r||"utf8")+"").toLowerCase();var d;switch(r){case"hex":d=i(this,t,e,n);break;case"utf8":case"utf-8":d=o(this,t,e,n);break;case"ascii":d=a(this,t,e,n);break;case"binary":d=s(this,t,e,n);break;case"base64":d=u(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=f(this,t,e,n);break;default:throw Error("Unknown encoding")}return d},r.prototype.toString=function(t,e,n){var r=this;if(t=((t||"utf8")+"").toLowerCase(),e=Number(e)||0,n=void 0===n?r.length:Number(n),n===e)return"";var i;switch(t){case"hex":i=p(r,e,n);break;case"utf8":case"utf-8":i=l(r,e,n);break;case"ascii":i=d(r,e,n);break;case"binary":i=h(r,e,n);break;case"base64":i=c(r,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,e,n);break;default:throw Error("Unknown encoding")}return i},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)} +},r.prototype.equals=function(t){return Z(r.isBuffer(t),"Argument must be a Buffer"),0===r.compare(this,t)},r.prototype.compare=function(t){return Z(r.isBuffer(t),"Argument must be a Buffer"),r.compare(this,t)},r.prototype.copy=function(t,e,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){Z(i>=n,"sourceEnd < sourceStart"),Z(e>=0&&t.length>e,"targetStart out of bounds"),Z(n>=0&&o.length>n,"sourceStart out of bounds"),Z(i>=0&&o.length>=i,"sourceEnd out of bounds"),i>this.length&&(i=this.length),i-n>t.length-e&&(i=t.length-e+n);var a=i-n;if(100>a||!r._useTypedArrays)for(var s=0;a>s;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+a),e)}},r.prototype.slice=function(t,e){var n=this.length;if(t=O(t,n,0),e=O(e,n,n),r._useTypedArrays)return r._augment(this.subarray(t,e));for(var i=e-t,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+t];return o},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.readUInt8=function(t,e){return e||(Z(void 0!==t&&null!==t,"missing offset"),Z(this.length>t,"Trying to read beyond buffer length")),t>=this.length?void 0:this[t]},r.prototype.readUInt16LE=function(t,e){return m(this,t,!0,e)},r.prototype.readUInt16BE=function(t,e){return m(this,t,!1,e)},r.prototype.readUInt32LE=function(t,e){return v(this,t,!0,e)},r.prototype.readUInt32BE=function(t,e){return v(this,t,!1,e)},r.prototype.readInt8=function(t,e){if(e||(Z(void 0!==t&&null!==t,"missing offset"),Z(this.length>t,"Trying to read beyond buffer length")),!(t>=this.length)){var n=128&this[t];return n?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,e){return y(this,t,!0,e)},r.prototype.readInt16BE=function(t,e){return y(this,t,!1,e)},r.prototype.readInt32LE=function(t,e){return b(this,t,!0,e)},r.prototype.readInt32BE=function(t,e){return b(this,t,!1,e)},r.prototype.readFloatLE=function(t,e){return _(this,t,!0,e)},r.prototype.readFloatBE=function(t,e){return _(this,t,!1,e)},r.prototype.readDoubleLE=function(t,e){return w(this,t,!0,e)},r.prototype.readDoubleBE=function(t,e){return w(this,t,!1,e)},r.prototype.writeUInt8=function(t,e,n){return n||(Z(void 0!==t&&null!==t,"missing value"),Z(void 0!==e&&null!==e,"missing offset"),Z(this.length>e,"trying to write beyond buffer length"),U(t,255)),e>=this.length?void 0:(this[e]=t,e+1)},r.prototype.writeUInt16LE=function(t,e,n){return E(this,t,e,!0,n)},r.prototype.writeUInt16BE=function(t,e,n){return E(this,t,e,!1,n)},r.prototype.writeUInt32LE=function(t,e,n){return I(this,t,e,!0,n)},r.prototype.writeUInt32BE=function(t,e,n){return I(this,t,e,!1,n)},r.prototype.writeInt8=function(t,e,n){return n||(Z(void 0!==t&&null!==t,"missing value"),Z(void 0!==e&&null!==e,"missing offset"),Z(this.length>e,"Trying to write beyond buffer length"),P(t,127,-128)),e>=this.length?void 0:(t>=0?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n),e+1)},r.prototype.writeInt16LE=function(t,e,n){return A(this,t,e,!0,n)},r.prototype.writeInt16BE=function(t,e,n){return A(this,t,e,!1,n)},r.prototype.writeInt32LE=function(t,e,n){return x(this,t,e,!0,n)},r.prototype.writeInt32BE=function(t,e,n){return x(this,t,e,!1,n)},r.prototype.writeFloatLE=function(t,e,n){return k(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){return k(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){return S(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){return S(this,t,e,!1,n)},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),Z(n>=e,"end < start"),n!==e&&0!==this.length){Z(e>=0&&this.length>e,"start out of bounds"),Z(n>=0&&this.length>=n,"end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var i=L(""+t),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}return this}},r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=D(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return""},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw Error("Buffer.toArrayBuffer not supported in this browser")};var H=r.prototype;r._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=H.get,t.set=H.set,t.write=H.write,t.toString=H.toString,t.toLocaleString=H.toString,t.toJSON=H.toJSON,t.equals=H.equals,t.compare=H.compare,t.copy=H.copy,t.slice=H.slice,t.readUInt8=H.readUInt8,t.readUInt16LE=H.readUInt16LE,t.readUInt16BE=H.readUInt16BE,t.readUInt32LE=H.readUInt32LE,t.readUInt32BE=H.readUInt32BE,t.readInt8=H.readInt8,t.readInt16LE=H.readInt16LE,t.readInt16BE=H.readInt16BE,t.readInt32LE=H.readInt32LE,t.readInt32BE=H.readInt32BE,t.readFloatLE=H.readFloatLE,t.readFloatBE=H.readFloatBE,t.readDoubleLE=H.readDoubleLE,t.readDoubleBE=H.readDoubleBE,t.writeUInt8=H.writeUInt8,t.writeUInt16LE=H.writeUInt16LE,t.writeUInt16BE=H.writeUInt16BE,t.writeUInt32LE=H.writeUInt32LE,t.writeUInt32BE=H.writeUInt32BE,t.writeInt8=H.writeInt8,t.writeInt16LE=H.writeInt16LE,t.writeInt16BE=H.writeInt16BE,t.writeInt32LE=H.writeInt32LE,t.writeInt32BE=H.writeInt32BE,t.writeFloatLE=H.writeFloatLE,t.writeFloatBE=H.writeFloatBE,t.writeDoubleLE=H.writeDoubleLE,t.writeDoubleBE=H.writeDoubleBE,t.fill=H.fill,t.inspect=H.inspect,t.toArrayBuffer=H.toArrayBuffer,t}},{"base64-js":7,ieee754:8}],7:[function(t,e){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(){"use strict";function t(t){var e=t.charCodeAt(0);return e===a?62:e===s?63:u>e?-1:u+10>e?e-u+26+26:c+26>e?e-c:f+26>e?e-f+26:void 0}function r(e){function n(t){f[l++]=t}var r,i,a,s,u,f;if(e.length%4>0)throw Error("Invalid string. Length must be a multiple of 4");var c=e.length;u="="===e.charAt(c-2)?2:"="===e.charAt(c-1)?1:0,f=new o(3*e.length/4-u),a=u>0?e.length-4:e.length;var l=0;for(r=0,i=0;a>r;r+=4,i+=3)s=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&s)):1===u&&(s=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(255&s>>8),n(255&s)),f}function i(t){function e(t){return n.charAt(t)}function r(t){return e(63&t>>18)+e(63&t>>12)+e(63&t>>6)+e(63&t)}var i,o,a,s=t.length%3,u="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=r(o);switch(s){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(63&o<<4),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(63&o>>4),u+=e(63&o<<2),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array;"0".charCodeAt(0);var a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),f="a".charCodeAt(0),c="A".charCodeAt(0);e.exports.toByteArray=r,e.exports.fromByteArray=i})()},{}],8:[function(t,e,n){n.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,l=n?i-1:0,d=n?-1:1,h=t[e+l];for(l+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+t[e+l],l+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+l],l+=d,c-=8);if(0===o)o=1-f;else{if(o===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),o-=f}return(h?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,s,u,f=8*o-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||1/0===e?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),1>e*(u=Math.pow(2,-a))&&(a--,u*=2),e+=a+l>=1?d/u:d*Math.pow(2,1-l),e*u>=2&&(a++,u/=2),a+l>=c?(s=0,a=c):a+l>=1?(s=(e*u-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;t[n+h]=255&a,h+=p,a/=256,f-=8);t[n+h-p]|=128*g}},{}],9:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw Error("process.chdir is not supported")}},{}],10:[function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(t){for(var e,n,i,o,a,s,u,f="",c=0;t.length>c;)e=t.charCodeAt(c++),n=t.charCodeAt(c++),i=t.charCodeAt(c++),o=e>>2,a=(3&e)<<4|n>>4,s=(15&n)<<2|i>>6,u=63&i,isNaN(n)?s=u=64:isNaN(i)&&(u=64),f=f+r.charAt(o)+r.charAt(a)+r.charAt(s)+r.charAt(u);return f},n.decode=function(t){var e,n,i,o,a,s,u,f="",c=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");t.length>c;)o=r.indexOf(t.charAt(c++)),a=r.indexOf(t.charAt(c++)),s=r.indexOf(t.charAt(c++)),u=r.indexOf(t.charAt(c++)),e=o<<2|a>>4,n=(15&a)<<4|s>>2,i=(3&s)<<6|u,f+=String.fromCharCode(e),64!=s&&(f+=String.fromCharCode(n)),64!=u&&(f+=String.fromCharCode(i));return f}},{}],11:[function(t,e){"use strict";function n(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}n.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},e.exports=n},{}],12:[function(t,e,n){"use strict";n.STORE={magic:"\0\0",compress:function(t){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},n.DEFLATE=t("./flate")},{"./flate":15}],13:[function(t,e){"use strict";function n(){this.data=null,this.length=0,this.index=0}var r=t("./utils");n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(t>this.length||0>t)throw Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return r.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date((127&t>>25)+1980,(15&t>>21)-1,31&t>>16,31&t>>11,63&t>>5,(31&t)<<1)}},e.exports=n},{"./utils":25}],14:[function(t,e,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.date=null,n.compression=null},{}],15:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=t("pako");n.uncompressInputType=r?"uint8array":"array",n.compressInputType=r?"uint8array":"array",n.magic="\b\0",n.compress=function(t){return i.deflateRaw(t)},n.uncompress=function(t){return i.inflateRaw(t)}},{pako:28}],16:[function(t,e){"use strict";function n(t,e){return this instanceof n?(this.files={},this.root="",t&&this.load(t,e),this.clone=function(){var t=new n;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t},void 0):new n(t,e)}n.prototype=t("./object"),n.prototype.load=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.utils=t("./utils"),n.base64=t("./base64"),n.compressions=t("./compressions"),e.exports=n},{"./base64":10,"./compressions":12,"./defaults":14,"./load":17,"./object":20,"./support":23,"./utils":25}],17:[function(t,e){"use strict";var n=t("./base64"),r=t("./zipEntries");e.exports=function(t,e){var i,o,a,s;for(e=e||{},e.base64&&(t=n.decode(t)),o=new r(t,e),i=o.files,a=0;i.length>a;a++)s=i[a],this.file(s.fileName,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir});return this}},{"./base64":10,"./zipEntries":26}],18:[function(t,e){(function(t){"use strict";e.exports=function(e,n){return new t(e,n)},e.exports.test=function(e){return t.isBuffer(e)}}).call(this,t("buffer").Buffer)},{buffer:6}],19:[function(t,e){"use strict";function n(t){this.data=t,this.length=this.data.length,this.index=0}var r=t("./uint8ArrayReader");n.prototype=new r,n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./uint8ArrayReader":24}],20:[function(t,e){"use strict";var n,r,i=t("./support"),o=t("./utils"),a=t("./signature"),s=t("./defaults"),u=t("./base64"),f=t("./compressions"),c=t("./compressedObject"),l=t("./nodeBuffer");i.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(n=new TextEncoder("utf-8"),r=new TextDecoder("utf-8"));var d=function(t){if(t._data instanceof c&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===o.getTypeOf(t._data))){var e=t._data;t._data=new Uint8Array(e.length),0!==e.length&&t._data.set(e,0)}return t._data},h=function(t){var e=d(t),r=o.getTypeOf(e);if("string"===r){if(!t.options.binary){if(n)return n.encode(e);if(i.nodebuffer)return l(e,"utf-8")}return t.asBinary()}return e},p=function(t){var e=d(this);return null===e||e===void 0?"":(this.options.base64&&(e=u.decode(e)),e=t&&this.options.binary?x.utf8decode(e):o.transformTo("string",e),t||this.options.binary||(e=x.utf8encode(e)),e)},g=function(t,e,n){this.name=t,this._data=e,this.options=n};g.prototype={asText:function(){return p.call(this,!0)},asBinary:function(){return p.call(this,!1)},asNodeBuffer:function(){var t=h(this);return o.transformTo("nodebuffer",t)},asUint8Array:function(){var t=h(this);return o.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var m=function(t,e){var n,r="";for(n=0;e>n;n++)r+=String.fromCharCode(255&t),t>>>=8;return r},v=function(){var t,e,n={};for(t=0;arguments.length>t;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&n[e]===void 0&&(n[e]=arguments[t][e]);return n},y=function(t){return t=t||{},t.base64!==!0||null!==t.binary&&void 0!==t.binary||(t.binary=!0),t=v(t,s),t.date=t.date||new Date,null!==t.compression&&(t.compression=t.compression.toUpperCase()),t},b=function(t,e,n){var r=o.getTypeOf(e);if(n=y(n),n.dir||null===e||e===void 0)n.base64=!1,n.binary=!1,e=null;else if("string"===r)n.binary&&!n.base64&&n.optimizedBinaryString!==!0&&(e=o.string2binary(e));else{if(n.base64=!1,n.binary=!0,!(r||e instanceof c))throw Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===r&&(e=o.transformTo("uint8array",e))}var i=new g(t,e,n);return this.files[t]=i,i},_=function(t){return"/"!=t.slice(-1)&&(t+="/"),this.files[t]||b.call(this,t,null,{dir:!0}),this.files[t]},w=function(t,e){var n,r=new c;return t._data instanceof c?(r.uncompressedSize=t._data.uncompressedSize,r.crc32=t._data.crc32,0===r.uncompressedSize||t.options.dir?(e=f.STORE,r.compressedContent="",r.crc32=0):t._data.compressionMethod===e.magic?r.compressedContent=t._data.getCompressedContent():(n=t._data.getContent(),r.compressedContent=e.compress(o.transformTo(e.compressInputType,n)))):(n=h(t),(!n||0===n.length||t.options.dir)&&(e=f.STORE,n=""),r.uncompressedSize=n.length,r.crc32=this.crc32(n),r.compressedContent=e.compress(o.transformTo(e.compressInputType,n))),r.compressedSize=r.compressedContent.length,r.compressionMethod=e.magic,r},E=function(t,e,n,r){var i,o,s=(n.compressedContent,this.utf8encode(e.name)),u=s!==e.name,f=e.options,c="",l="";i=f.date.getHours(),i<<=6,i|=f.date.getMinutes(),i<<=5,i|=f.date.getSeconds()/2,o=f.date.getFullYear()-1980,o<<=4,o|=f.date.getMonth()+1,o<<=5,o|=f.date.getDate(),u&&(l=m(1,1)+m(this.crc32(s),4)+s,c+="up"+m(l.length,2)+l);var d="";d+="\n\0",d+=u?"\0\b":"\0\0",d+=n.compressionMethod,d+=m(i,2),d+=m(o,2),d+=m(n.crc32,4),d+=m(n.compressedSize,4),d+=m(n.uncompressedSize,4),d+=m(s.length,2),d+=m(c.length,2);var h=a.LOCAL_FILE_HEADER+d+s+c,p=a.CENTRAL_FILE_HEADER+"\0"+d+"\0\0"+"\0\0"+"\0\0"+(e.options.dir===!0?"\0\0\0":"\0\0\0\0")+m(r,4)+s+c;return{fileRecord:h,dirRecord:p,compressedObject:n}},I=function(){this.data=[]};I.prototype={append:function(t){t=o.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}};var A=function(t){this.data=new Uint8Array(t),this.index=0};A.prototype={append:function(t){0!==t.length&&(t=o.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}};var x={load:function(){throw Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var e,n,r,i,o=[];for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],i=new g(r.name,r._data,v(r.options)),n=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(n,i)&&o.push(i));return o},file:function(t,e,n){if(1===arguments.length){if(o.isRegExp(t)){var r=t;return this.filter(function(t,e){return!e.options.dir&&r.test(t)})}return this.filter(function(e,n){return!n.options.dir&&e===t})[0]||null}return t=this.root+t,b.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(o.isRegExp(t))return this.filter(function(e,n){return n.options.dir&&t.test(e)});var e=this.root+t,n=_.call(this,e),r=this.clone();return r.root=n.name,r},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!=t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.options.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),r=0;n.length>r;r++)delete this.files[n[r].name];return this},generate:function(t){t=v(t||{},{base64:!0,compression:"STORE",type:"base64"}),o.checkSupport(t.type);var e,n,r=[],i=0,s=0;for(var c in this.files)if(this.files.hasOwnProperty(c)){var l=this.files[c],d=l.options.compression||t.compression.toUpperCase(),h=f[d];if(!h)throw Error(d+" is not a valid compression method !");var p=w.call(this,l,h),g=E.call(this,c,l,p,i);i+=g.fileRecord.length+p.compressedSize,s+=g.dirRecord.length,r.push(g)}var y="";y=a.CENTRAL_DIRECTORY_END+"\0\0"+"\0\0"+m(r.length,2)+m(r.length,2)+m(s,4)+m(i,4)+"\0\0";var b=t.type.toLowerCase();for(e="uint8array"===b||"arraybuffer"===b||"blob"===b||"nodebuffer"===b?new A(i+s+y.length):new I(i+s+y.length),n=0;r.length>n;n++)e.append(r[n].fileRecord),e.append(r[n].compressedObject.compressedContent);for(n=0;r.length>n;n++)e.append(r[n].dirRecord);e.append(y);var _=e.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return o.transformTo(t.type.toLowerCase(),_);case"blob":return o.arrayBuffer2Blob(o.transformTo("arraybuffer",_));case"base64":return t.base64?u.encode(_):_;default:return _}},crc32:function(t,e){if(t===void 0||!t.length)return 0;var n="string"!==o.getTypeOf(t),r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];e===void 0&&(e=0);var i=0,a=0,s=0;e=-1^e;for(var u=0,f=t.length;f>u;u++)s=n?t[u]:t.charCodeAt(u),a=255&(e^s),i=r[a],e=e>>>8^i;return-1^e},utf8encode:function(t){if(n){var e=n.encode(t);return o.transformTo("string",e)}if(i.nodebuffer)return o.transformTo("string",l(t,"utf-8"));for(var r=[],a=0,s=0;t.length>s;s++){var u=t.charCodeAt(s);128>u?r[a++]=String.fromCharCode(u):u>127&&2048>u?(r[a++]=String.fromCharCode(192|u>>6),r[a++]=String.fromCharCode(128|63&u)):(r[a++]=String.fromCharCode(224|u>>12),r[a++]=String.fromCharCode(128|63&u>>6),r[a++]=String.fromCharCode(128|63&u))}return r.join("")},utf8decode:function(t){var e=[],n=0,a=o.getTypeOf(t),s="string"!==a,u=0,f=0,c=0,l=0;if(r)return r.decode(o.transformTo("uint8array",t));if(i.nodebuffer)return o.transformTo("nodebuffer",t).toString("utf-8");for(;t.length>u;)f=s?t[u]:t.charCodeAt(u),128>f?(e[n++]=String.fromCharCode(f),u++):f>191&&224>f?(c=s?t[u+1]:t.charCodeAt(u+1),e[n++]=String.fromCharCode((31&f)<<6|63&c),u+=2):(c=s?t[u+1]:t.charCodeAt(u+1),l=s?t[u+2]:t.charCodeAt(u+2),e[n++]=String.fromCharCode((15&f)<<12|(63&c)<<6|63&l),u+=3);return e.join("")}};e.exports=x},{"./base64":10,"./compressedObject":11,"./compressions":12,"./defaults":14,"./nodeBuffer":18,"./signature":21,"./support":23,"./utils":25}],21:[function(t,e,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],22:[function(t,e){"use strict";function n(t,e){this.data=t,e||(this.data=i.string2binary(this.data)),this.length=this.data.length,this.index=0}var r=t("./dataReader"),i=t("./utils");n.prototype=new r,n.prototype.byteAt=function(t){return this.data.charCodeAt(t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":13,"./utils":25}],23:[function(t,e,n){(function(t){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=t!==void 0,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var e=new ArrayBuffer(0);try{n.blob=0===new Blob([e],{type:"application/zip"}).size}catch(r){try{var i=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new i;o.append(e),n.blob=0===o.getBlob("application/zip").size}catch(r){n.blob=!1}}}}).call(this,t("buffer").Buffer)},{buffer:6}],24:[function(t,e){"use strict";function n(t){t&&(this.data=t,this.length=this.data.length,this.index=0)}var r=t("./dataReader");n.prototype=new r,n.prototype.byteAt=function(t){return this.data[t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),r=t.charCodeAt(2),i=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o;return-1},n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.subarray(this.index,this.index+t);return this.index+=t,e},e.exports=n},{"./dataReader":13}],25:[function(t,e,n){"use strict";function r(t){return t}function i(t,e){for(var n=0;t.length>n;++n)e[n]=255&t.charCodeAt(n);return e}function o(t){var e=65536,r=[],i=t.length,o=n.getTypeOf(t),a=0,s=!0;try{switch(o){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,f(0))}}catch(u){s=!1}if(!s){for(var c="",l=0;t.length>l;l++)c+=String.fromCharCode(t[l]);return c}for(;i>a&&e>1;)try{"array"===o||"nodebuffer"===o?r.push(String.fromCharCode.apply(null,t.slice(a,Math.min(a+e,i)))):r.push(String.fromCharCode.apply(null,t.subarray(a,Math.min(a+e,i)))),a+=e}catch(u){e=Math.floor(e/2)}return r.join("")}function a(t,e){for(var n=0;t.length>n;n++)e[n]=t[n];return e}var s=t("./support"),u=t("./compressions"),f=t("./nodeBuffer");n.string2binary=function(t){for(var e="",n=0;t.length>n;n++)e+=String.fromCharCode(255&t.charCodeAt(n));return e},n.string2Uint8Array=function(t){return n.transformTo("uint8array",t)},n.uint8Array2String=function(t){return n.transformTo("string",t)},n.string2Blob=function(t){var e=n.transformTo("arraybuffer",t);return n.arrayBuffer2Blob(e)},n.arrayBuffer2Blob=function(t){n.checkSupport("blob");try{return new Blob([t],{type:"application/zip"})}catch(e){try{var r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,i=new r;return i.append(t),i.getBlob("application/zip")}catch(e){throw Error("Bug : can't construct the Blob.")}}};var c={};c.string={string:r,array:function(t){return i(t,Array(t.length))},arraybuffer:function(t){return c.string.uint8array(t).buffer},uint8array:function(t){return i(t,new Uint8Array(t.length))},nodebuffer:function(t){return i(t,f(t.length))}},c.array={string:o,array:r,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return f(t)}},c.arraybuffer={string:function(t){return o(new Uint8Array(t))},array:function(t){return a(new Uint8Array(t),Array(t.byteLength))},arraybuffer:r,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return f(new Uint8Array(t))}},c.uint8array={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:r,nodebuffer:function(t){return f(t)}},c.nodebuffer={string:o,array:function(t){return a(t,Array(t.length))},arraybuffer:function(t){return c.nodebuffer.uint8array(t).buffer},uint8array:function(t){return a(t,new Uint8Array(t.length))},nodebuffer:r},n.transformTo=function(t,e){if(e||(e=""),!t)return e;n.checkSupport(t);var r=n.getTypeOf(e),i=c[r][t](e);return i},n.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":s.nodebuffer&&f.test(t)?"nodebuffer":s.uint8array&&t instanceof Uint8Array?"uint8array":s.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(t){var e=s[t.toLowerCase()];if(!e)throw Error(t+" is not supported by this browser")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(t){var e,n,r="";for(n=0;(t||"").length>n;n++)e=t.charCodeAt(n),r+="\\x"+(16>e?"0":"")+e.toString(16).toUpperCase();return r},n.findCompression=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null},n.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}},{"./compressions":12,"./nodeBuffer":18,"./support":23}],26:[function(t,e){"use strict";function n(t,e){this.files=[],this.loadOptions=e,t&&this.load(t)}var r=t("./stringReader"),i=t("./nodeBufferReader"),o=t("./uint8ArrayReader"),a=t("./utils"),s=t("./signature"),u=t("./zipEntry"),f=t("./support");n.prototype={checkSignature:function(t){var e=this.reader.readString(4);if(e!==t)throw Error("Corrupted zip or bug : unexpected signature ("+a.pretty(e)+", expected "+a.pretty(t)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,r=this.zip64EndOfCentralSize-44,i=0;r>i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readString(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;this.files.length>t;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===s.CENTRAL_FILE_HEADER;)t=new u({zip64:this.zip64},this.loadOptions),t.readCentralPart(this.reader),this.files.push(t)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(-1===t)throw Error("Corrupted zip : can't find end of central directory");if(this.reader.setIndex(t),this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),-1===t)throw Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(t){var e=a.getTypeOf(t);this.reader="string"!==e||f.uint8array?"nodebuffer"===e?new i(t):new o(a.transformTo("uint8array",t)):new r(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=n},{"./nodeBufferReader":19,"./signature":21,"./stringReader":22,"./support":23,"./uint8ArrayReader":24,"./utils":25,"./zipEntry":27}],27:[function(t,e){"use strict"; +function n(t,e){this.options=t,this.loadOptions=e}var r=t("./stringReader"),i=t("./utils"),o=t("./compressedObject"),a=t("./object");n.prototype={isEncrypted:function(){return 1===(1&this.bitFlag)},useUTF8:function(){return 2048===(2048&this.bitFlag)},prepareCompressedContent:function(t,e,n){return function(){var r=t.index;t.setIndex(e);var i=t.readData(n);return t.setIndex(r),i}},prepareContent:function(t,e,n,r,o){return function(){var t=i.transformTo(r.uncompressInputType,this.getCompressedContent()),e=r.uncompress(t);if(e.length!==o)throw Error("Bug : uncompressed data size mismatch");return e}},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(n),-1==this.compressedSize||-1==this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(e=i.findCompression(this.compressionMethod),null===e)throw Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new o,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,e),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,e,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),a.crc32(this.decompressed)!==this.crc32))throw Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readString(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=new r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,n,r,i=t.index;for(this.extraFields=this.extraFields||{};t.index0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&16>e.windowBits&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==h)throw Error(f[n]);e.header&&a.deflateSetHeader(this.strm,e.header)};y.prototype.push=function(t,e){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?d:l,i.input="string"==typeof t?u.string2buf(t):t,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new s.Buf8(o),i.next_out=0,i.avail_out=o),n=a.deflate(i,r),n!==p&&n!==h)return this.onEnd(n),this.ended=!0,!1;(0===i.avail_out||0===i.avail_in&&r===d)&&("string"===this.options.to?this.onData(u.buf2binstring(s.shrinkBuf(i.output,i.next_out))):this.onData(s.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&n!==p);return r===d?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===h):!0},y.prototype.onData=function(t){this.chunks.push(t)},y.prototype.onEnd=function(t){t===h&&(this.result="string"===this.options.to?this.chunks.join(""):s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Deflate=y,n.deflate=r,n.deflateRaw=i,n.gzip=o},{"./utils/common":31,"./utils/strings":32,"./zlib/deflate.js":36,"./zlib/messages":41,"./zlib/zstream":43}],30:[function(t,e,n){"use strict";function r(t,e){var n=new d(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}function i(t,e){return e=e||{},e.raw=!0,r(t,e)}var o=t("./zlib/inflate.js"),a=t("./utils/common"),s=t("./utils/strings"),u=t("./zlib/constants"),f=t("./zlib/messages"),c=t("./zlib/zstream"),l=t("./zlib/gzheader"),d=function(t){this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&16>e.windowBits&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&16>e.windowBits)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&48>e.windowBits&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=o.inflateInit2(this.strm,e.windowBits);if(n!==u.Z_OK)throw Error(f[n]);this.header=new l,o.inflateGetHeader(this.strm,this.header)};d.prototype.push=function(t,e){var n,r,i,f,c,l=this.strm,d=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:e===!0?u.Z_FINISH:u.Z_NO_FLUSH,l.input="string"==typeof t?s.binstring2buf(t):t,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new a.Buf8(d),l.next_out=0,l.avail_out=d),n=o.inflate(l,u.Z_NO_FLUSH),n!==u.Z_STREAM_END&&n!==u.Z_OK)return this.onEnd(n),this.ended=!0,!1;l.next_out&&(0===l.avail_out||n===u.Z_STREAM_END||0===l.avail_in&&r===u.Z_FINISH)&&("string"===this.options.to?(i=s.utf8border(l.output,l.next_out),f=l.next_out-i,c=s.buf2string(l.output,i),l.next_out=f,l.avail_out=d-f,f&&a.arraySet(l.output,l.output,i,f,0),this.onData(c)):this.onData(a.shrinkBuf(l.output,l.next_out)))}while((l.avail_in>0||0===l.avail_out)&&n!==u.Z_STREAM_END);return n===u.Z_STREAM_END&&(r=u.Z_FINISH),r===u.Z_FINISH?(n=o.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===u.Z_OK):!0},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===u.Z_OK&&(this.result="string"===this.options.to?this.chunks.join(""):a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},n.Inflate=d,n.inflate=r,n.inflateRaw=i,n.ungzip=r},{"./utils/common":31,"./utils/strings":32,"./zlib/constants":34,"./zlib/gzheader":37,"./zlib/inflate.js":39,"./zlib/messages":41,"./zlib/zstream":43}],31:[function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}}return t},n.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var i={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray)return t.set(e.subarray(n,n+r),i),void 0;for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,a;for(r=0,e=0,n=t.length;n>e;e++)r+=t[e].length;for(a=new Uint8Array(r),i=0,e=0,n=t.length;n>e;e++)o=t[e],a.set(o,i),i+=o.length;return a}},o={arraySet:function(t,e,n,r,i){for(var o=0;r>o;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};n.setTyped=function(t){t?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],32:[function(t,e,n){"use strict";function r(t,e){if(65537>e&&(t.subarray&&a||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;e>r;r++)n+=String.fromCharCode(t[r]);return n}var i=t("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(s){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){a=!1}for(var u=new i.Buf8(256),f=0;256>f;f++)u[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;u[254]=u[254]=1,n.string2buf=function(t){var e,n,r,o,a,s=t.length,u=0;for(o=0;s>o;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),u+=128>n?1:2048>n?2:65536>n?3:4;for(e=new i.Buf8(u),a=0,o=0;u>a;o++)n=t.charCodeAt(o),55296===(64512&n)&&s>o+1&&(r=t.charCodeAt(o+1),56320===(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),o++)),128>n?e[a++]=n:2048>n?(e[a++]=192|n>>>6,e[a++]=128|63&n):65536>n?(e[a++]=224|n>>>12,e[a++]=128|63&n>>>6,e[a++]=128|63&n):(e[a++]=240|n>>>18,e[a++]=128|63&n>>>12,e[a++]=128|63&n>>>6,e[a++]=128|63&n);return e},n.buf2binstring=function(t){return r(t,t.length)},n.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;r>n;n++)e[n]=t.charCodeAt(n);return e},n.buf2string=function(t,e){var n,i,o,a,s=e||t.length,f=Array(2*s);for(i=0,n=0;s>n;)if(o=t[n++],128>o)f[i++]=o;else if(a=u[o],a>4)f[i++]=65533,n+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&s>n;)o=o<<6|63&t[n++],a--;a>1?f[i++]=65533:65536>o?f[i++]=o:(o-=65536,f[i++]=55296|1023&o>>10,f[i++]=56320|1023&o)}return r(f,i)},n.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&128===(192&t[n]);)n--;return 0>n?e:0===n?e:n+u[t[n]]>e?n:e}},{"./common":31}],33:[function(t,e){"use strict";function n(t,e,n,r){for(var i=0|65535&t,o=0|65535&t>>>16,a=0;0!==n;){a=n>2e3?2e3:n,n-=a;do i=0|i+e[r++],o=0|o+i;while(--a);i%=65521,o%=65521}return 0|(i|o<<16)}e.exports=n},{}],34:[function(t,e){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],35:[function(t,e){"use strict";function n(){for(var t,e=[],n=0;256>n;n++){t=n;for(var r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}function r(t,e,n,r){var o=i,a=r+n;t=-1^t;for(var s=r;a>s;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}var i=n();e.exports=r},{}],36:[function(t,e,n){"use strict";function r(t,e){return t.msg=N[e],e}function i(t){return(t<<1)-(t>4?9:0)}function o(t){for(var e=t.length;--e>=0;)t[e]=0}function a(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(T.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function s(t,e){O._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,a(t.strm)}function u(t,e){t.pending_buf[t.pending++]=e}function f(t,e){t.pending_buf[t.pending++]=255&e>>>8,t.pending_buf[t.pending++]=255&e}function c(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,T.arraySet(e,t.input,t.next_in,i,n),1===t.state.wrap?t.adler=C(t.adler,e,i,n):2===t.state.wrap&&(t.adler=R(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function l(t,e){var n,r,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-fe?t.strstart-(t.w_size-fe):0,f=t.window,c=t.w_mask,l=t.prev,d=t.strstart+ue,h=f[o+a-1],p=f[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do if(n=e,f[n+a]===p&&f[n+a-1]===h&&f[n]===f[o]&&f[++n]===f[o+1]){o+=2,n++;do;while(f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&f[++o]===f[++n]&&d>o);if(r=ue-(d-o),o=d-ue,r>a){if(t.match_start=e,a=r,r>=s)break;h=f[o+a-1],p=f[o+a]}}while((e=l[e&c])>u&&0!==--i);return t.lookahead>=a?a:t.lookahead}function d(t){var e,n,r,i,o,a=t.w_size;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=a+(a-fe)){T.arraySet(t.window,t.window,a,a,0),t.match_start-=a,t.strstart-=a,t.block_start-=a,n=t.hash_size,e=n;do r=t.head[--e],t.head[e]=r>=a?r-a:0;while(--n);n=a,e=n;do r=t.prev[--e],t.prev[e]=r>=a?r-a:0;while(--n);i+=a}if(0===t.strm.avail_in)break;if(n=c(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=n,t.lookahead+t.insert>=se)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<t.lookahead+t.insert)););}while(fe>t.lookahead&&0!==t.strm.avail_in)}function h(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(1>=t.lookahead){if(d(t),0===t.lookahead&&e===D)return ye;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,s(t,!1),0===t.strm.avail_out))return ye;if(t.strstart-t.block_start>=t.w_size-fe&&(s(t,!1),0===t.strm.avail_out))return ye}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.strstart>t.block_start&&(s(t,!1),0===t.strm.avail_out)?ye:ye}function p(t,e){for(var n,r;;){if(fe>t.lookahead){if(d(t),fe>t.lookahead&&e===D)return ye;if(0===t.lookahead)break}if(n=0,t.lookahead>=se&&(t.ins_h=(t.ins_h<=se)if(r=O._tr_tally(t,t.strstart-t.match_start,t.match_length-se),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=se){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<t.strstart?t.strstart:se-1,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function g(t,e){for(var n,r,i;;){if(fe>t.lookahead){if(d(t),fe>t.lookahead&&e===D)return ye;if(0===t.lookahead)break}if(n=0,t.lookahead>=se&&(t.ins_h=(t.ins_h<=t.match_length&&(t.strategy===Y||t.match_length===se&&t.strstart-t.match_start>4096)&&(t.match_length=se-1)),t.prev_length>=se&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-se,r=O._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-se),t.lookahead-=t.prev_length-1,t.prev_length-=2;do i>=++t.strstart&&(t.ins_h=(t.ins_h<t.strstart?t.strstart:se-1,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function m(t,e){for(var n,r,i,o,a=t.window;;){if(ue>=t.lookahead){if(d(t),ue>=t.lookahead&&e===D)return ye;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=se&&t.strstart>0&&(i=t.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=t.strstart+ue;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&o>i);t.match_length=ue-(o-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=se?(n=O._tr_tally(t,1,t.match_length-se),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=O._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(s(t,!1),0===t.strm.avail_out))return ye}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function v(t,e){for(var n;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===D)return ye;break}if(t.match_length=0,n=O._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(s(t,!1),0===t.strm.avail_out))return ye}return t.insert=0,e===z?(s(t,!0),0===t.strm.avail_out?_e:we):t.last_lit&&(s(t,!1),0===t.strm.avail_out)?ye:be}function y(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=S[t.level].max_lazy,t.good_match=S[t.level].good_length,t.nice_match=S[t.level].nice_length,t.max_chain_length=S[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=se-1,t.match_available=0,t.ins_h=0}function b(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=J,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new T.Buf16(2*oe),this.dyn_dtree=new T.Buf16(2*(2*re+1)),this.bl_tree=new T.Buf16(2*(2*ie+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new T.Buf16(ae+1),this.heap=new T.Buf16(2*ne+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new T.Buf16(2*ne+1),o(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function _(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=K,e=t.state,e.pending=0,e.pending_out=0,0>e.wrap&&(e.wrap=-e.wrap),e.status=e.wrap?le:me,t.adler=2===e.wrap?0:1,e.last_flush=D,O._tr_init(e),F):r(t,U)}function w(t){var e=_(t);return e===F&&y(t.state),e}function E(t,e){return t&&t.state?2!==t.state.wrap?U:(t.state.gzhead=e,F):U}function I(t,e,n,i,o,a){if(!t)return U;var s=1;if(e===Z&&(e=6),0>i?(s=0,i=-i):i>15&&(s=2,i-=16),1>o||o>G||n!==J||8>i||i>15||0>e||e>9||0>a||a>W)return r(t,U);8===i&&(i=9);var u=new b;return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=i,u.w_size=1<>1,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=a,u.method=n,w(t)}function A(t,e){return I(t,e,J,Q,$,q)}function x(t,e){var n,s,c,l;if(!t||!t.state||e>j||0>e)return t?r(t,U):U;if(s=t.state,!t.output||!t.input&&0!==t.avail_in||s.status===ve&&e!==z)return r(t,0===t.avail_out?V:U);if(s.strm=t,n=s.last_flush,s.last_flush=e,s.status===le)if(2===s.wrap)t.adler=0,u(s,31),u(s,139),u(s,8),s.gzhead?(u(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),u(s,255&s.gzhead.time),u(s,255&s.gzhead.time>>8),u(s,255&s.gzhead.time>>16),u(s,255&s.gzhead.time>>24),u(s,9===s.level?2:s.strategy>=X||2>s.level?4:0),u(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(u(s,255&s.gzhead.extra.length),u(s,255&s.gzhead.extra.length>>8)),s.gzhead.hcrc&&(t.adler=R(t.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=de):(u(s,0),u(s,0),u(s,0),u(s,0),u(s,0),u(s,9===s.level?2:s.strategy>=X||2>s.level?4:0),u(s,Ee),s.status=me);else{var d=J+(s.w_bits-8<<4)<<8,h=-1;h=s.strategy>=X||2>s.level?0:6>s.level?1:6===s.level?2:3,d|=h<<6,0!==s.strstart&&(d|=ce),d+=31-d%31,s.status=me,f(s,d),0!==s.strstart&&(f(s,t.adler>>>16),f(s,65535&t.adler)),t.adler=1}if(s.status===de)if(s.gzhead.extra){for(c=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending!==s.pending_buf_size));)u(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=he)}else s.status=he;if(s.status===he)if(s.gzhead.name){c=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexc&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),0===l&&(s.gzindex=0,s.status=pe)}else s.status=pe;if(s.status===pe)if(s.gzhead.comment){c=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>c&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),a(t),c=s.pending,s.pending===s.pending_buf_size)){l=1;break}l=s.gzindexc&&(t.adler=R(t.adler,s.pending_buf,s.pending-c,c)),0===l&&(s.status=ge)}else s.status=ge;if(s.status===ge&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&a(t),s.pending+2<=s.pending_buf_size&&(u(s,255&t.adler),u(s,255&t.adler>>8),t.adler=0,s.status=me)):s.status=me),0!==s.pending){if(a(t),0===t.avail_out)return s.last_flush=-1,F}else if(0===t.avail_in&&i(e)<=i(n)&&e!==z)return r(t,V);if(s.status===ve&&0!==t.avail_in)return r(t,V);if(0!==t.avail_in||0!==s.lookahead||e!==D&&s.status!==ve){var p=s.strategy===X?v(s,e):s.strategy===H?m(s,e):S[s.level].func(s,e);if((p===_e||p===we)&&(s.status=ve),p===ye||p===_e)return 0===t.avail_out&&(s.last_flush=-1),F;if(p===be&&(e===L?O._tr_align(s):e!==j&&(O._tr_stored_block(s,0,0,!1),e===B&&(o(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),a(t),0===t.avail_out))return s.last_flush=-1,F}return e!==z?F:0>=s.wrap?M:(2===s.wrap?(u(s,255&t.adler),u(s,255&t.adler>>8),u(s,255&t.adler>>16),u(s,255&t.adler>>24),u(s,255&t.total_in),u(s,255&t.total_in>>8),u(s,255&t.total_in>>16),u(s,255&t.total_in>>24)):(f(s,t.adler>>>16),f(s,65535&t.adler)),a(t),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?F:M)}function k(t){var e;return t&&t.state?(e=t.state.status,e!==le&&e!==de&&e!==he&&e!==pe&&e!==ge&&e!==me&&e!==ve?r(t,U):(t.state=null,e===me?r(t,P):F)):U}var S,T=t("../utils/common"),O=t("./trees"),C=t("./adler32"),R=t("./crc32"),N=t("./messages"),D=0,L=1,B=3,z=4,j=5,F=0,M=1,U=-2,P=-3,V=-5,Z=-1,Y=1,X=2,H=3,W=4,q=0,K=2,J=8,G=9,Q=15,$=8,te=29,ee=256,ne=ee+1+te,re=30,ie=19,oe=2*ne+1,ae=15,se=3,ue=258,fe=ue+se+1,ce=32,le=42,de=69,he=73,pe=91,ge=103,me=113,ve=666,ye=1,be=2,_e=3,we=4,Ee=3,Ie=function(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i};S=[new Ie(0,0,0,0,h),new Ie(4,4,8,4,p),new Ie(4,5,16,8,p),new Ie(4,6,32,32,p),new Ie(4,4,16,16,g),new Ie(8,16,32,32,g),new Ie(8,16,128,128,g),new Ie(8,32,128,256,g),new Ie(32,128,258,1024,g),new Ie(32,258,258,4096,g)],n.deflateInit=A,n.deflateInit2=I,n.deflateReset=w,n.deflateResetKeep=_,n.deflateSetHeader=E,n.deflate=x,n.deflateEnd=k,n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":31,"./adler32":33,"./crc32":35,"./messages":41,"./trees":42}],37:[function(t,e){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=n},{}],38:[function(t,e){"use strict";var n=30,r=12;e.exports=function(t,e){var i,o,a,s,u,f,c,l,d,h,p,g,m,v,y,b,_,w,E,I,A,x,k,S,T;i=t.state,o=t.next_in,S=t.input,a=o+(t.avail_in-5),s=t.next_out,T=t.output,u=s-(e-t.avail_out),f=s+(t.avail_out-257),c=i.dmax,l=i.wsize,d=i.whave,h=i.wnext,p=i.window,g=i.hold,m=i.bits,v=i.lencode,y=i.distcode,b=(1<m&&(g+=S[o++]<>>24,g>>>=E,m-=E,E=255&w>>>16,0===E)T[s++]=65535&w;else{if(!(16&E)){if(0===(64&E)){w=v[(65535&w)+(g&(1<m&&(g+=S[o++]<>>=E,m-=E),15>m&&(g+=S[o++]<>>24,g>>>=E,m-=E,E=255&w>>>16,!(16&E)){if(0===(64&E)){w=y[(65535&w)+(g&(1<m&&(g+=S[o++]<m&&(g+=S[o++]<c){t.msg="invalid distance too far back",i.mode=n;break t}if(g>>>=E,m-=E,E=s-u,A>E){if(E=A-E,E>d&&i.sane){t.msg="invalid distance too far back",i.mode=n;break t}if(x=0,k=p,0===h){if(x+=l-E,I>E){I-=E;do T[s++]=p[x++];while(--E);x=s-A,k=T}}else if(E>h){if(x+=l+h-E,E-=h,I>E){I-=E;do T[s++]=p[x++];while(--E);if(x=0,I>h){E=h,I-=E;do T[s++]=p[x++];while(--E);x=s-A,k=T}}}else if(x+=h-E,I>E){I-=E;do T[s++]=p[x++];while(--E);x=s-A,k=T}for(;I>2;)T[s++]=k[x++],T[s++]=k[x++],T[s++]=k[x++],I-=3;I&&(T[s++]=k[x++],I>1&&(T[s++]=k[x++]))}else{x=s-A;do T[s++]=T[x++],T[s++]=T[x++],T[s++]=T[x++],I-=3;while(I>2);I&&(T[s++]=T[x++],I>1&&(T[s++]=T[x++]))}break}}break}}while(a>o&&f>s);I=m>>3,o-=I,m-=I<<3,g&=(1<o?5+(a-o):5-(o-a),t.avail_out=f>s?257+(f-s):257-(s-f),i.hold=g,i.bits=m}},{}],39:[function(t,e,n){"use strict";function r(t){return(255&t>>>24)+(65280&t>>>8)+((65280&t)<<8)+((255&t)<<24)}function i(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=z,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new v.Buf32(pe),e.distcode=e.distdyn=new v.Buf32(ge),e.sane=1,e.back=-1,T):R}function a(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):R}function s(t,e){var n,r;return t&&t.state?(r=t.state,0>e?(n=0,e=-e):(n=(e>>4)+1,48>e&&(e&=15)),e&&(8>e||e>15)?R:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,a(t))):R}function u(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=s(t,e),n!==T&&(t.state=null),n):R}function f(t){return u(t,ve)}function c(t){if(ye){var e;for(g=new v.Buf32(512),m=new v.Buf32(32),e=0;144>e;)t.lens[e++]=8;for(;256>e;)t.lens[e++]=9;for(;280>e;)t.lens[e++]=7;for(;288>e;)t.lens[e++]=8;for(w(I,t.lens,0,288,g,0,t.work,{bits:9}),e=0;32>e;)t.lens[e++]=5;w(A,t.lens,0,32,m,0,t.work,{bits:5}),ye=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function l(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<=o.wsize?(v.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),v.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(v.arraySet(o.window,e,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveh;){if(0===u)break t;u--,d+=i[a++]<>>8,n.check=b(n.check,Se,2,0),d=0,h=0,n.mode=j;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",n.mode=le;break}if((15&d)!==B){t.msg="unknown compression method",n.mode=le;break}if(d>>>=4,h-=4,Ee=(15&d)+8,0===n.wbits)n.wbits=Ee;else if(Ee>n.wbits){t.msg="invalid window size",n.mode=le;break}n.dmax=1<h;){if(0===u)break t;u--,d+=i[a++]<>8),512&n.flags&&(Se[0]=255&d,Se[1]=255&d>>>8,n.check=b(n.check,Se,2,0)),d=0,h=0,n.mode=F;case F:for(;32>h;){if(0===u)break t;u--,d+=i[a++]<>>8,Se[2]=255&d>>>16,Se[3]=255&d>>>24,n.check=b(n.check,Se,4,0)),d=0,h=0,n.mode=M;case M:for(;16>h;){if(0===u)break t;u--,d+=i[a++]<>8),512&n.flags&&(Se[0]=255&d,Se[1]=255&d>>>8,n.check=b(n.check,Se,2,0)),d=0,h=0,n.mode=U;case U:if(1024&n.flags){for(;16>h;){if(0===u)break t;u--,d+=i[a++]<>>8,n.check=b(n.check,Se,2,0)),d=0,h=0}else n.head&&(n.head.extra=null);n.mode=P;case P:if(1024&n.flags&&(m=n.length,m>u&&(m=u),m&&(n.head&&(Ee=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),v.arraySet(n.head.extra,i,a,m,Ee)),512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,n.length-=m),n.length))break t;n.length=0,n.mode=V;case V:if(2048&n.flags){if(0===u)break t;m=0;do Ee=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.name+=String.fromCharCode(Ee));while(Ee&&u>m);if(512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,Ee)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=Z; +case Z:if(4096&n.flags){if(0===u)break t;m=0;do Ee=i[a+m++],n.head&&Ee&&65536>n.length&&(n.head.comment+=String.fromCharCode(Ee));while(Ee&&u>m);if(512&n.flags&&(n.check=b(n.check,i,m,a)),u-=m,a+=m,Ee)break t}else n.head&&(n.head.comment=null);n.mode=Y;case Y:if(512&n.flags){for(;16>h;){if(0===u)break t;u--,d+=i[a++]<>9,n.head.done=!0),t.adler=n.check=0,n.mode=W;break;case X:for(;32>h;){if(0===u)break t;u--,d+=i[a++]<>>=7&h,h-=7&h,n.mode=ue;break}for(;3>h;){if(0===u)break t;u--,d+=i[a++]<>>=1,h-=1,3&d){case 0:n.mode=K;break;case 1:if(c(n),n.mode=ee,e===S){d>>>=2,h-=2;break t}break;case 2:n.mode=Q;break;case 3:t.msg="invalid block type",n.mode=le}d>>>=2,h-=2;break;case K:for(d>>>=7&h,h-=7&h;32>h;){if(0===u)break t;u--,d+=i[a++]<>>16)){t.msg="invalid stored block lengths",n.mode=le;break}if(n.length=65535&d,d=0,h=0,n.mode=J,e===S)break t;case J:n.mode=G;case G:if(m=n.length){if(m>u&&(m=u),m>f&&(m=f),0===m)break t;v.arraySet(o,i,a,m,s),u-=m,a+=m,f-=m,s+=m,n.length-=m;break}n.mode=W;break;case Q:for(;14>h;){if(0===u)break t;u--,d+=i[a++]<>>=5,h-=5,n.ndist=(31&d)+1,d>>>=5,h-=5,n.ncode=(15&d)+4,d>>>=4,h-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=le;break}n.have=0,n.mode=$;case $:for(;n.haveh;){if(0===u)break t;u--,d+=i[a++]<>>=3,h-=3}for(;19>n.have;)n.lens[Te[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,Ae={bits:n.lenbits},Ie=w(E,n.lens,0,19,n.lencode,0,n.work,Ae),n.lenbits=Ae.bits,Ie){t.msg="invalid code lengths set",n.mode=le;break}n.have=0,n.mode=te;case te:for(;n.have>>24,ve=255&ke>>>16,ye=65535&ke,!(h>=me);){if(0===u)break t;u--,d+=i[a++]<ye)d>>>=me,h-=me,n.lens[n.have++]=ye;else{if(16===ye){for(xe=me+2;xe>h;){if(0===u)break t;u--,d+=i[a++]<>>=me,h-=me,0===n.have){t.msg="invalid bit length repeat",n.mode=le;break}Ee=n.lens[n.have-1],m=3+(3&d),d>>>=2,h-=2}else if(17===ye){for(xe=me+3;xe>h;){if(0===u)break t;u--,d+=i[a++]<>>=me,h-=me,Ee=0,m=3+(7&d),d>>>=3,h-=3}else{for(xe=me+7;xe>h;){if(0===u)break t;u--,d+=i[a++]<>>=me,h-=me,Ee=0,m=11+(127&d),d>>>=7,h-=7}if(n.have+m>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=le;break}for(;m--;)n.lens[n.have++]=Ee}}if(n.mode===le)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=le;break}if(n.lenbits=9,Ae={bits:n.lenbits},Ie=w(I,n.lens,0,n.nlen,n.lencode,0,n.work,Ae),n.lenbits=Ae.bits,Ie){t.msg="invalid literal/lengths set",n.mode=le;break}if(n.distbits=6,n.distcode=n.distdyn,Ae={bits:n.distbits},Ie=w(A,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,Ae),n.distbits=Ae.bits,Ie){t.msg="invalid distances set",n.mode=le;break}if(n.mode=ee,e===S)break t;case ee:n.mode=ne;case ne:if(u>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=a,t.avail_in=u,n.hold=d,n.bits=h,_(t,g),s=t.next_out,o=t.output,f=t.avail_out,a=t.next_in,i=t.input,u=t.avail_in,d=n.hold,h=n.bits,n.mode===W&&(n.back=-1);break}for(n.back=0;ke=n.lencode[d&(1<>>24,ve=255&ke>>>16,ye=65535&ke,!(h>=me);){if(0===u)break t;u--,d+=i[a++]<>be)],me=ke>>>24,ve=255&ke>>>16,ye=65535&ke,!(h>=be+me);){if(0===u)break t;u--,d+=i[a++]<>>=be,h-=be,n.back+=be}if(d>>>=me,h-=me,n.back+=me,n.length=ye,0===ve){n.mode=se;break}if(32&ve){n.back=-1,n.mode=W;break}if(64&ve){t.msg="invalid literal/length code",n.mode=le;break}n.extra=15&ve,n.mode=re;case re:if(n.extra){for(xe=n.extra;xe>h;){if(0===u)break t;u--,d+=i[a++]<>>=n.extra,h-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ie;case ie:for(;ke=n.distcode[d&(1<>>24,ve=255&ke>>>16,ye=65535&ke,!(h>=me);){if(0===u)break t;u--,d+=i[a++]<>be)],me=ke>>>24,ve=255&ke>>>16,ye=65535&ke,!(h>=be+me);){if(0===u)break t;u--,d+=i[a++]<>>=be,h-=be,n.back+=be}if(d>>>=me,h-=me,n.back+=me,64&ve){t.msg="invalid distance code",n.mode=le;break}n.offset=ye,n.extra=15&ve,n.mode=oe;case oe:if(n.extra){for(xe=n.extra;xe>h;){if(0===u)break t;u--,d+=i[a++]<>>=n.extra,h-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=le;break}n.mode=ae;case ae:if(0===f)break t;if(m=g-f,n.offset>m){if(m=n.offset-m,m>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=le;break}m>n.wnext?(m-=n.wnext,pe=n.wsize-m):pe=n.wnext-m,m>n.length&&(m=n.length),ge=n.window}else ge=o,pe=s-n.offset,m=n.length;m>f&&(m=f),f-=m,n.length-=m;do o[s++]=ge[pe++];while(--m);0===n.length&&(n.mode=ne);break;case se:if(0===f)break t;o[s++]=n.length,f--,n.mode=ne;break;case ue:if(n.wrap){for(;32>h;){if(0===u)break t;u--,d|=i[a++]<h;){if(0===u)break t;u--,d+=i[a++]<n.mode&&(ue>n.mode||e!==x))&&l(t,t.output,t.next_out,g-t.avail_out)?(n.mode=de,D):(p-=t.avail_in,g-=t.avail_out,t.total_in+=p,t.total_out+=g,n.total+=g,n.wrap&&g&&(t.adler=n.check=n.flags?b(n.check,o,g,t.next_out-g):y(n.check,o,g,t.next_out-g)),t.data_type=n.bits+(n.last?64:0)+(n.mode===W?128:0)+(n.mode===ee||n.mode===J?256:0),(0===p&&0===g||e===x)&&Ie===T&&(Ie=L),Ie)}function h(t){if(!t||!t.state)return R;var e=t.state;return e.window&&(e.window=null),t.state=null,T}function p(t,e){var n;return t&&t.state?(n=t.state,0===(2&n.wrap)?R:(n.head=e,e.done=!1,T)):R}var g,m,v=t("../utils/common"),y=t("./adler32"),b=t("./crc32"),_=t("./inffast"),w=t("./inftrees"),E=0,I=1,A=2,x=4,k=5,S=6,T=0,O=1,C=2,R=-2,N=-3,D=-4,L=-5,B=8,z=1,j=2,F=3,M=4,U=5,P=6,V=7,Z=8,Y=9,X=10,H=11,W=12,q=13,K=14,J=15,G=16,Q=17,$=18,te=19,ee=20,ne=21,re=22,ie=23,oe=24,ae=25,se=26,ue=27,fe=28,ce=29,le=30,de=31,he=32,pe=852,ge=592,me=15,ve=me,ye=!0;n.inflateReset=a,n.inflateReset2=s,n.inflateResetKeep=o,n.inflateInit=f,n.inflateInit2=u,n.inflate=d,n.inflateEnd=h,n.inflateGetHeader=p,n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":31,"./adler32":33,"./crc32":35,"./inffast":38,"./inftrees":40}],40:[function(t,e){"use strict";var n=t("../utils/common"),r=15,i=852,o=592,a=0,s=1,u=2,f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],c=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,h,p,g,m,v,y){var b,_,w,E,I,A,x,k,S,T=y.bits,O=0,C=0,R=0,N=0,D=0,L=0,B=0,z=0,j=0,F=0,M=null,U=0,P=new n.Buf16(r+1),V=new n.Buf16(r+1),Z=null,Y=0;for(O=0;r>=O;O++)P[O]=0;for(C=0;p>C;C++)P[e[h+C]]++;for(D=T,N=r;N>=1&&0===P[N];N--);if(D>N&&(D=N),0===N)return g[m++]=20971520,g[m++]=20971520,y.bits=1,0;for(R=1;N>R&&0===P[R];R++);for(R>D&&(D=R),z=1,O=1;r>=O;O++)if(z<<=1,z-=P[O],0>z)return-1;if(z>0&&(t===a||1!==N))return-1;for(V[1]=0,O=1;r>O;O++)V[O+1]=V[O]+P[O];for(C=0;p>C;C++)0!==e[h+C]&&(v[V[e[h+C]]++]=C);switch(t){case a:M=Z=v,A=19;break;case s:M=f,U-=257,Z=c,Y-=257,A=256;break;default:M=l,Z=d,A=-1}if(F=0,C=0,O=R,I=m,L=D,B=0,w=-1,j=1<i||t===u&&j>o)return 1;for(var X=0;;){X++,x=O-B,A>v[C]?(k=0,S=v[C]):v[C]>A?(k=Z[Y+v[C]],S=M[U+v[C]]):(k=96,S=0),b=1<>B)+_]=0|(x<<24|k<<16|S);while(0!==_);for(b=1<>=1;if(0!==b?(F&=b-1,F+=b):F=0,C++,0===--P[O]){if(O===N)break;O=e[h+v[C]]}if(O>D&&(F&E)!==w){for(0===B&&(B=D),I+=R,L=O-B,z=1<L+B&&(z-=P[L+B],!(0>=z));)L++,z<<=1;if(j+=1<i||t===u&&j>o)return 1;w=F&E,g[w]=0|(D<<24|L<<16|I-m)}}return 0!==F&&(g[I+F]=0|(O-B<<24|64<<16)),y.bits=D,0}},{"../utils/common":31}],41:[function(t,e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],42:[function(t,e,n){"use strict";function r(t){for(var e=t.length;--e>=0;)t[e]=0}function i(t){return 256>t?ae[t]:ae[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=255&e>>>8}function a(t,e,n){t.bi_valid>W-n?(t.bi_buf|=65535&e<>W-t.bi_valid,t.bi_valid+=n-W):(t.bi_buf|=65535&e<>>=1,n<<=1;while(--e>0);return n>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function c(t,e){var n,r,i,o,a,s,u=e.dyn_tree,f=e.max_code,c=e.stat_desc.static_tree,l=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;H>=o;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;X>n;n++)r=t.heap[n],o=u[2*u[2*r+1]+1]+1,o>p&&(o=p,g++),u[2*r+1]=o,r>f||(t.bl_count[o]++,a=0,r>=h&&(a=d[r-h]),s=u[2*r],t.opt_len+=s*(o+a),l&&(t.static_len+=s*(c[2*r+1]+a)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)i=t.heap[--n],i>f||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}function l(t,e,n){var r,i,o=Array(H+1),a=0;for(r=1;H>=r;r++)o[r]=a=a+n[r-1]<<1;for(i=0;e>=i;i++){var s=t[2*i+1];0!==s&&(t[2*i]=u(o[s]++,s))}}function d(){var t,e,n,r,i,o=Array(H+1);for(n=0,r=0;U-1>r;r++)for(ue[r]=n,t=0;1<<$[r]>t;t++)se[n++]=r;for(se[n-1]=r,i=0,r=0;16>r;r++)for(fe[r]=i,t=0;1<t;t++)ae[i++]=r;for(i>>=7;Z>r;r++)for(fe[r]=i<<7,t=0;1<t;t++)ae[256+i++]=r;for(e=0;H>=e;e++)o[e]=0;for(t=0;143>=t;)ie[2*t+1]=8,t++,o[8]++;for(;255>=t;)ie[2*t+1]=9,t++,o[9]++;for(;279>=t;)ie[2*t+1]=7,t++,o[7]++;for(;287>=t;)ie[2*t+1]=8,t++,o[8]++;for(l(ie,V+1,o),t=0;Z>t;t++)oe[2*t+1]=5,oe[2*t]=u(t,5);ce=new he(ie,$,P+1,V,H),le=new he(oe,te,0,Z,H),de=new he(Array(0),ee,0,Y,q)}function h(t){var e;for(e=0;V>e;e++)t.dyn_ltree[2*e]=0;for(e=0;Z>e;e++)t.dyn_dtree[2*e]=0;for(e=0;Y>e;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*K]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function p(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function g(t,e,n,r){p(t),r&&(o(t,n),o(t,~n)),C.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function m(t,e,n,r){var i=2*e,o=2*n;return t[i]=i&&(t.heap_len>i&&m(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!m(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r}function y(t,e,n){var r,o,u,f,c=0;if(0!==t.last_lit)do r=t.pending_buf[t.d_buf+2*c]<<8|t.pending_buf[t.d_buf+2*c+1],o=t.pending_buf[t.l_buf+c],c++,0===r?s(t,o,e):(u=se[o],s(t,u+P+1,e),f=$[u],0!==f&&(o-=ue[u],a(t,o,f)),r--,u=i(r),s(t,u,n),f=te[u],0!==f&&(r-=fe[u],a(t,r,f)));while(t.last_lit>c);s(t,K,e)}function b(t,e){var n,r,i,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,u=e.stat_desc.elems,f=-1;for(t.heap_len=0,t.heap_max=X,n=0;u>n;n++)0!==o[2*n]?(t.heap[++t.heap_len]=f=n,t.depth[n]=0):o[2*n+1]=0;for(;2>t.heap_len;)i=t.heap[++t.heap_len]=2>f?++f:0,o[2*i]=1,t.depth[i]=0,t.opt_len--,s&&(t.static_len-=a[2*i+1]);for(e.max_code=f,n=t.heap_len>>1;n>=1;n--)v(t,o,n);i=u;do n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],v(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=r,o[2*i]=o[2*n]+o[2*r],t.depth[i]=(t.depth[n]>=t.depth[r]?t.depth[n]:t.depth[r])+1,o[2*n+1]=o[2*r+1]=i,t.heap[1]=i++,v(t,o,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],c(t,e),l(o,f,t.bl_count)}function _(t,e,n){var r,i,o=-1,a=e[1],s=0,u=7,f=4;for(0===a&&(u=138,f=3),e[2*(n+1)+1]=65535,r=0;n>=r;r++)i=a,a=e[2*(r+1)+1],u>++s&&i===a||(f>s?t.bl_tree[2*i]+=s:0!==i?(i!==o&&t.bl_tree[2*i]++,t.bl_tree[2*J]++):10>=s?t.bl_tree[2*G]++:t.bl_tree[2*Q]++,s=0,o=i,0===a?(u=138,f=3):i===a?(u=6,f=3):(u=7,f=4))}function w(t,e,n){var r,i,o=-1,u=e[1],f=0,c=7,l=4;for(0===u&&(c=138,l=3),r=0;n>=r;r++)if(i=u,u=e[2*(r+1)+1],!(c>++f&&i===u)){if(l>f){do s(t,i,t.bl_tree);while(0!==--f)}else 0!==i?(i!==o&&(s(t,i,t.bl_tree),f--),s(t,J,t.bl_tree),a(t,f-3,2)):10>=f?(s(t,G,t.bl_tree),a(t,f-3,3)):(s(t,Q,t.bl_tree),a(t,f-11,7));f=0,o=i,0===u?(c=138,l=3):i===u?(c=6,l=3):(c=7,l=4)}}function E(t){var e;for(_(t,t.dyn_ltree,t.l_desc.max_code),_(t,t.dyn_dtree,t.d_desc.max_code),b(t,t.bl_desc),e=Y-1;e>=3&&0===t.bl_tree[2*ne[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function I(t,e,n,r){var i;for(a(t,e-257,5),a(t,n-1,5),a(t,r-4,4),i=0;r>i;i++)a(t,t.bl_tree[2*ne[i]+1],3);w(t,t.dyn_ltree,e-1),w(t,t.dyn_dtree,n-1)}function A(t){var e,n=4093624447;for(e=0;31>=e;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return N;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return D;for(e=32;P>e;e++)if(0!==t.dyn_ltree[2*e])return D;return N}function x(t){ge||(d(),ge=!0),t.l_desc=new pe(t.dyn_ltree,ce),t.d_desc=new pe(t.dyn_dtree,le),t.bl_desc=new pe(t.bl_tree,de),t.bi_buf=0,t.bi_valid=0,h(t)}function k(t,e,n,r){a(t,(B<<1)+(r?1:0),3),g(t,e,n,!0)}function S(t){a(t,z<<1,3),s(t,K,ie),f(t)}function T(t,e,n,r){var i,o,s=0;t.level>0?(t.strm.data_type===L&&(t.strm.data_type=A(t)),b(t,t.l_desc),b(t,t.d_desc),s=E(t),i=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,i>=o&&(i=o)):i=o=n+5,i>=n+4&&-1!==e?k(t,e,n,r):t.strategy===R||o===i?(a(t,(z<<1)+(r?1:0),3),y(t,ie,oe)):(a(t,(j<<1)+(r?1:0),3),I(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),y(t,t.dyn_ltree,t.dyn_dtree)),h(t),r&&p(t)}function O(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=255&e>>>8,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(se[n]+P+1)]++,t.dyn_dtree[2*i(e)]++),t.last_lit===t.lit_bufsize-1}var C=t("../utils/common"),R=4,N=0,D=1,L=2,B=0,z=1,j=2,F=3,M=258,U=29,P=256,V=P+1+U,Z=30,Y=19,X=2*V+1,H=15,W=16,q=7,K=256,J=16,G=17,Q=18,$=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],te=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ee=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],re=512,ie=Array(2*(V+2));r(ie);var oe=Array(2*Z);r(oe);var ae=Array(re);r(ae);var se=Array(M-F+1);r(se);var ue=Array(U);r(ue);var fe=Array(Z);r(fe);var ce,le,de,he=function(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length},pe=function(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e},ge=!1;n._tr_init=x,n._tr_stored_block=k,n._tr_flush_block=T,n._tr_tally=O,n._tr_align=S},{"../utils/common":31}],43:[function(t,e){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=n},{}],44:[function(t,e){var n="READ",r="WRITE",i="CREATE",o="EXCLUSIVE",a="TRUNCATE",s="APPEND",u="CREATE",f="REPLACE";e.exports={FILE_SYSTEM_NAME:"local",FILE_STORE_NAME:"files",IDB_RO:"readonly",IDB_RW:"readwrite",WSQL_VERSION:"1",WSQL_SIZE:5242880,WSQL_DESC:"FileSystem Storage",MODE_FILE:"FILE",MODE_DIRECTORY:"DIRECTORY",MODE_SYMBOLIC_LINK:"SYMLINK",MODE_META:"META",SYMLOOP_MAX:10,BINARY_MIME_TYPE:"application/octet-stream",JSON_MIME_TYPE:"application/json",ROOT_DIRECTORY_NAME:"/",FS_FORMAT:"FORMAT",FS_NOCTIME:"NOCTIME",FS_NOMTIME:"NOMTIME",O_READ:n,O_WRITE:r,O_CREATE:i,O_EXCLUSIVE:o,O_TRUNCATE:a,O_APPEND:s,O_FLAGS:{r:[n],"r+":[n,r],w:[r,i,a],"w+":[r,n,i,a],wx:[r,i,o,a],"wx+":[r,n,i,o,a],a:[r,i,s],"a+":[r,n,i,s],ax:[r,i,o,s],"ax+":[r,n,i,o,s]},XATTR_CREATE:u,XATTR_REPLACE:f,FS_READY:"READY",FS_PENDING:"PENDING",FS_ERROR:"ERROR",SUPER_NODE_ID:"00000000-0000-0000-0000-000000000000",STDIN:0,STDOUT:1,STDERR:2,FIRST_DESCRIPTOR:3,ENVIRONMENT:{TMP:"/tmp",PATH:""}}},{}],45:[function(t,e){var n=t("./constants.js").MODE_FILE;e.exports=function(t,e){this.id=t,this.type=e||n}},{"./constants.js":44}],46:[function(t,e){(function(t){function n(t){return t.toString("utf8")}function r(e){return new t(e,"utf8")}e.exports={encode:r,decode:n}}).call(this,t("buffer").Buffer)},{buffer:6}],47:[function(t,e){var n={};["-1:UNKNOWN:unknown error","0:OK:success","1:EOF:end of file","2:EADDRINFO:getaddrinfo error","3:EACCES:permission denied","4:EAGAIN:resource temporarily unavailable","5:EADDRINUSE:address already in use","6:EADDRNOTAVAIL:address not available","7:EAFNOSUPPORT:address family not supported","8:EALREADY:connection already in progress","9:EBADF:bad file descriptor","10:EBUSY:resource busy or locked","11:ECONNABORTED:software caused connection abort","12:ECONNREFUSED:connection refused","13:ECONNRESET:connection reset by peer","14:EDESTADDRREQ:destination address required","15:EFAULT:bad address in system call argument","16:EHOSTUNREACH:host is unreachable","17:EINTR:interrupted system call","18:EINVAL:invalid argument","19:EISCONN:socket is already connected","20:EMFILE:too many open files","21:EMSGSIZE:message too long","22:ENETDOWN:network is down","23:ENETUNREACH:network is unreachable","24:ENFILE:file table overflow","25:ENOBUFS:no buffer space available","26:ENOMEM:not enough memory","27:ENOTDIR:not a directory","28:EISDIR:illegal operation on a directory","29:ENONET:machine is not on the network","31:ENOTCONN:socket is not connected","32:ENOTSOCK:socket operation on non-socket","33:ENOTSUP:operation not supported on socket","34:ENOENT:no such file or directory","35:ENOSYS:function not implemented","36:EPIPE:broken pipe","37:EPROTO:protocol error","38:EPROTONOSUPPORT:protocol not supported","39:EPROTOTYPE:protocol wrong type for socket","40:ETIMEDOUT:connection timed out","41:ECHARSET:invalid Unicode character","42:EAIFAMNOSUPPORT:address family for hostname not supported","44:EAISERVICE:servname not supported for ai_socktype","45:EAISOCKTYPE:ai_socktype not supported","46:ESHUTDOWN:cannot send after transport endpoint shutdown","47:EEXIST:file already exists","48:ESRCH:no such process","49:ENAMETOOLONG:name too long","50:EPERM:operation not permitted","51:ELOOP:too many symbolic links encountered","52:EXDEV:cross-device link not permitted","53:ENOTEMPTY:directory not empty","54:ENOSPC:no space left on device","55:EIO:i/o error","56:EROFS:read-only file system","57:ENODEV:no such device","58:ESPIPE:invalid seek","59:ECANCELED:operation canceled","1000:ENOTMOUNTED:not mounted","1001:EFILESYSTEMERROR:missing super node, use 'FORMAT' flag to format filesystem.","1002:ENOATTR:attribute does not exist"].forEach(function(t){function e(t){this.message=t||o}t=t.split(":");var r=t[0],i=t[1],o=t[2],a=e.prototype=Error();a.errno=r,a.code=i,a.constructor=e,n[i]=n[r]=e}),e.exports=n},{}],48:[function(t,e){(function(n){function r(t){return function(e,n){e?t(e):t(null,n)}}function i(t,e,n,r,i){function o(n){t.changes.push({event:"change",path:e}),i(n)}var a=t.flags;he(a).contains(je)&&delete r.ctime,he(a).contains(ze)&&delete r.mtime;var s=!1;r.ctime&&(n.ctime=r.ctime,n.atime=r.ctime,s=!0),r.atime&&(n.atime=r.atime,s=!0),r.mtime&&(n.mtime=r.mtime,s=!0),s?t.put(n.id,n,o):o()}function o(t,e,n,r){function o(n,i){n?r(n):i.mode!==Ee?r(new Me.ENOTDIR("a component of the path prefix is not a directory")):(l=i,a(t,e,s))}function s(e,n){!e&&n?r(new Me.EEXIST("path name already exists")):!e||e instanceof Me.ENOENT?t.get(l.data,u):r(e)}function u(e,i){e?r(e):(d=i,h=new Ze(void 0,n),h.nlinks+=1,t.put(h.id,h,c))}function f(e){if(e)r(e);else{var n=Date.now();i(t,g,h,{mtime:n,ctime:n},r)}}function c(e){e?r(e):(d[p]=new Ue(h.id,n),t.put(l.data,d,f))}if(n!==Ee&&n!==we)return r(new Me.EINVAL("mode must be a directory or file"));e=ge(e);var l,d,h,p=ve(e),g=me(e);a(t,g,o)}function a(t,e,n){function r(e,r){e?n(e):r&&r.mode===Ae&&r.rnode?t.get(r.rnode,i):n(new Me.EFILESYSTEMERROR)}function i(t,e){t?n(t):e?n(null,e):n(new Me.ENOENT)}function o(e,r){e?n(e):r.mode===Ee&&r.data?t.get(r.data,s):n(new Me.ENOTDIR("a component of the path prefix is not a directory"))}function s(e,r){if(e)n(e);else if(he(r).has(c)){var i=r[c].id;t.get(i,u)}else n(new Me.ENOENT)}function u(t,e){t?n(t):e.mode==Ie?(d++,d>Se?n(new Me.ELOOP):f(e.data)):n(null,e)}function f(e){e=ge(e),l=me(e),c=ve(e),xe==c?t.get(ke,r):a(t,l,o)}if(e=ge(e),!e)return n(new Me.ENOENT("path is an empty string"));var c=ve(e),l=me(e),d=0;xe==c?t.get(ke,r):a(t,l,o)}function s(t,e,n,r,o,s){function u(e,a){function u(e){e?s(e):i(t,f,a,{ctime:Date.now()},s)}a?a.xattrs[n]:null,e?s(e):o===Le&&a.xattrs.hasOwnProperty(n)?s(new Me.EEXIST("attribute already exists")):o!==Be||a.xattrs.hasOwnProperty(n)?(a.xattrs[n]=r,t.put(a.id,a,u)):s(new Me.ENOATTR)}var f;"string"==typeof e?(f=e,a(t,e,u)):"object"==typeof e&&"string"==typeof e.id?(f=e.path,t.get(e.id,u)):s(new Me.EINVAL("path or file descriptor of wrong type"))}function u(t,e){function n(n,i){!n&&i?e(new Me.EEXIST):!n||n instanceof Me.ENOENT?(o=new Ve,t.put(o.id,o,r)):e(n)}function r(n){n?e(n):(a=new Ze(o.rnode,Ee),a.nlinks+=1,t.put(a.id,a,i))}function i(n){n?e(n):(s={},t.put(a.data,s,e))}var o,a,s;t.get(ke,n)}function f(t,e,n){function r(e,r){!e&&r?n(new Me.EEXIST):!e||e instanceof Me.ENOENT?a(t,m,o):n(e)}function o(e,r){e?n(e):(h=r,t.get(h.data,s))}function s(e,r){e?n(e):(p=r,l=new Ze(void 0,Ee),l.nlinks+=1,t.put(l.id,l,u))}function u(e){e?n(e):(d={},t.put(l.data,d,c))}function f(e){if(e)n(e);else{var r=Date.now();i(t,m,h,{mtime:r,ctime:r},n)}}function c(e){e?n(e):(p[g]=new Ue(l.id,Ee),t.put(h.data,p,f))}e=ge(e);var l,d,h,p,g=ve(e),m=me(e);a(t,e,r)}function c(t,e,n){function r(e,r){e?n(e):(g=r,t.get(g.data,o))}function o(e,r){e?n(e):xe==v?n(new Me.EBUSY):he(r).has(v)?(m=r,h=m[v].id,t.get(h,s)):n(new Me.ENOENT)}function s(e,r){e?n(e):r.mode!=Ee?n(new Me.ENOTDIR):(h=r,t.get(h.data,u))}function u(t,e){t?n(t):(p=e,he(p).size()>0?n(new Me.ENOTEMPTY):c())}function f(e){if(e)n(e);else{var r=Date.now();i(t,y,g,{mtime:r,ctime:r},l)}}function c(){delete m[v],t.put(g.data,m,f)}function l(e){e?n(e):t.delete(h.id,d)}function d(e){e?n(e):t.delete(h.data,n)}e=ge(e);var h,p,g,m,v=ve(e),y=me(e);a(t,y,r)}function l(t,e,r,o){function s(e,n){e?o(e):(v=n,t.get(v.data,u))}function u(e,n){e?o(e):(y=n,he(y).has(E)?he(r).contains(Re)?o(new Me.ENOENT("O_CREATE and O_EXCLUSIVE are set, and the named file exists")):(b=y[E],b.type==Ee&&he(r).contains(Oe)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):t.get(b.id,f)):he(r).contains(Ce)?d():o(new Me.ENOENT("O_CREATE is not set and the named file does not exist")))}function f(t,e){if(t)o(t);else{var n=e;n.mode==Ie?(A++,A>Se?o(new Me.ELOOP):c(n.data)):l(void 0,n)}}function c(n){n=ge(n),I=me(n),E=ve(n),xe==E&&(he(r).contains(Oe)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):a(t,e,l)),a(t,I,s)}function l(t,e){t?o(t):(_=e,o(null,_))}function d(){_=new Ze(void 0,we),_.nlinks+=1,t.put(_.id,_,h)}function h(e){e?o(e):(w=new n(0),w.fill(0),t.put(_.data,w,g))}function p(e){if(e)o(e);else{var n=Date.now();i(t,I,v,{mtime:n,ctime:n},m)}}function g(e){e?o(e):(y[E]=new Ue(_.id,we),t.put(v.data,y,p))}function m(t){t?o(t):o(null,_)}e=ge(e);var v,y,b,_,w,E=ve(e),I=me(e),A=0;xe==E?he(r).contains(Oe)?o(new Me.EISDIR("the named file is a directory and O_WRITE is set")):a(t,e,l):a(t,I,s)}function d(t,e,r,o,a,s){function u(t){t?s(t):s(null,a)}function f(n){if(n)s(n);else{var r=Date.now();i(t,e.path,d,{mtime:r,ctime:r},u)}}function c(e){e?s(e):t.put(d.id,d,f)}function l(i,u){if(i)s(i);else{d=u;var f=new n(a);f.fill(0),r.copy(f,0,o,o+a),e.position=a,d.size=a,d.version+=1,t.put(d.data,f,c)}}var d;t.get(e.id,l)}function h(t,e,r,o,a,s,u){function f(t){t?u(t):u(null,a)}function c(n){if(n)u(n);else{var r=Date.now();i(t,e.path,p,{mtime:r,ctime:r},f)}}function l(e){e?u(e):t.put(p.id,p,c)}function d(i,f){if(i)u(i);else{g=f;var c=void 0!==s&&null!==s?s:e.position,d=Math.max(g.length,c+a),h=new n(d);h.fill(0),g&&g.copy(h),r.copy(h,c,o,o+a),void 0===s&&(e.position+=a),p.size=d,p.version+=1,t.put(p.data,h,l)}}function h(e,n){e?u(e):(p=n,t.get(p.data,d))}var p,g;t.get(e.id,h)}function p(t,e,n,r,i,o,a){function s(t,s){if(t)a(t);else{c=s;var u=void 0!==o&&null!==o?o:e.position;i=u+i>n.length?i-u:i,c.copy(n,r,u,u+i),void 0===o&&(e.position+=i),a(null,i)}}function u(e,n){e?a(e):(f=n,t.get(f.data,s))}var f,c;t.get(e.id,u)}function g(t,e,n){e=ge(e),ve(e),a(t,e,r(n))}function m(t,e,n){t.get(e.id,r(n))}function v(t,e,n){function i(e,r){e?n(e):(s=r,t.get(s.data,o))}function o(e,i){e?n(e):(u=i,he(u).has(f)?t.get(u[f].id,r(n)):n(new Me.ENOENT("a component of the path does not name an existing file")))}e=ge(e);var s,u,f=ve(e),c=me(e);xe==f?a(t,e,r(n)):a(t,c,i)}function y(t,e,n,r){function o(e){e?r(e):i(t,n,b,{ctime:Date.now()},r)}function s(e,n){e?r(e):(b=n,b.nlinks+=1,t.put(b.id,b,o))}function u(e){e?r(e):t.get(y[_].id,s)}function f(e,n){e?r(e):(y=n,he(y).has(_)?r(new Me.EEXIST("newpath resolves to an existing file")):(y[_]=m[h],t.put(v.data,y,u)))}function c(e,n){e?r(e):(v=n,t.get(v.data,f))}function l(e,n){e?r(e):(m=n,he(m).has(h)?a(t,w,c):r(new Me.ENOENT("a component of either path prefix does not exist")))}function d(e,n){e?r(e):(g=n,t.get(g.data,l))}e=ge(e);var h=ve(e),p=me(e);n=ge(n);var g,m,v,y,b,_=ve(n),w=me(n);a(t,p,d)}function b(t,e,n){function r(e){e?n(e):(delete l[h],t.put(c.data,l,function(){var e=Date.now();i(t,p,c,{mtime:e,ctime:e},n)}))}function o(e){e?n(e):t.delete(d.data,r)}function s(a,s){a?n(a):(d=s,d.nlinks-=1,1>d.nlinks?t.delete(d.id,o):t.put(d.id,d,function(){i(t,e,d,{ctime:Date.now()},r)}))}function u(e,r){e?n(e):(l=r,he(l).has(h)?t.get(l[h].id,s):n(new Me.ENOENT("a component of the path does not name an existing file")))}function f(e,r){e?n(e):(c=r,t.get(c.data,u))}e=ge(e);var c,l,d,h=ve(e),p=me(e);a(t,p,f)}function _(t,e,n){function r(t,e){if(t)n(t);else{s=e;var r=Object.keys(s);n(null,r)}}function i(e,i){e?n(e):(o=i,t.get(o.data,r))}e=ge(e),ve(e);var o,s;a(t,e,i)}function w(t,e,n,r){function o(e,n){e?r(e):(l=n,t.get(l.data,s))}function s(t,e){t?r(t):(d=e,he(d).has(p)?r(new Me.EEXIST):u())}function u(){h=new Ze(void 0,Ie),h.nlinks+=1,h.size=e.length,h.data=e,t.put(h.id,h,c)}function f(e){if(e)r(e);else{var n=Date.now();i(t,g,l,{mtime:n,ctime:n},r)}}function c(e){e?r(e):(d[p]=new Ue(h.id,Ie),t.put(l.data,d,f))}n=ge(n);var l,d,h,p=ve(n),g=me(n);xe==p?r(new Me.EEXIST):a(t,g,o)}function E(t,e,n){function r(e,r){e?n(e):(s=r,t.get(s.data,i))}function i(e,r){e?n(e):(u=r,he(u).has(f)?t.get(u[f].id,o):n(new Me.ENOENT("a component of the path does not name an existing file")))}function o(t,e){t?n(t):e.mode!=Ie?n(new Me.EINVAL("path not a symbolic link")):n(null,e.data)}e=ge(e);var s,u,f=ve(e),c=me(e);a(t,c,r)}function I(t,e,r,o){function s(e,n){e?o(e):n.mode==Ee?o(new Me.EISDIR):(l=n,t.get(l.data,u))}function u(e,i){if(e)o(e);else{var a=new n(r);a.fill(0),i&&i.copy(a),t.put(l.data,a,c)}}function f(n){if(n)o(n);else{var r=Date.now();i(t,e,l,{mtime:r,ctime:r},o)}}function c(e){e?o(e):(l.size=r,l.version+=1,t.put(l.id,l,f))}e=ge(e);var l;0>r?o(new Me.EINVAL("length cannot be negative")):a(t,e,s)}function A(t,e,r,o){function a(e,n){e?o(e):n.mode==Ee?o(new Me.EISDIR):(c=n,t.get(c.data,s))}function s(e,i){if(e)o(e);else{var a;i?a=i.slice(0,r):(a=new n(r),a.fill(0)),t.put(c.data,a,f)}}function u(n){if(n)o(n);else{var r=Date.now();i(t,e.path,c,{mtime:r,ctime:r},o)}}function f(e){e?o(e):(c.size=r,c.version+=1,t.put(c.id,c,u))}var c;0>r?o(new Me.EINVAL("length cannot be negative")):t.get(e.id,a)}function x(t,e,n,r,o){function s(a,s){a?o(a):i(t,e,s,{atime:n,ctime:r,mtime:r},o)}e=ge(e),"number"!=typeof n||"number"!=typeof r?o(new Me.EINVAL("atime and mtime must be number")):0>n||0>r?o(new Me.EINVAL("atime and mtime must be positive integers")):a(t,e,s)}function k(t,e,n,r,o){function a(a,s){a?o(a):i(t,e.path,s,{atime:n,ctime:r,mtime:r},o)}"number"!=typeof n||"number"!=typeof r?o(new Me.EINVAL("atime and mtime must be a number")):0>n||0>r?o(new Me.EINVAL("atime and mtime must be positive integers")):t.get(e.id,a)}function S(t,e,n,r,i,o){e=ge(e),"string"!=typeof n?o(new Me.EINVAL("attribute name must be a string")):n?null!==i&&i!==Le&&i!==Be?o(new Me.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):s(t,e,n,r,i,o):o(new Me.EINVAL("attribute name cannot be an empty string"))}function T(t,e,n,r,i,o){"string"!=typeof n?o(new Me.EINVAL("attribute name must be a string")):n?null!==i&&i!==Le&&i!==Be?o(new Me.EINVAL("invalid flag, must be null, XATTR_CREATE or XATTR_REPLACE")):s(t,e,n,r,i,o):o(new Me.EINVAL("attribute name cannot be an empty string"))}function O(t,e,n,r){function i(t,e){e?e.xattrs[n]:null,t?r(t):e.xattrs.hasOwnProperty(n)?r(null,e.xattrs[n]):r(new Me.ENOATTR)}e=ge(e),"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?a(t,e,i):r(new Me.EINVAL("attribute name cannot be an empty string"))}function C(t,e,n,r){function i(t,e){e?e.xattrs[n]:null,t?r(t):e.xattrs.hasOwnProperty(n)?r(null,e.xattrs[n]):r(new Me.ENOATTR)}"string"!=typeof n?r(new Me.EINVAL):n?t.get(e.id,i):r(new Me.EINVAL("attribute name cannot be an empty string"))}function R(t,e,n,r){function o(o,a){function s(n){n?r(n):i(t,e,a,{ctime:Date.now()},r)}var u=a?a.xattrs:null;o?r(o):u.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Me.ENOATTR)}e=ge(e),"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?a(t,e,o):r(new Me.EINVAL("attribute name cannot be an empty string"))}function N(t,e,n,r){function o(o,a){function s(n){n?r(n):i(t,e.path,a,{ctime:Date.now()},r)}o?r(o):a.xattrs.hasOwnProperty(n)?(delete a.xattrs[n],t.put(a.id,a,s)):r(new Me.ENOATTR)}"string"!=typeof n?r(new Me.EINVAL("attribute name must be a string")):n?t.get(e.id,o):r(new Me.EINVAL("attribute name cannot be an empty string"))}function D(t){return he(De).has(t)?De[t]:null}function L(t,e,n){return t?"function"==typeof t?t={encoding:e,flag:n}:"string"==typeof t&&(t={encoding:t,flag:n}):t={encoding:e,flag:n},t}function B(t,e){var n;return be(t)?n=Error("Path must be a string without null bytes."):ye(t)||(n=Error("Path must be absolute.")),n?(e(n),!1):!0}function z(t,e,n,r,i,o){function a(e,i){if(e)o(e);else{var a;a=he(r).contains(Ne)?i.size:0;var s=new Pe(n,i.id,r,a),u=t.allocDescriptor(s);o(null,u)}}o=arguments[arguments.length-1],B(n,o)&&(r=D(r),r||o(new Me.EINVAL("flags is not valid")),l(e,n,r,a))}function j(t,e,n,r){he(t.openFiles).has(n)?(t.releaseDescriptor(n),r(null)):r(new Me.EBADF)}function F(t,e,n,r,i){B(n,i)&&o(e,n,r,i)}function M(t,e,n,i,o){o=arguments[arguments.length-1],B(n,o)&&f(e,n,r(o))}function U(t,e,n,i){B(n,i)&&c(e,n,r(i))}function P(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}B(n,r)&&g(e,n,i)}function V(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}var o=t.openFiles[n];o?m(e,o,i):r(new Me.EBADF)}function Z(t,e,n,i,o){B(n,o)&&B(i,o)&&y(e,n,i,r(o))}function Y(t,e,n,i){B(n,i)&&b(e,n,r(i))}function X(t,e,n,i,o,a,s,u){function f(t,e){u(t,e||0,i)}o=void 0===o?0:o,a=void 0===a?i.length-o:a,u=arguments[arguments.length-1];var c=t.openFiles[n];c?he(c.flags).contains(Te)?p(e,c,i,o,a,s,r(f)):u(new Me.EBADF("descriptor does not permit reading")):u(new Me.EBADF) +}function H(t,e,r,i,o){if(o=arguments[arguments.length-1],i=L(i,null,"r"),B(r,o)){var a=D(i.flag||"r");a||o(new Me.EINVAL("flags is not valid")),l(e,r,a,function(s,u){if(s)return o(s);var f=new Pe(r,u.id,a,0),c=t.allocDescriptor(f);m(e,f,function(r,a){if(r)return o(r);var s=new Ye(a,t.name),u=s.size,l=new n(u);l.fill(0),p(e,f,l,0,u,0,function(e){if(e)return o(e);t.releaseDescriptor(c);var n;n="utf8"===i.encoding?Fe.decode(l):l,o(null,n)})})})}}function W(t,e,n,i,o,a,s,u){u=arguments[arguments.length-1],o=void 0===o?0:o,a=void 0===a?i.length-o:a;var f=t.openFiles[n];f?he(f.flags).contains(Oe)?a>i.length-o?u(new Me.EIO("intput buffer is too small")):h(e,f,i,o,a,s,r(u)):u(new Me.EBADF("descriptor does not permit writing")):u(new Me.EBADF)}function q(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=L(i,"utf8","w"),B(n,o)){var a=D(i.flag||"w");a||o(new Me.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Fe.encode(r)),l(e,n,a,function(i,s){if(i)return o(i);var u=new Pe(n,s.id,a,0),f=t.allocDescriptor(u);d(e,u,r,0,r.length,function(e){return e?o(e):(t.releaseDescriptor(f),o(null),void 0)})})}}function K(t,e,n,r,i,o){if(o=arguments[arguments.length-1],i=L(i,"utf8","a"),B(n,o)){var a=D(i.flag||"a");a||o(new Me.EINVAL("flags is not valid")),r=r||"","number"==typeof r&&(r=""+r),"string"==typeof r&&"utf8"===i.encoding&&(r=Fe.encode(r)),l(e,n,a,function(i,s){if(i)return o(i);var u=new Pe(n,s.id,a,s.size),f=t.allocDescriptor(u);h(e,u,r,0,r.length,u.position,function(e){return e?o(e):(t.releaseDescriptor(f),o(null),void 0)})})}}function J(t,e,n,r){function i(t){r(t?!1:!0)}P(t,e,n,i)}function G(t,e,n,i,o){B(n,o)&&O(e,n,i,r(o))}function Q(t,e,n,i,o){var a=t.openFiles[n];a?C(e,a,i,r(o)):o(new Me.EBADF)}function $(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null),B(n,s)&&S(e,n,i,o,a,r(s))}function te(t,e,n,i,o,a,s){"function"==typeof a&&(s=a,a=null);var u=t.openFiles[n];u?he(u.flags).contains(Oe)?T(e,u,i,o,a,r(s)):s(new Me.EBADF("descriptor does not permit writing")):s(new Me.EBADF)}function ee(t,e,n,i,o){B(n,o)&&R(e,n,i,r(o))}function ne(t,e,n,i,o){var a=t.openFiles[n];a?he(a.flags).contains(Oe)?N(e,a,i,r(o)):o(new Me.EBADF("descriptor does not permit writing")):o(new Me.EBADF)}function re(t,e,n,r,i,o){function a(t,e){t?o(t):0>e.size+r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position=e.size+r,o(null,s.position))}var s=t.openFiles[n];s||o(new Me.EBADF),"SET"===i?0>r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position=r,o(null,s.position)):"CUR"===i?0>s.position+r?o(new Me.EINVAL("resulting file offset would be negative")):(s.position+=r,o(null,s.position)):"END"===i?m(e,s,a):o(new Me.EINVAL("whence argument is not a proper value"))}function ie(t,e,n,i){B(n,i)&&_(e,n,r(i))}function oe(t,e,n,i,o,a){if(B(n,a)){var s=Date.now();i=i?i:s,o=o?o:s,x(e,n,i,o,r(a))}}function ae(t,e,n,i,o,a){var s=Date.now();i=i?i:s,o=o?o:s;var u=t.openFiles[n];u?he(u.flags).contains(Oe)?k(e,u,i,o,r(a)):a(new Me.EBADF("descriptor does not permit writing")):a(new Me.EBADF)}function se(t,e,n,i,o){function a(t){t?o(t):b(e,n,r(o))}B(n,o)&&B(i,o)&&y(e,n,i,a)}function ue(t,e,n,i,o,a){a=arguments[arguments.length-1],B(n,a)&&B(i,a)&&w(e,n,i,r(a))}function fe(t,e,n,i){B(n,i)&&E(e,n,r(i))}function ce(t,e,n,r){function i(e,n){if(e)r(e);else{var i=new Ye(n,t.name);r(null,i)}}B(n,r)&&v(e,n,i)}function le(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0,B(n,o)&&I(e,n,i,r(o))}function de(t,e,n,i,o){o=arguments[arguments.length-1],i=i||0;var a=t.openFiles[n];a?he(a.flags).contains(Oe)?A(e,a,i,r(o)):o(new Me.EBADF("descriptor does not permit writing")):o(new Me.EBADF)}var he=t("../../lib/nodash.js"),pe=t("../path.js"),ge=pe.normalize,me=pe.dirname,ve=pe.basename,ye=pe.isAbsolute,be=pe.isNull,_e=t("../constants.js"),we=_e.MODE_FILE,Ee=_e.MODE_DIRECTORY,Ie=_e.MODE_SYMBOLIC_LINK,Ae=_e.MODE_META,xe=_e.ROOT_DIRECTORY_NAME,ke=_e.SUPER_NODE_ID,Se=_e.SYMLOOP_MAX,Te=_e.O_READ,Oe=_e.O_WRITE,Ce=_e.O_CREATE,Re=_e.O_EXCLUSIVE;_e.O_TRUNCATE;var Ne=_e.O_APPEND,De=_e.O_FLAGS,Le=_e.XATTR_CREATE,Be=_e.XATTR_REPLACE,ze=_e.FS_NOMTIME,je=_e.FS_NOCTIME,Fe=t("../encoding.js"),Me=t("../errors.js"),Ue=t("../directory-entry.js"),Pe=t("../open-file-description.js"),Ve=t("../super-node.js"),Ze=t("../node.js"),Ye=t("../stats.js");e.exports={makeRootDirectory:u,open:z,close:j,mknod:F,mkdir:M,rmdir:U,unlink:Y,stat:P,fstat:V,link:Z,read:X,readFile:H,write:W,writeFile:q,appendFile:K,exists:J,getxattr:G,fgetxattr:Q,setxattr:$,fsetxattr:te,removexattr:ee,fremovexattr:ne,lseek:re,readdir:ie,utimes:oe,futimes:ae,rename:se,symlink:ue,readlink:fe,lstat:ce,truncate:le,ftruncate:de}}).call(this,t("buffer").Buffer)},{"../../lib/nodash.js":4,"../constants.js":44,"../directory-entry.js":45,"../encoding.js":46,"../errors.js":47,"../node.js":52,"../open-file-description.js":53,"../path.js":54,"../stats.js":63,"../super-node.js":64,buffer:6}],49:[function(t,e){function n(t){return"function"==typeof t?t:function(t){if(t)throw t}}function r(t,e){function n(){T.forEach(function(t){t.call(this)}.bind(x)),T=null}function r(t){if(t.length){var e=g.getInstance();t.forEach(function(t){e.emit(t.event,t.path)})}}t=t||{},e=e||a;var s=t.flags,p=t.provider||new h.Default(t.name||u),I=t.name||p.name,A=i(s).contains(f),x=this;x.readyState=l,x.name=I,x.error=null,x.stdin=y,x.stdout=b,x.stderr=_;var k={},S=w;Object.defineProperty(this,"openFiles",{get:function(){return k}}),this.allocDescriptor=function(t){var e=S++;return k[e]=t,e},this.releaseDescriptor=function(t){delete k[t]};var T=[];this.queueOrRun=function(t){var e;return c==x.readyState?t.call(x):d==x.readyState?e=new v.EFILESYSTEMERROR("unknown error"):T.push(t),e},this.watch=function(t,e,n){if(o(t))throw Error("Path must be a string without null bytes.");"function"==typeof e&&(n=e,e={}),e=e||{},n=n||a;var r=new m;return r.start(t,!1,e.recursive),r.on("change",n),r},p.open(function(t,i){function o(t){function i(t){var e=p[t]();return e.flags=s,e.changes=[],e.close=function(){var t=e.changes;r(t),t.length=0},e}x.provider={openReadWriteContext:function(){return i("getReadWriteContext")},openReadOnlyContext:function(){return i("getReadOnlyContext")}},t?x.readyState=d:(x.readyState=c,n()),e(t,x)}if(t)return o(t);if(!A&&!i)return o(null);var a=p.getReadWriteContext();a.clear(function(t){return t?(o(t),void 0):(E.makeRootDirectory(a,o),void 0)})})}var i=t("../../lib/nodash.js"),o=t("../path.js").isNull,a=t("../shared.js").nop,s=t("../constants.js"),u=s.FILE_SYSTEM_NAME,f=s.FS_FORMAT,c=s.FS_READY,l=s.FS_PENDING,d=s.FS_ERROR,h=t("../providers/index.js"),p=t("../shell/shell.js"),g=t("../../lib/intercom.js"),m=t("../fs-watcher.js"),v=t("../errors.js"),y=s.STDIN,b=s.STDOUT,_=s.STDERR,w=s.FIRST_DESCRIPTOR,E=t("./implementation.js");r.providers=h,["open","close","mknod","mkdir","rmdir","stat","fstat","link","unlink","read","readFile","write","writeFile","appendFile","exists","lseek","readdir","rename","readlink","symlink","lstat","truncate","ftruncate","utimes","futimes","setxattr","getxattr","fsetxattr","fgetxattr","removexattr","fremovexattr"].forEach(function(t){r.prototype[t]=function(){var e=this,r=Array.prototype.slice.call(arguments,0),i=r.length-1,o="function"!=typeof r[i],a=n(r[i]),s=e.queueOrRun(function(){function n(){s.close(),a.apply(e,arguments)}var s=e.provider.openReadWriteContext();o?r.push(n):r[i]=n;var u=[e,s].concat(r);E[t].apply(null,u)});s&&a(s)}}),r.prototype.Shell=function(t){return new p(this,t)},e.exports=r},{"../../lib/intercom.js":3,"../../lib/nodash.js":4,"../constants.js":44,"../errors.js":47,"../fs-watcher.js":50,"../path.js":54,"../providers/index.js":55,"../shared.js":59,"../shell/shell.js":62,"./implementation.js":48}],50:[function(t,e){function n(){function t(t){(e===t||a&&0===t.indexOf(e+"/"))&&n.trigger("change","change",t)}r.call(this);var e,n=this,a=!1;n.start=function(n,r,s){if(!e){if(i(n))throw Error("Path must be a string without null bytes.");e=n,a=s===!0;var u=o.getInstance();u.on("change",t)}},n.close=function(){var e=o.getInstance();e.off("change",t),n.removeAllListeners("change")}}var r=t("../lib/eventemitter.js"),i=t("./path.js").isNull,o=t("../lib/intercom.js");n.prototype=new r,n.prototype.constructor=n,e.exports=n},{"../lib/eventemitter.js":2,"../lib/intercom.js":3,"./path.js":54}],51:[function(t,e){(function(n){e.exports={FileSystem:t("./filesystem/interface.js"),Buffer:n,Path:t("./path.js"),Errors:t("./errors.js")}}).call(this,t("buffer").Buffer)},{"./errors.js":47,"./filesystem/interface.js":49,"./path.js":54,buffer:6}],52:[function(t,e){var n=t("./constants.js").MODE_FILE,r=t("./shared.js").guid;e.exports=function(t,e,i,o,a,s,u,f,c,l){var d=Date.now();this.id=t||r(),this.mode=e||n,this.size=i||0,this.atime=o||d,this.ctime=a||d,this.mtime=s||d,this.flags=u||[],this.xattrs=f||{},this.nlinks=c||0,this.version=l||0,this.blksize=void 0,this.nblocks=1,this.data=r()}},{"./constants.js":44,"./shared.js":59}],53:[function(t,e){e.exports=function(t,e,n,r){this.path=t,this.id=e,this.flags=n,this.position=r}},{}],54:[function(t,e,n){function r(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var i=n>=0?arguments[n]:"/";"string"==typeof i&&i&&(t=i+"/"+t,e="/"===i.charAt(0))}return t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),(e?"/":"")+t||"."}function o(t){var e="/"===t.charAt(0);return"/"===t.substr(-1),t=r(t.split("/").filter(function(t){return!!t}),!e).join("/"),t||e||(t="."),(e?"/":"")+t}function a(){var t=Array.prototype.slice.call(arguments,0);return o(t.filter(function(t){return t&&"string"==typeof t}).join("/"))}function s(t,e){function r(t){for(var e=0;t.length>e&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var f=[],u=s;i.length>u;u++)f.push("..");return f=f.concat(o.slice(s)),f.join("/")}function u(t){var e=p(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."}function f(t,e){var n=p(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),""===n?"/":n}function c(t){return p(t)[3]}function l(t){return"/"===t.charAt(0)?!0:!1}function d(t){return-1!==(""+t).indexOf("\0")?!0:!1}var h=/^(\/?)([\s\S]+\/(?!$)|\/)?((?:\.{1,2}$|[\s\S]+?)?(\.[^.\/]*)?)$/,p=function(t){var e=h.exec(t);return[e[1]||"",e[2]||"",e[3]||"",e[4]||""]};e.exports={normalize:o,resolve:i,join:a,relative:s,sep:"/",delimiter:":",dirname:u,basename:f,extname:c,isAbsolute:l,isNull:d}},{}],55:[function(t,e){var n=t("./indexeddb.js"),r=t("./websql.js"),i=t("./memory.js");e.exports={IndexedDB:n,WebSQL:r,Memory:i,Default:n,Fallback:function(){function t(){throw"[Filer Error] Your browser doesn't support IndexedDB or WebSQL."}return n.isSupported()?n:r.isSupported()?r:(t.isSupported=function(){return!1},t)}()}},{"./indexeddb.js":56,"./memory.js":57,"./websql.js":58}],56:[function(t,e){(function(n){function r(t,e){var n=t.transaction(a,e);this.objectStore=n.objectStore(a)}function i(t){this.name=t||o,this.db=null}var o=t("../constants.js").FILE_SYSTEM_NAME,a=t("../constants.js").FILE_STORE_NAME,s=t("../constants.js").IDB_RW;t("../constants.js").IDB_RO;var u=t("../errors.js"),f=n.indexedDB||n.mozIndexedDB||n.webkitIndexedDB||n.msIndexedDB;r.prototype.clear=function(t){try{var e=this.objectStore.clear();e.onsuccess=function(){t()},e.onerror=function(e){t(e)}}catch(n){t(n)}},r.prototype.get=function(t,e){try{var n=this.objectStore.get(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},r.prototype.put=function(t,e,n){try{var r=this.objectStore.put(e,t);r.onsuccess=function(t){var e=t.target.result;n(null,e)},r.onerror=function(t){n(t)}}catch(i){n(i)}},r.prototype.delete=function(t,e){try{var n=this.objectStore.delete(t);n.onsuccess=function(t){var n=t.target.result;e(null,n)},n.onerror=function(t){e(t)}}catch(r){e(r)}},i.isSupported=function(){return!!f},i.prototype.open=function(t){var e=this;if(e.db)return t(null,!1),void 0;var n=!1,r=f.open(e.name);r.onupgradeneeded=function(t){var e=t.target.result;e.objectStoreNames.contains(a)&&e.deleteObjectStore(a),e.createObjectStore(a),n=!0},r.onsuccess=function(r){e.db=r.target.result,t(null,n)},r.onerror=function(){t(new u.EINVAL("IndexedDB cannot be accessed. If private browsing is enabled, disable it."))}},i.prototype.getReadOnlyContext=function(){return new r(this.db,s)},i.prototype.getReadWriteContext=function(){return new r(this.db,s)},e.exports=i})(this)},{"../constants.js":44,"../errors.js":47}],57:[function(t,e){function n(t,e){this.readOnly=e,this.objectStore=t}function r(t){this.name=t||i}var i=t("../constants.js").FILE_SYSTEM_NAME,o=t("../../lib/async.js").nextTick,a=function(){var t={};return function(e){var n=!t.hasOwnProperty(e);return n&&(t[e]={}),{firstAccess:n,db:t[e]}}}();n.prototype.clear=function(t){if(this.readOnly)return o(function(){t("[MemoryContext] Error: write operation on read only context")}),void 0;var e=this.objectStore;Object.keys(e).forEach(function(t){delete e[t]}),o(t)},n.prototype.get=function(t,e){var n=this;o(function(){e(null,n.objectStore[t])})},n.prototype.put=function(t,e,n){return this.readOnly?(o(function(){n("[MemoryContext] Error: write operation on read only context")}),void 0):(this.objectStore[t]=e,o(n),void 0)},n.prototype.delete=function(t,e){return this.readOnly?(o(function(){e("[MemoryContext] Error: write operation on read only context")}),void 0):(delete this.objectStore[t],o(e),void 0)},r.isSupported=function(){return!0},r.prototype.open=function(t){var e=a(this.name);this.db=e.db,o(function(){t(null,e.firstAccess)})},r.prototype.getReadOnlyContext=function(){return new n(this.db,!0)},r.prototype.getReadWriteContext=function(){return new n(this.db,!1)},e.exports=r},{"../../lib/async.js":1,"../constants.js":44}],58:[function(t,e){(function(n){function r(t,e){var n=this;this.getTransaction=function(r){return n.transaction?(r(n.transaction),void 0):(t[e?"readTransaction":"transaction"](function(t){n.transaction=t,r(t)}),void 0)}}function i(t){this.name=t||o,this.db=null}var o=t("../constants.js").FILE_SYSTEM_NAME,a=t("../constants.js").FILE_STORE_NAME,s=t("../constants.js").WSQL_VERSION,u=t("../constants.js").WSQL_SIZE,f=t("../constants.js").WSQL_DESC,c=t("../shared.js").u8toArray,l=t("../errors.js");r.prototype.clear=function(t){function e(e,n){t(n)}function n(){t(null)}this.getTransaction(function(t){t.executeSql("DELETE FROM "+a+";",[],n,e)})},r.prototype.get=function(t,e){function n(t,n){var r=0===n.rows.length?null:n.rows.item(0).data;try{r&&(r=JSON.parse(r),r.__isUint8Array&&(r=new Uint8Array(r.__array))),e(null,r)}catch(i){e(i)}}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("SELECT data FROM "+a+" WHERE id = ?;",[t],n,r)})},r.prototype.put=function(t,e,n){function r(){n(null)}function i(t,e){n(e)}"[object Uint8Array]"===Object.prototype.toString.call(e)&&(e={__isUint8Array:!0,__array:c(e)}),e=JSON.stringify(e),this.getTransaction(function(n){n.executeSql("INSERT OR REPLACE INTO "+a+" (id, data) VALUES (?, ?);",[t,e],r,i)})},r.prototype.delete=function(t,e){function n(){e(null)}function r(t,n){e(n)}this.getTransaction(function(e){e.executeSql("DELETE FROM "+a+" WHERE id = ?;",[t],n,r)})},i.isSupported=function(){return!!n.openDatabase},i.prototype.open=function(t){function e(e,n){5===n.code&&t(new l.EINVAL("WebSQL cannot be accessed. If private browsing is enabled, disable it.")),t(n)}function r(e){function n(e,n){var r=0===n.rows.item(0).count;t(null,r)}function r(e,n){t(n)}i.db=o,e.executeSql("SELECT COUNT(id) AS count FROM "+a+";",[],n,r)}var i=this;if(i.db)return t(null,!1),void 0;var o=n.openDatabase(i.name,s,f,u);return o?(o.transaction(function(t){function n(t){t.executeSql("CREATE INDEX IF NOT EXISTS idx_"+a+"_id"+" on "+a+" (id);",[],r,e)}t.executeSql("CREATE TABLE IF NOT EXISTS "+a+" (id unique, data TEXT);",[],n,e)}),void 0):(t("[WebSQL] Unable to open database."),void 0)},i.prototype.getReadOnlyContext=function(){return new r(this.db,!0)},i.prototype.getReadWriteContext=function(){return new r(this.db,!1)},e.exports=i})(this)},{"../constants.js":44,"../errors.js":47,"../shared.js":59}],59:[function(t,e){function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=0|16*Math.random(),n="x"==t?e:8|3&e;return n.toString(16)}).toUpperCase()}function r(){}function i(t){for(var e=[],n=t.length,r=0;n>r;r++)e[r]=t[r];return e}e.exports={guid:n,u8toArray:i,nop:r}},{}],60:[function(t,e){var n=t("../constants.js").ENVIRONMENT;e.exports=function(t){t=t||{},t.TMP=t.TMP||n.TMP,t.PATH=t.PATH||n.PATH,this.get=function(e){return t[e]},this.set=function(e,n){t[e]=n}}},{"../constants.js":44}],61:[function(t,e){var n=t("request");e.exports.download=function(t,e){n({url:t,method:"GET",encoding:null},function(t,n,r){var i,o;return n=n||null,i=n&&n.statusCode,(o=200!==i?{message:t||"Not found!",code:i}:null)?(e(o,null),void 0):(e(null,r),void 0)})}},{request:5}],62:[function(t,e){function n(t,e){e=e||{};var n=new o(e.env),a="/";Object.defineProperty(this,"fs",{get:function(){return t},enumerable:!0}),Object.defineProperty(this,"env",{get:function(){return n},enumerable:!0}),this.cd=function(e,n){e=r.resolve(this.cwd,e),t.stat(e,function(t,r){return t?(n(new i.ENOTDIR),void 0):("DIRECTORY"===r.type?(a=e,n()):n(new i.ENOTDIR),void 0)})},this.pwd=function(){return a}}var r=t("../path.js"),i=t("../errors.js"),o=t("./environment.js"),a=t("../../lib/async.js"),s=t("./network.js");t("../encoding.js");var u=t("jszip");n.prototype.exec=function(t,e,n){var i=this.fs;"function"==typeof e&&(n=e,e=[]),e=e||[],n=n||function(){},t=r.resolve(this.cwd,t),i.readFile(t,"utf8",function(t,r){if(t)return n(t),void 0;try{var o=Function("fs","args","callback",r);o(i,e,n)}catch(a){n(a)}})},n.prototype.touch=function(t,e,n){function i(t){a.writeFile(t,"",n)}function o(t){var r=Date.now(),i=e.date||r,o=e.date||r;a.utimes(t,i,o,n)}var a=this.fs;"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t=r.resolve(this.cwd,t),a.stat(t,function(r){r?e.updateOnly===!0?n():i(t):o(t)})},n.prototype.cat=function(t,e){function n(t,e){var n=r.resolve(this.cwd,t);o.readFile(n,"utf8",function(t,n){return t?(e(t),void 0):(s+=n+"\n",e(),void 0)})}var o=this.fs,s="";return e=e||function(){},t?(t="string"==typeof t?[t]:t,a.eachSeries(t,n,function(t){t?e(t):e(null,s.replace(/\n$/,""))}),void 0):(e(new i.EINVAL("Missing files argument")),void 0)},n.prototype.ls=function(t,e,n){function o(t,n){var i=r.resolve(this.cwd,t),u=[];s.readdir(i,function(t,f){function c(t,n){t=r.join(i,t),s.stat(t,function(a,s){if(a)return n(a),void 0;var f={path:r.basename(t),links:s.nlinks,size:s.size,modified:s.mtime,type:s.type};e.recursive&&"DIRECTORY"===s.type?o(r.join(i,f.path),function(t,e){return t?(n(t),void 0):(f.contents=e,u.push(f),n(),void 0)}):(u.push(f),n())})}return t?(n(t),void 0):(a.each(f,c,function(t){n(t,u)}),void 0)})}var s=this.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing dir argument")),void 0)},n.prototype.rm=function(t,e,n){function o(t,n){t=r.resolve(this.cwd,t),s.stat(t,function(u,f){return u?(n(u),void 0):"FILE"===f.type?(s.unlink(t,n),void 0):(s.readdir(t,function(u,f){return u?(n(u),void 0):0===f.length?(s.rmdir(t,n),void 0):e.recursive?(f=f.map(function(e){return r.join(t,e)}),a.each(f,o,function(e){return e?(n(e),void 0):(s.rmdir(t,n),void 0)}),void 0):(n(new i.ENOTEMPTY),void 0)}),void 0)})}var s=this.fs;return"function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},t?(o(t,n),void 0):(n(new i.EINVAL("Missing path argument")),void 0)},n.prototype.tempDir=function(t){var e=this.fs,n=this.env.get("TMP");t=t||function(){},e.mkdir(n,function(){t(null,n)})},n.prototype.mkdirp=function(t,e){function n(t,e){o.stat(t,function(a,s){if(s){if(s.isDirectory())return e(),void 0;if(s.isFile())return e(new i.ENOTDIR),void 0}else{if(a&&"ENOENT"!==a.code)return e(a),void 0;var u=r.dirname(t);"/"===u?o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}):n(u,function(n){return n?e(n):(o.mkdir(t,function(t){return t&&"EEXIST"!=t.code?(e(t),void 0):(e(),void 0)}),void 0)})}})}var o=this.fs;return e=e||function(){},t?"/"===t?(e(),void 0):(n(t,e),void 0):(e(new i.EINVAL("Missing path argument")),void 0)},n.prototype.wget=function(t,e,n){function o(){n(Error("unable to get resource"))}var a=this.fs;if("function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},!t)return n(new i.EINVAL("missing url argument")),void 0;var u=e.filename||t.split("/").pop();u=r.resolve(a.cwd,u),s.download(t,function(t,e){return t||!e?o():(a.writeFile(u,e,function(t){t?n(t):n(null,u)}),void 0)})},n.prototype.unzip=function(t,e,n){var o=this.fs,s=this;if("function"==typeof e&&(n=e,e={}),e=e||{},n=n||function(){},!t)return n(new i.EINVAL("missing zipfile argument")),void 0;var f=r.resolve(this.cwd,t),c=r.resolve(e.destination||this.cwd);o.readFile(f,function(t,e){function i(t,e){t.isDirectory?s.mkdirp(t.absPath,e):o.writeFile(t.absPath,t.data,e)}if(t)return n(t);var f=new u(e),l=[];f.filter(function(t,e){var n=e.options.dir,i=n?null:e.asNodeBuffer();l.push({absPath:r.join(c,e.name),isDirectory:n,data:i})}),a.eachSeries(l,i,n)})},n.prototype.zip=function(t,e,n,o){function s(t){return t.replace(/^\//,"")}function f(t,e){d.readFile(t,function(n,r){return n?e(n):(p.file(s(t),r,{binary:!0}),e(),void 0)})}function c(t,e){d.readdir(t,function(i,o){p.folder(s(t)),n.recursive||e(),a.eachSeries(o,function(e,n){l(r.join(t,e),n)},e)})}function l(t,e){t=r.resolve(h.cwd,t),d.stat(t,function(n,r){return n?e(n):(r.isDirectory()?c(t,e):f(t,e),void 0)})}var d=this.fs,h=this;if("function"==typeof n&&(o=n,n={}),n=n||{},o=o||function(){},!t)return o(new i.EINVAL("missing zipfile argument")),void 0;if(!e)return o(new i.EINVAL("missing paths argument")),void 0;"string"==typeof e&&(e=[e]),t=r.resolve(this.cwd,t);var p=new u;d.stat(t,function(n,r){return r?o(new i.EEXIST("zipfile already exists")):(a.eachSeries(e,l,function(e){if(e)return o(e);var n;n=p.generate({type:"nodebuffer"}),d.writeFile(t,n,o)}),void 0)})},e.exports=n},{"../../lib/async.js":1,"../encoding.js":46,"../errors.js":47,"../path.js":54,"./environment.js":60,"./network.js":61,jszip:16}],63:[function(t,e){function n(t,e){this.node=t.id,this.dev=e,this.size=t.size,this.nlinks=t.nlinks,this.atime=t.atime,this.mtime=t.mtime,this.ctime=t.ctime,this.type=t.mode}var r=t("./constants.js");n.prototype.isFile=function(){return this.type===r.MODE_FILE},n.prototype.isDirectory=function(){return this.type===r.MODE_DIRECTORY},n.prototype.isSymbolicLink=function(){return this.type===r.MODE_SYMBOLIC_LINK},n.prototype.isSocket=n.prototype.isFIFO=n.prototype.isCharacterDevice=n.prototype.isBlockDevice=function(){return!1},e.exports=n},{"./constants.js":44}],64:[function(t,e){var n=t("./constants.js"),r=t("./shared.js").guid;e.exports=function(t,e,i){var o=Date.now();this.id=n.SUPER_NODE_ID,this.mode=n.MODE_META,this.atime=t||o,this.ctime=e||o,this.mtime=i||o,this.rnode=r()}},{"./constants.js":44,"./shared.js":59}]},{},[51])(51)}); \ No newline at end of file diff --git a/package.json b/package.json index 2e93433..bad81d3 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "idb", "websql" ], - "version": "0.0.10", + "version": "0.0.11", "author": "Alan K (http://blog.modeswitch.org)", "homepage": "http://js-platform.github.io/filer", "bugs": "https://github.com/js-platform/filer/issues",