tildefriends/core/jszip.min.js
2024-01-21 23:56:36 +00:00

2 lines
77 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var t={Promise:Promise},e={base64:!0,array:!0,string:!0,nodebuffer:!1,nodestream:!1,get arraybuffer(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},get uint8array(){return"undefined"!=typeof Uint8Array},get blob(){return r()}},r=function(){var t;if("undefined"==typeof ArrayBuffer)t=!1;else{var e=new ArrayBuffer(0);try{t=0===new Blob([e],{type:"application/zip"}).size}catch(e){t=!1}}return r=function(){return t},t},i=e,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function a(t){return t}function s(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}function o(t,e,r){var i=[],n=0,a=t.length;if(a<=r)return String.fromCharCode.apply(null,t);for(;n<a;)"array"===e?i.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+r,a)))):i.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+r,a)))),n+=r;return i.join("")}var h=function(){var t;try{t=i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){t=!1}return h=function(){return t},t};function l(t){var e=65536,r=p(t),i=!0;if("uint8array"===r&&(i=h()),i)for(;e>1;)try{return o(t,r,e)}catch(t){e=Math.floor(e/2)}return function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}(t)}var d=l;function u(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}var c={string:{string:a,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return c.string.uint8array(t).buffer},uint8array:function(t){return s(t,new Uint8Array(t.length))}},array:{string:l,array:a,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)}},arraybuffer:{string:function(t){return l(new Uint8Array(t))},array:function(t){return u(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:a,uint8array:function(t){return new Uint8Array(t)}},uint8array:{string:l,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:a}},f=function(t,e){if(e||(e=""),!t)return e;m(t);var r=p(e);return c[r][t](e)},p=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":i.uint8array&&t instanceof Uint8Array?"uint8array":i.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},m=function(t){if(!i[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},_=function(t){var e,r,i="";for(r=0;r<(t||"").length;r++)i+="\\x"+((e=t.charCodeAt(r))<16?"0":"")+e.toString(16).toUpperCase();return i},g=function(t,e,r){setTimeout((function(){t.apply(r||null,e||[])}),0)},y=function(){var t,e,r=arguments,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.hasOwnProperty.call(r[t],e)&&void 0===i[e]&&(i[e]=r[t][e]);return i},v=function(e,r,a,o,h){return t.Promise.resolve(r).then((function(e){return i.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new t.Promise((function(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=function(t){r(t.target.error)},i.readAsArrayBuffer(e)})):e})).then((function(r){var l,d=p(r);return d?("arraybuffer"===d?r=f("uint8array",r):"string"===d&&(h?r=function(t){var e,r,a,s,o,h,l=0,d=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var u,c=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===n.charAt(64)&&c--,t.charAt(t.length-2)===n.charAt(64)&&c--,c%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=i.uint8array?new Uint8Array(0|c):new Array(0|c);l<t.length;)e=n.indexOf(t.charAt(l++))<<2|(s=n.indexOf(t.charAt(l++)))>>4,r=(15&s)<<4|(o=n.indexOf(t.charAt(l++)))>>2,a=(3&o)<<6|(h=n.indexOf(t.charAt(l++))),u[d++]=e,64!==o&&(u[d++]=r),64!==h&&(u[d++]=a);return u}(r):a&&!0!==o&&(r=s(l=r,i.uint8array?new Uint8Array(l.length):new Array(l.length)))),r):t.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))},w=function(t){this.name=t||"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};w.prototype.push=function(t){this.emit("data",t)},w.prototype.end=function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},w.prototype.error=function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},w.prototype.on=function(t,e){return this._listeners[t].push(e),this},w.prototype.cleanUp=function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},w.prototype.emit=function(t,e){if(this._listeners[t])for(var r=0;r<this._listeners[t].length;r++)this._listeners[t][r].call(this,e)},w.prototype.pipe=function(t){return t.registerPrevious(this)},w.prototype.registerPrevious=function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},w.prototype.pause=function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},w.prototype.resume=function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var t=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},w.prototype.flush=function(){},w.prototype.processChunk=function(t){this.push(t)},w.prototype.withStreamInfo=function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},w.prototype.mergeStreamInfo=function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},w.prototype.lock=function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},w.prototype.toString=function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t};var b=function(t){for(var e=new Array(256),r=0;r<256;r++)e[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;return e[254]=e[254]=1,b=function(t){return e[t]},e[t]},k=function(t){return function(t){var e,r,n,a,s,o=t.length,h=0;for(a=0;a<o;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),h+=r<128?1:r<2048?2:r<65536?3:4;for(e=i.uint8array?new Uint8Array(h):new Array(h),s=0,a=0;s<h;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e}(t)},x=function(t){return function(t){var e,r,i,n,a=t.length,s=new Array(2*a);for(r=0,e=0;e<a;)if((i=t[e++])<128)s[r++]=i;else if((n=b(i))>4)s[r++]=65533,e+=n-1;else{for(i&=2===n?31:3===n?15:7;n>1&&e<a;)i=i<<6|63&t[e++],n--;n>1?s[r++]=65533:i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|1023&i)}return s.length!==r&&(s.subarray?s=s.subarray(0,r):s.length=r),d(s)}(t=f(i.uint8array?"uint8array":"array",t))},z=function(t){function e(){t.call(this,"utf-8 decode"),this.leftOver=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){var e=f(i.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var r=e;(e=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),e.set(r,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var n=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+b(t[r])>e?r:e}(e),a=e;n!==e.length&&(i.uint8array?(a=e.subarray(0,n),this.leftOver=e.subarray(n,e.length)):(a=e.slice(0,n),this.leftOver=e.slice(n,e.length))),this.push({data:x(a),meta:t.meta})},e.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:x(this.leftOver),meta:{}}),this.leftOver=null)},e}(w),S=function(t){function e(){t.call(this,"utf-8 encode")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.push({data:k(t.data),meta:t.meta})},e}(w),C=function(t){function e(e){t.call(this,"ConvertWorker to "+e),this.destType=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.push({data:f(this.destType,t.data),meta:t.meta})},e}(w);function A(t,e,r){switch(t){case"blob":return function(t,e){return m("blob"),new Blob([t],{type:e})}(f("arraybuffer",e),r);case"base64":return function(t){for(var e,r,i,a,s,o,h,l=[],d=0,u=t.length,c=u,f="string"!=typeof t;d<t.length;)c=u-d,f?(e=t[d++],r=d<u?t[d++]:0,i=d<u?t[d++]:0):(e=t.charCodeAt(d++),r=d<u?t.charCodeAt(d++):0,i=d<u?t.charCodeAt(d++):0),a=e>>2,s=(3&e)<<4|r>>4,o=c>1?(15&r)<<2|i>>6:64,h=c>2?63&i:64,l.push(n.charAt(a)+n.charAt(s)+n.charAt(o)+n.charAt(h));return l.join("")}(e);default:return f(t,e)}}function I(e,r){return new t.Promise((function(t,i){var n=[],a=e._internalType,s=e._outputType,o=e._mimeType;e.on("data",(function(t,e){n.push(t),r&&r(e)})).on("error",(function(t){n=[],i(t)})).on("end",(function(){try{var e=A(s,function(t,e){var r,i=0,n=null,a=0;for(r=0;r<e.length;r++)a+=e[r].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(a),r=0;r<e.length;r++)n.set(e[r],i),i+=e[r].length;return n;default:throw new Error("concat : unsupported type '"+t+"'")}}(a,n),o);t(e)}catch(t){i(t)}n=[]})).resume()}))}var O=function(t,e,r){var i=e;switch(e){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=e,this._mimeType=r,m(i),this._worker=t.pipe(new C(i)),t.lock()}catch(t){this._worker=new w("error"),this._worker.error(t)}};O.prototype.accumulate=function(t){return I(this,t)},O.prototype.on=function(t,e){var r=this;return"data"===t?this._worker.on(t,(function(t){e.call(r,t.data,t.meta)})):this._worker.on(t,(function(){g(e,arguments,r)})),this},O.prototype.resume=function(){return g(this._worker.resume,[],this._worker),this},O.prototype.pause=function(){return this._worker.pause(),this};var P=O,E=Object.freeze({__proto__:null,base64:!1,binary:!1,comment:null,compression:null,compressionOptions:null,createFolders:!0,date:null,dir:!1,dosPermissions:null,unixPermissions:null}),F=function(t){function e(e){t.call(this,"DataWorker");var r=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(t){r.dataIsReady=!0,r.data=t,r.max=t&&t.length||0,r.type=p(t),r.isPaused||r._tickAndRepeat()}),(function(t){r.error(t)}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.cleanUp=function(){t.prototype.cleanUp.call(this),this.data=null},e.prototype.resume=function(){return!!t.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,g(this._tickAndRepeat,[],this)),!0)},e.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(g(this._tickAndRepeat,[],this),this._tickScheduled=!0))},e.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},e}(w),B=function(t){function e(e){t.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(e){if(e){var r=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=r+e.data.length}t.prototype.processChunk.call(this,e)},e}(w),D=function(){for(var t=[],e=0;e<256;e++){for(var r=e,i=0;i<8;i++)r=1&r?3988292384^r>>>1:r>>>1;t[e]=r}return D=function(){return t},t};function U(t,e){return void 0!==t&&t.length?"string"!==p(t)?function(t,e,r,i){var n=D(),a=i+r;t^=-1;for(var s=i;s<a;s++)t=t>>>8^n[255&(t^e[s])];return-1^t}(0|e,t,t.length,0):function(t,e,r,i){var n=D(),a=i+r;t^=-1;for(var s=i;s<a;s++)t=t>>>8^n[255&(t^e.charCodeAt(s))];return-1^t}(0|e,t,t.length,0):0}var j=function(t){function e(){t.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.streamInfo.crc32=U(t.data,this.streamInfo.crc32||0),this.push(t)},e}(w),R=function(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n};R.prototype.getContentWorker=function(){var e=new F(t.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new B("data_length")),r=this;return e.on("end",(function(){if(this.streamInfo.data_length!==r.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},R.prototype.getCompressedWorker=function(){return new F(t.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)},R.createWorkerFrom=function(t,e,r){return t.pipe(new j).pipe(new B("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new B("compressedSize")).withStreamInfo("compression",e)};var N=R,T=function(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};T.prototype.internalStream=function(t){var e=null,r="string";try{if(!t)throw new Error("No output type specified.");var i="string"===(r=t.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),e=this._decompressWorker();var n=!this._dataBinary;n&&!i&&(e=e.pipe(new S)),!n&&i&&(e=e.pipe(new z))}catch(t){(e=new w("error")).error(t)}return new P(e,r,"")},T.prototype.async=function(t,e){return this.internalStream(t).accumulate(e)},T.prototype._compressWorker=function(t,e){if(this._data instanceof N&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new S)),N.createWorkerFrom(r,t,e)},T.prototype._decompressWorker=function(){return this._data instanceof N?this._data.getContentWorker():this._data instanceof w?this._data:new F(this._data)};function W(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function L(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)W(r,i)&&(t[i]=r[i])}}return t}function Z(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)}var K={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(var a=0;a<i;a++)t[n+a]=e[r+a]},flattenChunks:function(t){var e,r,i,n,a,s;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)a=t[e],s.set(a,n),n+=a.length;return s},Buf8:function(t){return new Uint8Array(t)},Buf16:function(t){return new Uint16Array(t)},Buf32:function(t){return new Int32Array(t)}},M={arraySet:function(t,e,r,i,n){for(var a=0;a<i;a++)t[n+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)},Buf8:function(t){return new Array(t)},Buf16:function(t){return new Array(t)},Buf32:function(t){return new Array(t)}},H=function(){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;return H=function(){return t},t},J=function(t,e,r,i,n){return(J=H()?K.arraySet:M.arraySet)(t,e,r,i,n)},X=function(t){return(X=H()?K.flattenChunks:M.flattenChunks)(t)},Y=function(t){return(Y=H()?K.Buf8:M.Buf8)(t)},q=function(t){return(q=H()?K.Buf16:M.Buf16)(t)},G=function(t){return(G=H()?K.Buf32:M.Buf32)(t)},Q=function(){var t=!0;try{String.fromCharCode.apply(null,[0])}catch(e){t=!1}return Q=function(){return t},t},V=function(){var t=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){t=!1}return V=function(){return t},t},$=function(t){for(var e=Y(256),r=0;r<256;r++)e[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;return e[254]=e[254]=1,$=function(t){return e[t]},e[t]};function tt(t){var e,r,i,n,a,s=t.length,o=0;for(n=0;n<s;n++)55296==(64512&(r=t.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=t.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),o+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(o),a=0,n=0;a<o;n++)55296==(64512&(r=t.charCodeAt(n)))&&n+1<s&&56320==(64512&(i=t.charCodeAt(n+1)))&&(r=65536+(r-55296<<10)+(i-56320),n++),r<128?e[a++]=r:r<2048?(e[a++]=192|r>>>6,e[a++]=128|63&r):r<65536?(e[a++]=224|r>>>12,e[a++]=128|r>>>6&63,e[a++]=128|63&r):(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63,e[a++]=128|r>>>6&63,e[a++]=128|63&r);return e}function et(t,e){if(e<65534&&(t.subarray&&V()||!t.subarray&&Q()))return String.fromCharCode.apply(null,Z(t,e));for(var r="",i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r}function rt(t,e){var r,i,n,a,s=e||t.length,o=new Array(2*s);for(i=0,r=0;r<s;)if((n=t[r++])<128)o[i++]=n;else if((a=$(n))>4)o[i++]=65533,r+=a-1;else{for(n&=2===a?31:3===a?15:7;a>1&&r<s;)n=n<<6|63&t[r++],a--;a>1?o[i++]=65533:n<65536?o[i++]=n:(n-=65536,o[i++]=55296|n>>10&1023,o[i++]=56320|1023&n)}return et(o,i)}function it(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0||0===r?e:r+$(t[r])>e?r:e}function nt(t,e,r,i){for(var n=65535&t|0,a=t>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{a=a+(n=n+e[i++]|0)|0}while(--s);n%=65521,a%=65521}return n|a<<16|0}var at=function(){var t=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();return at=function(){return t},t};function st(t,e,r,i){var n=at(),a=i+r;t^=-1;for(var s=i;s<a;s++)t=t>>>8^n[255&(t^e[s])];return-1^t}function ot(t,e){var r,i,n,a,s,o,h,l,d,u,c,f,p,m,_,g,y,v,w,b,k,x,z,S,C;r=t.state,i=t.next_in,S=t.input,n=i+(t.avail_in-5),a=t.next_out,C=t.output,s=a-(e-t.avail_out),o=a+(t.avail_out-257),h=r.dmax,l=r.wsize,d=r.whave,u=r.wnext,c=r.window,f=r.hold,p=r.bits,m=r.lencode,_=r.distcode,g=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;t:do{p<15&&(f+=S[i++]<<p,p+=8,f+=S[i++]<<p,p+=8),v=m[f&g];e:for(;;){if(f>>>=w=v>>>24,p-=w,0===(w=v>>>16&255))C[a++]=65535&v;else{if(!(16&w)){if(0==(64&w)){v=m[(65535&v)+(f&(1<<w)-1)];continue e}if(32&w){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}b=65535&v,(w&=15)&&(p<w&&(f+=S[i++]<<p,p+=8),b+=f&(1<<w)-1,f>>>=w,p-=w),p<15&&(f+=S[i++]<<p,p+=8,f+=S[i++]<<p,p+=8),v=_[f&y];r:for(;;){if(f>>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(0==(64&w)){v=_[(65535&v)+(f&(1<<w)-1)];continue r}t.msg="invalid distance code",r.mode=30;break t}if(k=65535&v,p<(w&=15)&&(f+=S[i++]<<p,(p+=8)<w&&(f+=S[i++]<<p,p+=8)),(k+=f&(1<<w)-1)>h){t.msg="invalid distance too far back",r.mode=30;break t}if(f>>>=w,p-=w,k>(w=a-s)){if((w=k-w)>d&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(x=0,z=c,0===u){if(x+=l-w,w<b){b-=w;do{C[a++]=c[x++]}while(--w);x=a-k,z=C}}else if(u<w){if(x+=l+u-w,(w-=u)<b){b-=w;do{C[a++]=c[x++]}while(--w);if(x=0,u<b){b-=w=u;do{C[a++]=c[x++]}while(--w);x=a-k,z=C}}}else if(x+=u-w,w<b){b-=w;do{C[a++]=c[x++]}while(--w);x=a-k,z=C}for(;b>2;)C[a++]=z[x++],C[a++]=z[x++],C[a++]=z[x++],b-=3;b&&(C[a++]=z[x++],b>1&&(C[a++]=z[x++]))}else{x=a-k;do{C[a++]=C[x++],C[a++]=C[x++],C[a++]=C[x++],b-=3}while(b>2);b&&(C[a++]=C[x++],b>1&&(C[a++]=C[x++]))}break}}break}}while(i<n&&a<o);i-=b=p>>3,f&=(1<<(p-=b<<3))-1,t.next_in=i,t.next_out=a,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=a<o?o-a+257:257-(a-o),r.hold=f,r.bits=p}var ht=[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],lt=[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],dt=[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],ut=[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];function ct(t,e,r,i,n,a,s,o){var h,l,d,u,c,f,p,m,_,g=o.bits,y=0,v=0,w=0,b=0,k=0,x=0,z=0,S=0,C=0,A=0,I=null,O=0,P=q(16),E=q(16),F=null,B=0;for(y=0;y<=15;y++)P[y]=0;for(v=0;v<i;v++)P[e[r+v]]++;for(k=g,b=15;b>=1&&0===P[b];b--);if(k>b&&(k=b),0===b)return n[a++]=20971520,n[a++]=20971520,o.bits=1,0;for(w=1;w<b&&0===P[w];w++);for(k<w&&(k=w),S=1,y=1;y<=15;y++)if(S<<=1,(S-=P[y])<0)return-1;if(S>0&&(0===t||1!==b))return-1;for(E[1]=0,y=1;y<15;y++)E[y+1]=E[y]+P[y];for(v=0;v<i;v++)0!==e[r+v]&&(s[E[e[r+v]]++]=v);if(0===t?(I=F=s,f=19):1===t?(I=ht,O-=257,F=lt,B-=257,f=256):(I=dt,F=ut,f=-1),A=0,v=0,y=w,c=a,x=k,z=0,d=-1,u=(C=1<<k)-1,1===t&&C>852||2===t&&C>592)return 1;for(;;){p=y-z,s[v]<f?(m=0,_=s[v]):s[v]>f?(m=F[B+s[v]],_=I[O+s[v]]):(m=96,_=0),h=1<<y-z,w=l=1<<x;do{n[c+(A>>z)+(l-=h)]=p<<24|m<<16|_|0}while(0!==l);for(h=1<<y-1;A&h;)h>>=1;if(0!==h?(A&=h-1,A+=h):A=0,v++,0==--P[y]){if(y===b)break;y=e[r+s[v]]}if(y>k&&(A&u)!==d){for(0===z&&(z=k),c+=w,S=1<<(x=y-z);x+z<b&&!((S-=P[x+z])<=0);)x++,S<<=1;if(C+=1<<x,1===t&&C>852||2===t&&C>592)return 1;n[d=A&u]=k<<24|x<<16|c-a|0}}return 0!==A&&(n[c+A]=y-z<<24|64<<16|0),o.bits=k,0}function ft(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function pt(){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=q(320),this.work=q(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function mt(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,function(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=G(852),e.distcode=e.distdyn=G(592),e.sane=1,e.back=-1,0):-2}(t)):-2}function _t(t,e){var r,i;return t?(i=new pt,t.state=i,i.window=null,0!==(r=function(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,mt(t))):-2}(t,e))&&(t.state=null),r):-2}var gt,yt,vt=!0;function wt(t){if(vt){var e;for(gt=G(512),yt=G(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ct(1,t.lens,0,288,gt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ct(2,t.lens,0,32,yt,0,t.work,{bits:5}),vt=!1}t.lencode=gt,t.lenbits=9,t.distcode=yt,t.distbits=5}function bt(t,e,r,i){var n,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=Y(a.wsize)),i>=a.wsize?(J(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((n=a.wsize-a.wnext)>i&&(n=i),J(a.window,e,r-i,n,a.wnext),(i-=n)?(J(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}function kt(t,e){var r,i,n,a,s,o,h,l,d,u,c,f,p,m,_,g,y,v,w,b,k,x,z,S,C=0,A=Y(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(r=t.state).mode&&(r.mode=13),s=t.next_out,n=t.output,h=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,l=r.hold,d=r.bits,u=o,c=h,x=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;d<16;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(2&r.wrap&&35615===l){r.check=0,A[0]=255&l,A[1]=l>>>8&255,r.check=st(r.check,A,2,0),l=0,d=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&l)){t.msg="unknown compression method",r.mode=30;break}if(d-=4,k=8+(15&(l>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<k,t.adler=r.check=1,r.mode=512&l?10:12,l=0,d=0;break;case 2:for(;d<16;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(r.flags=l,8!=(255&r.flags)){t.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){t.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=st(r.check,A,2,0)),l=0,d=0,r.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}r.head&&(r.head.time=l),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=st(r.check,A,4,0)),l=0,d=0,r.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=st(r.check,A,2,0)),l=0,d=0,r.mode=5;case 5:if(1024&r.flags){for(;d<16;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=st(r.check,A,2,0)),l=0,d=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((f=r.length)>o&&(f=o),f&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),J(r.head.extra,i,a,f,k)),512&r.flags&&(r.check=st(r.check,i,f,a)),o-=f,a+=f,r.length-=f),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break t;f=0;do{k=i[a+f++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&f<o);if(512&r.flags&&(r.check=st(r.check,i,f,a)),o-=f,a+=f,k)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===o)break t;f=0;do{k=i[a+f++],r.head&&k&&r.length<65536&&(r.head.comment+=String.fromCharCode(k))}while(k&&f<o);if(512&r.flags&&(r.check=st(r.check,i,f,a)),o-=f,a+=f,k)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;d<16;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(l!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}l=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=12;break;case 10:for(;d<32;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}t.adler=r.check=ft(l),l=0,d=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=s,t.avail_out=h,t.next_in=a,t.avail_in=o,r.hold=l,r.bits=d,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){l>>>=7&d,d-=7&d,r.mode=27;break}for(;d<3;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}switch(r.last=1&l,d-=1,3&(l>>>=1)){case 0:r.mode=14;break;case 1:if(wt(r),r.mode=20,6===e){l>>>=2,d-=2;break t}break;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}l>>>=2,d-=2;break;case 14:for(l>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,l=0,d=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(f=r.length){if(f>o&&(f=o),f>h&&(f=h),0===f)break t;J(n,i,a,f,s),o-=f,a+=f,h-=f,s+=f,r.length-=f;break}r.mode=12;break;case 17:for(;d<14;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(r.nlen=257+(31&l),l>>>=5,d-=5,r.ndist=1+(31&l),l>>>=5,d-=5,r.ncode=4+(15&l),l>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;d<3;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}r.lens[I[r.have++]]=7&l,l>>>=3,d-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,z={bits:r.lenbits},x=ct(0,r.lens,0,19,r.lencode,0,r.work,z),r.lenbits=z.bits,x){t.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;g=(C=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,y=65535&C,!((_=C>>>24)<=d);){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(y<16)l>>>=_,d-=_,r.lens[r.have++]=y;else{if(16===y){for(S=_+2;d<S;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(l>>>=_,d-=_,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],f=3+(3&l),l>>>=2,d-=2}else if(17===y){for(S=_+3;d<S;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}d-=_,k=0,f=3+(7&(l>>>=_)),l>>>=3,d-=3}else{for(S=_+7;d<S;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}d-=_,k=0,f=11+(127&(l>>>=_)),l>>>=7,d-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;f--;)r.lens[r.have++]=k}}if(30===r.mode)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,z={bits:r.lenbits},x=ct(1,r.lens,0,r.nlen,r.lencode,0,r.work,z),r.lenbits=z.bits,x){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,z={bits:r.distbits},x=ct(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,z),r.distbits=z.bits,x){t.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===e)break t;case 20:r.mode=21;case 21:if(o>=6&&h>=258){t.next_out=s,t.avail_out=h,t.next_in=a,t.avail_in=o,r.hold=l,r.bits=d,ot(t,c),s=t.next_out,n=t.output,h=t.avail_out,a=t.next_in,i=t.input,o=t.avail_in,l=r.hold,d=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[l&(1<<r.lenbits)-1])>>>16&255,y=65535&C,!((_=C>>>24)<=d);){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(g&&0==(240&g)){for(v=_,w=g,b=y;g=(C=r.lencode[b+((l&(1<<v+w)-1)>>v)])>>>16&255,y=65535&C,!(v+(_=C>>>24)<=d);){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}l>>>=v,d-=v,r.back+=v}if(l>>>=_,d-=_,r.back+=_,r.length=y,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(S=r.extra;d<S;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[l&(1<<r.distbits)-1])>>>16&255,y=65535&C,!((_=C>>>24)<=d);){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(0==(240&g)){for(v=_,w=g,b=y;g=(C=r.distcode[b+((l&(1<<v+w)-1)>>v)])>>>16&255,y=65535&C,!(v+(_=C>>>24)<=d);){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}l>>>=v,d-=v,r.back+=v}if(l>>>=_,d-=_,r.back+=_,64&g){t.msg="invalid distance code",r.mode=30;break}r.offset=y,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(S=r.extra;d<S;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===h)break t;if(f=c-h,r.offset>f){if((f=r.offset-f)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),m=r.window}else m=n,p=s-r.offset,f=r.length;f>h&&(f=h),h-=f,r.length-=f;do{n[s++]=m[p++]}while(--f);0===r.length&&(r.mode=21);break;case 26:if(0===h)break t;n[s++]=r.length,h--,r.mode=21;break;case 27:if(r.wrap){for(;d<32;){if(0===o)break t;o--,l|=i[a++]<<d,d+=8}if(c-=h,t.total_out+=c,r.total+=c,c&&(t.adler=r.check=r.flags?st(r.check,n,c,s-c):nt(r.check,n,c,s-c)),c=h,(r.flags?l:ft(l))!==r.check){t.msg="incorrect data check",r.mode=30;break}l=0,d=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;d<32;){if(0===o)break t;o--,l+=i[a++]<<d,d+=8}if(l!==(4294967295&r.total)){t.msg="incorrect length check",r.mode=30;break}l=0,d=0}r.mode=29;case 29:x=1;break t;case 30:x=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=s,t.avail_out=h,t.next_in=a,t.avail_in=o,r.hold=l,r.bits=d,(r.wsize||c!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&bt(t,t.output,t.next_out,c-t.avail_out),u-=t.avail_in,c-=t.avail_out,t.total_in+=u,t.total_out+=c,r.total+=c,r.wrap&&c&&(t.adler=r.check=r.flags?st(r.check,n,c,t.next_out-c):nt(r.check,n,c,t.next_out-c)),t.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===u&&0===c||4===e)&&0===x&&(x=-5),x}function xt(t,e){var r,i=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?-2:11===r.mode&&nt(1,e,i,0)!==r.check?-3:bt(t,e,i,i)?(r.mode=31,-4):(r.havedict=1,0):-2}var zt={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 St(){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 Ct(){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}var At=Object.prototype.toString,It=function t(e){if(!(this instanceof t))return new t(e);this.options=L({chunkSize:16384,windowBits:0,to:""},e||{});var r=this.options;r.raw&&r.windowBits>=0&&r.windowBits<16&&(r.windowBits=-r.windowBits,0===r.windowBits&&(r.windowBits=-15)),!(r.windowBits>=0&&r.windowBits<16)||e&&e.windowBits||(r.windowBits+=32),r.windowBits>15&&r.windowBits<48&&0==(15&r.windowBits)&&(r.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new St,this.strm.avail_out=0;var i,n,a,s=_t(this.strm,r.windowBits);if(0!==s)throw new Error(zt[s]);if(this.header=new Ct,i=this.strm,n=this.header,i&&i.state&&(0==(2&(a=i.state).wrap)||(a.head=n,n.done=!1)),r.dictionary&&("string"==typeof r.dictionary?r.dictionary=tt(r.dictionary):"[object ArrayBuffer]"===At.call(r.dictionary)&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw&&0!==(s=xt(this.strm,r.dictionary))))throw new Error(zt[s])};function Ot(t){for(var e=t.length;--e>=0;)t[e]=0}It.prototype.push=function(t,e){var r,i,n,a,s,o,h=this.strm,l=this.options.chunkSize,d=this.options.dictionary,u=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?h.input=function(t){for(var e=new Uint8Array(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e}(t):"[object ArrayBuffer]"===At.call(t)?h.input=new Uint8Array(t):h.input=t,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=Y(l),h.next_out=0,h.avail_out=l),2===(r=kt(h,0))&&d&&(o="string"==typeof d?tt(d):"[object ArrayBuffer]"===At.call(d)?new Uint8Array(d):d,r=xt(this.strm,o)),-5===r&&!0===u&&(r=0,u=!1),1!==r&&0!==r)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&1!==r&&(0!==h.avail_in||4!==i&&2!==i)||("string"===this.options.to?(n=it(h.output,h.next_out),a=h.next_out-n,s=rt(h.output,n),h.next_out=a,h.avail_out=l-a,a&&J(h.output,h.output,n,a,0),this.onData(s)):this.onData(Z(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(u=!0)}while((h.avail_in>0||0===h.avail_out)&&1!==r);return 1===r&&(i=4),4===i?(r=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0}(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==i||(this.onEnd(0),h.avail_out=0,!0)},It.prototype.onData=function(t){this.chunks.push(t)},It.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=X(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Pt,Et,Ft,Bt,Dt,Ut,jt,Rt,Nt,Tt=[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],Wt=[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],Lt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Zt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Kt(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function Mt(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Ht(t){return t<256?Ft[t]:Ft[256+(t>>>7)]}function Jt(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function Xt(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,Jt(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function Yt(t,e,r){Xt(t,r[2*e],r[2*e+1])}function qt(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1}function Gt(t,e,r){var i,n,a=new Array(16),s=0;for(i=1;i<=15;i++)a[i]=s=s+r[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=qt(a[o]++,o))}}function Qt(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Vt(t){t.bi_valid>8?Jt(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function $t(t,e,r,i){var n=2*e,a=2*r;return t[n]<t[a]||t[n]===t[a]&&i[e]<=i[r]}function te(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&$t(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!$t(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}function ee(t,e,r){var i,n,a,s,o=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],n=t.pending_buf[t.l_buf+o],o++,0===i?Yt(t,n,e):(Yt(t,(a=Bt[n])+256+1,e),0!==(s=Tt[a])&&Xt(t,n-=Dt[a],s),Yt(t,a=Ht(--i),r),0!==(s=Wt[a])&&Xt(t,i-=Ut[a],s))}while(o<t.last_lit);Yt(t,256,e)}function re(t,e){var r,i,n,a=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,h=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<h;r++)0!==a[2*r]?(t.heap[++t.heap_len]=l=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)a[2*(n=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=l,r=t.heap_len>>1;r>=1;r--)te(t,a,r);n=h;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],te(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,a[2*n]=a[2*r]+a[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,a[2*r+1]=a[2*i+1]=n,t.heap[1]=n++,te(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,a,s,o,h=e.dyn_tree,l=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(a=h[2*h[2*(i=t.heap[r])+1]+1]+1)>p&&(a=p,m++),h[2*i+1]=a,i>l||(t.bl_count[a]++,s=0,i>=f&&(s=c[i-f]),o=h[2*i],t.opt_len+=o*(a+s),u&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==m){do{for(a=p-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(a=p;0!==a;a--)for(i=t.bl_count[a];0!==i;)(n=t.heap[--r])>l||(h[2*n+1]!==a&&(t.opt_len+=(a-h[2*n+1])*h[2*n],h[2*n+1]=a),i--)}}(t,e),Gt(a,l,t.bl_count)}function ie(t,e,r){var i,n,a=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=e[2*(i+1)+1],++o<h&&n===s||(o<l?t.bl_tree[2*n]+=o:0!==n?(n!==a&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=n,0===s?(h=138,l=3):n===s?(h=6,l=3):(h=7,l=4))}function ne(t,e,r){var i,n,a=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),i=0;i<=r;i++)if(n=s,s=e[2*(i+1)+1],!(++o<h&&n===s)){if(o<l)do{Yt(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==a&&(Yt(t,n,t.bl_tree),o--),Yt(t,16,t.bl_tree),Xt(t,o-3,2)):o<=10?(Yt(t,17,t.bl_tree),Xt(t,o-3,3)):(Yt(t,18,t.bl_tree),Xt(t,o-11,7));o=0,a=n,0===s?(h=138,l=3):n===s?(h=6,l=3):(h=7,l=4)}}var ae=!1;function se(t){ae||(!function(){var t,e,r,i,n,a=new Array(16);for(Ot(Pt=new Array(576)),Ot(Et=new Array(60)),Ot(Ft=new Array(512)),Ot(Bt=new Array(256)),Ot(Dt=new Array(29)),Ot(Ut=new Array(30)),r=0,i=0;i<28;i++)for(Dt[i]=r,t=0;t<1<<Tt[i];t++)Bt[r++]=i;for(Bt[r-1]=i,n=0,i=0;i<16;i++)for(Ut[i]=n,t=0;t<1<<Wt[i];t++)Ft[n++]=i;for(n>>=7;i<30;i++)for(Ut[i]=n<<7,t=0;t<1<<Wt[i]-7;t++)Ft[256+n++]=i;for(e=0;e<=15;e++)a[e]=0;for(t=0;t<=143;)Pt[2*t+1]=8,t++,a[8]++;for(;t<=255;)Pt[2*t+1]=9,t++,a[9]++;for(;t<=279;)Pt[2*t+1]=7,t++,a[7]++;for(;t<=287;)Pt[2*t+1]=8,t++,a[8]++;for(Gt(Pt,287,a),t=0;t<30;t++)Et[2*t+1]=5,Et[2*t]=qt(t,5);jt=new Kt(Pt,Tt,257,286,15),Rt=new Kt(Et,Wt,0,30,15),Nt=new Kt(new Array(0),Lt,0,19,7)}(),ae=!0),t.l_desc=new Mt(t.dyn_ltree,jt),t.d_desc=new Mt(t.dyn_dtree,Rt),t.bl_desc=new Mt(t.bl_tree,Nt),t.bi_buf=0,t.bi_valid=0,Qt(t)}function oe(t,e,r,i){Xt(t,0+(i?1:0),3),function(t,e,r,i){Vt(t),i&&(Jt(t,r),Jt(t,~r)),J(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}(t,e,r,!0)}function he(t){Xt(t,2,3),Yt(t,256,Pt),function(t){16===t.bi_valid?(Jt(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}function le(t,e,r,i){var n,a,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),re(t,t.l_desc),re(t,t.d_desc),s=function(t){var e;for(ie(t,t.dyn_ltree,t.l_desc.max_code),ie(t,t.dyn_dtree,t.d_desc.max_code),re(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*Zt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==e?oe(t,e,r,i):4===t.strategy||a===n?(Xt(t,2+(i?1:0),3),ee(t,Pt,Et)):(Xt(t,4+(i?1:0),3),function(t,e,r,i){var n;for(Xt(t,e-257,5),Xt(t,r-1,5),Xt(t,i-4,4),n=0;n<i;n++)Xt(t,t.bl_tree[2*Zt[n]+1],3);ne(t,t.dyn_ltree,e-1),ne(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),ee(t,t.dyn_ltree,t.dyn_dtree)),Qt(t),i&&Vt(t)}function de(t,e,r){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(Bt[r]+256+1)]++,t.dyn_dtree[2*Ht(e)]++),t.last_lit===t.lit_bufsize-1}function ue(t,e){return t.msg=zt[e],e}function ce(t){return(t<<1)-(t>4?9:0)}function fe(t){for(var e=t.length;--e>=0;)t[e]=0}function pe(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(J(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function me(t,e){le(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,pe(t.strm)}function _e(t,e){t.pending_buf[t.pending++]=e}function ge(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function ye(t,e){var r,i,n=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,l=t.window,d=t.w_mask,u=t.prev,c=t.strstart+258,f=l[a+s-1],p=l[a+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(l[(r=e)+s]===p&&l[r+s-1]===f&&l[r]===l[a]&&l[++r]===l[a+1]){a+=2,r++;do{}while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&a<c);if(i=258-(c-a),a=c-258,i>s){if(t.match_start=e,s=i,i>=o)break;f=l[a+s-1],p=l[a+s]}}}while((e=u[e&d])>h&&0!=--n);return s<=t.lookahead?s:t.lookahead}function ve(t){var e,r,i,n,a,s,o,h,l,d,u=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=u+(u-262)){J(t.window,t.window,u,u,0),t.match_start-=u,t.strstart-=u,t.block_start-=u,e=r=t.hash_size;do{i=t.head[--e],t.head[e]=i>=u?i-u:0}while(--r);e=r=u;do{i=t.prev[--e],t.prev[e]=i>=u?i-u:0}while(--r);n+=u}if(0===t.strm.avail_in)break;if(s=t.strm,o=t.window,h=t.strstart+t.lookahead,l=n,d=void 0,(d=s.avail_in)>l&&(d=l),r=0===d?0:(s.avail_in-=d,J(o,s.input,s.next_in,d,h),1===s.state.wrap?s.adler=nt(s.adler,o,d,h):2===s.state.wrap&&(s.adler=st(s.adler,o,d,h)),s.next_in+=d,s.total_in+=d,d),t.lookahead+=r,t.lookahead+t.insert>=3)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[a+3-1])&t.hash_mask,t.prev[a&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=a,a++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function we(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ve(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,me(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(me(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(me(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(me(t,!1),t.strm.avail_out),1)}function be(t,e){for(var r,i;;){if(t.lookahead<262){if(ve(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=ye(t,r)),t.match_length>=3)if(i=de(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=de(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(me(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(me(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(me(t,!1),0===t.strm.avail_out)?1:2}function ke(t,e){for(var r,i,n;;){if(t.lookahead<262){if(ve(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-262&&(t.match_length=ye(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=de(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(me(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=de(t,0,t.window[t.strstart-1]))&&me(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=de(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(me(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(me(t,!1),0===t.strm.avail_out)?1:2}function xe(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var ze=function(){var t=[new xe(0,0,0,0,we),new xe(4,4,8,4,be),new xe(4,5,16,8,be),new xe(4,6,32,32,be),new xe(4,4,16,16,ke),new xe(8,16,32,32,ke),new xe(8,16,128,128,ke),new xe(8,32,128,256,ke),new xe(32,128,258,1024,ke),new xe(32,258,258,4096,ke)];return ze=function(){return t},t};function Se(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=q(1146),this.dyn_dtree=q(122),this.bl_tree=q(78),fe(this.dyn_ltree),fe(this.dyn_dtree),fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=q(16),this.heap=q(573),fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=q(573),fe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ce(t){var e=function(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,se(e),0):ue(t,-2)}(t);return 0===e&&function(t){t.window_size=2*t.w_size,fe(t.head);var e=ze();t.max_lazy_match=e[t.level].max_lazy,t.good_match=e[t.level].good_length,t.nice_match=e[t.level].nice_length,t.max_chain_length=e[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function Ae(t,e){var r,i,n,a;if(!t||!t.state||e>5||e<0)return t?ue(t,-2):-2;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||666===i.status&&4!==e)return ue(t,0===t.avail_out?-5:-2);if(i.strm=t,r=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,_e(i,31),_e(i,139),_e(i,8),i.gzhead?(_e(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),_e(i,255&i.gzhead.time),_e(i,i.gzhead.time>>8&255),_e(i,i.gzhead.time>>16&255),_e(i,i.gzhead.time>>24&255),_e(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),_e(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(_e(i,255&i.gzhead.extra.length),_e(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=st(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(_e(i,0),_e(i,0),_e(i,0),_e(i,0),_e(i,0),_e(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),_e(i,3),i.status=113);else{var s=8+(i.w_bits-8<<4)<<8;s|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(s|=32),s+=31-s%31,i.status=113,ge(i,s),0!==i.strstart&&(ge(i,t.adler>>>16),ge(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>n&&(t.adler=st(t.adler,i.pending_buf,i.pending-n,n)),pe(t),n=i.pending,i.pending!==i.pending_buf_size));)_e(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=st(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=st(t.adler,i.pending_buf,i.pending-n,n)),pe(t),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,_e(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>n&&(t.adler=st(t.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=st(t.adler,i.pending_buf,i.pending-n,n)),pe(t),n=i.pending,i.pending===i.pending_buf_size)){a=1;break}a=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,_e(i,a)}while(0!==a);i.gzhead.hcrc&&i.pending>n&&(t.adler=st(t.adler,i.pending_buf,i.pending-n,n)),0===a&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&pe(t),i.pending+2<=i.pending_buf_size&&(_e(i,255&t.adler),_e(i,t.adler>>8&255),t.adler=0,i.status=113)):i.status=113),0!==i.pending){if(pe(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&ce(e)<=ce(r)&&4!==e)return ue(t,-5);if(666===i.status&&0!==t.avail_in)return ue(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&666!==i.status){var o=2===i.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(ve(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=de(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(me(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(me(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(me(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var r,i,n,a,s=t.window;;){if(t.lookahead<=258){if(ve(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=s[n=t.strstart-1])===s[++n]&&i===s[++n]&&i===s[++n]){a=t.strstart+258;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<a);t.match_length=258-(a-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=de(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=de(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(me(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(me(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(me(t,!1),0===t.strm.avail_out)?1:2}(i,e):ze()[i.level].func(i,e);if(3!==o&&4!==o||(i.status=666),1===o||3===o)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===o&&(1===e?he(i):5!==e&&(oe(i,0,0,!1),3===e&&(fe(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),pe(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(_e(i,255&t.adler),_e(i,t.adler>>8&255),_e(i,t.adler>>16&255),_e(i,t.adler>>24&255),_e(i,255&t.total_in),_e(i,t.total_in>>8&255),_e(i,t.total_in>>16&255),_e(i,t.total_in>>24&255)):(ge(i,t.adler>>>16),ge(i,65535&t.adler)),pe(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)}var Ie=Object.prototype.toString,Oe=function(t){this.options=L({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new St,this.strm.avail_out=0;var r,i,n=function(t,e,r,i,n,a){if(!t)return-2;var s=1;if(-1===e&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>9||8!==r||i<8||i>15||e<0||e>9||a<0||a>4)return ue(t,-2);8===i&&(i=9);var o=new Se;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=Y(2*o.w_size),o.head=q(o.hash_size),o.prev=q(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=Y(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=a,o.method=r,Ce(t)}(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(zt[n]);if(e.header&&(r=this.strm,i=e.header,r&&r.state&&(2!==r.state.wrap||(r.state.gzhead=i))),e.dictionary){var a;if(a="string"==typeof e.dictionary?tt(e.dictionary):"[object ArrayBuffer]"===Ie.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=function(t,e){var r,i,n,a,s,o,h,l,d=e.length;if(!t||!t.state)return-2;if(2===(a=(r=t.state).wrap)||1===a&&42!==r.status||r.lookahead)return-2;for(1===a&&(t.adler=nt(t.adler,e,d,0)),r.wrap=0,d>=r.w_size&&(0===a&&(fe(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=Y(r.w_size),J(l,e,d-r.w_size,r.w_size,0),e=l,d=r.w_size),s=t.avail_in,o=t.next_in,h=t.input,t.avail_in=d,t.next_in=0,t.input=e,ve(r);r.lookahead>=3;){i=r.strstart,n=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+3-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--n);r.strstart=i,r.lookahead=2,ve(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=o,t.input=h,t.avail_in=s,r.wrap=a,0}(this.strm,a)))throw new Error(zt[n]);this._dict_set=!0}};Oe.prototype.push=function(t,e){var r,i,n,a=this.strm,s=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=tt(t):"[object ArrayBuffer]"===Ie.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=Y(s),a.next_out=0,a.avail_out=s),1!==(r=Ae(a,i))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(et(n=Z(a.output,a.next_out),n.length)):this.onData(Z(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==r);return 4===i?(r=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?ue(t,-2):(t.state=null,113===e?ue(t,-3):0):-2}(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==i||(this.onEnd(0),a.avail_out=0,!0)},Oe.prototype.onData=function(t){this.chunks.push(t)},Oe.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=X(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Pe=function(){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";Pe=function(){return t}},Ee=function(t){function e(e,r){t.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=r,this.meta={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(f(Pe(),t.data),!1)},e.prototype.flush=function(){t.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},e.prototype.cleanUp=function(){t.prototype.cleanUp.call(this),this._pako=null},e.prototype._createPako=function(){var t=this,e={raw:!0,level:this._pakoOptions.level||-1};this._pako="Deflate"===this._pakoAction?new Oe(e):new It(e),this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},e}(w),Fe={STORE:{magic:"\0\0",compressWorker:function(){return new w("STORE compression")},uncompressWorker:function(){return new w("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(t){return new Ee("Deflate",t)},uncompressWorker:function(){return new Ee("Inflate",{})}}},Be=function(t,e){var r,i="";for(r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i},De=function(t,e,r,i,n,a){var s,o,h=t.file,l=t.compression,d=a!==k,u=f("string",a(h.name)),c=f("string",k(h.name)),p=h.comment,m=f("string",a(p)),_=f("string",k(p)),g=c.length!==h.name.length,y=_.length!==p.length,v="",w="",b="",x=h.dir,z=h.date,S={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(S.crc32=t.crc32,S.compressedSize=t.compressedSize,S.uncompressedSize=t.uncompressedSize);var C=0;e&&(C|=8),d||!g&&!y||(C|=2048);var A=0,I=0;x&&(A|=16),"UNIX"===n?(I=798,A|=function(t,e){var r=t;return t||(r=e?16893:33204),(65535&r)<<16}(h.unixPermissions,x)):(I=20,A|=function(t,e){return 63&(t||0)}(h.dosPermissions)),s=z.getUTCHours(),s<<=6,s|=z.getUTCMinutes(),s<<=5,s|=z.getUTCSeconds()/2,o=z.getUTCFullYear()-1980,o<<=4,o|=z.getUTCMonth()+1,o<<=5,o|=z.getUTCDate(),g&&(w=Be(1,1)+Be(U(u),4)+c,v+="up"+Be(w.length,2)+w),y&&(b=Be(1,1)+Be(U(m),4)+_,v+="uc"+Be(b.length,2)+b);var O="";return O+="\n\0",O+=Be(C,2),O+=l.magic,O+=Be(s,2),O+=Be(o,2),O+=Be(S.crc32,4),O+=Be(S.compressedSize,4),O+=Be(S.uncompressedSize,4),O+=Be(u.length,2),{fileRecord:"PK"+(O+=Be(v.length,2))+u+v,dirRecord:"PK"+Be(I,2)+O+Be(m.length,2)+"\0\0\0\0"+Be(A,4)+Be(i,4)+u+v+m}},Ue=function(t){return"PK\b"+Be(t.crc32,4)+Be(t.compressedSize,4)+Be(t.uncompressedSize,4)},je=function(t){function e(e,r,i,n){t.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=r,this.zipPlatform=i,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(e){var r=e.meta.percent||0,i=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,t.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(r+100*(i-n-1))/i:100}}))},e.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=De(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},e.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=De(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:Ue(t),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},e.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var r=this.bytesWritten-t,i=function(t,e,r,i,n){var a=f("string",n(i));return"PK\0\0\0\0"+Be(t,2)+Be(t,2)+Be(e,4)+Be(r,4)+Be(a.length,2)+a}(this.dirRecords.length,r,t,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},e.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},e.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()})),t.on("error",(function(t){e.error(t)})),this},e.prototype.resume=function(){return!!t.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},e.prototype.error=function(e){var r=this._sources;if(!t.prototype.error.call(this,e))return!1;for(var i=0;i<r.length;i++)try{r[i].error(e)}catch(t){}return!0},e.prototype.lock=function(){t.prototype.lock.call(this);for(var e=this._sources,r=0;r<e.length;r++)e[r].lock()},e}(w),Re=function(t,e,r){var i=new je(e.streamFiles,r,e.platform,e.encodeFileName),n=0;try{t.forEach((function(t,r){n++;var a=function(t,e){var r=t||e,i=Fe[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,e.compression),s=r.options.compressionOptions||e.compressionOptions||{},o=r.dir,h=r.date;r._compressWorker(a,s).withStreamInfo("file",{name:t,dir:o,date:h,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(i)})),i.entriesCount=n}catch(t){i.error(t)}return i},Ne=function(t){this.data=t,this.length=t.length,this.index=0,this.zero=0};Ne.prototype.checkOffset=function(t){this.checkIndex(this.index+t)},Ne.prototype.checkIndex=function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},Ne.prototype.setIndex=function(t){this.checkIndex(t),this.index=t},Ne.prototype.skip=function(t){this.setIndex(this.index+t)},Ne.prototype.byteAt=function(t){},Ne.prototype.readInt=function(t){var e,r=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},Ne.prototype.readString=function(t){return f("string",this.readData(t))},Ne.prototype.readData=function(t){},Ne.prototype.lastIndexOfSignature=function(t){},Ne.prototype.readAndCheckSignature=function(t){},Ne.prototype.readDate=function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))};var Te=Ne,We=function(t){function e(e){t.call(this,e);for(var r=0;r<this.data.length;r++)e[r]=255&e[r]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.byteAt=function(t){return this.data[this.zero+t]},e.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2),n=t.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===e&&this.data[a+1]===r&&this.data[a+2]===i&&this.data[a+3]===n)return a-this.zero;return-1},e.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2),n=t.charCodeAt(3),a=this.readData(4);return e===a[0]&&r===a[1]&&i===a[2]&&n===a[3]},e.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e}(Te),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.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},e.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},e.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},e.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e}(Te),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.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e}(We);function Ke(t){var e=p(t);return m(e),"string"!==e||i.uint8array?i.uint8array?new Ze(f("uint8array",t)):new We(f("array",t)):new Le(t)}var Me=function(t,e){this.options=t,this.loadOptions=e};Me.prototype.isEncrypted=function(){return 1==(1&this.bitFlag)},Me.prototype.useUTF8=function(){return 2048==(2048&this.bitFlag)},Me.prototype.readLocalPart=function(t){var e,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in Fe)if(Fe.hasOwnProperty(e)&&Fe[e].magic===t)return Fe[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+_(this.compressionMethod)+" unknown (inner file : "+f("string",this.fileName)+")");this.decompressed=new N(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},Me.prototype.readCentralPart=function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},Me.prototype.processAttributes=function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},Me.prototype.parseZIP64ExtraField=function(t){if(this.extraFields[1]){var e=Ke(this.extraFields[1].value);-1===this.uncompressedSize&&(this.uncompressedSize=e.readInt(8)),-1===this.compressedSize&&(this.compressedSize=e.readInt(8)),-1===this.localHeaderOffset&&(this.localHeaderOffset=e.readInt(8)),-1===this.diskNumberStart&&(this.diskNumberStart=e.readInt(4))}},Me.prototype.readExtraFields=function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<n;)e=t.readInt(2),r=t.readInt(2),i=t.readData(r),this.extraFields[e]={id:e,length:r,value:i}},Me.prototype.handleUTF8=function(){var t=i.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=x(this.fileName),this.fileCommentStr=x(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var r=f(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var a=f(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},Me.prototype.findExtraFieldUnicodePath=function(){var t=this.extraFields[28789];if(t){var e=Ke(t.value);return 1!==e.readInt(1)||U(this.fileName)!==e.readInt(4)?null:x(e.readData(t.length-5))}return null},Me.prototype.findExtraFieldUnicodeComment=function(){var t=this.extraFields[25461];if(t){var e=Ke(t.value);return 1!==e.readInt(1)||U(this.fileComment)!==e.readInt(4)?null:x(e.readData(t.length-5))}return null};var He=Me,Je=function(t){this.files=[],this.loadOptions=t};function Xe(e){return new t.Promise((function(t,r){var i=e.decompressed.getContentWorker().pipe(new j);i.on("error",(function(t){r(t)})).on("end",(function(){i.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}function Ye(e,r){var i=this;return r=y(r||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:x}),v("the loaded zip file",e,!0,r.optimizedBinaryString,r.base64).then((function(t){var e=new Je(r);return e.load(t),e})).then((function(e){var i=[t.Promise.resolve(e)],n=e.files;if(r.checkCRC32)for(var a=0;a<n.length;a++)i.push(Xe(n[a]));return t.Promise.all(i)})).then((function(t){for(var e=t.shift(),n=e.files,a=0;a<n.length;a++){var s=n[a];i.file(s.fileNameStr,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:r.createFolders})}return e.zipComment.length&&(i.comment=e.zipComment),i}))}Je.prototype.checkSignature=function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+_(e)+", expected "+_(t)+")")}},Je.prototype.isSignature=function(t,e){var r=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(r),i},Je.prototype.readBlockEndOfCentral=function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=i.uint8array?"uint8array":"array",r=f(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},Je.prototype.readBlockZip64EndOfCentral=function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,r,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),r=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:r}},Je.prototype.readBlockZip64EndOfCentralLocator=function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},Je.prototype.readLocalFiles=function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature("PK"),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},Je.prototype.readCentralDir=function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature("PK");)(t=new He({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},Je.prototype.readEndOfCentral=function(){var t=this.reader.lastIndexOfSignature("PK");if(t<0)throw!this.isSignature(0,"PK")?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(t);var e=t;if(this.checkSignature("PK"),this.readBlockEndOfCentral(),65535===this.diskNumber||65535===this.diskWithCentralDirStart||65535===this.centralDirRecordsOnThisDisk||65535===this.centralDirRecords||-1===this.centralDirSize||-1===this.centralDirOffset){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature("PK"))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature("PK"),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,"PK")&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature("PK"),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature("PK"),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var i=e-r;if(i>0)this.isSignature(e,"PK")||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},Je.prototype.prepareReader=function(t){this.reader=Ke(t)},Je.prototype.load=function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()};var qe=function(t,e,r){var i,n=p(e),a=y(r||{},E);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=Qe(t)),a.createFolders&&(i=Ge(t))&&Ve.call(this,i,!0);var s="string"===n&&!1===a.binary&&!1===a.base64;r&&void 0!==r.binary||(a.binary=!s),(e instanceof N&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",n="string");var o=null;o=e instanceof N||e instanceof w?e:v(t,e,a.binary,a.optimizedBinaryString,a.base64);var h=new T(t,o,a);this.files[t]=h},Ge=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},Qe=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},Ve=function(t,e){return e=void 0===e||e,t=Qe(t),this.files[t]||qe.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function $e(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var tr=function t(){if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new t;for(var r in this)"function"!=typeof this[r]&&(e[r]=this[r]);return e}},er={support:{configurable:!0},defaults:{configurable:!0},version:{configurable:!0},external:{configurable:!0}};tr.prototype.load=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},tr.prototype.forEach=function(t){var e,r,i;for(e in this.files)i=this.files[e],(r=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(r,i)},tr.prototype.filter=function(t){var e=[];return this.forEach((function(r,i){t(r,i)&&e.push(i)})),e},tr.prototype.file=function(t,e,r){if(1===arguments.length){if($e(t)){var i=t;return this.filter((function(t,e){return!e.dir&&i.test(t)}))}var n=this.files[this.root+t];return n&&!n.dir?n:null}return t=this.root+t,qe.call(this,t,e,r),this},tr.prototype.folder=function(t){if(!t)return this;if($e(t))return this.filter((function(e,r){return r.dir&&t.test(e)}));var e=this.root+t,r=Ve.call(this,e),i=this.clone();return i.root=r.name,i},tr.prototype.remove=function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter((function(e,r){return r.name.slice(0,t.length)===t})),i=0;i<r.length;i++)delete this.files[r[i].name];return this},tr.prototype.generate=function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},tr.prototype.generateInternalStream=function(t){var e,r={};try{if((r=y(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:k})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");m(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var i=r.comment||this.comment||"";e=Re(this,r,i)}catch(t){(e=new w("error")).error(t)}return new P(e,r.type||"string",r.mimeType)},tr.prototype.generateAsync=function(t,e){return this.generateInternalStream(t).accumulate(e)},tr.prototype.loadAsync=function(t,e){return Ye.apply(this,[t,e])},tr.loadAsync=function(t,e){return(new tr).loadAsync(t,e)},er.support.get=function(){return i},er.defaults.get=function(){return E},er.version.get=function(){return"3.2.2-esm"},er.external.get=function(){return t},Object.defineProperties(tr,er);export{tr as default};