text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.BrowserFS=e():t.BrowserFS=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=19)}([function(t,e,n){"use strict";function r(t){if(!(this instanceof r))return new r(t);c.call(this,t),f.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||s(o,this)}function o(t){t.end()}var s=n(7),a=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=r;var u=n(3);u.inherits=n(1);var c=n(14),f=n(12);u.inherits(r,c);for(var h=a(f.prototype),p=0;p<h.length;p++){var l=h[p];r.prototype[l]||(r.prototype[l]=f.prototype[l])}Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),r.prototype._destroy=function(t,e){this.push(null),this.end(),s(e,t)}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";var r=n(22),i=new r,o={};for(var s in i)!function(t){o[t]||("function"==typeof i[t]?o[t]=function(){return i[t].apply(i,arguments)}:o[t]=i[t])}(s);o.initializeTTYs=function(){null===i.stdin&&(i.initializeTTYs(),o.stdin=i.stdin,o.stdout=i.stdout,o.stderr=i.stderr)},i.nextTick(function(){o.initializeTTYs()}),t.exports=o},function(t,e,n){(function(t){function n(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function r(t){return"boolean"==typeof t}function i(t){return null===t}function o(t){return null==t}function s(t){return"number"==typeof t}function a(t){return"string"==typeof t}function u(t){return"symbol"==typeof t}function c(t){return void 0===t}function f(t){return"[object RegExp]"===g(t)}function h(t){return"object"==typeof t&&null!==t}function p(t){return"[object Date]"===g(t)}function l(t){return"[object Error]"===g(t)||t instanceof Error}function d(t){return"function"==typeof t}function y(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function g(t){return Object.prototype.toString.call(t)}e.isArray=n,e.isBoolean=r,e.isNull=i,e.isNullOrUndefined=o,e.isNumber=s,e.isString=a,e.isSymbol=u,e.isUndefined=c,e.isRegExp=f,e.isObject=h,e.isDate=p,e.isError=l,e.isFunction=d,e.isPrimitive=y,e.isBuffer=t.isBuffer}).call(e,n(9))},function(t,e,n){"use strict";function r(t){if(t>J)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(t)}return o(t,e,n)}function o(t,e,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return q(t)?h(t,e,n):"string"==typeof t?c(t,e):p(t)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,e,n){return s(t),t<=0?r(t):void 0!==e?"string"==typeof n?r(t).fill(e,n):r(t).fill(e):r(t)}function u(t){return s(t),r(t<0?0:0|l(t))}function c(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(t,e),o=r(n),s=o.write(t,e);return s!==n&&(o=o.slice(0,s)),o}function f(t){for(var e=t.length<0?0:0|l(t.length),n=r(e),i=0;i<e;i+=1)n[i]=255&t[i];return n}function h(t,e,n){if(e<0||t.byteLength<e)throw new RangeError("'offset' is out of bounds");if(t.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");var r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),r.__proto__=i.prototype,r}function p(t){if(i.isBuffer(t)){var e=0|l(t.length),n=r(e);return 0===n.length?n:(t.copy(n,0,0,e),n)}if(t){if(Y(t)||"length"in t)return"number"!=typeof t.length||H(t.length)?r(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function l(t){if(t>=J)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J.toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),i.alloc(+t)}function y(t,e){if(i.isBuffer(t))return t.length;if(Y(t)||q(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(r)return j(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return N(this,e,n);case"ascii":return R(this,e,n);case"latin1":case"binary":return T(this,e,n);case"base64":return k(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function w(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,H(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}var c;if(i){var f=-1;for(c=n;c<a;c++)if(o(t,c)===o(e,-1===f?0:c-f)){if(-1===f&&(f=c),c-f+1===u)return f*s}else-1!==f&&(c-=c-f),f=-1}else for(n+u>a&&(n=a-u),c=n;c>=0;c--){for(var h=!0,p=0;p<u;p++)if(o(t,c+p)!==o(e,p)){h=!1;break}if(h)return c}return-1}function _(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(H(a))return s;t[n+s]=a}return s}function b(t,e,n,r){return Z(j(e,t.length-n),t,n,r)}function E(t,e,n,r){return Z(z(e),t,n,r)}function S(t,e,n,r){return E(t,e,n,r)}function I(t,e,n,r){return Z(V(e),t,n,r)}function O(t,e,n,r){return Z(W(e,t.length-n),t,n,r)}function k(t,e,n){return 0===e&&n===t.length?X.fromByteArray(t):X.fromByteArray(t.slice(e,n))}function N(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,c,f,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],128==(192&u)&&(h=(31&o)<<6|63&u)>127&&(s=h);break;case 3:u=t[i+1],c=t[i+2],128==(192&u)&&128==(192&c)&&(h=(15&o)<<12|(63&u)<<6|63&c)>2047&&(h<55296||h>57343)&&(s=h);break;case 4:u=t[i+1],c=t[i+2],f=t[i+3],128==(192&u)&&128==(192&c)&&128==(192&f)&&(h=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&f)>65535&&h<1114112&&(s=h)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return F(r)}function F(t){var e=t.length;if(e<=G)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=G));return n}function R(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function L(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=B(t[o]);return i}function x(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function A(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,n,r,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function C(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(t,e,n,r,i){return e=+e,n>>>=0,i||C(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(t,e,n,r,23,4),n+4}function M(t,e,n,r,i){return e=+e,n>>>=0,i||C(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(t,e,n,r,52,8),n+8}function U(t){if(t=t.trim().replace(Q,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function W(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function V(t){return X.toByteArray(U(t))}function Z(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function q(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function Y(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function H(t){return t!==t}/*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
   * @license  MIT
   */
  var X=n(20),K=n(21);e.Buffer=i,e.SlowBuffer=d,e.INSPECT_MAX_BYTES=50;var J=2147483647;e.kMaxLength=J,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,n){return o(t,e,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,n){return a(t,e,n)},i.allocUnsafe=function(t){return u(t)},i.allocUnsafeSlow=function(t){return u(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,s=Math.min(n,r);o<s;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=i.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var s=t[n];if(!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},i.byteLength=y,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?N(this,0,t):g.apply(this,arguments)},i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},i.prototype.compare=function(t,e,n,r,o){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var s=o-r,a=n-e,u=Math.min(s,a),c=this.slice(r,o),f=t.slice(e,n),h=0;h<u;++h)if(c[h]!==f[h]){s=c[h],a=f[h];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},i.prototype.indexOf=function(t,e,n){return w(this,t,e,n,!0)},i.prototype.lastIndexOf=function(t,e,n){return w(this,t,e,n,!1)},i.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return b(this,t,e,n);case"ascii":return E(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return I(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var G=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return r.__proto__=i.prototype,r},i.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},i.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},i.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},i.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),K.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),K.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),K.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),K.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){D(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){D(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var i=Math.pow(2,8*n-1);D(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return M(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return M(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},i.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var s;if("number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var a=i.isBuffer(t)?t:new i(t,r),u=a.length;for(s=0;s<n-e;++s)this[s+e]=a[s%u]}return this};var Q=/[^+\/0-9A-Za-z-_]/g},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;u<i;u++)c[u].apply(this,a);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";(function(e){function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=n:t.exports=e.nextTick}).call(e,n(2))},function(t,e,n){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.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},e.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 void t.set(e.subarray(n,n+r),i);for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){var e,n,r,i,o,s;for(r=0,e=0,n=t.length;e<n;e++)r+=t[e].length;for(s=new Uint8Array(r),i=0,e=0,n=t.length;e<n;e++)o=t[e],s.set(o,i),i+=o.length;return s}},o={arraySet:function(t,e,n,r,i){for(var o=0;o<r;o++)t[i+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,i)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(r)},function(t,e,n){t.exports=n(4).Buffer},function(t,e,n){e=t.exports=n(14),e.Stream=e,e.Readable=e,e.Writable=n(12),e.Duplex=n(0),e.Transform=n(18),e.PassThrough=n(29)},function(t,e,n){function r(t,e){for(var n in t)e[n]=t[n]}function i(t,e,n){return s(t,e,n)}var o=n(4),s=o.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=o:(r(o,e),e.Buffer=i),r(s,i),i.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,n)},i.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=s(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},i.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},i.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e,r){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){k(e,t)}}function o(t){return A.from(t)}function s(t){return A.isBuffer(t)||t instanceof D}function a(){}function u(t,e){F=F||n(0),t=t||{},this.objectMode=!!t.objectMode,e instanceof F&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){m(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function c(t){if(F=F||n(0),!(P.call(c,this)||this instanceof F))return new c(t);this._writableState=new u(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),x.call(this)}function f(t,e){var n=new Error("write after end");t.emit("error",n),N(e,n)}function h(t,e,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),N(r,o),i=!1),i}function p(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=A.from(e,n)),e}function l(t,e,n,r,i,o){if(!n){var s=p(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else d(t,e,!1,a,r,i,o);return u}function d(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function y(t,e,n,r,i){--e.pendingcb,n?(N(i,r),N(I,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),I(t,e))}function g(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function m(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(g(n),e)y(t,n,r,e,i);else{var o=b(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||_(t,n),r?R(w,t,n,o,i):w(t,n,o,i)}}function w(t,e,n,r){n||v(t,e),e.pendingcb--,r(),I(t,e)}function v(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function _(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,o=new Array(r),s=e.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)o[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;o.allBuffers=u,d(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e)}else{for(;n;){var c=n.chunk,f=n.encoding,h=n.callback;if(d(t,e,!1,e.objectMode?1:c.length,c,f,h),n=n.next,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=n,e.bufferProcessing=!1}function b(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),I(t,e)})}function S(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,N(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function I(t,e){var n=b(e);return n&&(S(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}function O(t,e,n){e.ending=!0,I(t,e),n&&(e.finished?N(n):t.once("finish",n)),e.ended=!0,t.writable=!1}function k(t,e,n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}var N=n(7);t.exports=c;var F,R=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?setImmediate:N;c.WritableState=u;var T=n(3);T.inherits=n(1);var L={deprecate:n(28)},x=n(15),A=n(11).Buffer,D=r.Uint8Array||function(){},C=n(16);T.inherits(c,x),u.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(u.prototype,"buffer",{get:L.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var P;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(P=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(t){return!!P.call(this,t)||t&&t._writableState instanceof u}})):P=function(t){return t instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(t,e,n){var r=this._writableState,i=!1,u=s(t)&&!r.objectMode;return u&&!A.isBuffer(t)&&(t=o(t)),"function"==typeof e&&(n=e,e=null),u?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=a),r.ended?f(this,n):(u||h(this,r,t,n))&&(r.pendingcb++,i=l(this,r,u,t,e,n)),i},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},c.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},c.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||O(this,r,n)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),c.prototype.destroy=C.destroy,c.prototype._undestroy=C.undestroy,c.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n(2),n(5))},function(t,e,n){"use strict";(function(e){function n(t){var e=r.exec(t);return e.shift(),e}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(){function t(){}return t.normalize=function(e){""===e&&(e=".");var n=e.charAt(0)===t.sep;e=t._removeDuplicateSeps(e);for(var r=e.split(t.sep),i=[],o=0;o<r.length;o++){var s=r[o];"."!==s&&(".."===s&&(n||!n&&i.length>0&&".."!==i[0])?i.pop():i.push(s))}if(!n&&i.length<2)switch(i.length){case 1:""===i[0]&&i.unshift(".");break;default:i.push(".")}return e=i.join(t.sep),n&&e.charAt(0)!==t.sep&&(e=t.sep+e),e},t.join=function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];for(var r=[],i=0;i<e.length;i++){var o=e[i];if("string"!=typeof o)throw new TypeError("Invalid argument type to path.join: "+typeof o);""!==o&&r.push(o)}return t.normalize(r.join(t.sep))},t.resolve=function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];for(var i=[],o=0;o<n.length;o++){var s=n[o];if("string"!=typeof s)throw new TypeError("Invalid argument type to path.join: "+typeof s);""!==s&&(s.charAt(0)===t.sep&&(i=[]),i.push(s))}var a=t.normalize(i.join(t.sep));if(a.length>1&&a.charAt(a.length-1)===t.sep)return a.substr(0,a.length-1);if(a.charAt(0)!==t.sep){"."!==a.charAt(0)||1!==a.length&&a.charAt(1)!==t.sep||(a=1===a.length?"":a.substr(2));var u=e.cwd();a=""!==a?this.normalize(u+("/"!==u?t.sep:"")+a):u}return a},t.relative=function(e,n){var r;e=t.resolve(e),n=t.resolve(n);var i=e.split(t.sep),o=n.split(t.sep);o.shift(),i.shift();var s=0,a=[];for(r=0;r<i.length;r++){if(i[r]!==o[r]){s=i.length-r;break}}a=o.slice(r),1===i.length&&""===i[0]&&(s=0),s>i.length&&(s=i.length);var u="";for(r=0;r<s;r++)u+="../";return u+=a.join(t.sep),u.length>1&&u.charAt(u.length-1)===t.sep&&(u=u.substr(0,u.length-1)),u},t.dirname=function(e){e=t._removeDuplicateSeps(e);var n=e.charAt(0)===t.sep,r=e.split(t.sep);return""===r.pop()&&r.length>0&&r.pop(),r.length>1||1===r.length&&!n?r.join(t.sep):n?t.sep:"."},t.basename=function(e,n){if(void 0===n&&(n=""),""===e)return e;e=t.normalize(e);var r=e.split(t.sep),i=r[r.length-1];if(""===i&&r.length>1)return r[r.length-2];if(n.length>0){if(i.substr(i.length-n.length)===n)return i.substr(0,i.length-n.length)}return i},t.extname=function(e){e=t.normalize(e);var n=e.split(t.sep);if(e=n.pop(),""===e&&n.length>0&&(e=n.pop()),".."===e)return"";var r=e.lastIndexOf(".");return-1===r||0===r?"":e.substr(r)},t.isAbsolute=function(e){return e.length>0&&e.charAt(0)===t.sep},t._makeLong=function(t){return t},t.parse=function(t){var e=n(t);return{root:e[0],dir:e[0]+e[1].slice(0,-1),base:e[2],ext:e[3],name:e[2].slice(0,e[2].length-e[3].length)}},t.format=function(e){if(null===e||"object"!=typeof e)throw new TypeError("Parameter 'pathObject' must be an object, not "+typeof e);if("string"!=typeof(e.root||""))throw new TypeError("'pathObject.root' must be a string or undefined, not "+typeof e.root);return(e.dir?e.dir+t.sep:"")+(e.base||"")},t._removeDuplicateSeps=function(t){return t=t.replace(this._replaceRegex,this.sep)},t.sep="/",t._replaceRegex=new RegExp("//+","g"),t.delimiter=":",t.posix=t,t.win32=t,t}();t.exports=i}).call(e,n(2))},function(t,e,n){"use strict";(function(e,r){function i(t){return M.from(t)}function o(t){return M.isBuffer(t)||t instanceof U}function s(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?D(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}function a(t,e){A=A||n(0),t=t||{},this.objectMode=!!t.objectMode,e instanceof A&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new V,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(W||(W=n(17).StringDecoder),this.decoder=new W(t.encoding),this.encoding=t.encoding)}function u(t){if(A=A||n(0),!(this instanceof u))return new u(t);this._readableState=new a(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),P.call(this)}function c(t,e,n,r,o){var s=t._readableState;if(null===e)s.reading=!1,y(t,s);else{var a;o||(a=h(s,e)),a?t.emit("error",a):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===M.prototype||(e=i(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):f(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?f(t,s,e,!1):w(t,s)):f(t,s,e,!1))):r||(s.reading=!1)}return p(s)}function f(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&g(t)),w(t,e)}function h(t,e){var n;return o(e)||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function p(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function l(t){return t>=Y?t=Y:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function d(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=l(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function y(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,g(t)}}function g(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(z("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?x(m,t):m(t))}function m(t){z("emit readable"),t.emit("readable"),I(t)}function w(t,e){e.readingMore||(e.readingMore=!0,x(v,t,e))}function v(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(z("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function _(t){return function(){var e=t._readableState;z("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&C(t,"data")&&(e.flowing=!0,I(t))}}function b(t){z("readable nexttick read 0"),t.read(0)}function E(t,e){e.resumeScheduled||(e.resumeScheduled=!0,x(S,t,e))}function S(t,e){e.reading||(z("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),I(t),e.flowing&&!e.reading&&t.read(0)}function I(t){var e=t._readableState;for(z("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){if(0===e.length)return null;var n;return e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=k(t,e.buffer,e.decoder),n}function k(t,e,n){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():n?N(t,e):F(t,e),r}function N(t,e){var n=e.head,r=1,i=n.data;for(t-=i.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function F(t,e){var n=M.allocUnsafe(t),r=e.head,i=1;for(r.data.copy(n),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,x(T,e,t))}function T(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function L(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}var x=n(7);t.exports=u;var A,D=n(25);u.ReadableState=a;var C=(n(6).EventEmitter,function(t,e){return t.listeners(e).length}),P=n(15),M=n(11).Buffer,U=e.Uint8Array||function(){},B=n(3);B.inherits=n(1);var j=n(26),z=void 0;z=j&&j.debuglog?j.debuglog("stream"):function(){};var W,V=n(27),Z=n(16);B.inherits(u,P);var q=["error","close","destroy","pause","resume"];Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),u.prototype.destroy=Z.destroy,u.prototype._undestroy=Z.undestroy,u.prototype._destroy=function(t,e){this.push(null),e(t)},u.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=M.from(t,e),e=""),n=!0),c(this,t,e,!1,n)},u.prototype.unshift=function(t){return c(this,t,null,!0,!1)},u.prototype.isPaused=function(){return!1===this._readableState.flowing},u.prototype.setEncoding=function(t){return W||(W=n(17).StringDecoder),this._readableState.decoder=new W(t),this._readableState.encoding=t,this};var Y=8388608;u.prototype.read=function(t){z("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return z("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):g(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&R(this),null;var r=e.needReadable;z("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&(r=!0,z("length less than watermark",r)),e.ended||e.reading?(r=!1,z("reading or ended",r)):r&&(z("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=d(n,e)));var i;return i=t>0?O(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&R(this)),null!==i&&this.emit("data",i),i},u.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},u.prototype.pipe=function(t,e){function n(t,e){z("onunpipe"),t===p&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,o())}function i(){z("onend"),t.end()}function o(){z("cleanup"),t.removeListener("close",c),t.removeListener("finish",f),t.removeListener("drain",g),t.removeListener("error",u),t.removeListener("unpipe",n),p.removeListener("end",i),p.removeListener("end",h),p.removeListener("data",a),m=!0,!l.awaitDrain||t._writableState&&!t._writableState.needDrain||g()}function a(e){z("ondata"),w=!1,!1!==t.write(e)||w||((1===l.pipesCount&&l.pipes===t||l.pipesCount>1&&-1!==L(l.pipes,t))&&!m&&(z("false write response, pause",p._readableState.awaitDrain),p._readableState.awaitDrain++,w=!0),p.pause())}function u(e){z("onerror",e),h(),t.removeListener("error",u),0===C(t,"error")&&t.emit("error",e)}function c(){t.removeListener("finish",f),h()}function f(){z("onfinish"),t.removeListener("close",c),h()}function h(){z("unpipe"),p.unpipe(t)}var p=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=t;break;case 1:l.pipes=[l.pipes,t];break;default:l.pipes.push(t)}l.pipesCount+=1,z("pipe count=%d opts=%j",l.pipesCount,e);var d=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr,y=d?i:h;l.endEmitted?x(y):p.once("end",y),t.on("unpipe",n);var g=_(p);t.on("drain",g);var m=!1,w=!1;return p.on("data",a),s(t,"error",u),t.once("close",c),t.once("finish",f),t.emit("pipe",p),l.flowing||(z("pipe resume"),p.resume()),t},u.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var s=L(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},u.prototype.on=function(t,e){var n=P.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&g(this):x(b,this))}return n},u.prototype.addListener=u.prototype.on,u.prototype.resume=function(){var t=this._readableState;return t.flowing||(z("resume"),t.flowing=!0,E(this,t)),this},u.prototype.pause=function(){return z("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(z("pause"),this._readableState.flowing=!1,this.emit("pause")),this},u.prototype.wrap=function(t){var e=this._readableState,n=!1,r=this;t.on("end",function(){if(z("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&r.push(t)}r.push(null)}),t.on("data",function(i){if(z("wrapped data"),e.decoder&&(i=e.decoder.write(i)),(!e.objectMode||null!==i&&void 0!==i)&&(e.objectMode||i&&i.length)){r.push(i)||(n=!0,t.pause())}});for(var i in t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<q.length;o++)t.on(q[o],r.emit.bind(r,q[o]));return r._read=function(e){z("wrapped _read",e),n&&(n=!1,t.resume())},r},u._fromList=O}).call(e,n(5),n(2))},function(t,e,n){t.exports=n(6).EventEmitter},function(t,e,n){"use strict";function r(t,e){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(r||i)return void(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||s(o,this,t));this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(s(o,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)})}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(t,e){t.emit("error",e)}var s=n(7);t.exports={destroy:r,undestroy:i}},function(t,e,n){function r(t){if(t&&!u(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function s(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var a=n(4).Buffer,u=a.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=e.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),r(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(t){for(var e="";this.charLength;){var n=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";t=t.slice(n,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=e.charCodeAt(e.length-1);if(!(r>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,r=e.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var n=t[t.length-e];if(1==e&&n>>5==6){this.charLength=2;break}if(e<=2&&n>>4==14){this.charLength=3;break}if(e<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,n).toString(i)}return e}},function(t,e,n){"use strict";function r(t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(t,e,n){var r=t._transformState;r.transforming=!1;var i=r.writecb;if(!i)return t.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&t.push(n),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}function o(t){if(!(this instanceof o))return new o(t);a.call(this,t),this._transformState=new r(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(t,n){s(e,t,n)}):s(e)})}function s(t,e,n){if(e)return t.emit("error",e);null!==n&&void 0!==n&&t.push(n);var r=t._writableState,i=t._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}t.exports=o;var a=n(0),u=n(3);u.inherits=n(1),u.inherits(o,a),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var n=this;a.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";(function(t,r,i){function o(t){if(t)return t;throw new at(nt.EIO,"Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)")}function s(t,e){switch(typeof t){case"number":return t;case"string":var n=parseInt(t,8);return isNaN(n)?e:n;default:return e}}function a(t){if(t instanceof Date)return t;if("number"==typeof t)return new Date(1e3*t);throw new at(nt.EINVAL,"Invalid time.")}function u(t){if(t.indexOf("\0")>=0)throw new at(nt.EINVAL,"Path must be a string without null bytes.");if(""===t)throw new at(nt.EINVAL,"Path must not be empty.");return it.resolve(t)}function c(t,e,n,r){switch(typeof t){case"object":return{encoding:void 0!==t.encoding?t.encoding:e,flag:void 0!==t.flag?t.flag:n,mode:s(t.mode,r)};case"string":return{encoding:t,flag:n,mode:r};default:return{encoding:e,flag:n,mode:r}}}function f(){}function h(t,e,n,r,i){return t<e||n<e?t>n?n+1:t+1:r===i?e:e+1}function p(t,e){if(t===e)return 0;if(t.length>e.length){var n=t;t=e,e=n}for(var r=t.length,i=e.length;r>0&&t.charCodeAt(r-1)===e.charCodeAt(i-1);)r--,i--;for(var o=0;o<r&&t.charCodeAt(o)===e.charCodeAt(o);)o++;if(r-=o,i-=o,0===r||1===i)return i;for(var s=new Array(r<<1),a=0;a<r;)s[r+a]=t.charCodeAt(o+a),s[a]=++a;var u,c,f,p,l;for(u=0;u+3<i;)for(var d=e.charCodeAt(o+(c=u)),y=e.charCodeAt(o+(f=u+1)),g=e.charCodeAt(o+(p=u+2)),m=e.charCodeAt(o+(l=u+3)),w=u+=4,v=0;v<r;){var _=s[r+v],b=s[v];c=h(b,c,f,d,_),f=h(c,f,p,y,_),p=h(f,p,l,g,_),w=h(p,l,w,m,_),s[v++]=w,l=p,p=f,f=c,c=b}for(var E=0;u<i;){var S=e.charCodeAt(o+(c=u));E=++u;for(var I=0;I<r;I++){var O=s[I];s[I]=E=O<c||E<c?O>E?E+1:O+1:S===s[r+I]?c:c+1,c=O}}return E}function l(t,e,n){t&&console.warn("["+e+"] Direct file system constructor usage is deprecated for this file system, and will be removed in the next major version. Please use the '"+e+".Create("+JSON.stringify(n)+", callback)' method instead. See https://github.com/jvilk/BrowserFS/issues/176 for more details.")}function d(){throw new Error("BFS has reached an impossible code path; please file a bug.")}function y(t,e,n){n.existsSync(t)||(y(it.dirname(t),e,n),n.mkdirSync(t,e))}function g(t){var e=m(t),n=e.byteOffset,r=e.byteLength;return 0===n&&r===e.buffer.byteLength?e.buffer:e.buffer.slice(n,n+r)}function m(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function w(e){return e instanceof t?e:e instanceof Uint8Array?v(e):t.from(e)}function v(e){return e instanceof t?e:0===e.byteOffset&&e.byteLength===e.buffer.byteLength?_(e.buffer):t.from(e.buffer,e.byteOffset,e.byteLength)}function _(e){return t.from(e)}function b(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=t.length),e<0||n<0||n>t.length||e>n)throw new TypeError("Invalid slice bounds on buffer of length "+t.length+": ["+e+", "+n+"]");if(0===t.length)return E();var r=m(t),i=t[0],o=(i+1)%255;return t[0]=o,r[0]===o?(r[0]=i,v(r.slice(e,n))):(t[0]=i,v(r.subarray(e,n)))}function E(){return vt||(vt=t.alloc(0))}function S(e,n){t.isBuffer(e)?n():n(new at(nt.EINVAL,"option must be a Buffer."))}function I(t,e,n){function r(t){a||(t&&(a=!0,n(t)),0===--s&&u&&n())}var i=t.Options,o=t.Name,s=0,a=!1,u=!1;for(var c in i){var f=function(t){if(i.hasOwnProperty(t)){var u=i[t],c=e[t];if(void 0===c||null===c){if(!u.optional){var f=Object.keys(e).filter(function(t){return!(t in i)}).map(function(e){return{str:e,distance:p(t,e)}}).filter(function(t){return t.distance<5}).sort(function(t,e){return t.distance-e.distance});return a?{}:(a=!0,{v:n(new at(nt.EINVAL,"["+o+"] Required option '"+t+"' not provided."+(f.length>0?" You provided unrecognized option '"+f[0].str+"'; perhaps you meant to type '"+t+"'.":"")+"\nOption description: "+u.description))})}}else{if(!(Array.isArray(u.type)?-1!==u.type.indexOf(typeof c):typeof c===u.type))return a?{}:(a=!0,{v:n(new at(nt.EINVAL,"["+o+"] Value provided for option "+t+" is not the proper type. Expected "+(Array.isArray(u.type)?"one of {"+u.type.join(", ")+"}":u.type)+", but received "+typeof c+"\nOption description: "+u.description))});u.validator&&(s++,u.validator(c,r))}}}(c);if(f)return f.v}u=!0,0!==s||a||n()}function O(){return xt||(xt=t.from("{}"))}function k(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function N(t,e){return!t||(e(t),!1)}function F(t,e,n){return!t||(e.abort(function(){n(t)}),!1)}function R(t,e){switch(void 0===e&&(e=t.toString()),t.name){case"NotFoundError":return new at(nt.ENOENT,e);case"QuotaExceededError":return new at(nt.ENOSPC,e);default:return new at(nt.EIO,e)}}function T(t,e,n){return void 0===e&&(e=nt.EIO),void 0===n&&(n=null),function(r){r.preventDefault(),t(new at(e,null!==n?n:void 0))}}function L(t,e,n){return e?function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var r=e[0],i=this._getFs(r);e[0]=i.path;try{return i.fs[t].apply(i.fs,e)}catch(t){throw this.standardizeError(t,i.path,r),t}}:function(){for(var e=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];var i=n[0],o=this._getFs(i);if(n[0]=o.path,"function"==typeof n[n.length-1]){var s=n[n.length-1];n[n.length-1]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];t.length>0&&t[0]instanceof at&&e.standardizeError(t[0],o.path,i),s.apply(null,t)}}return o.fs[t].apply(o.fs,n)}}function x(t){return{type:re.API_ERROR,errorData:j(t.writeToBuffer())}}function A(t){return at.fromBuffer(z(t.errorData))}function D(t){return{type:re.ERROR,name:t.name,message:t.message,stack:t.stack}}function C(t){var e=jt[t.name];"function"!=typeof e&&(e=Error);var n=new e(t.message);return n.stack=t.stack,n}function P(t){return{type:re.STATS,statsData:j(t.toBuffer())}}function M(t){return ht.fromBuffer(z(t.statsData))}function U(t){return{type:re.FILEFLAG,flagStr:t.getFlagString()}}function B(t){return ct.getFileFlag(t.flagStr)}function j(t){return g(t)}function z(t){return _(t)}function W(t){return{type:re.BUFFER,data:j(t)}}function V(t){return z(t.data)}function Z(t){return t&&"object"==typeof t&&t.hasOwnProperty("browserfsMessage")&&t.browserfsMessage}function q(t){return t&&"object"==typeof t&&t.hasOwnProperty("browserfsMessage")&&t.browserfsMessage}function Y(t){return!!t&&t.isFile()}function H(t){return!!t&&t.isDir()}function X(t,e){var n=31&e,r=(e>>5&15)-1,i=1980+(e>>9),o=31&t,s=t>>5&63,a=t>>11;return new Date(i,r,n,a,s,o)}function K(t,e,n,r){return 0===r?"":e?t.toString("utf8",n,n+r):ue.byte2str(t.slice(n,n+r))}function J(e){e.Buffer=t,e.process=i;var n=e.require?e.require:null;e.require=function(t){var e=Q(t);return e||n.apply(null,Array.prototype.slice.call(arguments,0))}}function G(t,e){Pe[t]=e}function Q(t){switch(t){case"fs":return yt;case"path":return it;case"buffer":return rt;case"process":return i;case"bfs_utils":return _t;default:return Pe[t]}}function $(t){return yt.initialize(t)}function tt(t,e){et(t,function(t,n){n?($(n),e()):e(t)})}function et(t,e){function n(){if(!s){s=!0;var t=Pe[r];t?t.Create(i,e):e(new at(nt.EPERM,"File system "+r+" is not available in BrowserFS."))}}var r=t.fs;if(!r)return e(new at(nt.EPERM,'Missing "fs" property on configuration object.'));var i=t.options,o=0,s=!1;if(null!==i&&"object"==typeof i){var a=!1;Object.keys(i).filter(function(t){return"fs"!==t}).forEach(function(t){var r=i[t];null!==r&&"object"==typeof r&&r.fs&&(o++,et(r,function(r,u){if(o--,r){if(s)return;s=!0,e(r)}else i[t]=u,0===o&&a&&n()}))}),a=!0}0===o&&n()}Object.defineProperty(e,"__esModule",{value:!0});var nt,rt=n(4),it=n(13);!function(t){t[t.EPERM=1]="EPERM",t[t.ENOENT=2]="ENOENT",t[t.EIO=5]="EIO",t[t.EBADF=9]="EBADF",t[t.EACCES=13]="EACCES",t[t.EBUSY=16]="EBUSY",t[t.EEXIST=17]="EEXIST",t[t.ENOTDIR=20]="ENOTDIR",t[t.EISDIR=21]="EISDIR",t[t.EINVAL=22]="EINVAL",t[t.EFBIG=27]="EFBIG",t[t.ENOSPC=28]="ENOSPC",t[t.EROFS=30]="EROFS",t[t.ENOTEMPTY=39]="ENOTEMPTY",t[t.ENOTSUP=95]="ENOTSUP"}(nt||(nt={}));var ot={};ot[nt.EPERM]="Operation not permitted.",ot[nt.ENOENT]="No such file or directory.",ot[nt.EIO]="Input/output error.",ot[nt.EBADF]="Bad file descriptor.",ot[nt.EACCES]="Permission denied.",ot[nt.EBUSY]="Resource busy or locked.",ot[nt.EEXIST]="File exists.",ot[nt.ENOTDIR]="File is not a directory.",ot[nt.EISDIR]="File is a directory.",ot[nt.EINVAL]="Invalid argument.",ot[nt.EFBIG]="File is too big.",ot[nt.ENOSPC]="No space left on disk.",ot[nt.EROFS]="Cannot modify a read-only file system.",ot[nt.ENOTEMPTY]="Directory is not empty.",ot[nt.ENOTSUP]="Operation is not supported.";var st,at=function(e){function n(t,n,r){void 0===n&&(n=ot[t]),e.call(this,n),this.syscall="",this.errno=t,this.code=nt[t],this.path=r,this.stack=(new e).stack,this.message="Error: "+this.code+": "+n+(this.path?", '"+this.path+"'":"")}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.fromJSON=function(t){var e=new n(0);return e.errno=t.errno,e.code=t.code,e.path=t.path,e.stack=t.stack,e.message=t.message,e},n.fromBuffer=function(t,e){return void 0===e&&(e=0),n.fromJSON(JSON.parse(t.toString("utf8",e+4,e+4+t.readUInt32LE(e))))},n.FileError=function(t,e){return new n(t,ot[t],e)},n.ENOENT=function(t){return this.FileError(nt.ENOENT,t)},n.EEXIST=function(t){return this.FileError(nt.EEXIST,t)},n.EISDIR=function(t){return this.FileError(nt.EISDIR,t)},n.ENOTDIR=function(t){return this.FileError(nt.ENOTDIR,t)},n.EPERM=function(t){return this.FileError(nt.EPERM,t)},n.ENOTEMPTY=function(t){return this.FileError(nt.ENOTEMPTY,t)},n.prototype.toString=function(){return this.message},n.prototype.toJSON=function(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message}},n.prototype.writeToBuffer=function(e,n){void 0===e&&(e=t.alloc(this.bufferSize())),void 0===n&&(n=0);var r=e.write(JSON.stringify(this.toJSON()),n+4);return e.writeUInt32LE(r,n),e},n.prototype.bufferSize=function(){return 4+t.byteLength(JSON.stringify(this.toJSON()))},n}(Error),ut=Object.freeze({get ErrorCode(){return nt},ErrorStrings:ot,ApiError:at});!function(t){t[t.NOP=0]="NOP",t[t.THROW_EXCEPTION=1]="THROW_EXCEPTION",t[t.TRUNCATE_FILE=2]="TRUNCATE_FILE",t[t.CREATE_FILE=3]="CREATE_FILE"}(st||(st={}));var ct=function t(e){if(this.flagStr=e,t.validFlagStrs.indexOf(e)<0)throw new at(nt.EINVAL,"Invalid flag: "+e)};ct.getFileFlag=function(t){return ct.flagCache.hasOwnProperty(t)?ct.flagCache[t]:ct.flagCache[t]=new ct(t)},ct.prototype.getFlagString=function(){return this.flagStr},ct.prototype.isReadable=function(){return-1!==this.flagStr.indexOf("r")||-1!==this.flagStr.indexOf("+")},ct.prototype.isWriteable=function(){return-1!==this.flagStr.indexOf("w")||-1!==this.flagStr.indexOf("a")||-1!==this.flagStr.indexOf("+")},ct.prototype.isTruncating=function(){return-1!==this.flagStr.indexOf("w")},ct.prototype.isAppendable=function(){return-1!==this.flagStr.indexOf("a")},ct.prototype.isSynchronous=function(){return-1!==this.flagStr.indexOf("s")},ct.prototype.isExclusive=function(){return-1!==this.flagStr.indexOf("x")},ct.prototype.pathExistsAction=function(){return this.isExclusive()?st.THROW_EXCEPTION:this.isTruncating()?st.TRUNCATE_FILE:st.NOP},ct.prototype.pathNotExistsAction=function(){return(this.isWriteable()||this.isAppendable())&&"r+"!==this.flagStr?st.CREATE_FILE:st.THROW_EXCEPTION},ct.flagCache={},ct.validFlagStrs=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];var ft;!function(t){t[t.FILE=32768]="FILE",t[t.DIRECTORY=16384]="DIRECTORY",t[t.SYMLINK=40960]="SYMLINK"}(ft||(ft={}));var ht=function(t,e,n,r,i,o){if(void 0===r&&(r=new Date),void 0===i&&(i=new Date),void 0===o&&(o=new Date),this.size=e,this.atime=r,this.mtime=i,this.ctime=o,this.dev=0,this.ino=0,this.rdev=0,this.nlink=1,this.blksize=4096,this.uid=0,this.gid=0,this.birthtime=new Date(0),this.fileData=null,n)this.mode=n;else switch(t){case ft.FILE:this.mode=420;break;case ft.DIRECTORY:default:this.mode=511}this.blocks=Math.ceil(e/512),this.mode<4096&&(this.mode|=t)};ht.fromBuffer=function(t){var e=t.readUInt32LE(0),n=t.readUInt32LE(4),r=t.readDoubleLE(8),i=t.readDoubleLE(16),o=t.readDoubleLE(24);return new ht(61440&n,e,4095&n,new Date(r),new Date(i),new Date(o))},ht.prototype.toBuffer=function(){var e=t.alloc(32);return e.writeUInt32LE(this.size,0),e.writeUInt32LE(this.mode,4),e.writeDoubleLE(this.atime.getTime(),8),e.writeDoubleLE(this.mtime.getTime(),16),e.writeDoubleLE(this.ctime.getTime(),24),e},ht.prototype.clone=function(){return new ht(61440&this.mode,this.size,4095&this.mode,this.atime,this.mtime,this.ctime)},ht.prototype.isFile=function(){return(61440&this.mode)===ft.FILE},ht.prototype.isDirectory=function(){return(61440&this.mode)===ft.DIRECTORY},ht.prototype.isSymbolicLink=function(){return(61440&this.mode)===ft.SYMLINK},ht.prototype.chmod=function(t){this.mode=61440&this.mode|t},ht.prototype.isSocket=function(){return!1},ht.prototype.isBlockDevice=function(){return!1},ht.prototype.isCharacterDevice=function(){return!1},ht.prototype.isFIFO=function(){return!1};var pt=function(t,e){return t},lt=function(){this.F_OK=0,this.R_OK=4,this.W_OK=2,this.X_OK=1,this.root=null,this.fdMap={},this.nextFd=100};lt.prototype.initialize=function(t){if(!t.constructor.isAvailable())throw new at(nt.EINVAL,"Tried to instantiate BrowserFS with an unavailable file system.");return this.root=t},lt.prototype._toUnixTimestamp=function(t){if("number"==typeof t)return t;if(t instanceof Date)return t.getTime()/1e3;throw new Error("Cannot parse time: "+t)},lt.prototype.getRootFS=function(){return this.root?this.root:null},lt.prototype.rename=function(t,e,n){void 0===n&&(n=f);var r=pt(n,1);try{o(this.root).rename(u(t),u(e),r)}catch(t){r(t)}},lt.prototype.renameSync=function(t,e){o(this.root).renameSync(u(t),u(e))},lt.prototype.exists=function(t,e){void 0===e&&(e=f);var n=pt(e,1);try{return o(this.root).exists(u(t),n)}catch(t){return n(!1)}},lt.prototype.existsSync=function(t){try{return o(this.root).existsSync(u(t))}catch(t){return!1}},lt.prototype.stat=function(t,e){void 0===e&&(e=f);var n=pt(e,2);try{return o(this.root).stat(u(t),!1,n)}catch(t){return n(t)}},lt.prototype.statSync=function(t){return o(this.root).statSync(u(t),!1)},lt.prototype.lstat=function(t,e){void 0===e&&(e=f);var n=pt(e,2);try{return o(this.root).stat(u(t),!0,n)}catch(t){return n(t)}},lt.prototype.lstatSync=function(t){return o(this.root).statSync(u(t),!0)},lt.prototype.truncate=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=f);var r=0;"function"==typeof e?n=e:"number"==typeof e&&(r=e);var i=pt(n,1);try{if(r<0)throw new at(nt.EINVAL);return o(this.root).truncate(u(t),r,i)}catch(t){return i(t)}},lt.prototype.truncateSync=function(t,e){if(void 0===e&&(e=0),e<0)throw new at(nt.EINVAL);return o(this.root).truncateSync(u(t),e)},lt.prototype.unlink=function(t,e){void 0===e&&(e=f);var n=pt(e,1);try{return o(this.root).unlink(u(t),n)}catch(t){return n(t)}},lt.prototype.unlinkSync=function(t){return o(this.root).unlinkSync(u(t))},lt.prototype.open=function(t,e,n,r){var i=this;void 0===r&&(r=f);var a=s(n,420);r="function"==typeof n?n:r;var c=pt(r,2);try{o(this.root).open(u(t),ct.getFileFlag(e),a,function(t,e){e?c(t,i.getFdForFile(e)):c(t)})}catch(t){c(t)}},lt.prototype.openSync=function(t,e,n){return void 0===n&&(n=420),this.getFdForFile(o(this.root).openSync(u(t),ct.getFileFlag(e),s(n,420)))},lt.prototype.readFile=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n=f);var r=c(e,null,"r",null);n="function"==typeof e?e:n;var i=pt(n,2);try{var s=ct.getFileFlag(r.flag);return s.isReadable()?o(this.root).readFile(u(t),r.encoding,s,i):i(new at(nt.EINVAL,"Flag passed to readFile must allow for reading."))}catch(t){return i(t)}},lt.prototype.readFileSync=function(t,e){void 0===e&&(e={});var n=c(e,null,"r",null),r=ct.getFileFlag(n.flag);if(!r.isReadable())throw new at(nt.EINVAL,"Flag passed to readFile must allow for reading.");return o(this.root).readFileSync(u(t),n.encoding,r)},lt.prototype.writeFile=function(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r=f);var i=c(n,"utf8","w",420);r="function"==typeof n?n:r;var s=pt(r,1);try{var a=ct.getFileFlag(i.flag);return a.isWriteable()?o(this.root).writeFile(u(t),e,i.encoding,a,i.mode,s):s(new at(nt.EINVAL,"Flag passed to writeFile must allow for writing."))}catch(t){return s(t)}},lt.prototype.writeFileSync=function(t,e,n){var r=c(n,"utf8","w",420),i=ct.getFileFlag(r.flag);if(!i.isWriteable())throw new at(nt.EINVAL,"Flag passed to writeFile must allow for writing.");return o(this.root).writeFileSync(u(t),e,r.encoding,i,r.mode)},lt.prototype.appendFile=function(t,e,n,r){void 0===r&&(r=f);var i=c(n,"utf8","a",420);r="function"==typeof n?n:r;var s=pt(r,1);try{var a=ct.getFileFlag(i.flag);if(!a.isAppendable())return s(new at(nt.EINVAL,"Flag passed to appendFile must allow for appending."));o(this.root).appendFile(u(t),e,i.encoding,a,i.mode,s)}catch(t){s(t)}},lt.prototype.appendFileSync=function(t,e,n){var r=c(n,"utf8","a",420),i=ct.getFileFlag(r.flag);if(!i.isAppendable())throw new at(nt.EINVAL,"Flag passed to appendFile must allow for appending.");return o(this.root).appendFileSync(u(t),e,r.encoding,i,r.mode)},lt.prototype.fstat=function(t,e){void 0===e&&(e=f);var n=pt(e,2);try{this.fd2file(t).stat(n)}catch(t){n(t)}},lt.prototype.fstatSync=function(t){return this.fd2file(t).statSync()},lt.prototype.close=function(t,e){var n=this;void 0===e&&(e=f);var r=pt(e,1);try{this.fd2file(t).close(function(e){e||n.closeFd(t),r(e)})}catch(t){r(t)}},lt.prototype.closeSync=function(t){this.fd2file(t).closeSync(),this.closeFd(t)},lt.prototype.ftruncate=function(t,e,n){void 0===n&&(n=f);var r="number"==typeof e?e:0;n="function"==typeof e?e:n;var i=pt(n,1);try{var o=this.fd2file(t);if(r<0)throw new at(nt.EINVAL);o.truncate(r,i)}catch(t){i(t)}},lt.prototype.ftruncateSync=function(t,e){void 0===e&&(e=0);var n=this.fd2file(t);if(e<0)throw new at(nt.EINVAL);n.truncateSync(e)},lt.prototype.fsync=function(t,e){void 0===e&&(e=f);var n=pt(e,1);try{this.fd2file(t).sync(n)}catch(t){n(t)}},lt.prototype.fsyncSync=function(t){this.fd2file(t).syncSync()},lt.prototype.fdatasync=function(t,e){void 0===e&&(e=f);var n=pt(e,1);try{this.fd2file(t).datasync(n)}catch(t){n(t)}},lt.prototype.fdatasyncSync=function(t){this.fd2file(t).datasyncSync()},lt.prototype.write=function(e,n,r,i,o,s){void 0===s&&(s=f);var a,u,c,h=null;if("string"==typeof n){var p="utf8";switch(typeof r){case"function":s=r;break;case"number":h=r,p="string"==typeof i?i:"utf8",s="function"==typeof o?o:s;break;default:return(s="function"==typeof i?i:"function"==typeof o?o:s)(new at(nt.EINVAL,"Invalid arguments."))}a=t.from(n,p),u=0,c=a.length}else a=n,u=r,c=i,h="number"==typeof o?o:null,s="function"==typeof o?o:s;var l=pt(s,3);try{var d=this.fd2file(e);void 0!==h&&null!==h||(h=d.getPos()),d.write(a,u,c,h,l)}catch(t){l(t)}},lt.prototype.writeSync=function(e,n,r,i,o){var s,a,u,c=0;if("string"==typeof n){u="number"==typeof r?r:null;var f="string"==typeof i?i:"utf8";c=0,s=t.from(n,f),a=s.length}else s=n,c=r,a=i,u="number"==typeof o?o:null;var h=this.fd2file(e);return void 0!==u&&null!==u||(u=h.getPos()),h.writeSync(s,c,a,u)},lt.prototype.read=function(e,n,r,i,o,s){void 0===s&&(s=f);var a,u,c,h,p;if("number"==typeof n){c=n,a=r;var l=i;s="function"==typeof o?o:s,u=0,h=t.alloc(c),p=pt(function(t,e,n){if(t)return s(t);s(t,n.toString(l),e)},3)}else h=n,u=r,c=i,a=o,p=pt(s,3);try{var d=this.fd2file(e);void 0!==a&&null!==a||(a=d.getPos()),d.read(h,u,c,a,p)}catch(t){p(t)}},lt.prototype.readSync=function(e,n,r,i,o){var s,a,u,c,f=!1,h="utf8";"number"==typeof n?(u=n,c=r,h=i,a=0,s=t.alloc(u),f=!0):(s=n,a=r,u=i,c=o);var p=this.fd2file(e);void 0!==c&&null!==c||(c=p.getPos());var l=p.readSync(s,a,u,c);return f?[s.toString(h),l]:l},lt.prototype.fchown=function(t,e,n,r){void 0===r&&(r=f);var i=pt(r,1);try{this.fd2file(t).chown(e,n,i)}catch(t){i(t)}},lt.prototype.fchownSync=function(t,e,n){this.fd2file(t).chownSync(e,n)},lt.prototype.fchmod=function(t,e,n){var r=pt(n,1);try{var i="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmod(i,r)}catch(t){r(t)}},lt.prototype.fchmodSync=function(t,e){var n="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmodSync(n)},lt.prototype.futimes=function(t,e,n,r){void 0===r&&(r=f);var i=pt(r,1);try{var o=this.fd2file(t);"number"==typeof e&&(e=new Date(1e3*e)),"number"==typeof n&&(n=new Date(1e3*n)),o.utimes(e,n,i)}catch(t){i(t)}},lt.prototype.futimesSync=function(t,e,n){this.fd2file(t).utimesSync(a(e),a(n))},lt.prototype.rmdir=function(t,e){void 0===e&&(e=f);var n=pt(e,1);try{t=u(t),o(this.root).rmdir(t,n)}catch(t){n(t)}},lt.prototype.rmdirSync=function(t){return t=u(t),o(this.root).rmdirSync(t)},lt.prototype.mkdir=function(t,e,n){void 0===n&&(n=f),"function"==typeof e&&(n=e,e=511);var r=pt(n,1);try{t=u(t),o(this.root).mkdir(t,e,r)}catch(t){r(t)}},lt.prototype.mkdirSync=function(t,e){o(this.root).mkdirSync(u(t),s(e,511))},lt.prototype.readdir=function(t,e){void 0===e&&(e=f);var n=pt(e,2);try{t=u(t),o(this.root).readdir(t,n)}catch(t){n(t)}},lt.prototype.readdirSync=function(t){return t=u(t),o(this.root).readdirSync(t)},lt.prototype.link=function(t,e,n){void 0===n&&(n=f);var r=pt(n,1);try{t=u(t),e=u(e),o(this.root).link(t,e,r)}catch(t){r(t)}},lt.prototype.linkSync=function(t,e){return t=u(t),e=u(e),o(this.root).linkSync(t,e)},lt.prototype.symlink=function(t,e,n,r){void 0===r&&(r=f);var i="string"==typeof n?n:"file";r="function"==typeof n?n:r;var s=pt(r,1);try{if("file"!==i&&"dir"!==i)return s(new at(nt.EINVAL,"Invalid type: "+i));t=u(t),e=u(e),o(this.root).symlink(t,e,i,s)}catch(t){s(t)}},lt.prototype.symlinkSync=function(t,e,n){if(n){if("file"!==n&&"dir"!==n)throw new at(nt.EINVAL,"Invalid type: "+n)}else n="file";return t=u(t),e=u(e),o(this.root).symlinkSync(t,e,n)},lt.prototype.readlink=function(t,e){void 0===e&&(e=f);var n=pt(e,2);try{t=u(t),o(this.root).readlink(t,n)}catch(t){n(t)}},lt.prototype.readlinkSync=function(t){return t=u(t),o(this.root).readlinkSync(t)},lt.prototype.chown=function(t,e,n,r){void 0===r&&(r=f);var i=pt(r,1);try{t=u(t),o(this.root).chown(t,!1,e,n,i)}catch(t){i(t)}},lt.prototype.chownSync=function(t,e,n){t=u(t),o(this.root).chownSync(t,!1,e,n)},lt.prototype.lchown=function(t,e,n,r){void 0===r&&(r=f);var i=pt(r,1);try{t=u(t),o(this.root).chown(t,!0,e,n,i)}catch(t){i(t)}},lt.prototype.lchownSync=function(t,e,n){t=u(t),o(this.root).chownSync(t,!0,e,n)},lt.prototype.chmod=function(t,e,n){void 0===n&&(n=f);var r=pt(n,1);try{var i=s(e,-1);if(i<0)throw new at(nt.EINVAL,"Invalid mode.");o(this.root).chmod(u(t),!1,i,r)}catch(t){r(t)}},lt.prototype.chmodSync=function(t,e){var n=s(e,-1);if(n<0)throw new at(nt.EINVAL,"Invalid mode.");t=u(t),o(this.root).chmodSync(t,!1,n)},lt.prototype.lchmod=function(t,e,n){void 0===n&&(n=f);var r=pt(n,1);try{var i=s(e,-1);if(i<0)throw new at(nt.EINVAL,"Invalid mode.");o(this.root).chmod(u(t),!0,i,r)}catch(t){r(t)}},lt.prototype.lchmodSync=function(t,e){var n=s(e,-1);if(n<1)throw new at(nt.EINVAL,"Invalid mode.");o(this.root).chmodSync(u(t),!0,n)},lt.prototype.utimes=function(t,e,n,r){void 0===r&&(r=f);var i=pt(r,1);try{o(this.root).utimes(u(t),a(e),a(n),i)}catch(t){i(t)}},lt.prototype.utimesSync=function(t,e,n){o(this.root).utimesSync(u(t),a(e),a(n))},lt.prototype.realpath=function(t,e,n){void 0===n&&(n=f);var r="object"==typeof e?e:{};n="function"==typeof e?e:f;var i=pt(n,2);try{t=u(t),o(this.root).realpath(t,r,i)}catch(t){i(t)}},lt.prototype.realpathSync=function(t,e){return void 0===e&&(e={}),t=u(t),o(this.root).realpathSync(t,e)},lt.prototype.watchFile=function(t,e,n){throw void 0===n&&(n=f),new at(nt.ENOTSUP)},lt.prototype.unwatchFile=function(t,e){throw void 0===e&&(e=f),new at(nt.ENOTSUP)},lt.prototype.watch=function(t,e,n){throw void 0===n&&(n=f),new at(nt.ENOTSUP)},lt.prototype.access=function(t,e,n){throw void 0===n&&(n=f),new at(nt.ENOTSUP)},lt.prototype.accessSync=function(t,e){throw new at(nt.ENOTSUP)},lt.prototype.createReadStream=function(t,e){throw new at(nt.ENOTSUP)},lt.prototype.createWriteStream=function(t,e){throw new at(nt.ENOTSUP)},lt.prototype.wrapCallbacks=function(t){pt=t},lt.prototype.getFdForFile=function(t){var e=this.nextFd++;return this.fdMap[e]=t,e},lt.prototype.fd2file=function(t){var e=this.fdMap[t];if(e)return e;throw new at(nt.EBADF,"Invalid file descriptor.")},lt.prototype.closeFd=function(t){delete this.fdMap[t]},lt.Stats=ht;var dt=new lt,yt={},gt=lt.prototype;Object.keys(gt).forEach(function(t){"function"==typeof dt[t]?yt[t]=function(){return dt[t].apply(dt,arguments)}:yt[t]=dt[t]}),yt.changeFSModule=function(t){dt=t},yt.getFSModule=function(){return dt},yt.FS=lt;var mt="undefined"!=typeof navigator&&!(!/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())&&-1===navigator.userAgent.indexOf("Trident")),wt="undefined"==typeof window,vt=null,_t=Object.freeze({deprecationMessage:l,isIE:mt,isWebWorker:wt,fail:d,mkdirpSync:y,buffer2ArrayBuffer:g,buffer2Uint8array:m,arrayish2Buffer:w,uint8Array2Buffer:v,arrayBuffer2Buffer:_,copyingSlice:b,emptyBuffer:E,bufferValidator:S,checkOptions:I}),bt=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};bt.prototype.open=function(t){var e=this.fs.realPath(t.node),n=this.FS;try{n.isFile(t.node.mode)&&(t.nfd=this.nodefs.openSync(e,this.fs.flagsToPermissionString(t.flags)))}catch(t){if(!t.code)throw t;throw new n.ErrnoError(this.ERRNO_CODES[t.code])}},bt.prototype.close=function(t){var e=this.FS;try{e.isFile(t.node.mode)&&t.nfd&&this.nodefs.closeSync(t.nfd)}catch(t){if(!t.code)throw t;throw new e.ErrnoError(this.ERRNO_CODES[t.code])}},bt.prototype.read=function(t,e,n,r,i){try{return this.nodefs.readSync(t.nfd,v(e),n,r,i)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},bt.prototype.write=function(t,e,n,r,i){try{return this.nodefs.writeSync(t.nfd,v(e),n,r,i)}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},bt.prototype.llseek=function(t,e,n){var r=e;if(1===n)r+=t.position;else if(2===n&&this.FS.isFile(t.node.mode))try{var i=this.nodefs.fstatSync(t.nfd);r+=i.size}catch(t){throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(r<0)throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);return t.position=r,r};var Et=function(t){this.fs=t,this.nodefs=t.getNodeFS(),this.FS=t.getFS(),this.PATH=t.getPATH(),this.ERRNO_CODES=t.getERRNO_CODES()};Et.prototype.getattr=function(t){var e,n=this.fs.realPath(t);try{e=this.nodefs.lstatSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return{dev:e.dev,ino:e.ino,mode:e.mode,nlink:e.nlink,uid:e.uid,gid:e.gid,rdev:e.rdev,size:e.size,atime:e.atime,mtime:e.mtime,ctime:e.ctime,blksize:e.blksize,blocks:e.blocks}},Et.prototype.setattr=function(t,e){var n=this.fs.realPath(t);try{if(void 0!==e.mode&&(this.nodefs.chmodSync(n,e.mode),t.mode=e.mode),void 0!==e.timestamp){var r=new Date(e.timestamp);this.nodefs.utimesSync(n,r,r)}}catch(t){if(!t.code)throw t;if("ENOTSUP"!==t.code)throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}if(void 0!==e.size)try{this.nodefs.truncateSync(n,e.size)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Et.prototype.lookup=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e),r=this.fs.getMode(n);return this.fs.createNode(t,e,r)},Et.prototype.mknod=function(t,e,n,r){var i=this.fs.createNode(t,e,n,r),o=this.fs.realPath(i);try{this.FS.isDir(i.mode)?this.nodefs.mkdirSync(o,i.mode):this.nodefs.writeFileSync(o,"",{mode:i.mode})}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return i},Et.prototype.rename=function(t,e,n){var r=this.fs.realPath(t),i=this.PATH.join2(this.fs.realPath(e),n);try{this.nodefs.renameSync(r,i),t.name=n,t.parent=e}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Et.prototype.unlink=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.unlinkSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Et.prototype.rmdir=function(t,e){var n=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.rmdirSync(n)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Et.prototype.readdir=function(t){var e=this.fs.realPath(t);try{var n=this.nodefs.readdirSync(e);return n.push(".",".."),n}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Et.prototype.symlink=function(t,e,n){var r=this.PATH.join2(this.fs.realPath(t),e);try{this.nodefs.symlinkSync(n,r)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}},Et.prototype.readlink=function(t){var e=this.fs.realPath(t);try{return this.nodefs.readlinkSync(e)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}};var St=function(t,e,n,r){void 0===t&&(t=self.FS),void 0===e&&(e=self.PATH),void 0===n&&(n=self.ERRNO_CODES),void 0===r&&(r=yt),this.flagsToPermissionStringMap={0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},this.nodefs=r,this.FS=t,this.PATH=e,this.ERRNO_CODES=n,this.node_ops=new Et(this),this.stream_ops=new bt(this)};St.prototype.mount=function(t){return this.createNode(null,"/",this.getMode(t.opts.root),0)},St.prototype.createNode=function(t,e,n,r){var i=this.FS;if(!i.isDir(n)&&!i.isFile(n)&&!i.isLink(n))throw new i.ErrnoError(this.ERRNO_CODES.EINVAL);var o=i.createNode(t,e,n);return o.node_ops=this.node_ops,o.stream_ops=this.stream_ops,o},St.prototype.getMode=function(t){var e;try{e=this.nodefs.lstatSync(t)}catch(t){if(!t.code)throw t;throw new this.FS.ErrnoError(this.ERRNO_CODES[t.code])}return e.mode},St.prototype.realPath=function(t){for(var e=[];t.parent!==t;)e.push(t.name),t=t.parent;return e.push(t.mount.opts.root),e.reverse(),this.PATH.join.apply(null,e)},St.prototype.flagsToPermissionString=function(t){var e="string"==typeof t?parseInt(t,10):t;return e&=8191,e in this.flagsToPermissionStringMap?this.flagsToPermissionStringMap[e]:t},St.prototype.getNodeFS=function(){return this.nodefs},St.prototype.getFS=function(){return this.FS},St.prototype.getPATH=function(){return this.PATH},St.prototype.getERRNO_CODES=function(){return this.ERRNO_CODES};var It=function(){};It.prototype.supportsLinks=function(){return!1},It.prototype.diskSpace=function(t,e){e(0,0)},It.prototype.openFile=function(t,e,n){throw new at(nt.ENOTSUP)},It.prototype.createFile=function(t,e,n,r){throw new at(nt.ENOTSUP)},It.prototype.open=function(t,e,n,r){var i=this,o=function(o,s){if(o)switch(e.pathNotExistsAction()){case st.CREATE_FILE:return i.stat(it.dirname(t),!1,function(o,s){o?r(o):s&&!s.isDirectory()?r(at.ENOTDIR(it.dirname(t))):i.createFile(t,e,n,r)});case st.THROW_EXCEPTION:return r(at.ENOENT(t));default:return r(new at(nt.EINVAL,"Invalid FileFlag object."))}else{if(s&&s.isDirectory())return r(at.EISDIR(t));switch(e.pathExistsAction()){case st.THROW_EXCEPTION:return r(at.EEXIST(t));case st.TRUNCATE_FILE:return i.openFile(t,e,function(t,e){t?r(t):e?e.truncate(0,function(){e.sync(function(){r(null,e)})}):d()});case st.NOP:return i.openFile(t,e,r);default:return r(new at(nt.EINVAL,"Invalid FileFlag object."))}}};this.stat(t,!1,o)},It.prototype.rename=function(t,e,n){n(new at(nt.ENOTSUP))},It.prototype.renameSync=function(t,e){throw new at(nt.ENOTSUP)},It.prototype.stat=function(t,e,n){n(new at(nt.ENOTSUP))},It.prototype.statSync=function(t,e){throw new at(nt.ENOTSUP)},It.prototype.openFileSync=function(t,e,n){throw new at(nt.ENOTSUP)},It.prototype.createFileSync=function(t,e,n){throw new at(nt.ENOTSUP)},It.prototype.openSync=function(t,e,n){var r;try{r=this.statSync(t,!1)}catch(r){switch(e.pathNotExistsAction()){case st.CREATE_FILE:var i=this.statSync(it.dirname(t),!1);if(!i.isDirectory())throw at.ENOTDIR(it.dirname(t));return this.createFileSync(t,e,n);case st.THROW_EXCEPTION:throw at.ENOENT(t);default:throw new at(nt.EINVAL,"Invalid FileFlag object.")}}if(r.isDirectory())throw at.EISDIR(t);switch(e.pathExistsAction()){case st.THROW_EXCEPTION:throw at.EEXIST(t);case st.TRUNCATE_FILE:return this.unlinkSync(t),this.createFileSync(t,e,r.mode);case st.NOP:return this.openFileSync(t,e,n);default:throw new at(nt.EINVAL,"Invalid FileFlag object.")}},It.prototype.unlink=function(t,e){e(new at(nt.ENOTSUP))},It.prototype.unlinkSync=function(t){throw new at(nt.ENOTSUP)},It.prototype.rmdir=function(t,e){e(new at(nt.ENOTSUP))},It.prototype.rmdirSync=function(t){throw new at(nt.ENOTSUP)},It.prototype.mkdir=function(t,e,n){n(new at(nt.ENOTSUP))},It.prototype.mkdirSync=function(t,e){throw new at(nt.ENOTSUP)},It.prototype.readdir=function(t,e){e(new at(nt.ENOTSUP))},It.prototype.readdirSync=function(t){throw new at(nt.ENOTSUP)},It.prototype.exists=function(t,e){this.stat(t,null,function(t){e(!t)})},It.prototype.existsSync=function(t){try{return this.statSync(t,!0),!0}catch(t){return!1}},It.prototype.realpath=function(t,e,n){if(this.supportsLinks())for(var r=t.split(it.sep),i=0;i<r.length;i++){var o=r.slice(0,i+1);r[i]=it.join.apply(null,o)}else this.exists(t,function(e){e?n(null,t):n(at.ENOENT(t))})},It.prototype.realpathSync=function(t,e){if(this.supportsLinks()){for(var n=t.split(it.sep),r=0;r<n.length;r++){var i=n.slice(0,r+1);n[r]=it.join.apply(it,i)}return n.join(it.sep)}if(this.existsSync(t))return t;throw at.ENOENT(t)},It.prototype.truncate=function(t,e,n){this.open(t,ct.getFileFlag("r+"),420,function(t,r){if(t)return n(t);r.truncate(e,function(t){r.close(function(e){n(t||e)})})})},It.prototype.truncateSync=function(t,e){var n=this.openSync(t,ct.getFileFlag("r+"),420);try{n.truncateSync(e)}catch(t){throw t}finally{n.closeSync()}},It.prototype.readFile=function(e,n,r,i){var o=i;this.open(e,r,420,function(e,r){if(e)return i(e);i=function(t,e){r.close(function(n){return t||(t=n),o(t,e)})},r.stat(function(e,o){if(e)return i(e);var s=t.alloc(o.size);r.read(s,0,o.size,0,function(t){if(t)return i(t);if(null===n)return i(t,s);try{i(null,s.toString(n))}catch(t){i(t)}})})})},It.prototype.readFileSync=function(e,n,r){var i=this.openSync(e,r,420);try{var o=i.statSync(),s=t.alloc(o.size);return i.readSync(s,0,o.size,0),i.closeSync(),null===n?s:s.toString(n)}finally{i.closeSync()}},It.prototype.writeFile=function(e,n,r,i,o,s){var a=s;this.open(e,i,420,function(e,i){if(e)return s(e);s=function(t){i.close(function(e){a(t||e)})};try{"string"==typeof n&&(n=t.from(n,r))}catch(t){return s(t)}i.write(n,0,n.length,0,s)})},It.prototype.writeFileSync=function(e,n,r,i,o){var s=this.openSync(e,i,o);try{"string"==typeof n&&(n=t.from(n,r)),s.writeSync(n,0,n.length,0)}finally{s.closeSync()}},It.prototype.appendFile=function(e,n,r,i,o,s){var a=s;this.open(e,i,o,function(e,i){if(e)return s(e);s=function(t){i.close(function(e){a(t||e)})},"string"==typeof n&&(n=t.from(n,r)),i.write(n,0,n.length,null,s)})},It.prototype.appendFileSync=function(e,n,r,i,o){var s=this.openSync(e,i,o);try{"string"==typeof n&&(n=t.from(n,r)),s.writeSync(n,0,n.length,null)}finally{s.closeSync()}},It.prototype.chmod=function(t,e,n,r){r(new at(nt.ENOTSUP))},It.prototype.chmodSync=function(t,e,n){throw new at(nt.ENOTSUP)},It.prototype.chown=function(t,e,n,r,i){i(new at(nt.ENOTSUP))},It.prototype.chownSync=function(t,e,n,r){throw new at(nt.ENOTSUP)},It.prototype.utimes=function(t,e,n,r){r(new at(nt.ENOTSUP))},It.prototype.utimesSync=function(t,e,n){throw new at(nt.ENOTSUP)},It.prototype.link=function(t,e,n){n(new at(nt.ENOTSUP))},It.prototype.linkSync=function(t,e){throw new at(nt.ENOTSUP)},It.prototype.symlink=function(t,e,n,r){r(new at(nt.ENOTSUP))},It.prototype.symlinkSync=function(t,e,n){throw new at(nt.ENOTSUP)},It.prototype.readlink=function(t,e){e(new at(nt.ENOTSUP))},It.prototype.readlinkSync=function(t){throw new at(nt.ENOTSUP)};var Ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.supportsSynch=function(){return!0},e.prototype.rename=function(t,e,n){try{this.renameSync(t,e),n()}catch(t){n(t)}},e.prototype.stat=function(t,e,n){try{n(null,this.statSync(t,e))}catch(t){n(t)}},e.prototype.open=function(t,e,n,r){try{r(null,this.openSync(t,e,n))}catch(t){r(t)}},e.prototype.unlink=function(t,e){try{this.unlinkSync(t),e()}catch(t){e(t)}},e.prototype.rmdir=function(t,e){try{this.rmdirSync(t),e()}catch(t){e(t)}},e.prototype.mkdir=function(t,e,n){try{this.mkdirSync(t,e),n()}catch(t){n(t)}},e.prototype.readdir=function(t,e){try{e(null,this.readdirSync(t))}catch(t){e(t)}},e.prototype.chmod=function(t,e,n,r){try{this.chmodSync(t,e,n),r()}catch(t){r(t)}},e.prototype.chown=function(t,e,n,r,i){try{this.chownSync(t,e,n,r),i()}catch(t){i(t)}},e.prototype.utimes=function(t,e,n,r){try{this.utimesSync(t,e,n),r()}catch(t){r(t)}},e.prototype.link=function(t,e,n){try{this.linkSync(t,e),n()}catch(t){n(t)}},e.prototype.symlink=function(t,e,n,r){try{this.symlinkSync(t,e,n),r()}catch(t){r(t)}},e.prototype.readlink=function(t,e){try{e(null,this.readlinkSync(t))}catch(t){e(t)}},e}(It),kt=function(){};kt.prototype.sync=function(t){t(new at(nt.ENOTSUP))},kt.prototype.syncSync=function(){throw new at(nt.ENOTSUP)},kt.prototype.datasync=function(t){this.sync(t)},kt.prototype.datasyncSync=function(){return this.syncSync()},kt.prototype.chown=function(t,e,n){n(new at(nt.ENOTSUP))},kt.prototype.chownSync=function(t,e){throw new at(nt.ENOTSUP)},kt.prototype.chmod=function(t,e){e(new at(nt.ENOTSUP))},kt.prototype.chmodSync=function(t){throw new at(nt.ENOTSUP)},kt.prototype.utimes=function(t,e,n){n(new at(nt.ENOTSUP))},kt.prototype.utimesSync=function(t,e){throw new at(nt.ENOTSUP)};var Nt=function(e){function n(t,n,r,i,o){if(e.call(this),this._pos=0,this._dirty=!1,this._fs=t,this._path=n,this._flag=r,this._stat=i,this._buffer=o||E(),this._stat.size!==this._buffer.length&&this._flag.isReadable())throw new Error("Invalid buffer: Buffer is "+this._buffer.length+" long, yet Stats object specifies that file is "+this._stat.size+" long.")}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.getBuffer=function(){return this._buffer},n.prototype.getStats=function(){return this._stat},n.prototype.getFlag=function(){return this._flag},n.prototype.getPath=function(){return this._path},n.prototype.getPos=function(){return this._flag.isAppendable()?this._stat.size:this._pos},n.prototype.advancePos=function(t){return this._pos+=t},n.prototype.setPos=function(t){return this._pos=t},n.prototype.sync=function(t){try{this.syncSync(),t()}catch(e){t(e)}},n.prototype.syncSync=function(){throw new at(nt.ENOTSUP)},n.prototype.close=function(t){try{this.closeSync(),t()}catch(e){t(e)}},n.prototype.closeSync=function(){throw new at(nt.ENOTSUP)},n.prototype.stat=function(t){try{t(null,this._stat.clone())}catch(e){t(e)}},n.prototype.statSync=function(){return this._stat.clone()},n.prototype.truncate=function(t,e){try{this.truncateSync(t),this._flag.isSynchronous()&&!yt.getRootFS().supportsSynch()&&this.sync(e),e()}catch(t){return e(t)}},n.prototype.truncateSync=function(e){if(this._dirty=!0,!this._flag.isWriteable())throw new at(nt.EPERM,"File not opened with a writeable mode.");if(this._stat.mtime=new Date,e>this._buffer.length){var n=t.alloc(e-this._buffer.length,0);return this.writeSync(n,0,n.length,this._buffer.length),void(this._flag.isSynchronous()&&yt.getRootFS().supportsSynch()&&this.syncSync())}this._stat.size=e;var r=t.alloc(e);this._buffer.copy(r,0,0,e),this._buffer=r,this._flag.isSynchronous()&&yt.getRootFS().supportsSynch()&&this.syncSync()},n.prototype.write=function(t,e,n,r,i){try{i(null,this.writeSync(t,e,n,r),t)}catch(t){i(t)}},n.prototype.writeSync=function(e,n,r,i){if(this._dirty=!0,void 0!==i&&null!==i||(i=this.getPos()),!this._flag.isWriteable())throw new at(nt.EPERM,"File not opened with a writeable mode.");var o=i+r;if(o>this._stat.size&&(this._stat.size=o,o>this._buffer.length)){var s=t.alloc(o);this._buffer.copy(s),this._buffer=s}var a=e.copy(this._buffer,i,n,n+r);return this._stat.mtime=new Date,this._flag.isSynchronous()?(this.syncSync(),a):(this.setPos(i+a),a)},n.prototype.read=function(t,e,n,r,i){try{i(null,this.readSync(t,e,n,r),t)}catch(t){i(t)}},n.prototype.readSync=function(t,e,n,r){if(!this._flag.isReadable())throw new at(nt.EPERM,"File not opened with a readable mode.");void 0!==r&&null!==r||(r=this.getPos()),r+n>this._stat.size&&(n=this._stat.size-r);var i=this._buffer.copy(t,e,r,r+n);return this._stat.atime=new Date,this._pos=r+n,i},n.prototype.chmod=function(t,e){try{this.chmodSync(t),e()}catch(t){e(t)}},n.prototype.chmodSync=function(t){if(!this._fs.supportsProps())throw new at(nt.ENOTSUP);this._dirty=!0,this._stat.chmod(t),this.syncSync()},n.prototype.isDirty=function(){return this._dirty},n.prototype.resetDirty=function(){this._dirty=!1},n}(kt),Ft=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.close=function(t){t()},e.prototype.closeSync=function(){},e}(Nt),Rt=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(Nt),Tt=function(t){function e(e,n){t.call(this),this._queue=[],this._queueRunning=!1,this._isInitialized=!1,this._initializeCallbacks=[],this._sync=e,this._async=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{var r=new e(t.sync,t.async);r._initialize(function(t){t?n(t):n(null,r)})}catch(t){n(t)}},e.isAvailable=function(){return!0},e.prototype.getName=function(){return e.Name},e.prototype._syncSync=function(t){this._sync.writeFileSync(t.getPath(),t.getBuffer(),null,ct.getFileFlag("w"),t.getStats().mode),this.enqueueOp({apiMethod:"writeFile",arguments:[t.getPath(),t.getBuffer(),null,t.getFlag(),t.getStats().mode]})},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._sync.supportsProps()&&this._async.supportsProps()},e.prototype.renameSync=function(t,e){this._sync.renameSync(t,e),this.enqueueOp({apiMethod:"rename",arguments:[t,e]})},e.prototype.statSync=function(t,e){return this._sync.statSync(t,e)},e.prototype.openSync=function(t,e,n){return this._sync.openSync(t,e,n).closeSync(),new Rt(this,t,e,this._sync.statSync(t,!1),this._sync.readFileSync(t,null,ct.getFileFlag("r")))},e.prototype.unlinkSync=function(t){this._sync.unlinkSync(t),this.enqueueOp({apiMethod:"unlink",arguments:[t]})},e.prototype.rmdirSync=function(t){this._sync.rmdirSync(t),this.enqueueOp({apiMethod:"rmdir",arguments:[t]})},e.prototype.mkdirSync=function(t,e){this._sync.mkdirSync(t,e),this.enqueueOp({apiMethod:"mkdir",arguments:[t,e]})},e.prototype.readdirSync=function(t){return this._sync.readdirSync(t)},e.prototype.existsSync=function(t){return this._sync.existsSync(t)},e.prototype.chmodSync=function(t,e,n){this._sync.chmodSync(t,e,n),this.enqueueOp({apiMethod:"chmod",arguments:[t,e,n]})},e.prototype.chownSync=function(t,e,n,r){this._sync.chownSync(t,e,n,r),this.enqueueOp({apiMethod:"chown",arguments:[t,e,n,r]})},e.prototype.utimesSync=function(t,e,n){this._sync.utimesSync(t,e,n),this.enqueueOp({apiMethod:"utimes",arguments:[t,e,n]})},e.prototype._initialize=function(t){var e=this,n=this._initializeCallbacks,r=function(t){e._isInitialized=!t,e._initializeCallbacks=[],n.forEach(function(e){return e(t)})};if(this._isInitialized)t();else if(1===n.push(t)){var i=function(t,n,r){"/"!==t&&e._sync.mkdirSync(t,n),e._async.readdir(t,function(e,n){function i(e){e?r(e):o<n.length?(s(it.join(t,n[o]),i),o++):r()}var o=0;e?r(e):i()})},o=function(t,n,r){e._async.readFile(t,null,ct.getFileFlag("r"),function(i,o){if(i)r(i);else try{e._sync.writeFileSync(t,o,null,ct.getFileFlag("w"),n)}catch(t){i=t}finally{r(i)}})},s=function(t,n){e._async.stat(t,!1,function(e,r){e?n(e):r.isDirectory()?i(t,r.mode,n):o(t,r.mode,n)})};i("/",0,r)}},e.prototype.enqueueOp=function(t){var e=this;if(this._queue.push(t),!this._queueRunning){this._queueRunning=!0;var n=function(t){if(t)throw new Error("WARNING: File system has desynchronized. Received following error: "+t+"\n$");if(e._queue.length>0){var r=e._queue.shift(),i=r.arguments;i.push(n),e._async[r.apiMethod].apply(e._async,i)}else e._queueRunning=!1};n()}},e}(Ot);Tt.Name="AsyncMirror",Tt.Options={sync:{type:"object",description:"The synchronous file system to mirror the asynchronous file system to.",validator:function(t,e){t&&"function"==typeof t.supportsSynch&&t.supportsSynch()?e():e(new at(nt.EINVAL,"'sync' option must be a file system that supports synchronous operations"))}},async:{type:"object",description:"The asynchronous file system to mirror."}};var Lt=function(t,e,n,r,i,o){this.id=t,this.size=e,this.mode=n,this.atime=r,this.mtime=i,this.ctime=o};Lt.fromBuffer=function(t){if(void 0===t)throw new Error("NO");return new Lt(t.toString("ascii",30),t.readUInt32LE(0),t.readUInt16LE(4),t.readDoubleLE(6),t.readDoubleLE(14),t.readDoubleLE(22))},Lt.prototype.toStats=function(){return new ht((61440&this.mode)===ft.DIRECTORY?ft.DIRECTORY:ft.FILE,this.size,this.mode,new Date(this.atime),new Date(this.mtime),new Date(this.ctime))},Lt.prototype.getSize=function(){return 30+this.id.length},Lt.prototype.toBuffer=function(e){return void 0===e&&(e=t.alloc(this.getSize())),e.writeUInt32LE(this.size,0),e.writeUInt16LE(this.mode,4),e.writeDoubleLE(this.atime,6),e.writeDoubleLE(this.mtime,14),e.writeDoubleLE(this.ctime,22),e.write(this.id,30,this.id.length,"ascii"),e},Lt.prototype.update=function(t){var e=!1;this.size!==t.size&&(this.size=t.size,e=!0),this.mode!==t.mode&&(this.mode=t.mode,e=!0);var n=t.atime.getTime();this.atime!==n&&(this.atime=n,e=!0);var r=t.mtime.getTime();this.mtime!==r&&(this.mtime=r,e=!0);var i=t.ctime.getTime();return this.ctime!==i&&(this.ctime=i,e=!0),e},Lt.prototype.isFile=function(){return(61440&this.mode)===ft.FILE},Lt.prototype.isDirectory=function(){return(61440&this.mode)===ft.DIRECTORY};var xt=null,At=function(t){this.store=t,this.originalData={},this.modifiedKeys=[]};At.prototype.get=function(t){var e=this.store.get(t);return this.stashOldValue(t,e),e},At.prototype.put=function(t,e,n){return this.markModified(t),this.store.put(t,e,n)},At.prototype.del=function(t){this.markModified(t),this.store.del(t)},At.prototype.commit=function(){},At.prototype.abort=function(){for(var t=this,e=0,n=t.modifiedKeys;e<n.length;e+=1){var r=n[e],i=t.originalData[r];i?t.store.put(r,i,!0):t.store.del(r)}},At.prototype.stashOldValue=function(t,e){this.originalData.hasOwnProperty(t)||(this.originalData[t]=e)},At.prototype.markModified=function(t){-1===this.modifiedKeys.indexOf(t)&&(this.modifiedKeys.push(t),this.originalData.hasOwnProperty(t)||(this.originalData[t]=this.store.get(t)))};var Dt=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer(),this.getStats()),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(Nt),Ct=function(e){function n(t){e.call(this),this.store=t.store,this.makeRootDirectory()}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.isAvailable=function(){return!0},n.prototype.getName=function(){return this.store.name()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsSymlinks=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!0},n.prototype.empty=function(){this.store.clear(),this.makeRootDirectory()},n.prototype.renameSync=function(e,n){var r=this.store.beginTransaction("readwrite"),i=it.dirname(e),o=it.basename(e),s=it.dirname(n),a=it.basename(n),u=this.findINode(r,i),c=this.getDirListing(r,i,u);if(!c[o])throw at.ENOENT(e);var f=c[o];if(delete c[o],0===(s+"/").indexOf(e+"/"))throw new at(nt.EBUSY,i);var h,p;if(s===i?(h=u,p=c):(h=this.findINode(r,s),p=this.getDirListing(r,s,h)),p[a]){var l=this.getINode(r,n,p[a]);if(!l.isFile())throw at.EPERM(n);try{r.del(l.id),r.del(p[a])}catch(t){throw r.abort(),t}}p[a]=f;try{r.put(u.id,t.from(JSON.stringify(c)),!0),r.put(h.id,t.from(JSON.stringify(p)),!0)}catch(t){throw r.abort(),t}r.commit()},n.prototype.statSync=function(t,e){return this.findINode(this.store.beginTransaction("readonly"),t).toStats()},n.prototype.createFileSync=function(t,e,n){var r=this.store.beginTransaction("readwrite"),i=E(),o=this.commitNewFile(r,t,ft.FILE,n,i);return new Dt(this,t,e,o.toStats(),i)},n.prototype.openFileSync=function(t,e){var n=this.store.beginTransaction("readonly"),r=this.findINode(n,t),i=n.get(r.id);if(void 0===i)throw at.ENOENT(t);return new Dt(this,t,e,r.toStats(),i)},n.prototype.unlinkSync=function(t){this.removeEntry(t,!1)},n.prototype.rmdirSync=function(t){if(this.readdirSync(t).length>0)throw at.ENOTEMPTY(t);this.removeEntry(t,!0)},n.prototype.mkdirSync=function(e,n){var r=this.store.beginTransaction("readwrite"),i=t.from("{}");this.commitNewFile(r,e,ft.DIRECTORY,n,i)},n.prototype.readdirSync=function(t){var e=this.store.beginTransaction("readonly");return Object.keys(this.getDirListing(e,t,this.findINode(e,t)))},n.prototype._syncSync=function(t,e,n){var r=this.store.beginTransaction("readwrite"),i=this._findINode(r,it.dirname(t),it.basename(t)),o=this.getINode(r,t,i),s=o.update(n);try{r.put(o.id,e,!0),s&&r.put(i,o.toBuffer(),!0)}catch(t){throw r.abort(),t}r.commit()},n.prototype.makeRootDirectory=function(){var t=this.store.beginTransaction("readwrite");if(void 0===t.get("/")){var e=(new Date).getTime(),n=new Lt(k(),4096,511|ft.DIRECTORY,e,e,e);t.put(n.id,O(),!1),t.put("/",n.toBuffer(),!1),t.commit()}},n.prototype._findINode=function(t,e,n){var r=this,i=function(i){var o=r.getDirListing(t,e,i);if(o[n])return o[n];throw at.ENOENT(it.resolve(e,n))};return"/"===e?""===n?"/":i(this.getINode(t,e,"/")):i(this.getINode(t,e+it.sep+n,this._findINode(t,it.dirname(e),it.basename(e))))},n.prototype.findINode=function(t,e){return this.getINode(t,e,this._findINode(t,it.dirname(e),it.basename(e)))},n.prototype.getINode=function(t,e,n){var r=t.get(n);if(void 0===r)throw at.ENOENT(e);return Lt.fromBuffer(r)},n.prototype.getDirListing=function(t,e,n){if(!n.isDirectory())throw at.ENOTDIR(e);var r=t.get(n.id);if(void 0===r)throw at.ENOENT(e);return JSON.parse(r.toString())},n.prototype.addNewNode=function(t,e){for(var n;;)try{return n=k(),t.put(n,e,!1),n}catch(t){}throw new at(nt.EIO,"Unable to commit data to key-value store.")},n.prototype.commitNewFile=function(e,n,r,i,o){var s=it.dirname(n),a=it.basename(n),u=this.findINode(e,s),c=this.getDirListing(e,s,u),f=(new Date).getTime();if("/"===n)throw at.EEXIST(n);if(c[a])throw at.EEXIST(n);var h;try{var p=this.addNewNode(e,o);h=new Lt(p,o.length,i|r,f,f,f);var l=this.addNewNode(e,h.toBuffer());c[a]=l,e.put(u.id,t.from(JSON.stringify(c)),!0)}catch(t){throw e.abort(),t}return e.commit(),h},n.prototype.removeEntry=function(e,n){var r=this.store.beginTransaction("readwrite"),i=it.dirname(e),o=this.findINode(r,i),s=this.getDirListing(r,i,o),a=it.basename(e);if(!s[a])throw at.ENOENT(e);var u=s[a];delete s[a];var c=this.getINode(r,e,u);if(!n&&c.isDirectory())throw at.EISDIR(e);if(n&&!c.isDirectory())throw at.ENOTDIR(e);try{r.del(c.id),r.del(u),r.put(o.id,t.from(JSON.stringify(s)),!0)}catch(t){throw r.abort(),t}r.commit()},n}(Ot),Pt=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;this.isDirty()?this._fs._sync(this.getPath(),this.getBuffer(),this.getStats(),function(n){n||e.resetDirty(),t(n)}):t()},e.prototype.close=function(t){this.sync(t)},e}(Nt),Mt=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.isAvailable=function(){return!0},n.prototype.init=function(t,e){this.store=t,this.makeRootDirectory(e)},n.prototype.getName=function(){return this.store.name()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsSymlinks=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!1},n.prototype.empty=function(t){var e=this;this.store.clear(function(n){N(n,t)&&e.makeRootDirectory(t)})},n.prototype.rename=function(e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=it.dirname(e),a=it.basename(e),u=it.dirname(n),c=it.basename(n),f={},h={},p=!1;if(0===(u+"/").indexOf(e+"/"))return r(new at(nt.EBUSY,s));var l=function(){if(!p&&h.hasOwnProperty(s)&&h.hasOwnProperty(u)){var l=h[s],d=f[s],y=h[u],g=f[u];if(l[a]){var m=l[a];delete l[a];var w=function(){y[c]=m,o.put(d.id,t.from(JSON.stringify(l)),!0,function(e){F(e,o,r)&&(s===u?o.commit(r):o.put(g.id,t.from(JSON.stringify(y)),!0,function(t){F(t,o,r)&&o.commit(r)}))})};y[c]?i.getINode(o,n,y[c],function(t,e){F(t,o,r)&&(e.isFile()?o.del(e.id,function(t){F(t,o,r)&&o.del(y[c],function(t){F(t,o,r)&&w()})}):o.abort(function(t){r(at.EPERM(n))}))}):w()}else r(at.ENOENT(e))}},d=function(t){i.findINodeAndDirListing(o,t,function(e,n,i){e?p||(p=!0,o.abort(function(){r(e)})):(f[t]=n,h[t]=i,l())})};d(s),s!==u&&d(u)},n.prototype.stat=function(t,e,n){var r=this.store.beginTransaction("readonly");this.findINode(r,t,function(t,e){N(t,n)&&n(null,e.toStats())})},n.prototype.createFile=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=E();this.commitNewFile(o,t,ft.FILE,n,s,function(n,o){N(n,r)&&r(null,new Pt(i,t,e,o.toStats(),s))})},n.prototype.openFile=function(t,e,n){var r=this,i=this.store.beginTransaction("readonly");this.findINode(i,t,function(o,s){N(o,n)&&i.get(s.id,function(i,o){N(i,n)&&(void 0===o?n(at.ENOENT(t)):n(null,new Pt(r,t,e,s.toStats(),o)))})})},n.prototype.unlink=function(t,e){this.removeEntry(t,!1,e)},n.prototype.rmdir=function(t,e){var n=this;this.readdir(t,function(r,i){r?e(r):i.length>0?e(at.ENOTEMPTY(t)):n.removeEntry(t,!0,e)})},n.prototype.mkdir=function(e,n,r){var i=this.store.beginTransaction("readwrite"),o=t.from("{}");this.commitNewFile(i,e,ft.DIRECTORY,n,o,r)},n.prototype.readdir=function(t,e){var n=this,r=this.store.beginTransaction("readonly");this.findINode(r,t,function(i,o){N(i,e)&&n.getDirListing(r,t,o,function(t,n){N(t,e)&&e(null,Object.keys(n))})})},n.prototype._sync=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite");this._findINode(o,it.dirname(t),it.basename(t),function(s,a){F(s,o,r)&&i.getINode(o,t,a,function(t,i){if(F(t,o,r)){var s=i.update(n);o.put(i.id,e,!0,function(t){F(t,o,r)&&(s?o.put(a,i.toBuffer(),!0,function(t){F(t,o,r)&&o.commit(r)}):o.commit(r))})}})})},n.prototype.makeRootDirectory=function(t){var e=this.store.beginTransaction("readwrite");e.get("/",function(n,r){if(n||void 0===r){var i=(new Date).getTime(),o=new Lt(k(),4096,511|ft.DIRECTORY,i,i,i);e.put(o.id,O(),!1,function(n){F(n,e,t)&&e.put("/",o.toBuffer(),!1,function(n){n?e.abort(function(){t(n)}):e.commit(t)})})}else e.commit(t)})},n.prototype._findINode=function(t,e,n,r){var i=this,o=function(t,i,o){t?r(t):o[n]?r(null,o[n]):r(at.ENOENT(it.resolve(e,n)))};"/"===e?""===n?r(null,"/"):this.getINode(t,e,"/",function(n,s){N(n,r)&&i.getDirListing(t,e,s,function(t,e){o(t,0,e)})}):this.findINodeAndDirListing(t,e,o)},n.prototype.findINode=function(t,e,n){var r=this;this._findINode(t,it.dirname(e),it.basename(e),function(i,o){N(i,n)&&r.getINode(t,e,o,n)})},n.prototype.getINode=function(t,e,n,r){t.get(n,function(t,n){N(t,r)&&(void 0===n?r(at.ENOENT(e)):r(null,Lt.fromBuffer(n)))})},n.prototype.getDirListing=function(t,e,n,r){n.isDirectory()?t.get(n.id,function(t,n){if(N(t,r))try{r(null,JSON.parse(n.toString()))}catch(t){r(at.ENOENT(e))}}):r(at.ENOTDIR(e))},n.prototype.findINodeAndDirListing=function(t,e,n){var r=this;this.findINode(t,e,function(i,o){N(i,n)&&r.getDirListing(t,e,o,function(t,e){N(t,n)&&n(null,o,e)})})},n.prototype.addNewNode=function(t,e,n){var r,i=0,o=function(){5==++i?n(new at(nt.EIO,"Unable to commit data to key-value store.")):(r=k(),t.put(r,e,!1,function(t,e){t||!e?o():n(null,r)}))};o()},n.prototype.commitNewFile=function(e,n,r,i,o,s){var a=this,u=it.dirname(n),c=it.basename(n),f=(new Date).getTime();if("/"===n)return s(at.EEXIST(n));this.findINodeAndDirListing(e,u,function(u,h,p){F(u,e,s)&&(p[c]?e.abort(function(){s(at.EEXIST(n))}):a.addNewNode(e,o,function(n,u){if(F(n,e,s)){var l=new Lt(u,o.length,i|r,f,f,f);a.addNewNode(e,l.toBuffer(),function(n,r){F(n,e,s)&&(p[c]=r,e.put(h.id,t.from(JSON.stringify(p)),!0,function(t){F(t,e,s)&&e.commit(function(t){F(t,e,s)&&s(null,l)})}))})}}))})},n.prototype.removeEntry=function(e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=it.dirname(e),a=it.basename(e);this.findINodeAndDirListing(o,s,function(s,u,c){if(F(s,o,r))if(c[a]){var f=c[a];delete c[a],i.getINode(o,e,f,function(i,s){F(i,o,r)&&(!n&&s.isDirectory()?o.abort(function(){r(at.EISDIR(e))}):n&&!s.isDirectory()?o.abort(function(){r(at.ENOTDIR(e))}):o.del(s.id,function(e){F(e,o,r)&&o.del(f,function(e){F(e,o,r)&&o.put(u.id,t.from(JSON.stringify(c)),!0,function(t){F(t,o,r)&&o.commit(r)})})}))})}else o.abort(function(){r(at.ENOENT(e))})})},n}(It),Ut=function(){this.store={}};Ut.prototype.name=function(){return Bt.Name},Ut.prototype.clear=function(){this.store={}},Ut.prototype.beginTransaction=function(t){return new At(this)},Ut.prototype.get=function(t){return this.store[t]},Ut.prototype.put=function(t,e,n){return!(!n&&this.store.hasOwnProperty(t))&&(this.store[t]=e,!0)},Ut.prototype.del=function(t){delete this.store[t]};var Bt=function(t){function e(){t.call(this,{store:new Ut})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e)},e}(Ct);Bt.Name="InMemory",Bt.Options={};var jt="undefined"!=typeof window?window:"undefined"!=typeof self?self:r,zt=jt.indexedDB||jt.mozIndexedDB||jt.webkitIndexedDB||jt.msIndexedDB,Wt=function(t,e){this.tx=t,this.store=e};Wt.prototype.get=function(t,e){try{var n=this.store.get(t);n.onerror=T(e),n.onsuccess=function(t){var n=t.target.result;void 0===n?e(null,n):e(null,_(n))}}catch(t){e(R(t))}};var Vt=function(t){function e(e,n){t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.put=function(t,e,n,r){try{var i,o=g(e);i=n?this.store.put(o,t):this.store.add(o,t),i.onerror=T(r),i.onsuccess=function(t){r(null,!0)}}catch(t){r(R(t))}},e.prototype.del=function(t,e){try{var n=this.store.delete(t);n.onerror=T(e),n.onsuccess=function(t){e()}}catch(t){e(R(t))}},e.prototype.commit=function(t){setTimeout(t,0)},e.prototype.abort=function(t){var e=null;try{this.tx.abort()}catch(t){e=R(t)}finally{t(e)}},e}(Wt),Zt=function(t,e){this.db=t,this.storeName=e};Zt.Create=function(t,e){var n=zt.open(t,1);n.onupgradeneeded=function(e){var n=e.target.result;n.objectStoreNames.contains(t)&&n.deleteObjectStore(t),n.createObjectStore(t)},n.onsuccess=function(n){e(null,new Zt(n.target.result,t))},n.onerror=T(e,nt.EACCES)},Zt.prototype.name=function(){return qt.Name+" - "+this.storeName},Zt.prototype.clear=function(t){try{var e=this.db.transaction(this.storeName,"readwrite"),n=e.objectStore(this.storeName),r=n.clear();r.onsuccess=function(e){setTimeout(t,0)},r.onerror=T(t)}catch(e){t(R(e))}},Zt.prototype.beginTransaction=function(t){void 0===t&&(t="readonly");var e=this.db.transaction(this.storeName,t),n=e.objectStore(this.storeName);if("readwrite"===t)return new Vt(e,n);if("readonly"===t)return new Wt(e,n);throw new at(nt.EINVAL,"Invalid transaction type.")};var qt=function(t){function e(e){t.call(this),this.store=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){Zt.Create(t.storeName?t.storeName:"browserfs",function(t,r){r?n(null,new e(r)):n(t)})},e.isAvailable=function(){try{return void 0!==zt&&null!==zt.open("__browserfs_test__")}catch(t){return!1}},e}(Mt);qt.Name="IndexedDB",qt.Options={storeName:{type:"string",optional:!0,description:"The name of this file system. You can have multiple IndexedDB file systems operating at once, but each must have a different name."}};var Yt,Ht=!1;try{jt.localStorage.setItem("__test__",String.fromCharCode(55296)),Ht=jt.localStorage.getItem("__test__")===String.fromCharCode(55296)}catch(t){Ht=!1}Yt=Ht?"binary_string":"binary_string_ie",t.isEncoding(Yt)||(Yt="base64");var Xt=function(){};Xt.prototype.name=function(){return Kt.Name},Xt.prototype.clear=function(){jt.localStorage.clear()},Xt.prototype.beginTransaction=function(t){return new At(this)},Xt.prototype.get=function(e){try{var n=jt.localStorage.getItem(e);if(null!==n)return t.from(n,Yt)}catch(t){}},Xt.prototype.put=function(t,e,n){try{return!(!n&&null!==jt.localStorage.getItem(t))&&(jt.localStorage.setItem(t,e.toString(Yt)),!0)}catch(t){throw new at(nt.ENOSPC,"LocalStorage is full.")}},Xt.prototype.del=function(t){try{jt.localStorage.removeItem(t)}catch(e){throw new at(nt.EIO,"Unable to delete key "+t+": "+e)}};var Kt=function(t){function e(){t.call(this,{store:new Xt})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){n(null,new e)},e.isAvailable=function(){return void 0!==jt.localStorage},e}(Ct);Kt.Name="LocalStorage",Kt.Options={};var Jt=function(t){function e(e){t.call(this),this.mountList=[],this.mntMap={},this.rootFs=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){Bt.Create({},function(r,i){if(i){var o=new e(i);try{Object.keys(t).forEach(function(e){o.mount(e,t[e])})}catch(r){return n(r)}n(null,o)}else n(r)})},e.isAvailable=function(){return!0},e.prototype.mount=function(t,e){if("/"!==t[0]&&(t="/"+t),t=it.resolve(t),this.mntMap[t])throw new at(nt.EINVAL,"Mount point "+t+" is already taken.");y(t,511,this.rootFs),this.mntMap[t]=e,this.mountList.push(t),this.mountList=this.mountList.sort(function(t,e){return e.length-t.length})},e.prototype.umount=function(t){var e=this;if("/"!==t[0]&&(t="/"+t),t=it.resolve(t),!this.mntMap[t])throw new at(nt.EINVAL,"Mount point "+t+" is already unmounted.");for(delete this.mntMap[t],this.mountList.splice(this.mountList.indexOf(t),1);"/"!==t&&0===e.rootFs.readdirSync(t).length;)e.rootFs.rmdirSync(t),t=it.dirname(t)},e.prototype._getFs=function(t){for(var e=this,n=this.mountList,r=n.length,i=0;i<r;i++){var o=n[i];if(o.length<=t.length&&0===t.indexOf(o))return t=t.substr(o.length>1?o.length:0),""===t&&(t="/"),{fs:e.mntMap[o],path:t}}return{fs:this.rootFs,path:t}},e.prototype.getName=function(){return e.Name},e.prototype.diskSpace=function(t,e){e(0,0)},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.standardizeError=function(t,e,n){var r=t.message.indexOf(e);return-1!==r&&(t.message=t.message.substr(0,r)+n+t.message.substr(r+e.length),t.path=n),t},e.prototype.rename=function(t,e,n){var r=this,i=this._getFs(t),o=this._getFs(e);return i.fs===o.fs?i.fs.rename(i.path,o.path,function(s){s&&r.standardizeError(r.standardizeError(s,i.path,t),o.path,e),n(s)}):yt.readFile(t,function(r,i){if(r)return n(r);yt.writeFile(e,i,function(e){if(e)return n(e);yt.unlink(t,n)})})},e.prototype.renameSync=function(t,e){var n=this._getFs(t),r=this._getFs(e);if(n.fs===r.fs)try{return n.fs.renameSync(n.path,r.path)}catch(i){throw this.standardizeError(this.standardizeError(i,n.path,t),r.path,e),i}var i=yt.readFileSync(t);return yt.writeFileSync(e,i),yt.unlinkSync(t)},e.prototype.readdirSync=function(t){var e=this._getFs(t),n=null;if(e.fs!==this.rootFs)try{n=this.rootFs.readdirSync(t)}catch(t){}try{var r=e.fs.readdirSync(e.path);return null===n?r:r.concat(n.filter(function(t){return-1===r.indexOf(t)}))}catch(r){if(null===n)throw this.standardizeError(r,e.path,t);return n}},e.prototype.readdir=function(t,e){var n=this,r=this._getFs(t);r.fs.readdir(r.path,function(i,o){if(r.fs!==n.rootFs)try{var s=n.rootFs.readdirSync(t);o=o?o.concat(s.filter(function(t){return-1===o.indexOf(t)})):s}catch(o){if(i)return e(n.standardizeError(i,r.path,t))}else if(i)return e(n.standardizeError(i,r.path,t));e(null,o)})},e.prototype.rmdirSync=function(t){var e=this._getFs(t);if(this._containsMountPt(t))throw at.ENOTEMPTY(t);try{e.fs.rmdirSync(e.path)}catch(n){throw this.standardizeError(n,e.path,t)}},e.prototype.rmdir=function(t,e){var n=this,r=this._getFs(t);this._containsMountPt(t)?e(at.ENOTEMPTY(t)):r.fs.rmdir(r.path,function(i){e(i?n.standardizeError(i,r.path,t):null)})},e.prototype._containsMountPt=function(t){for(var e=this.mountList,n=e.length,r=0;r<n;r++){var i=e[r];if(i.length>=t.length&&i.slice(0,t.length)===t)return!0}return!1},e}(It);Jt.Name="MountableFileSystem",Jt.Options={};for(var Gt=[["exists","unlink","readlink"],["stat","mkdir","realpath","truncate"],["open","readFile","chmod","utimes"],["chown"],["writeFile","appendFile"]],Qt=0;Qt<Gt.length;Qt++)for(var $t=Gt[Qt],te=0,ee=$t;te<ee.length;te+=1){var ne=ee[te];Jt.prototype[ne]=L(ne,!1,Qt+1),Jt.prototype[ne+"Sync"]=L(ne+"Sync",!0,Qt+1)}var re;!function(t){t[t.CB=0]="CB",t[t.FD=1]="FD",t[t.API_ERROR=2]="API_ERROR",t[t.STATS=3]="STATS",t[t.PROBE=4]="PROBE",t[t.FILEFLAG=5]="FILEFLAG",t[t.BUFFER=6]="BUFFER",t[t.ERROR=7]="ERROR"}(re||(re={}));var ie=function(){this._callbacks={},this._nextId=0};ie.prototype.toRemoteArg=function(t){var e=this._nextId++;return this._callbacks[e]=t,{type:re.CB,id:e}},ie.prototype.toLocalArg=function(t){var e=this._callbacks[t];return delete this._callbacks[t],e};var oe=function(){this._fileDescriptors={},this._nextId=0};oe.prototype.toRemoteArg=function(e,n,r,i){var o,s,a=this._nextId++;this._fileDescriptors[a]=e,e.stat(function(u,c){u?i(u):(s=j(c.toBuffer()),r.isReadable()?e.read(t.alloc(c.size),0,c.size,0,function(t,e,u){t?i(t):(o=j(u),i(null,{type:re.FD,id:a,data:o,stat:s,path:n,flag:r.getFlagString()}))}):i(null,{type:re.FD,id:a,data:new ArrayBuffer(0),stat:s,path:n,flag:r.getFlagString()}))})},oe.prototype.applyFdAPIRequest=function(t,e){var n=this,r=t.args[0];this._applyFdChanges(r,function(i,o){i?e(i):o[t.method](function(i){"close"===t.method&&delete n._fileDescriptors[r.id],e(i)})})},oe.prototype._applyFdChanges=function(t,e){var n=this._fileDescriptors[t.id],r=z(t.data),i=ht.fromBuffer(z(t.stat)),o=ct.getFileFlag(t.flag);o.isWriteable()?n.write(r,0,r.length,o.isAppendable()?n.getPos():0,function(t){function s(){n.stat(function(t,r){t?e(t):r.mode!==i.mode?n.chmod(i.mode,function(t){e(t,n)}):e(t,n)})}t?e(t):o.isAppendable()?s():n.truncate(r.length,function(){s()})}):e(null,n)};var se=function(t){function e(e,n,r,i,o,s){t.call(this,e,n,r,i,s),this._remoteFdId=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getRemoteFdId=function(){return this._remoteFdId},e.prototype.toRemoteArg=function(){return{type:re.FD,id:this._remoteFdId,data:j(this.getBuffer()),stat:j(this.getStats().toBuffer()),path:this.getPath(),flag:this.getFlag().getFlagString()}},e.prototype.sync=function(t){this._syncClose("sync",t)},e.prototype.close=function(t){this._syncClose("close",t)},e.prototype._syncClose=function(t,e){var n=this;this.isDirty()?this._fs.syncClose(t,this,function(t){t||n.resetDirty(),e(t)}):e()},e}(Nt),ae=function(e){function n(t){var n=this;e.call(this),this._callbackConverter=new ie,this._isInitialized=!1,this._isReadOnly=!1,this._supportLinks=!1,this._supportProps=!1,this._worker=t,this._worker.addEventListener("message",function(t){var e=t.data;if(q(e)){var r,i=e.args,o=new Array(i.length);for(r=0;r<o.length;r++)o[r]=n._argRemote2Local(i[r]);n._callbackConverter.toLocalArg(e.cbId).apply(null,o)}})}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.Create=function(t,e){var r=new n(t.worker);r._initialize(function(){e(null,r)})},n.isAvailable=function(){return"undefined"!=typeof importScripts||"undefined"!=typeof Worker},n.attachRemoteListener=function(e){function n(e,n,r){switch(typeof e){case"object":e instanceof ht?r(null,P(e)):e instanceof at?r(null,x(e)):e instanceof kt?r(null,i.toRemoteArg(e,n[0],n[1],r)):e instanceof ct?r(null,U(e)):e instanceof t?r(null,W(e)):e instanceof Error?r(null,D(e)):r(null,e);break;default:r(null,e)}}function r(t,r){if(!t)return t;switch(typeof t){case"object":if("number"!=typeof t.type)return t;var i=t;switch(i.type){case re.CB:var o=t.id;return function(){function t(t){c>0&&(c=-1,s={browserfsMessage:!0,cbId:o,args:[x(t)]},e.postMessage(s))}var i,s,a=arguments,u=new Array(arguments.length),c=arguments.length;for(i=0;i<arguments.length;i++)!function(i,a){n(a,r,function(n,r){u[i]=r,n?t(n):0==--c&&(s={browserfsMessage:!0,cbId:o,args:u},e.postMessage(s))})}(i,a[i]);0===arguments.length&&(s={browserfsMessage:!0,cbId:o,args:u},e.postMessage(s))};case re.API_ERROR:return A(i);case re.STATS:return M(i);case re.FILEFLAG:return B(i);case re.BUFFER:return V(i);case re.ERROR:return C(i);default:return t}default:return t}}var i=new oe;e.addEventListener("message",function(t){var n=t.data;if(Z(n)){var o=n.args,s=new Array(o.length);switch(n.method){case"close":case"sync":!function(){var t=o[1];i.applyFdAPIRequest(n,function(n){var r={browserfsMessage:!0,cbId:t.id,args:n?[x(n)]:[]};e.postMessage(r)})}();break;case"probe":!function(){var t=yt.getRootFS(),n=o[1],r={type:re.PROBE,isReadOnly:t.isReadOnly(),supportsLinks:t.supportsLinks(),supportsProps:t.supportsProps()},i={browserfsMessage:!0,cbId:n.id,args:[r]};e.postMessage(i)}();break;default:for(var a=0;a<o.length;a++)s[a]=r(o[a],s);var u=yt.getRootFS();u[n.method].apply(u,s)}}})},n.prototype.getName=function(){return n.Name},n.prototype.isReadOnly=function(){return this._isReadOnly},n.prototype.supportsSynch=function(){return!1},n.prototype.supportsLinks=function(){return this._supportLinks},n.prototype.supportsProps=function(){return this._supportProps},n.prototype.rename=function(t,e,n){this._rpc("rename",arguments)},n.prototype.stat=function(t,e,n){this._rpc("stat",arguments)},n.prototype.open=function(t,e,n,r){this._rpc("open",arguments)},n.prototype.unlink=function(t,e){this._rpc("unlink",arguments)},n.prototype.rmdir=function(t,e){this._rpc("rmdir",arguments)},n.prototype.mkdir=function(t,e,n){this._rpc("mkdir",arguments)},n.prototype.readdir=function(t,e){this._rpc("readdir",arguments)},n.prototype.exists=function(t,e){this._rpc("exists",arguments)},n.prototype.realpath=function(t,e,n){this._rpc("realpath",arguments)},n.prototype.truncate=function(t,e,n){this._rpc("truncate",arguments)},n.prototype.readFile=function(t,e,n,r){this._rpc("readFile",arguments)},n.prototype.writeFile=function(t,e,n,r,i,o){this._rpc("writeFile",arguments)},n.prototype.appendFile=function(t,e,n,r,i,o){this._rpc("appendFile",arguments)},n.prototype.chmod=function(t,e,n,r){this._rpc("chmod",arguments)},n.prototype.chown=function(t,e,n,r,i){this._rpc("chown",arguments)},n.prototype.utimes=function(t,e,n,r){this._rpc("utimes",arguments)},n.prototype.link=function(t,e,n){this._rpc("link",arguments)},n.prototype.symlink=function(t,e,n,r){this._rpc("symlink",arguments)},n.prototype.readlink=function(t,e){this._rpc("readlink",arguments)},n.prototype.syncClose=function(t,e,n){this._worker.postMessage({browserfsMessage:!0,method:t,args:[e.toRemoteArg(),this._callbackConverter.toRemoteArg(n)]})},n.prototype._initialize=function(t){var e=this;if(this._isInitialized)t();else{var n={browserfsMessage:!0,method:"probe",args:[this._argLocal2Remote(E()),this._callbackConverter.toRemoteArg(function(n){e._isInitialized=!0,e._isReadOnly=n.isReadOnly,e._supportLinks=n.supportsLinks,e._supportProps=n.supportsProps,t()})]};this._worker.postMessage(n)}},n.prototype._argRemote2Local=function(t){if(!t)return t;switch(typeof t){case"object":if("number"!=typeof t.type)return t;var e=t;switch(e.type){case re.API_ERROR:return A(e);case re.FD:var n=e;return new se(this,n.path,ct.getFileFlag(n.flag),ht.fromBuffer(z(n.stat)),n.id,z(n.data));case re.STATS:return M(e);case re.FILEFLAG:return B(e);case re.BUFFER:return V(e);case re.ERROR:return C(e);default:return t}default:return t}},n.prototype._rpc=function(t,e){for(var n=this,r=new Array(e.length),i=0;i<e.length;i++)r[i]=n._argLocal2Remote(e[i]);var o={browserfsMessage:!0,method:t,args:r};this._worker.postMessage(o)},n.prototype._argLocal2Remote=function(e){if(!e)return e;switch(typeof e){case"object":return e instanceof ht?P(e):e instanceof at?x(e):e instanceof se?e.toRemoteArg():e instanceof ct?U(e):e instanceof t?W(e):e instanceof Error?D(e):"Unknown argument";case"function":return this._callbackConverter.toRemoteArg(e);default:return e}},n}(It);ae.Name="WorkerFS",ae.Options={worker:{type:"object",description:"The target worker that you want to connect to, or the current worker if in a worker context.",validator:function(t,e){t.postMessage?e():e(new at(nt.EINVAL,"option must be a Web Worker instance."))}}};var ue=function(){};ue.str2byte=function(t,e){for(var n=t.length>e.length?e.length:t.length,r=0;r<n;r++){var i=t.charCodeAt(r);if(i>127){var o=ue.extendedChars.indexOf(t.charAt(r));o>-1&&(i=o+128)}e[i]=r}return n},ue.byte2str=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++){var r=t[n];e[n]=r>127?ue.extendedChars[r-128]:String.fromCharCode(r)}return e.join("")},ue.byteLength=function(t){return t.length},ue.extendedChars=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];var ce;if("undefined"!=typeof setImmediate)ce=setImmediate;else{var fe=jt,he=[];if(function(){if(void 0!==fe.importScripts||!fe.postMessage)return!1;var t=!0,e=fe.onmessage;return fe.onmessage=function(){t=!1},fe.postMessage("","*"),fe.onmessage=e,t}()){ce=function(t){he.push(t),fe.postMessage("zero-timeout-message","*")};var pe=function(t){if(t.source===self&&"zero-timeout-message"===t.data&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,he.length>0)){return he.shift()()}};fe.addEventListener?fe.addEventListener("message",pe,!0):fe.attachEvent("onmessage",pe)}else if(fe.MessageChannel){var le=new fe.MessageChannel;le.port1.onmessage=function(t){if(he.length>0)return he.shift()()},ce=function(t){he.push(t),le.port2.postMessage("")}}else ce=function(t){return setTimeout(t,0)}}var de=ce,ye=function(){this._index={},this.addPath("/",new me)};ye.fromListing=function(t){var e=new ye,n=new me;e._index["/"]=n;for(var r=[["",t,n]];r.length>0;){var i=void 0,o=r.pop(),s=o[0],a=o[1],u=o[2];for(var c in a)if(a.hasOwnProperty(c)){var f=a[c],h=s+"/"+c;f?(e._index[h]=i=new me,r.push([h,f,i])):i=new ge(new ht(ft.FILE,-1,365)),u&&(u._ls[c]=i)}}return e},ye.prototype.fileIterator=function(t){var e=this;for(var n in e._index)if(e._index.hasOwnProperty(n))for(var r=e._index[n],i=r.getListing(),o=0,s=i;o<s.length;o+=1){var a=s[o],u=r.getItem(a);Y(u)&&t(u.getData())}},ye.prototype.addPath=function(t,e){if(!e)throw new Error("Inode must be specified");if("/"!==t[0])throw new Error("Path must be absolute, got: "+t);if(this._index.hasOwnProperty(t))return this._index[t]===e;var n=this._split_path(t),r=n[0],i=n[1],o=this._index[r];return!(void 0===o&&"/"!==t&&(o=new me,!this.addPath(r,o)))&&(!("/"!==t&&!o.addItem(i,e))&&(H(e)&&(this._index[t]=e),!0))},ye.prototype.addPathFast=function(t,e){var n=t.lastIndexOf("/"),r=0===n?"/":t.substring(0,n),i=t.substring(n+1),o=this._index[r];return void 0===o&&(o=new me,this.addPathFast(r,o)),!!o.addItem(i,e)&&(e.isDir()&&(this._index[t]=e),!0)},ye.prototype.removePath=function(t){var e=this,n=this._split_path(t),r=n[0],i=n[1],o=this._index[r];if(void 0===o)return null;var s=o.remItem(i);if(null===s)return null;if(H(s)){for(var a=s.getListing(),u=0,c=a;u<c.length;u+=1){var f=c[u];e.removePath(t+"/"+f)}"/"!==t&&delete this._index[t]}return s},ye.prototype.ls=function(t){var e=this._index[t];return void 0===e?null:e.getListing()},ye.prototype.getInode=function(t){var e=this._split_path(t),n=e[0],r=e[1],i=this._index[n];return void 0===i?null:n===t?i:i.getItem(r)},ye.prototype._split_path=function(t){var e=it.dirname(t);return[e,t.substr(e.length+("/"===e?0:1))]};var ge=function(t){this.data=t};ge.prototype.isFile=function(){return!0},ge.prototype.isDir=function(){return!1},ge.prototype.getData=function(){return this.data},ge.prototype.setData=function(t){this.data=t};var me=function(t){void 0===t&&(t=null),this.data=t,this._ls={}};me.prototype.isFile=function(){return!1},me.prototype.isDir=function(){return!0},me.prototype.getData=function(){return this.data},me.prototype.getStats=function(){return new ht(ft.DIRECTORY,4096,365)},me.prototype.getListing=function(){return Object.keys(this._ls)},me.prototype.getItem=function(t){var e=this._ls[t];return e||null},me.prototype.addItem=function(t,e){return!(t in this._ls)&&(this._ls[t]=e,!0)},me.prototype.remItem=function(t){var e=this._ls[t];return void 0===e?null:(delete this._ls[t],e)};var we,ve=n(34).inflateRaw,_e={};!function(t){t[t.MSDOS=0]="MSDOS",t[t.AMIGA=1]="AMIGA",t[t.OPENVMS=2]="OPENVMS",t[t.UNIX=3]="UNIX",t[t.VM_CMS=4]="VM_CMS",t[t.ATARI_ST=5]="ATARI_ST",t[t.OS2_HPFS=6]="OS2_HPFS",t[t.MAC=7]="MAC",t[t.Z_SYSTEM=8]="Z_SYSTEM",t[t.CP_M=9]="CP_M",t[t.NTFS=10]="NTFS",t[t.MVS=11]="MVS",t[t.VSE=12]="VSE",t[t.ACORN_RISC=13]="ACORN_RISC",t[t.VFAT=14]="VFAT",t[t.ALT_MVS=15]="ALT_MVS",t[t.BEOS=16]="BEOS",t[t.TANDEM=17]="TANDEM",t[t.OS_400=18]="OS_400",t[t.OSX=19]="OSX"}(we||(we={}));var be;!function(t){t[t.STORED=0]="STORED",t[t.SHRUNK=1]="SHRUNK",t[t.REDUCED_1=2]="REDUCED_1",t[t.REDUCED_2=3]="REDUCED_2",t[t.REDUCED_3=4]="REDUCED_3",t[t.REDUCED_4=5]="REDUCED_4",t[t.IMPLODE=6]="IMPLODE",t[t.DEFLATE=8]="DEFLATE",t[t.DEFLATE64=9]="DEFLATE64",t[t.TERSE_OLD=10]="TERSE_OLD",t[t.BZIP2=12]="BZIP2",t[t.LZMA=14]="LZMA",t[t.TERSE_NEW=18]="TERSE_NEW",t[t.LZ77=19]="LZ77",t[t.WAVPACK=97]="WAVPACK",t[t.PPMD=98]="PPMD"}(be||(be={}));var Ee=function(t){if(this.data=t,67324752!==t.readUInt32LE(0))throw new at(nt.EINVAL,"Invalid Zip file: Local file header has invalid signature: "+this.data.readUInt32LE(0))};Ee.prototype.versionNeeded=function(){return this.data.readUInt16LE(4)},Ee.prototype.flags=function(){return this.data.readUInt16LE(6)},Ee.prototype.compressionMethod=function(){return this.data.readUInt16LE(8)},Ee.prototype.lastModFileTime=function(){return X(this.data.readUInt16LE(10),this.data.readUInt16LE(12))},Ee.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(10)},Ee.prototype.crc32=function(){return this.data.readUInt32LE(14)},Ee.prototype.fileNameLength=function(){return this.data.readUInt16LE(26)},Ee.prototype.extraFieldLength=function(){return this.data.readUInt16LE(28)},Ee.prototype.fileName=function(){return K(this.data,this.useUTF8(),30,this.fileNameLength())},Ee.prototype.extraField=function(){var t=30+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},Ee.prototype.totalSize=function(){return 30+this.fileNameLength()+this.extraFieldLength()},Ee.prototype.useUTF8=function(){return 2048==(2048&this.flags())};var Se=function(t,e,n){this.header=t,this.record=e,this.data=n};Se.prototype.decompress=function(){var t=this.header.compressionMethod(),e=_e[t];if(e)return e(this.data,this.record.compressedSize(),this.record.uncompressedSize(),this.record.flag());var n=be[t];throw n||(n="Unknown: "+t),new at(nt.EINVAL,"Invalid compression method on file '"+this.header.fileName()+"': "+n)},Se.prototype.getHeader=function(){return this.header},Se.prototype.getRecord=function(){return this.record},Se.prototype.getRawData=function(){return this.data};var Ie=function(t){this.data=t};Ie.prototype.crc32=function(){return this.data.readUInt32LE(0)},Ie.prototype.compressedSize=function(){return this.data.readUInt32LE(4)},Ie.prototype.uncompressedSize=function(){return this.data.readUInt32LE(8)};var Oe=function(t){if(this.data=t,134630224!==this.data.readUInt32LE(0))throw new at(nt.EINVAL,"Invalid archive extra data record signature: "+this.data.readUInt32LE(0))};Oe.prototype.length=function(){return this.data.readUInt32LE(4)},Oe.prototype.extraFieldData=function(){return this.data.slice(8,8+this.length())};var ke=function(t){if(this.data=t,84233040!==this.data.readUInt32LE(0))throw new at(nt.EINVAL,"Invalid digital signature signature: "+this.data.readUInt32LE(0))};ke.prototype.size=function(){return this.data.readUInt16LE(4)},ke.prototype.signatureData=function(){return this.data.slice(6,6+this.size())};var Ne=function(t,e){if(this.zipData=t,this.data=e,33639248!==this.data.readUInt32LE(0))throw new at(nt.EINVAL,"Invalid Zip file: Central directory record has invalid signature: "+this.data.readUInt32LE(0));this._filename=this.produceFilename()};Ne.prototype.versionMadeBy=function(){return this.data.readUInt16LE(4)},Ne.prototype.versionNeeded=function(){return this.data.readUInt16LE(6)},Ne.prototype.flag=function(){return this.data.readUInt16LE(8)},Ne.prototype.compressionMethod=function(){return this.data.readUInt16LE(10)},Ne.prototype.lastModFileTime=function(){return X(this.data.readUInt16LE(12),this.data.readUInt16LE(14))},Ne.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(12)},Ne.prototype.crc32=function(){return this.data.readUInt32LE(16)},Ne.prototype.compressedSize=function(){return this.data.readUInt32LE(20)},Ne.prototype.uncompressedSize=function(){return this.data.readUInt32LE(24)},Ne.prototype.fileNameLength=function(){return this.data.readUInt16LE(28)},Ne.prototype.extraFieldLength=function(){return this.data.readUInt16LE(30)},Ne.prototype.fileCommentLength=function(){return this.data.readUInt16LE(32)},Ne.prototype.diskNumberStart=function(){return this.data.readUInt16LE(34)},Ne.prototype.internalAttributes=function(){return this.data.readUInt16LE(36)},Ne.prototype.externalAttributes=function(){return this.data.readUInt32LE(38)},Ne.prototype.headerRelativeOffset=function(){return this.data.readUInt32LE(42)},Ne.prototype.produceFilename=function(){return K(this.data,this.useUTF8(),46,this.fileNameLength()).replace(/\\/g,"/")},Ne.prototype.fileName=function(){return this._filename},Ne.prototype.rawFileName=function(){return this.data.slice(46,46+this.fileNameLength())},Ne.prototype.extraField=function(){var t=44+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},Ne.prototype.fileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return K(this.data,this.useUTF8(),t,this.fileCommentLength())},Ne.prototype.rawFileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return this.data.slice(t,t+this.fileCommentLength())},Ne.prototype.totalSize=function(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()},Ne.prototype.isDirectory=function(){var t=this.fileName();return!!(16&this.externalAttributes())||"/"===t.charAt(t.length-1)},Ne.prototype.isFile=function(){return!this.isDirectory()},Ne.prototype.useUTF8=function(){return 2048==(2048&this.flag())},Ne.prototype.isEncrypted=function(){return 1==(1&this.flag())},Ne.prototype.getFileData=function(){var t=this.headerRelativeOffset(),e=new Ee(this.zipData.slice(t));return new Se(e,this,this.zipData.slice(t+e.totalSize()))},Ne.prototype.getData=function(){return this.getFileData().decompress()},Ne.prototype.getRawData=function(){return this.getFileData().getRawData()},Ne.prototype.getStats=function(){return new ht(ft.FILE,this.uncompressedSize(),365,new Date,this.lastModFileTime())};var Fe=function(t){if(this.data=t,101010256!==this.data.readUInt32LE(0))throw new at(nt.EINVAL,"Invalid Zip file: End of central directory record has invalid signature: "+this.data.readUInt32LE(0))};Fe.prototype.diskNumber=function(){return this.data.readUInt16LE(4)},Fe.prototype.cdDiskNumber=function(){return this.data.readUInt16LE(6)},Fe.prototype.cdDiskEntryCount=function(){return this.data.readUInt16LE(8)},Fe.prototype.cdTotalEntryCount=function(){return this.data.readUInt16LE(10)},Fe.prototype.cdSize=function(){return this.data.readUInt32LE(12)},Fe.prototype.cdOffset=function(){return this.data.readUInt32LE(16)},Fe.prototype.cdZipCommentLength=function(){return this.data.readUInt16LE(20)},Fe.prototype.cdZipComment=function(){return K(this.data,!0,22,this.cdZipCommentLength())},Fe.prototype.rawCdZipComment=function(){return this.data.slice(22,22+this.cdZipCommentLength())};var Re=function(t,e,n,r){this.index=t,this.directoryEntries=e,this.eocd=n,this.data=r},Te=function(t){function e(e,n){void 0===n&&(n=""),t.call(this),this.name=n,this._index=new ye,this._directoryEntries=[],this._eocd=null,this._index=e.index,this._directoryEntries=e.directoryEntries,this._eocd=e.eocd,this.data=e.data}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{e._computeIndex(t.zipData,function(r,i){if(i){var o=new e(i,t.name);n(null,o)}else n(r)})}catch(t){n(t)}},e.isAvailable=function(){return!0},e.RegisterDecompressionMethod=function(t,e){_e[t]=e},e._getEOCD=function(t){for(var e=Math.min(65557,t.length-1),n=22;n<e;n++)if(101010256===t.readUInt32LE(t.length-n))return new Fe(t.slice(t.length-n));throw new at(nt.EINVAL,"Invalid ZIP file: Could not locate End of Central Directory signature.")},e._addToIndex=function(t,e){var n=t.fileName();if("/"===n.charAt(0))throw new at(nt.EPERM,"Unexpectedly encountered an absolute path in a zip file. Please file a bug.");"/"===n.charAt(n.length-1)&&(n=n.substr(0,n.length-1)),t.isDirectory()?e.addPathFast("/"+n,new me(t)):e.addPathFast("/"+n,new ge(t))},e._computeIndex=function(t,n){try{var r=new ye,i=e._getEOCD(t);if(i.diskNumber()!==i.cdDiskNumber())return n(new at(nt.EINVAL,"ZipFS does not support spanned zip files."));var o=i.cdOffset();if(4294967295===o)return n(new at(nt.EINVAL,"ZipFS does not support Zip64."));var s=o+i.cdSize();e._computeIndexResponsive(t,r,o,s,n,[],i)}catch(t){n(t)}},e._computeIndexResponsiveTrampoline=function(t,n,r,i,o,s,a){try{e._computeIndexResponsive(t,n,r,i,o,s,a)}catch(t){o(t)}},e._computeIndexResponsive=function(t,n,r,i,o,s,a){if(r<i){for(var u=0;u++<200&&r<i;){var c=new Ne(t,t.slice(r));e._addToIndex(c,n),r+=c.totalSize(),s.push(c)}de(function(){e._computeIndexResponsiveTrampoline(t,n,r,i,o,s,a)})}else o(null,new Re(n,s,a,t))},e.prototype.getName=function(){return e.Name+(""!==this.name?" "+this.name:"")},e.prototype.getCentralDirectoryEntry=function(t){var e=this._index.getInode(t);if(null===e)throw at.ENOENT(t);if(Y(e))return e.getData();if(H(e))return e.getData();throw at.EPERM("Invalid inode: "+e)},e.prototype.getCentralDirectoryEntryAt=function(t){var e=this._directoryEntries[t];if(!e)throw new RangeError("Invalid directory index: "+t+".");return e},e.prototype.getNumberOfCentralDirectoryEntries=function(){return this._directoryEntries.length},e.prototype.getEndOfCentralDirectory=function(){return this._eocd},e.prototype.diskSpace=function(t,e){e(this.data.length,0)},e.prototype.isReadOnly=function(){return!0},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return!1},e.prototype.supportsSynch=function(){return!0},e.prototype.statSync=function(t,e){var n=this._index.getInode(t);if(null===n)throw at.ENOENT(t);var r;if(Y(n))r=n.getData().getStats();else{if(!H(n))throw new at(nt.EINVAL,"Invalid inode.");r=n.getStats()}return r},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new at(nt.EPERM,t);var r=this._index.getInode(t);if(!r)throw at.ENOENT(t);if(!Y(r))throw at.EISDIR(t);var i=r.getData(),o=i.getStats();switch(e.pathExistsAction()){case st.THROW_EXCEPTION:case st.TRUNCATE_FILE:throw at.EEXIST(t);case st.NOP:return new Ft(this,t,e,o,i.getData());default:throw new at(nt.EINVAL,"Invalid FileMode object.")}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(e){if(H(e))return e.getListing();throw at.ENOTDIR(t)}throw at.ENOENT(t)},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r,o=i.getBuffer();return null===e?b(o):o.toString(e)}finally{r.closeSync()}},e}(Ot);Te.Name="ZipFS",Te.Options={zipData:{type:"object",description:"The zip file as a Buffer object.",validator:S},name:{type:"string",optional:!0,description:"The name of the zip file (optional)."}},Te.CompressionMethod=be,Te.RegisterDecompressionMethod(be.DEFLATE,function(t,e,n){return w(ve(t.slice(0,e),{chunkSize:n}))}),Te.RegisterDecompressionMethod(be.STORED,function(t,e,n){return b(t,0,n)});var Le=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;if(this.isDirty()){var n=this.getBuffer();this._fs._sync(this.getPath(),n,function(n,r){n||e.resetDirty(),t(n)})}else t()},e.prototype.close=function(t){this.sync(t)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer()),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(Nt),xe=function(e){function n(t){e.call(this),this.manager=t}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.Create=function(t,e){e(null,new n(t.manager))},n.isAvailable=function(){return!0},n.prototype.getName=function(){return"CodeSandboxFS"},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!0},n.prototype.empty=function(t){var e=this,n=this.manager.getTranspiledModules();Object.keys(n).forEach(function(t){e.manager.removeModule(n[t].module)}),t()},n.prototype.renameSync=function(t,e){var n=this,r=this.manager.getTranspiledModules(),i=Object.keys(r).filter(function(e){return e.startsWith(t)+"/"||e===t});if(0===i.length)throw at.FileError(nt.ENOENT,t);i.map(function(t){return r[t]}).forEach(function(r){var i=r.module;n.manager.moveModule(i,i.path.replace(t,e))})},n.prototype.statSync=function(t,e){var n=this.manager.getTranspiledModules(),r=n[t];if(!r){if(Object.keys(n).filter(function(e){return e.startsWith(t.endsWith("/")?t:t+"/")||e===t}).length>0)return new ht(ft.DIRECTORY,0);throw at.FileError(nt.ENOENT,t)}return new ht(ft.FILE,(r.module.code||"").length)},n.prototype.createFileSync=function(e,n,r){if("/"===e)throw at.EEXIST(e);if(this.manager.getTranspiledModules()[e])throw at.EEXIST(e);var i={path:e,code:""};this.manager.addModule(i);var o=t.from(i.code||""),s=new ht(ft.FILE,o.length);return new Le(this,e,n,s,o)},n.prototype.openFileSync=function(e,n,r){var i=this.manager.getTranspiledModules()[e];if(!i)throw at.ENOENT(e);var o=i.module,s=o.code;void 0===s&&(s="");var a=t.from(s||""),u=new ht(ft.FILE,a.length);return new Le(this,e,n,u,a)},n.prototype.rmdirSync=function(t){var e=this,n=this.manager.getTranspiledModules();Object.keys(n).filter(function(e){return e.startsWith(t+"/")||t===e}).forEach(function(t){var r=n[t],i=r.module;e.manager.removeModule(i)})},n.prototype.mkdirSync=function(t){},n.prototype.readdirSync=function(t){var e=Object.keys(this.manager.getTranspiledModules()),n=t.endsWith("/")?t:t+"/",r=e.filter(function(t){return t.startsWith(n)});if(0===r.length)return[];var i=new Set,o=n.split("/").length;return r.filter(function(t){return t.split("/").length>=o}).forEach(function(t){var e=t.split("/");e.length=o,i.add(e.join("/"))}),Array.from(i).map(function(t){return t.replace(n,"")})},n.prototype._sync=function(t,e,n){var r=this,i=it.dirname(t);this.stat(i,!1,function(e,o){if(e)n(at.FileError(nt.ENOENT,i));else{var s=r.manager.getTranspiledModules()[t].module;r.manager.updateModule(s),n(null)}})},n.prototype._syncSync=function(t,e){var n=it.dirname(t);this.statSync(n,!1);var r=this.manager.getTranspiledModules()[t].module;this.manager.updateModule(r)},n}(Ot);xe.Name="CodeSandboxFS",xe.Options={manager:{type:"object",description:"The CodeSandbox Manager",validator:function(t,e){t?e():e(new at(nt.EINVAL,"Manager is invalid"))}}};var Ae=console.warn,De=function(t){function e(e,n,r,i,o){t.call(this,e,n,r,i,o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.sync=function(t){var e=this;if(this.isDirty()){var n=this.getBuffer();this._fs._sync(this.getPath(),n,function(n,r){n||e.resetDirty(),t(n)})}else t()},e.prototype.close=function(t){this.sync(t)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this.getPath(),this.getBuffer()),this.resetDirty())},e.prototype.closeSync=function(){this.syncSync()},e}(Nt),Ce=function(e){function n(t){e.call(this),this.manager=t}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.Create=function(t,e){e(null,new n(t.manager))},n.isAvailable=function(){return!0},n.prototype.getName=function(){return"CodeSandboxEditorFS"},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsProps=function(){return!1},n.prototype.supportsSynch=function(){return!0},n.prototype.empty=function(t){throw new Error("Empty not supported")},n.prototype.renameSync=function(t,e){throw new Error("Rename not supported")},n.prototype.statSync=function(t,e){var n=this.manager.getState().editor.modulesByPath,r=n[t];if(!r){if(Object.keys(n).filter(function(e){return e.startsWith(t.endsWith("/")?t:t+"/")||e===t}).length>0)return new ht(ft.DIRECTORY,0);throw at.FileError(nt.ENOENT,t)}return new ht(ft.FILE,(r.code||"").length,void 0,new Date,new Date(r.updatedAt),new Date(r.insertedAt))},n.prototype.createFileSync=function(t,e,n){throw new Error("Create file not supported")},n.prototype.openFileSync=function(e,n,r){var i=this.manager.getState().editor.modulesByPath[e];if(!i)throw at.ENOENT(e);var o=i.code;void 0===o&&(o="");var s=t.from(o||""),a=new ht(ft.FILE,s.length,void 0,new Date,new Date(i.updatedAt),new Date(i.insertedAt));return new De(this,e,n,a,s)},n.prototype.writeFileSync=function(){},n.prototype.rmdirSync=function(t){Ae("rmDirSync not supported")},n.prototype.mkdirSync=function(t){Ae("rmDirSync not supported")},n.prototype.readdirSync=function(t){var e=Object.keys(this.manager.getState().editor.modulesByPath),n=t.endsWith("/")?t:t+"/",r=e.filter(function(t){return t.startsWith(n)});if(0===r.length)return[];var i=new Set,o=n.split("/").length;return r.filter(function(t){return t.split("/").length>=o}).forEach(function(t){var e=t.split("/");e.length=o,i.add(e.join("/"))}),Array.from(i).map(function(t){return t.replace(n,"")})},n.prototype._sync=function(t,e,n){Ae("Sync not supported")},n.prototype._syncSync=function(t,e){Ae("Sync not supported")},n}(Ot);Ce.Name="CodeSandboxEditorFS",Ce.Options={manager:{type:"object",description:"The CodeSandbox Editor",validator:function(t,e){t?e():e(new at(nt.EINVAL,"Manager is invalid"))}}},[Tt,Bt,qt,Kt,Jt,ae,Te,xe,Ce].forEach(function(t){var e=t.Create;t.Create=function(n,r){function i(n){n?s(n):e.call(t,a,s)}var o="function"==typeof n,s=o?n:r,a=o?{}:n;I(t,a,i)}});var Pe={AsyncMirror:Tt,InMemory:Bt,IndexedDB:qt,LocalStorage:Kt,MountableFileSystem:Jt,WorkerFS:ae,ZipFS:Te,CodeSandboxFS:xe,CodeSandboxEditorFS:Ce};i.initializeTTYs&&i.initializeTTYs(),"b"!=="ab".substr(-1)&&(String.prototype.substr=function(t){return function(e,n){return e<0&&(e=this.length+e),t.call(this,e,n)}}(String.prototype.substr)),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&(Uint8Array.prototype.slice||(Uint8Array.prototype.slice=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.length);var n=this;return t<0&&(t=this.length+t)<0&&(t=0),e<0&&(e=this.length+e)<0&&(e=0),e<t&&(e=t),new Uint8Array(n.buffer,n.byteOffset+t,e-t)})),e.install=J,e.registerFileSystem=G,e.BFSRequire=Q,e.initialize=$,e.configure=tt,e.getFileSystem=et,e.EmscriptenFS=St,e.FileSystem=Pe,e.Errors=ut,e.setImmediate=de}).call(e,n(9),n(5),n(2))},function(t,e,n){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-r(t)}function o(t){var e,n,i,o,s,a=t.length;o=r(t),s=new h(3*a/4-o),n=o>0?a-4:a;var u=0;for(e=0;e<n;e+=4)i=f[t.charCodeAt(e)]<<18|f[t.charCodeAt(e+1)]<<12|f[t.charCodeAt(e+2)]<<6|f[t.charCodeAt(e+3)],s[u++]=i>>16&255,s[u++]=i>>8&255,s[u++]=255&i;return 2===o?(i=f[t.charCodeAt(e)]<<2|f[t.charCodeAt(e+1)]>>4,s[u++]=255&i):1===o&&(i=f[t.charCodeAt(e)]<<10|f[t.charCodeAt(e+1)]<<4|f[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=255&i),s}function s(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function a(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(s(r));return i.join("")}function u(t){for(var e,n=t.length,r=n%3,i="",o=[],s=0,u=n-r;s<u;s+=16383)o.push(a(t,s,s+16383>u?u:s+16383));return 1===r?(e=t[n-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=u;for(var c=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,d=p.length;l<d;++l)c[l]=p[l],f[p.charCodeAt(l)]=l;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,f=-7,h=n?i-1:0,p=n?-1:1,l=t[e+h];for(h+=p,o=l&(1<<-f)-1,l>>=-f,f+=a;f>0;o=256*o+t[e+h],h+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[e+h],h+=p,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,r),o-=c}return(l?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,h=f>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=r?0:o-1,d=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+h>=1?p/u:p*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+l]=255&a,l+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+l]=255&s,l+=d,s/=256,c-=8);t[n+l-d]|=128*y}},function(t,e,n){"use strict";(function(e){var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(6),o=null,s=function(){function t(t,e){this.fun=t,this.array=e}return t.prototype.run=function(){this.fun.apply(null,this.array)},t}(),a=function(){function t(){this._queue=[],this._draining=!1,this._currentQueue=null,this._queueIndex=-1}return t.prototype.push=function(t){var e=this;1!==this._queue.push(t)||this._draining||setTimeout(function(){return e._drainQueue()},0)},t.prototype._cleanUpNextTick=function(){this._draining=!1,this._currentQueue&&this._currentQueue.length?this._queue=this._currentQueue.concat(this._queue):this._queueIndex=-1,this._queue.length&&this._drainQueue()},t.prototype._drainQueue=function(){var t=this;if(!this._draining){var e=setTimeout(function(){return t._cleanUpNextTick()});this._draining=!0;for(var n=this._queue.length;n;){for(this._currentQueue=this._queue,this._queue=[];++this._queueIndex<n;)this._currentQueue&&this._currentQueue[this._queueIndex].run();this._queueIndex=-1,n=this._queue.length}this._currentQueue=null,this._draining=!1,clearTimeout(e)}},t}(),u=function(t){function i(){t.apply(this,arguments),this.startTime=Date.now(),this._cwd="/",this.platform="browser",this.argv=[],this.execArgv=[],this.stdout=null,this.stderr=null,this.stdin=null,this.domain=null,this._queue=new a,this.execPath=e,this.env={},this.exitCode=0,this._gid=1,this._uid=1,this.version="v5.0",this.versions={http_parser:"0.0",node:"5.0",v8:"0.0",uv:"0.0",zlib:"0.0",ares:"0.0",icu:"0.0",modules:"0",openssl:"0.0"},this.config={target_defaults:{cflags:[],default_configuration:"Release",defines:[],include_dirs:[],libraries:[]},variables:{clang:0,host_arch:"x32",node_install_npm:!1,node_install_waf:!1,node_prefix:"",node_shared_cares:!1,node_shared_http_parser:!1,node_shared_libuv:!1,node_shared_zlib:!1,node_shared_v8:!1,node_use_dtrace:!1,node_use_etw:!1,node_use_openssl:!1,node_shared_openssl:!1,strict_aliasing:!1,target_arch:"x32",v8_use_snapshot:!1,v8_no_strict_aliasing:0,visibility:""}},this.pid=1e3*Math.random()|0,this.title="node",this.arch="x32",this._mask=18,this.connected=void 0}return r(i,t),i.prototype.chdir=function(t){null===o&&(o=n(13)),this._cwd=o.resolve(t)},i.prototype.cwd=function(){return this._cwd},i.prototype.uptime=function(){return(Date.now()-this.startTime)/1e3|0},i.prototype.nextTick=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this._queue.push(new s(t,e))},i.prototype.abort=function(){this.emit("abort")},i.prototype.exit=function(t){this.exitCode=t,this.emit("exit",[t])},i.prototype.getgid=function(){return this._gid},i.prototype.setgid=function(t){this._gid="number"==typeof t?t:1},i.prototype.getuid=function(){return this._uid},i.prototype.setuid=function(t){this._uid="number"==typeof t?t:1},i.prototype.kill=function(t,e){this.emit("kill",[t,e])},i.prototype.memoryUsage=function(){return{rss:0,heapTotal:0,heapUsed:0}},i.prototype.umask=function(t){void 0===t&&(t=this._mask);var e=this._mask;return this._mask=t,this.emit("umask",[t]),e},i.prototype.hrtime=function(){var t;t="undefined"!=typeof performance?performance.now():Date.now?Date.now():(new Date).getTime();var e=t/1e3|0;return t-=1e3*e,t=1e6*t|0,[e,t]},i.prototype.initializeTTYs=function(){if(null===this.stdout){var t=n(23);this.stdout=new t,this.stderr=new t,this.stdin=new t}},i.prototype.disconnect=function(){},i}(i.EventEmitter);t.exports=u}).call(e,"/")},function(t,e,n){"use strict";(function(e){var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(24),o=function(t){function n(){t.call(this),this.isRaw=!1,this.columns=80,this.rows=120,this.isTTY=!0,this._bufferedWrites=[],this._waitingForWrites=!1}return r(n,t),n.prototype.setRawMode=function(t){this.isRaw!==t&&(this.isRaw=t,this.emit("modeChange"))},n.prototype.changeColumns=function(t){t!==this.columns&&(this.columns=t,this.emit("resize"))},n.prototype.changeRows=function(t){t!==this.rows&&(this.rows=t,this.emit("resize"))},n.isatty=function(t){return t&&t instanceof n},n.prototype._write=function(t,n,r){var i;try{var o;o="string"==typeof t?new e(t,n):t,this._bufferedWrites.push(o),this._waitingForWrites&&this._read(1024)}catch(t){i=t}finally{r(i)}},n.prototype._read=function(t){if(0===this._bufferedWrites.length)this._waitingForWrites=!0;else for(;this._bufferedWrites.length>0&&(this._waitingForWrites=this.push(this._bufferedWrites.shift()),this._waitingForWrites););},n}(i.Duplex);t.exports=o}).call(e,n(9))},function(t,e,n){function r(){i.call(this)}t.exports=r;var i=n(6).EventEmitter;n(1)(r,i),r.Readable=n(10),r.Writable=n(30),r.Duplex=n(31),r.Transform=n(32),r.PassThrough=n(33),r.Stream=r,r.prototype.pipe=function(t,e){function n(e){t.writable&&!1===t.write(e)&&c.pause&&c.pause()}function r(){c.readable&&c.resume&&c.resume()}function o(){f||(f=!0,t.end())}function s(){f||(f=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){c.removeListener("data",n),t.removeListener("drain",r),c.removeListener("end",o),c.removeListener("close",s),c.removeListener("error",a),t.removeListener("error",a),c.removeListener("end",u),c.removeListener("close",u),t.removeListener("close",u)}var c=this;c.on("data",n),t.on("drain",r),t._isStdio||e&&!1===e.end||(c.on("end",o),c.on("close",s));var f=!1;return c.on("error",a),t.on("error",a),c.on("end",u),c.on("close",u),t.on("close",u),t.emit("pipe",c),t}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){t.copy(e,n)}var o=n(11).Buffer;t.exports=function(){function t(){r(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var e=o.allocUnsafe(t>>>0),n=this.head,r=0;n;)i(n.data,e,r),r+=n.data.length,n=n.next;return e},t}()},function(t,e,n){(function(e){function n(t,e){function n(){if(!i){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(r("noDeprecation"))return t;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(e,n(5))},function(t,e,n){"use strict";function r(t){if(!(this instanceof r))return new r(t);i.call(this,t)}t.exports=r;var i=n(18),o=n(3);o.inherits=n(1),o.inherits(r,i),r.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){t.exports=n(12)},function(t,e,n){t.exports=n(0)},function(t,e,n){t.exports=n(10).Transform},function(t,e,n){t.exports=n(10).PassThrough},function(t,e,n){"use strict";function r(t){if(!(this instanceof r))return new r(t);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var n=s.inflateInit2(this.strm,e.windowBits);if(n!==c.Z_OK)throw new Error(f[n]);this.header=new p,s.inflateGetHeader(this.strm,this.header)}function i(t,e){var n=new r(e);if(n.push(t,!0),n.err)throw n.msg||f[n.err];return n.result}function o(t,e){return e=e||{},e.raw=!0,i(t,e)}var s=n(35),a=n(8),u=n(40),c=n(41),f=n(42),h=n(43),p=n(44),l=Object.prototype.toString;r.prototype.push=function(t,e){var n,r,i,o,f,h,p=this.strm,d=this.options.chunkSize,y=this.options.dictionary,g=!1;if(this.ended)return!1;r=e===~~e?e:!0===e?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof t?p.input=u.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?p.input=new Uint8Array(t):p.input=t,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new a.Buf8(d),p.next_out=0,p.avail_out=d),n=s.inflate(p,c.Z_NO_FLUSH),n===c.Z_NEED_DICT&&y&&(h="string"==typeof y?u.string2buf(y):"[object ArrayBuffer]"===l.call(y)?new Uint8Array(y):y,n=s.inflateSetDictionary(this.strm,h)),n===c.Z_BUF_ERROR&&!0===g&&(n=c.Z_OK,g=!1),n!==c.Z_STREAM_END&&n!==c.Z_OK)return this.onEnd(n),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&n!==c.Z_STREAM_END&&(0!==p.avail_in||r!==c.Z_FINISH&&r!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(i=u.utf8border(p.output,p.next_out),o=p.next_out-i,f=u.buf2string(p.output,i),p.next_out=o,p.avail_out=d-o,o&&a.arraySet(p.output,p.output,i,o,0),this.onData(f)):this.onData(a.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(g=!0)}while((p.avail_in>0||0===p.avail_out)&&n!==c.Z_STREAM_END);return n===c.Z_STREAM_END&&(r=c.Z_FINISH),r===c.Z_FINISH?(n=s.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c.Z_OK):r!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),p.avail_out=0,!0)},r.prototype.onData=function(t){this.chunks.push(t)},r.prototype.onEnd=function(t){t===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=r,e.inflate=i,e.inflateRaw=o,e.ungzip=i},function(t,e,n){"use strict";function r(t){return(t>>>24&255)+(t>>>8&65280)+((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 w.Buf16(320),this.work=new w.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=M,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new w.Buf32(yt),e.distcode=e.distdyn=new w.Buf32(gt),e.sane=1,e.back=-1,R):x}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,o(t)):x}function a(t,e){var n,r;return t&&t.state?(r=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?x:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,s(t))):x}function u(t,e){var n,r;return t?(r=new i,t.state=r,r.window=null,n=a(t,e),n!==R&&(t.state=null),n):x}function c(t){return u(t,mt)}function f(t){if(wt){var e;for(g=new w.Buf32(512),m=new w.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(E(I,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;E(O,t.lens,0,32,m,0,t.work,{bits:5}),wt=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function h(t,e,n,r){var i,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new w.Buf8(o.wsize)),r>=o.wsize?(w.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),w.arraySet(o.window,e,n-r,i,o.wnext),r-=i,r?(w.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.whave<o.wsize&&(o.whave+=i))),0}function p(t,e){var n,i,o,s,a,u,c,p,l,d,y,g,m,yt,gt,mt,wt,vt,_t,bt,Et,St,It,Ot,kt=0,Nt=new w.Buf8(4),Ft=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return x;n=t.state,n.mode===X&&(n.mode=K),a=t.next_out,o=t.output,c=t.avail_out,s=t.next_in,i=t.input,u=t.avail_in,p=n.hold,l=n.bits,d=u,y=c,St=R;t:for(;;)switch(n.mode){case M:if(0===n.wrap){n.mode=K;break}for(;l<16;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(2&n.wrap&&35615===p){n.check=0,Nt[0]=255&p,Nt[1]=p>>>8&255,n.check=_(n.check,Nt,2,0),p=0,l=0,n.mode=U;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&p)<<8)+(p>>8))%31){t.msg="incorrect header check",n.mode=pt;break}if((15&p)!==P){t.msg="unknown compression method",n.mode=pt;break}if(p>>>=4,l-=4,Et=8+(15&p),0===n.wbits)n.wbits=Et;else if(Et>n.wbits){t.msg="invalid window size",n.mode=pt;break}n.dmax=1<<Et,t.adler=n.check=1,n.mode=512&p?Y:X,p=0,l=0;break;case U:for(;l<16;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(n.flags=p,(255&n.flags)!==P){t.msg="unknown compression method",n.mode=pt;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=pt;break}n.head&&(n.head.text=p>>8&1),512&n.flags&&(Nt[0]=255&p,Nt[1]=p>>>8&255,n.check=_(n.check,Nt,2,0)),p=0,l=0,n.mode=B;case B:for(;l<32;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}n.head&&(n.head.time=p),512&n.flags&&(Nt[0]=255&p,Nt[1]=p>>>8&255,Nt[2]=p>>>16&255,Nt[3]=p>>>24&255,n.check=_(n.check,Nt,4,0)),p=0,l=0,n.mode=j;case j:for(;l<16;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}n.head&&(n.head.xflags=255&p,n.head.os=p>>8),512&n.flags&&(Nt[0]=255&p,Nt[1]=p>>>8&255,n.check=_(n.check,Nt,2,0)),p=0,l=0,n.mode=z;case z:if(1024&n.flags){for(;l<16;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}n.length=p,n.head&&(n.head.extra_len=p),512&n.flags&&(Nt[0]=255&p,Nt[1]=p>>>8&255,n.check=_(n.check,Nt,2,0)),p=0,l=0}else n.head&&(n.head.extra=null);n.mode=W;case W:if(1024&n.flags&&(g=n.length,g>u&&(g=u),g&&(n.head&&(Et=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),w.arraySet(n.head.extra,i,s,g,Et)),512&n.flags&&(n.check=_(n.check,i,g,s)),u-=g,s+=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{Et=i[s+g++],n.head&&Et&&n.length<65536&&(n.head.name+=String.fromCharCode(Et))}while(Et&&g<u);if(512&n.flags&&(n.check=_(n.check,i,g,s)),u-=g,s+=g,Et)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{Et=i[s+g++],n.head&&Et&&n.length<65536&&(n.head.comment+=String.fromCharCode(Et))}while(Et&&g<u);if(512&n.flags&&(n.check=_(n.check,i,g,s)),u-=g,s+=g,Et)break t}else n.head&&(n.head.comment=null);n.mode=q;case q:if(512&n.flags){for(;l<16;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(p!==(65535&n.check)){t.msg="header crc mismatch",n.mode=pt;break}p=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=X;break;case Y:for(;l<32;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}t.adler=n.check=r(p),p=0,l=0,n.mode=H;case H:if(0===n.havedict)return t.next_out=a,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=p,n.bits=l,L;t.adler=n.check=1,n.mode=X;case X:if(e===N||e===F)break t;case K:if(n.last){p>>>=7&l,l-=7&l,n.mode=ct;break}for(;l<3;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}switch(n.last=1&p,p>>>=1,l-=1,3&p){case 0:n.mode=J;break;case 1:if(f(n),n.mode=nt,e===F){p>>>=2,l-=2;break t}break;case 2:n.mode=$;break;case 3:t.msg="invalid block type",n.mode=pt}p>>>=2,l-=2;break;case J:for(p>>>=7&l,l-=7&l;l<32;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if((65535&p)!=(p>>>16^65535)){t.msg="invalid stored block lengths",n.mode=pt;break}if(n.length=65535&p,p=0,l=0,n.mode=G,e===F)break t;case G:n.mode=Q;case Q:if(g=n.length){if(g>u&&(g=u),g>c&&(g=c),0===g)break t;w.arraySet(o,i,s,g,a),u-=g,s+=g,c-=g,a+=g,n.length-=g;break}n.mode=X;break;case $:for(;l<14;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(n.nlen=257+(31&p),p>>>=5,l-=5,n.ndist=1+(31&p),p>>>=5,l-=5,n.ncode=4+(15&p),p>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=pt;break}n.have=0,n.mode=tt;case tt:for(;n.have<n.ncode;){for(;l<3;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}n.lens[Ft[n.have++]]=7&p,p>>>=3,l-=3}for(;n.have<19;)n.lens[Ft[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,It={bits:n.lenbits},St=E(S,n.lens,0,19,n.lencode,0,n.work,It),n.lenbits=It.bits,St){t.msg="invalid code lengths set",n.mode=pt;break}n.have=0,n.mode=et;case et:for(;n.have<n.nlen+n.ndist;){for(;kt=n.lencode[p&(1<<n.lenbits)-1],gt=kt>>>24,mt=kt>>>16&255,wt=65535&kt,!(gt<=l);){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(wt<16)p>>>=gt,l-=gt,n.lens[n.have++]=wt;else{if(16===wt){for(Ot=gt+2;l<Ot;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(p>>>=gt,l-=gt,0===n.have){t.msg="invalid bit length repeat",n.mode=pt;break}Et=n.lens[n.have-1],g=3+(3&p),p>>>=2,l-=2}else if(17===wt){for(Ot=gt+3;l<Ot;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}p>>>=gt,l-=gt,Et=0,g=3+(7&p),p>>>=3,l-=3}else{for(Ot=gt+7;l<Ot;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}p>>>=gt,l-=gt,Et=0,g=11+(127&p),p>>>=7,l-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=pt;break}for(;g--;)n.lens[n.have++]=Et}}if(n.mode===pt)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=pt;break}if(n.lenbits=9,It={bits:n.lenbits},St=E(I,n.lens,0,n.nlen,n.lencode,0,n.work,It),n.lenbits=It.bits,St){t.msg="invalid literal/lengths set",n.mode=pt;break}if(n.distbits=6,n.distcode=n.distdyn,It={bits:n.distbits},St=E(O,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,It),n.distbits=It.bits,St){t.msg="invalid distances set",n.mode=pt;break}if(n.mode=nt,e===F)break t;case nt:n.mode=rt;case rt:if(u>=6&&c>=258){t.next_out=a,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=p,n.bits=l,b(t,y),a=t.next_out,o=t.output,c=t.avail_out,s=t.next_in,i=t.input,u=t.avail_in,p=n.hold,l=n.bits,n.mode===X&&(n.back=-1);break}for(n.back=0;kt=n.lencode[p&(1<<n.lenbits)-1],gt=kt>>>24,mt=kt>>>16&255,wt=65535&kt,!(gt<=l);){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(mt&&0==(240&mt)){for(vt=gt,_t=mt,bt=wt;kt=n.lencode[bt+((p&(1<<vt+_t)-1)>>vt)],gt=kt>>>24,mt=kt>>>16&255,wt=65535&kt,!(vt+gt<=l);){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}p>>>=vt,l-=vt,n.back+=vt}if(p>>>=gt,l-=gt,n.back+=gt,n.length=wt,0===mt){n.mode=ut;break}if(32&mt){n.back=-1,n.mode=X;break}if(64&mt){t.msg="invalid literal/length code",n.mode=pt;break}n.extra=15&mt,n.mode=it;case it:if(n.extra){for(Ot=n.extra;l<Ot;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}n.length+=p&(1<<n.extra)-1,p>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=ot;case ot:for(;kt=n.distcode[p&(1<<n.distbits)-1],gt=kt>>>24,mt=kt>>>16&255,wt=65535&kt,!(gt<=l);){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(0==(240&mt)){for(vt=gt,_t=mt,bt=wt;kt=n.distcode[bt+((p&(1<<vt+_t)-1)>>vt)],gt=kt>>>24,mt=kt>>>16&255,wt=65535&kt,!(vt+gt<=l);){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}p>>>=vt,l-=vt,n.back+=vt}if(p>>>=gt,l-=gt,n.back+=gt,64&mt){t.msg="invalid distance code",n.mode=pt;break}n.offset=wt,n.extra=15&mt,n.mode=st;case st:if(n.extra){for(Ot=n.extra;l<Ot;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}n.offset+=p&(1<<n.extra)-1,p>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=pt;break}n.mode=at;case at:if(0===c)break t;if(g=y-c,n.offset>g){if((g=n.offset-g)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=pt;break}g>n.wnext?(g-=n.wnext,m=n.wsize-g):m=n.wnext-g,g>n.length&&(g=n.length),yt=n.window}else yt=o,m=a-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do{o[a++]=yt[m++]}while(--g);0===n.length&&(n.mode=rt);break;case ut:if(0===c)break t;o[a++]=n.length,c--,n.mode=rt;break;case ct:if(n.wrap){for(;l<32;){if(0===u)break t;u--,p|=i[s++]<<l,l+=8}if(y-=c,t.total_out+=y,n.total+=y,y&&(t.adler=n.check=n.flags?_(n.check,o,y,a-y):v(n.check,o,y,a-y)),y=c,(n.flags?p:r(p))!==n.check){t.msg="incorrect data check",n.mode=pt;break}p=0,l=0}n.mode=ft;case ft:if(n.wrap&&n.flags){for(;l<32;){if(0===u)break t;u--,p+=i[s++]<<l,l+=8}if(p!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=pt;break}p=0,l=0}n.mode=ht;case ht:St=T;break t;case pt:St=A;break t;case lt:return D;case dt:default:return x}return t.next_out=a,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=p,n.bits=l,(n.wsize||y!==t.avail_out&&n.mode<pt&&(n.mode<ct||e!==k))&&h(t,t.output,t.next_out,y-t.avail_out)?(n.mode=lt,D):(d-=t.avail_in,y-=t.avail_out,t.total_in+=d,t.total_out+=y,n.total+=y,n.wrap&&y&&(t.adler=n.check=n.flags?_(n.check,o,y,t.next_out-y):v(n.check,o,y,t.next_out-y)),t.data_type=n.bits+(n.last?64:0)+(n.mode===X?128:0)+(n.mode===nt||n.mode===G?256:0),(0===d&&0===y||e===k)&&St===R&&(St=C),St)}function l(t){if(!t||!t.state)return x;var e=t.state;return e.window&&(e.window=null),t.state=null,R}function d(t,e){var n;return t&&t.state?(n=t.state,0==(2&n.wrap)?x:(n.head=e,e.done=!1,R)):x}function y(t,e){var n,r,i=e.length;return t&&t.state?(n=t.state,0!==n.wrap&&n.mode!==H?x:n.mode===H&&(r=1,(r=v(r,e,i,0))!==n.check)?A:h(t,e,i,i)?(n.mode=lt,D):(n.havedict=1,R)):x}var g,m,w=n(8),v=n(36),_=n(37),b=n(38),E=n(39),S=0,I=1,O=2,k=4,N=5,F=6,R=0,T=1,L=2,x=-2,A=-3,D=-4,C=-5,P=8,M=1,U=2,B=3,j=4,z=5,W=6,V=7,Z=8,q=9,Y=10,H=11,X=12,K=13,J=14,G=15,Q=16,$=17,tt=18,et=19,nt=20,rt=21,it=22,ot=23,st=24,at=25,ut=26,ct=27,ft=28,ht=29,pt=30,lt=31,dt=32,yt=852,gt=592,mt=15,wt=!0;e.inflateReset=s,e.inflateReset2=a,e.inflateResetKeep=o,e.inflateInit=c,e.inflateInit2=u,e.inflate=p,e.inflateEnd=l,e.inflateGetHeader=d,e.inflateSetDictionary=y,e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";function r(t,e,n,r){for(var i=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){s=n>2e3?2e3:n,n-=s;do{i=i+e[r++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=r},function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,o,s,a,u,c,f,h,p,l,d,y,g,m,w,v,_,b,E,S,I,O,k;n=t.state,r=t.next_in,O=t.input,i=r+(t.avail_in-5),o=t.next_out,k=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=n.dmax,c=n.wsize,f=n.whave,h=n.wnext,p=n.window,l=n.hold,d=n.bits,y=n.lencode,g=n.distcode,m=(1<<n.lenbits)-1,w=(1<<n.distbits)-1;t:do{d<15&&(l+=O[r++]<<d,d+=8,l+=O[r++]<<d,d+=8),v=y[l&m];e:for(;;){if(_=v>>>24,l>>>=_,d-=_,0===(_=v>>>16&255))k[o++]=65535&v;else{if(!(16&_)){if(0==(64&_)){v=y[(65535&v)+(l&(1<<_)-1)];continue e}if(32&_){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}b=65535&v,_&=15,_&&(d<_&&(l+=O[r++]<<d,d+=8),b+=l&(1<<_)-1,l>>>=_,d-=_),d<15&&(l+=O[r++]<<d,d+=8,l+=O[r++]<<d,d+=8),v=g[l&w];n:for(;;){if(_=v>>>24,l>>>=_,d-=_,!(16&(_=v>>>16&255))){if(0==(64&_)){v=g[(65535&v)+(l&(1<<_)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(E=65535&v,_&=15,d<_&&(l+=O[r++]<<d,(d+=8)<_&&(l+=O[r++]<<d,d+=8)),(E+=l&(1<<_)-1)>u){t.msg="invalid distance too far back",n.mode=30;break t}if(l>>>=_,d-=_,_=o-s,E>_){if((_=E-_)>f&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=0,I=p,0===h){if(S+=c-_,_<b){b-=_;do{k[o++]=p[S++]}while(--_);S=o-E,I=k}}else if(h<_){if(S+=c+h-_,(_-=h)<b){b-=_;do{k[o++]=p[S++]}while(--_);if(S=0,h<b){_=h,b-=_;do{k[o++]=p[S++]}while(--_);S=o-E,I=k}}}else if(S+=h-_,_<b){b-=_;do{k[o++]=p[S++]}while(--_);S=o-E,I=k}for(;b>2;)k[o++]=I[S++],k[o++]=I[S++],k[o++]=I[S++],b-=3;b&&(k[o++]=I[S++],b>1&&(k[o++]=I[S++]))}else{S=o-E;do{k[o++]=k[S++],k[o++]=k[S++],k[o++]=k[S++],b-=3}while(b>2);b&&(k[o++]=k[S++],b>1&&(k[o++]=k[S++]))}break}}break}}while(r<i&&o<a);b=d>>3,r-=b,d-=b<<3,l&=(1<<d)-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?i-r+5:5-(r-i),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=l,n.bits=d}},function(t,e,n){"use strict";var r=n(8),i=[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],o=[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],s=[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],a=[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];t.exports=function(t,e,n,u,c,f,h,p){var l,d,y,g,m,w,v,_,b,E=p.bits,S=0,I=0,O=0,k=0,N=0,F=0,R=0,T=0,L=0,x=0,A=null,D=0,C=new r.Buf16(16),P=new r.Buf16(16),M=null,U=0;for(S=0;S<=15;S++)C[S]=0;for(I=0;I<u;I++)C[e[n+I]]++;for(N=E,k=15;k>=1&&0===C[k];k--);if(N>k&&(N=k),0===k)return c[f++]=20971520,c[f++]=20971520,p.bits=1,0;for(O=1;O<k&&0===C[O];O++);for(N<O&&(N=O),T=1,S=1;S<=15;S++)if(T<<=1,(T-=C[S])<0)return-1;if(T>0&&(0===t||1!==k))return-1;for(P[1]=0,S=1;S<15;S++)P[S+1]=P[S]+C[S];for(I=0;I<u;I++)0!==e[n+I]&&(h[P[e[n+I]]++]=I);if(0===t?(A=M=h,w=19):1===t?(A=i,D-=257,M=o,U-=257,w=256):(A=s,M=a,w=-1),x=0,I=0,S=O,m=f,F=N,R=0,y=-1,L=1<<N,g=L-1,1===t&&L>852||2===t&&L>592)return 1;for(;;){v=S-R,h[I]<w?(_=0,b=h[I]):h[I]>w?(_=M[U+h[I]],b=A[D+h[I]]):(_=96,b=0),l=1<<S-R,d=1<<F,O=d;do{d-=l,c[m+(x>>R)+d]=v<<24|_<<16|b|0}while(0!==d);for(l=1<<S-1;x&l;)l>>=1;if(0!==l?(x&=l-1,x+=l):x=0,I++,0==--C[S]){if(S===k)break;S=e[n+h[I]]}if(S>N&&(x&g)!==y){for(0===R&&(R=N),m+=O,F=S-R,T=1<<F;F+R<k&&!((T-=C[F+R])<=0);)F++,T<<=1;if(L+=1<<F,1===t&&L>852||2===t&&L>592)return 1;y=x&g,c[y]=N<<24|F<<16|m-f|0}}return 0!==x&&(c[m+x]=S-R<<24|64<<16|0),p.bits=N,0}},function(t,e,n){"use strict";function r(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&o))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n}var i=n(8),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var a=new i.Buf8(256),u=0;u<256;u++)a[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;a[254]=a[254]=1,e.string2buf=function(t){var e,n,r,o,s,a=t.length,u=0;for(o=0;o<a;o++)n=t.charCodeAt(o),55296==(64512&n)&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),u+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(u),s=0,o=0;s<u;o++)n=t.charCodeAt(o),55296==(64512&n)&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return r(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,i,o,s,u=e||t.length,c=new Array(2*u);for(i=0,n=0;n<u;)if((o=t[n++])<128)c[i++]=o;else if((s=a[o])>4)c[i++]=65533,n+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&n<u;)o=o<<6|63&t[n++],s--;s>1?c[i++]=65533:o<65536?c[i++]=o:(o-=65536,c[i++]=55296|o>>10&1023,c[i++]=56320|1023&o)}return r(c,i)},e.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 n<0?e:0===n?e:n+a[t[n]]>e?n:e}},function(t,e,n){"use strict";t.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}},function(t,e,n){"use strict";t.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"}},function(t,e,n){"use strict";function r(){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}t.exports=r},function(t,e,n){"use strict";function r(){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}t.exports=r}])});
  //# sourceMappingURL=browserfs.min.js.map