UNPKG

@exezt-/webamp-custom

Version:

Winamp 2 implemented in HTML5 and JavaScript

15 lines (13 loc) 702 kB
function e(e,A){return A.forEach((function(A){A&&"string"!=typeof A&&!Array.isArray(A)&&Object.keys(A).forEach((function(t){if("default"!==t&&!(t in e)){var n=Object.getOwnPropertyDescriptor(A,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:function(){return A[t]}})}}))})),Object.freeze(e)} /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function A(e,A){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&A.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)A.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}function t(e,A,t,n){return new(t||(t=Promise))((function(r,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function o(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var A;e.done?r(e.value):(A=e.value,A instanceof t?A:new t((function(e){e(A)}))).then(a,o)}s((n=n.apply(e,A||[])).next())}))}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){if(e.__esModule)return e;var A=e.default;if("function"==typeof A){var t=function e(){return this instanceof e?Reflect.construct(A,arguments,this.constructor):A.apply(this,arguments)};t.prototype=A.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach((function(A){var n=Object.getOwnPropertyDescriptor(e,A);Object.defineProperty(t,A,n.get?n:{enumerable:!0,get:function(){return e[A]}})})),t}var a={},o={},s="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},l=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,d=!1;function h(){d=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=0;A<64;++A)l[A]=e[A],u[e.charCodeAt(A)]=A;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63}function g(e,A,t){for(var n,r,i=[],a=A;a<t;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],i.push(l[(r=n)>>18&63]+l[r>>12&63]+l[r>>6&63]+l[63&r]);return i.join("")}function p(e){var A;d||h();for(var t=e.length,n=t%3,r="",i=[],a=16383,o=0,s=t-n;o<s;o+=a)i.push(g(e,o,o+a>s?s:o+a));return 1===n?(A=e[t-1],r+=l[A>>2],r+=l[A<<4&63],r+="=="):2===n&&(A=(e[t-2]<<8)+e[t-1],r+=l[A>>10],r+=l[A>>4&63],r+=l[A<<2&63],r+="="),i.push(r),i.join("")}function f(e,A,t,n,r){var i,a,o=8*r-n-1,s=(1<<o)-1,l=s>>1,u=-7,c=t?r-1:0,d=t?-1:1,h=e[A+c];for(c+=d,i=h&(1<<-u)-1,h>>=-u,u+=o;u>0;i=256*i+e[A+c],c+=d,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=n;u>0;a=256*a+e[A+c],c+=d,u-=8);if(0===i)i=1-l;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=l}return(h?-1:1)*a*Math.pow(2,i-n)}function m(e,A,t,n,r,i){var a,o,s,l=8*i-r-1,u=(1<<l)-1,c=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,g=n?1:-1,p=A<0||0===A&&1/A<0?1:0;for(A=Math.abs(A),isNaN(A)||A===1/0?(o=isNaN(A)?1:0,a=u):(a=Math.floor(Math.log(A)/Math.LN2),A*(s=Math.pow(2,-a))<1&&(a--,s*=2),(A+=a+c>=1?d/s:d*Math.pow(2,1-c))*s>=2&&(a++,s/=2),a+c>=u?(o=0,a=u):a+c>=1?(o=(A*s-1)*Math.pow(2,r),a+=c):(o=A*Math.pow(2,c-1)*Math.pow(2,r),a=0));r>=8;e[t+h]=255&o,h+=g,o/=256,r-=8);for(a=a<<r|o,l+=r;l>0;e[t+h]=255&a,h+=g,a/=256,l-=8);e[t+h-g]|=128*p}var w={}.toString,b=Array.isArray||function(e){return"[object Array]"==w.call(e)};function E(){return v.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(e,A){if(E()<A)throw new RangeError("Invalid typed array length");return v.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(A)).__proto__=v.prototype:(null===e&&(e=new v(A)),e.length=A),e}function v(e,A,t){if(!(v.TYPED_ARRAY_SUPPORT||this instanceof v))return new v(e,A,t);if("number"==typeof e){if("string"==typeof A)throw new Error("If encoding is specified then the first argument must be a string");return I(this,e)}return k(this,e,A,t)}function k(e,A,t,n){if("number"==typeof A)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&A instanceof ArrayBuffer?function(e,A,t,n){if(A.byteLength,t<0||A.byteLength<t)throw new RangeError("'offset' is out of bounds");if(A.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");A=void 0===t&&void 0===n?new Uint8Array(A):void 0===n?new Uint8Array(A,t):new Uint8Array(A,t,n);v.TYPED_ARRAY_SUPPORT?(e=A).__proto__=v.prototype:e=U(e,A);return e}(e,A,t,n):"string"==typeof A?function(e,A,t){"string"==typeof t&&""!==t||(t="utf8");if(!v.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|B(A,t);e=y(e,n);var r=e.write(A,t);r!==n&&(e=e.slice(0,r));return e}(e,A,t):function(e,A){if(C(A)){var t=0|x(A.length);return 0===(e=y(e,t)).length||A.copy(e,0,0,t),e}if(A){if("undefined"!=typeof ArrayBuffer&&A.buffer instanceof ArrayBuffer||"length"in A)return"number"!=typeof A.length||(n=A.length)!=n?y(e,0):U(e,A);if("Buffer"===A.type&&b(A.data))return U(e,A.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,A)}function S(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function I(e,A){if(S(A),e=y(e,A<0?0:0|x(A)),!v.TYPED_ARRAY_SUPPORT)for(var t=0;t<A;++t)e[t]=0;return e}function U(e,A){var t=A.length<0?0:0|x(A.length);e=y(e,t);for(var n=0;n<t;n+=1)e[n]=255&A[n];return e}function x(e){if(e>=E())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+E().toString(16)+" bytes");return 0|e}function C(e){return!(null==e||!e._isBuffer)}function B(e,A){if(C(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var t=e.length;if(0===t)return 0;for(var n=!1;;)switch(A){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return te(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return ne(e).length;default:if(n)return te(e).length;A=(""+A).toLowerCase(),n=!0}}function M(e,A,t){var n=!1;if((void 0===A||A<0)&&(A=0),A>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(A>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Y(this,A,t);case"utf8":case"utf-8":return z(this,A,t);case"ascii":return j(this,A,t);case"latin1":case"binary":return P(this,A,t);case"base64":return F(this,A,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,A,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function N(e,A,t){var n=e[A];e[A]=e[t],e[t]=n}function T(e,A,t,n,r){if(0===e.length)return-1;if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=r?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(r)return-1;t=e.length-1}else if(t<0){if(!r)return-1;t=0}if("string"==typeof A&&(A=v.from(A,n)),C(A))return 0===A.length?-1:O(e,A,t,n,r);if("number"==typeof A)return A&=255,v.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,A,t):Uint8Array.prototype.lastIndexOf.call(e,A,t):O(e,[A],t,n,r);throw new TypeError("val must be string, number or Buffer")}function O(e,A,t,n,r){var i,a=1,o=e.length,s=A.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||A.length<2)return-1;a=2,o/=2,s/=2,t/=2}function l(e,A){return 1===a?e[A]:e.readUInt16BE(A*a)}if(r){var u=-1;for(i=t;i<o;i++)if(l(e,i)===l(A,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===s)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(t+s>o&&(t=o-s),i=t;i>=0;i--){for(var c=!0,d=0;d<s;d++)if(l(e,i+d)!==l(A,d)){c=!1;break}if(c)return i}return-1}function Q(e,A,t,n){t=Number(t)||0;var r=e.length-t;n?(n=Number(n))>r&&(n=r):n=r;var i=A.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var o=parseInt(A.substr(2*a,2),16);if(isNaN(o))return a;e[t+a]=o}return a}function L(e,A,t,n){return re(te(A,e.length-t),e,t,n)}function D(e,A,t,n){return re(function(e){for(var A=[],t=0;t<e.length;++t)A.push(255&e.charCodeAt(t));return A}(A),e,t,n)}function R(e,A,t,n){return D(e,A,t,n)}function _(e,A,t,n){return re(ne(A),e,t,n)}function V(e,A,t,n){return re(function(e,A){for(var t,n,r,i=[],a=0;a<e.length&&!((A-=2)<0);++a)n=(t=e.charCodeAt(a))>>8,r=t%256,i.push(r),i.push(n);return i}(A,e.length-t),e,t,n)}function F(e,A,t){return 0===A&&t===e.length?p(e):p(e.slice(A,t))}function z(e,A,t){t=Math.min(e.length,t);for(var n=[],r=A;r<t;){var i,a,o,s,l=e[r],u=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c<=t)switch(c){case 1:l<128&&(u=l);break;case 2:128==(192&(i=e[r+1]))&&(s=(31&l)<<6|63&i)>127&&(u=s);break;case 3:i=e[r+1],a=e[r+2],128==(192&i)&&128==(192&a)&&(s=(15&l)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:i=e[r+1],a=e[r+2],o=e[r+3],128==(192&i)&&128==(192&a)&&128==(192&o)&&(s=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&o)>65535&&s<1114112&&(u=s)}null===u?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=c}return function(e){var A=e.length;if(A<=G)return String.fromCharCode.apply(String,e);var t="",n=0;for(;n<A;)t+=String.fromCharCode.apply(String,e.slice(n,n+=G));return t}(n)}v.TYPED_ARRAY_SUPPORT=void 0===s.TYPED_ARRAY_SUPPORT||s.TYPED_ARRAY_SUPPORT,E(),v.poolSize=8192,v._augment=function(e){return e.__proto__=v.prototype,e},v.from=function(e,A,t){return k(null,e,A,t)},v.TYPED_ARRAY_SUPPORT&&(v.prototype.__proto__=Uint8Array.prototype,v.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&v[Symbol.species]),v.alloc=function(e,A,t){return function(e,A,t,n){return S(A),A<=0?y(e,A):void 0!==t?"string"==typeof n?y(e,A).fill(t,n):y(e,A).fill(t):y(e,A)}(null,e,A,t)},v.allocUnsafe=function(e){return I(null,e)},v.allocUnsafeSlow=function(e){return I(null,e)},v.isBuffer=function(e){return null!=e&&(!!e._isBuffer||ie(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ie(e.slice(0,0))}(e))},v.compare=function(e,A){if(!C(e)||!C(A))throw new TypeError("Arguments must be Buffers");if(e===A)return 0;for(var t=e.length,n=A.length,r=0,i=Math.min(t,n);r<i;++r)if(e[r]!==A[r]){t=e[r],n=A[r];break}return t<n?-1:n<t?1:0},v.isEncoding=function(e){switch(String(e).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}},v.concat=function(e,A){if(!b(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return v.alloc(0);var t;if(void 0===A)for(A=0,t=0;t<e.length;++t)A+=e[t].length;var n=v.allocUnsafe(A),r=0;for(t=0;t<e.length;++t){var i=e[t];if(!C(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,r),r+=i.length}return n},v.byteLength=B,v.prototype._isBuffer=!0,v.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var A=0;A<e;A+=2)N(this,A,A+1);return this},v.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var A=0;A<e;A+=4)N(this,A,A+3),N(this,A+1,A+2);return this},v.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var A=0;A<e;A+=8)N(this,A,A+7),N(this,A+1,A+6),N(this,A+2,A+5),N(this,A+3,A+4);return this},v.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?z(this,0,e):M.apply(this,arguments)},v.prototype.equals=function(e){if(!C(e))throw new TypeError("Argument must be a Buffer");return this===e||0===v.compare(this,e)},v.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},v.prototype.compare=function(e,A,t,n,r){if(!C(e))throw new TypeError("Argument must be a Buffer");if(void 0===A&&(A=0),void 0===t&&(t=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),A<0||t>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&A>=t)return 0;if(n>=r)return-1;if(A>=t)return 1;if(this===e)return 0;for(var i=(r>>>=0)-(n>>>=0),a=(t>>>=0)-(A>>>=0),o=Math.min(i,a),s=this.slice(n,r),l=e.slice(A,t),u=0;u<o;++u)if(s[u]!==l[u]){i=s[u],a=l[u];break}return i<a?-1:a<i?1:0},v.prototype.includes=function(e,A,t){return-1!==this.indexOf(e,A,t)},v.prototype.indexOf=function(e,A,t){return T(this,e,A,t,!0)},v.prototype.lastIndexOf=function(e,A,t){return T(this,e,A,t,!1)},v.prototype.write=function(e,A,t,n){if(void 0===A)n="utf8",t=this.length,A=0;else if(void 0===t&&"string"==typeof A)n=A,t=this.length,A=0;else{if(!isFinite(A))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");A|=0,isFinite(t)?(t|=0,void 0===n&&(n="utf8")):(n=t,t=void 0)}var r=this.length-A;if((void 0===t||t>r)&&(t=r),e.length>0&&(t<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return Q(this,e,A,t);case"utf8":case"utf-8":return L(this,e,A,t);case"ascii":return D(this,e,A,t);case"latin1":case"binary":return R(this,e,A,t);case"base64":return _(this,e,A,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,e,A,t);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var G=4096;function j(e,A,t){var n="";t=Math.min(e.length,t);for(var r=A;r<t;++r)n+=String.fromCharCode(127&e[r]);return n}function P(e,A,t){var n="";t=Math.min(e.length,t);for(var r=A;r<t;++r)n+=String.fromCharCode(e[r]);return n}function Y(e,A,t){var n=e.length;(!A||A<0)&&(A=0),(!t||t<0||t>n)&&(t=n);for(var r="",i=A;i<t;++i)r+=Ae(e[i]);return r}function K(e,A,t){for(var n=e.slice(A,t),r="",i=0;i<n.length;i+=2)r+=String.fromCharCode(n[i]+256*n[i+1]);return r}function H(e,A,t){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+A>t)throw new RangeError("Trying to access beyond buffer length")}function J(e,A,t,n,r,i){if(!C(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(A>r||A<i)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}function q(e,A,t,n){A<0&&(A=65535+A+1);for(var r=0,i=Math.min(e.length-t,2);r<i;++r)e[t+r]=(A&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function W(e,A,t,n){A<0&&(A=4294967295+A+1);for(var r=0,i=Math.min(e.length-t,4);r<i;++r)e[t+r]=A>>>8*(n?r:3-r)&255}function Z(e,A,t,n,r,i){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function X(e,A,t,n,r){return r||Z(e,0,t,4),m(e,A,t,n,23,4),t+4}function $(e,A,t,n,r){return r||Z(e,0,t,8),m(e,A,t,n,52,8),t+8}v.prototype.slice=function(e,A){var t,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(A=void 0===A?n:~~A)<0?(A+=n)<0&&(A=0):A>n&&(A=n),A<e&&(A=e),v.TYPED_ARRAY_SUPPORT)(t=this.subarray(e,A)).__proto__=v.prototype;else{var r=A-e;t=new v(r,void 0);for(var i=0;i<r;++i)t[i]=this[i+e]}return t},v.prototype.readUIntLE=function(e,A,t){e|=0,A|=0,t||H(e,A,this.length);for(var n=this[e],r=1,i=0;++i<A&&(r*=256);)n+=this[e+i]*r;return n},v.prototype.readUIntBE=function(e,A,t){e|=0,A|=0,t||H(e,A,this.length);for(var n=this[e+--A],r=1;A>0&&(r*=256);)n+=this[e+--A]*r;return n},v.prototype.readUInt8=function(e,A){return A||H(e,1,this.length),this[e]},v.prototype.readUInt16LE=function(e,A){return A||H(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUInt16BE=function(e,A){return A||H(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUInt32LE=function(e,A){return A||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUInt32BE=function(e,A){return A||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readIntLE=function(e,A,t){e|=0,A|=0,t||H(e,A,this.length);for(var n=this[e],r=1,i=0;++i<A&&(r*=256);)n+=this[e+i]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*A)),n},v.prototype.readIntBE=function(e,A,t){e|=0,A|=0,t||H(e,A,this.length);for(var n=A,r=1,i=this[e+--n];n>0&&(r*=256);)i+=this[e+--n]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*A)),i},v.prototype.readInt8=function(e,A){return A||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,A){A||H(e,2,this.length);var t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},v.prototype.readInt16BE=function(e,A){A||H(e,2,this.length);var t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},v.prototype.readInt32LE=function(e,A){return A||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,A){return A||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readFloatLE=function(e,A){return A||H(e,4,this.length),f(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,A){return A||H(e,4,this.length),f(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,A){return A||H(e,8,this.length),f(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,A){return A||H(e,8,this.length),f(this,e,!1,52,8)},v.prototype.writeUIntLE=function(e,A,t,n){(e=+e,A|=0,t|=0,n)||J(this,e,A,t,Math.pow(2,8*t)-1,0);var r=1,i=0;for(this[A]=255&e;++i<t&&(r*=256);)this[A+i]=e/r&255;return A+t},v.prototype.writeUIntBE=function(e,A,t,n){(e=+e,A|=0,t|=0,n)||J(this,e,A,t,Math.pow(2,8*t)-1,0);var r=t-1,i=1;for(this[A+r]=255&e;--r>=0&&(i*=256);)this[A+r]=e/i&255;return A+t},v.prototype.writeUInt8=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,1,255,0),v.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[A]=255&e,A+1},v.prototype.writeUInt16LE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[A]=255&e,this[A+1]=e>>>8):q(this,e,A,!0),A+2},v.prototype.writeUInt16BE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,2,65535,0),v.TYPED_ARRAY_SUPPORT?(this[A]=e>>>8,this[A+1]=255&e):q(this,e,A,!1),A+2},v.prototype.writeUInt32LE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[A+3]=e>>>24,this[A+2]=e>>>16,this[A+1]=e>>>8,this[A]=255&e):W(this,e,A,!0),A+4},v.prototype.writeUInt32BE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,4,4294967295,0),v.TYPED_ARRAY_SUPPORT?(this[A]=e>>>24,this[A+1]=e>>>16,this[A+2]=e>>>8,this[A+3]=255&e):W(this,e,A,!1),A+4},v.prototype.writeIntLE=function(e,A,t,n){if(e=+e,A|=0,!n){var r=Math.pow(2,8*t-1);J(this,e,A,t,r-1,-r)}var i=0,a=1,o=0;for(this[A]=255&e;++i<t&&(a*=256);)e<0&&0===o&&0!==this[A+i-1]&&(o=1),this[A+i]=(e/a|0)-o&255;return A+t},v.prototype.writeIntBE=function(e,A,t,n){if(e=+e,A|=0,!n){var r=Math.pow(2,8*t-1);J(this,e,A,t,r-1,-r)}var i=t-1,a=1,o=0;for(this[A+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[A+i+1]&&(o=1),this[A+i]=(e/a|0)-o&255;return A+t},v.prototype.writeInt8=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,1,127,-128),v.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[A]=255&e,A+1},v.prototype.writeInt16LE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[A]=255&e,this[A+1]=e>>>8):q(this,e,A,!0),A+2},v.prototype.writeInt16BE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,2,32767,-32768),v.TYPED_ARRAY_SUPPORT?(this[A]=e>>>8,this[A+1]=255&e):q(this,e,A,!1),A+2},v.prototype.writeInt32LE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,4,2147483647,-2147483648),v.TYPED_ARRAY_SUPPORT?(this[A]=255&e,this[A+1]=e>>>8,this[A+2]=e>>>16,this[A+3]=e>>>24):W(this,e,A,!0),A+4},v.prototype.writeInt32BE=function(e,A,t){return e=+e,A|=0,t||J(this,e,A,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),v.TYPED_ARRAY_SUPPORT?(this[A]=e>>>24,this[A+1]=e>>>16,this[A+2]=e>>>8,this[A+3]=255&e):W(this,e,A,!1),A+4},v.prototype.writeFloatLE=function(e,A,t){return X(this,e,A,!0,t)},v.prototype.writeFloatBE=function(e,A,t){return X(this,e,A,!1,t)},v.prototype.writeDoubleLE=function(e,A,t){return $(this,e,A,!0,t)},v.prototype.writeDoubleBE=function(e,A,t){return $(this,e,A,!1,t)},v.prototype.copy=function(e,A,t,n){if(t||(t=0),n||0===n||(n=this.length),A>=e.length&&(A=e.length),A||(A=0),n>0&&n<t&&(n=t),n===t)return 0;if(0===e.length||0===this.length)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-A<n-t&&(n=e.length-A+t);var r,i=n-t;if(this===e&&t<A&&A<n)for(r=i-1;r>=0;--r)e[r+A]=this[r+t];else if(i<1e3||!v.TYPED_ARRAY_SUPPORT)for(r=0;r<i;++r)e[r+A]=this[r+t];else Uint8Array.prototype.set.call(e,this.subarray(t,t+i),A);return i},v.prototype.fill=function(e,A,t,n){if("string"==typeof e){if("string"==typeof A?(n=A,A=0,t=this.length):"string"==typeof t&&(n=t,t=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!v.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(A<0||this.length<A||this.length<t)throw new RangeError("Out of range index");if(t<=A)return this;var i;if(A>>>=0,t=void 0===t?this.length:t>>>0,e||(e=0),"number"==typeof e)for(i=A;i<t;++i)this[i]=e;else{var a=C(e)?e:te(new v(e,n).toString()),o=a.length;for(i=0;i<t-A;++i)this[i+A]=a[i%o]}return this};var ee=/[^+\/0-9A-Za-z-_]/g;function Ae(e){return e<16?"0"+e.toString(16):e.toString(16)}function te(e,A){var t;A=A||1/0;for(var n=e.length,r=null,i=[],a=0;a<n;++a){if((t=e.charCodeAt(a))>55295&&t<57344){if(!r){if(t>56319){(A-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(A-=3)>-1&&i.push(239,191,189);continue}r=t;continue}if(t<56320){(A-=3)>-1&&i.push(239,191,189),r=t;continue}t=65536+(r-55296<<10|t-56320)}else r&&(A-=3)>-1&&i.push(239,191,189);if(r=null,t<128){if((A-=1)<0)break;i.push(t)}else if(t<2048){if((A-=2)<0)break;i.push(t>>6|192,63&t|128)}else if(t<65536){if((A-=3)<0)break;i.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((A-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return i}function ne(e){return function(e){var A,t,n,r,i,a;d||h();var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[o-2]?2:"="===e[o-1]?1:0,a=new c(3*o/4-i),n=i>0?o-4:o;var s=0;for(A=0,t=0;A<n;A+=4,t+=3)r=u[e.charCodeAt(A)]<<18|u[e.charCodeAt(A+1)]<<12|u[e.charCodeAt(A+2)]<<6|u[e.charCodeAt(A+3)],a[s++]=r>>16&255,a[s++]=r>>8&255,a[s++]=255&r;return 2===i?(r=u[e.charCodeAt(A)]<<2|u[e.charCodeAt(A+1)]>>4,a[s++]=255&r):1===i&&(r=u[e.charCodeAt(A)]<<10|u[e.charCodeAt(A+1)]<<4|u[e.charCodeAt(A+2)]>>2,a[s++]=r>>8&255,a[s++]=255&r),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ee,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function re(e,A,t,n){for(var r=0;r<n&&!(r+t>=A.length||r>=e.length);++r)A[r+t]=e[r];return r}function ie(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}if(exports.base64=!0,exports.array=!0,exports.string=!0,exports.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,exports.nodebuffer=void 0!==v,exports.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)exports.blob=!1;else{var ae=new ArrayBuffer(0);try{exports.blob=0===new Blob([ae],{type:"application/zip"}).size}catch(sy){try{var oe=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);oe.append(ae),exports.blob=0===oe.getBlob("application/zip").size}catch(sy){exports.blob=!1}}}try{exports.nodestream=!!require("readable-stream").Readable}catch(sy){exports.nodestream=!1}var se,le=i(Object.freeze({__proto__:null})),ue={};module.exports={isNode:void 0!==v,newBufferFrom:function(e,A){if(v.from&&v.from!==Uint8Array.from)return v.from(e,A);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new v(e,A)},allocBuffer:function(e){if(v.alloc)return v.alloc(e);var A=new v(e);return A.fill(0),A},isBuffer:function(e){return v.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}};var ce=i(Object.freeze({__proto__:null}));function de(){throw new Error("setTimeout has not been defined")}function he(){throw new Error("clearTimeout has not been defined")}var ge=de,pe=he;function fe(e){if(ge===setTimeout)return setTimeout(e,0);if((ge===de||!ge)&&setTimeout)return ge=setTimeout,setTimeout(e,0);try{return ge(e,0)}catch(A){try{return ge.call(null,e,0)}catch(A){return ge.call(this,e,0)}}}"function"==typeof s.setTimeout&&(ge=setTimeout),"function"==typeof s.clearTimeout&&(pe=clearTimeout);var me,we=[],be=!1,Ee=-1;function ye(){be&&me&&(be=!1,me.length?we=me.concat(we):Ee=-1,we.length&&ve())}function ve(){if(!be){var e=fe(ye);be=!0;for(var A=we.length;A;){for(me=we,we=[];++Ee<A;)me&&me[Ee].run();Ee=-1,A=we.length}me=null,be=!1,function(e){if(pe===clearTimeout)return clearTimeout(e);if((pe===he||!pe)&&clearTimeout)return pe=clearTimeout,clearTimeout(e);try{return pe(e)}catch(A){try{return pe.call(null,e)}catch(A){return pe.call(this,e)}}}(e)}}function ke(e){var A=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)A[t-1]=arguments[t];we.push(new Se(e,A)),1!==we.length||be||fe(ve)}function Se(e,A){this.fun=e,this.array=A}Se.prototype.run=function(){this.fun.apply(null,this.array)};var Ie=s.performance||{};Ie.now||Ie.mozNow||Ie.msNow||Ie.oNow||Ie.webkitNow;var Ue={env:{}},xe=require("immediate");function Ce(){}var Be={},Me=["REJECTED"],Ne=["FULFILLED"],Te=["PENDING"];function Oe(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=Te,this.queue=[],this.outcome=void 0,e!==Ce&&Re(this,e)}function Qe(e,A,t){this.promise=e,"function"==typeof A&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),"function"==typeof t&&(this.onRejected=t,this.callRejected=this.otherCallRejected)}function Le(e,A,t){xe((function(){var n;try{n=A(t)}catch(A){return Be.reject(e,A)}n===e?Be.reject(e,new TypeError("Cannot resolve promise with itself")):Be.resolve(e,n)}))}function De(e){var A=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof A)return function(){A.apply(e,arguments)}}function Re(e,A){var t=!1;function n(A){t||(t=!0,Be.reject(e,A))}function r(A){t||(t=!0,Be.resolve(e,A))}var i=_e((function(){A(r,n)}));"error"===i.status&&n(i.value)}function _e(e,A){var t={};try{t.value=e(A),t.status="success"}catch(e){t.status="error",t.value=e}return t}module.exports=Oe,Oe.prototype.finally=function(e){if("function"!=typeof e)return this;var A=this.constructor;return this.then((function(t){return A.resolve(e()).then((function(){return t}))}),(function(t){return A.resolve(e()).then((function(){throw t}))}))},Oe.prototype.catch=function(e){return this.then(null,e)},Oe.prototype.then=function(e,A){if("function"!=typeof e&&this.state===Ne||"function"!=typeof A&&this.state===Me)return this;var t=new this.constructor(Ce);this.state!==Te?Le(t,this.state===Ne?e:A,this.outcome):this.queue.push(new Qe(t,e,A));return t},Qe.prototype.callFulfilled=function(e){Be.resolve(this.promise,e)},Qe.prototype.otherCallFulfilled=function(e){Le(this.promise,this.onFulfilled,e)},Qe.prototype.callRejected=function(e){Be.reject(this.promise,e)},Qe.prototype.otherCallRejected=function(e){Le(this.promise,this.onRejected,e)},Be.resolve=function(e,A){var t=_e(De,A);if("error"===t.status)return Be.reject(e,t.value);var n=t.value;if(n)Re(e,n);else{e.state=Ne,e.outcome=A;for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callFulfilled(A)}return e},Be.reject=function(e,A){e.state=Me,e.outcome=A;for(var t=-1,n=e.queue.length;++t<n;)e.queue[t].callRejected(A);return e},Oe.resolve=function(e){if(e instanceof this)return e;return Be.resolve(new this(Ce),e)},Oe.reject=function(e){var A=new this(Ce);return Be.reject(A,e)},Oe.all=function(e){var A=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);var r=new Array(t),i=0,a=-1,o=new this(Ce);for(;++a<t;)s(e[a],a);return o;function s(e,a){A.resolve(e).then((function(e){r[a]=e,++i!==t||n||(n=!0,Be.resolve(o,r))}),(function(e){n||(n=!0,Be.reject(o,e))}))}},Oe.race=function(e){var A=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);var r=-1,i=new this(Ce);for(;++r<t;)a=e[r],A.resolve(a).then((function(e){n||(n=!0,Be.resolve(i,e))}),(function(e){n||(n=!0,Be.reject(i,e))}));var a;return i};var Ve,Fe={Promise:"undefined"!=typeof Promise?Promise:i(Object.freeze({__proto__:null}))};function ze(){return Ve||(Ve=1,function(e){var A=le,t=function(){if(se)return ue;se=1;var e=ze(),A=le,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return ue.encode=function(A){for(var n,r,i,a,o,s,l,u=[],c=0,d=A.length,h=d,g="string"!==e.getTypeOf(A);c<A.length;)h=d-c,g?(n=A[c++],r=c<d?A[c++]:0,i=c<d?A[c++]:0):(n=A.charCodeAt(c++),r=c<d?A.charCodeAt(c++):0,i=c<d?A.charCodeAt(c++):0),a=n>>2,o=(3&n)<<4|r>>4,s=h>1?(15&r)<<2|i>>6:64,l=h>2?63&i:64,u.push(t.charAt(a)+t.charAt(o)+t.charAt(s)+t.charAt(l));return u.join("")},ue.decode=function(e){var n,r,i,a,o,s,l=0,u=0,c="data:";if(e.substr(0,5)===c)throw new Error("Invalid base64 input, it looks like a data url.");var d,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===t.charAt(64)&&h--,e.charAt(e.length-2)===t.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=A.uint8array?new Uint8Array(0|h):new Array(0|h);l<e.length;)n=t.indexOf(e.charAt(l++))<<2|(a=t.indexOf(e.charAt(l++)))>>4,r=(15&a)<<4|(o=t.indexOf(e.charAt(l++)))>>2,i=(3&o)<<6|(s=t.indexOf(e.charAt(l++))),d[u++]=n,64!==o&&(d[u++]=r),64!==s&&(d[u++]=i);return d},ue}(),n=ce,r=Fe;function i(e){return e}function a(e,A){for(var t=0;t<e.length;++t)A[t]=255&e.charCodeAt(t);return A}e.newBlob=function(A,t){e.checkSupport("blob");try{return new Blob([A],{type:t})}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(A),n.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var o={stringifyByChunk:function(e,A,t){var n=[],r=0,i=e.length;if(i<=t)return String.fromCharCode.apply(null,e);for(;r<i;)"array"===A||"nodebuffer"===A?n.push(String.fromCharCode.apply(null,e.slice(r,Math.min(r+t,i)))):n.push(String.fromCharCode.apply(null,e.subarray(r,Math.min(r+t,i)))),r+=t;return n.join("")},stringifyByChar:function(e){for(var A="",t=0;t<e.length;t++)A+=String.fromCharCode(e[t]);return A},applyCanBeUsed:{uint8array:function(){try{return A.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return A.nodebuffer&&1===String.fromCharCode.apply(null,n.allocBuffer(1)).length}catch(e){return!1}}()}};function s(A){var t=65536,n=e.getTypeOf(A),r=!0;if("uint8array"===n?r=o.applyCanBeUsed.uint8array:"nodebuffer"===n&&(r=o.applyCanBeUsed.nodebuffer),r)for(;t>1;)try{return o.stringifyByChunk(A,n,t)}catch(e){t=Math.floor(t/2)}return o.stringifyByChar(A)}function l(e,A){for(var t=0;t<e.length;t++)A[t]=e[t];return A}e.applyFromCharCode=s;var u={};u.string={string:i,array:function(e){return a(e,new Array(e.length))},arraybuffer:function(e){return u.string.uint8array(e).buffer},uint8array:function(e){return a(e,new Uint8Array(e.length))},nodebuffer:function(e){return a(e,n.allocBuffer(e.length))}},u.array={string:s,array:i,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return n.newBufferFrom(e)}},u.arraybuffer={string:function(e){return s(new Uint8Array(e))},array:function(e){return l(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:i,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return n.newBufferFrom(new Uint8Array(e))}},u.uint8array={string:s,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:i,nodebuffer:function(e){return n.newBufferFrom(e)}},u.nodebuffer={string:s,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return u.nodebuffer.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:i},e.transformTo=function(A,t){if(t||(t=""),!A)return t;e.checkSupport(A);var n=e.getTypeOf(t);return u[n][A](t)},e.resolve=function(e){for(var A=e.split("/"),t=[],n=0;n<A.length;n++){var r=A[n];"."===r||""===r&&0!==n&&n!==A.length-1||(".."===r?t.pop():t.push(r))}return t.join("/")},e.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":A.nodebuffer&&n.isBuffer(e)?"nodebuffer":A.uint8array&&e instanceof Uint8Array?"uint8array":A.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(e){if(!A[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(e){var A,t,n="";for(t=0;t<(e||"").length;t++)n+="\\x"+((A=e.charCodeAt(t))<16?"0":"")+A.toString(16).toUpperCase();return n},e.delay=function(e,A,t){setImmediate((function(){e.apply(t||null,A||[])}))},e.inherits=function(e,A){var t=function(){};t.prototype=A.prototype,e.prototype=new t},e.extend=function(){var e,A,t={};for(e=0;e<arguments.length;e++)for(A in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],A)&&void 0===t[A]&&(t[A]=arguments[e][A]);return t},e.prepareContent=function(n,i,o,s,l){var u=r.Promise.resolve(i).then((function(e){return A.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new r.Promise((function(A,t){var n=new FileReader;n.onload=function(e){A(e.target.result)},n.onerror=function(e){t(e.target.error)},n.readAsArrayBuffer(e)})):e}));return u.then((function(i){var u,c=e.getTypeOf(i);return c?("arraybuffer"===c?i=e.transformTo("uint8array",i):"string"===c&&(l?i=t.decode(i):o&&!0!==s&&(i=a(u=i,A.uint8array?new Uint8Array(u.length):new Array(u.length)))),i):r.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}}(o)),o}function Ge(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Ge.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,A){return this._listeners[e].push(A),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,A){if(this._listeners[e])for(var t=0;t<this._listeners[e].length;t++)this._listeners[e][t].call(this,A)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var A=this;return e.on("data",(function(e){A.processChunk(e)})),e.on("end",(function(){A.end()})),e.on("error",(function(e){A.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,A){return this.extraStreamInfo[e]=A,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};var je=Ge;!function(e){for(var A=ze(),t=le,n=ce,r=je,i=new Array(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1;function o(){r.call(this,"utf-8 decode"),this.leftOver=null}function s(){r.call(this,"utf-8 encode")}e.utf8encode=function(e){return t.nodebuffer?n.newBufferFrom(e,"utf-8"):function(e){var A,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),s+=n<128?1:n<2048?2:n<65536?3:4;for(A=t.uint8array?new Uint8Array(s):new Array(s),a=0,i=0;a<s;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<o&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?A[a++]=n:n<2048?(A[a++]=192|n>>>6,A[a++]=128|63&n):n<65536?(A[a++]=224|n>>>12,A[a++]=128|n>>>6&63,A[a++]=128|63&n):(A[a++]=240|n>>>18,A[a++]=128|n>>>12&63,A[a++]=128|n>>>6&63,A[a++]=128|63&n);return A}(e)},e.utf8decode=function(e){return t.nodebuffer?A.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,a,o=e.length,s=new Array(2*o);for(n=0,t=0;t<o;)if((r=e[t++])<128)s[n++]=r;else if((a=i[r])>4)s[n++]=65533,t+=a-1;else{for(r&=2===a?31:3===a?15:7;a>1&&t<o;)r=r<<6|63&e[t++],a--;a>1?s[n++]=65533:r<65536?s[n++]=r:(r-=65536,s[n++]=55296|r>>10&1023,s[n++]=56320|1023&r)}return s.length!==n&&(s.subarray?s=s.subarray(0,n):s.length=n),A.applyFromCharCode(s)}(e=A.transformTo(t.uint8array?"uint8array":"array",e))},A.inherits(o,r),o.prototype.processChunk=function(n){var r=A.transformTo(t.uint8array?"uint8array":"array",n.data);if(this.leftOver&&this.leftOver.length){if(t.uint8array){var a=r;(r=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),r.set(a,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var o=function(e,A){var t;for((A=A||e.length)>e.length&&(A=e.length),t=A-1;t>=0&&128==(192&e[t]);)t--;return t<0||0===t?A:t+i[e[t]]>A?t:A}(r),s=r;o!==r.length&&(t.uint8array?(s=r.subarray(0,o),this.leftOver=r.subarray(o,r.length)):(s=r.slice(0,o),this.leftOver=r.slice(o,r.length))),this.push({data:e.utf8decode(s),meta:n.meta})},o.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=o,A.inherits(s,r),s.prototype.processChunk=function(A){this.push({data:e.utf8encode(A.data),meta:A.meta})},e.Utf8EncodeWorker=s}(a);var Pe=require("../utils"),Ye=require("./ConvertWorker"),Ke=require("./GenericWorker"),He=require("../base64"),Je=require("../support"),qe=require("../external"),We=null;if(Je.nodestream)try{We=require("../nodejs/NodejsStreamOutputAdapter")}catch(sy){}function Ze(e,A){return new qe.Promise((function(t,n){var r=[],i=e._internalType,a=e._outputType,o=e._mimeType;e.on("data",(function(e,t){r.push(e),A&&A(t)})).on("error",(function(e){r=[],n(e)})).on("end",(function(){try{var e=function(e,A,t){switch(e){case"blob":return Pe.newBlob(Pe.transformTo("arraybuffer",A),t);case"base64":return He.encode(A);default:return Pe.transformTo(e,A)}}(a,function(e,A){var t,n=0,r=null,i=0;for(t=0;t<A.length;t++)i+=A[t].length;switch(e){case"string":return A.join("");case"array":return Array.prototype.concat.apply([],A);case"uint8array":for(r=new Uint8Array(i),t=0;t<A.length;t++)r.set(A[t],n),n+=A[t].length;return r;case"nodebuffer":return v.concat(A);default:throw new Error("concat : unsupported type '"+e+"'")}}(i,r),o);t(e)}catch(e){n(e)}r=[]})).resume()}))}function Xe(e,A,t){var n=A;switch(A){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string"}try{this._internalType=n,this._outputType=A,this._mimeType=t,Pe.checkSupport(n),this._worker=e.pipe(new Ye(n)),e.lock()}catch(e){this._worker=new Ke("error"),this._worker.error(e)}}Xe.prototype={accumulate:function(e){return Ze(this,e)},on:function(e,A){var t=this;return"data"===e?this._worker.on(e,(function(e){A.call(t,e.data,e.meta)})):this._worker.on(e,(function(){Pe.delay(A,arguments,t)})),this},resume:function(){return Pe.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(Pe.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new We(this,{objectMode:"nodebuffer"!==this._outputType},e)}},module.exports=Xe;var $e=i(Object.freeze({__proto__:null})),eA={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null},AA=ze(),tA=je;function nA(e){tA.call(this,"DataWorker");var A=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){A.dataIsReady=!0,A.data=e,A.max=e&&e.length||0,A.type=AA.getTypeOf(e),A.isPaused||A._tickAndRepeat()}),(function(e){A.error(e)}))}AA.inherits(nA,tA),nA.prototype.cleanUp=function(){tA.prototype.cleanUp.call(this),this.data=null},nA.prototype.resume=function(){return!!tA.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,AA.delay(this._tickAndRepeat,[],this)),!0)},nA.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(AA.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},nA.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,A=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,A);break;case"uint8array":e=this.data.subarray(this.index,A);break;case"array":case"nodebuffer":e=this.data.slice(this.index,A)}return this.index=A,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})};var rA=nA,iA=ze();var aA=function(){for(var e,A=[],t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;A[t]=e}return A}();var oA=function(e,A){return void 0!==e&&e.length?"string"!==iA.getTypeOf(e)?function(e,A,t,n){var r=aA,i=n+t;e=~e;for(var a=n;a<i;a++)e=e>>>8^r[255&(e^A[a])];return~e}(0|A,e,e.length,0):function(e,A,t,n){var r=aA,i=n+t;e=~e;for(var a=n;a<i;a++)e=e>>>8^r[255&(e^A.charCodeAt(a))];return~e}(0|A,e,e.length,0):0},sA=je,lA=oA;function uA(){sA.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}ze().inherits(uA,sA),uA.prototype.processChunk=function(e){this.streamInfo.crc32=lA(e.data,this.streamInfo.crc32||0),this.push(e)};var cA=uA,dA=ze(),hA=je;function gA(e){hA.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}dA.inherits(gA,hA),gA.prototype.processChunk=function(e){if(e){var A=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=A+e.data.length}hA.prototype.processChunk.call(this,e)};var pA=Fe,fA=rA,mA=cA,wA=gA;function bA(e,A,t,n,r){this.compressedSize=e,this.uncompressedSize=A,this.crc32=t,this.compression=n,this.compressedContent=r}bA.prototype={getContentWorker:function(){var e=new fA(pA.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new wA("data_length")),A=this;return e.on("end",(function(){if(this.streamInfo.data_length!==A.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new fA(pA.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},bA.createWorkerFrom=function(e,A,t){return e.pipe(new mA).pipe(new wA("uncompressedSize")).pipe(A.compressWorker(t)).pipe(new wA("compressedSize")).withStreamInfo("compression",A)};var EA=bA,yA=$e,vA=rA,kA=a,SA=EA,IA=je,UA=function(e,A,t){this.name=e,this.dir=t.dir,this.date=t.date,this.comment=t.comment,this.unixPermissions=t.unixPermissions,this.dosPermissions=t.dosPermissions,this._data=A,this._dataBinary=t.binary,this.options={compression:t.compression,compressionOptions:t.compressionOptions}};UA.prototype={internalStream:function(e){var A=null,t="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(t=e.toLowerCase())||"text"===t;"binarystring"!==t&&"text"!==t||(t="string"),A=this._decompressWorker();var r=!this._dataBinary;r&&!n&&(A=A.pipe(new kA.Utf8EncodeWorker)),!r&&n&&(A=A.pipe(new kA.Utf8DecodeWorker))}catch(e){(A=new IA("error")).error(e)}return new yA(A,t,"")},async:function(e,A){return this.internalStream(e).accumulate(A)},nodeStream:function(e,A){return this.internalStream(e||"nodebuffer").toNodejsStream(A)},_compressWorker:function(e,A){if(this._data instanceof SA&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var t=this._decompressWorker();return this._dataBinary||(t=t.pipe(new kA.Utf8EncodeWorker)),SA.createWorkerFrom(t,e,A)},_decompressWorker:function(){return this._data instanceof SA?this._data.getContentWorker():this._data instanceof IA?this._data:new vA(this._data)}};for(var xA=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],CA=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},BA=0;BA<xA.length;BA++)UA.prototype[xA[BA]]=CA;var MA=UA,NA={},TA={},OA={},QA={};!function(e){var A="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function t(e,A){return Object.prototype.hasOwnProperty.call(e,A)}e.assign=function(e){for(var A=Array.prototype.slice.call(arguments,1);A.length;){var n=A.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)t(n,r)&&(e[r]=n[r])}}return e},e.shrinkBuf=function(e,A){return e.length===A?e:e.subarray?e.subarray(0,A):(e.length=A,e)};var n={arraySet:function(e,A,t,n,r){if(A.subarray&&e.subarray)e.set(A.subarray(t,t+n),r);else for(var i=0;i<n;i++)e[r+i]=A[t+i]},flattenChunks:function(e){var A,t,n,r,i,a;for(n=0,A=0,t=e.length;A<t;A++)n+=e[A].length;for(a=new Uint8Array(n),r=0,A=0,t=e.length;A<t;A++)i=e[A],a.set(i,r),r+=i.length;return a}},r={arraySet:function(e,A,t,n,r){for(var i=0;i<n;i++)e[r+i]=A[t+i]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(A){A?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,r))},e.setTyped(A)}(QA);var LA={},DA={},RA={},_A=QA;function VA(e){for(var A=e.length;--A>=0;)e[A]=0}var FA=256,zA=286,GA=30,jA=15,PA=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],YA=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],KA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],HA=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],JA=new Array(576);VA(JA);var qA=new Array(60);VA(qA);var WA=new Array(512);VA(WA);var ZA=new Array(256);VA(ZA);var XA=new Array(29);VA(XA);var $A,et,At,tt=new Array(GA);function nt(e,A,t,n,r){this.static_tree=e,this.extra_bits=A,this.extra_base=t,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}function rt(e,A){this.dyn_tree=e,this.max_code=0,this.stat_desc=A}function it(e){return e<256?WA[e]:WA[256+(e>>>7)]}function at(e,A){e.pending_buf[e.pending++]=255&A,e.pending_buf[e.pending++]=A>>>8&255}function ot(e,A,t){e.bi_valid>16-t?(e.bi_buf|=A<<e.bi_valid&65535,at(e,e.bi_buf),e.bi_buf=A>>16-e.bi_valid,e.bi_valid+=t-16):(e.bi_buf|=A<<e.bi_valid&65535,e.bi_valid+=t)}function st(e,A,t){ot(e,t[2*A],t[2*A+1])}function lt(e,A){var t=0;do{t|=1&e,e>>>=1,t<<=1}while(--A>0);return t>>>1}function ut(e,A,t){var n,r,i=new Array(16),a=0;for(n=1;n<=jA;n++)i[n]=a=a+t[n-1]<<1;for(r=0;r<=A;r++){var o=e[2*r+1];0!==o&&(e[2*r]=lt(i[o]++,o))}}function ct(e){var A;for(A=0;A<zA;A++)e.dyn_ltree[2*A]=0;for(A=0;A<GA;A++)e.dyn_dtree[2*A]=0;for(A=0;A<19;A++)e.bl_tree[2*A]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function dt(e){e.bi_valid>8?at(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ht(e,A,t,n){var r=2*A,i=2*t;return e[r]<e[i]||e[r]===e[i]&&n[A]<=n[t]}function gt(e,A,t){for(var n=e.heap[t],r=t<<1;r<=e.heap_len&&(r<e.heap_len&&ht(A,e.heap[r+1],e.heap[r],e.depth)&&r++,!ht(A,n,e.heap[r],e.depth));)e.heap[t]=e.heap[r],t=r,r<<=1;e.heap[t]=n}function pt(e,A,t){var n,r,i,a,o=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*o]<<8|e.pending_buf[e.d_buf+2*o+1],r=e.pending_buf[e.l_buf+o],o++,0===n?st(e,r,A):(st(e,(i=ZA[r])+FA+1,A),0!==(a=PA[i])&&ot(e,r-=XA[i],a),st(e,i=it(--n),