JSZip - A Javascript class for generating and reading zip files
JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
<http://stuartk.com/jszip>
(c) 2009-2012 Stuart Knightley <stuart [at] stuartk.com>
(c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
JSZip uses the library zlib.js released under the following license :
JSZip uses the library zlib.js released under the following license :
zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License
zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License
*/
*/
!function(a){"object"==typeofexports?module.exports=a():"function"==typeofdefine&&define.amd?define(a):"undefined"!=typeofwindow?window.JSZip=a():"undefined"!=typeofglobal?global.JSZip=a():"undefined"!=typeofself&&(self.JSZip=a())}(function(){returnfunctiona(b,c,d){functione(g,h){if(!c[g]){if(!b[g]){vari="function"==typeofrequire&&require;if(!h&&i)returni(g,!0);if(f)returnf(g,!0);thrownewError("Cannot find module '"+g+"'")}varj=c[g]={exports:{}};b[g][0].call(j.exports,function(a){varc=b[g][1][a];returne(c?c:a)},j,j.exports,a,b,c,d)}returnc[g].exports}for(varf="function"==typeofrequire&&require,g=0;g<d.length;g++)e(d[g]);returne}({1:[function(a,b,c){"use strict";vard="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(a){for(varb,c,e,f,g,h,i,j="",k=0;k<a.length;)b=a.charCodeAt(k++),c=a.charCodeAt(k++),e=a.charCodeAt(k++),f=b>>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|e>>6,i=63&e,isNaN(c)?h=i=64:isNaN(e)&&(i=64),j=j+d.charAt(f)+d.charAt(g)+d.charAt(h)+d.charAt(i);returnj},c.decode=function(a){varb,c,e,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)f=d.indexOf(a.charAt(k++)),g=d.indexOf(a.charAt(k++)),h=d.indexOf(a.charAt(k++)),i=d.indexOf(a.charAt(k++)),b=f<<2|g>>4,c=(15&g)<<4|h>>2,e=(3&h)<<6|i,j+=String.fromCharCode(b),64!=h&&(j+=String.fromCharCode(c)),64!=i&&(j+=String.fromCharCode(e));returnj}},{}],2:[function(a,b){"use strict";functionc(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}c.prototype={getContent:function(){returnnull},getCompressedContent:function(){returnnull}},b.exports=c},{}],3:[function(a,b,c){"use strict";c.STORE={magic:"\x00\x00",compress:function(a){returna},uncompress:function(a){returna},compressInputType:null,uncompressInputType:null},c.DEFLATE=a("./flate")},{"./flate":6}],4:[function(a,b){"use strict";functionc(){this.data=null,this.length=0,this.index=0}vard=a("./utils");c.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<a||0>a)thrownewError("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){varb,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);returnthis.index+=a,c},readString:function(a){returnd.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){vara=this.readInt(4);returnnewDate((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=c},{"./utils":14}],5:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.date=null,c.compression=null},{}],6:[function(a,b,c){"use strict";vard="undefined"!=typeofUint8Array&&"undefined"!=typeofUint16Array&&"undefined"!=typeofUint32Array,e=a("zlibjs/bin/rawdeflate.min").Zlib,f=a("zlibjs/bin/rawinflate.min").Zlib;c.uncompressInputType=d?"uint8array":"array",c.compressInputType=d?"uint8array":"array",c.magic="\b\x00",c.compress=function(a){varb=newe.RawDeflate(a);returnb.compress()},c.uncompress=function(a){varb=newf.RawInflate(a);returnb.decompress()}},{"zlibjs/bin/rawdeflate.min":19,"zlibjs/bin/rawinflate.min":20}],7:[function(a,b){"use strict";functionc(a,b){this.files={},this.root="",a&&this.load(a,b),this.clone=function(){vara=newc;for(varbinthis)"function"!=typeofthis[b]&&(a[b]=this[b]);returna}}c.prototype=a("./object"),c.prototype.load=a("./load"),c.support=a("./support"),c.defaults=a("./defaults"),c.utils=a("./utils"),c.base64=a("./base64"),c.compressions=a("./compressions"),b.exports=c},{"./base64":1,"./compressions":3,"./defaults":5,"./load":8,"./object":9,"./support":12,"./utils":14}],8:[function(a,b){"use strict";varc=a("./base64"),d=a("./zipEntries");b.exports=function(a,b){vare,f,g,h;for(b=b||{},b.base64&&(a=c.decode(a)),f=newd(a,b),e=f.files,g=0;g<e.length;g++)h=e[g],this.file(h.fileName,h.decompressed,{binary:!0,optimizedBinaryString:!0,date:h.date,dir:h.dir});returnthis}},{"./base64":1,"./zipEntries":15}],9:[function(a,b){"use strict";varc,d,e=a("./support"),f=a("./utils"),g=a("./signature"),h=a("./defaults"),i=a("./base64"),j=a("./compressions"),k=a("./compressedObject"),l=a("./nodeBuffer");e.uint8array&&"function"==typeofTextEncoder&&"function"==typeofTextDecoder&&(c=newTextEncoder("utf-8"),d=newTextDecoder("utf-8"));varm=function(a){if(a._datainstanceofk&&(a._data=a._data.getContent(),a.options.binary=!0,a.options.base64=!1,"uint8array"===f.getTypeOf(a._data))){varb=a._data;a._data=newUint8Array(b.length),0!==b.length&&a._data.set(b,0)}returna._data},n=function(a){varb=m(a),d=f.getTypeOf(b);if("string"===d){if(!a.options.binary){if(c)returnc.encode(b);if(e.nodebuffer)returnl(b,"utf-8")}returna.asBinary()}returnb},o=function(a){varb=m(this);returnnull===b||"undefined"==typeofb?"":(this.options.base64&&(b=i.decode(b)),b=a&&this.options.binary?A.utf8decode(b):f.transformTo("string",b),a||this.options.binary||(b=A.utf8encode(b)),b)},p=function(a,b,c){this.name=a,this._data=b,this.options=c};p.prototype={asText:function(){returno.call(this,!0)},asBinary:function(){returno.call(this,!1)},asNodeBuffer:function(){vara=n(this);returnf.transformTo("nodebuffer",a)},asUint8Array:function(){vara=n(this);returnf.transformTo("uint8array",a)},asArrayBuffer:function(){returnthis.asUint8Array().buffer}};varq=function(a,b){varc,d="";for(c=0;b>c;c++)d+=String.fromCharCode(255&a),a>>>=8;returnd},r=function(){vara,b,c={};for(a=0;a<arguments.length;a++)for(binarguments[a])arguments[a].hasOwnProperty(b)&&"undefined"==typeofc[b]&&(c[b]=arguments[a][b]);returnc},s=function(a){returna=a||{},a.base64!==!0||null!==a.binary&&void0!==a.binary||(a.binary=!0),a=r(a,h),a.date=a.date||newDate,null!==a.compression&&(a.compression=a.compression.toUpperCase()),a},t=function(a,b,c){vard=u(a),e=f.getTypeOf(b);if(d&&v.call(this,d),c=s(c),c.dir||null===b||"undefined"==typeofb)c.base64=!1,c.binary=!1,b=null;elseif("string"===e)c.binary&&!c.base64&&c.optimizedBinaryString!==!0&&(b=f.string2binary(b));else{if(c.base64=!1,c.binary=!0,!(e||binstanceofk))thrownewError("The data of '"+a+"' is in an unsupported format !");"arraybuffer"===e&&(b=f.transformTo("uint8array",b))}varg=newp(a,b,c);returnthis.files[a]=g,g},u=function(a){"/"==a.slice(-1)&&(a=a.substring(0,a.length-1));varb=a.lastIndexOf("/");returnb>0?a.substring(0,b):""},v=function(a){return"/"!=a.slice(-1)&&(a+="/"),this.files[a]||t.call(this,a,null,{dir:!0}),this.files[a]},w=function(a,b){varc,d=newk;returna._datainstanceofk?(d.uncompressedSize=a._data.uncompressedSize,d.crc32=a._data.crc32,0===d.uncompressedSize||a.options.dir?(b=j.STORE,d.compressedContent="",d.crc32=0):a._data.compressionMethod===b.magic?d.compressedContent=a._data.getCompressedContent():(c=a._data.getContent(),d.compressedContent=b.compress(f.transformTo(b.compressInputType,c)))):(c=n(a),(!c||0===c.length||a.options.dir)&&(b=j.STORE,c=""),d.uncompressedSize=c.length,d.crc32=this.crc32(c),d.compressedContent=b.compress(f.transformTo(b.compressInputType,c))),d.compressedSize=d.compressedContent.length,d.compressionMethod=b.magic,d},x=function(a,b,c,d){vare,f,h=(c.compressedContent,this.utf8encode(b.name)),i=h!==b.name,j=b.options,k="",l="";e=j.date.getHours(),e<<=6,e|=j.date.getMinutes(),e<<=5,e|=j.date.getSeconds()/2,f=j.date.getFullYear()-1980,f<<=4,f|=j.date.getMonth()+1,f<<=5,f|=j.date.getDate(),i&&(l=q(1,1)+q(this.crc32(h),4)+h,k+="up"+q(l.length,2)+l);varm="";m+="\n\x00",m+=i?"\x00\b":"\x00\x00",m+=c.compressionMethod,m+=q(e,2),m+=q(f,2),m+=q(c.crc32,4),m+=q(c.compressedSize,4),m+=q(c.uncompressedSize,4),m+=q(h.length,2),m+=q(k.length,2);varn=g.LOCAL_FILE_HEADER+m+h+k,o=g.CENTRAL_FILE_HEADER+"\x00"+m+"\x00\x00\x00\x00\x00\x00"+(b.options.dir===!0?"\x00\x00\x00":"\x00\x00\x00\x00")+q(d,4)+h+k;return{fileRecord:n,dirRecord:o,compressedObject:c}},y=function(){this.data=[]};y.prototype={append:function(a){a=f.transformTo("string",a),this.data.push(a)},finalize:function(){returnthis.data.join("")}};varz=function(a){this.data=newUint8Array(a),this.index=0};z.prototype={append:function(a){0!==a.length&&(a=f.transformTo("uint8array",a),this.data.set(a,this.index),this.index+=a.length)},finalize:function(){returnthis.data}};varA={load:function(){thrownewError("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(a){varb,c,d,e,f=[];for(binthis.files)this.files.hasOwnProperty(b)&&(d=this.files[b],e=newp(d.name,d._data,r(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,e)&&f.push(e));returnf},file:function(a,b,c){if(1===arguments.length){if(f.isRegExp(a)){vard=a;returnthis.filter(function(a,b){return!b.options.dir&&d.test(a)})}returnthis.filter(function(b,c){return!c.options.dir&&b===a})[0]||null}returna=this.root+a,t.call(this,a,b,c),this},folder:function(a){if(!a)returnthis;if(f.isRegExp(a))returnthis.filter(function(b,c){returnc.options.dir&&a.test(b)});varb=this.root+a,c=v.call(this,b),d=this.clone();returnd.root=c.name,d},remove:function(a){a=this.root+a;varb=this.files[a];if(b||("/"!=a.slice(-1)&&(a+="/"),b=this.files[a]),b)if(b.options.dir)for(varc=this.filter(function(b,c){returnc.name.slice(0,a.length)===a}),d=0;d<c.length;d++)deletethis.files[c[d].name];elsedeletethis.files[a];returnthis},generate:function(a){a=r(a||{},{base64:!0,compression:"STORE",type:"base64"}),f.checkSupport(a.type);varb,c,d=[],e=0,h=0;for(varkinthis.files)if(this.files.hasOwnProperty(k)){varl=this.files[k],m=l.options.compression||a.compression.toUpperCase(),n=j[m];if(!n)thrownewError(m+" is not a valid compression method !");varo=w.call(this,l,n),p=x.call(this,k,l,o,e);e+=p.fileRecord.length+o.compressedSize,h+=p.dirRecord.length,d.push(p)}vars="";s=g.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+q(d.length,2)+q(d.length,2)+q(h,4)+q(e,4)+"\x00\x00";vart=a.type.toLowerCase();for(b="uint8array"===t||"arraybuffer"===t||"blob"===t||"nodebuffer"===t?newz(e+h+s.length):newy(e+h+s.length),c=0;c<d.length;c++)b.append(d[c].fileRecord),b.append(d[c].compressedObject.compressedContent);for(c=0;c<d.length;c++)b.append(d[c].dirRecord);b.append(s);varu=b.finalize();switch(a.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":returnf.transformTo(a.type.toLowerCase(),u);case"blob":returnf.arrayBuffer2Blob(f.transformTo("arraybuffer",u));case"base64":returna.base64?i.encode(u):u;default:returnu}},crc32:function(a,b){if("undefined"==typeofa||!a.length)return0;varc="string"!==f.getTypeOf(a),d=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"==typeofb&&(b=0);vare=0,g=0,h=0;b=-1^b;for(vari=0,j=a.length;j>i;i++)h=c?a[i]:a.charCodeAt(i),g=255&(b^h),e=d[g],b=b>>>8^e;return-1^b},utf8encode:function(a){if(c){varb=c.encode(a);returnf.transformTo("string",b)}if(e.nodebuffer)returnf.transformTo("string",l(a,"utf-8"));for(vard=[],g=0,h=0;h<a.length;h++){vari=a.charCodeAt(h);128>i?d[g++]=String.fromCharCode(i):i>127&&2048>i?(d[g++]=String.fromCharCode(i>>6|192),d[g++]=String.fromCharCode(63&i|128)):(d[g++]=String.fromCharCode(i>>12|224),d[g++]=String.fromCharCode(i>>6&63|128),d[g++]=String.fromCharCode(63&i|128))}returnd.join("")},utf8decode:function(a){varb=[],c=0,g=f.getTypeOf(a),h="string"!==g,i=0,j=0,k=0,l=0;if(d)returnd.decode(f.transformTo("uint8array",a));if(e.nodebuffer)returnf.transformTo("nodebuffer",a).toString("utf-8");for(;i<a.length;)j=h?a[i]:a.charCodeAt(i),128>j?(b[c++]=String.fromCharCode(j),i++):j>191&&224>j?(k=h?a[i+1]:a.charCodeAt(i+1),b[c++]=String.fromCharCode((31&j)<<6|63&k),i+=2):(k=h?a[i+1]:a.charCodeAt(i+1),l=h?a[i+2]:a.charCodeAt(i+2),b[c++]=String.fromCharCode((15&j)<<12|(63&k)<<6|63&l),i+=3);returnb.join("")}};b.exports=A},{"./base64":1,"./compressedObject":2,"./compressions":3,"./defaults":5,"./nodeBuffer":17,"./signature":10,"./support":12,"./utils":14}],10:[function(a,b,c){"use strict";c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\b"},{}],11:[function(a,b){"use strict";functionc(a,b){this.data=a,b||(this.data=e.string2binary(this.data)),this.length=this.data.length,this.index=0}vard=a("./dataReader"),e=a("./utils");c.prototype=newd,c.prototype.byteAt=function(a){returnthis.data.charCodeAt(a)},c.prototype.lastIndexOfSignature=function(a){returnthis.data.lastIndexOf(a)},c.prototype.readData=function(a){this.checkOffset(a);varb=this.data.slice(this.index,this.index+a);returnthis.index+=a,b},b.exports=c},{"./dataReader":4,"./utils":14}],12:[function(a,b,c){vard=a("__browserify_process");if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer="undefined"!=typeofArrayBuffer&&"undefined"!=typeofUint8Array,c.nodebuffer=!d.browser,c.uint8array="undefined"!=typeofUint8Array,"undefined"==typeofArrayBuffer)c.blob=!1;else{vare=newArrayBuffer(0);try{c.blob=0===newBlob([e],{type:"application/zip"}).size}catch(f){try{varg=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,h=newg;h.append(e),c.blob=0===h.getBlob("application/zip").size}catch(f){c.blob=!1}}}},{__browserify_process:18}],13:[function(a,b){"use strict";functionc(a){a&&(this.data=a,this.length=this.data.length,this.index=0)}vard=a("./dataReader");c.prototype=newd,c.prototype.byteAt=function(a){returnthis.data[a]},c.prototype.lastIndexOfSignature=function(a){for(varb=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.length-4;f>=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)returnf;return-1},c.prototype.readData=function(a){this.checkOffset(a);varb=this.data.subarray(this.index,this.index+a);returnthis.index+=a,b},b.exports=c},{"./dataReader":4}],14:[function(a,b,c){"use strict";functiond(a){returna}functione(a,b){for(varc=0;c<a.length;++c)b[c]=255&a.charCodeAt(c);returnb}functionf(a){varb=65536,d=[],e=a.length,f=c.getTypeOf(a),g=0,h=!0;try{switch(f){case"uint8array":String.fromCharCode.apply(null,newUint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,j(0))}}catch(i){h=!1}if(!h){for(vark="",l=0;l<a.length;l++)k+=String.fromCharCode(a[l]);returnk}for(;e>g&&b>1;)try{d.push("array"===f||"nodebuffer"===f?String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e))):String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}returnd.join("")}functiong(a,b){for(varc=0;c<a.length;c++)b[c]=a[c];returnb}varh=a("./support"),i=a("./compressions"),j=a("./nodeBuffer");c.string2binary=function(a){for(varb="",c=0;c<a.length;c++)b+=String.fromCharCode(255&a.charCodeAt(c));returnb},c.string2Uint8Array=function(a){returnc.transformTo("uint8array",a)},c.uint8Array2String=function(a){returnc.transformTo("string",a)},c.string2Blob=function(a){varb=c.transformTo("arraybuffer",a);returnc.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){c.checkSupport("blob");try{returnnewBlob([a],{type:"application/zip"})}catch(b){try{vard=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,e=newd;returne.append(a),e.getBlob("application/zip")}catch(b){thrownewError("Bug : can't construct the Blob.")}}};vark={};k.string={string:d,array:function(a){returne(a,newArray(a.length))},arraybuffer:function(a){returnk.string.uint8array(a).buffer},uint8array:function(a){returne(a,newUint8Array(a.length))},nodebuffer:function(a){returne(a,j(a.length))}},k.array={string:f,array:d,arraybuffer:function(a){returnnewUint8Array(a).buffer},uint8array:function(a){returnnewUint8Array(a)},nodebuffer:function(a){returnj(a)}},k.arraybuffer={string:function(a){returnf(newUint8Array(a))},array:function(a){returng(newUint8Array(a),newArray(a.byteLength))},arraybuffer:d,uint8array:function(a){returnnewUint8Array(a)},nodebuffer:function(a){returnj(newUint8Array(a))}},k.uint8array={string:f,array:function(a){returng(a,newArray(a.length))},arraybuffer:function(a){returna.buffer},uint8array:d,nodebuffer:function(a){returnj(a)}},k.nodebuffer={string:f,array:function(a){returng(a,newArray(a.length))},arraybuffer:function(a){returnk.nodebuffer.uint8array(a).buffer},uint8array:function(a){returng(a,newUint8Array(a.length))},nodebuffer:d},c.transformTo=function(a,b){if(b||(b=""),!a)returnb;c.checkSupport(a);vard=c.getTypeOf(b),e=k[d][a](b);returne},c.getTypeOf=function(a){return"string"==typeofa?"string":"[object Array]"===Object.prototype.toString.call(a)?"array":h.nodebuffer&&j.test(a)?"nodebuffer":h.uint8array&&ainstanceofUint8Array?"uint8array":h.arraybuffer&&ainstanceofArrayBuffer?"arraybuffer":void0},c.checkSupport=function(a){varb=h[a.toLowerCase()];if(!b)thrownewError(a+" is not supported by this browser")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(a){varb,c,d="";for(c=0;c<(a||"").length;c++)b=a.charCodeAt(c),d+="\\x"+(16>b?"0":"")+b.toString(16).toUpperCase();returnd},c.findCompression=function(a){for(varbini)if(i.hasOwnProperty(b)&&i[b].magic===a)returni[b];returnnull},c.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)}},{"./compressions":3,"./nodeBuffer":17,"./support":12}],15:[function(a,b){"use strict";functionc(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}vard=a("./stringReader"),e=a("./nodeBufferReader"),f=a("./uint8ArrayReader"),g=a("./utils"),h=a("./signature"),i=a("./zipEntry"),j=a("./support");c.prototype={checkSignature:function(a){varb=this.reader.readString(4);if(b!==a)thrownewError("Corrupted zip or bug : unexpected signature ("+g.pretty(b)+", expected "+g.pretty(a)+")")},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),this.zipComment=this.reader.readString(this.zipCommentLength)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),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(vara,b,c,d=this.zip64EndOfCentralSize-44,e=0;d>e;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)thrownewError("Multi-volumes zip are not supported")},readLocalFiles:function(){vara,b;for(a=0;a<this.files.length;a++)b=this.files[a],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(h.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8()},readCentralDir:function(){vara;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===h.CENTRAL_FILE_HEADER;)a=newi({zip64:this.zip64},this.loadOptions),a.readCentralPart(this.reader),this.files.push(a)},readEndOfCentral:function(){vara=this.reader.lastIndexOfSignature(h.CENTRAL_DIRECTORY_END);if(-1===a)thrownewError("Corrupted zip : can't find end of central directory");if(this.reader.setIndex(a),this.checkSignature(h.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===g.MAX_VALUE_16BITS||this.diskWithCentralDirStart===g.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===g.MAX_VALUE_16BITS||this.centralDirRecords===g.MAX_VALUE_16BITS||this.centralDirSize===g.MAX_VALUE_32BITS||this.centralDirOffset===g.MAX_VALUE_32BITS){if(this.zip64=!0,a=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),-1===a)thrownewError("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(a),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(a){varb=g.getTypeOf(a);this.reader="string"!==b||j.uint8array?"nodebuffer"===b?newe(a):newf(g.transformTo("uint8array",a)):newd(a,this.loadOptions.optimizedBinaryString)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=c},{"./nodeBufferReader":17,"./signature":10,"./stringReader":11,"./support":12,"./uint8ArrayReader":13,"./utils":14,"./zipEntry":16}],16:[function(a,b){"use strict";functionc(a,b){this.options=a,this.loadOptions=b}vard=a("./stringReader"),e=a("./utils"),f=a("./compressedObject"),g=a("./object");c.prototype={isEncrypted:function(){return1===(1&this.bitFlag)},useUTF8:function(){return2048===(2048&this.bitFlag)},prepareCompressedContent:function(a,b,c){returnfunction(){vard=a.index;a.setIndex(b);vare=a.readData(c);returna.setIndex(d),e}},prepareContent:function(a,b,c,d,f){returnfunction(){vara=e.transformTo(d.uncompressInputType,this.getCompressedContent()),b=d.uncompress(a);if(b.length!==f)thrownewError("Bug : uncompressed data size mismatch");returnb}},readLocalPart:function(a){varb,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readString(this.fileNameLength),a.skip(c),-1==this.compressedSize||-1==this.uncompressedSize)thrownewError("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(b=e.findCompression(this.compressionMethod),null===b)thrownewError("Corrupted zip : compression "+e.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=newf,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(a,a.index,this.compressedSize,b),this.decompressed.getContent=this.prepareContent(a,a.index,this.compressedSize,b,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=e.transformTo("string",this.decompressed.getContent()),g.crc32(this.decompressed)!==this.crc32))thrownewError("Corrupted zip : CRC32 mismatch")},readCentralPart:function(a){if(this.versionMadeBy=a.readString(2),this.versionNeeded=a.readInt(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4),this.fileNameLength=a.readInt(2),this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())thrownewError("Encrypted zip are not supported");this.fileName=a.readString(this.fileNameLength),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){vara=newd(this.extraFields[1].value);this.uncompressedSize===e.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===e.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===e.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===e.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){varb,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index<e+this.extraFieldsLength;)b=a.readInt(2),c=a.readInt(2),d=a.readString(c),this.extraFields[b]={id:b,length:c,value:d}},handleUTF8:function(){if(this.useUTF8())this.fileName=g.utf8decode(this.fileName),this.fileComment=g.utf8decode(this.fileComment);else{vara=this.findExtraFieldUnicodePath();null!==a&&(this.fileName=a)}},findExtraFieldUnicodePath:function(){vara=this.extraFields[28789];if(a){varb=newd(a.value);return1!==b.readInt(1)?null:g.crc32(this.fileName)!==b.readInt(4)?null:g.utf8decode(b.readString(a.length-5))}returnnull}},b.exports=c},{"./compressedObject":2,"./object":9,"./stringReader":11,"./utils":14}],17:[function(){},{}],18:[function(a,b){varc=b.exports={};c.nextTick=function(){vara="undefined"!=typeofwindow&&window.setImmediate,b="undefined"!=typeofwindow&&window.postMessage&&window.addEventListener;if(a)returnfunction(a){returnwindow.setImmediate(a)};if(b){varc=[];returnwindow.addEventListener("message",function(a){varb=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){vard=c.shift();d()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}returnfunction(a){setTimeout(a,0)}}(),c.title="browser",c.browser=!0,c.env={},c.argv=[],c.binding=function(){thrownewError("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(){thrownewError("process.chdir is not supported")}},{}],19:[function(){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
!function(a){"object"==typeofexports?module.exports=a():"function"==typeofdefine&&define.amd?define(a):"undefined"!=typeofwindow?window.JSZip=a():"undefined"!=typeofglobal?global.JSZip=a():"undefined"!=typeofself&&(self.JSZip=a())}(function(){returnfunctiona(b,c,d){functione(g,h){if(!c[g]){if(!b[g]){vari="function"==typeofrequire&&require;if(!h&&i)returni(g,!0);if(f)returnf(g,!0);thrownewError("Cannot find module '"+g+"'")}varj=c[g]={exports:{}};b[g][0].call(j.exports,function(a){varc=b[g][1][a];returne(c?c:a)},j,j.exports,a,b,c,d)}returnc[g].exports}for(varf="function"==typeofrequire&&require,g=0;g<d.length;g++)e(d[g]);returne}({1:[function(a,b,c){"use strict";vard="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(a){for(varb,c,e,f,g,h,i,j="",k=0;k<a.length;)b=a.charCodeAt(k++),c=a.charCodeAt(k++),e=a.charCodeAt(k++),f=b>>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|e>>6,i=63&e,isNaN(c)?h=i=64:isNaN(e)&&(i=64),j=j+d.charAt(f)+d.charAt(g)+d.charAt(h)+d.charAt(i);returnj},c.decode=function(a){varb,c,e,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)f=d.indexOf(a.charAt(k++)),g=d.indexOf(a.charAt(k++)),h=d.indexOf(a.charAt(k++)),i=d.indexOf(a.charAt(k++)),b=f<<2|g>>4,c=(15&g)<<4|h>>2,e=(3&h)<<6|i,j+=String.fromCharCode(b),64!=h&&(j+=String.fromCharCode(c)),64!=i&&(j+=String.fromCharCode(e));returnj}},{}],2:[function(a,b){"use strict";functionc(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}c.prototype={getContent:function(){returnnull},getCompressedContent:function(){returnnull}},b.exports=c},{}],3:[function(a,b,c){"use strict";c.STORE={magic:"\x00\x00",compress:function(a){returna},uncompress:function(a){returna},compressInputType:null,uncompressInputType:null},c.DEFLATE=a("./flate")},{"./flate":6}],4:[function(a,b){"use strict";functionc(){this.data=null,this.length=0,this.index=0}vard=a("./utils");c.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<a||0>a)thrownewError("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){varb,c=0;for(this.checkOffset(a),b=this.index+a-1;b>=this.index;b--)c=(c<<8)+this.byteAt(b);returnthis.index+=a,c},readString:function(a){returnd.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){vara=this.readInt(4);returnnewDate((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1)}},b.exports=c},{"./utils":14}],5:[function(a,b,c){"use strict";c.base64=!1,c.binary=!1,c.dir=!1,c.date=null,c.compression=null},{}],6:[function(a,b,c){"use strict";vard="undefined"!=typeofUint8Array&&"undefined"!=typeofUint16Array&&"undefined"!=typeofUint32Array,e=a("zlibjs/bin/rawdeflate.min").Zlib,f=a("zlibjs/bin/rawinflate.min").Zlib;c.uncompressInputType=d?"uint8array":"array",c.compressInputType=d?"uint8array":"array",c.magic="\b\x00",c.compress=function(a){varb=newe.RawDeflate(a);returnb.compress()},c.uncompress=function(a){varb=newf.RawInflate(a);returnb.decompress()}},{"zlibjs/bin/rawdeflate.min":19,"zlibjs/bin/rawinflate.min":20}],7:[function(a,b){"use strict";functionc(a,b){returnthisinstanceofc?(this.files={},this.root="",a&&this.load(a,b),void(this.clone=function(){vara=newc;for(varbinthis)"function"!=typeofthis[b]&&(a[b]=this[b]);returna})):newc(a,b)}c.prototype=a("./object"),c.prototype.load=a("./load"),c.support=a("./support"),c.defaults=a("./defaults"),c.utils=a("./utils"),c.base64=a("./base64"),c.compressions=a("./compressions"),b.exports=c},{"./base64":1,"./compressions":3,"./defaults":5,"./load":8,"./object":9,"./support":12,"./utils":14}],8:[function(a,b){"use strict";varc=a("./base64"),d=a("./zipEntries");b.exports=function(a,b){vare,f,g,h;for(b=b||{},b.base64&&(a=c.decode(a)),f=newd(a,b),e=f.files,g=0;g<e.length;g++)h=e[g],this.file(h.fileName,h.decompressed,{binary:!0,optimizedBinaryString:!0,date:h.date,dir:h.dir});returnthis}},{"./base64":1,"./zipEntries":15}],9:[function(a,b){"use strict";varc,d,e=a("./support"),f=a("./utils"),g=a("./signature"),h=a("./defaults"),i=a("./base64"),j=a("./compressions"),k=a("./compressedObject"),l=a("./nodeBuffer");e.uint8array&&"function"==typeofTextEncoder&&"function"==typeofTextDecoder&&(c=newTextEncoder("utf-8"),d=newTextDecoder("utf-8"));varm=function(a){if(a._datainstanceofk&&(a._data=a._data.getContent(),a.options.binary=!0,a.options.base64=!1,"uint8array"===f.getTypeOf(a._data))){varb=a._data;a._data=newUint8Array(b.length),0!==b.length&&a._data.set(b,0)}returna._data},n=function(a){varb=m(a),d=f.getTypeOf(b);if("string"===d){if(!a.options.binary){if(c)returnc.encode(b);if(e.nodebuffer)returnl(b,"utf-8")}returna.asBinary()}returnb},o=function(a){varb=m(this);returnnull===b||"undefined"==typeofb?"":(this.options.base64&&(b=i.decode(b)),b=a&&this.options.binary?A.utf8decode(b):f.transformTo("string",b),a||this.options.binary||(b=A.utf8encode(b)),b)},p=function(a,b,c){this.name=a,this._data=b,this.options=c};p.prototype={asText:function(){returno.call(this,!0)},asBinary:function(){returno.call(this,!1)},asNodeBuffer:function(){vara=n(this);returnf.transformTo("nodebuffer",a)},asUint8Array:function(){vara=n(this);returnf.transformTo("uint8array",a)},asArrayBuffer:function(){returnthis.asUint8Array().buffer}};varq=function(a,b){varc,d="";for(c=0;b>c;c++)d+=String.fromCharCode(255&a),a>>>=8;returnd},r=function(){vara,b,c={};for(a=0;a<arguments.length;a++)for(binarguments[a])arguments[a].hasOwnProperty(b)&&"undefined"==typeofc[b]&&(c[b]=arguments[a][b]);returnc},s=function(a){returna=a||{},a.base64!==!0||null!==a.binary&&void0!==a.binary||(a.binary=!0),a=r(a,h),a.date=a.date||newDate,null!==a.compression&&(a.compression=a.compression.toUpperCase()),a},t=function(a,b,c){vard=u(a),e=f.getTypeOf(b);if(d&&v.call(this,d),c=s(c),c.dir||null===b||"undefined"==typeofb)c.base64=!1,c.binary=!1,b=null;elseif("string"===e)c.binary&&!c.base64&&c.optimizedBinaryString!==!0&&(b=f.string2binary(b));else{if(c.base64=!1,c.binary=!0,!(e||binstanceofk))thrownewError("The data of '"+a+"' is in an unsupported format !");"arraybuffer"===e&&(b=f.transformTo("uint8array",b))}varg=newp(a,b,c);returnthis.files[a]=g,g},u=function(a){"/"==a.slice(-1)&&(a=a.substring(0,a.length-1));varb=a.lastIndexOf("/");returnb>0?a.substring(0,b):""},v=function(a){return"/"!=a.slice(-1)&&(a+="/"),this.files[a]||t.call(this,a,null,{dir:!0}),this.files[a]},w=function(a,b){varc,d=newk;returna._datainstanceofk?(d.uncompressedSize=a._data.uncompressedSize,d.crc32=a._data.crc32,0===d.uncompressedSize||a.options.dir?(b=j.STORE,d.compressedContent="",d.crc32=0):a._data.compressionMethod===b.magic?d.compressedContent=a._data.getCompressedContent():(c=a._data.getContent(),d.compressedContent=b.compress(f.transformTo(b.compressInputType,c)))):(c=n(a),(!c||0===c.length||a.options.dir)&&(b=j.STORE,c=""),d.uncompressedSize=c.length,d.crc32=this.crc32(c),d.compressedContent=b.compress(f.transformTo(b.compressInputType,c))),d.compressedSize=d.compressedContent.length,d.compressionMethod=b.magic,d},x=function(a,b,c,d){vare,f,h=(c.compressedContent,this.utf8encode(b.name)),i=h!==b.name,j=b.options,k="",l="";e=j.date.getHours(),e<<=6,e|=j.date.getMinutes(),e<<=5,e|=j.date.getSeconds()/2,f=j.date.getFullYear()-1980,f<<=4,f|=j.date.getMonth()+1,f<<=5,f|=j.date.getDate(),i&&(l=q(1,1)+q(this.crc32(h),4)+h,k+="up"+q(l.length,2)+l);varm="";m+="\n\x00",m+=i?"\x00\b":"\x00\x00",m+=c.compressionMethod,m+=q(e,2),m+=q(f,2),m+=q(c.crc32,4),m+=q(c.compressedSize,4),m+=q(c.uncompressedSize,4),m+=q(h.length,2),m+=q(k.length,2);varn=g.LOCAL_FILE_HEADER+m+h+k,o=g.CENTRAL_FILE_HEADER+"\x00"+m+"\x00\x00\x00\x00\x00\x00"+(b.options.dir===!0?"\x00\x00\x00":"\x00\x00\x00\x00")+q(d,4)+h+k;return{fileRecord:n,dirRecord:o,compressedObject:c}},y=function(){this.data=[]};y.prototype={append:function(a){a=f.transformTo("string",a),this.data.push(a)},finalize:function(){returnthis.data.join("")}};varz=function(a){this.data=newUint8Array(a),this.index=0};z.prototype={append:function(a){0!==a.length&&(a=f.transformTo("uint8array",a),this.data.set(a,this.index),this.index+=a.length)},finalize:function(){returnthis.data}};varA={load:function(){thrownewError("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(a){varb,c,d,e,f=[];for(binthis.files)this.files.hasOwnProperty(b)&&(d=this.files[b],e=newp(d.name,d._data,r(d.options)),c=b.slice(this.root.length,b.length),b.slice(0,this.root.length)===this.root&&a(c,e)&&f.push(e));returnf},file:function(a,b,c){if(1===arguments.length){if(f.isRegExp(a)){vard=a;returnthis.filter(function(a,b){return!b.options.dir&&d.test(a)})}returnthis.filter(function(b,c){return!c.options.dir&&b===a})[0]||null}returna=this.root+a,t.call(this,a,b,c),this},folder:function(a){if(!a)returnthis;if(f.isRegExp(a))returnthis.filter(function(b,c){returnc.options.dir&&a.test(b)});varb=this.root+a,c=v.call(this,b),d=this.clone();returnd.root=c.name,d},remove:function(a){a=this.root+a;varb=this.files[a];if(b||("/"!=a.slice(-1)&&(a+="/"),b=this.files[a]),b)if(b.options.dir)for(varc=this.filter(function(b,c){returnc.name.slice(0,a.length)===a}),d=0;d<c.length;d++)deletethis.files[c[d].name];elsedeletethis.files[a];returnthis},generate:function(a){a=r(a||{},{base64:!0,compression:"STORE",type:"base64"}),f.checkSupport(a.type);varb,c,d=[],e=0,h=0;for(varkinthis.files)if(this.files.hasOwnProperty(k)){varl=this.files[k],m=l.options.compression||a.compression.toUpperCase(),n=j[m];if(!n)thrownewError(m+" is not a valid compression method !");varo=w.call(this,l,n),p=x.call(this,k,l,o,e);e+=p.fileRecord.length+o.compressedSize,h+=p.dirRecord.length,d.push(p)}vars="";s=g.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+q(d.length,2)+q(d.length,2)+q(h,4)+q(e,4)+"\x00\x00";vart=a.type.toLowerCase();for(b="uint8array"===t||"arraybuffer"===t||"blob"===t||"nodebuffer"===t?newz(e+h+s.length):newy(e+h+s.length),c=0;c<d.length;c++)b.append(d[c].fileRecord),b.append(d[c].compressedObject.compressedContent);for(c=0;c<d.length;c++)b.append(d[c].dirRecord);b.append(s);varu=b.finalize();switch(a.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":returnf.transformTo(a.type.toLowerCase(),u);case"blob":returnf.arrayBuffer2Blob(f.transformTo("arraybuffer",u));case"base64":returna.base64?i.encode(u):u;default:returnu}},crc32:function(a,b){if("undefined"==typeofa||!a.length)return0;varc="string"!==f.getTypeOf(a),d=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"==typeofb&&(b=0);vare=0,g=0,h=0;b=-1^b;for(vari=0,j=a.length;j>i;i++)h=c?a[i]:a.charCodeAt(i),g=255&(b^h),e=d[g],b=b>>>8^e;return-1^b},utf8encode:function(a){if(c){varb=c.encode(a);returnf.transformTo("string",b)}if(e.nodebuffer)returnf.transformTo("string",l(a,"utf-8"));for(vard=[],g=0,h=0;h<a.length;h++){vari=a.charCodeAt(h);128>i?d[g++]=String.fromCharCode(i):i>127&&2048>i?(d[g++]=String.fromCharCode(i>>6|192),d[g++]=String.fromCharCode(63&i|128)):(d[g++]=String.fromCharCode(i>>12|224),d[g++]=String.fromCharCode(i>>6&63|128),d[g++]=String.fromCharCode(63&i|128))}returnd.join("")},utf8decode:function(a){varb=[],c=0,g=f.getTypeOf(a),h="string"!==g,i=0,j=0,k=0,l=0;if(d)returnd.decode(f.transformTo("uint8array",a));if(e.nodebuffer)returnf.transformTo("nodebuffer",a).toString("utf-8");for(;i<a.length;)j=h?a[i]:a.charCodeAt(i),128>j?(b[c++]=String.fromCharCode(j),i++):j>191&&224>j?(k=h?a[i+1]:a.charCodeAt(i+1),b[c++]=String.fromCharCode((31&j)<<6|63&k),i+=2):(k=h?a[i+1]:a.charCodeAt(i+1),l=h?a[i+2]:a.charCodeAt(i+2),b[c++]=String.fromCharCode((15&j)<<12|(63&k)<<6|63&l),i+=3);returnb.join("")}};b.exports=A},{"./base64":1,"./compressedObject":2,"./compressions":3,"./defaults":5,"./nodeBuffer":17,"./signature":10,"./support":12,"./utils":14}],10:[function(a,b,c){"use strict";c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\b"},{}],11:[function(a,b){"use strict";functionc(a,b){this.data=a,b||(this.data=e.string2binary(this.data)),this.length=this.data.length,this.index=0}vard=a("./dataReader"),e=a("./utils");c.prototype=newd,c.prototype.byteAt=function(a){returnthis.data.charCodeAt(a)},c.prototype.lastIndexOfSignature=function(a){returnthis.data.lastIndexOf(a)},c.prototype.readData=function(a){this.checkOffset(a);varb=this.data.slice(this.index,this.index+a);returnthis.index+=a,b},b.exports=c},{"./dataReader":4,"./utils":14}],12:[function(a,b,c){vard=a("__browserify_process");if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer="undefined"!=typeofArrayBuffer&&"undefined"!=typeofUint8Array,c.nodebuffer=!d.browser,c.uint8array="undefined"!=typeofUint8Array,"undefined"==typeofArrayBuffer)c.blob=!1;else{vare=newArrayBuffer(0);try{c.blob=0===newBlob([e],{type:"application/zip"}).size}catch(f){try{varg=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,h=newg;h.append(e),c.blob=0===h.getBlob("application/zip").size}catch(f){c.blob=!1}}}},{__browserify_process:18}],13:[function(a,b){"use strict";functionc(a){a&&(this.data=a,this.length=this.data.length,this.index=0)}vard=a("./dataReader");c.prototype=newd,c.prototype.byteAt=function(a){returnthis.data[a]},c.prototype.lastIndexOfSignature=function(a){for(varb=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),e=a.charCodeAt(3),f=this.length-4;f>=0;--f)if(this.data[f]===b&&this.data[f+1]===c&&this.data[f+2]===d&&this.data[f+3]===e)returnf;return-1},c.prototype.readData=function(a){this.checkOffset(a);varb=this.data.subarray(this.index,this.index+a);returnthis.index+=a,b},b.exports=c},{"./dataReader":4}],14:[function(a,b,c){"use strict";functiond(a){returna}functione(a,b){for(varc=0;c<a.length;++c)b[c]=255&a.charCodeAt(c);returnb}functionf(a){varb=65536,d=[],e=a.length,f=c.getTypeOf(a),g=0,h=!0;try{switch(f){case"uint8array":String.fromCharCode.apply(null,newUint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,j(0))}}catch(i){h=!1}if(!h){for(vark="",l=0;l<a.length;l++)k+=String.fromCharCode(a[l]);returnk}for(;e>g&&b>1;)try{d.push("array"===f||"nodebuffer"===f?String.fromCharCode.apply(null,a.slice(g,Math.min(g+b,e))):String.fromCharCode.apply(null,a.subarray(g,Math.min(g+b,e)))),g+=b}catch(i){b=Math.floor(b/2)}returnd.join("")}functiong(a,b){for(varc=0;c<a.length;c++)b[c]=a[c];returnb}varh=a("./support"),i=a("./compressions"),j=a("./nodeBuffer");c.string2binary=function(a){for(varb="",c=0;c<a.length;c++)b+=String.fromCharCode(255&a.charCodeAt(c));returnb},c.string2Uint8Array=function(a){returnc.transformTo("uint8array",a)},c.uint8Array2String=function(a){returnc.transformTo("string",a)},c.string2Blob=function(a){varb=c.transformTo("arraybuffer",a);returnc.arrayBuffer2Blob(b)},c.arrayBuffer2Blob=function(a){c.checkSupport("blob");try{returnnewBlob([a],{type:"application/zip"})}catch(b){try{vard=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,e=newd;returne.append(a),e.getBlob("application/zip")}catch(b){thrownewError("Bug : can't construct the Blob.")}}};vark={};k.string={string:d,array:function(a){returne(a,newArray(a.length))},arraybuffer:function(a){returnk.string.uint8array(a).buffer},uint8array:function(a){returne(a,newUint8Array(a.length))},nodebuffer:function(a){returne(a,j(a.length))}},k.array={string:f,array:d,arraybuffer:function(a){returnnewUint8Array(a).buffer},uint8array:function(a){returnnewUint8Array(a)},nodebuffer:function(a){returnj(a)}},k.arraybuffer={string:function(a){returnf(newUint8Array(a))},array:function(a){returng(newUint8Array(a),newArray(a.byteLength))},arraybuffer:d,uint8array:function(a){returnnewUint8Array(a)},nodebuffer:function(a){returnj(newUint8Array(a))}},k.uint8array={string:f,array:function(a){returng(a,newArray(a.length))},arraybuffer:function(a){returna.buffer},uint8array:d,nodebuffer:function(a){returnj(a)}},k.nodebuffer={string:f,array:function(a){returng(a,newArray(a.length))},arraybuffer:function(a){returnk.nodebuffer.uint8array(a).buffer},uint8array:function(a){returng(a,newUint8Array(a.length))},nodebuffer:d},c.transformTo=function(a,b){if(b||(b=""),!a)returnb;c.checkSupport(a);vard=c.getTypeOf(b),e=k[d][a](b);returne},c.getTypeOf=function(a){return"string"==typeofa?"string":"[object Array]"===Object.prototype.toString.call(a)?"array":h.nodebuffer&&j.test(a)?"nodebuffer":h.uint8array&&ainstanceofUint8Array?"uint8array":h.arraybuffer&&ainstanceofArrayBuffer?"arraybuffer":void0},c.checkSupport=function(a){varb=h[a.toLowerCase()];if(!b)thrownewError(a+" is not supported by this browser")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(a){varb,c,d="";for(c=0;c<(a||"").length;c++)b=a.charCodeAt(c),d+="\\x"+(16>b?"0":"")+b.toString(16).toUpperCase();returnd},c.findCompression=function(a){for(varbini)if(i.hasOwnProperty(b)&&i[b].magic===a)returni[b];returnnull},c.isRegExp=function(a){return"[object RegExp]"===Object.prototype.toString.call(a)}},{"./compressions":3,"./nodeBuffer":17,"./support":12}],15:[function(a,b){"use strict";functionc(a,b){this.files=[],this.loadOptions=b,a&&this.load(a)}vard=a("./stringReader"),e=a("./nodeBufferReader"),f=a("./uint8ArrayReader"),g=a("./utils"),h=a("./signature"),i=a("./zipEntry"),j=a("./support");c.prototype={checkSignature:function(a){varb=this.reader.readString(4);if(b!==a)thrownewError("Corrupted zip or bug : unexpected signature ("+g.pretty(b)+", expected "+g.pretty(a)+")")},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),this.zipComment=this.reader.readString(this.zipCommentLength)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),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(vara,b,c,d=this.zip64EndOfCentralSize-44,e=0;d>e;)a=this.reader.readInt(2),b=this.reader.readInt(4),c=this.reader.readString(b),this.zip64ExtensibleData[a]={id:a,length:b,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)thrownewError("Multi-volumes zip are not supported")},readLocalFiles:function(){vara,b;for(a=0;a<this.files.length;a++)b=this.files[a],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(h.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8()},readCentralDir:function(){vara;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===h.CENTRAL_FILE_HEADER;)a=newi({zip64:this.zip64},this.loadOptions),a.readCentralPart(this.reader),this.files.push(a)},readEndOfCentral:function(){vara=this.reader.lastIndexOfSignature(h.CENTRAL_DIRECTORY_END);if(-1===a)thrownewError("Corrupted zip : can't find end of central directory");if(this.reader.setIndex(a),this.checkSignature(h.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===g.MAX_VALUE_16BITS||this.diskWithCentralDirStart===g.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===g.MAX_VALUE_16BITS||this.centralDirRecords===g.MAX_VALUE_16BITS||this.centralDirSize===g.MAX_VALUE_32BITS||this.centralDirOffset===g.MAX_VALUE_32BITS){if(this.zip64=!0,a=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),-1===a)thrownewError("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(a),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(a){varb=g.getTypeOf(a);this.reader="string"!==b||j.uint8array?"nodebuffer"===b?newe(a):newf(g.transformTo("uint8array",a)):newd(a,this.loadOptions.optimizedBinaryString)},load:function(a){this.prepareReader(a),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},b.exports=c},{"./nodeBufferReader":17,"./signature":10,"./stringReader":11,"./support":12,"./uint8ArrayReader":13,"./utils":14,"./zipEntry":16}],16:[function(a,b){"use strict";functionc(a,b){this.options=a,this.loadOptions=b}vard=a("./stringReader"),e=a("./utils"),f=a("./compressedObject"),g=a("./object");c.prototype={isEncrypted:function(){return1===(1&this.bitFlag)},useUTF8:function(){return2048===(2048&this.bitFlag)},prepareCompressedContent:function(a,b,c){returnfunction(){vard=a.index;a.setIndex(b);vare=a.readData(c);returna.setIndex(d),e}},prepareContent:function(a,b,c,d,f){returnfunction(){vara=e.transformTo(d.uncompressInputType,this.getCompressedContent()),b=d.uncompress(a);if(b.length!==f)thrownewError("Bug : uncompressed data size mismatch");returnb}},readLocalPart:function(a){varb,c;if(a.skip(22),this.fileNameLength=a.readInt(2),c=a.readInt(2),this.fileName=a.readString(this.fileNameLength),a.skip(c),-1==this.compressedSize||-1==this.uncompressedSize)thrownewError("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(b=e.findCompression(this.compressionMethod),null===b)thrownewError("Corrupted zip : compression "+e.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=newf,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(a,a.index,this.compressedSize,b),this.decompressed.getContent=this.prepareContent(a,a.index,this.compressedSize,b,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=e.transformTo("string",this.decompressed.getContent()),g.crc32(this.decompressed)!==this.crc32))thrownewError("Corrupted zip : CRC32 mismatch")},readCentralPart:function(a){if(this.versionMadeBy=a.readString(2),this.versionNeeded=a.readInt(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4),this.fileNameLength=a.readInt(2),this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())thrownewError("Encrypted zip are not supported");this.fileName=a.readString(this.fileNameLength),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readString(this.fileCommentLength),this.dir=16&this.externalFileAttributes?!0:!1},parseZIP64ExtraField:function(){if(this.extraFields[1]){vara=newd(this.extraFields[1].value);this.uncompressedSize===e.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===e.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===e.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===e.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){varb,c,d,e=a.index;for(this.extraFields=this.extraFields||{};a.index<e+this.extraFieldsLength;)b=a.readInt(2),c=a.readInt(2),d=a.readString(c),this.extraFields[b]={id:b,length:c,value:d}},handleUTF8:function(){if(this.useUTF8())this.fileName=g.utf8decode(this.fileName),this.fileComment=g.utf8decode(this.fileComment);else{vara=this.findExtraFieldUnicodePath();null!==a&&(this.fileName=a)}},findExtraFieldUnicodePath:function(){vara=this.extraFields[28789];if(a){varb=newd(a.value);return1!==b.readInt(1)?null:g.crc32(this.fileName)!==b.readInt(4)?null:g.utf8decode(b.readString(a.length-5))}returnnull}},b.exports=c},{"./compressedObject":2,"./object":9,"./stringReader":11,"./utils":14}],17:[function(){},{}],18:[function(a,b){varc=b.exports={};c.nextTick=function(){vara="undefined"!=typeofwindow&&window.setImmediate,b="undefined"!=typeofwindow&&window.postMessage&&window.addEventListener;if(a)returnfunction(a){returnwindow.setImmediate(a)};if(b){varc=[];returnwindow.addEventListener("message",function(a){varb=a.source;if((b===window||null===b)&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){vard=c.shift();d()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}returnfunction(a){setTimeout(a,0)}}(),c.title="browser",c.browser=!0,c.env={},c.argv=[],c.binding=function(){thrownewError("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(){thrownewError("process.chdir is not supported")}},{}],19:[function(){/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */