scratch4js 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +118 -0
- package/dist/LICENSE +373 -0
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/assets.d.ts +61 -0
- package/dist/esm/format.d.ts +7 -0
- package/dist/esm/ids.d.ts +6 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/md5.d.ts +7 -0
- package/dist/esm/project.d.ts +123 -0
- package/dist/esm/target.d.ts +217 -0
- package/dist/umd/index.js +3 -0
- package/dist/umd/index.js.LICENSE.txt +11 -0
- package/dist/umd/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! LICENSE: index.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.scratch4js=e():t.scratch4js=e()}(globalThis,()=>(()=>{var t={"../../node_modules/.pnpm/@turbowarp+jszip@3.12.0/node_modules/@turbowarp/jszip/dist/jszip.min.js"(t,e,r){t.exports=(function t(e,i,n){function s(o,h){if(!i[o]){if(!e[o]){var u=r("../../node_modules/.pnpm/@turbowarp+jszip@3.12.0/node_modules/@turbowarp/jszip/dist sync recursive");if(!h&&u)return u(o,!0);if(a)return a(o,!0);var l=Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[o]={exports:{}};e[o][0].call(d.exports,function(t){return s(e[o][1][t]||t)},d,d.exports,t,e,i,n)}return i[o].exports}for(var a=r("../../node_modules/.pnpm/@turbowarp+jszip@3.12.0/node_modules/@turbowarp/jszip/dist sync recursive"),o=0;o<n.length;o++)s(n[o]);return s})({1:[function(t,e,r){"use strict";var i=t("./utils"),n=t("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(t){for(var e,r,n,a,o,h,u,l=[],d=0,c=t.length,f=c,p="string"!==i.getTypeOf(t);d<t.length;)f=c-d,n=p?(e=t[d++],r=d<c?t[d++]:0,d<c?t[d++]:0):(e=t.charCodeAt(d++),r=d<c?t.charCodeAt(d++):0,d<c?t.charCodeAt(d++):0),a=e>>2,o=(3&e)<<4|r>>4,h=1<f?(15&r)<<2|n>>6:64,u=2<f?63&n:64,l.push(s.charAt(a)+s.charAt(o)+s.charAt(h)+s.charAt(u));return l.join("")},r.decode=function(t){var e,r,i,a,o,h,u=0,l=0,d="data:";if(t.substr(0,d.length)===d)throw Error("Invalid base64 input, it looks like a data url.");var c,f=3*(t=t.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(t.charAt(t.length-1)===s.charAt(64)&&f--,t.charAt(t.length-2)===s.charAt(64)&&f--,f%1!=0)throw Error("Invalid base64 input, bad content length.");for(c=n.uint8array?new Uint8Array(0|f):Array(0|f);u<t.length;)e=s.indexOf(t.charAt(u++))<<2|(a=s.indexOf(t.charAt(u++)))>>4,r=(15&a)<<4|(o=s.indexOf(t.charAt(u++)))>>2,i=(3&o)<<6|(h=s.indexOf(t.charAt(u++))),c[l++]=e,64!==o&&(c[l++]=r),64!==h&&(c[l++]=i);return c}},{"./support":30,"./utils":32}],2:[function(t,e,r){"use strict";var i=t("./external"),n=t("./stream/DataWorker"),s=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function o(t,e,r,i,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=r,this.compression=i,this.compressedContent=n}o.prototype={getContentWorker:function(){var t=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(t,e,r){return t.pipe(new s).pipe(new a("uncompressedSize")).pipe(e.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",e)},e.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,e,r){"use strict";var i=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,e,r){"use strict";var i=t("./utils"),n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,r){var i=0+r;t^=-1;for(var s=0;s<i;s++)t=t>>>8^n[255&(t^e[s])];return -1^t}(0|e,t,t.length):function(t,e,r){var i=0+r;t^=-1;for(var s=0;s<i;s++)t=t>>>8^n[255&(t^e.charCodeAt(s))];return -1^t}(0|e,t,t.length):0}},{"./utils":32}],5:[function(t,e,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,e,r){"use strict";e.exports={Promise:"u">typeof Promise?Promise:t("lie")}},{lie:37}],7:[function(t,e,r){"use strict";var i="u">typeof Uint8Array&&"u">typeof Uint16Array&&"u">typeof Uint32Array,n=t("./utils"),s=t("./stream/GenericWorker"),a=i?"uint8array":"array";function o(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}r.magic="\b\0",n.inherits(o,s),o.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(n.transformTo(a,t.data),!1)},o.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},o.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},o.prototype._createPako=function(){var e=t("pako");this._pako=new e[this._pakoAction]({chunkSize:65536,raw:!0,level:this._pakoOptions.level||-1});var r=this;this._pako.onData=function(t){r.push({data:t,meta:r.meta})}},r.compressWorker=function(t){return new o("Deflate",t)},r.uncompressWorker=function(){return new o("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,e,r){"use strict";function i(t,e){var r,i="";for(r=0;r<e;r++)i+=String.fromCharCode(255&t),t>>>=8;return i}function n(t,e,r,n,a,l){var d,c,f,p,m=t.file,_=t.compression,g=l!==o.utf8encode,b=s.transformTo("string",l(m.name)),v=s.transformTo("string",o.utf8encode(m.name)),y=m.comment,w=s.transformTo("string",l(y)),k=s.transformTo("string",o.utf8encode(y)),x=v.length!==m.name.length,S=k.length!==y.length,C="",z="",A="",E=m.dir,j=m.date,O={crc32:0,compressedSize:0,uncompressedSize:0};e&&!r||(O.crc32=t.crc32,O.compressedSize=t.compressedSize,O.uncompressedSize=t.uncompressedSize);var I=0;e&&(I|=8),!g&&(x||S)&&(I|=2048);var B=0,T=0;E&&(B|=16),"UNIX"===a?(T=798,B|=(d=m.unixPermissions,c=d,d||(c=E?16893:33204),(65535&c)<<16)):(T=20,B|=63&(m.dosPermissions||0)),f=(j.getUTCHours()<<6|j.getUTCMinutes())<<5|j.getUTCSeconds()/2,p=(j.getUTCFullYear()-1980<<4|j.getUTCMonth()+1)<<5|j.getUTCDate(),x&&(z=i(1,1)+i(h(b),4)+v,C+="up"+i(z.length,2)+z),S&&(A=i(1,1)+i(h(w),4)+k,C+="uc"+i(A.length,2)+A);var R="";return R+="\n\0",R+=i(I,2),R+=_.magic,R+=i(f,2),R+=i(p,2),R+=i(O.crc32,4),R+=i(O.compressedSize,4),R+=i(O.uncompressedSize,4),R+=i(b.length,2),R+=i(C.length,2),{fileRecord:u.LOCAL_FILE_HEADER+R+b+C,dirRecord:u.CENTRAL_FILE_HEADER+i(T,2)+R+i(w.length,2)+"\0\0\0\0"+i(B,4)+i(n,4)+b+C+w}}var s=t("../utils"),a=t("../stream/GenericWorker"),o=t("../utf8"),h=t("../crc32"),u=t("../signature");function l(t,e,r,i){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(l,a),l.prototype.push=function(t){var e=t.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,a.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:r?(e+100*(r-i-1))/r:100}}))},l.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var r=n(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,r=n(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),e)this.push({data:u.DATA_DESCRIPTOR+i(t.crc32,4)+i(t.compressedSize,4)+i(t.uncompressedSize,4),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var t,e,r,n,a=this.bytesWritten,o=0;o<this.dirRecords.length;o++)this.push({data:this.dirRecords[o],meta:{percent:100}});var h=this.bytesWritten-a,l=(t=this.dirRecords.length,e=this.zipComment,r=this.encodeFileName,n=s.transformTo("string",r(e)),u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(t,2)+i(t,2)+i(h,4)+i(a,4)+i(n.length,2)+n);this.push({data:l,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.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},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(t){var e=this._sources;if(!a.prototype.error.call(this,t))return!1;for(var r=0;r<e.length;r++)try{e[r].error(t)}catch(t){}return!0},l.prototype.lock=function(){a.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},e.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,e,r){"use strict";var i=t("../compressions"),n=t("./ZipFileWorker");r.generateWorker=function(t,e,r){var s=new n(e.streamFiles,r,e.platform,e.encodeFileName),a=0;try{t.forEach(function(t,r){a++;var n=function(t,e){var r=t||e,n=i[r];if(!n)throw Error(r+" is not a valid compression method !");return n}(r.options.compression,e.compression),o=r.options.compressionOptions||e.compressionOptions||{},h=r.dir,u=r.date;r._compressWorker(n,o).withStreamInfo("file",{name:t,dir:h,date:u,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(s)}),s.entriesCount=a}catch(t){s.error(t)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,e,r){"use strict";function i(){if(!(this instanceof i))return new i;if(arguments.length)throw 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 t=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}(i.prototype=t("./object")).loadAsync=t("./load"),i.support=t("./support"),i.defaults=t("./defaults"),i.loadAsync=function(t,e){return(new i).loadAsync(t,e)},i.external=t("./external"),e.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,e,r){"use strict";var i=t("./utils"),n=t("./external"),s=t("./utf8"),a=t("./zipEntries"),o=t("./stream/Crc32Probe"),h=t("./nodejsUtils");e.exports=function(t,e){var r=this;return e=i.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),h.isNode&&h.isStream(t)?n.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var r=new a(e);return r.load(t),r}).then(function(t){var r=[n.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var s=0;s<i.length;s++)r.push(function(t){return new n.Promise(function(e,r){var i=t.decompressed.getContentWorker().pipe(new o);i.on("error",function(t){r(t)}).on("end",function(){i.streamInfo.crc32!==t.decompressed.crc32?r(Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}(i[s]));return n.Promise.all(r)}).then(function(t){for(var n=t.shift(),s=n.files,a=0;a<s.length;a++){var o=s[a],h=o.fileNameStr,u=i.resolve(o.fileNameStr);r.file(u,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders}),o.dir||(r.file(u).unsafeOriginalName=h)}return n.zipComment.length&&(r.comment=n.zipComment),r})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,e,r){"use strict";var i=t("../utils"),n=t("../stream/GenericWorker");function s(t,e){n.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}i.inherits(s,n),s.prototype._bindStream=function(t){var e=this;(this._stream=t).pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},s.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,e,r){"use strict";var i=t("readable-stream").Readable;function n(t,e,r){i.call(this,e),this._helper=t;var n=this;t.on("data",function(t,e){n.push(t)||n._helper.pause(),r&&r(e)}).on("error",function(t){n.emit("error",t)}).on("end",function(){n.push(null)})}t("../utils").inherits(n,i),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(t,e,r){"use strict";e.exports={isNode:"u">typeof Buffer,newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if("number"==typeof t)throw Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}},{}],15:[function(t,e,r){"use strict";function i(t,e,r){var i,n=s.getTypeOf(e),o=s.extend(r||{},h);o.date=o.date||new Date(1716106843e3),null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(t=m(t)),o.createFolders&&(i=p(t))&&_.call(this,i,!0);var d="string"===n&&!1===o.binary&&!1===o.base64;r&&void 0!==r.binary||(o.binary=!d),(e instanceof u&&0===e.uncompressedSize||o.dir||!e||0===e.length)&&(o.base64=!1,o.binary=!0,e="",o.compression="STORE",n="string");var g=null;g=e instanceof u||e instanceof a?e:c.isNode&&c.isStream(e)?new f(t,e):s.prepareContent(t,e,o.binary,o.optimizedBinaryString,o.base64);var b=new l(t,g,o);this.files[t]=b}var n=t("./utf8"),s=t("./utils"),a=t("./stream/GenericWorker"),o=t("./stream/StreamHelper"),h=t("./defaults"),u=t("./compressedObject"),l=t("./zipObject"),d=t("./generate"),c=t("./nodejsUtils"),f=t("./nodejs/NodejsStreamInputAdapter"),p=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return 0<e?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},_=function(t,e){return e=void 0!==e?e:h.createFolders,t=m(t),this.files[t]||i.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function g(t){return"[object RegExp]"===Object.prototype.toString.call(t)}e.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},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)},filter:function(t){var e=[];return this.forEach(function(r,i){t(r,i)&&e.push(i)}),e},file:function(t,e,r){if(1!=arguments.length)return t=this.root+t,i.call(this,t,e,r),this;if(g(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}var s=this.files[this.root+t];return s&&!s.dir?s:null},folder:function(t){if(!t)return this;if(g(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=_.call(this,e),i=this.clone();return i.root=r.name,i},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},generate:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,r={};try{if((r=s.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw Error("No output type specified.");s.checkSupport(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=d.generateWorker(this,r,i)}catch(t){(e=new a("error")).error(t)}return new o(e,r.type||"string",r.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,e,r){"use strict";e.exports=t("stream")},{stream:void 0}],17:[function(t,e,r){"use strict";var i=t("./DataReader");function n(t){i.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}t("../utils").inherits(n,i),n.prototype.byteAt=function(t){return this.data[this.zero+t]},n.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2),n=t.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===e&&this.data[s+1]===r&&this.data[s+2]===i&&this.data[s+3]===n)return s-this.zero;return -1},n.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2),n=t.charCodeAt(3),s=this.readData(4);return e===s[0]&&r===s[1]&&i===s[2]&&n===s[3]},n.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.exports=n},{"../utils":32,"./DataReader":18}],18:[function(t,e,r){"use strict";var i=t("../utils");function n(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,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},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},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))}},e.exports=n},{"../utils":32}],19:[function(t,e,r){"use strict";var i=t("./Uint8ArrayReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.readData=function(t){this.checkOffset(t);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,e,r){"use strict";var i=t("./DataReader");function n(t){i.call(this,t)}t("../utils").inherits(n,i),n.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},n.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},n.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},n.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.exports=n},{"../utils":32,"./DataReader":18}],21:[function(t,e,r){"use strict";var i=t("./ArrayReader"),n=t("./DataReader");function s(t){n.call(this,t)}t("../utils").inherits(s,i),s.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.exports=s},{"../utils":32,"./ArrayReader":17,"./DataReader":18}],22:[function(t,e,r){"use strict";var i=t("../utils"),n=t("../support"),s=t("./ArrayReader"),a=t("./StringReader"),o=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");e.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new o(t):n.uint8array?new h(i.transformTo("uint8array",t)):new s(i.transformTo("array",t)):new a(t)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,e,r){"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../utils");function s(t){i.call(this,"ConvertWorker to "+t),this.destType=t}n.inherits(s,i),s.prototype.processChunk=function(t){this.push({data:n.transformTo(this.destType,t.data),meta:t.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(t,e,r){"use strict";var i=t("./GenericWorker"),n=t("../crc32");function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(s,i),s.prototype.processChunk=function(t){this.streamInfo.crc32=n(t.data,this.streamInfo.crc32||0),this.push(t)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(s,n),s.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}n.prototype.processChunk.call(this,t)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./GenericWorker");function s(t){n.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+65536);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":case"nodebuffer":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.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(t,e,r){"use strict";function i(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}i.prototype={push:function(t){this.emit("data",t)},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},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)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},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)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw 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},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;var t=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},e.exports=i},{}],29:[function(t,e,r){"use strict";var i=t("../utils"),n=t("./ConvertWorker"),s=t("./GenericWorker"),a=t("../base64"),o=t("../support"),h=t("../external"),u=null;if(o.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch(t){}function l(t,e,r){var a=e;switch(e){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=e,this._mimeType=r,i.checkSupport(a),this._worker=t.pipe(new n(a)),t.lock()}catch(t){this._worker=new s("error"),this._worker.error(t)}}l.prototype={accumulate:function(t){var e;return e=this,new h.Promise(function(r,n){var s=[],o=e._internalType,h=e._outputType,u=e._mimeType;e.on("data",function(e,r){s.push(e),t&&t(r)}).on("error",function(t){s=[],n(t)}).on("end",function(){try{var t=function(t,e,r){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),r);case"base64":return a.encode(e);default:return i.transformTo(t,e)}}(h,function(t,e){var r,i=0,n=null,s=0;for(r=0;r<e.length;r++)s+=e[r].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(n=new Uint8Array(s),r=0;r<e.length;r++)n.set(e[r],i),i+=e[r].length;return n;case"nodebuffer":return Buffer.concat(e);default:throw Error("concat : unsupported type '"+t+"'")}}(o,s),u);r(t)}catch(t){n(t)}s=[]}).resume()})},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(){i.delay(e,arguments,r)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},t)}},e.exports=l},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,e,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="u">typeof ArrayBuffer&&"u">typeof Uint8Array,r.nodebuffer="u">typeof Buffer,r.uint8array="u">typeof Uint8Array,"u"<typeof ArrayBuffer)r.blob=!1;else{var i=new ArrayBuffer(0);try{r.blob=0===new Blob([i],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(i),r.blob=0===n.getBlob("application/zip").size}catch(t){r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch(t){r.nodestream=!1}},{"readable-stream":16}],31:[function(t,e,r){"use strict";for(var i=t("./utils"),n=t("./support"),s=t("./nodejsUtils"),a=t("./stream/GenericWorker"),o=Array(256),h=0;h<256;h++)o[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}o[254]=o[254]=1,r.utf8encode=function(t){return n.nodebuffer?s.newBufferFrom(t,"utf-8"):function(t){var e,r,i,s,a,o=t.length,h=0;for(s=0;s<o;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(i=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),h+=r<128?1:r<2048?2:r<65536?3:4;for(e=n.uint8array?new Uint8Array(h):Array(h),s=a=0;a<h;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(i=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),r<128?e[a++]=r:(r<2048?e[a++]=192|r>>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e}(t)},r.utf8decode=function(t){return n.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,r,n,s,a=t.length,h=Array(2*a);for(e=r=0;e<a;)if((n=t[e++])<128)h[r++]=n;else if(4<(s=o[n]))h[r++]=65533,e+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&e<a;)n=n<<6|63&t[e++],s--;1<s?h[r++]=65533:n<65536?h[r++]=n:(n-=65536,h[r++]=55296|n>>10&1023,h[r++]=56320|1023&n)}return h.length!==r&&(h.subarray?h=h.subarray(0,r):h.length=r),i.applyFromCharCode(h)}(t=i.transformTo(n.uint8array?"uint8array":"array",t))},i.inherits(u,a),u.prototype.processChunk=function(t){var e=i.transformTo(n.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=e;(e=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),e.set(s,this.leftOver.length)}else e=this.leftOver.concat(e);this.leftOver=null}var a=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+o[t[r]]>e?r:e}(e),h=e;a!==e.length&&(n.uint8array?(h=e.subarray(0,a),this.leftOver=e.subarray(a,e.length)):(h=e.slice(0,a),this.leftOver=e.slice(a,e.length))),this.push({data:r.utf8decode(h),meta:t.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=u,i.inherits(l,a),l.prototype.processChunk=function(t){this.push({data:r.utf8encode(t.data),meta:t.meta})},r.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,e,r){"use strict";var i=t("./support"),n=t("./base64"),s=t("./nodejsUtils"),a=t("./external");function o(t){return t}function h(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}t("setimmediate"),r.newBlob=function(t,e){r.checkSupport("blob");try{return new Blob([t],{type:e})}catch(r){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(t),i.getBlob(e)}catch(t){throw Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(t,e,r){var i=[],n=0,s=t.length;if(s<=r)return String.fromCharCode.apply(null,t);for(;n<s;)"array"===e||"nodebuffer"===e?i.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+r,s)))):i.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+r,s)))),n+=r;return i.join("")},stringifyByChar:function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(t){return!1}}()}};function l(t){var e=65536,i=r.getTypeOf(t),n=!0;if("uint8array"===i?n=u.applyCanBeUsed.uint8array:"nodebuffer"===i&&(n=u.applyCanBeUsed.nodebuffer),n)for(;1<e;)try{return u.stringifyByChunk(t,i,e)}catch(t){e=Math.floor(e/2)}return u.stringifyByChar(t)}function d(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}r.applyFromCharCode=l;var c={};c.string={string:o,array:function(t){return h(t,Array(t.length))},arraybuffer:function(t){return c.string.uint8array(t).buffer},uint8array:function(t){return h(t,new Uint8Array(t.length))},nodebuffer:function(t){return h(t,s.allocBuffer(t.length))}},c.array={string:l,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(t)}},c.arraybuffer={string:function(t){return l(new Uint8Array(t))},array:function(t){return d(new Uint8Array(t),Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s.newBufferFrom(new Uint8Array(t))}},c.uint8array={string:l,array:function(t){return d(t,Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return s.newBufferFrom(t)}},c.nodebuffer={string:l,array:function(t){return d(t,Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:function(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},nodebuffer:o},r.transformTo=function(t,e){return(e=e||"",t)?(r.checkSupport(t),c[r.getTypeOf(e)][t](e)):e},r.resolve=function(t){for(var e=t.split("/"),r=[],i=0;i<e.length;i++){var n=e[i];"."===n||""===n&&0!==i&&i!==e.length-1||(".."===n?r.pop():r.push(n))}return r.join("/")},r.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":i.nodebuffer&&s.isBuffer(t)?"nodebuffer":i.uint8array&&t instanceof Uint8Array?"uint8array":i.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(t){if(!i[t.toLowerCase()])throw Error(t+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=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},r.delay=function(t,e,r){setImmediate(function(){t.apply(r||null,e||[])})},r.inherits=function(t,e){function r(){}r.prototype=e.prototype,t.prototype=new r},r.extend=function(){var t,e,r={};for(t=0;t<arguments.length;t++)for(e in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],e)&&void 0===r[e]&&(r[e]=arguments[t][e]);return r},r.prepareContent=function(t,e,s,o,u){return a.Promise.resolve(e).then(function(t){var e=i.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)));return e&&"u">typeof FileReader?new a.Promise(function(e,r){var i=new FileReader;i.onload=function(t){e(t.target.result)},i.onerror=function(t){r(t.target.error)},i.readAsArrayBuffer(t)}):e&&"function"==typeof t.arrayBuffer?t.arrayBuffer():t}).then(function(e){var l,d=r.getTypeOf(e);return d?("arraybuffer"===d?e=r.transformTo("uint8array",e):"string"===d&&(u?e=n.decode(e):s&&!0!==o&&(e=h(l=e,i.uint8array?new Uint8Array(l.length):Array(l.length)))),e):a.Promise.reject(Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,e,r){"use strict";var i=t("./reader/readerFor"),n=t("./utils"),s=t("./signature"),a=t("./zipEntry"),o=t("./support");function h(t){this.files=[],this.loadOptions=t}h.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+n.pretty(e)+", expected "+n.pretty(t)+")")}},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},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=o.uint8array?"uint8array":"array",r=n.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},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}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(t=new a({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 Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?Error("Corrupted zip: can't find end of central directory"):Error("Corrupted zip: can't find zip signature or end of central directory");this.reader.setIndex(t);var e=t;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var i=e-r;if(0<i)this.isSignature(e,s.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},tryRecoverCorruptedZip:function(){this.reader.setIndex(0),this.files=[],this.zipCommentLength=0,this.zipComment=[];for(var t=0,e=this.reader.length,r=0;r<e-4;r++)if(80===this.reader.byteAt(r)&&75===this.reader.byteAt(r+1)&&3===this.reader.byteAt(r+2)&&4===this.reader.byteAt(r+3)){t++;var i=this.tryRecoverFileEntry(r);i&&this.files.push(i)}if(0===this.files.length){if(0===t)throw Error("Corrupted zip: no central directory or any file headers");throw Error("Corrupted zip: no central directory, and "+t+" possible local headers could not be recovered")}},tryRecoverFileEntry:function(t){this.reader.setIndex(t);var e=new a({zip64:this.zip64},this.loadOptions);try{return e.readLocalPartFromCorruptedZip(this.reader),e.handleUTF8(),e.processAttributes(),e}catch(t){return this.loadOptions.onUnrecoverableFileEntry&&this.loadOptions.onUnrecoverableFileEntry(t),null}},load:function(t){this.prepareReader(t);try{this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}catch(t){if(!this.loadOptions.recoverCorrupted)throw t;this.loadOptions.onCorruptCentralDirectory&&this.loadOptions.onCorruptCentralDirectory(t),this.tryRecoverCorruptedZip()}}},e.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,e,r){"use strict";function i(t){for(var e in u)if(Object.prototype.hasOwnProperty.call(u,e)&&u[e].magic===t)return u[e];return null}var n=t("./reader/readerFor"),s=t("./utils"),a=t("./compressedObject"),o=t("./crc32"),h=t("./utf8"),u=t("./compressions"),l=t("./support"),d=t("./signature");function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},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 Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=i(this.compressionMethod)))throw Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},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 Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},readLocalPartFromCorruptedZip:function(t){t.readAndCheckSignature(d.LOCAL_FILE_HEADER),this.versionMadeBy=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileName=t.readData(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t);var e=i(this.compressionMethod);if(null===e)throw Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},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)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,i,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<n;)e=t.readInt(2),r=t.readInt(2),i=t.readData(r),this.extraFields[e]={id:e,length:r,value:i};t.setIndex(n)},handleUTF8:function(){var t=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var r=s.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var n=s.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=n(t.value);return 1!==e.readInt(1)||o(this.fileName)!==e.readInt(4)?null:h.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=n(t.value);return 1!==e.readInt(1)||o(this.fileComment)!==e.readInt(4)?null:h.utf8decode(e.readData(t.length-5))}return null}},e.exports=c},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,e,r){"use strict";function i(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}}var n=t("./stream/StreamHelper"),s=t("./stream/DataWorker"),a=t("./utf8"),o=t("./compressedObject"),h=t("./stream/GenericWorker");i.prototype={internalStream:function(t){var e=null,r="string";try{if(!t)throw Error("No output type specified.");var i="string"===(r=t.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!i&&(e=e.pipe(new a.Utf8EncodeWorker)),!s&&i&&(e=e.pipe(new a.Utf8DecodeWorker))}catch(t){(e=new h("error")).error(t)}return new n(e,r,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof o&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(r,t,e)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof h?this._data:new s(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},d=0;d<u.length;d++)i.prototype[u[d]]=l;e.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,e,i){(function(t){"use strict";var r,i,n=t.MutationObserver||t.WebKitMutationObserver;if(n){var s=0,a=new n(l),o=t.document.createTextNode("");a.observe(o,{characterData:!0}),r=function(){o.data=s=++s%2}}else if(t.setImmediate||void 0===t.MessageChannel)r="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){l(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(l,0)};else{var h=new t.MessageChannel;h.port1.onmessage=l,r=function(){h.port2.postMessage(0)}}var u=[];function l(){var t,e;i=!0;for(var r=u.length;r;){for(e=u,u=[],t=-1;++t<r;)e[t]();r=u.length}i=!1}e.exports=function(t){1!==u.push(t)||i||r()}}).call(this,void 0!==r.g?r.g:"u">typeof self?self:"u">typeof window?window:{})},{}],37:[function(t,e,r){"use strict";var i=t("immediate");function n(){}var s={},a=["REJECTED"],o=["FULFILLED"],h=["PENDING"];function u(t){if("function"!=typeof t)throw TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,t!==n&&f(this,t)}function l(t,e,r){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function d(t,e,r){i(function(){var i;try{i=e(r)}catch(e){return s.reject(t,e)}i===t?s.reject(t,TypeError("Cannot resolve promise with itself")):s.resolve(t,i)})}function c(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function f(t,e){var r=!1;function i(e){r||(r=!0,s.reject(t,e))}function n(e){r||(r=!0,s.resolve(t,e))}var a=p(function(){e(n,i)});"error"===a.status&&i(a.value)}function p(t,e){var r={};try{r.value=t(e),r.status="success"}catch(t){r.status="error",r.value=t}return r}(e.exports=u).prototype.finally=function(t){if("function"!=typeof t)return this;var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},u.prototype.catch=function(t){return this.then(null,t)},u.prototype.then=function(t,e){if("function"!=typeof t&&this.state===o||"function"!=typeof e&&this.state===a)return this;var r=new this.constructor(n);return this.state!==h?d(r,this.state===o?t:e,this.outcome):this.queue.push(new l(r,t,e)),r},l.prototype.callFulfilled=function(t){s.resolve(this.promise,t)},l.prototype.otherCallFulfilled=function(t){d(this.promise,this.onFulfilled,t)},l.prototype.callRejected=function(t){s.reject(this.promise,t)},l.prototype.otherCallRejected=function(t){d(this.promise,this.onRejected,t)},s.resolve=function(t,e){var r=p(c,e);if("error"===r.status)return s.reject(t,r.value);var i=r.value;if(i)f(t,i);else{t.state=o,t.outcome=e;for(var n=-1,a=t.queue.length;++n<a;)t.queue[n].callFulfilled(e)}return t},s.reject=function(t,e){t.state=a,t.outcome=e;for(var r=-1,i=t.queue.length;++r<i;)t.queue[r].callRejected(e);return t},u.resolve=function(t){return t instanceof this?t:s.resolve(new this(n),t)},u.reject=function(t){var e=new this(n);return s.reject(e,t)},u.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(TypeError("must be an array"));var r=t.length,i=!1;if(!r)return this.resolve([]);for(var a=Array(r),o=0,h=-1,u=new this(n);++h<r;)!function(t,n){e.resolve(t).then(function(t){a[n]=t,++o!==r||i||(i=!0,s.resolve(u,a))},function(t){i||(i=!0,s.reject(u,t))})}(t[h],h);return u},u.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(TypeError("must be an array"));var e,r=t.length,i=!1;if(!r)return this.resolve([]);for(var a=-1,o=new this(n);++a<r;)e=t[a],this.resolve(e).then(function(t){i||(i=!0,s.resolve(o,t))},function(t){i||(i=!0,s.reject(o,t))});return o}},{immediate:36}],38:[function(t,e,r){"use strict";var i={};(0,t("./lib/utils/common").assign)(i,t("./lib/deflate"),t("./lib/inflate"),t("./lib/zlib/constants")),e.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,e,r){"use strict";var i=t("./zlib/deflate"),n=t("./utils/common"),s=t("./utils/strings"),a=t("./zlib/messages"),o=t("./zlib/zstream"),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e,r=this.options;r.raw&&0<r.windowBits?r.windowBits=-r.windowBits:r.gzip&&0<r.windowBits&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var l=i.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==l)throw Error(a[l]);if(r.header&&i.deflateSetHeader(this.strm,r.header),r.dictionary){if(e="string"==typeof r.dictionary?s.string2buf(r.dictionary):"[object ArrayBuffer]"===h.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(l=i.deflateSetDictionary(this.strm,e)))throw Error(a[l]);this._dict_set=!0}}function l(t,e){var r=new u(e);if(r.push(t,!0),r.err)throw r.msg||a[r.err];return r.result}u.prototype.push=function(t,e){var r,a,o=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:4*(!0===e),"string"==typeof t?o.input=s.string2buf(t):"[object ArrayBuffer]"===h.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new n.Buf8(u),o.next_out=0,o.avail_out=u),1!==(r=i.deflate(o,a))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(s.buf2binstring(n.shrinkBuf(o.output,o.next_out))):this.onData(n.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==r)return 4===a?(r=i.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),o.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Deflate=u,r.deflate=l,r.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},r.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,e,r){"use strict";var i=t("./zlib/inflate"),n=t("./utils/common"),s=t("./utils/strings"),a=t("./zlib/constants"),o=t("./zlib/messages"),h=t("./zlib/zstream"),u=t("./zlib/gzheader"),l=Object.prototype.toString;function d(t){if(!(this instanceof d))return new d(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&0<=e.windowBits&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(0<=e.windowBits&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),15<e.windowBits&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,e.windowBits);if(r!==a.Z_OK||(this.header=new u,i.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=s.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=i.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK)))throw Error(o[r])}function c(t,e){var r=new d(e);if(r.push(t,!0),r.err)throw r.msg||o[r.err];return r.result}d.prototype.push=function(t,e){var r,o,h,u,d,c=this.strm,f=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?c.input=s.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?c.input=new Uint8Array(t):c.input=t,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new n.Buf8(f),c.next_out=0,c.avail_out=f),(r=i.inflate(c,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=i.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===m&&(r=a.Z_OK,m=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&r!==a.Z_STREAM_END&&(0!==c.avail_in||o!==a.Z_FINISH&&o!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(h=s.utf8border(c.output,c.next_out),u=c.next_out-h,d=s.buf2string(c.output,h),c.next_out=u,c.avail_out=f-u,u&&n.arraySet(c.output,c.output,h,u,0),this.onData(d)):this.onData(n.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(m=!0)}while((0<c.avail_in||0===c.avail_out)&&r!==a.Z_STREAM_END)return r===a.Z_STREAM_END&&(o=a.Z_FINISH),o===a.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):o!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),c.avail_out=0,!0)},d.prototype.onData=function(t){this.chunks.push(t)},d.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},r.Inflate=d,r.inflate=c,r.inflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},r.ungzip=c},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,e,r){"use strict";var i="u">typeof Uint8Array&&"u">typeof Uint16Array&&"u">typeof Int32Array;r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+i),n);else for(var s=0;s<i;s++)t[n+s]=e[r+s]},flattenChunks:function(t){var e,r,i,n,s,a;for(e=i=0,r=t.length;e<r;e++)i+=t[e].length;for(a=new Uint8Array(i),e=n=0,r=t.length;e<r;e++)s=t[e],a.set(s,n),n+=s.length;return a}},s={arraySet:function(t,e,r,i,n){for(var s=0;s<i;s++)t[n+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};r.setTyped=function(t){t?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(i)},{}],42:[function(t,e,r){"use strict";var i=t("./common"),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var a=new i.Buf8(256),o=0;o<256;o++)a[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function h(t,e){if(e<65534&&(t.subarray&&s||!t.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",a=0;a<e;a++)r+=String.fromCharCode(t[a]);return r}a[254]=a[254]=1,r.string2buf=function(t){var e,r,n,s,a,o=t.length,h=0;for(s=0;s<o;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(n=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),h+=r<128?1:r<2048?2:r<65536?3:4;for(e=new i.Buf8(h),s=a=0;a<h;s++)55296==(64512&(r=t.charCodeAt(s)))&&s+1<o&&56320==(64512&(n=t.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),r<128?e[a++]=r:(r<2048?e[a++]=192|r>>>6:(r<65536?e[a++]=224|r>>>12:(e[a++]=240|r>>>18,e[a++]=128|r>>>12&63),e[a++]=128|r>>>6&63),e[a++]=128|63&r);return e},r.buf2binstring=function(t){return h(t,t.length)},r.binstring2buf=function(t){for(var e=new i.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e},r.buf2string=function(t,e){var r,i,n,s,o=e||t.length,u=Array(2*o);for(r=i=0;r<o;)if((n=t[r++])<128)u[i++]=n;else if(4<(s=a[n]))u[i++]=65533,r+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&r<o;)n=n<<6|63&t[r++],s--;1<s?u[i++]=65533:n<65536?u[i++]=n:(n-=65536,u[i++]=55296|n>>10&1023,u[i++]=56320|1023&n)}return h(u,i)},r.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;0<=r&&128==(192&t[r]);)r--;return r<0||0===r?e:r+a[t[r]]>e?r:e}},{"./common":41}],43:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){for(var n=65535&t,s=t>>>16&65535,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;s=s+(n=n+e[i++]|0)|0,--a;);n%=65521,s%=65521}return n|s<<16}},{}],44:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(t,e,r){"use strict";var i=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?0xedb88320^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,n){var s=n+r;t^=-1;for(var a=n;a<s;a++)t=t>>>8^i[255&(t^e[a])];return -1^t}},{}],46:[function(t,e,r){"use strict";var i,n=t("../utils/common"),s=t("./trees"),a=t("./adler32"),o=t("./crc32"),h=t("./messages");function u(t,e){return t.msg=h[e],e}function l(t){return(t<<1)-9*(4<t)}function d(t){for(var e=t.length;0<=--e;)t[e]=0}function c(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(n.arraySet(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 f(t,e){s._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,c(t.strm)}function p(t,e){t.pending_buf[t.pending++]=e}function m(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function _(t,e){var r,i,n=t.max_chain_length,s=t.strstart,a=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,l=t.w_mask,d=t.prev,c=t.strstart+258,f=u[s+a-1],p=u[s+a];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(u[(r=e)+a]===p&&u[r+a-1]===f&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do;while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&s<c)if(i=258-(c-s),s=c-258,a<i){if(t.match_start=e,o<=(a=i))break;f=u[s+a-1],p=u[s+a]}}while((e=d[e&l])>h&&0!=--n)return a<=t.lookahead?a:t.lookahead}function g(t){var e,r,i,s,h,u,l,d,c,f,p=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-262)){for(n.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=r=t.hash_size;i=t.head[--e],t.head[e]=p<=i?i-p:0,--r;);for(e=r=p;i=t.prev[--e],t.prev[e]=p<=i?i-p:0,--r;);s+=p}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,d=t.strstart+t.lookahead,f=void 0,(c=s)<(f=u.avail_in)&&(f=c),r=0===f?0:(u.avail_in-=f,n.arraySet(l,u.input,u.next_in,f,d),1===u.state.wrap?u.adler=a(u.adler,l,f,d):2===u.state.wrap&&(u.adler=o(u.adler,l,f,d)),u.next_in+=f,u.total_in+=f,f),t.lookahead+=r,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function b(t,e){for(var r,i;;){if(t.lookahead<262){if(g(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=_(t,r)),t.match_length>=3)if(i=s._tr_tally(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){for(t.match_length--;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,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=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(f(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(f(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(f(t,!1),0===t.strm.avail_out)?1:2}function v(t,e){for(var r,i,n;;){if(t.lookahead<262){if(g(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=_(t,r),t.match_length<=5&&(1===t.strategy||3===t.match_length&&4096<t.strstart-t.match_start)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){for(n=t.strstart+t.lookahead-3,i=s._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;++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),0!=--t.prev_length;);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(f(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=s._tr_tally(t,0,t.window[t.strstart-1]))&&f(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=s._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(f(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(f(t,!1),0===t.strm.avail_out)?1:2}function y(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function w(){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=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),d(this.dyn_ltree),d(this.dyn_dtree),d(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),d(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),d(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 k(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),e.last_flush=0,s._tr_init(e),0):u(t,-2)}function x(t){var e,r=k(t);return 0===r&&((e=t.state).window_size=2*e.w_size,d(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r}function S(t,e,r,i,s,a){if(!t)return -2;var o=1;if(-1===e&&(e=6),i<0?(o=0,i=-i):15<i&&(o=2,i-=16),s<1||9<s||8!==r||i<8||15<i||e<0||9<e||a<0||4<a)return u(t,-2);8===i&&(i=9);var h=new w;return(t.state=h).strm=t,h.wrap=o,h.gzhead=null,h.w_bits=i,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new n.Buf8(2*h.w_size),h.head=new n.Buf16(h.hash_size),h.prev=new n.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new n.Buf8(h.pending_buf_size),h.d_buf=+h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=a,h.method=r,x(t)}i=[new y(0,0,0,0,function(t,e){var r=65535;for(65535>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(g(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,f(t,!1),0===t.strm.avail_out)||t.strstart-t.block_start>=t.w_size-262&&(f(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(f(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(f(t,!1),t.strm.avail_out),1)}),new y(4,4,8,4,b),new y(4,5,16,8,b),new y(4,6,32,32,b),new y(4,4,16,16,v),new y(8,16,32,32,v),new y(8,16,128,128,v),new y(8,32,128,256,v),new y(32,128,258,1024,v),new y(32,258,258,4096,v)],r.deflateInit=function(t,e){return S(t,e,8,15,8,0)},r.deflateInit2=S,r.deflateReset=x,r.deflateResetKeep=k,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},r.deflate=function(t,e){var r,n,a,h;if(!t||!t.state||5<e||e<0)return t?u(t,-2):-2;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||666===n.status&&4!==e)return u(t,0===t.avail_out?-5:-2);if(n.strm=t,r=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,p(n,31),p(n,139),p(n,8),n.gzhead?(p(n,+!!n.gzhead.text+2*!!n.gzhead.hcrc+4*!!n.gzhead.extra+8*!!n.gzhead.name+16*!!n.gzhead.comment),p(n,255&n.gzhead.time),p(n,n.gzhead.time>>8&255),p(n,n.gzhead.time>>16&255),p(n,n.gzhead.time>>24&255),p(n,9===n.level?2:4*(2<=n.strategy||n.level<2)),p(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(p(n,255&n.gzhead.extra.length),p(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=o(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(p(n,0),p(n,0),p(n,0),p(n,0),p(n,0),p(n,9===n.level?2:4*(2<=n.strategy||n.level<2)),p(n,3),n.status=113);else{var _=8+(n.w_bits-8<<4)<<8;_|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(_|=32),_+=31-_%31,n.status=113,m(n,_),0!==n.strstart&&(m(n,t.adler>>>16),m(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),c(t),a=n.pending,n.pending!==n.pending_buf_size));)p(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),c(t),a=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,p(n,h)}while(0!==h)n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===h&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),c(t),a=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,p(n,h)}while(0!==h)n.gzhead.hcrc&&n.pending>a&&(t.adler=o(t.adler,n.pending_buf,n.pending-a,a)),0===h&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&c(t),n.pending+2<=n.pending_buf_size&&(p(n,255&t.adler),p(n,t.adler>>8&255),t.adler=0,n.status=113)):n.status=113),0!==n.pending){if(c(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&l(e)<=l(r)&&4!==e)return u(t,-5);if(666===n.status&&0!==t.avail_in)return u(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&666!==n.status){var b=2===n.strategy?function(t,e){for(var r;;){if(0===t.lookahead&&(g(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(f(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(f(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(f(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var r,i,n,a,o=t.window;;){if(t.lookahead<=258){if(g(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&0<t.strstart&&(i=o[n=t.strstart-1])===o[++n]&&i===o[++n]&&i===o[++n]){a=t.strstart+258;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++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=s._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=s._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(f(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(f(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(f(t,!1),0===t.strm.avail_out)?1:2}(n,e):i[n.level].func(n,e);if(3!==b&&4!==b||(n.status=666),1===b||3===b)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===b&&(1===e?s._tr_align(n):5!==e&&(s._tr_stored_block(n,0,0,!1),3===e&&(d(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),c(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(p(n,255&t.adler),p(n,t.adler>>8&255),p(n,t.adler>>16&255),p(n,t.adler>>24&255),p(n,255&t.total_in),p(n,t.total_in>>8&255),p(n,t.total_in>>16&255),p(n,t.total_in>>24&255)):(m(n,t.adler>>>16),m(n,65535&t.adler)),c(t),0<n.wrap&&(n.wrap=-n.wrap),+(0===n.pending))},r.deflateEnd=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?u(t,-2):(t.state=null,113===e?u(t,-3):0):-2},r.deflateSetDictionary=function(t,e){var r,i,s,o,h,u,l,c,f=e.length;if(!t||!t.state||2===(o=(r=t.state).wrap)||1===o&&42!==r.status||r.lookahead)return -2;for(1===o&&(t.adler=a(t.adler,e,f,0)),r.wrap=0,f>=r.w_size&&(0===o&&(d(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new n.Buf8(r.w_size),n.arraySet(c,e,f-r.w_size,r.w_size,0),e=c,f=r.w_size),h=t.avail_in,u=t.next_in,l=t.input,t.avail_in=f,t.next_in=0,t.input=e,g(r);r.lookahead>=3;){for(i=r.strstart,s=r.lookahead-2;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++,--s;);r.strstart=i,r.lookahead=2,g(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=u,t.input=l,t.avail_in=h,r.wrap=o,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,e,r){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(t,e,r){"use strict";e.exports=function(t,e){var r,i,n,s,a,o,h,u,l,d,c,f,p,m,_,g,b,v,y,w,k,x,S,C,z;r=t.state,i=t.next_in,C=t.input,n=i+(t.avail_in-5),s=t.next_out,z=t.output,a=s-(e-t.avail_out),o=s+(t.avail_out-257),h=r.dmax,u=r.wsize,l=r.whave,d=r.wnext,c=r.window,f=r.hold,p=r.bits,m=r.lencode,_=r.distcode,g=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;t:do for(p<15&&(f+=C[i++]<<p,p+=8,f+=C[i++]<<p,p+=8),v=m[f&g];;){if(f>>>=y=v>>>24,p-=y,0==(y=v>>>16&255))z[s++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(f&(1<<y)-1)];continue}if(32&y){r.mode=12;break t}t.msg="invalid literal/length code",r.mode=30;break t}for(w=65535&v,(y&=15)&&(p<y&&(f+=C[i++]<<p,p+=8),w+=f&(1<<y)-1,f>>>=y,p-=y),p<15&&(f+=C[i++]<<p,p+=8,f+=C[i++]<<p,p+=8),v=_[f&b];;){if(f>>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(f&(1<<y)-1)];continue}t.msg="invalid distance code",r.mode=30;break t}if(k=65535&v,p<(y&=15)&&(f+=C[i++]<<p,(p+=8)<y&&(f+=C[i++]<<p,p+=8)),h<(k+=f&(1<<y)-1)){t.msg="invalid distance too far back",r.mode=30;break t}if(f>>>=y,p-=y,(y=s-a)<k){if(l<(y=k-y)&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(S=c,(x=0)===d){if(x+=u-y,y<w){for(w-=y;z[s++]=c[x++],--y;);x=s-k,S=z}}else if(d<y){if(x+=u+d-y,(y-=d)<w){for(w-=y;z[s++]=c[x++],--y;);if(x=0,d<w){for(w-=y=d;z[s++]=c[x++],--y;);x=s-k,S=z}}}else if(x+=d-y,y<w){for(w-=y;z[s++]=c[x++],--y;);x=s-k,S=z}for(;2<w;)z[s++]=S[x++],z[s++]=S[x++],z[s++]=S[x++],w-=3;w&&(z[s++]=S[x++],1<w&&(z[s++]=S[x++]))}else{for(x=s-k;z[s++]=z[x++],z[s++]=z[x++],z[s++]=z[x++],2<(w-=3););w&&(z[s++]=z[x++],1<w&&(z[s++]=z[x++]))}break}}break}while(i<n&&s<o)i-=w=p>>3,f&=(1<<(p-=w<<3))-1,t.next_in=i,t.next_out=s,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=s<o?o-s+257:257-(s-o),r.hold=f,r.bits=p}},{}],49:[function(t,e,r){"use strict";var i=t("../utils/common"),n=t("./adler32"),s=t("./crc32"),a=t("./inffast"),o=t("./inftrees");function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(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=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):-2}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):-2}function c(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||15<e)?-2:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,d(t))):-2}function f(t,e){var r;return t?((t.state=new u).window=null,0!==(r=c(t,e))&&(t.state=null),r):-2}var p,m,_=!0;function g(t,e,r,n){var s,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new i.Buf8(a.wsize)),n>=a.wsize?(i.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n<(s=a.wsize-a.wnext)&&(s=n),i.arraySet(a.window,e,r-n,s,a.wnext),(n-=s)?(i.arraySet(a.window,e,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=s,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=s))),0}r.inflateReset=d,r.inflateReset2=c,r.inflateResetKeep=l,r.inflateInit=function(t){return f(t,15)},r.inflateInit2=f,r.inflate=function(t,e){var r,u,l,d,c,f,b,v,y,w,k,x,S,C,z,A,E,j,O,I,B,T,R,D,F=0,N=new i.Buf8(4),U=[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),c=t.next_out,l=t.output,b=t.avail_out,d=t.next_in,u=t.input,f=t.avail_in,v=r.hold,y=r.bits,w=f,k=b,T=0;t:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;y<16;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(2&r.wrap&&35615===v){N[r.check=0]=255&v,N[1]=v>>>8&255,r.check=s(r.check,N,2,0),y=v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",r.mode=30;break}if(8!=(15&v)){t.msg="unknown compression method",r.mode=30;break}if(y-=4,B=8+(15&(v>>>=4)),0===r.wbits)r.wbits=B;else if(B>r.wbits){t.msg="invalid window size",r.mode=30;break}r.dmax=1<<B,t.adler=r.check=1,r.mode=512&v?10:12,y=v=0;break;case 2:for(;y<16;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(r.flags=v,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=v>>8&1),512&r.flags&&(N[0]=255&v,N[1]=v>>>8&255,r.check=s(r.check,N,2,0)),y=v=0,r.mode=3;case 3:for(;y<32;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}r.head&&(r.head.time=v),512&r.flags&&(N[0]=255&v,N[1]=v>>>8&255,N[2]=v>>>16&255,N[3]=v>>>24&255,r.check=s(r.check,N,4,0)),y=v=0,r.mode=4;case 4:for(;y<16;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(N[0]=255&v,N[1]=v>>>8&255,r.check=s(r.check,N,2,0)),y=v=0,r.mode=5;case 5:if(1024&r.flags){for(;y<16;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(N[0]=255&v,N[1]=v>>>8&255,r.check=s(r.check,N,2,0)),y=v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(f<(x=r.length)&&(x=f),x&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),i.arraySet(r.head.extra,u,d,x,B)),512&r.flags&&(r.check=s(r.check,u,x,d)),f-=x,d+=x,r.length-=x),r.length))break t;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===f)break t;for(x=0;B=u[d+x++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B)),B&&x<f;);if(512&r.flags&&(r.check=s(r.check,u,x,d)),f-=x,d+=x,B)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===f)break t;for(x=0;B=u[d+x++],r.head&&B&&r.length<65536&&(r.head.comment+=String.fromCharCode(B)),B&&x<f;);if(512&r.flags&&(r.check=s(r.check,u,x,d)),f-=x,d+=x,B)break t}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;y<16;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(v!==(65535&r.check)){t.msg="header crc mismatch",r.mode=30;break}y=v=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(;y<32;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}t.adler=r.check=h(v),y=v=0,r.mode=11;case 11:if(0===r.havedict)return t.next_out=c,t.avail_out=b,t.next_in=d,t.avail_in=f,r.hold=v,r.bits=y,2;t.adler=r.check=1,r.mode=12;case 12:if(5===e||6===e)break t;case 13:if(r.last){v>>>=7&y,y-=7&y,r.mode=27;break}for(;y<3;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}switch(r.last=1&v,y-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(function(t){if(_){var e;for(p=new i.Buf32(512),m=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(1,t.lens,0,288,p,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(2,t.lens,0,32,m,0,t.work,{bits:5}),_=!1}t.lencode=p,t.lenbits=9,t.distcode=m,t.distbits=5}(r),r.mode=20,6!==e)break;v>>>=2,y-=2;break t;case 2:r.mode=17;break;case 3:t.msg="invalid block type",r.mode=30}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,y=v=0,r.mode=15,6===e)break t;case 15:r.mode=16;case 16:if(x=r.length){if(f<x&&(x=f),b<x&&(x=b),0===x)break t;i.arraySet(l,u,d,x,c),f-=x,d+=x,b-=x,c+=x,r.length-=x;break}r.mode=12;break;case 17:for(;y<14;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(r.nlen=257+(31&v),y-=5,r.ndist=1+(31&(v>>>=5)),y-=5,r.ncode=4+(15&(v>>>=5)),v>>>=4,y-=4,286<r.nlen||30<r.ndist){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(;y<3;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}r.lens[U[r.have++]]=7&v,v>>>=3,y-=3}for(;r.have<19;)r.lens[U[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},T=o(0,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,T){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(;A=(F=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,E=65535&F,!((z=F>>>24)<=y);){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(E<16)v>>>=z,y-=z,r.lens[r.have++]=E;else{if(16===E){for(D=z+2;y<D;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(v>>>=z,y-=z,0===r.have){t.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],x=3+(3&v),v>>>=2,y-=2}else if(17===E){for(D=z+3;y<D;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}y-=z,B=0,x=3+(7&(v>>>=z)),v>>>=3,y-=3}else{for(D=z+7;y<D;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}y-=z,B=0,x=11+(127&(v>>>=z)),v>>>=7,y-=7}if(r.have+x>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=30;break}for(;x--;)r.lens[r.have++]=B}}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,R={bits:r.lenbits},T=o(1,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,T){t.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},T=o(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,T){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(6<=f&&258<=b){t.next_out=c,t.avail_out=b,t.next_in=d,t.avail_in=f,r.hold=v,r.bits=y,a(t,k),c=t.next_out,l=t.output,b=t.avail_out,d=t.next_in,u=t.input,f=t.avail_in,v=r.hold,y=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(F=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,E=65535&F,!((z=F>>>24)<=y);){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(A&&0==(240&A)){for(j=z,O=A,I=E;A=(F=r.lencode[I+((v&(1<<j+O)-1)>>j)])>>>16&255,E=65535&F,!(j+(z=F>>>24)<=y);){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}v>>>=j,y-=j,r.back+=j}if(v>>>=z,y-=z,r.back+=z,r.length=E,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=12;break}if(64&A){t.msg="invalid literal/length code",r.mode=30;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(D=r.extra;y<D;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,y-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(F=r.distcode[v&(1<<r.distbits)-1])>>>16&255,E=65535&F,!((z=F>>>24)<=y);){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(0==(240&A)){for(j=z,O=A,I=E;A=(F=r.distcode[I+((v&(1<<j+O)-1)>>j)])>>>16&255,E=65535&F,!(j+(z=F>>>24)<=y);){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}v>>>=j,y-=j,r.back+=j}if(v>>>=z,y-=z,r.back+=z,64&A){t.msg="invalid distance code",r.mode=30;break}r.offset=E,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(D=r.extra;y<D;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,y-=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===b)break t;if(x=k-b,r.offset>x){if((x=r.offset-x)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=30;break}S=x>r.wnext?(x-=r.wnext,r.wsize-x):r.wnext-x,x>r.length&&(x=r.length),C=r.window}else C=l,S=c-r.offset,x=r.length;for(b<x&&(x=b),b-=x,r.length-=x;l[c++]=C[S++],--x;);0===r.length&&(r.mode=21);break;case 26:if(0===b)break t;l[c++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;y<32;){if(0===f)break t;f--,v|=u[d++]<<y,y+=8}if(k-=b,t.total_out+=k,r.total+=k,k&&(t.adler=r.check=r.flags?s(r.check,l,k,c-k):n(r.check,l,k,c-k)),k=b,(r.flags?v:h(v))!==r.check){t.msg="incorrect data check",r.mode=30;break}y=v=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;y<32;){if(0===f)break t;f--,v+=u[d++]<<y,y+=8}if(v!==(0|r.total)){t.msg="incorrect length check",r.mode=30;break}y=v=0}r.mode=29;case 29:T=1;break t;case 30:T=-3;break t;case 31:return -4;default:return -2}return t.next_out=c,t.avail_out=b,t.next_in=d,t.avail_in=f,r.hold=v,r.bits=y,(r.wsize||k!==t.avail_out&&r.mode<30&&(r.mode<27||4!==e))&&g(t,t.output,t.next_out,k-t.avail_out)?(r.mode=31,-4):(w-=t.avail_in,k-=t.avail_out,t.total_in+=w,t.total_out+=k,r.total+=k,r.wrap&&k&&(t.adler=r.check=r.flags?s(r.check,l,k,t.next_out-k):n(r.check,l,k,t.next_out-k)),t.data_type=r.bits+64*!!r.last+128*(12===r.mode)+256*(20===r.mode||15===r.mode),(0==w&&0===k||4===e)&&0===T&&(T=-5),T)},r.inflateEnd=function(t){if(!t||!t.state)return -2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},r.inflateGetHeader=function(t,e){var r;return t&&t.state?0==(2&(r=t.state).wrap)?-2:((r.head=e).done=!1,0):-2},r.inflateSetDictionary=function(t,e){var r,i=e.length;return t&&t.state?0!==(r=t.state).wrap&&11!==r.mode?-2:11===r.mode&&n(1,e,i,0)!==r.check?-3:g(t,e,i,i)?(r.mode=31,-4):(r.havedict=1,0):-2},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,e,r){"use strict";var i=t("../utils/common"),n=[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],s=[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],a=[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],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,r,h,u,l,d,c){var f,p,m,_,g,b,v,y,w,k=c.bits,x=0,S=0,C=0,z=0,A=0,E=0,j=0,O=0,I=0,B=0,T=null,R=0,D=new i.Buf16(16),F=new i.Buf16(16),N=null,U=0;for(x=0;x<=15;x++)D[x]=0;for(S=0;S<h;S++)D[e[r+S]]++;for(A=k,z=15;1<=z&&0===D[z];z--);if(z<A&&(A=z),0===z)return u[l++]=0x1400000,u[l++]=0x1400000,c.bits=1,0;for(C=1;C<z&&0===D[C];C++);for(A<C&&(A=C),x=O=1;x<=15;x++)if(O<<=1,(O-=D[x])<0)return -1;if(0<O&&(0===t||1!==z))return -1;for(F[1]=0,x=1;x<15;x++)F[x+1]=F[x]+D[x];for(S=0;S<h;S++)0!==e[r+S]&&(d[F[e[r+S]]++]=S);if(b=0===t?(T=N=d,19):1===t?(T=n,R-=257,N=s,U-=257,256):(T=a,N=o,-1),x=C,g=l,j=S=B=0,m=-1,_=(I=1<<(E=A))-1,1===t&&852<I||2===t&&592<I)return 1;for(;;){for(v=x-j,w=d[S]<b?(y=0,d[S]):d[S]>b?(y=N[U+d[S]],T[R+d[S]]):(y=96,0),f=1<<x-j,C=p=1<<E;u[g+(B>>j)+(p-=f)]=v<<24|y<<16|w,0!==p;);for(f=1<<x-1;B&f;)f>>=1;if(0!==f?(B&=f-1,B+=f):B=0,S++,0==--D[x]){if(x===z)break;x=e[r+d[S]]}if(A<x&&(B&_)!==m){for(0===j&&(j=A),g+=C,O=1<<(E=x-j);E+j<z&&!((O-=D[E+j])<=0);)E++,O<<=1;if(I+=1<<E,1===t&&852<I||2===t&&592<I)return 1;u[m=B&_]=A<<24|E<<16|g-l}}return 0!==B&&(u[g+B]=x-j<<24|4194304),c.bits=A,0}},{"../utils/common":41}],51:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(t,e,r){"use strict";var i=t("../utils/common");function n(t){for(var e=t.length;0<=--e;)t[e]=0}var s=[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],a=[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],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=Array(576);n(u);var l=Array(60);n(l);var d=Array(512);n(d);var c=Array(256);n(c);var f=Array(29);n(f);var p,m,_,g=Array(30);function b(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 v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function y(t){return t<256?d[t]:d[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(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 x(t,e,r){k(t,r[2*e],r[2*e+1])}function S(t,e){for(var r=0;r|=1&t,t>>>=1,r<<=1,0<--e;);return r>>>1}function C(t,e,r){var i,n,s=Array(16),a=0;for(i=1;i<=15;i++)s[i]=a=a+r[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=S(s[o]++,o))}}function z(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 A(t){8<t.bi_valid?w(t,t.bi_buf):0<t.bi_valid&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function E(t,e,r,i){var n=2*e,s=2*r;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[r]}function j(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&E(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!E(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}function O(t,e,r){var i,n,o,h,u=0;if(0!==t.last_lit)for(;i=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],n=t.pending_buf[t.l_buf+u],u++,0===i?x(t,n,e):(x(t,(o=c[n])+256+1,e),0!==(h=s[o])&&k(t,n-=f[o],h),x(t,o=y(--i),r),0!==(h=a[o])&&k(t,i-=g[o],h)),u<t.last_lit;);x(t,256,e)}function I(t,e){var r,i,n,s=e.dyn_tree,a=e.stat_desc.static_tree,o=e.stat_desc.has_stree,h=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<h;r++)0!==s[2*r]?(t.heap[++t.heap_len]=u=r,t.depth[r]=0):s[2*r+1]=0;for(;t.heap_len<2;)s[2*(n=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=a[2*n+1]);for(e.max_code=u,r=t.heap_len>>1;1<=r;r--)j(t,s,r);for(n=h;r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],j(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,j(t,s,1),2<=t.heap_len;);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,a,o,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,d=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(s=0;s<=15;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)p<(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)&&(s=p,m++),h[2*i+1]=s,u<i||(t.bl_count[s]++,a=0,f<=i&&(a=c[i-f]),o=h[2*i],t.opt_len+=o*(s+a),d&&(t.static_len+=o*(l[2*i+1]+a)));if(0!==m){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,m-=2}while(0<m)for(s=p;0!==s;s--)for(i=t.bl_count[s];0!==i;)u<(n=t.heap[--r])||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}}(t,e),C(s,u,t.bl_count)}function B(t,e,r){var i,n,s=-1,a=e[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=a,a=e[2*(i+1)+1],++o<h&&n===a||(o<u?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=n,u=(o=0)===a?(h=138,3):n===a?(h=6,3):(h=7,4))}function T(t,e,r){var i,n,s=-1,a=e[1],o=0,h=7,u=4;for(0===a&&(h=138,u=3),i=0;i<=r;i++)if(n=a,a=e[2*(i+1)+1],!(++o<h&&n===a)){if(o<u)for(;x(t,n,t.bl_tree),0!=--o;);else 0!==n?(n!==s&&(x(t,n,t.bl_tree),o--),x(t,16,t.bl_tree),k(t,o-3,2)):o<=10?(x(t,17,t.bl_tree),k(t,o-3,3)):(x(t,18,t.bl_tree),k(t,o-11,7));s=n,u=(o=0)===a?(h=138,3):n===a?(h=6,3):(h=7,4)}}n(g);var R=!1;function D(t,e,r,n){k(t,0+ +!!n,3),A(t),w(t,r),w(t,~r),i.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}r._tr_init=function(t){R||(function(){var t,e,r,i,n,h=Array(16);for(i=r=0;i<28;i++)for(f[i]=r,t=0;t<1<<s[i];t++)c[r++]=i;for(c[r-1]=i,i=n=0;i<16;i++)for(g[i]=n,t=0;t<1<<a[i];t++)d[n++]=i;for(n>>=7;i<30;i++)for(g[i]=n<<7,t=0;t<1<<a[i]-7;t++)d[256+n++]=i;for(e=0;e<=15;e++)h[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,h[8]++;for(;t<=255;)u[2*t+1]=9,t++,h[9]++;for(;t<=279;)u[2*t+1]=7,t++,h[7]++;for(;t<=287;)u[2*t+1]=8,t++,h[8]++;for(C(u,287,h),t=0;t<30;t++)l[2*t+1]=5,l[2*t]=S(t,5);p=new b(u,s,257,286,15),m=new b(l,a,0,30,15),_=new b([],o,0,19,7)}(),R=!0),t.l_desc=new v(t.dyn_ltree,p),t.d_desc=new v(t.dyn_dtree,m),t.bl_desc=new v(t.bl_tree,_),t.bi_buf=0,t.bi_valid=0,z(t)},r._tr_stored_block=D,r._tr_flush_block=function(t,e,r,i){var n,s,a=0;0<t.level?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=0xf3ffc07f;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)),I(t,t.l_desc),I(t,t.d_desc),a=function(t){var e;for(B(t,t.dyn_ltree,t.l_desc.max_code),B(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;3<=e&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==e?D(t,e,r,i):4===t.strategy||s===n?(k(t,2+ +!!i,3),O(t,u,l)):(k(t,4+ +!!i,3),function(t,e,r,i){var n;for(k(t,e-257,5),k(t,r-1,5),k(t,i-4,4),n=0;n<i;n++)k(t,t.bl_tree[2*h[n]+1],3);T(t,t.dyn_ltree,e-1),T(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),O(t,t.dyn_ltree,t.dyn_dtree)),z(t),i&&A(t)},r._tr_tally=function(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*(c[r]+256+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){k(t,2,3),x(t,256,u),16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,e,i){(function(t){!function(t){"use strict";if(!t.setImmediate){var e,r,i,n,s=1,a={},o=!1,h=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,e="[object process]"===({}).toString.call(t.process)?function(t){process.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((i=new MessageChannel).port1.onmessage=function(t){d(t.data)},function(t){i.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):function(t){setTimeout(d,0,t)}:(n="setImmediate$"+Math.random()+"$",t.addEventListener?t.addEventListener("message",c,!1):t.attachEvent("onmessage",c),function(e){t.postMessage(n+e,"*")}),u.setImmediate=function(t){"function"!=typeof t&&(t=Function(""+t));for(var r=Array(arguments.length-1),i=0;i<r.length;i++)r[i]=arguments[i+1];var n={callback:t,args:r};return a[s]=n,e(s),s++},u.clearImmediate=l}function l(t){delete a[t]}function d(t){if(o)setTimeout(d,0,t);else{var e=a[t];if(e){o=!0;try{var r=e.callback,i=e.args;switch(i.length){case 0:r();break;case 1:r(i[0]);break;case 2:r(i[0],i[1]);break;case 3:r(i[0],i[1],i[2]);break;default:r.apply(void 0,i)}}finally{l(t),o=!1}}}}function c(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(n)&&d(+e.data.slice(n.length))}}("u"<typeof self?void 0===t?this:t:self)}).call(this,void 0!==r.g?r.g:"u">typeof self?self:"u">typeof window?window:{})},{}]},{},[10])(10)},"../../node_modules/.pnpm/@turbowarp+jszip@3.12.0/node_modules/@turbowarp/jszip/dist sync recursive"(t){function e(t){var e=Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}e.keys=()=>[],e.resolve=e,e.id="../../node_modules/.pnpm/@turbowarp+jszip@3.12.0/node_modules/@turbowarp/jszip/dist sync recursive",t.exports=e}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(t,e,i)=>{var n=(e,i)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,[i]:e[n]})};n(e,"get"),n(i,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{Costume:()=>l,Project:()=>w,Sound:()=>d,Sprite:()=>v,Stage:()=>b,Target:()=>g,md5:()=>h,sniffFormat:()=>p,uid:()=>_});var t=r("../../node_modules/.pnpm/@turbowarp+jszip@3.12.0/node_modules/@turbowarp/jszip/dist/jszip.min.js");let e=new Int32Array([0xd76aa478,0xe8c7b756,0x242070db,0xc1bdceee,0xf57c0faf,0x4787c62a,0xa8304613,0xfd469501,0x698098d8,0x8b44f7af,0xffff5bb1,0x895cd7be,0x6b901122,0xfd987193,0xa679438e,0x49b40821,0xf61e2562,0xc040b340,0x265e5a51,0xe9b6c7aa,0xd62f105d,0x2441453,0xd8a1e681,0xe7d3fbc8,0x21e1cde6,0xc33707d6,0xf4d50d87,0x455a14ed,0xa9e3e905,0xfcefa3f8,0x676f02d9,0x8d2a4c8a,0xfffa3942,0x8771f681,0x6d9d6122,0xfde5380c,0xa4beea44,0x4bdecfa9,0xf6bb4b60,0xbebfbc70,0x289b7ec6,0xeaa127fa,0xd4ef3085,0x4881d05,0xd9d4d039,0xe6db99e5,0x1fa27cf8,0xc4ac5665,0xf4292244,0x432aff97,0xab9423a7,0xfc93a039,0x655b59c3,0x8f0ccc92,0xffeff47d,0x85845dd1,0x6fa87e4f,0xfe2ce6e0,0xa3014314,0x4e0811a1,0xf7537e82,0xbd3af235,0x2ad7d2bb,0xeb86d391]),n=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],s=(t,e)=>t<<e|t>>>32-e,a=[];for(let t=0;t<256;t++)a[t]=(t<16?"0":"")+t.toString(16);let o=t=>a[255&t]+a[t>>>8&255]+a[t>>>16&255]+a[t>>>24&255];function h(t){let r=t instanceof Uint8Array?t:new Uint8Array(t),i=r.length,a=i+1,h=a+(a%64<=56?56-a%64:120-a%64)+8,u=new Uint8Array(h);u.set(r),u[i]=128;let l=i<<3>>>0,d=i>>>29>>>0;u[h-8]=255&l,u[h-7]=l>>>8&255,u[h-6]=l>>>16&255,u[h-5]=l>>>24&255,u[h-4]=255&d,u[h-3]=d>>>8&255,u[h-2]=d>>>16&255,u[h-1]=d>>>24&255;let c=0x67452301,f=0xefcdab89,p=0x98badcfe,m=0x10325476,_=new Int32Array(16);for(let t=0;t<h;t+=64){for(let e=0;e<16;e++){let r=t+4*e;_[e]=u[r]|u[r+1]<<8|u[r+2]<<16|u[r+3]<<24}let r=c,i=f,a=p,o=m;for(let t=0;t<64;t++){let h,u;t<16?(h=i&a|~i&o,u=t):t<32?(h=o&i|~o&a,u=(5*t+1)%16):t<48?(h=i^a^o,u=(3*t+5)%16):(h=a^(i|~o),u=7*t%16),h=h+r+e[t]+_[u]|0,r=o,o=a,a=i,i=i+s(h,n[t])|0}c=c+r|0,f=f+i|0,p=p+a|0,m=m+o|0}return o(c)+o(f)+o(p)+o(m)}class u{get name(){return this.json.name}set name(t){this.json.name=String(t)}get dataFormat(){return this.json.dataFormat}get md5ext(){return this.json.md5ext}get data(){return this.project.assets.get(this.json.md5ext)}set data(t){let e=t instanceof Uint8Array?t:new Uint8Array(t),r=this.json.md5ext,i=h(e);this.json.assetId=i,this.json.md5ext=`${i}.${this.json.dataFormat}`,this.project.assets.set(this.json.md5ext,e),r&&r!==this.json.md5ext&&this.project._maybeDropAsset(r)}constructor(t,e){this.json=t,this.project=e}}class l extends u{get bitmapResolution(){return this.json.bitmapResolution??1}set bitmapResolution(t){this.json.bitmapResolution=Number(t)}get rotationCenterX(){return this.json.rotationCenterX??0}set rotationCenterX(t){this.json.rotationCenterX=Number(t)}get rotationCenterY(){return this.json.rotationCenterY??0}set rotationCenterY(t){this.json.rotationCenterY=Number(t)}}class d extends u{get rate(){return this.json.rate}set rate(t){this.json.rate=Number(t)}get sampleCount(){return this.json.sampleCount}set sampleCount(t){this.json.sampleCount=Number(t)}}let c=(t,e)=>e.every((e,r)=>t[r]===e),f=t=>[...t].map(t=>t.charCodeAt(0));function p(t){if(!t||t.length<4)return;if(c(t,[137,80,78,71]))return"png";if(c(t,[255,216,255]))return"jpg";if(c(t,f("GIF")))return"gif";if(c(t,f("RIFF")))return"wav";if(c(t,f("ID3"))||255===t[0]&&(224&t[1])==224)return"mp3";let e=String.fromCharCode(...t.slice(0,256)).trimStart();if(e.startsWith("<?xml")||e.startsWith("<svg")||e.includes("<svg"))return"svg"}let m="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function _(){let t="";for(let e=0;e<20;e++)t+=m[Math.floor(Math.random()*m.length)];return t}class g{get isStage(){return!!this.json.isStage}get name(){return this.json.name}set name(t){this.json.name=String(t)}get volume(){return this.json.volume??100}set volume(t){this.json.volume=Number(t)}get costumes(){return this.json.costumes.map(t=>new l(t,this.project))}get currentCostume(){return this.json.currentCostume??0}set currentCostume(t){this.json.currentCostume=Number(t)}getCostume(t){let e=this.json.costumes.find(e=>e.name===t);return e?new l(e,this.project):void 0}addCostume(t,e,r={}){let i=e instanceof Uint8Array?e:new Uint8Array(e),n=r.dataFormat??p(i)??"png",s=h(i),a={name:String(t),bitmapResolution:r.bitmapResolution??("svg"===n?1:2),dataFormat:n,assetId:s,md5ext:`${s}.${n}`,rotationCenterX:r.rotationCenterX??0,rotationCenterY:r.rotationCenterY??0};return this.project.assets.set(a.md5ext,i),this.json.costumes.push(a),new l(a,this.project)}removeCostume(t){return this._removeMedia("costumes",t)}get sounds(){return this.json.sounds.map(t=>new d(t,this.project))}getSound(t){let e=this.json.sounds.find(e=>e.name===t);return e?new d(e,this.project):void 0}addSound(t,e,r={}){let i=e instanceof Uint8Array?e:new Uint8Array(e),n=r.dataFormat??p(i)??"wav",s=h(i),a={name:String(t),assetId:s,dataFormat:n,format:"",rate:r.rate??48e3,sampleCount:r.sampleCount??0,md5ext:`${s}.${n}`};return this.project.assets.set(a.md5ext,i),this.json.sounds.push(a),new d(a,this.project)}removeSound(t){return this._removeMedia("sounds",t)}_removeMedia(t,e){let r=this.json[t],i="number"==typeof e?e:r.findIndex(t=>t.name===e);if(i<0||i>=r.length)return!1;let[n]=r.splice(i,1);return"costumes"===t&&this.json.currentCostume>=r.length&&(this.json.currentCostume=Math.max(0,r.length-1)),this.project._maybeDropAsset(n.md5ext),!0}get variableNames(){return Object.values(this.json.variables).map(([t])=>t)}getVariable(t){let e=Object.values(this.json.variables).find(([e])=>e===t);return e?e[1]:void 0}setVariable(t,e){for(let[r,i]of Object.entries(this.json.variables))if(i[0]===t)return i[1]=e,r;let r=_();return this.json.variables[r]=[t,e],r}deleteVariable(t){for(let[e,r]of Object.entries(this.json.variables))if(r[0]===t)return delete this.json.variables[e],!0;return!1}get listNames(){return Object.values(this.json.lists).map(([t])=>t)}getList(t){let e=Object.values(this.json.lists).find(([e])=>e===t);return e?e[1]:void 0}setList(t,e=[]){for(let[r,i]of Object.entries(this.json.lists))if(i[0]===t)return i[1]=e,r;let r=_();return this.json.lists[r]=[t,e],r}deleteList(t){for(let[e,r]of Object.entries(this.json.lists))if(r[0]===t)return delete this.json.lists[e],!0;return!1}get blocks(){return this.json.blocks}constructor(t,e){this.json=t,this.project=e}}class b extends g{get isStage(){return!0}get tempo(){return this.json.tempo??60}set tempo(t){this.json.tempo=Number(t)}get videoState(){return this.json.videoState??"off"}set videoState(t){this.json.videoState=String(t)}get videoTransparency(){return this.json.videoTransparency??50}set videoTransparency(t){this.json.videoTransparency=Number(t)}get broadcastNames(){return Object.values(this.json.broadcasts)}addBroadcast(t){for(let[e,r]of Object.entries(this.json.broadcasts))if(r===t)return e;let e=`broadcastMsgId-${t}`;return this.json.broadcasts[e]=t,e}}class v extends g{get isStage(){return!1}get x(){return this.json.x??0}set x(t){this.json.x=Number(t)}get y(){return this.json.y??0}set y(t){this.json.y=Number(t)}get size(){return this.json.size??100}set size(t){this.json.size=Number(t)}get direction(){return this.json.direction??90}set direction(t){this.json.direction=Number(t)}get visible(){return this.json.visible??!0}set visible(t){this.json.visible=!!t}get draggable(){return this.json.draggable??!1}set draggable(t){this.json.draggable=!!t}get rotationStyle(){return this.json.rotationStyle??"all around"}set rotationStyle(t){this.json.rotationStyle=String(t)}get layerOrder(){return this.json.layerOrder??0}set layerOrder(t){this.json.layerOrder=Number(t)}}let y={semver:"3.0.0",vm:"14.0.0",agent:""};class w{static async load(e){let r=await t.loadAsync(e),i=r.file("project.json");if(!i)throw Error("Not a valid sb3: project.json is missing.");let n=JSON.parse(await i.async("string")),s=new Map,a=[];return r.forEach((t,e)=>{e.dir||"project.json"===t||a.push(e.async("uint8array").then(e=>s.set(t,e)))}),await Promise.all(a),new w(n,s)}static create(){return new w({targets:[{isStage:!0,name:"Stage",variables:{},lists:{},broadcasts:{},blocks:{},comments:{},currentCostume:0,costumes:[],sounds:[],volume:100,layerOrder:0,tempo:60,videoTransparency:50,videoState:"on",textToSpeechLanguage:null}],monitors:[],extensions:[],meta:{...y}})}get stage(){return new b(this.json.targets.find(t=>t.isStage),this)}get sprites(){return this.json.targets.filter(t=>!t.isStage).map(t=>new v(t,this))}get targets(){return this.json.targets.map(t=>t.isStage?new b(t,this):new v(t,this))}get meta(){return this.json.meta}get monitors(){return this.json.monitors}get extensions(){return this.json.extensions}sprite(t){let e=this.json.targets.find(e=>!e.isStage&&e.name===t);return e?new v(e,this):void 0}target(t){let e=this.json.targets.find(e=>e.name===t);if(e)return e.isStage?new b(e,this):new v(e,this)}addSprite(t,e={}){if(this.sprite(t))throw Error(`A sprite named "${t}" already exists.`);let r=Math.max(0,...this.json.targets.map(t=>t.layerOrder??0)),i={isStage:!1,name:String(t),variables:{},lists:{},broadcasts:{},blocks:{},comments:{},currentCostume:0,costumes:[],sounds:[],volume:100,layerOrder:r+1,visible:!0,x:0,y:0,size:100,direction:90,draggable:!1,rotationStyle:"all around",...e};return this.json.targets.push(i),new v(i,this)}removeSprite(t){let e="string"==typeof t?t:t.name,r=this.json.targets.findIndex(t=>!t.isStage&&t.name===e);if(r<0)return!1;let[i]=this.json.targets.splice(r,1);for(let t of[...i.costumes,...i.sounds])this._maybeDropAsset(t.md5ext);return!0}_maybeDropAsset(t){!t||this.json.targets.some(e=>e.costumes.some(e=>e.md5ext===t)||e.sounds.some(e=>e.md5ext===t))||this.assets.delete(t)}async save({compressionLevel:e=6}={}){let r=new t;for(let[t,e]of(r.file("project.json",JSON.stringify(this.json)),this.assets))r.file(t,e);return r.generateAsync({type:"uint8array",compression:"DEFLATE",compressionOptions:{level:e}})}constructor(t,e=new Map){this.json=t,this.assets=e}}})(),i})());
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
|
|
3
|
+
JSZip v3.11.1 - A JavaScript class for generating and reading zip files
|
|
4
|
+
<http://stuartk.com/jszip>
|
|
5
|
+
|
|
6
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
7
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
8
|
+
|
|
9
|
+
JSZip uses the library pako released under the MIT license :
|
|
10
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
11
|
+
*/
|