securityos/public/System/BrowserFS/browserfs.min.js

11 lines
176 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!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){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([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_MEM_ERROR:-4,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";
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/const r=n(5),i=n(6),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|y(t,e);let r=a(n);const i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(q(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(q(t,ArrayBuffer)||t&&q(t.buffer,ArrayBuffer))return l(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(q(t,SharedArrayBuffer)||t&&q(t.buffer,SharedArrayBuffer)))return l(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return c.from(r,e,n);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),n=a(e);return 0===n.length?n:(t.copy(n,0,0,e),n)}if(void 0!==t.length)return"number"!=typeof t.length||$(t.length)?a(0):p(t);if("Buffer"===t.type&&Array.isArray(t.data))return p(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return f(t),a(t<0?0:0|d(t))}function p(t){const e=t.length<0?0:0|d(t.length),n=a(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function l(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,c.prototype),r}function d(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(t).length;default:if(i)return r?-1:Y(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){let o,s=1,a=t.length,c=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,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let r=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===c)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let r=0;r<c;r++)if(u(t,o+r)!==u(e,r)){n=!1;break}if(n)return o}return-1}function _(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=e.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=K[e[2*s]],i=K[e[2*s+1]];if(void 0===r||void 0===i)return s;t[n+s]=r<<4|i}return s}function E(t,e,n,r){return X(Y(e,t.length-n),t,n,r)}function v(t,e,n,r){return X(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function S(t,e,n,r){return X(W(e),t,n,r)}function b(t,e,n,r){return X(function(t,e){let n,r,i;const o=[];for(let 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}(e,t.length-n),t,n,r)}function I(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function k(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=n){let n,r,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:128==(192&(n=t[i+1]))&&(c=(31&e)<<6|63&n)>127&&(o=c);break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(c=(15&e)<<12|(63&n)<<6|63&r)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:n=t[i+1],r=t[i+2],a=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&a)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(t){const e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=O));return n}(r)}e.kStringMaxLength=268435440,e.constants={MAX_LENGTH:s,MAX_STRING_LENGTH:268435440},c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.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."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,n){return u(t,e,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,n){return function(t,e,n){return f(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},c.allocUnsafe=function(t){return h(t)},c.allocUnsafeSlow=function(t){return h(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},c.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}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=c.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(q(e,Uint8Array))i+e.length>r.length?(c.isBuffer(e)||(e=c.from(e.buffer,e.byteOffset,e.byteLength)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?k(this,0,t):function(t,e,n){let 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))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,n);case"utf8":case"utf-8":return k(this,e,n);case"ascii":return N(this,e,n);case"latin1":case"binary":return F(this,e,n);case"base64":return I(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,n,r,i){if(q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;let o=i-r,s=n-e;const a=Math.min(o,s),u=this.slice(r,i),f=t.slice(e,n);for(let t=0;t<a;++t)if(u[t]!==f[t]){o=u[t],s=f[t];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},c.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)}const 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");let o=!1;for(;;)switch(r){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":case"latin1":case"binary":return v(this,t,e,n);case"base64":return S(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function N(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function F(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function T(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let r=e;r<n;++r)i+=J[t[r]];return i}function L(t,e,n){const r=t.slice(e,n);let i="";for(let t=0;t<r.length-1;t+=2)i+=String.fromCharCode(r[t]+256*r[t+1]);return i}function x(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,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r,i){j(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,n}function A(t,e,n,r,i){j(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=s,s>>=8,t[n+2]=s,s>>=8,t[n+1]=s,s>>=8,t[n]=s,n+8}function U(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,o){return e=+e,n>>>=0,o||U(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,o){return e=+e,n>>>=0,o||U(t,0,n,8),i.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){const 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);const r=this.subarray(t,e);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=G(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Z(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=G(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Z(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||x(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=G(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Z(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),c.prototype.readBigInt64BE=G(function(t){H(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||Z(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)}),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.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)}let i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},c.prototype.writeUintBE=c.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)}let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},c.prototype.writeUint8=c.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},c.prototype.writeUint16LE=c.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},c.prototype.writeUint16BE=c.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},c.prototype.writeUint32LE=c.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},c.prototype.writeUint32BE=c.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},c.prototype.writeBigUInt64LE=G(function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=G(function(t,e=0){return A(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,t,e,n,r-1,-r)}let i=0,o=1,s=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);D(this,t,e,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},c.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},c.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},c.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},c.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},c.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},c.prototype.writeBigInt64LE=G(function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=G(function(t,e=0){return A(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(t,e,n){return P(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return P(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");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("Index out of range");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);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},c.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),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,r),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=o[i%s]}return this};const C={};function M(t,e,n){C[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function z(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function j(t,e,n,r,i,o){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** `+`${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new C.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||Z(e,t.length-(n+1))}(r,i,o)}function H(t,e){if("number"!=typeof t)throw new C.ERR_INVALID_ARG_TYPE(e,"number",t)}function Z(t,e,n){if(Math.floor(t)!==t)throw H(t,n),new C.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new C.ERR_BUFFER_OUT_OF_BOUNDS;throw new C.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),M("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),M("ERR_OUT_OF_RANGE",function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=z(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),r+=` It must be ${e}. Received ${i}`},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function Y(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let 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 W(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function X(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}const J=function(){const t=new Array(256);for(let e=0;e<16;++e){const n=16*e;for(let r=0;r<16;++r)t[n+r]="0123456789abcdef"[e]+"0123456789abcdef"[r]}return t}(),K={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function G(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var c,u=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&l())}function l(){if(!f){var t=a(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new d(t,e)),1!==u.length||f||a(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";(function(t,r,i){var o=n(1),s=n(8);function a(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var c,u=a(o),f=a(s);!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"}(c||(c={}));var h={};h[c.EPERM]="Operation not permitted.",h[c.ENOENT]="No such file or directory.",h[c.EIO]="Input/output error.",h[c.EBADF]="Bad file descriptor.",h[c.EACCES]="Permission denied.",h[c.EBUSY]="Resource busy or locked.",h[c.EEXIST]="File exists.",h[c.ENOTDIR]="File is not a directory.",h[c.EISDIR]="File is a directory.",h[c.EINVAL]="Invalid argument.",h[c.EFBIG]="File is too big.",h[c.ENOSPC]="No space left on disk.",h[c.EROFS]="Cannot modify a read-only file system.",h[c.ENOTEMPTY]="Directory is not empty.",h[c.ENOTSUP]="Operation is not supported.";var p,l=function(e){function n(t,n,r){void 0===n&&(n=h[t]),e.call(this,n),this.syscall="",this.errno=t,this.code=c[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,h[t],e)},n.ENOENT=function(t){return this.FileError(c.ENOENT,t)},n.EEXIST=function(t){return this.FileError(c.EEXIST,t)},n.EISDIR=function(t){return this.FileError(c.EISDIR,t)},n.ENOTDIR=function(t){return this.FileError(c.ENOTDIR,t)},n.EPERM=function(t){return this.FileError(c.EPERM,t)},n.ENOTEMPTY=function(t){return this.FileError(c.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),d=Object.freeze({__proto__:null,ApiError:l,get ErrorCode(){return c},ErrorStrings:h});!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"}(p||(p={}));var y,g=function t(e){if(this.flagStr=e,t.validFlagStrs.indexOf(e)<0)throw new l(c.EINVAL,"Invalid flag: "+e)};g.getFileFlag=function(t){return g.flagCache.hasOwnProperty(t)?g.flagCache[t]:g.flagCache[t]=new g(t)},g.prototype.getFlagString=function(){return this.flagStr},g.prototype.isReadable=function(){return-1!==this.flagStr.indexOf("r")||-1!==this.flagStr.indexOf("+")},g.prototype.isWriteable=function(){return-1!==this.flagStr.indexOf("w")||-1!==this.flagStr.indexOf("a")||-1!==this.flagStr.indexOf("+")},g.prototype.isTruncating=function(){return-1!==this.flagStr.indexOf("w")},g.prototype.isAppendable=function(){return-1!==this.flagStr.indexOf("a")},g.prototype.isSynchronous=function(){return-1!==this.flagStr.indexOf("s")},g.prototype.isExclusive=function(){return-1!==this.flagStr.indexOf("x")},g.prototype.pathExistsAction=function(){return this.isExclusive()?p.THROW_EXCEPTION:this.isTruncating()?p.TRUNCATE_FILE:p.NOP},g.prototype.pathNotExistsAction=function(){return(this.isWriteable()||this.isAppendable())&&"r+"!==this.flagStr?p.CREATE_FILE:p.THROW_EXCEPTION},g.flagCache={},g.validFlagStrs=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"],function(t){t[t.FILE=32768]="FILE",t[t.DIRECTORY=16384]="DIRECTORY",t[t.SYMLINK=40960]="SYMLINK"}(y||(y={}));var m=function(t,e,n,r,i,o,s){this.dev=0,this.ino=0,this.rdev=0,this.nlink=1,this.blksize=4096,this.uid=0,this.gid=0,this.fileData=null,this.size=e;var a=0;if("number"!=typeof r&&(r=a=Date.now()),"number"!=typeof i&&(a||(a=Date.now()),i=a),"number"!=typeof o&&(a||(a=Date.now()),o=a),"number"!=typeof s&&(a||(a=Date.now()),s=a),this.atimeMs=r,this.ctimeMs=o,this.mtimeMs=i,this.birthtimeMs=s,n)this.mode=n;else switch(t){case y.FILE:this.mode=420;break;case y.DIRECTORY:default:this.mode=511}this.blocks=Math.ceil(e/512),this.mode<4096&&(this.mode|=t)},w={atime:{configurable:!0},mtime:{configurable:!0},ctime:{configurable:!0},birthtime:{configurable:!0}};m.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 m(61440&n,e,4095&n,r,i,o)},m.clone=function(t){return new m(61440&t.mode,t.size,4095&t.mode,t.atimeMs,t.mtimeMs,t.ctimeMs,t.birthtimeMs)},w.atime.get=function(){return new Date(this.atimeMs)},w.mtime.get=function(){return new Date(this.mtimeMs)},w.ctime.get=function(){return new Date(this.ctimeMs)},w.birthtime.get=function(){return new Date(this.birthtimeMs)},m.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},m.prototype.isFile=function(){return(61440&this.mode)===y.FILE},m.prototype.isDirectory=function(){return(61440&this.mode)===y.DIRECTORY},m.prototype.isSymbolicLink=function(){return(61440&this.mode)===y.SYMLINK},m.prototype.chmod=function(t){this.mode=61440&this.mode|t},m.prototype.isSocket=function(){return!1},m.prototype.isBlockDevice=function(){return!1},m.prototype.isCharacterDevice=function(){return!1},m.prototype.isFIFO=function(){return!1},Object.defineProperties(m.prototype,w);var _,E="undefined"!=typeof window?window:"undefined"!=typeof self?self:r;if("undefined"!=typeof setImmediate)_=setImmediate;else{var v=E,S=[];if(function(){if(void 0!==v.importScripts||!v.postMessage)return!1;var t=!0,e=v.onmessage;return v.onmessage=function(){t=!1},v.postMessage("","*"),v.onmessage=e,t}()){_=function(t){S.push(t),v.postMessage("zero-timeout-message","*")};var b=function(t){if(t.source===self&&"zero-timeout-message"===t.data&&(t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,S.length>0))return S.shift()()};v.addEventListener?v.addEventListener("message",b,!0):v.attachEvent("onmessage",b)}else if(v.MessageChannel){var I=new v.MessageChannel;I.port1.onmessage=function(t){if(S.length>0)return S.shift()()},_=function(t){S.push(t),I.port2.postMessage("")}}else _=function(t){return setTimeout(t,0)}}var k=_,O=function(t,e){return t};function N(t,e){if("function"!=typeof t)throw new Error("Callback must be a function.");var n=O(t,e);switch(e){case 1:return function(t){k(function(){return n(t)})};case 2:return function(t,e){k(function(){return n(t,e)})};case 3:return function(t,e,r){k(function(){return n(t,e,r)})};default:throw new Error("Invalid invocation of wrapCb.")}}function F(t){if(t)return t;throw new l(c.EIO,"Initialize BrowserFS with a file system using BrowserFS.initialize(filesystem)")}function T(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 L(t){if(t instanceof Date)return t;if("number"==typeof t)return new Date(1e3*t);throw new l(c.EINVAL,"Invalid time.")}function x(t){if(t.indexOf("\0")>=0)throw new l(c.EINVAL,"Path must be a string without null bytes.");if(""===t)throw new l(c.EINVAL,"Path must not be empty.");return f.resolve(t)}function D(t,e,n,r){switch(null===t?"null":typeof t){case"object":return{encoding:void 0!==t.encoding?t.encoding:e,flag:void 0!==t.flag?t.flag:n,mode:T(t.mode,r)};case"string":return{encoding:t,flag:n,mode:r};case"null":case"undefined":case"function":return{encoding:e,flag:n,mode:r};default:throw new TypeError('"options" must be a string or an object, got '+typeof t+" instead.")}}function R(){}var A=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};A.prototype.initialize=function(t){if(!t.constructor.isAvailable())throw new l(c.EINVAL,"Tried to instantiate BrowserFS with an unavailable file system.");return this.root=t},A.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)},A.prototype.getRootFS=function(){return this.root?this.root:null},A.prototype.rename=function(t,e,n){void 0===n&&(n=R);var r=N(n,1);try{F(this.root).rename(x(t),x(e),r)}catch(t){r(t)}},A.prototype.renameSync=function(t,e){F(this.root).renameSync(x(t),x(e))},A.prototype.exists=function(t,e){void 0===e&&(e=R);var n=N(e,1);try{return F(this.root).exists(x(t),n)}catch(t){return n(!1)}},A.prototype.existsSync=function(t){try{return F(this.root).existsSync(x(t))}catch(t){return!1}},A.prototype.stat=function(t,e){void 0===e&&(e=R);var n=N(e,2);try{return F(this.root).stat(x(t),!1,n)}catch(t){return n(t)}},A.prototype.statSync=function(t){return F(this.root).statSync(x(t),!1)},A.prototype.lstat=function(t,e){void 0===e&&(e=R);var n=N(e,2);try{return F(this.root).stat(x(t),!0,n)}catch(t){return n(t)}},A.prototype.lstatSync=function(t){return F(this.root).statSync(x(t),!0)},A.prototype.truncate=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=R);var r=0;"function"==typeof e?n=e:"number"==typeof e&&(r=e);var i=N(n,1);try{if(r<0)throw new l(c.EINVAL);return F(this.root).truncate(x(t),r,i)}catch(t){return i(t)}},A.prototype.truncateSync=function(t,e){if(void 0===e&&(e=0),e<0)throw new l(c.EINVAL);return F(this.root).truncateSync(x(t),e)},A.prototype.unlink=function(t,e){void 0===e&&(e=R);var n=N(e,1);try{return F(this.root).unlink(x(t),n)}catch(t){return n(t)}},A.prototype.unlinkSync=function(t){return F(this.root).unlinkSync(x(t))},A.prototype.open=function(t,e,n,r){var i=this;void 0===r&&(r=R);var o=T(n,420),s=N(r="function"==typeof n?n:r,2);try{F(this.root).open(x(t),g.getFileFlag(e),o,function(t,e){e?s(t,i.getFdForFile(e)):s(t)})}catch(t){s(t)}},A.prototype.openSync=function(t,e,n){return void 0===n&&(n=420),this.getFdForFile(F(this.root).openSync(x(t),g.getFileFlag(e),T(n,420)))},A.prototype.readFile=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n=R);var r=D(e,null,"r",null),i=N(n="function"==typeof e?e:n,2);try{var o=g.getFileFlag(r.flag);return o.isReadable()?F(this.root).readFile(x(t),r.encoding,o,i):i(new l(c.EINVAL,"Flag passed to readFile must allow for reading."))}catch(t){return i(t)}},A.prototype.readFileSync=function(t,e){void 0===e&&(e={});var n=D(e,null,"r",null),r=g.getFileFlag(n.flag);if(!r.isReadable())throw new l(c.EINVAL,"Flag passed to readFile must allow for reading.");return F(this.root).readFileSync(x(t),n.encoding,r)},A.prototype.writeFile=function(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r=R);var i=D(n,"utf8","w",420),o=N(r="function"==typeof n?n:r,1);try{var s=g.getFileFlag(i.flag);return s.isWriteable()?F(this.root).writeFile(x(t),e,i.encoding,s,i.mode,o):o(new l(c.EINVAL,"Flag passed to writeFile must allow for writing."))}catch(t){return o(t)}},A.prototype.writeFileSync=function(t,e,n){var r=D(n,"utf8","w",420),i=g.getFileFlag(r.flag);if(!i.isWriteable())throw new l(c.EINVAL,"Flag passed to writeFile must allow for writing.");return F(this.root).writeFileSync(x(t),e,r.encoding,i,r.mode)},A.prototype.appendFile=function(t,e,n,r){void 0===r&&(r=R);var i=D(n,"utf8","a",420),o=N(r="function"==typeof n?n:r,1);try{var s=g.getFileFlag(i.flag);if(!s.isAppendable())return o(new l(c.EINVAL,"Flag passed to appendFile must allow for appending."));F(this.root).appendFile(x(t),e,i.encoding,s,i.mode,o)}catch(t){o(t)}},A.prototype.appendFileSync=function(t,e,n){var r=D(n,"utf8","a",420),i=g.getFileFlag(r.flag);if(!i.isAppendable())throw new l(c.EINVAL,"Flag passed to appendFile must allow for appending.");return F(this.root).appendFileSync(x(t),e,r.encoding,i,r.mode)},A.prototype.fstat=function(t,e){void 0===e&&(e=R);var n=N(e,2);try{this.fd2file(t).stat(n)}catch(t){n(t)}},A.prototype.fstatSync=function(t){return this.fd2file(t).statSync()},A.prototype.close=function(t,e){var n=this;void 0===e&&(e=R);var r=N(e,1);try{this.fd2file(t).close(function(e){e||n.closeFd(t),r(e)})}catch(t){r(t)}},A.prototype.closeSync=function(t){this.fd2file(t).closeSync(),this.closeFd(t)},A.prototype.ftruncate=function(t,e,n){void 0===n&&(n=R);var r="number"==typeof e?e:0,i=N(n="function"==typeof e?e:n,1);try{var o=this.fd2file(t);if(r<0)throw new l(c.EINVAL);o.truncate(r,i)}catch(t){i(t)}},A.prototype.ftruncateSync=function(t,e){void 0===e&&(e=0);var n=this.fd2file(t);if(e<0)throw new l(c.EINVAL);n.truncateSync(e)},A.prototype.fsync=function(t,e){void 0===e&&(e=R);var n=N(e,1);try{this.fd2file(t).sync(n)}catch(t){n(t)}},A.prototype.fsyncSync=function(t){this.fd2file(t).syncSync()},A.prototype.fdatasync=function(t,e){void 0===e&&(e=R);var n=N(e,1);try{this.fd2file(t).datasync(n)}catch(t){n(t)}},A.prototype.fdatasyncSync=function(t){this.fd2file(t).datasyncSync()},A.prototype.write=function(e,n,r,i,o,s){void 0===s&&(s=R);var a,u,f,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 l(c.EINVAL,"Invalid arguments."))}u=0,f=(a=t.from(n,p)).length}else a=n,u=r,f=i,h="number"==typeof o?o:null,s="function"==typeof o?o:s;var d=N(s,3);try{var y=this.fd2file(e);void 0!==h&&null!==h||(h=y.getPos()),y.write(a,u,f,h,d)}catch(t){d(t)}},A.prototype.writeSync=function(e,n,r,i,o){var s,a,c,u=0;if("string"==typeof n){c="number"==typeof r?r:null;var f="string"==typeof i?i:"utf8";u=0,a=(s=t.from(n,f)).length}else s=n,u=r,a=i,c="number"==typeof o?o:null;var h=this.fd2file(e);return void 0!==c&&null!==c||(c=h.getPos()),h.writeSync(s,u,a,c)},A.prototype.read=function(e,n,r,i,o,s){var a,c,u,f,h;if(void 0===s&&(s=R),"number"==typeof n){u=n,a=r;var p=i;s="function"==typeof o?o:s,c=0,f=t.alloc(u),h=N(function(t,e,n){if(t)return s(t);s(t,n.toString(p),e)},3)}else f=n,c=r,u=i,a=o,h=N(s,3);try{var l=this.fd2file(e);void 0!==a&&null!==a||(a=l.getPos()),l.read(f,c,u,a,h)}catch(t){h(t)}},A.prototype.readSync=function(e,n,r,i,o){var s,a,c,u,f=!1,h="utf8";"number"==typeof n?(c=n,u=r,h=i,a=0,s=t.alloc(c),f=!0):(s=n,a=r,c=i,u=o);var p=this.fd2file(e);void 0!==u&&null!==u||(u=p.getPos());var l=p.readSync(s,a,c,u);return f?[s.toString(h),l]:l},A.prototype.fchown=function(t,e,n,r){void 0===r&&(r=R);var i=N(r,1);try{this.fd2file(t).chown(e,n,i)}catch(t){i(t)}},A.prototype.fchownSync=function(t,e,n){this.fd2file(t).chownSync(e,n)},A.prototype.fchmod=function(t,e,n){var r=N(n,1);try{var i="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmod(i,r)}catch(t){r(t)}},A.prototype.fchmodSync=function(t,e){var n="string"==typeof e?parseInt(e,8):e;this.fd2file(t).chmodSync(n)},A.prototype.futimes=function(t,e,n,r){void 0===r&&(r=R);var i=N(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)}},A.prototype.futimesSync=function(t,e,n){this.fd2file(t).utimesSync(L(e),L(n))},A.prototype.rmdir=function(t,e){void 0===e&&(e=R);var n=N(e,1);try{t=x(t),F(this.root).rmdir(t,n)}catch(t){n(t)}},A.prototype.rmdirSync=function(t){return t=x(t),F(this.root).rmdirSync(t)},A.prototype.mkdir=function(t,e,n){void 0===n&&(n=R),"function"==typeof e&&(n=e,e=511);var r=N(n,1);try{t=x(t),F(this.root).mkdir(t,e,r)}catch(t){r(t)}},A.prototype.mkdirSync=function(t,e){F(this.root).mkdirSync(x(t),T(e,511))},A.prototype.readdir=function(t,e){void 0===e&&(e=R);var n=N(e,2);try{t=x(t),F(this.root).readdir(t,n)}catch(t){n(t)}},A.prototype.readdirSync=function(t){return t=x(t),F(this.root).readdirSync(t)},A.prototype.link=function(t,e,n){void 0===n&&(n=R);var r=N(n,1);try{t=x(t),e=x(e),F(this.root).link(t,e,r)}catch(t){r(t)}},A.prototype.linkSync=function(t,e){return t=x(t),e=x(e),F(this.root).linkSync(t,e)},A.prototype.symlink=function(t,e,n,r){void 0===r&&(r=R);var i="string"==typeof n?n:"file",o=N(r="function"==typeof n?n:r,1);try{if("file"!==i&&"dir"!==i)return o(new l(c.EINVAL,"Invalid type: "+i));t=x(t),e=x(e),F(this.root).symlink(t,e,i,o)}catch(t){o(t)}},A.prototype.symlinkSync=function(t,e,n){if(n){if("file"!==n&&"dir"!==n)throw new l(c.EINVAL,"Invalid type: "+n)}else n="file";return t=x(t),e=x(e),F(this.root).symlinkSync(t,e,n)},A.prototype.readlink=function(t,e){void 0===e&&(e=R);var n=N(e,2);try{t=x(t),F(this.root).readlink(t,n)}catch(t){n(t)}},A.prototype.readlinkSync=function(t){return t=x(t),F(this.root).readlinkSync(t)},A.prototype.chown=function(t,e,n,r){void 0===r&&(r=R);var i=N(r,1);try{t=x(t),F(this.root).chown(t,!1,e,n,i)}catch(t){i(t)}},A.prototype.chownSync=function(t,e,n){t=x(t),F(this.root).chownSync(t,!1,e,n)},A.prototype.lchown=function(t,e,n,r){void 0===r&&(r=R);var i=N(r,1);try{t=x(t),F(this.root).chown(t,!0,e,n,i)}catch(t){i(t)}},A.prototype.lchownSync=function(t,e,n){t=x(t),F(this.root).chownSync(t,!0,e,n)},A.prototype.chmod=function(t,e,n){void 0===n&&(n=R);var r=N(n,1);try{var i=T(e,-1);if(i<0)throw new l(c.EINVAL,"Invalid mode.");F(this.root).chmod(x(t),!1,i,r)}catch(t){r(t)}},A.prototype.chmodSync=function(t,e){var n=T(e,-1);if(n<0)throw new l(c.EINVAL,"Invalid mode.");t=x(t),F(this.root).chmodSync(t,!1,n)},A.prototype.lchmod=function(t,e,n){void 0===n&&(n=R);var r=N(n,1);try{var i=T(e,-1);if(i<0)throw new l(c.EINVAL,"Invalid mode.");F(this.root).chmod(x(t),!0,i,r)}catch(t){r(t)}},A.prototype.lchmodSync=function(t,e){var n=T(e,-1);if(n<1)throw new l(c.EINVAL,"Invalid mode.");F(this.root).chmodSync(x(t),!0,n)},A.prototype.utimes=function(t,e,n,r){void 0===r&&(r=R);var i=N(r,1);try{F(this.root).utimes(x(t),L(e),L(n),i)}catch(t){i(t)}},A.prototype.utimesSync=function(t,e,n){F(this.root).utimesSync(x(t),L(e),L(n))},A.prototype.realpath=function(t,e,n){void 0===n&&(n=R);var r="object"==typeof e?e:{},i=N(n="function"==typeof e?e:R,2);try{t=x(t),F(this.root).realpath(t,r,i)}catch(t){i(t)}},A.prototype.realpathSync=function(t,e){return void 0===e&&(e={}),t=x(t),F(this.root).realpathSync(t,e)},A.prototype.watchFile=function(t,e,n){throw new l(c.ENOTSUP)},A.prototype.unwatchFile=function(t,e){throw new l(c.ENOTSUP)},A.prototype.watch=function(t,e,n){throw new l(c.ENOTSUP)},A.prototype.access=function(t,e,n){throw new l(c.ENOTSUP)},A.prototype.accessSync=function(t,e){throw new l(c.ENOTSUP)},A.prototype.createReadStream=function(t,e){throw new l(c.ENOTSUP)},A.prototype.createWriteStream=function(t,e){throw new l(c.ENOTSUP)},A.prototype.wrapCallbacks=function(t){O=t},A.prototype.getFdForFile=function(t){var e=this.nextFd++;return this.fdMap[e]=t,e},A.prototype.fd2file=function(t){var e=this.fdMap[t];if(e)return e;throw new l(c.EBADF,"Invalid file descriptor.")},A.prototype.closeFd=function(t){delete this.fdMap[t]},A.Stats=m;var U=new A,P={},B=A.prototype;function C(){throw new Error("BFS has reached an impossible code path; please file a bug.")}function M(t,e,n){n.existsSync(t)||(M(f.dirname(t),e,n),n.mkdirSync(t,e))}function z(t){var e=j(t),n=e.byteOffset,r=e.byteLength;return 0===n&&r===e.buffer.byteLength?e.buffer:e.buffer.slice(n,n+r)}function j(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function H(e){return e instanceof t?e:e instanceof Uint8Array?Z(e):t.from(e)}function Z(e){return e instanceof t?e:0===e.byteOffset&&e.byteLength===e.buffer.byteLength?V(e.buffer):t.from(e.buffer,e.byteOffset,e.byteLength)}function V(e){return t.from(e)}function Y(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 X();var r=j(t),i=t[0],o=(i+1)%255;return t[0]=o,r[0]===o?(r[0]=i,Z(r.slice(e,n))):(t[0]=i,Z(r.subarray(e,n)))}Object.keys(B).forEach(function(t){"function"==typeof U[t]?P[t]=function(){return U[t].apply(U,arguments)}:P[t]=U[t]}),P.changeFSModule=function(t){U=t},P.getFSModule=function(){return U},P.FS=A,P.Stats=A.Stats;var W=null;function X(){return W||(W=t.alloc(0))}function q(e,n){t.isBuffer(e)?n():n(new l(c.EINVAL,"option must be a Buffer."))}var $=Object.freeze({__proto__:null,arrayBuffer2Buffer:V,arrayish2Buffer:H,buffer2ArrayBuffer:z,buffer2Uint8array:j,bufferValidator:q,copyingSlice:Y,deprecationMessage:function(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.")},emptyBuffer:X,fail:C,mkdirpSync:M,uint8Array2Buffer:Z}),J=function(){};J.prototype.supportsLinks=function(){return!1},J.prototype.diskSpace=function(t,e){e(0,0)},J.prototype.openFile=function(t,e,n){throw new l(c.ENOTSUP)},J.prototype.createFile=function(t,e,n,r){throw new l(c.ENOTSUP)},J.prototype.open=function(t,e,n,r){var i=this;this.stat(t,!1,function(o,s){if(o)switch(e.pathNotExistsAction()){case p.CREATE_FILE:return i.stat(f.dirname(t),!1,function(o,s){o?r(o):s&&!s.isDirectory()?r(l.ENOTDIR(f.dirname(t))):i.createFile(t,e,n,r)});case p.THROW_EXCEPTION:return r(l.ENOENT(t));default:return r(new l(c.EINVAL,"Invalid FileFlag object."))}else{if(s&&s.isDirectory())return r(l.EISDIR(t));switch(e.pathExistsAction()){case p.THROW_EXCEPTION:return r(l.EEXIST(t));case p.TRUNCATE_FILE:return i.openFile(t,e,function(t,e){t?r(t):e?e.truncate(0,function(){e.sync(function(){r(null,e)})}):C()});case p.NOP:return i.openFile(t,e,r);default:return r(new l(c.EINVAL,"Invalid FileFlag object."))}}})},J.prototype.rename=function(t,e,n){n(new l(c.ENOTSUP))},J.prototype.renameSync=function(t,e){throw new l(c.ENOTSUP)},J.prototype.stat=function(t,e,n){n(new l(c.ENOTSUP))},J.prototype.statSync=function(t,e){throw new l(c.ENOTSUP)},J.prototype.openFileSync=function(t,e,n){throw new l(c.ENOTSUP)},J.prototype.createFileSync=function(t,e,n){throw new l(c.ENOTSUP)},J.prototype.openSync=function(t,e,n){var r;try{r=this.statSync(t,!1)}catch(r){switch(e.pathNotExistsAction()){case p.CREATE_FILE:if(!this.statSync(f.dirname(t),!1).isDirectory())throw l.ENOTDIR(f.dirname(t));return this.createFileSync(t,e,n);case p.THROW_EXCEPTION:throw l.ENOENT(t);default:throw new l(c.EINVAL,"Invalid FileFlag object.")}}if(r.isDirectory())throw l.EISDIR(t);switch(e.pathExistsAction()){case p.THROW_EXCEPTION:throw l.EEXIST(t);case p.TRUNCATE_FILE:return this.unlinkSync(t),this.createFileSync(t,e,r.mode);case p.NOP:return this.openFileSync(t,e,n);default:throw new l(c.EINVAL,"Invalid FileFlag object.")}},J.prototype.unlink=function(t,e){e(new l(c.ENOTSUP))},J.prototype.unlinkSync=function(t){throw new l(c.ENOTSUP)},J.prototype.rmdir=function(t,e){e(new l(c.ENOTSUP))},J.prototype.rmdirSync=function(t){throw new l(c.ENOTSUP)},J.prototype.mkdir=function(t,e,n){n(new l(c.ENOTSUP))},J.prototype.mkdirSync=function(t,e){throw new l(c.ENOTSUP)},J.prototype.readdir=function(t,e){e(new l(c.ENOTSUP))},J.prototype.readdirSync=function(t){throw new l(c.ENOTSUP)},J.prototype.exists=function(t,e){this.stat(t,null,function(t){e(!t)})},J.prototype.existsSync=function(t){try{return this.statSync(t,!0),!0}catch(t){return!1}},J.prototype.realpath=function(t,e,n){if(this.supportsLinks())for(var r=t.split(f.sep),i=0;i<r.length;i++){var o=r.slice(0,i+1);r[i]=f.join.apply(null,o)}else this.exists(t,function(e){e?n(null,t):n(l.ENOENT(t))})},J.prototype.realpathSync=function(t,e){if(this.supportsLinks()){for(var n=t.split(f.sep),r=0;r<n.length;r++){var i=n.slice(0,r+1);n[r]=f.join.apply(f,i)}return n.join(f.sep)}if(this.existsSync(t))return t;throw l.ENOENT(t)},J.prototype.truncate=function(t,e,n){this.open(t,g.getFileFlag("r+"),420,function(t,r){if(t)return n(t);r.truncate(e,function(t){r.close(function(e){n(t||e)})})})},J.prototype.truncateSync=function(t,e){var n=this.openSync(t,g.getFileFlag("r+"),420);try{n.truncateSync(e)}catch(t){throw t}finally{n.closeSync()}},J.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)}})})})},J.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()}},J.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)})},J.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()}},J.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)})},J.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()}},J.prototype.chmod=function(t,e,n,r){r(new l(c.ENOTSUP))},J.prototype.chmodSync=function(t,e,n){throw new l(c.ENOTSUP)},J.prototype.chown=function(t,e,n,r,i){i(new l(c.ENOTSUP))},J.prototype.chownSync=function(t,e,n,r){throw new l(c.ENOTSUP)},J.prototype.utimes=function(t,e,n,r){r(new l(c.ENOTSUP))},J.prototype.utimesSync=function(t,e,n){throw new l(c.ENOTSUP)},J.prototype.link=function(t,e,n){n(new l(c.ENOTSUP))},J.prototype.linkSync=function(t,e){throw new l(c.ENOTSUP)},J.prototype.symlink=function(t,e,n,r){r(new l(c.ENOTSUP))},J.prototype.symlinkSync=function(t,e,n){throw new l(c.ENOTSUP)},J.prototype.readlink=function(t,e){e(new l(c.ENOTSUP))},J.prototype.readlinkSync=function(t){throw new l(c.ENOTSUP)};var K=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}(J),G=function(){};function Q(t,e){void 0===e&&(e="");for(var n=t.errno,r=t.node,i=[];r&&(i.unshift(r.name),r!==r.parent);)r=r.parent;return new l(n,h[n],i.length>0?"/"+i.join("/"):e)}G.prototype.sync=function(t){t(new l(c.ENOTSUP))},G.prototype.syncSync=function(){throw new l(c.ENOTSUP)},G.prototype.datasync=function(t){this.sync(t)},G.prototype.datasyncSync=function(){return this.syncSync()},G.prototype.chown=function(t,e,n){n(new l(c.ENOTSUP))},G.prototype.chownSync=function(t,e){throw new l(c.ENOTSUP)},G.prototype.chmod=function(t,e){e(new l(c.ENOTSUP))},G.prototype.chmodSync=function(t){throw new l(c.ENOTSUP)},G.prototype.utimes=function(t,e,n){n(new l(c.ENOTSUP))},G.prototype.utimesSync=function(t,e){throw new l(c.ENOTSUP)};var tt=function(t){function e(e,n,r,i){t.call(this),this._fs=e,this._FS=n,this._path=r,this._stream=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPos=function(){},e.prototype.close=function(t){var e=null;try{this.closeSync()}catch(t){e=t}finally{t(e)}},e.prototype.closeSync=function(){try{this._FS.close(this._stream)}catch(t){throw Q(t,this._path)}},e.prototype.stat=function(t){try{t(null,this.statSync())}catch(e){t(e)}},e.prototype.statSync=function(){try{return this._fs.statSync(this._path,!1)}catch(t){throw Q(t,this._path)}},e.prototype.truncate=function(t,e){var n=null;try{this.truncateSync(t)}catch(t){n=t}finally{e(n)}},e.prototype.truncateSync=function(t){try{this._FS.ftruncate(this._stream.fd,t)}catch(t){throw Q(t,this._path)}},e.prototype.write=function(t,e,n,r,i){try{i(null,this.writeSync(t,e,n,r),t)}catch(t){i(t)}},e.prototype.writeSync=function(t,e,n,r){try{var i=j(t),o=null===r?void 0:r;return this._FS.write(this._stream,i,e,n,o)}catch(t){throw Q(t,this._path)}},e.prototype.read=function(t,e,n,r,i){try{i(null,this.readSync(t,e,n,r),t)}catch(t){i(t)}},e.prototype.readSync=function(t,e,n,r){try{var i=j(t),o=null===r?void 0:r;return this._FS.read(this._stream,i,e,n,o)}catch(t){throw Q(t,this._path)}},e.prototype.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.chown=function(t,e,n){var r=null;try{this.chownSync(t,e)}catch(t){r=t}finally{n(r)}},e.prototype.chownSync=function(t,e){try{this._FS.fchown(this._stream.fd,t,e)}catch(t){throw Q(t,this._path)}},e.prototype.chmod=function(t,e){var n=null;try{this.chmodSync(t)}catch(t){n=t}finally{e(n)}},e.prototype.chmodSync=function(t){try{this._FS.fchmod(this._stream.fd,t)}catch(t){throw Q(t,this._path)}},e.prototype.utimes=function(t,e,n){var r=null;try{this.utimesSync(t,e)}catch(t){r=t}finally{n(r)}},e.prototype.utimesSync=function(t,e){this._fs.utimesSync(this._path,t,e)},e}(G),et=function(e){function n(t){e.call(this),this._FS=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.FS))},n.isAvailable=function(){return!0},n.prototype.getName=function(){return this._FS.DB_NAME()},n.prototype.isReadOnly=function(){return!1},n.prototype.supportsLinks=function(){return!0},n.prototype.supportsProps=function(){return!0},n.prototype.supportsSynch=function(){return!0},n.prototype.renameSync=function(t,e){try{this._FS.rename(t,e)}catch(n){throw n.errno===c.ENOENT?Q(n,this.existsSync(t)?e:t):Q(n)}},n.prototype.statSync=function(t,e){try{var n=e?this._FS.lstat(t):this._FS.stat(t),r=this.modeToFileType(n.mode);return new m(r,n.size,n.mode,n.atime.getTime(),n.mtime.getTime(),n.ctime.getTime())}catch(e){throw Q(e,t)}},n.prototype.openSync=function(t,e,n){try{var r=this._FS.open(t,e.getFlagString(),n);if(this._FS.isDir(r.node.mode))throw this._FS.close(r),l.EISDIR(t);return new tt(this,this._FS,t,r)}catch(e){throw Q(e,t)}},n.prototype.unlinkSync=function(t){try{this._FS.unlink(t)}catch(e){throw Q(e,t)}},n.prototype.rmdirSync=function(t){try{this._FS.rmdir(t)}catch(e){throw Q(e,t)}},n.prototype.mkdirSync=function(t,e){try{this._FS.mkdir(t,e)}catch(e){throw Q(e,t)}},n.prototype.readdirSync=function(t){try{return this._FS.readdir(t).filter(function(t){return"."!==t&&".."!==t})}catch(e){throw Q(e,t)}},n.prototype.truncateSync=function(t,e){try{this._FS.truncate(t,e)}catch(e){throw Q(e,t)}},n.prototype.readFileSync=function(t,e,n){try{var r=Z(this._FS.readFile(t,{flags:n.getFlagString()}));return e?r.toString(e):r}catch(e){throw Q(e,t)}},n.prototype.writeFileSync=function(e,n,r,i,o){try{r&&(n=t.from(n,r));var s=j(n);this._FS.writeFile(e,s,{flags:i.getFlagString(),encoding:"binary"}),this._FS.chmod(e,o)}catch(t){throw Q(t,e)}},n.prototype.chmodSync=function(t,e,n){try{e?this._FS.lchmod(t,n):this._FS.chmod(t,n)}catch(e){throw Q(e,t)}},n.prototype.chownSync=function(t,e,n,r){try{e?this._FS.lchown(t,n,r):this._FS.chown(t,n,r)}catch(e){throw Q(e,t)}},n.prototype.symlinkSync=function(t,e,n){try{this._FS.symlink(t,e)}catch(t){throw Q(t)}},n.prototype.readlinkSync=function(t){try{return this._FS.readlink(t)}catch(e){throw Q(e,t)}},n.prototype.utimesSync=function(t,e,n){try{this._FS.utime(t,e.getTime(),n.getTime())}catch(e){throw Q(e,t)}},n.prototype.modeToFileType=function(t){if(this._FS.isDir(t))return y.DIRECTORY;if(this._FS.isFile(t))return y.FILE;if(this._FS.isLink(t))return y.SYMLINK;throw l.EPERM("Invalid mode: "+t)},n}(K);et.Name="EmscriptenFileSystem",et.Options={FS:{type:"object",description:"The Emscripten file system to use (the `FS` variable)"}};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||X(),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 l(c.ENOTSUP)},n.prototype.close=function(t){try{this.closeSync(),t()}catch(e){t(e)}},n.prototype.closeSync=function(){throw new l(c.ENOTSUP)},n.prototype.stat=function(t){try{t(null,m.clone(this._stat))}catch(e){t(e)}},n.prototype.statSync=function(){return m.clone(this._stat)},n.prototype.truncate=function(t,e){try{this.truncateSync(t),this._flag.isSynchronous()&&!P.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 l(c.EPERM,"File not opened with a writeable mode.");if(this._stat.mtimeMs=Date.now(),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()&&P.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()&&P.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 l(c.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.mtimeMs=Date.now(),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 l(c.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.atimeMs=Date.now(),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 l(c.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}(G),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.sync=function(t){t()},e.prototype.syncSync=function(){},e.prototype.close=function(t){t()},e.prototype.closeSync=function(){},e}(nt),it=function(t,e){return void 0===e&&(e=""),function(n){if("NotFoundError"===n.name)return t(l.ENOENT(e));t(n)}},ot=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),st=function(e){function n(t){e.call(this),this._handles={"/":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.handle))},n.isAvailable=function(){return"function"==typeof FileSystemHandle},n.prototype.getName=function(){return n.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._sync=function(t,e,n,r){var i=this;this.stat(t,!1,function(o,s){n.mtime!==s.mtime?i.writeFile(t,e,null,g.getFileFlag("w"),s.mode,r):r(o)})},n.prototype.rename=function(t,e,n){var r=this;this.getHandle(t,function(i,o){if(i)return n(i);o instanceof FileSystemDirectoryHandle&&r.readdir(t,function(i,o){if(void 0===o&&(o=[]),i)return n(i);r.mkdir(e,"wx",function(i){if(i)return n(i);0===o.length?r.unlink(t,n):o.forEach(function(i){return r.rename(s.join(t,i),s.join(e,i),function(){return r.unlink(t,n)})})})}),o instanceof FileSystemFileHandle&&o.getFile().then(function(i){return r.getHandle(s.dirname(e),function(o,a){if(o)return n(o);a instanceof FileSystemDirectoryHandle&&a.getFileHandle(s.basename(e),{create:!0}).then(function(o){return o.createWritable().then(function(o){return i.arrayBuffer().then(function(i){return o.write(i).then(function(){o.close(),r.unlink(t,n)}).catch(it(n,e))}).catch(it(n,t))}).catch(it(n,e))}).catch(it(n,e))})}).catch(it(n,t))})},n.prototype.writeFile=function(t,e,n,r,i,o,a){var c=this;this.getHandle(s.dirname(t),function(n,i){if(n)return o(n);i instanceof FileSystemDirectoryHandle&&i.getFileHandle(s.basename(t),{create:!0}).then(function(n){return n.createWritable().then(function(n){return n.write(e).then(function(){n.close().catch(it(o,t)),o(null,a?c.newFile(t,r,e):void 0)}).catch(it(o,t))}).catch(it(o,t))}).catch(it(o,t))})},n.prototype.createFile=function(t,e,n,r){this.writeFile(t,X(),null,e,n,r,!0)},n.prototype.stat=function(t,e,n){this.getHandle(t,function(e,r){return e?n(e):r?r instanceof FileSystemDirectoryHandle?n(null,new m(y.DIRECTORY,4096)):void(r instanceof FileSystemFileHandle&&r.getFile().then(function(t){var e=t.lastModified,r=t.size;return n(null,new m(y.FILE,r,void 0,void 0,e))}).catch(it(n,t))):n(l.FileError(c.EINVAL,t))})},n.prototype.exists=function(t,e){this.getHandle(t,function(t){return e(null===t)})},n.prototype.openFile=function(t,e,n){var r=this;this.getHandle(t,function(i,o){if(i)return n(i);o instanceof FileSystemFileHandle&&o.getFile().then(function(i){return i.arrayBuffer().then(function(o){return n(null,r.newFile(t,e,o,i.size,i.lastModified))}).catch(it(n,t))}).catch(it(n,t))})},n.prototype.unlink=function(t,e){this.getHandle(s.dirname(t),function(n,r){if(n)return e(n);r instanceof FileSystemDirectoryHandle&&r.removeEntry(s.basename(t),{recursive:!0}).then(function(){return e(null)}).catch(it(e,t))})},n.prototype.rmdir=function(t,e){this.unlink(t,e)},n.prototype.mkdir=function(t,e,n){var r=this,i=e&&e.flag&&e.flag.includes("w")&&!e.flag.includes("x");this.getHandle(t,function(e,o){if(o&&!i)return n(l.EEXIST(t));r.getHandle(s.dirname(t),function(e,r){if(e)return n(e);r instanceof FileSystemDirectoryHandle&&r.getDirectoryHandle(s.basename(t),{create:!0}).then(function(){return n(null)}).catch(it(n,t))})})},n.prototype.readdir=function(t,e){this.getHandle(t,function(n,r){if(n)return e(n);r instanceof FileSystemDirectoryHandle&&function(t,e,n){var r=[],i=function(){t.next().then(function(t){var n=t.done,o=t.value;if(n)return e(null,r);r.push(o),i()}).catch(it(e,n))};i()}(r.keys(),e,t)})},n.prototype.newFile=function(e,n,r,i,o){return new ot(this,e,n,new m(y.FILE,i||0,void 0,void 0,o||(new Date).getTime()),t.from(r))},n.prototype.getHandle=function(t,e){var n=this;if("/"===t)return e(null,this._handles["/"]);var r="/",i=t.split("/").slice(1),o=function(i){var a=i[0],u=i.slice(1),f=s.join(r,a),h=function(i){if(r=f,n._handles[r]=i,0===u.length)return e(null,n._handles[t]);o(u)},p=n._handles[r];p.getDirectoryHandle(a).then(h).catch(function(t){"TypeMismatchError"===t.name?p.getFileHandle(a).then(h).catch(it(e,f)):"Name is not allowed."===t.message?e(new l(c.ENOENT,t.message,f)):it(e,f)(t)})};o(i)},n}(J);st.Name="FileSystemAccess",st.Options={};var at=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};at.fromBuffer=function(t){if(void 0===t)throw new Error("NO");return new at(t.toString("ascii",30),t.readUInt32LE(0),t.readUInt16LE(4),t.readDoubleLE(6),t.readDoubleLE(14),t.readDoubleLE(22))},at.prototype.toStats=function(){return new m((61440&this.mode)===y.DIRECTORY?y.DIRECTORY:y.FILE,this.size,this.mode,this.atime,this.mtime,this.ctime)},at.prototype.getSize=function(){return 30+this.id.length},at.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},at.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},at.prototype.isFile=function(){return(61440&this.mode)===y.FILE},at.prototype.isDirectory=function(){return(61440&this.mode)===y.DIRECTORY};var ct=null;function ut(){return ct||(ct=t.from("{}"))}function ft(){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 ht(t,e){return!t||(e(t),!1)}function pt(t,e,n){return!t||(e.abort(function(){n(t)}),!1)}var lt=function(t){this.limit=t,this.size=0,this.map=new Map,this.head=null,this.tail=null};lt.prototype.set=function(t,e){var n=this.map.get(t);n?(n.value=e,this.remove(t,n)):this.size>=this.limit&&(this.map.delete(this.tail.key),this.size--,this.tail=this.tail.prev,this.tail.next=null),this.setHead(n||new function(t,e){this.key=t,this.value=e,this.prev=null,this.next=null}(t,e))},lt.prototype.get=function(t){var e=this.map.get(t);return e?(this.remove(t,e),this.setHead(e),e.value):null},lt.prototype.remove=function(t,e){var n=e||this.map.get(t);n&&(null!==n.prev?n.prev.next=n.next:this.head=n.next,null!==n.next?n.next.prev=n.prev:this.tail=n.prev,this.map.delete(t),this.size--)},lt.prototype.removeAll=function(){this.size=0,this.map=new Map,this.head=null,this.tail=null},lt.prototype.setHead=function(t){t.next=this.head,t.prev=null,null!==this.head&&(this.head.prev=t),this.head=t,null===this.tail&&(this.tail=t),this.size++,this.map.set(t.key,t)};var dt=function(t){this.store=t,this.originalData={},this.modifiedKeys=[]};dt.prototype.get=function(t){var e=this.store.get(t);return this.stashOldValue(t,e),e},dt.prototype.put=function(t,e,n){return this.markModified(t),this.store.put(t,e,n)},dt.prototype.del=function(t){this.markModified(t),this.store.del(t)},dt.prototype.commit=function(){},dt.prototype.abort=function(){for(var t=0,e=this.modifiedKeys;t<e.length;t+=1){var n=e[t],r=this.originalData[n];r?this.store.put(n,r,!0):this.store.del(n)}},dt.prototype.stashOldValue=function(t,e){this.originalData.hasOwnProperty(t)||(this.originalData[t]=e)},dt.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 yt=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),gt=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=f.dirname(e),o=f.basename(e),s=f.dirname(n),a=f.basename(n),u=this.findINode(r,i),h=this.getDirListing(r,i,u);if(!h[o])throw l.ENOENT(e);var p,d,y=h[o];if(delete h[o],0===(s+"/").indexOf(e+"/"))throw new l(c.EBUSY,i);if(s===i?(p=u,d=h):(p=this.findINode(r,s),d=this.getDirListing(r,s,p)),d[a]){var g=this.getINode(r,n,d[a]);if(!g.isFile())throw l.EPERM(n);try{r.del(g.id),r.del(d[a])}catch(t){throw r.abort(),t}}d[a]=y;try{r.put(u.id,t.from(JSON.stringify(h)),!0),r.put(p.id,t.from(JSON.stringify(d)),!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=X(),o=this.commitNewFile(r,t,y.FILE,n,i);return new yt(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 l.ENOENT(t);return new yt(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 l.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,y.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,f.dirname(t),f.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 at(ft(),4096,511|y.DIRECTORY,e,e,e);t.put(n.id,ut(),!1),t.put("/",n.toBuffer(),!1),t.commit()}},n.prototype._findINode=function(t,e,n){var r=this,o=function(i){var o=r.getDirListing(t,e,i);if(o[n])return o[n];throw l.ENOENT(f.resolve(e,n))};return"."===e&&(e=i.cwd()),"/"===e?""===n?"/":o(this.getINode(t,e,"/")):o(this.getINode(t,e+f.sep+n,this._findINode(t,f.dirname(e),f.basename(e))))},n.prototype.findINode=function(t,e){return this.getINode(t,e,this._findINode(t,f.dirname(e),f.basename(e)))},n.prototype.getINode=function(t,e,n){var r=t.get(n);if(void 0===r)throw l.ENOENT(e);return at.fromBuffer(r)},n.prototype.getDirListing=function(t,e,n){if(!n.isDirectory())throw l.ENOTDIR(e);var r=t.get(n.id);if(void 0===r)throw l.ENOENT(e);return JSON.parse(r.toString())},n.prototype.addNewNode=function(t,e){for(var n;;)try{return n=ft(),t.put(n,e,!1),n}catch(t){}throw new l(c.EIO,"Unable to commit data to key-value store.")},n.prototype.commitNewFile=function(e,n,r,i,o){var s,a=f.dirname(n),c=f.basename(n),u=this.findINode(e,a),h=this.getDirListing(e,a,u),p=(new Date).getTime();if("/"===n)throw l.EEXIST(n);if(h[c])throw l.EEXIST(n);try{var d=this.addNewNode(e,o);s=new at(d,o.length,i|r,p,p,p);var y=this.addNewNode(e,s.toBuffer());h[c]=y,e.put(u.id,t.from(JSON.stringify(h)),!0)}catch(t){throw e.abort(),t}return e.commit(),s},n.prototype.removeEntry=function(e,n){var r=this.store.beginTransaction("readwrite"),i=f.dirname(e),o=this.findINode(r,i),s=this.getDirListing(r,i,o),a=f.basename(e);if(!s[a])throw l.ENOENT(e);var c=s[a];delete s[a];var u=this.getINode(r,e,c);if(!n&&u.isDirectory())throw l.EISDIR(e);if(n&&!u.isDirectory())throw l.ENOTDIR(e);try{r.del(u.id),r.del(c),r.put(o.id,t.from(JSON.stringify(s)),!0)}catch(t){throw r.abort(),t}r.commit()},n}(K),mt=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),wt=function(e){function n(t){e.call(this),this._cache=null,t>0&&(this._cache=new lt(t))}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._cache&&this._cache.removeAll(),this.store.clear(function(n){ht(n,t)&&e.makeRootDirectory(t)})},n.prototype.rename=function(e,n,r){var i=this;if(this._cache){var o=this._cache;this._cache=null,o.removeAll();var s=r;r=function(t){i._cache=o,s(t)}}var a=this.store.beginTransaction("readwrite"),u=f.dirname(e),h=f.basename(e),p=f.dirname(n),d=f.basename(n),y={},g={},m=!1;if(0===(p+"/").indexOf(e+"/"))return r(new l(c.EBUSY,u));var w=function(o){i.findINodeAndDirListing(a,o,function(s,c,f){s?m||(m=!0,a.abort(function(){r(s)})):(y[o]=c,g[o]=f,function(){if(!m&&g.hasOwnProperty(u)&&g.hasOwnProperty(p)){var o=g[u],s=y[u],c=g[p],f=y[p];if(o[h]){var w=o[h];delete o[h];var _=function(){c[d]=w,a.put(s.id,t.from(JSON.stringify(o)),!0,function(e){pt(e,a,r)&&(u===p?a.commit(r):a.put(f.id,t.from(JSON.stringify(c)),!0,function(t){pt(t,a,r)&&a.commit(r)}))})};c[d]?i.getINode(a,n,c[d],function(t,e){pt(t,a,r)&&(e.isFile()?a.del(e.id,function(t){pt(t,a,r)&&a.del(c[d],function(t){pt(t,a,r)&&_()})}):a.abort(function(t){r(l.EPERM(n))}))}):_()}else r(l.ENOENT(e))}}())})};w(u),u!==p&&w(p)},n.prototype.stat=function(t,e,n){var r=this.store.beginTransaction("readonly");this.findINode(r,t,function(t,e){ht(t,n)&&n(null,e.toStats())})},n.prototype.createFile=function(t,e,n,r){var i=this,o=this.store.beginTransaction("readwrite"),s=X();this.commitNewFile(o,t,y.FILE,n,s,function(n,o){ht(n,r)&&r(null,new mt(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){ht(o,n)&&i.get(s.id,function(i,o){ht(i,n)&&(void 0===o?n(l.ENOENT(t)):n(null,new mt(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(l.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,y.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){ht(i,e)&&n.getDirListing(r,t,o,function(t,n){ht(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,f.dirname(t),f.basename(t),function(s,a){pt(s,o,r)&&i.getINode(o,t,a,function(t,i){if(pt(t,o,r)){var s=i.update(n);o.put(i.id,e,!0,function(t){pt(t,o,r)&&(s?o.put(a,i.toBuffer(),!0,function(t){pt(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 at(ft(),4096,511|y.DIRECTORY,i,i,i);e.put(o.id,ut(),!1,function(n){pt(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;if(this._cache){var o=this._cache.get(f.join(e,n));if(o)return r(null,o)}var s=function(t,o,s){if(t)r(t);else if(s[n]){var a=s[n];i._cache&&i._cache.set(f.join(e,n),a),r(null,a)}else r(l.ENOENT(f.resolve(e,n)))};"/"===e?""===n?(this._cache&&this._cache.set(f.join(e,n),"/"),r(null,"/")):this.getINode(t,e,"/",function(n,o){ht(n,r)&&i.getDirListing(t,e,o,function(t,e){s(t,0,e)})}):this.findINodeAndDirListing(t,e,s)},n.prototype.findINode=function(t,e,n){var r=this;this._findINode(t,f.dirname(e),f.basename(e),function(i,o){ht(i,n)&&r.getINode(t,e,o,n)})},n.prototype.getINode=function(t,e,n,r){t.get(n,function(t,n){ht(t,r)&&(void 0===n?r(l.ENOENT(e)):r(null,at.fromBuffer(n)))})},n.prototype.getDirListing=function(t,e,n,r){n.isDirectory()?t.get(n.id,function(t,n){if(ht(t,r))try{r(null,JSON.parse(n.toString()))}catch(t){r(l.ENOENT(e))}}):r(l.ENOTDIR(e))},n.prototype.findINodeAndDirListing=function(t,e,n){var r=this;this.findINode(t,e,function(i,o){ht(i,n)&&r.getDirListing(t,e,o,function(t,e){ht(t,n)&&n(null,o,e)})})},n.prototype.addNewNode=function(t,e,n){var r,i=0,o=function(){5==++i?n(new l(c.EIO,"Unable to commit data to key-value store.")):(r=ft(),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,c=f.dirname(n),u=f.basename(n),h=(new Date).getTime();if("/"===n)return s(l.EEXIST(n));this.findINodeAndDirListing(e,c,function(c,f,p){pt(c,e,s)&&(p[u]?e.abort(function(){s(l.EEXIST(n))}):a.addNewNode(e,o,function(n,c){if(pt(n,e,s)){var l=new at(c,o.length,i|r,h,h,h);a.addNewNode(e,l.toBuffer(),function(n,r){pt(n,e,s)&&(p[u]=r,e.put(f.id,t.from(JSON.stringify(p)),!0,function(t){pt(t,e,s)&&e.commit(function(t){pt(t,e,s)&&s(null,l)})}))})}}))})},n.prototype.removeEntry=function(e,n,r){var i=this;this._cache&&this._cache.remove(e);var o=this.store.beginTransaction("readwrite"),s=f.dirname(e),a=f.basename(e);this.findINodeAndDirListing(o,s,function(s,c,u){if(pt(s,o,r))if(u[a]){var f=u[a];delete u[a],i.getINode(o,e,f,function(i,s){pt(i,o,r)&&(!n&&s.isDirectory()?o.abort(function(){r(l.EISDIR(e))}):n&&!s.isDirectory()?o.abort(function(){r(l.ENOTDIR(e))}):o.del(s.id,function(e){pt(e,o,r)&&o.del(f,function(e){pt(e,o,r)&&o.put(c.id,t.from(JSON.stringify(u)),!0,function(t){pt(t,o,r)&&o.commit(r)})})}))})}else o.abort(function(){r(l.ENOENT(e))})})},n}(J),_t=function(){this.store={}};_t.prototype.name=function(){return Et.Name},_t.prototype.clear=function(){this.store={}},_t.prototype.beginTransaction=function(t){return new dt(this)},_t.prototype.get=function(t){return this.store[t]},_t.prototype.put=function(t,e,n){return!(!n&&this.store.hasOwnProperty(t))&&(this.store[t]=e,!0)},_t.prototype.del=function(t){delete this.store[t]};var Et=function(t){function e(){t.call(this,{store:new _t})}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}(gt);Et.Name="InMemory",Et.Options={};var vt=function(){try{return E.indexedDB||E.mozIndexedDB||E.webkitIndexedDB||E.msIndexedDB}catch(t){return null}}();function St(t,e){switch(void 0===e&&(e=t.toString()),t.name){case"NotFoundError":return new l(c.ENOENT,e);case"QuotaExceededError":return new l(c.ENOSPC,e);default:return new l(c.EIO,e)}}function bt(t,e,n){return void 0===e&&(e=c.EIO),void 0===n&&(n=null),function(r){r.preventDefault(),t(new l(e,null!==n?n:void 0))}}var It=function(t,e){this.tx=t,this.store=e};It.prototype.get=function(t,e){try{var n=this.store.get(t);n.onerror=bt(e),n.onsuccess=function(t){var n=t.target.result;e(null,void 0===n?n:V(n))}}catch(t){e(St(t))}};var kt=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=z(e);(i=n?this.store.put(o,t):this.store.add(o,t)).onerror=bt(r),i.onsuccess=function(t){r(null,!0)}}catch(t){r(St(t))}},e.prototype.del=function(t,e){try{var n=this.store.delete(t);n.onerror=bt(e),n.onsuccess=function(t){e()}}catch(t){e(St(t))}},e.prototype.commit=function(t){setTimeout(t,0)},e.prototype.abort=function(t){var e=null;try{this.tx.abort()}catch(t){e=St(t)}finally{t(e)}},e}(It),Ot=function(t,e){this.db=t,this.storeName=e};Ot.Create=function(t,e){var n=vt.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 Ot(n.target.result,t))},n.onerror=bt(e,c.EACCES)},Ot.prototype.name=function(){return Nt.Name+" - "+this.storeName},Ot.prototype.clear=function(t){try{var e=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).clear();e.onsuccess=function(e){setTimeout(t,0)},e.onerror=bt(t)}catch(e){t(St(e))}},Ot.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 kt(e,n);if("readonly"===t)return new It(e,n);throw new l(c.EINVAL,"Invalid transaction type.")};var Nt=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){void 0===t&&(t={}),Ot.Create(t.storeName?t.storeName:"browserfs",function(r,i){if(i){var o=new e("number"==typeof t.cacheSize?t.cacheSize:100);o.init(i,function(t){t?n(t):n(null,o)})}else n(r)})},e.isAvailable=function(){try{return void 0!==vt&&null!==vt.open("__browserfs_test__")}catch(t){return!1}},e}(wt);Nt.Name="IndexedDB",Nt.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."},cacheSize:{type:"number",optional:!0,description:"The size of the inode cache. Defaults to 100. A size of 0 or below disables caching."}};var Ft=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){Et.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=f.resolve(t),this.mntMap[t])throw new l(c.EINVAL,"Mount point "+t+" is already taken.");M(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){if("/"!==t[0]&&(t="/"+t),t=f.resolve(t),!this.mntMap[t])throw new l(c.EINVAL,"Mount point "+t+" is already unmounted.");for(delete this.mntMap[t],this.mountList.splice(this.mountList.indexOf(t),1);"/"!==t&&0===this.rootFs.readdirSync(t).length;)this.rootFs.rmdirSync(t),t=f.dirname(t)},e.prototype._getFs=function(t){for(var e=this.mountList,n=e.length,r=0;r<n;r++){var i=e[r];if(i.length<=t.length&&(t===i||t.startsWith(i.endsWith("/")?i:i+"/")))return""===(t=t.substr(i.length>1?i.length:0))&&(t="/"),{fs:this.mntMap[i],path:t,mountPoint:i}}return{fs:this.rootFs,path:t,mountPoint:"/"}},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)}):P.readFile(t,function(r,i){if(r)return n(r);P.writeFile(e,i,function(e){if(e)return n(e);P.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=P.readFileSync(t);return P.writeFileSync(e,i),P.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.realpathSync=function(t,e){var n=this._getFs(t);try{var r=n.fs.realpathSync(n.path,{});return f.resolve(f.join(n.mountPoint,r))}catch(e){throw this.standardizeError(e,n.path,t)}},e.prototype.realpath=function(t,e,n){var r=this,i=this._getFs(t);i.fs.realpath(i.path,{},function(e,o){e?n(r.standardizeError(e,i.path,t)):n(null,f.resolve(f.join(i.mountPoint,o)))})},e.prototype.rmdirSync=function(t){var e=this._getFs(t);if(this._containsMountPt(t))throw l.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(l.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}(J);function Tt(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 l&&e.standardizeError(t[0],o.path,i),s.apply(null,t)}}return o.fs[t].apply(o.fs,n)}}Ft.Name="MountableFileSystem",Ft.Options={};for(var Lt=[["exists","unlink","readlink"],["stat","mkdir","truncate"],["open","readFile","chmod","utimes"],["chown"],["writeFile","appendFile"]],xt=0;xt<Lt.length;xt++)for(var Dt=0,Rt=Lt[xt];Dt<Rt.length;Dt+=1){var At=Rt[Dt];Ft.prototype[At]=Tt(At,!1),Ft.prototype[At+"Sync"]=Tt(At+"Sync",!0)}var Ut=function(){this._locked=!1,this._waiters=[]};Ut.prototype.lock=function(t){this._locked?this._waiters.push(t):(this._locked=!0,t())},Ut.prototype.unlock=function(){if(!this._locked)throw new Error("unlock of a non-locked mutex");var t=this._waiters.shift();t?k(t):this._locked=!1},Ut.prototype.tryLock=function(){return!this._locked&&(this._locked=!0,!0)},Ut.prototype.isLocked=function(){return this._locked};var Pt=function(t){this._fs=t,this._mu=new Ut};Pt.prototype.getName=function(){return"LockedFS<"+this._fs.getName()+">"},Pt.prototype.getFSUnlocked=function(){return this._fs},Pt.prototype.diskSpace=function(t,e){this._fs.diskSpace(t,e)},Pt.prototype.isReadOnly=function(){return this._fs.isReadOnly()},Pt.prototype.supportsLinks=function(){return this._fs.supportsLinks()},Pt.prototype.supportsProps=function(){return this._fs.supportsProps()},Pt.prototype.supportsSynch=function(){return this._fs.supportsSynch()},Pt.prototype.rename=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.rename(t,e,function(t){r._mu.unlock(),n(t)})})},Pt.prototype.renameSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.renameSync(t,e)},Pt.prototype.stat=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.stat(t,e,function(t,e){r._mu.unlock(),n(t,e)})})},Pt.prototype.statSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.statSync(t,e)},Pt.prototype.open=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.open(t,e,n,function(t,e){i._mu.unlock(),r(t,e)})})},Pt.prototype.openSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.openSync(t,e,n)},Pt.prototype.unlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.unlink(t,function(t){n._mu.unlock(),e(t)})})},Pt.prototype.unlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.unlinkSync(t)},Pt.prototype.rmdir=function(t,e){var n=this;this._mu.lock(function(){n._fs.rmdir(t,function(t){n._mu.unlock(),e(t)})})},Pt.prototype.rmdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.rmdirSync(t)},Pt.prototype.mkdir=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.mkdir(t,e,function(t){r._mu.unlock(),n(t)})})},Pt.prototype.mkdirSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.mkdirSync(t,e)},Pt.prototype.readdir=function(t,e){var n=this;this._mu.lock(function(){n._fs.readdir(t,function(t,r){n._mu.unlock(),e(t,r)})})},Pt.prototype.readdirSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readdirSync(t)},Pt.prototype.exists=function(t,e){var n=this;this._mu.lock(function(){n._fs.exists(t,function(t){n._mu.unlock(),e(t)})})},Pt.prototype.existsSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.existsSync(t)},Pt.prototype.realpath=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.realpath(t,e,function(t,e){r._mu.unlock(),n(t,e)})})},Pt.prototype.realpathSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.realpathSync(t,e)},Pt.prototype.truncate=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.truncate(t,e,function(t){r._mu.unlock(),n(t)})})},Pt.prototype.truncateSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.truncateSync(t,e)},Pt.prototype.readFile=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.readFile(t,e,n,function(t,e){i._mu.unlock(),r(t,e)})})},Pt.prototype.readFileSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readFileSync(t,e,n)},Pt.prototype.writeFile=function(t,e,n,r,i,o){var s=this;this._mu.lock(function(){s._fs.writeFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},Pt.prototype.writeFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.writeFileSync(t,e,n,r,i)},Pt.prototype.appendFile=function(t,e,n,r,i,o){var s=this;this._mu.lock(function(){s._fs.appendFile(t,e,n,r,i,function(t){s._mu.unlock(),o(t)})})},Pt.prototype.appendFileSync=function(t,e,n,r,i){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.appendFileSync(t,e,n,r,i)},Pt.prototype.chmod=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.chmod(t,e,n,function(t){i._mu.unlock(),r(t)})})},Pt.prototype.chmodSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chmodSync(t,e,n)},Pt.prototype.chown=function(t,e,n,r,i){var o=this;this._mu.lock(function(){o._fs.chown(t,e,n,r,function(t){o._mu.unlock(),i(t)})})},Pt.prototype.chownSync=function(t,e,n,r){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.chownSync(t,e,n,r)},Pt.prototype.utimes=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.utimes(t,e,n,function(t){i._mu.unlock(),r(t)})})},Pt.prototype.utimesSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.utimesSync(t,e,n)},Pt.prototype.link=function(t,e,n){var r=this;this._mu.lock(function(){r._fs.link(t,e,function(t){r._mu.unlock(),n(t)})})},Pt.prototype.linkSync=function(t,e){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.linkSync(t,e)},Pt.prototype.symlink=function(t,e,n,r){var i=this;this._mu.lock(function(){i._fs.symlink(t,e,n,function(t){i._mu.unlock(),r(t)})})},Pt.prototype.symlinkSync=function(t,e,n){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.symlinkSync(t,e,n)},Pt.prototype.readlink=function(t,e){var n=this;this._mu.lock(function(){n._fs.readlink(t,function(t,r){n._mu.unlock(),e(t,r)})})},Pt.prototype.readlinkSync=function(t){if(this._mu.isLocked())throw new Error("invalid sync call");return this._fs.readlinkSync(t)};var Bt="/.deletedFiles.log";function Ct(t){return 146|t}function Mt(t){return g.getFileFlag(t)}var zt=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._syncAsync(this,function(n){e.resetDirty(),t(n)}):t(null)},e.prototype.syncSync=function(){this.isDirty()&&(this._fs._syncSync(this),this.resetDirty())},e.prototype.close=function(t){this.sync(t)},e.prototype.closeSync=function(){this.syncSync()},e}(nt),jt=function(t){function e(e,n){if(t.call(this),this._isInitialized=!1,this._initializeCallbacks=[],this._deletedFiles={},this._deleteLog="",this._deleteLogUpdatePending=!1,this._deleteLogUpdateNeeded=!1,this._deleteLogError=null,this._writable=e,this._readable=n,this._writable.isReadOnly())throw new l(c.EINVAL,"Writable file system must be writable.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.isAvailable=function(){return!0},e.prototype.getOverlayedFileSystems=function(){return{readable:this._readable,writable:this._writable}},e.prototype._syncAsync=function(t,e){var n=this;this.createParentDirectoriesAsync(t.getPath(),function(r){if(r)return e(r);n._writable.writeFile(t.getPath(),t.getBuffer(),null,Mt("w"),t.getStats().mode,e)})},e.prototype._syncSync=function(t){this.createParentDirectories(t.getPath()),this._writable.writeFileSync(t.getPath(),t.getBuffer(),null,Mt("w"),t.getStats().mode)},e.prototype.getName=function(){return Ht.Name},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)return t();n.push(t),1===n.length&&this._writable.readFile(Bt,"utf8",Mt("r"),function(t,n){if(t){if(t.errno!==c.ENOENT)return r(t)}else e._deleteLog=n;e._reparseDeletionLog(),r()})},e.prototype.isReadOnly=function(){return!1},e.prototype.supportsSynch=function(){return this._readable.supportsSynch()&&this._writable.supportsSynch()},e.prototype.supportsLinks=function(){return!1},e.prototype.supportsProps=function(){return this._readable.supportsProps()&&this._writable.supportsProps()},e.prototype.getDeletionLog=function(){return this._deleteLog},e.prototype.restoreDeletionLog=function(t){this._deleteLog=t,this._reparseDeletionLog(),this.updateLog("")},e.prototype.rename=function(t,e,n){var r=this;if(this.checkInitAsync(n)&&!this.checkPathAsync(t,n)&&!this.checkPathAsync(e,n))return t===Bt||e===Bt?n(l.EPERM("Cannot rename deletion log.")):t===e?n():void this.stat(t,!1,function(i,o){return i?n(i):r.stat(e,!1,function(i,s){var a=r;function u(r){var i=r.shift();if(!i)return n();var o=f.resolve(t,i),s=f.resolve(e,i);a.rename(o,s,function(t){if(t)return n(t);u(r)})}var h=511;if(o.isDirectory()){if(i)return i.errno!==c.ENOENT?n(i):r._writable.exists(t,function(i){if(i)return r.createParentDirectoriesAsync(e,function(i){return i?n(i):r._writable.rename(t,e,n)});r.createParentDirectoriesAsync(e,function(i){if(i)return n(i);r._writable.mkdir(e,h,function(e){if(e)return n(e);r.readdir(t,function(e,i){if(e)return n(e);u(i),r.deletePath(t)})})})});if(h=s.mode,!s.isDirectory())return n(l.ENOTDIR(e));r.readdir(e,function(i,o){if(o&&o.length)return n(l.ENOTEMPTY(e));r._readable.readdir(t,function(e,i){if(e)return n(e);u(i),r.deletePath(t)})})}if(s&&s.isDirectory())return n(l.EISDIR(e));r.readFile(t,null,Mt("r"),function(i,s){return i?n(i):r.writeFile(e,s,null,Mt("w"),o.mode,function(e){return e?n(e):r.unlink(t,n)})})})})},e.prototype.renameSync=function(t,e){var n=this;if(this.checkInitialized(),this.checkPath(t),this.checkPath(e),t===Bt||e===Bt)throw l.EPERM("Cannot rename deletion log.");var r=this.statSync(t,!1);if(r.isDirectory()){if(t===e)return;var i=511;if(this.existsSync(e)){var o=this.statSync(e,!1);if(i=o.mode,!o.isDirectory())throw l.ENOTDIR(e);if(this.readdirSync(e).length>0)throw l.ENOTEMPTY(e)}this._writable.existsSync(t)?this._writable.renameSync(t,e):this._writable.existsSync(e)||(this.createParentDirectories(e),this._writable.mkdirSync(e,i)),this._readable.existsSync(t)&&(this._readable.readdirSync(t).forEach(function(r){n.renameSync(f.resolve(t,r),f.resolve(e,r))}),this.deletePath(t))}else{if(this.existsSync(e)&&this.statSync(e,!1).isDirectory())throw l.EISDIR(e);this.writeFileSync(e,this.readFileSync(t,null,Mt("r")),null,Mt("w"),r.mode)}t!==e&&this.existsSync(t)&&this.unlinkSync(t)},e.prototype.stat=function(t,e,n){var r=this;this.checkInitAsync(n)&&this._writable.stat(t,e,function(i,o){if(i&&i.errno===c.ENOENT){if(r._deletedFiles[t])return n(l.ENOENT(t));r._readable.stat(t,e,function(t,e){e&&((e=m.clone(e)).mode=Ct(e.mode)),n(t,e)})}else n(i,o)})},e.prototype.statSync=function(t,e){this.checkInitialized();try{return this._writable.statSync(t,e)}catch(r){if(this._deletedFiles[t])throw l.ENOENT(t);var n=m.clone(this._readable.statSync(t,e));return n.mode=Ct(n.mode),n}},e.prototype.open=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&!this.checkPathAsync(t,r)&&this.stat(t,!0,function(o,s){if(s)switch(e.pathExistsAction()){case p.TRUNCATE_FILE:return i.createParentDirectoriesAsync(t,function(o){if(o)return r(o);i._writable.open(t,e,n,r)});case p.NOP:return i._writable.exists(t,function(o){o?i._writable.open(t,e,n,r):((s=m.clone(s)).mode=n,i._readable.readFile(t,null,Mt("r"),function(n,o){if(n)return r(n);-1===s.size&&(s.size=o.length);var a=new zt(i,t,e,s,o);r(null,a)}))});default:return r(l.EEXIST(t))}else switch(e.pathNotExistsAction()){case p.CREATE_FILE:return i.createParentDirectoriesAsync(t,function(o){return o?r(o):i._writable.open(t,e,n,r)});default:return r(l.ENOENT(t))}})},e.prototype.openSync=function(t,e,n){if(this.checkInitialized(),this.checkPath(t),t===Bt)throw l.EPERM("Cannot open deletion log.");if(this.existsSync(t))switch(e.pathExistsAction()){case p.TRUNCATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,n);case p.NOP:if(this._writable.existsSync(t))return this._writable.openSync(t,e,n);var r=this._readable.readFileSync(t,null,Mt("r")),i=m.clone(this._readable.statSync(t,!1));return i.mode=n,new zt(this,t,e,i,r);default:throw l.EEXIST(t)}else switch(e.pathNotExistsAction()){case p.CREATE_FILE:return this.createParentDirectories(t),this._writable.openSync(t,e,n);default:throw l.ENOENT(t)}},e.prototype.unlink=function(t,e){var n=this;this.checkInitAsync(e)&&!this.checkPathAsync(t,e)&&this.exists(t,function(r){if(!r)return e(l.ENOENT(t));n._writable.exists(t,function(r){if(r)return n._writable.unlink(t,function(r){if(r)return e(r);n.exists(t,function(r){r&&n.deletePath(t),e(null)})});n.deletePath(t),e(null)})})},e.prototype.unlinkSync=function(t){if(this.checkInitialized(),this.checkPath(t),!this.existsSync(t))throw l.ENOENT(t);this._writable.existsSync(t)&&this._writable.unlinkSync(t),this.existsSync(t)&&this.deletePath(t)},e.prototype.rmdir=function(t,e){var n=this;if(this.checkInitAsync(e)){var r=function(){n.readdir(t,function(r,i){return r?e(r):i.length?e(l.ENOTEMPTY(t)):(n.deletePath(t),void e(null))})};this.exists(t,function(i){if(!i)return e(l.ENOENT(t));n._writable.exists(t,function(i){i?n._writable.rmdir(t,function(i){if(i)return e(i);n._readable.exists(t,function(t){t?r():e()})}):r()})})}},e.prototype.rmdirSync=function(t){if(this.checkInitialized(),!this.existsSync(t))throw l.ENOENT(t);if(this._writable.existsSync(t)&&this._writable.rmdirSync(t),this.existsSync(t)){if(this.readdirSync(t).length>0)throw l.ENOTEMPTY(t);this.deletePath(t)}},e.prototype.mkdir=function(t,e,n){var r=this;this.checkInitAsync(n)&&this.exists(t,function(i){if(i)return n(l.EEXIST(t));r.createParentDirectoriesAsync(t,function(i){if(i)return n(i);r._writable.mkdir(t,e,n)})})},e.prototype.mkdirSync=function(t,e){if(this.checkInitialized(),this.existsSync(t))throw l.EEXIST(t);this.createParentDirectories(t),this._writable.mkdirSync(t,e)},e.prototype.readdir=function(t,e){var n=this;this.checkInitAsync(e)&&this.stat(t,!0,function(r,i){return r?e(r):i.isDirectory()?void n._writable.readdir(t,function(r,i){if(r&&"ENOENT"!==r.code)return e(r);!r&&i||(i=[]),n._readable.readdir(t,function(r,o){!r&&o||(o=[]);var s={},a=i.concat(o.filter(function(e){return!n._deletedFiles[t+("/"===t?"":"/")+e]})).filter(function(t){var e=!s[t];return s[t]=!0,e});e(null,a)})}):e(l.ENOTDIR(t))})},e.prototype.readdirSync=function(t){var e=this;if(this.checkInitialized(),!this.statSync(t,!1).isDirectory())throw l.ENOTDIR(t);var n=[];try{n=n.concat(this._writable.readdirSync(t))}catch(t){}try{n=n.concat(this._readable.readdirSync(t).filter(function(n){return!e._deletedFiles[t+("/"===t?"":"/")+n]}))}catch(t){}var r={};return n.filter(function(t){var e=!r[t];return r[t]=!0,e})},e.prototype.exists=function(t,e){var n=this;this.checkInitialized(),this._writable.exists(t,function(r){if(r)return e(!0);n._readable.exists(t,function(r){e(r&&!0!==n._deletedFiles[t])})})},e.prototype.existsSync=function(t){return this.checkInitialized(),this._writable.existsSync(t)||this._readable.existsSync(t)&&!0!==this._deletedFiles[t]},e.prototype.chmod=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,function(o){if(o)return r(o);i._writable.chmod(t,e,n,r)})},e.prototype.chmodSync=function(t,e,n){var r=this;this.checkInitialized(),this.operateOnWritable(t,function(){r._writable.chmodSync(t,e,n)})},e.prototype.chown=function(t,e,n,r,i){var o=this;this.checkInitAsync(i)&&this.operateOnWritableAsync(t,function(s){if(s)return i(s);o._writable.chown(t,e,n,r,i)})},e.prototype.chownSync=function(t,e,n,r){var i=this;this.checkInitialized(),this.operateOnWritable(t,function(){i._writable.chownSync(t,e,n,r)})},e.prototype.utimes=function(t,e,n,r){var i=this;this.checkInitAsync(r)&&this.operateOnWritableAsync(t,function(o){if(o)return r(o);i._writable.utimes(t,e,n,r)})},e.prototype.utimesSync=function(t,e,n){var r=this;this.checkInitialized(),this.operateOnWritable(t,function(){r._writable.utimesSync(t,e,n)})},e.prototype.deletePath=function(t){this._deletedFiles[t]=!0,this.updateLog("d"+t+"\n")},e.prototype.updateLog=function(t){var e=this;this._deleteLog+=t,this._deleteLogUpdatePending?this._deleteLogUpdateNeeded=!0:(this._deleteLogUpdatePending=!0,this._writable.writeFile(Bt,this._deleteLog,"utf8",g.getFileFlag("w"),420,function(t){e._deleteLogUpdatePending=!1,t?e._deleteLogError=t:e._deleteLogUpdateNeeded&&(e._deleteLogUpdateNeeded=!1,e.updateLog(""))}))},e.prototype._reparseDeletionLog=function(){var t=this;this._deletedFiles={},this._deleteLog.split("\n").forEach(function(e){t._deletedFiles[e.slice(1)]="d"===e.slice(0,1)})},e.prototype.checkInitialized=function(){if(!this._isInitialized)throw new l(c.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(null!==this._deleteLogError){var t=this._deleteLogError;throw this._deleteLogError=null,t}},e.prototype.checkInitAsync=function(t){if(!this._isInitialized)return t(new l(c.EPERM,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.")),!1;if(null!==this._deleteLogError){var e=this._deleteLogError;return this._deleteLogError=null,t(e),!1}return!0},e.prototype.checkPath=function(t){if(t===Bt)throw l.EPERM(t)},e.prototype.checkPathAsync=function(t,e){return t===Bt&&(e(l.EPERM(t)),!0)},e.prototype.createParentDirectoriesAsync=function(t,e){var n=f.dirname(t),r=[],i=this;this._writable.stat(n,!1,function t(o,s){o?"/"===n?e(new l(c.EBUSY,"Invariant failed: root does not exist!")):(r.push(n),n=f.dirname(n),i._writable.stat(n,!1,t)):function t(){if(!r.length)return e();var n=r.pop();i._readable.stat(n,!1,function(r,o){if(!o)return e();i._writable.mkdir(n,o.mode,function(n){if(n)return e(n);t()})})}()})},e.prototype.createParentDirectories=function(t){for(var e=this,n=f.dirname(t),r=[];!this._writable.existsSync(n);)r.push(n),n=f.dirname(n);(r=r.reverse()).forEach(function(t){e._writable.mkdirSync(t,e.statSync(t,!1).mode)})},e.prototype.operateOnWritable=function(t,e){if(!this.existsSync(t))throw l.ENOENT(t);this._writable.existsSync(t)||this.copyToWritable(t),e()},e.prototype.operateOnWritableAsync=function(t,e){var n=this;this.exists(t,function(r){if(!r)return e(l.ENOENT(t));n._writable.exists(t,function(r){if(!r)return n.copyToWritableAsync(t,e);e()})})},e.prototype.copyToWritable=function(t){var e=this.statSync(t,!1);e.isDirectory()?this._writable.mkdirSync(t,e.mode):this.writeFileSync(t,this._readable.readFileSync(t,null,Mt("r")),null,Mt("w"),this.statSync(t,!1).mode)},e.prototype.copyToWritableAsync=function(t,e){var n=this;this.stat(t,!1,function(r,i){return r?e(r):i.isDirectory()?n._writable.mkdir(t,i.mode,e):void n._readable.readFile(t,null,Mt("r"),function(r,o){if(r)return e(r);n.writeFile(t,o,null,Mt("w"),i.mode,e)})})},e}(J),Ht=function(t){function e(e,n){t.call(this,new jt(e,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.writable,t.readable);r._initialize(function(t){n(t,r)})}catch(t){n(t)}},e.isAvailable=function(){return jt.isAvailable()},e.prototype.getOverlayedFileSystems=function(){return t.prototype.getFSUnlocked.call(this).getOverlayedFileSystems()},e.prototype.unwrap=function(){return t.prototype.getFSUnlocked.call(this)},e.prototype._initialize=function(e){t.prototype.getFSUnlocked.call(this)._initialize(e)},e}(Pt);Ht.Name="OverlayFS",Ht.Options={writable:{type:"object",description:"The file system to write modified files to."},readable:{type:"object",description:"The file system that initially populates this file system."}};var Zt=function(e,n,r){var i=new XMLHttpRequest;i.open("GET",e,!0);var o=!0;switch(n){case"buffer":i.responseType="arraybuffer";break;case"json":try{i.responseType="json",o="json"===i.responseType}catch(t){o=!1}break;default:return r(new l(c.EINVAL,"Invalid download type: "+n))}i.onreadystatechange=function(e){if(4===i.readyState){if(200!==i.status)return r(new l(c.EIO,"XHR error: response returned code "+i.status));switch(n){case"buffer":return r(null,i.response?t.from(i.response):X());case"json":return r(null,o?i.response:JSON.parse(i.responseText))}}},i.send()},Vt=function(e,n){var r=new XMLHttpRequest;r.open("GET",e,!1);var i=null,o=null;if(r.overrideMimeType("text/plain; charset=x-user-defined"),r.onreadystatechange=function(e){if(4===r.readyState){if(200!==r.status)return void(o=new l(c.EIO,"XHR error: response returned code "+r.status));switch(n){case"buffer":var s=r.responseText;i=t.alloc(s.length);for(var a=0;a<s.length;a++)i[a]=s.charCodeAt(a);return;case"json":return void(i=JSON.parse(r.responseText))}}},r.send(),o)throw o;return i};function Yt(t){var e=-1;return function(t,e,n){var r=new XMLHttpRequest;r.open("HEAD",e,t),r.onreadystatechange=function(t){if(4===r.readyState){if(200!==r.status)return n(new l(c.EIO,"XHR HEAD error: response returned code "+r.status));try{var e=r.getResponseHeader("Content-Length");return n(null,e?parseInt(e,10):-1)}catch(t){return n(new l(c.EIO,"XHR HEAD error: Could not read content-length."))}}},r.send()}(!1,t,function(t,n){if(t)throw t;e=n}),e}var Wt={cache:"no-cache",keepalive:!1,mode:"cors",priority:"high",referrerPolicy:"no-referrer",window:null},Xt={cache:"no-cache",keepalive:!1,method:"HEAD",mode:"no-cors",priority:"high",referrerPolicy:"no-referrer",window:null};function qt(e,n,r){var i;try{i=window.fetch(e,Wt)}catch(t){return r(new l(c.EINVAL,t.message))}i.then(function(e){if(!e.ok)return r(new l(c.EIO,"fetch error: response returned code "+e.status));switch(n){case"buffer":e.arrayBuffer().then(function(e){return r(null,t.from(e))}).catch(function(t){return r(new l(c.EIO,t.message))});break;case"json":e.json().then(function(t){return r(null,t)}).catch(function(t){return r(new l(c.EIO,t.message))});break;default:r(new l(c.EINVAL,"Invalid download type: "+n))}}).catch(function(t){return r(new l(c.EIO,t.message))})}function $t(t,e){window.fetch(t,Xt).then(function(t){if(t.ok){var n=t.headers.get("Content-Length");return e(null,n?parseInt(n,10):-1)}return e(new l(c.EIO,"fetch HEAD error: response returned code "+t.status))}).catch(function(t){return e(new l(c.EIO,t.message))})}var Jt=function(){this._index={},this.addPath("/",new Gt)};Jt.fromListing=function(t){var e=new Jt,n=new Gt;e._index["/"]=n;for(var r=[["",t,n]];r.length>0;){var i=void 0,o=r.pop(),s=o[0],a=o[1],c=o[2];for(var u in a)if(a.hasOwnProperty(u)){var f=a[u],h=s+"/"+u;f?(e._index[h]=i=new Gt,r.push([h,f,i])):i=new Kt(new m(y.FILE,-1,365)),c&&(c._ls[u]=i)}}return e},Jt.prototype.fileIterator=function(t){for(var e in this._index)if(this._index.hasOwnProperty(e))for(var n=this._index[e],r=0,i=n.getListing();r<i.length;r+=1){var o=i[r],s=n.getItem(o);Qt(s)&&t(s.getData())}},Jt.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 Gt,!this.addPath(r,o)))&&(!("/"!==t&&!o.addItem(i,e))&&(te(e)&&(this._index[t]=e),!0))},Jt.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 Gt,this.addPathFast(r,o)),!!o.addItem(i,e)&&(e.isDir()&&(this._index[t]=e),!0)},Jt.prototype.removePath=function(t){var e=this._split_path(t),n=e[0],r=e[1],i=this._index[n];if(void 0===i)return null;var o=i.remItem(r);if(null===o)return null;if(te(o)){for(var s=0,a=o.getListing();s<a.length;s+=1){var c=a[s];this.removePath(t+"/"+c)}"/"!==t&&delete this._index[t]}return o},Jt.prototype.ls=function(t){var e=this._index[t];return void 0===e?null:e.getListing()},Jt.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)},Jt.prototype._split_path=function(t){var e=f.dirname(t);return[e,t.substr(e.length+("/"===e?0:1))]};var Kt=function(t){this.data=t};Kt.prototype.isFile=function(){return!0},Kt.prototype.isDir=function(){return!1},Kt.prototype.getData=function(){return this.data},Kt.prototype.setData=function(t){this.data=t};var Gt=function(t){void 0===t&&(t=null),this.data=t,this._ls={}};function Qt(t){return!!t&&t.isFile()}function te(t){return!!t&&t.isDir()}Gt.prototype.isFile=function(){return!1},Gt.prototype.isDir=function(){return!0},Gt.prototype.getData=function(){return this.data},Gt.prototype.getStats=function(){return new m(y.DIRECTORY,4096,365)},Gt.prototype.getListing=function(){return Object.keys(this._ls)},Gt.prototype.getItem=function(t){var e=this._ls[t];return e||null},Gt.prototype.addItem=function(t,e){return!(t in this._ls)&&(this._ls[t]=e,!0)},Gt.prototype.remItem=function(t){var e=this._ls[t];return void 0===e?null:(delete this._ls[t],e)};var ee=function(t){function e(e,n){void 0===n&&(n=""),t.call(this),n.length>0&&"/"!==n.charAt(n.length-1)&&(n+="/"),this.prefixUrl=n,this._index=Jt.fromListing(e),this._requestFileAsyncInternal=qt,this._requestFileSizeAsyncInternal=$t,this._requestFileSyncInternal=Vt,this._requestFileSizeSyncInternal=Yt}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){void 0===t.index&&(t.index="index.json"),"string"==typeof t.index?Zt(t.index,"json",function(r,i){r?n(r):n(null,new e(i,t.baseUrl))}):n(null,new e(t.index,t.baseUrl))},e.isAvailable=function(){return!0},e.prototype.empty=function(){this._index.fileIterator(function(t){t.fileData=null})},e.prototype.getName=function(){return e.Name},e.prototype.diskSpace=function(t,e){e(0,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.preloadFile=function(t,e){var n=this._index.getInode(t);if(!Qt(n))throw l.EISDIR(t);if(null===n)throw l.ENOENT(t);var r=n.getData();r.size=e.length,r.fileData=e},e.prototype.stat=function(t,e,n){var r,i=this._index.getInode(t);if(null===i)return n(l.ENOENT(t));Qt(i)?(r=i.getData(),!e&&r.size<0?this._requestFileSizeAsync(t,function(t,e){if(t)return n(t);r.size=e,n(null,m.clone(r))}):n(null,m.clone(r))):te(i)?(r=i.getStats(),n(null,r)):n(l.FileError(c.EINVAL,t))},e.prototype.statSync=function(t,e){var n,r=this._index.getInode(t);if(null===r)throw l.ENOENT(t);if(Qt(r))(n=r.getData()).size<0&&(n.size=this._requestFileSizeSync(t));else{if(!te(r))throw l.FileError(c.EINVAL,t);n=r.getStats()}return n},e.prototype.open=function(t,e,n,r){if(e.isWriteable())return r(new l(c.EPERM,t));var i=this,o=this._index.getInode(t);if(null===o)return r(l.ENOENT(t));if(!Qt(o))return r(l.EISDIR(t));var s=o.getData();switch(e.pathExistsAction()){case p.THROW_EXCEPTION:case p.TRUNCATE_FILE:return r(l.EEXIST(t));case p.NOP:if(s.fileData)return r(null,new rt(i,t,e,m.clone(s),s.fileData));this._requestFileAsync(t,"buffer",function(n,o){return n?r(n):(s.size=o.length,s.fileData=o,r(null,new rt(i,t,e,m.clone(s),o)))});break;default:return r(new l(c.EINVAL,"Invalid FileMode object."))}},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new l(c.EPERM,t);var r=this._index.getInode(t);if(null===r)throw l.ENOENT(t);if(!Qt(r))throw l.EISDIR(t);var i=r.getData();switch(e.pathExistsAction()){case p.THROW_EXCEPTION:case p.TRUNCATE_FILE:throw l.EEXIST(t);case p.NOP:if(i.fileData)return new rt(this,t,e,m.clone(i),i.fileData);var o=this._requestFileSync(t,"buffer");return i.size=o.length,i.fileData=o,new rt(this,t,e,m.clone(i),o);default:throw new l(c.EINVAL,"Invalid FileMode object.")}},e.prototype.readdir=function(t,e){try{e(null,this.readdirSync(t))}catch(t){e(t)}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(null===e)throw l.ENOENT(t);if(te(e))return e.getListing();throw l.ENOTDIR(t)},e.prototype.readFile=function(t,e,n,r){var i=r;this.open(t,n,420,function(t,n){if(t)return r(t);r=function(t,e){n.close(function(n){return t||(t=n),i(t,e)})};var o=n.getBuffer();null===e?r(t,Y(o)):function(t,e,n){try{n(null,t.toString(e))}catch(t){n(t)}}(o,e,r)})},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r.getBuffer();return null===e?Y(i):i.toString(e)}finally{r.closeSync()}},e.prototype._getHTTPPath=function(t){return"/"===t.charAt(0)&&(t=t.slice(1)),this.prefixUrl+t},e.prototype._requestFileAsync=function(t,e,n){this._requestFileAsyncInternal(this._getHTTPPath(t),e,n)},e.prototype._requestFileSync=function(t,e){return this._requestFileSyncInternal(this._getHTTPPath(t),e)},e.prototype._requestFileSizeAsync=function(t,e){this._requestFileSizeAsyncInternal(this._getHTTPPath(t),e)},e.prototype._requestFileSizeSync=function(t){return this._requestFileSizeSyncInternal(this._getHTTPPath(t))},e}(J);ee.Name="HTTPRequest",ee.Options={index:{type:["string","object"],optional:!0,description:"URL to a file index as a JSON file or the file index object itself, generated with the make_http_index script. Defaults to `index.json`."},baseUrl:{type:"string",optional:!0,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}};var ne=function(){};ne.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=ne.extendedChars.indexOf(t.charAt(r));o>-1&&(i=o+128)}e[i]=r}return n},ne.byte2str=function(t){for(var e=new Array(t.length),n=0;n<t.length;n++){var r=t[n];e[n]=r>127?ne.extendedChars[r-128]:String.fromCharCode(r)}return e.join("")},ne.byteLength=function(t){return t.length},ne.extendedChars=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];var re,ie=n(9).inflateRaw,oe={};function se(t,e){return new Date(1980+(e>>9),(e>>5&15)-1,31&e,t>>11,t>>5&63,31&t)}function ae(t,e,n,r){return 0===r?"":e?t.toString("utf8",n,n+r):ne.byte2str(t.slice(n,n+r))}!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"}(re||(re={}));var ce=function(t){if(this.data=t,67324752!==t.readUInt32LE(0))throw new l(c.EINVAL,"Invalid Zip file: Local file header has invalid signature: "+this.data.readUInt32LE(0))};ce.prototype.versionNeeded=function(){return this.data.readUInt16LE(4)},ce.prototype.flags=function(){return this.data.readUInt16LE(6)},ce.prototype.compressionMethod=function(){return this.data.readUInt16LE(8)},ce.prototype.lastModFileTime=function(){return se(this.data.readUInt16LE(10),this.data.readUInt16LE(12))},ce.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(10)},ce.prototype.crc32=function(){return this.data.readUInt32LE(14)},ce.prototype.fileNameLength=function(){return this.data.readUInt16LE(26)},ce.prototype.extraFieldLength=function(){return this.data.readUInt16LE(28)},ce.prototype.fileName=function(){return ae(this.data,this.useUTF8(),30,this.fileNameLength())},ce.prototype.extraField=function(){var t=30+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},ce.prototype.totalSize=function(){return 30+this.fileNameLength()+this.extraFieldLength()},ce.prototype.useUTF8=function(){return 2048==(2048&this.flags())};var ue=function(t,e,n){this.header=t,this.record=e,this.data=n};ue.prototype.decompress=function(){var t=this.header.compressionMethod(),e=oe[t];if(e)return e(this.data,this.record.compressedSize(),this.record.uncompressedSize(),this.record.flag());var n=re[t];throw n||(n="Unknown: "+t),new l(c.EINVAL,"Invalid compression method on file '"+this.header.fileName()+"': "+n)},ue.prototype.getHeader=function(){return this.header},ue.prototype.getRecord=function(){return this.record},ue.prototype.getRawData=function(){return this.data};var fe=function(t,e){if(this.zipData=t,this.data=e,33639248!==this.data.readUInt32LE(0))throw new l(c.EINVAL,"Invalid Zip file: Central directory record has invalid signature: "+this.data.readUInt32LE(0));this._filename=this.produceFilename()};fe.prototype.versionMadeBy=function(){return this.data.readUInt16LE(4)},fe.prototype.versionNeeded=function(){return this.data.readUInt16LE(6)},fe.prototype.flag=function(){return this.data.readUInt16LE(8)},fe.prototype.compressionMethod=function(){return this.data.readUInt16LE(10)},fe.prototype.lastModFileTime=function(){return se(this.data.readUInt16LE(12),this.data.readUInt16LE(14))},fe.prototype.rawLastModFileTime=function(){return this.data.readUInt32LE(12)},fe.prototype.crc32=function(){return this.data.readUInt32LE(16)},fe.prototype.compressedSize=function(){return this.data.readUInt32LE(20)},fe.prototype.uncompressedSize=function(){return this.data.readUInt32LE(24)},fe.prototype.fileNameLength=function(){return this.data.readUInt16LE(28)},fe.prototype.extraFieldLength=function(){return this.data.readUInt16LE(30)},fe.prototype.fileCommentLength=function(){return this.data.readUInt16LE(32)},fe.prototype.diskNumberStart=function(){return this.data.readUInt16LE(34)},fe.prototype.internalAttributes=function(){return this.data.readUInt16LE(36)},fe.prototype.externalAttributes=function(){return this.data.readUInt32LE(38)},fe.prototype.headerRelativeOffset=function(){return this.data.readUInt32LE(42)},fe.prototype.produceFilename=function(){return ae(this.data,this.useUTF8(),46,this.fileNameLength()).replace(/\\/g,"/")},fe.prototype.fileName=function(){return this._filename},fe.prototype.rawFileName=function(){return this.data.slice(46,46+this.fileNameLength())},fe.prototype.extraField=function(){var t=44+this.fileNameLength();return this.data.slice(t,t+this.extraFieldLength())},fe.prototype.fileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return ae(this.data,this.useUTF8(),t,this.fileCommentLength())},fe.prototype.rawFileComment=function(){var t=46+this.fileNameLength()+this.extraFieldLength();return this.data.slice(t,t+this.fileCommentLength())},fe.prototype.totalSize=function(){return 46+this.fileNameLength()+this.extraFieldLength()+this.fileCommentLength()},fe.prototype.isDirectory=function(){var t=this.fileName();return!!(16&this.externalAttributes())||"/"===t.charAt(t.length-1)},fe.prototype.isFile=function(){return!this.isDirectory()},fe.prototype.useUTF8=function(){return 2048==(2048&this.flag())},fe.prototype.isEncrypted=function(){return 1==(1&this.flag())},fe.prototype.getFileData=function(){var t=this.headerRelativeOffset(),e=new ce(this.zipData.slice(t));return new ue(e,this,this.zipData.slice(t+e.totalSize()))},fe.prototype.getData=function(){return this.getFileData().decompress()},fe.prototype.getRawData=function(){return this.getFileData().getRawData()},fe.prototype.getStats=function(){return new m(y.FILE,this.uncompressedSize(),365,Date.now(),this.lastModFileTime().getTime())};var he=function(t){if(this.data=t,101010256!==this.data.readUInt32LE(0))throw new l(c.EINVAL,"Invalid Zip file: End of central directory record has invalid signature: "+this.data.readUInt32LE(0))};he.prototype.diskNumber=function(){return this.data.readUInt16LE(4)},he.prototype.cdDiskNumber=function(){return this.data.readUInt16LE(6)},he.prototype.cdDiskEntryCount=function(){return this.data.readUInt16LE(8)},he.prototype.cdTotalEntryCount=function(){return this.data.readUInt16LE(10)},he.prototype.cdSize=function(){return this.data.readUInt32LE(12)},he.prototype.cdOffset=function(){return this.data.readUInt32LE(16)},he.prototype.cdZipCommentLength=function(){return this.data.readUInt16LE(20)},he.prototype.cdZipComment=function(){return ae(this.data,!0,22,this.cdZipCommentLength())},he.prototype.rawCdZipComment=function(){return this.data.slice(22,22+this.cdZipCommentLength())};var pe=function(t){function e(e,n){void 0===n&&(n=""),t.call(this),this.name=n,this._index=new Jt,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){oe[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 he(t.slice(t.length-n));throw new l(c.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 l(c.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 Gt(t)):e.addPathFast("/"+n,new Kt(t))},e._computeIndex=function(t,n){try{var r=new Jt,i=e._getEOCD(t);if(i.diskNumber()!==i.cdDiskNumber())return n(new l(c.EINVAL,"ZipFS does not support spanned zip files."));var o=i.cdOffset();if(4294967295===o)return n(new l(c.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 c=0;c++<200&&r<i;){var u=new fe(t,t.slice(r));e._addToIndex(u,n),r+=u.totalSize(),s.push(u)}k(function(){e._computeIndexResponsiveTrampoline(t,n,r,i,o,s,a)})}else o(null,new function(t,e,n,r){this.index=t,this.directoryEntries=e,this.eocd=n,this.data=r}(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 l.ENOENT(t);if(Qt(e))return e.getData();if(te(e))return e.getData();throw l.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,r=this._index.getInode(t);if(null===r)throw l.ENOENT(t);if(Qt(r))n=r.getData().getStats();else{if(!te(r))throw new l(c.EINVAL,"Invalid inode.");n=r.getStats()}return n},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new l(c.EPERM,t);var r=this._index.getInode(t);if(!r)throw l.ENOENT(t);if(!Qt(r))throw l.EISDIR(t);var i=r.getData(),o=i.getStats();switch(e.pathExistsAction()){case p.THROW_EXCEPTION:case p.TRUNCATE_FILE:throw l.EEXIST(t);case p.NOP:return new rt(this,t,e,o,i.getData());default:throw new l(c.EINVAL,"Invalid FileMode object.")}},e.prototype.readdirSync=function(t){var e=this._index.getInode(t);if(e){if(te(e))return e.getListing();throw l.ENOTDIR(t)}throw l.ENOENT(t)},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r.getBuffer();return null===e?Y(i):i.toString(e)}finally{r.closeSync()}},e}(K);pe.Name="ZipFS",pe.Options={zipData:{type:"object",description:"The zip file as a Buffer object.",validator:q},name:{type:"string",optional:!0,description:"The name of the zip file (optional)."}},pe.CompressionMethod=re,pe.RegisterDecompressionMethod(re.DEFLATE,function(t,e,n){return H(ie(t.slice(0,e),{chunkSize:n}))}),pe.RegisterDecompressionMethod(re.STORED,function(t,e,n){return Y(t,0,n)});function le(t,e,n){return t.toString("ascii",e,e+n).trim()}function de(t,e,n){if(1===n)return String.fromCharCode(t[e]);for(var r=Math.floor(n/2),i=new Array(r),o=0;o<r;o++){var s=e+(o<<1);i[o]=String.fromCharCode(t[s+1]|t[s]<<8)}return i.join("")}function ye(t,e){var n=parseInt(le(t,e,4),10),r=parseInt(le(t,e+4,2),10),i=parseInt(le(t,e+6,2),10),o=parseInt(le(t,e+8,2),10),s=parseInt(le(t,e+10,2),10),a=parseInt(le(t,e+12,2),10),c=parseInt(le(t,e+14,2),10);return new Date(n,r,i,o,s,a,100*c)}function ge(t,e){var n=t[e],r=t[e+1],i=t[e+2],o=t[e+3],s=t[e+4],a=t[e+5];return new Date(n,r-1,i,o,s,a)}function me(t,e){var n=t.slice(e),r=new Oe(n);switch(r.signatureWord()){case 17221:return new Ne(n);case 20548:return new Fe(n);case 21328:return new Te(n);case 21332:return new Le(n);case 17746:return new xe(n);case 17747:return new De(n);case 20568:return new Ae(n);case 20558:return new Ue(n);case 21324:return new Pe(n);case 20045:return new Ce(n);case 17228:return new Me(n);case 20556:return new ze(n);case 21061:return new je(n);case 21574:return new He(n);case 21318:return new Ze(n);case 21074:return new Re(n);default:return r}}function we(t,e,n,r){n-=4;for(var i=new Array;e<n;){var o=me(t,e),s=o.length();if(0===s)return i;if(e+=s,o instanceof Le)break;o instanceof Ne?i=i.concat(o.getEntries(r)):i.push(o)}return i}var _e=function(t){this._data=t};_e.prototype.type=function(){return this._data[0]},_e.prototype.standardIdentifier=function(){return le(this._data,1,5)},_e.prototype.version=function(){return this._data[6]},_e.prototype.data=function(){return this._data.slice(7,2048)};var Ee=function(t){function e(e){t.call(this,e),this._root=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.systemIdentifier=function(){return this._getString32(8)},e.prototype.volumeIdentifier=function(){return this._getString32(40)},e.prototype.volumeSpaceSize=function(){return this._data.readUInt32LE(80)},e.prototype.volumeSetSize=function(){return this._data.readUInt16LE(120)},e.prototype.volumeSequenceNumber=function(){return this._data.readUInt16LE(124)},e.prototype.logicalBlockSize=function(){return this._data.readUInt16LE(128)},e.prototype.pathTableSize=function(){return this._data.readUInt32LE(132)},e.prototype.locationOfTypeLPathTable=function(){return this._data.readUInt32LE(140)},e.prototype.locationOfOptionalTypeLPathTable=function(){return this._data.readUInt32LE(144)},e.prototype.locationOfTypeMPathTable=function(){return this._data.readUInt32BE(148)},e.prototype.locationOfOptionalTypeMPathTable=function(){return this._data.readUInt32BE(152)},e.prototype.rootDirectoryEntry=function(t){return null===this._root&&(this._root=this._constructRootDirectoryRecord(this._data.slice(156)),this._root.rootCheckForRockRidge(t)),this._root},e.prototype.volumeSetIdentifier=function(){return this._getString(190,128)},e.prototype.publisherIdentifier=function(){return this._getString(318,128)},e.prototype.dataPreparerIdentifier=function(){return this._getString(446,128)},e.prototype.applicationIdentifier=function(){return this._getString(574,128)},e.prototype.copyrightFileIdentifier=function(){return this._getString(702,38)},e.prototype.abstractFileIdentifier=function(){return this._getString(740,36)},e.prototype.bibliographicFileIdentifier=function(){return this._getString(776,37)},e.prototype.volumeCreationDate=function(){return ye(this._data,813)},e.prototype.volumeModificationDate=function(){return ye(this._data,830)},e.prototype.volumeExpirationDate=function(){return ye(this._data,847)},e.prototype.volumeEffectiveDate=function(){return ye(this._data,864)},e.prototype.fileStructureVersion=function(){return this._data[881]},e.prototype.applicationUsed=function(){return this._data.slice(883,1395)},e.prototype.reserved=function(){return this._data.slice(1395,2048)},e.prototype._getString32=function(t){return this._getString(t,32)},e}(_e),ve=function(t){function e(e){if(t.call(this,e),1!==this.type())throw new l(c.EIO,"Invalid primary volume descriptor.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.name=function(){return"ISO9660"},e.prototype._constructRootDirectoryRecord=function(t){return new Ie(t,-1)},e.prototype._getString=function(t,e){return this._getString(t,e)},e}(Ee),Se=function(t){function e(e){if(t.call(this,e),2!==this.type())throw new l(c.EIO,"Invalid supplementary volume descriptor.");var n=this.escapeSequence(),r=n[2];if(37!==n[0]||47!==n[1]||64!==r&&67!==r&&69!==r)throw new l(c.EIO,"Unrecognized escape sequence for SupplementaryVolumeDescriptor: "+n.toString())}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.name=function(){return"Joliet"},e.prototype.escapeSequence=function(){return this._data.slice(88,120)},e.prototype._constructRootDirectoryRecord=function(t){return new ke(t,-1)},e.prototype._getString=function(t,e){return de(this._data,t,e)},e}(Ee),be=function(t,e){this._suEntries=null,this._fileOrDir=null,this._data=t,this._rockRidgeOffset=e};be.prototype.hasRockRidge=function(){return this._rockRidgeOffset>-1},be.prototype.getRockRidgeOffset=function(){return this._rockRidgeOffset},be.prototype.rootCheckForRockRidge=function(t){var e=this.getDirectory(t);this._rockRidgeOffset=e.getDotEntry(t)._getRockRidgeOffset(t),this._rockRidgeOffset>-1&&(this._fileOrDir=null)},be.prototype.length=function(){return this._data[0]},be.prototype.extendedAttributeRecordLength=function(){return this._data[1]},be.prototype.lba=function(){return 2048*this._data.readUInt32LE(2)},be.prototype.dataLength=function(){return this._data.readUInt32LE(10)},be.prototype.recordingDate=function(){return ge(this._data,18)},be.prototype.fileFlags=function(){return this._data[25]},be.prototype.fileUnitSize=function(){return this._data[26]},be.prototype.interleaveGapSize=function(){return this._data[27]},be.prototype.volumeSequenceNumber=function(){return this._data.readUInt16LE(28)},be.prototype.identifier=function(){return this._getString(33,this._data[32])},be.prototype.fileName=function(t){if(this.hasRockRidge()){var e=this._rockRidgeFilename(t);if(null!==e)return e}var n=this.identifier();if(this.isDirectory(t))return n;var r=n.indexOf(";");return-1===r?n:"."===n[r-1]?n.slice(0,r-1):n.slice(0,r)},be.prototype.isDirectory=function(t){var e=!!(2&this.fileFlags());return!e&&this.hasRockRidge()&&(e=this.getSUEntries(t).filter(function(t){return t instanceof Me}).length>0),e},be.prototype.isSymlink=function(t){return this.hasRockRidge()&&this.getSUEntries(t).filter(function(t){return t instanceof Pe}).length>0},be.prototype.getSymlinkPath=function(t){for(var e="",n=this.getSUEntries(t),r=this._getGetString(),i=0,o=n;i<o.length;i+=1){var s=o[i];if(s instanceof Pe){for(var a=0,c=s.componentRecords();a<c.length;a+=1){var u=c[a],f=u.flags();2&f?e+="./":4&f?e+="../":8&f?e+="/":(e+=u.content(r),1&f||(e+="/"))}if(!s.continueFlag())break}}return e.length>1&&"/"===e[e.length-1]?e.slice(0,e.length-1):e},be.prototype.getFile=function(t){if(this.isDirectory(t))throw new Error("Tried to get a File from a directory.");return null===this._fileOrDir&&(this._fileOrDir=t.slice(this.lba(),this.lba()+this.dataLength())),this._fileOrDir},be.prototype.getDirectory=function(t){if(!this.isDirectory(t))throw new Error("Tried to get a Directory from a file.");return null===this._fileOrDir&&(this._fileOrDir=this._constructDirectory(t)),this._fileOrDir},be.prototype.getSUEntries=function(t){return this._suEntries||this._constructSUEntries(t),this._suEntries},be.prototype._rockRidgeFilename=function(t){var e=this.getSUEntries(t).filter(function(t){return t instanceof Ce});if(0===e.length||6&e[0].flags())return null;for(var n="",r=this._getGetString(),i=0,o=e;i<o.length;i+=1){var s=o[i];if(n+=s.name(r),!(1&s.flags()))break}return n},be.prototype._constructSUEntries=function(t){var e=33+this._data[32];e%2==1&&e++,e+=this._rockRidgeOffset,this._suEntries=we(this._data,e,this.length(),t)},be.prototype._getRockRidgeOffset=function(t){this._rockRidgeOffset=0;var e=this.getSUEntries(t);if(e.length>0){var n=e[0];if(n instanceof Te&&n.checkBytesPass())for(var r=1;r<e.length;r++){var i=e[r];if(i instanceof Re||i instanceof xe&&"IEEE_P1282"===i.extensionIdentifier())return n.bytesSkipped()}}return this._rockRidgeOffset=-1,-1};var Ie=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._getString=function(t,e){return le(this._data,t,e)},e.prototype._constructDirectory=function(t){return new Ye(this,t)},e.prototype._getGetString=function(){return le},e}(be),ke=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._getString=function(t,e){return de(this._data,t,e)},e.prototype._constructDirectory=function(t){return new We(this,t)},e.prototype._getGetString=function(){return de},e}(be),Oe=function(t){this._data=t};Oe.prototype.signatureWord=function(){return this._data.readUInt16BE(0)},Oe.prototype.signatureWordString=function(){return le(this._data,0,2)},Oe.prototype.length=function(){return this._data[2]},Oe.prototype.suVersion=function(){return this._data[3]};var Ne=function(t){function e(e){t.call(this,e),this._entries=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.continuationLba=function(){return this._data.readUInt32LE(4)},e.prototype.continuationLbaOffset=function(){return this._data.readUInt32LE(12)},e.prototype.continuationLength=function(){return this._data.readUInt32LE(20)},e.prototype.getEntries=function(t){if(!this._entries){var e=2048*this.continuationLba()+this.continuationLbaOffset();this._entries=we(t,e,this.continuationLength(),t)}return this._entries},e}(Oe),Fe=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oe),Te=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.checkBytesPass=function(){return 190===this._data[4]&&239===this._data[5]},e.prototype.bytesSkipped=function(){return this._data[6]},e}(Oe),Le=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oe),xe=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.identifierLength=function(){return this._data[4]},e.prototype.descriptorLength=function(){return this._data[5]},e.prototype.sourceLength=function(){return this._data[6]},e.prototype.extensionVersion=function(){return this._data[7]},e.prototype.extensionIdentifier=function(){return le(this._data,8,this.identifierLength())},e.prototype.extensionDescriptor=function(){return le(this._data,8+this.identifierLength(),this.descriptorLength())},e.prototype.extensionSource=function(){return le(this._data,8+this.identifierLength()+this.descriptorLength(),this.sourceLength())},e}(Oe),De=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.extensionSequence=function(){return this._data[4]},e}(Oe),Re=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oe),Ae=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.mode=function(){return this._data.readUInt32LE(4)},e.prototype.fileLinks=function(){return this._data.readUInt32LE(12)},e.prototype.uid=function(){return this._data.readUInt32LE(20)},e.prototype.gid=function(){return this._data.readUInt32LE(28)},e.prototype.inode=function(){return this._data.readUInt32LE(36)},e}(Oe),Ue=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.devTHigh=function(){return this._data.readUInt32LE(4)},e.prototype.devTLow=function(){return this._data.readUInt32LE(12)},e}(Oe),Pe=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flags=function(){return this._data[4]},e.prototype.continueFlag=function(){return 1&this.flags()},e.prototype.componentRecords=function(){for(var t=new Array,e=5;e<this.length();){var n=new Be(this._data.slice(e));t.push(n),e+=n.length()}return t},e}(Oe),Be=function(t){this._data=t};Be.prototype.flags=function(){return this._data[0]},Be.prototype.length=function(){return 2+this.componentLength()},Be.prototype.componentLength=function(){return this._data[1]},Be.prototype.content=function(t){return t(this._data,2,this.componentLength())};var Ce=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flags=function(){return this._data[4]},e.prototype.name=function(t){return t(this._data,5,this.length()-5)},e}(Oe),Me=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.childDirectoryLba=function(){return this._data.readUInt32LE(4)},e}(Oe),ze=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.parentDirectoryLba=function(){return this._data.readUInt32LE(4)},e}(Oe),je=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Oe),He=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flags=function(){return this._data[4]},e.prototype.creation=function(){return 1&this.flags()?this._longFormDates()?ye(this._data,5):ge(this._data,5):null},e.prototype.modify=function(){if(2&this.flags()){var t=1&this.flags()?1:0;return this._longFormDates()?ye(this._data,5+17*t):ge(this._data,5+7*t)}return null},e.prototype.access=function(){if(4&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,this._longFormDates()?ye(this._data,5+17*t):ge(this._data,5+7*t)}return null},e.prototype.backup=function(){if(16&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,t+=4&this.flags()?1:0,this._longFormDates()?ye(this._data,5+17*t):ge(this._data,5+7*t)}return null},e.prototype.expiration=function(){if(32&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,t+=4&this.flags()?1:0,t+=16&this.flags()?1:0,this._longFormDates()?ye(this._data,5+17*t):ge(this._data,5+7*t)}return null},e.prototype.effective=function(){if(64&this.flags()){var t=1&this.flags()?1:0;return t+=2&this.flags()?1:0,t+=4&this.flags()?1:0,t+=16&this.flags()?1:0,t+=32&this.flags()?1:0,this._longFormDates()?ye(this._data,5+17*t):ge(this._data,5+7*t)}return null},e.prototype._longFormDates=function(){return!!this.flags()},e}(Oe),Ze=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.virtualSizeHigh=function(){return this._data.readUInt32LE(4)},e.prototype.virtualSizeLow=function(){return this._data.readUInt32LE(12)},e.prototype.tableDepth=function(){return this._data[20]},e}(Oe),Ve=function(t,e){this._fileList=[],this._fileMap={},this._record=t;var n=t.lba(),r=n+t.dataLength();2&t.fileFlags()||(n=2048*t.getSUEntries(e).filter(function(t){return t instanceof Me})[0].childDirectoryLba(),r=1/0);for(;n<r;){if(0!==e[n]){var i=this._constructDirectoryRecord(e.slice(n)),o=i.fileName(e);"\0"!==o&&""!==o?i.hasRockRidge()&&0!==i.getSUEntries(e).filter(function(t){return t instanceof je}).length||(this._fileMap[o]=i,this._fileList.push(o)):r===1/0&&(r=n+i.dataLength()),n+=i.length()}else n++}};Ve.prototype.getRecord=function(t){return this._fileMap[t]},Ve.prototype.getFileList=function(){return this._fileList},Ve.prototype.getDotEntry=function(t){return this._constructDirectoryRecord(t.slice(this._record.lba()))};var Ye=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._constructDirectoryRecord=function(t){return new Ie(t,this._record.getRockRidgeOffset())},e}(Ve),We=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._constructDirectoryRecord=function(t){return new ke(t,this._record.getRockRidgeOffset())},e}(Ve),Xe=function(t){function e(e,n){var r=this;void 0===n&&(n=""),t.call(this),this._data=e;for(var i=!1,o=32768,s=new Array;!i;){var a=e.slice(o);switch(new _e(a).type()){case 1:s.push(new ve(a));break;case 2:s.push(new Se(a));break;case 255:i=!0}o+=2048}if(0===s.length)throw new l(c.EIO,"Unable to find a suitable volume descriptor.");s.forEach(function(t){r._pvd&&2===r._pvd.type()||(r._pvd=t)}),this._root=this._pvd.rootDirectoryEntry(e),this._name=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.Create=function(t,n){try{n(null,new e(t.data,t.name))}catch(t){n(t)}},e.isAvailable=function(){return!0},e.prototype.getName=function(){var t="IsoFS"+this._name+(this._pvd?"-"+this._pvd.name():"");return this._root&&this._root.hasRockRidge()&&(t+="-RockRidge"),t},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._getDirectoryRecord(t);if(null===n)throw l.ENOENT(t);return this._getStats(t,n)},e.prototype.openSync=function(t,e,n){if(e.isWriteable())throw new l(c.EPERM,t);var r=this._getDirectoryRecord(t);if(!r)throw l.ENOENT(t);if(r.isSymlink(this._data))return this.openSync(f.resolve(t,r.getSymlinkPath(this._data)),e,n);if(r.isDirectory(this._data))throw l.EISDIR(t);var i=r.getFile(this._data),o=this._getStats(t,r);switch(e.pathExistsAction()){case p.THROW_EXCEPTION:case p.TRUNCATE_FILE:throw l.EEXIST(t);case p.NOP:return new rt(this,t,e,o,i);default:throw new l(c.EINVAL,"Invalid FileMode object.")}},e.prototype.readdirSync=function(t){var e=this._getDirectoryRecord(t);if(e){if(e.isDirectory(this._data))return e.getDirectory(this._data).getFileList().slice(0);throw l.ENOTDIR(t)}throw l.ENOENT(t)},e.prototype.readFileSync=function(t,e,n){var r=this.openSync(t,n,420);try{var i=r.getBuffer();return null===e?Y(i):i.toString(e)}finally{r.closeSync()}},e.prototype._getDirectoryRecord=function(t){if("/"===t)return this._root;for(var e=t.split("/").slice(1),n=this._root,r=0,i=e;r<i.length;r+=1){var o=i[r];if(!n.isDirectory(this._data))return null;if(!(n=n.getDirectory(this._data).getRecord(o)))return null}return n},e.prototype._getStats=function(t,e){if(e.isSymlink(this._data)){var n=f.resolve(t,e.getSymlinkPath(this._data)),r=this._getDirectoryRecord(n);return r?this._getStats(n,r):null}var i=e.dataLength(),o=365,s=e.recordingDate().getTime(),a=s,c=s,u=s;if(e.hasRockRidge())for(var h=0,p=e.getSUEntries(this._data);h<p.length;h+=1){var l=p[h];if(l instanceof Ae)o=l.mode();else if(l instanceof He){var d=l.flags();4&d&&(a=l.access().getTime()),2&d&&(c=l.modify().getTime()),1&d&&(u=l.creation().getTime())}}return o&=365,new m(e.isDirectory(this._data)?y.DIRECTORY:y.FILE,i,o,a,c,u)},e}(K);Xe.Name="IsoFS",Xe.Options={data:{type:"object",description:"The ISO file in a buffer",validator:q}};var qe={Emscripten:et,FileSystemAccess:st,InMemory:Et,IndexedDB:Nt,IsoFS:Xe,MountableFileSystem:Ft,OverlayFS:Ht,HTTPRequest:ee,ZipFS:pe};function $e(t){switch(t){case"fs":return P;case"path":return f;case"buffer":return u;case"process":return i;case"bfs_utils":return $;default:return qe[t]}}function Je(t){return P.initialize(t)}function Ke(t,e){var n=t.fs;if(!n)return e(new l(c.EPERM,'Missing "fs" property on configuration object.'));var r=t.options,i=0,o=!1;function s(){if(!o){o=!0;var t=qe[n];t?t.Create(r,e):e(new l(c.EPERM,"File system "+n+" is not available in BrowserFS."))}}if(null!==r&&"object"==typeof r){var a=!1;Object.keys(r).filter(function(t){return"fs"!==t}).forEach(function(t){var n=r[t];null!==n&&"object"==typeof n&&n.fs&&(i++,Ke(n,function(n,c){if(i--,n){if(o)return;o=!0,e(n)}else r[t]=c,0===i&&a&&s()}))}),a=!0}0===i&&s()}i.initializeTTYs&&i.initializeTTYs(),e.BFSRequire=$e,e.Errors=d,e.FileSystem=qe,e.configure=function(t,e){Ke(t,function(t,n){n?(Je(n),e()):e(t)})},e.getFileSystem=Ke,e.initialize=Je,e.install=function(e){e.Buffer=t,e.process=i;var n=e.require?e.require:null;e.require=function(t){var e=$e(t);return e||n.apply(null,Array.prototype.slice.call(arguments,0))}},e.registerFileSystem=function(t,e){qe[t]=e}}).call(this,n(4),n(7),n(2))},function(t,e,n){t.exports=n(1).Buffer},function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=u(t),s=r[0],a=r[1],c=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),f=0,h=a>0?s-4:s;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,c[f++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function h(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),i.push(f(r));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>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-u;else{if(o===c)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,r),o-=u}return(l?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-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*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?p/c:p*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*c-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,u+=i;u>0;t[n+l]=255&s,l+=d,s/=256,u-=8);t[n+l-d]|=128*y}},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,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(t){return r.exec(t).slice(1)};function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}e.resolve=function(){for(var e="",r=!1,i=arguments.length-1;i>=-1&&!r;i--){var s=i>=0?arguments[i]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,r="/"===s.charAt(0))}return e=n(o(e.split("/"),function(t){return!!t}),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),i="/"===s(t,-1);return(t=n(o(t.split("/"),function(t){return!!t}),!r).join("/"))||r||(t="."),t&&i&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),s=Math.min(i.length,o.length),a=s,c=0;c<s;c++)if(i[c]!==o[c]){a=c;break}var u=[];for(c=a;c<i.length;c++)u.push("..");return(u=u.concat(o.slice(a))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){var e=i(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},e.basename=function(t,e){var n=i(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){return i(t)[3]};var s="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(2))},function(t,e,n){"use strict";const r=n(10),i=n(15),o=n(16),s=n(17),a=n(18),c=n(19),u=Object.prototype.toString,{Z_NO_FLUSH:f,Z_FINISH:h,Z_OK:p,Z_STREAM_END:l,Z_NEED_DICT:d,Z_STREAM_ERROR:y,Z_DATA_ERROR:g,Z_MEM_ERROR:m}=n(0);function w(t){this.options=i.assign({chunkSize:65536,windowBits:15,to:""},t||{});const 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 a,this.strm.avail_out=0;let n=r.inflateInit2(this.strm,e.windowBits);if(n!==p)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=r.inflateSetDictionary(this.strm,e.dictionary))!==p))throw new Error(s[n])}function _(t,e){const n=new w(e);if(n.push(t),n.err)throw n.msg||s[n.err];return n.result}w.prototype.push=function(t,e){const n=this.strm,i=this.options.chunkSize,s=this.options.dictionary;let a,c,w;if(this.ended)return!1;for(c=e===~~e?e:!0===e?h:f,"[object ArrayBuffer]"===u.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(a=r.inflate(n,c))===d&&s&&((a=r.inflateSetDictionary(n,s))===p?a=r.inflate(n,c):a===g&&(a=d));n.avail_in>0&&a===l&&n.state.wrap>0&&0!==t[n.next_in];)r.inflateReset(n),a=r.inflate(n,c);switch(a){case y:case g:case d:case m:return this.onEnd(a),this.ended=!0,!1}if(w=n.avail_out,n.next_out&&(0===n.avail_out||a===l))if("string"===this.options.to){let t=o.utf8border(n.output,n.next_out),e=n.next_out-t,r=o.buf2string(n.output,t);n.next_out=e,n.avail_out=i-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==p||0!==w){if(a===l)return a=r.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},w.prototype.onData=function(t){this.chunks.push(t)},w.prototype.onEnd=function(t){t===p&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},t.exports.Inflate=w,t.exports.inflate=_,t.exports.inflateRaw=function(t,e){return(e=e||{}).raw=!0,_(t,e)},t.exports.ungzip=_,t.exports.constants=n(0)},function(t,e,n){"use strict";const r=n(11),i=n(12),o=n(13),s=n(14),{Z_FINISH:a,Z_BLOCK:c,Z_TREES:u,Z_OK:f,Z_STREAM_END:h,Z_NEED_DICT:p,Z_STREAM_ERROR:l,Z_DATA_ERROR:d,Z_MEM_ERROR:y,Z_BUF_ERROR:g,Z_DEFLATED:m}=n(0),w=16209,_=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);const E=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},v=t=>{if(E(t))return l;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,f},S=t=>{if(E(t))return l;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,v(t)},b=(t,e)=>{let n;if(E(t))return l;const r=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?l:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,S(t))},I=(t,e)=>{if(!t)return l;const n=new function(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0};t.state=n,n.strm=t,n.window=null,n.mode=16180;const r=b(t,e);return r!==f&&(t.state=null),r};let k,O,N=!0;const F=t=>{if(N){k=new Int32Array(512),O=new Int32Array(32);let e=0;for(;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(s(1,t.lens,0,288,k,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,O,0,t.work,{bits:5}),N=!1}t.lencode=k,t.lenbits=9,t.distcode=O,t.distbits=5},T=(t,e,n,r)=>{let i;const o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(e.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),o.window.set(e.subarray(n-r,n-r+i),o.wnext),(r-=i)?(o.window.set(e.subarray(n-r,n),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};t.exports.inflateReset=S,t.exports.inflateReset2=b,t.exports.inflateResetKeep=v,t.exports.inflateInit=(t=>I(t,15)),t.exports.inflateInit2=I,t.exports.inflate=((t,e)=>{let n,v,S,b,I,k,O,N,L,x,D,R,A,U,P,B,C,M,z,j,H,Z,V=0;const Y=new Uint8Array(4);let W,X;const q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(E(t)||!t.output||!t.input&&0!==t.avail_in)return l;16191===(n=t.state).mode&&(n.mode=16192),I=t.next_out,S=t.output,O=t.avail_out,b=t.next_in,v=t.input,k=t.avail_in,N=n.hold,L=n.bits,x=k,D=O,Z=f;t:for(;;)switch(n.mode){case 16180:if(0===n.wrap){n.mode=16192;break}for(;L<16;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(2&n.wrap&&35615===N){0===n.wbits&&(n.wbits=15),n.check=0,Y[0]=255&N,Y[1]=N>>>8&255,n.check=i(n.check,Y,2,0),N=0,L=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&N)<<8)+(N>>8))%31){t.msg="incorrect header check",n.mode=w;break}if((15&N)!==m){t.msg="unknown compression method",n.mode=w;break}if(L-=4,H=8+(15&(N>>>=4)),0===n.wbits&&(n.wbits=H),H>15||H>n.wbits){t.msg="invalid window size",n.mode=w;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=512&N?16189:16191,N=0,L=0;break;case 16181:for(;L<16;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(n.flags=N,(255&n.flags)!==m){t.msg="unknown compression method",n.mode=w;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=w;break}n.head&&(n.head.text=N>>8&1),512&n.flags&&4&n.wrap&&(Y[0]=255&N,Y[1]=N>>>8&255,n.check=i(n.check,Y,2,0)),N=0,L=0,n.mode=16182;case 16182:for(;L<32;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}n.head&&(n.head.time=N),512&n.flags&&4&n.wrap&&(Y[0]=255&N,Y[1]=N>>>8&255,Y[2]=N>>>16&255,Y[3]=N>>>24&255,n.check=i(n.check,Y,4,0)),N=0,L=0,n.mode=16183;case 16183:for(;L<16;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}n.head&&(n.head.xflags=255&N,n.head.os=N>>8),512&n.flags&&4&n.wrap&&(Y[0]=255&N,Y[1]=N>>>8&255,n.check=i(n.check,Y,2,0)),N=0,L=0,n.mode=16184;case 16184:if(1024&n.flags){for(;L<16;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}n.length=N,n.head&&(n.head.extra_len=N),512&n.flags&&4&n.wrap&&(Y[0]=255&N,Y[1]=N>>>8&255,n.check=i(n.check,Y,2,0)),N=0,L=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&((R=n.length)>k&&(R=k),R&&(n.head&&(H=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(v.subarray(b,b+R),H)),512&n.flags&&4&n.wrap&&(n.check=i(n.check,v,R,b)),k-=R,b+=R,n.length-=R),n.length))break t;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===k)break t;R=0;do{H=v[b+R++],n.head&&H&&n.length<65536&&(n.head.name+=String.fromCharCode(H))}while(H&&R<k);if(512&n.flags&&4&n.wrap&&(n.check=i(n.check,v,R,b)),k-=R,b+=R,H)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===k)break t;R=0;do{H=v[b+R++],n.head&&H&&n.length<65536&&(n.head.comment+=String.fromCharCode(H))}while(H&&R<k);if(512&n.flags&&4&n.wrap&&(n.check=i(n.check,v,R,b)),k-=R,b+=R,H)break t}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;L<16;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(4&n.wrap&&N!==(65535&n.check)){t.msg="header crc mismatch",n.mode=w;break}N=0,L=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=16191;break;case 16189:for(;L<32;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}t.adler=n.check=_(N),N=0,L=0,n.mode=16190;case 16190:if(0===n.havedict)return t.next_out=I,t.avail_out=O,t.next_in=b,t.avail_in=k,n.hold=N,n.bits=L,p;t.adler=n.check=1,n.mode=16191;case 16191:if(e===c||e===u)break t;case 16192:if(n.last){N>>>=7&L,L-=7&L,n.mode=16206;break}for(;L<3;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}switch(n.last=1&N,L-=1,3&(N>>>=1)){case 0:n.mode=16193;break;case 1:if(F(n),n.mode=16199,e===u){N>>>=2,L-=2;break t}break;case 2:n.mode=16196;break;case 3:t.msg="invalid block type",n.mode=w}N>>>=2,L-=2;break;case 16193:for(N>>>=7&L,L-=7&L;L<32;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if((65535&N)!=(N>>>16^65535)){t.msg="invalid stored block lengths",n.mode=w;break}if(n.length=65535&N,N=0,L=0,n.mode=16194,e===u)break t;case 16194:n.mode=16195;case 16195:if(R=n.length){if(R>k&&(R=k),R>O&&(R=O),0===R)break t;S.set(v.subarray(b,b+R),I),k-=R,b+=R,O-=R,I+=R,n.length-=R;break}n.mode=16191;break;case 16196:for(;L<14;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(n.nlen=257+(31&N),N>>>=5,L-=5,n.ndist=1+(31&N),N>>>=5,L-=5,n.ncode=4+(15&N),N>>>=4,L-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=w;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;L<3;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}n.lens[q[n.have++]]=7&N,N>>>=3,L-=3}for(;n.have<19;)n.lens[q[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,W={bits:n.lenbits},Z=s(0,n.lens,0,19,n.lencode,0,n.work,W),n.lenbits=W.bits,Z){t.msg="invalid code lengths set",n.mode=w;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;B=(V=n.lencode[N&(1<<n.lenbits)-1])>>>16&255,C=65535&V,!((P=V>>>24)<=L);){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(C<16)N>>>=P,L-=P,n.lens[n.have++]=C;else{if(16===C){for(X=P+2;L<X;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(N>>>=P,L-=P,0===n.have){t.msg="invalid bit length repeat",n.mode=w;break}H=n.lens[n.have-1],R=3+(3&N),N>>>=2,L-=2}else if(17===C){for(X=P+3;L<X;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}L-=P,H=0,R=3+(7&(N>>>=P)),N>>>=3,L-=3}else{for(X=P+7;L<X;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}L-=P,H=0,R=11+(127&(N>>>=P)),N>>>=7,L-=7}if(n.have+R>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=w;break}for(;R--;)n.lens[n.have++]=H}}if(n.mode===w)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=w;break}if(n.lenbits=9,W={bits:n.lenbits},Z=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,W),n.lenbits=W.bits,Z){t.msg="invalid literal/lengths set",n.mode=w;break}if(n.distbits=6,n.distcode=n.distdyn,W={bits:n.distbits},Z=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,W),n.distbits=W.bits,Z){t.msg="invalid distances set",n.mode=w;break}if(n.mode=16199,e===u)break t;case 16199:n.mode=16200;case 16200:if(k>=6&&O>=258){t.next_out=I,t.avail_out=O,t.next_in=b,t.avail_in=k,n.hold=N,n.bits=L,o(t,D),I=t.next_out,S=t.output,O=t.avail_out,b=t.next_in,v=t.input,k=t.avail_in,N=n.hold,L=n.bits,16191===n.mode&&(n.back=-1);break}for(n.back=0;B=(V=n.lencode[N&(1<<n.lenbits)-1])>>>16&255,C=65535&V,!((P=V>>>24)<=L);){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(B&&0==(240&B)){for(M=P,z=B,j=C;B=(V=n.lencode[j+((N&(1<<M+z)-1)>>M)])>>>16&255,C=65535&V,!(M+(P=V>>>24)<=L);){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}N>>>=M,L-=M,n.back+=M}if(N>>>=P,L-=P,n.back+=P,n.length=C,0===B){n.mode=16205;break}if(32&B){n.back=-1,n.mode=16191;break}if(64&B){t.msg="invalid literal/length code",n.mode=w;break}n.extra=15&B,n.mode=16201;case 16201:if(n.extra){for(X=n.extra;L<X;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}n.length+=N&(1<<n.extra)-1,N>>>=n.extra,L-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;B=(V=n.distcode[N&(1<<n.distbits)-1])>>>16&255,C=65535&V,!((P=V>>>24)<=L);){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(0==(240&B)){for(M=P,z=B,j=C;B=(V=n.distcode[j+((N&(1<<M+z)-1)>>M)])>>>16&255,C=65535&V,!(M+(P=V>>>24)<=L);){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}N>>>=M,L-=M,n.back+=M}if(N>>>=P,L-=P,n.back+=P,64&B){t.msg="invalid distance code",n.mode=w;break}n.offset=C,n.extra=15&B,n.mode=16203;case 16203:if(n.extra){for(X=n.extra;L<X;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}n.offset+=N&(1<<n.extra)-1,N>>>=n.extra,L-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=w;break}n.mode=16204;case 16204:if(0===O)break t;if(R=D-O,n.offset>R){if((R=n.offset-R)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=w;break}R>n.wnext?(R-=n.wnext,A=n.wsize-R):A=n.wnext-R,R>n.length&&(R=n.length),U=n.window}else U=S,A=I-n.offset,R=n.length;R>O&&(R=O),O-=R,n.length-=R;do{S[I++]=U[A++]}while(--R);0===n.length&&(n.mode=16200);break;case 16205:if(0===O)break t;S[I++]=n.length,O--,n.mode=16200;break;case 16206:if(n.wrap){for(;L<32;){if(0===k)break t;k--,N|=v[b++]<<L,L+=8}if(D-=O,t.total_out+=D,n.total+=D,4&n.wrap&&D&&(t.adler=n.check=n.flags?i(n.check,S,D,I-D):r(n.check,S,D,I-D)),D=O,4&n.wrap&&(n.flags?N:_(N))!==n.check){t.msg="incorrect data check",n.mode=w;break}N=0,L=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;L<32;){if(0===k)break t;k--,N+=v[b++]<<L,L+=8}if(4&n.wrap&&N!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=w;break}N=0,L=0}n.mode=16208;case 16208:Z=h;break t;case w:Z=d;break t;case 16210:return y;case 16211:default:return l}return t.next_out=I,t.avail_out=O,t.next_in=b,t.avail_in=k,n.hold=N,n.bits=L,(n.wsize||D!==t.avail_out&&n.mode<w&&(n.mode<16206||e!==a))&&T(t,t.output,t.next_out,D-t.avail_out)?(n.mode=16210,y):(x-=t.avail_in,D-=t.avail_out,t.total_in+=x,t.total_out+=D,n.total+=D,4&n.wrap&&D&&(t.adler=n.check=n.flags?i(n.check,S,D,t.next_out-D):r(n.check,S,D,t.next_out-D)),t.data_type=n.bits+(n.last?64:0)+(16191===n.mode?128:0)+(16199===n.mode||16194===n.mode?256:0),(0===x&&0===D||e===a)&&Z===f&&(Z=g),Z)}),t.exports.inflateEnd=(t=>{if(E(t))return l;let e=t.state;return e.window&&(e.window=null),t.state=null,f}),t.exports.inflateGetHeader=((t,e)=>{if(E(t))return l;const n=t.state;return 0==(2&n.wrap)?l:(n.head=e,e.done=!1,f)}),t.exports.inflateSetDictionary=((t,e)=>{const n=e.length;let i,o,s;return E(t)?l:0!==(i=t.state).wrap&&16190!==i.mode?l:16190===i.mode&&(o=r(o=1,e,n,0))!==i.check?d:(s=T(t,e,n,n))?(i.mode=16210,y):(i.havedict=1,f)}),t.exports.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";t.exports=((t,e,n,r)=>{let i=65535&t|0,o=t>>>16&65535|0,s=0;for(;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(i=i+e[r++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0})},function(t,e,n){"use strict";const r=new Uint32Array((()=>{let t,e=[];for(var 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=((t,e,n,i)=>{const o=r,s=i+n;t^=-1;for(let n=i;n<s;n++)t=t>>>8^o[255&(t^e[n])];return-1^t})},function(t,e,n){"use strict";t.exports=function(t,e){let n,r,i,o,s,a,c,u,f,h,p,l,d,y,g,m,w,_,E,v,S,b,I,k;const O=t.state;n=t.next_in,I=t.input,r=n+(t.avail_in-5),i=t.next_out,k=t.output,o=i-(e-t.avail_out),s=i+(t.avail_out-257),a=O.dmax,c=O.wsize,u=O.whave,f=O.wnext,h=O.window,p=O.hold,l=O.bits,d=O.lencode,y=O.distcode,g=(1<<O.lenbits)-1,m=(1<<O.distbits)-1;t:do{l<15&&(p+=I[n++]<<l,l+=8,p+=I[n++]<<l,l+=8),w=d[p&g];e:for(;;){if(p>>>=_=w>>>24,l-=_,0===(_=w>>>16&255))k[i++]=65535&w;else{if(!(16&_)){if(0==(64&_)){w=d[(65535&w)+(p&(1<<_)-1)];continue e}if(32&_){O.mode=16191;break t}t.msg="invalid literal/length code",O.mode=16209;break t}E=65535&w,(_&=15)&&(l<_&&(p+=I[n++]<<l,l+=8),E+=p&(1<<_)-1,p>>>=_,l-=_),l<15&&(p+=I[n++]<<l,l+=8,p+=I[n++]<<l,l+=8),w=y[p&m];n:for(;;){if(p>>>=_=w>>>24,l-=_,!(16&(_=w>>>16&255))){if(0==(64&_)){w=y[(65535&w)+(p&(1<<_)-1)];continue n}t.msg="invalid distance code",O.mode=16209;break t}if(v=65535&w,l<(_&=15)&&(p+=I[n++]<<l,(l+=8)<_&&(p+=I[n++]<<l,l+=8)),(v+=p&(1<<_)-1)>a){t.msg="invalid distance too far back",O.mode=16209;break t}if(p>>>=_,l-=_,v>(_=i-o)){if((_=v-_)>u&&O.sane){t.msg="invalid distance too far back",O.mode=16209;break t}if(S=0,b=h,0===f){if(S+=c-_,_<E){E-=_;do{k[i++]=h[S++]}while(--_);S=i-v,b=k}}else if(f<_){if(S+=c+f-_,(_-=f)<E){E-=_;do{k[i++]=h[S++]}while(--_);if(S=0,f<E){E-=_=f;do{k[i++]=h[S++]}while(--_);S=i-v,b=k}}}else if(S+=f-_,_<E){E-=_;do{k[i++]=h[S++]}while(--_);S=i-v,b=k}for(;E>2;)k[i++]=b[S++],k[i++]=b[S++],k[i++]=b[S++],E-=3;E&&(k[i++]=b[S++],E>1&&(k[i++]=b[S++]))}else{S=i-v;do{k[i++]=k[S++],k[i++]=k[S++],k[i++]=k[S++],E-=3}while(E>2);E&&(k[i++]=k[S++],E>1&&(k[i++]=k[S++]))}break}}break}}while(n<r&&i<s);n-=E=l>>3,p&=(1<<(l-=E<<3))-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=i<s?s-i+257:257-(i-s),O.hold=p,O.bits=l}},function(t,e,n){"use strict";const r=new Uint16Array([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]),i=new Uint8Array([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]),o=new Uint16Array([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]),s=new Uint8Array([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=((t,e,n,a,c,u,f,h)=>{const p=h.bits;let l,d,y,g,m,w,_=0,E=0,v=0,S=0,b=0,I=0,k=0,O=0,N=0,F=0,T=null;const L=new Uint16Array(16),x=new Uint16Array(16);let D,R,A,U=null;for(_=0;_<=15;_++)L[_]=0;for(E=0;E<a;E++)L[e[n+E]]++;for(b=p,S=15;S>=1&&0===L[S];S--);if(b>S&&(b=S),0===S)return c[u++]=20971520,c[u++]=20971520,h.bits=1,0;for(v=1;v<S&&0===L[v];v++);for(b<v&&(b=v),O=1,_=1;_<=15;_++)if(O<<=1,(O-=L[_])<0)return-1;if(O>0&&(0===t||1!==S))return-1;for(x[1]=0,_=1;_<15;_++)x[_+1]=x[_]+L[_];for(E=0;E<a;E++)0!==e[n+E]&&(f[x[e[n+E]]++]=E);if(0===t?(T=U=f,w=20):1===t?(T=r,U=i,w=257):(T=o,U=s,w=0),F=0,E=0,_=v,m=u,I=b,k=0,y=-1,g=(N=1<<b)-1,1===t&&N>852||2===t&&N>592)return 1;for(;;){D=_-k,f[E]+1<w?(R=0,A=f[E]):f[E]>=w?(R=U[f[E]-w],A=T[f[E]-w]):(R=96,A=0),l=1<<_-k,v=d=1<<I;do{c[m+(F>>k)+(d-=l)]=D<<24|R<<16|A|0}while(0!==d);for(l=1<<_-1;F&l;)l>>=1;if(0!==l?(F&=l-1,F+=l):F=0,E++,0==--L[_]){if(_===S)break;_=e[n+f[E]]}if(_>b&&(F&g)!==y){for(0===k&&(k=b),m+=v,O=1<<(I=_-k);I+k<S&&!((O-=L[I+k])<=0);)I++,O<<=1;if(N+=1<<I,1===t&&N>852||2===t&&N>592)return 1;c[y=F&g]=b<<24|I<<16|m-u|0}}return 0!==F&&(c[m+F]=_-k<<24|64<<16|0),h.bits=b,0})},function(t,e,n){"use strict";const r=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);t.exports.assign=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)r(n,e)&&(t[e]=n[e])}}return t},t.exports.flattenChunks=(t=>{let e=0;for(let n=0,r=t.length;n<r;n++)e+=t[n].length;const n=new Uint8Array(e);for(let e=0,r=0,i=t.length;e<i;e++){let i=t[e];n.set(i,r),r+=i.length}return n})},function(t,e,n){"use strict";let r=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){r=!1}const i=new Uint8Array(256);for(let t=0;t<256;t++)i[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;i[254]=i[254]=1,t.exports.string2buf=(t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,r,i,o,s=t.length,a=0;for(i=0;i<s;i++)55296==(64512&(n=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(r=t.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),o=0,i=0;o<a;i++)55296==(64512&(n=t.charCodeAt(i)))&&i+1<s&&56320==(64512&(r=t.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?e[o++]=n:n<2048?(e[o++]=192|n>>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e});t.exports.buf2string=((t,e)=>{const n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let o,s;const a=new Array(2*n);for(s=0,o=0;o<n;){let e=t[o++];if(e<128){a[s++]=e;continue}let r=i[e];if(r>4)a[s++]=65533,o+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&o<n;)e=e<<6|63&t[o++],r--;r>1?a[s++]=65533:e<65536?a[s++]=e:(e-=65536,a[s++]=55296|e>>10&1023,a[s++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&r)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n})(a,s)}),t.exports.utf8border=((t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0?e:0===n?e:n+i[t[n]]>e?n:e})},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";t.exports=function(){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}},function(t,e,n){"use strict";t.exports=function(){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}}])});
//# sourceMappingURL=browserfs.min.js.map