UNPKG

tinymce-plugin

Version:
7 lines 194 kB
/*! * @plugin @tinymce-plugin/tp-importword * @version 0.0.3-beta.6 (2022-7-29) * @description 导入word文档 * @copyright (2022) Li Hailong . All rights reserved. https://github.com/tinymce-plugin/tp-importword */(function(){"use strict";var Ue=function(i,r){return Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])},Ue(i,r)};function be(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");Ue(i,r);function e(){this.constructor=i}i.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var me=function(){return me=Object.assign||function(r){for(var e,n=1,a=arguments.length;n<a;n++){e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},me.apply(this,arguments)};function Pr(i,r,e){if(e||arguments.length===2)for(var n=0,a=r.length,t;n<a;n++)(t||!(n in r))&&(t||(t=Array.prototype.slice.call(r,0,n)),t[n]=r[n]);return i.concat(t||Array.prototype.slice.call(r))}var de;(function(i){i.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",i.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",i.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",i.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",i.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",i.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",i.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",i.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",i.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",i.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",i.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",i.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",i.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",i.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",i.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",i.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",i.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties"})(de||(de={}));function Sr(i,r){return r.elements(i).map(function(e){return{id:r.attr(e,"Id"),type:r.attr(e,"Type"),target:r.attr(e,"Target"),targetMode:r.attr(e,"TargetMode")}})}var Je={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",drawingml:"http://schemas.openxmlformats.org/drawingml/2006/main",picture:"http://schemas.openxmlformats.org/drawingml/2006/picture",compatibility:"http://schemas.openxmlformats.org/markup-compatibility/2006"},he={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt"},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:null}};function $e(i,r){var e;return r===void 0&&(r=he.Dxa),i==null||/.+(p[xt]|[%])$/.test(i)?i:"".concat((parseInt(i)*r.mul).toFixed(2)).concat((e=r.unit)!==null&&e!==void 0?e:"")}function Or(i,r){switch(r===void 0&&(r=!1),i){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return r}}function Qe(i,r,e){if(i.namespaceURI!=Je.wordml)return!1;switch(i.localName){case"color":r.color=e.attr(i,"val");break;case"sz":r.fontSize=e.lengthAttr(i,"val",he.FontSize);break;default:return!1}return!0}function Cr(i,r){r===void 0&&(r=!1),r&&(i=i.replace(/<[?].*[?]>/,""));var e=new DOMParser().parseFromString(i,"application/xml"),n=Ar(e);if(n)throw new Error(n);return e}function Ar(i){var r;return(r=i.getElementsByTagName("parsererror")[0])===null||r===void 0?void 0:r.textContent}function Er(i){return new XMLSerializer().serializeToString(i)}var er=function(){function i(){}return Object.defineProperty(i.prototype,"elements",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e){e===void 0&&(e=null);for(var n=[],a=0,t=r.childNodes.length;a<t;a++){var o=r.childNodes.item(a);o.nodeType==1&&(e==null||o.localName==e)&&n.push(o)}return n}}),Object.defineProperty(i.prototype,"element",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e){for(var n=0,a=r.childNodes.length;n<a;n++){var t=r.childNodes.item(n);if(t.nodeType==1&&t.localName==e)return t}return null}}),Object.defineProperty(i.prototype,"elementAttr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e,n){var a=this.element(r,e);return a?this.attr(a,n):void 0}}),Object.defineProperty(i.prototype,"attr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e){for(var n=0,a=r.attributes.length;n<a;n++){var t=r.attributes.item(n);if(t.localName==e)return t.value}return null}}),Object.defineProperty(i.prototype,"intAttr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e,n){n===void 0&&(n=null);var a=this.attr(r,e);return a?parseInt(a):n}}),Object.defineProperty(i.prototype,"hexAttr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e,n){n===void 0&&(n=null);var a=this.attr(r,e);return a?parseInt(a,16):n}}),Object.defineProperty(i.prototype,"floatAttr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e,n){n===void 0&&(n=null);var a=this.attr(r,e);return a?parseFloat(a):n}}),Object.defineProperty(i.prototype,"boolAttr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e,n){return n===void 0&&(n=null),Or(this.attr(r,e),n)}}),Object.defineProperty(i.prototype,"lengthAttr",{enumerable:!1,configurable:!0,writable:!0,value:function(r,e,n){return n===void 0&&(n=he.Dxa),$e(this.attr(r,e),n)}}),i}(),B=new er,ye=function(){function i(r,e){Object.defineProperty(this,"_package",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"path",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_xmlDocument",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rels",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(i.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(){var r=this;return Promise.all([this._package.loadRelationships(this.path).then(function(e){r.rels=e}),this._package.load(this.path).then(function(e){var n=r._package.parseXmlDocument(e);r._package.options.keepOrigin&&(r._xmlDocument=n),r.parseXml(n.firstElementChild)})])}}),Object.defineProperty(i.prototype,"save",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._package.update(this.path,Er(this._xmlDocument))}}),Object.defineProperty(i.prototype,"parseXml",{enumerable:!1,configurable:!0,writable:!0,value:function(r){}}),i}(),xr={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function jr(i,r){return r.elements(i).map(function(e){return Nr(e,r)})}function Nr(i,r){for(var e={name:r.attr(i,"name"),embedFontRefs:[]},n=0,a=r.elements(i);n<a.length;n++){var t=a[n];switch(t.localName){case"family":e.family=r.attr(t,"val");break;case"altName":e.altName=r.attr(t,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":e.embedFontRefs.push(Br(t,r));break}}return e}function Br(i,r){return{id:r.attr(i,"id"),key:r.attr(i,"fontKey"),type:xr[i.localName]}}var zr=function(i){be(r,i);function r(){var e=i!==null&&i.apply(this,arguments)||this;return Object.defineProperty(e,"fonts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e}return Object.defineProperty(r.prototype,"parseXml",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.fonts=jr(e,this._package.xmlParser)}}),r}(ye),rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Be(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tr={exports:{}};(function(i,r){(function(e){i.exports=e()})(function(){return function e(n,a,t){function o(f,p){if(!a[f]){if(!n[f]){var b=typeof Be=="function"&&Be;if(!p&&b)return b(f,!0);if(u)return u(f,!0);var w=new Error("Cannot find module '"+f+"'");throw w.code="MODULE_NOT_FOUND",w}var h=a[f]={exports:{}};n[f][0].call(h.exports,function(v){var k=n[f][1][v];return o(k||v)},h,h.exports,e,n,a,t)}return a[f].exports}for(var u=typeof Be=="function"&&Be,l=0;l<t.length;l++)o(t[l]);return o}({1:[function(e,n,a){var t=e("./utils"),o=e("./support"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.encode=function(l){for(var f,p,b,w,h,v,k,d=[],m=0,y=l.length,S=y,x=t.getTypeOf(l)!=="string";m<l.length;)S=y-m,b=x?(f=l[m++],p=m<y?l[m++]:0,m<y?l[m++]:0):(f=l.charCodeAt(m++),p=m<y?l.charCodeAt(m++):0,m<y?l.charCodeAt(m++):0),w=f>>2,h=(3&f)<<4|p>>4,v=1<S?(15&p)<<2|b>>6:64,k=2<S?63&b:64,d.push(u.charAt(w)+u.charAt(h)+u.charAt(v)+u.charAt(k));return d.join("")},a.decode=function(l){var f,p,b,w,h,v,k=0,d=0,m="data:";if(l.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");var y,S=3*(l=l.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(l.charAt(l.length-1)===u.charAt(64)&&S--,l.charAt(l.length-2)===u.charAt(64)&&S--,S%1!=0)throw new Error("Invalid base64 input, bad content length.");for(y=o.uint8array?new Uint8Array(0|S):new Array(0|S);k<l.length;)f=u.indexOf(l.charAt(k++))<<2|(w=u.indexOf(l.charAt(k++)))>>4,p=(15&w)<<4|(h=u.indexOf(l.charAt(k++)))>>2,b=(3&h)<<6|(v=u.indexOf(l.charAt(k++))),y[d++]=f,h!==64&&(y[d++]=p),v!==64&&(y[d++]=b);return y}},{"./support":30,"./utils":32}],2:[function(e,n,a){var t=e("./external"),o=e("./stream/DataWorker"),u=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function f(p,b,w,h,v){this.compressedSize=p,this.uncompressedSize=b,this.crc32=w,this.compression=h,this.compressedContent=v}f.prototype={getContentWorker:function(){var p=new o(t.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),b=this;return p.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),p},getCompressedWorker:function(){return new o(t.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(p,b,w){return p.pipe(new u).pipe(new l("uncompressedSize")).pipe(b.compressWorker(w)).pipe(new l("compressedSize")).withStreamInfo("compression",b)},n.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,n,a){var t=e("./stream/GenericWorker");a.STORE={magic:"\0\0",compressWorker:function(o){return new t("STORE compression")},uncompressWorker:function(){return new t("STORE decompression")}},a.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,n,a){var t=e("./utils"),o=function(){for(var u,l=[],f=0;f<256;f++){u=f;for(var p=0;p<8;p++)u=1&u?3988292384^u>>>1:u>>>1;l[f]=u}return l}();n.exports=function(u,l){return u!==void 0&&u.length?t.getTypeOf(u)!=="string"?function(f,p,b,w){var h=o,v=w+b;f^=-1;for(var k=w;k<v;k++)f=f>>>8^h[255&(f^p[k])];return-1^f}(0|l,u,u.length,0):function(f,p,b,w){var h=o,v=w+b;f^=-1;for(var k=w;k<v;k++)f=f>>>8^h[255&(f^p.charCodeAt(k))];return-1^f}(0|l,u,u.length,0):0}},{"./utils":32}],5:[function(e,n,a){a.base64=!1,a.binary=!1,a.dir=!1,a.createFolders=!0,a.date=null,a.compression=null,a.compressionOptions=null,a.comment=null,a.unixPermissions=null,a.dosPermissions=null},{}],6:[function(e,n,a){var t=null;t=typeof Promise<"u"?Promise:e("lie"),n.exports={Promise:t}},{lie:37}],7:[function(e,n,a){var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=e("pako"),u=e("./utils"),l=e("./stream/GenericWorker"),f=t?"uint8array":"array";function p(b,w){l.call(this,"FlateWorker/"+b),this._pako=null,this._pakoAction=b,this._pakoOptions=w,this.meta={}}a.magic="\b\0",u.inherits(p,l),p.prototype.processChunk=function(b){this.meta=b.meta,this._pako===null&&this._createPako(),this._pako.push(u.transformTo(f,b.data),!1)},p.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},p.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},p.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var b=this;this._pako.onData=function(w){b.push({data:w,meta:b.meta})}},a.compressWorker=function(b){return new p("Deflate",b)},a.uncompressWorker=function(){return new p("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,n,a){function t(h,v){var k,d="";for(k=0;k<v;k++)d+=String.fromCharCode(255&h),h>>>=8;return d}function o(h,v,k,d,m,y){var S,x,C=h.file,D=h.compression,F=y!==f.utf8encode,U=u.transformTo("string",y(C.name)),N=u.transformTo("string",f.utf8encode(C.name)),G=C.comment,Q=u.transformTo("string",y(G)),P=u.transformTo("string",f.utf8encode(G)),T=N.length!==C.name.length,c=P.length!==G.length,R="",re="",W="",te=C.dir,H=C.date,ee={crc32:0,compressedSize:0,uncompressedSize:0};v&&!k||(ee.crc32=h.crc32,ee.compressedSize=h.compressedSize,ee.uncompressedSize=h.uncompressedSize);var j=0;v&&(j|=8),F||!T&&!c||(j|=2048);var E=0,$=0;te&&(E|=16),m==="UNIX"?($=798,E|=function(V,ue){var ve=V;return V||(ve=ue?16893:33204),(65535&ve)<<16}(C.unixPermissions,te)):($=20,E|=function(V){return 63&(V||0)}(C.dosPermissions)),S=H.getUTCHours(),S<<=6,S|=H.getUTCMinutes(),S<<=5,S|=H.getUTCSeconds()/2,x=H.getUTCFullYear()-1980,x<<=4,x|=H.getUTCMonth()+1,x<<=5,x|=H.getUTCDate(),T&&(re=t(1,1)+t(p(U),4)+N,R+="up"+t(re.length,2)+re),c&&(W=t(1,1)+t(p(Q),4)+P,R+="uc"+t(W.length,2)+W);var K="";return K+=` \0`,K+=t(j,2),K+=D.magic,K+=t(S,2),K+=t(x,2),K+=t(ee.crc32,4),K+=t(ee.compressedSize,4),K+=t(ee.uncompressedSize,4),K+=t(U.length,2),K+=t(R.length,2),{fileRecord:b.LOCAL_FILE_HEADER+K+U+R,dirRecord:b.CENTRAL_FILE_HEADER+t($,2)+K+t(Q.length,2)+"\0\0\0\0"+t(E,4)+t(d,4)+U+R+Q}}var u=e("../utils"),l=e("../stream/GenericWorker"),f=e("../utf8"),p=e("../crc32"),b=e("../signature");function w(h,v,k,d){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=v,this.zipPlatform=k,this.encodeFileName=d,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}u.inherits(w,l),w.prototype.push=function(h){var v=h.meta.percent||0,k=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:k?(v+100*(k-d-1))/k:100}}))},w.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var v=this.streamFiles&&!h.file.dir;if(v){var k=o(h,v,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:k.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(h){this.accumulate=!1;var v=this.streamFiles&&!h.file.dir,k=o(h,v,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(k.dirRecord),v)this.push({data:function(d){return b.DATA_DESCRIPTOR+t(d.crc32,4)+t(d.compressedSize,4)+t(d.uncompressedSize,4)}(h),meta:{percent:100}});else for(this.push({data:k.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var h=this.bytesWritten,v=0;v<this.dirRecords.length;v++)this.push({data:this.dirRecords[v],meta:{percent:100}});var k=this.bytesWritten-h,d=function(m,y,S,x,C){var D=u.transformTo("string",C(x));return b.CENTRAL_DIRECTORY_END+"\0\0\0\0"+t(m,2)+t(m,2)+t(y,4)+t(S,4)+t(D.length,2)+D}(this.dirRecords.length,k,h,this.zipComment,this.encodeFileName);this.push({data:d,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(h){this._sources.push(h);var v=this;return h.on("data",function(k){v.processChunk(k)}),h.on("end",function(){v.closedSource(v.previous.streamInfo),v._sources.length?v.prepareNextSource():v.end()}),h.on("error",function(k){v.error(k)}),this},w.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(h){var v=this._sources;if(!l.prototype.error.call(this,h))return!1;for(var k=0;k<v.length;k++)try{v[k].error(h)}catch{}return!0},w.prototype.lock=function(){l.prototype.lock.call(this);for(var h=this._sources,v=0;v<h.length;v++)h[v].lock()},n.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,n,a){var t=e("../compressions"),o=e("./ZipFileWorker");a.generateWorker=function(u,l,f){var p=new o(l.streamFiles,f,l.platform,l.encodeFileName),b=0;try{u.forEach(function(w,h){b++;var v=function(y,S){var x=y||S,C=t[x];if(!C)throw new Error(x+" is not a valid compression method !");return C}(h.options.compression,l.compression),k=h.options.compressionOptions||l.compressionOptions||{},d=h.dir,m=h.date;h._compressWorker(v,k).withStreamInfo("file",{name:w,dir:d,date:m,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(p)}),p.entriesCount=b}catch(w){p.error(w)}return p}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,n,a){function t(){if(!(this instanceof t))return new t;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new t;for(var u in this)typeof this[u]!="function"&&(o[u]=this[u]);return o}}(t.prototype=e("./object")).loadAsync=e("./load"),t.support=e("./support"),t.defaults=e("./defaults"),t.version="3.9.1",t.loadAsync=function(o,u){return new t().loadAsync(o,u)},t.external=e("./external"),n.exports=t},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,n,a){var t=e("./utils"),o=e("./external"),u=e("./utf8"),l=e("./zipEntries"),f=e("./stream/Crc32Probe"),p=e("./nodejsUtils");function b(w){return new o.Promise(function(h,v){var k=w.decompressed.getContentWorker().pipe(new f);k.on("error",function(d){v(d)}).on("end",function(){k.streamInfo.crc32!==w.decompressed.crc32?v(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}n.exports=function(w,h){var v=this;return h=t.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:u.utf8decode}),p.isNode&&p.isStream(w)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):t.prepareContent("the loaded zip file",w,!0,h.optimizedBinaryString,h.base64).then(function(k){var d=new l(h);return d.load(k),d}).then(function(k){var d=[o.Promise.resolve(k)],m=k.files;if(h.checkCRC32)for(var y=0;y<m.length;y++)d.push(b(m[y]));return o.Promise.all(d)}).then(function(k){for(var d=k.shift(),m=d.files,y=0;y<m.length;y++){var S=m[y],x=S.fileNameStr,C=t.resolve(S.fileNameStr);v.file(C,S.decompressed,{binary:!0,optimizedBinaryString:!0,date:S.date,dir:S.dir,comment:S.fileCommentStr.length?S.fileCommentStr:null,unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions,createFolders:h.createFolders}),S.dir||(v.file(C).unsafeOriginalName=x)}return d.zipComment.length&&(v.comment=d.zipComment),v})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,n,a){var t=e("../utils"),o=e("../stream/GenericWorker");function u(l,f){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(f)}t.inherits(u,o),u.prototype._bindStream=function(l){var f=this;(this._stream=l).pause(),l.on("data",function(p){f.push({data:p,meta:{percent:0}})}).on("error",function(p){f.isPaused?this.generatedError=p:f.error(p)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.end()})},u.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=u},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,n,a){var t=e("readable-stream").Readable;function o(u,l,f){t.call(this,l),this._helper=u;var p=this;u.on("data",function(b,w){p.push(b)||p._helper.pause(),f&&f(w)}).on("error",function(b){p.emit("error",b)}).on("end",function(){p.push(null)})}e("../utils").inherits(o,t),o.prototype._read=function(){this._helper.resume()},n.exports=o},{"../utils":32,"readable-stream":16}],14:[function(e,n,a){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(t,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,o);if(typeof t=="number")throw new Error('The "data" argument must not be a number');return new Buffer(t,o)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var o=new Buffer(t);return o.fill(0),o},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}}},{}],15:[function(e,n,a){function t(C,D,F){var U,N=u.getTypeOf(D),G=u.extend(F||{},p);G.date=G.date||new Date,G.compression!==null&&(G.compression=G.compression.toUpperCase()),typeof G.unixPermissions=="string"&&(G.unixPermissions=parseInt(G.unixPermissions,8)),G.unixPermissions&&16384&G.unixPermissions&&(G.dir=!0),G.dosPermissions&&16&G.dosPermissions&&(G.dir=!0),G.dir&&(C=m(C)),G.createFolders&&(U=d(C))&&y.call(this,U,!0);var Q=N==="string"&&G.binary===!1&&G.base64===!1;F&&F.binary!==void 0||(G.binary=!Q),(D instanceof b&&D.uncompressedSize===0||G.dir||!D||D.length===0)&&(G.base64=!1,G.binary=!0,D="",G.compression="STORE",N="string");var P=null;P=D instanceof b||D instanceof l?D:v.isNode&&v.isStream(D)?new k(C,D):u.prepareContent(C,D,G.binary,G.optimizedBinaryString,G.base64);var T=new w(C,P,G);this.files[C]=T}var o=e("./utf8"),u=e("./utils"),l=e("./stream/GenericWorker"),f=e("./stream/StreamHelper"),p=e("./defaults"),b=e("./compressedObject"),w=e("./zipObject"),h=e("./generate"),v=e("./nodejsUtils"),k=e("./nodejs/NodejsStreamInputAdapter"),d=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var D=C.lastIndexOf("/");return 0<D?C.substring(0,D):""},m=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},y=function(C,D){return D=D!==void 0?D:p.createFolders,C=m(C),this.files[C]||t.call(this,C,null,{dir:!0,createFolders:D}),this.files[C]};function S(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var D,F,U;for(D in this.files)U=this.files[D],(F=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&C(F,U)},filter:function(C){var D=[];return this.forEach(function(F,U){C(F,U)&&D.push(U)}),D},file:function(C,D,F){if(arguments.length!==1)return C=this.root+C,t.call(this,C,D,F),this;if(S(C)){var U=C;return this.filter(function(G,Q){return!Q.dir&&U.test(G)})}var N=this.files[this.root+C];return N&&!N.dir?N:null},folder:function(C){if(!C)return this;if(S(C))return this.filter(function(N,G){return G.dir&&C.test(N)});var D=this.root+C,F=y.call(this,D),U=this.clone();return U.root=F.name,U},remove:function(C){C=this.root+C;var D=this.files[C];if(D||(C.slice(-1)!=="/"&&(C+="/"),D=this.files[C]),D&&!D.dir)delete this.files[C];else for(var F=this.filter(function(N,G){return G.name.slice(0,C.length)===C}),U=0;U<F.length;U++)delete this.files[F[U].name];return this},generate:function(C){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var D,F={};try{if((F=u.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=F.type.toLowerCase(),F.compression=F.compression.toUpperCase(),F.type==="binarystring"&&(F.type="string"),!F.type)throw new Error("No output type specified.");u.checkSupport(F.type),F.platform!=="darwin"&&F.platform!=="freebsd"&&F.platform!=="linux"&&F.platform!=="sunos"||(F.platform="UNIX"),F.platform==="win32"&&(F.platform="DOS");var U=F.comment||this.comment||"";D=h.generateWorker(this,F,U)}catch(N){(D=new l("error")).error(N)}return new f(D,F.type||"string",F.mimeType)},generateAsync:function(C,D){return this.generateInternalStream(C).accumulate(D)},generateNodeStream:function(C,D){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(D)}};n.exports=x},{"./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(e,n,a){n.exports=e("stream")},{stream:void 0}],17:[function(e,n,a){var t=e("./DataReader");function o(u){t.call(this,u);for(var l=0;l<this.data.length;l++)u[l]=255&u[l]}e("../utils").inherits(o,t),o.prototype.byteAt=function(u){return this.data[this.zero+u]},o.prototype.lastIndexOfSignature=function(u){for(var l=u.charCodeAt(0),f=u.charCodeAt(1),p=u.charCodeAt(2),b=u.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===l&&this.data[w+1]===f&&this.data[w+2]===p&&this.data[w+3]===b)return w-this.zero;return-1},o.prototype.readAndCheckSignature=function(u){var l=u.charCodeAt(0),f=u.charCodeAt(1),p=u.charCodeAt(2),b=u.charCodeAt(3),w=this.readData(4);return l===w[0]&&f===w[1]&&p===w[2]&&b===w[3]},o.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},n.exports=o},{"../utils":32,"./DataReader":18}],18:[function(e,n,a){var t=e("../utils");function o(u){this.data=u,this.length=u.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(u){this.checkIndex(this.index+u)},checkIndex:function(u){if(this.length<this.zero+u||u<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+u+"). Corrupted zip ?")},setIndex:function(u){this.checkIndex(u),this.index=u},skip:function(u){this.setIndex(this.index+u)},byteAt:function(u){},readInt:function(u){var l,f=0;for(this.checkOffset(u),l=this.index+u-1;l>=this.index;l--)f=(f<<8)+this.byteAt(l);return this.index+=u,f},readString:function(u){return t.transformTo("string",this.readData(u))},readData:function(u){},lastIndexOfSignature:function(u){},readAndCheckSignature:function(u){},readDate:function(){var u=this.readInt(4);return new Date(Date.UTC(1980+(u>>25&127),(u>>21&15)-1,u>>16&31,u>>11&31,u>>5&63,(31&u)<<1))}},n.exports=o},{"../utils":32}],19:[function(e,n,a){var t=e("./Uint8ArrayReader");function o(u){t.call(this,u)}e("../utils").inherits(o,t),o.prototype.readData=function(u){this.checkOffset(u);var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,n,a){var t=e("./DataReader");function o(u){t.call(this,u)}e("../utils").inherits(o,t),o.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},o.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},o.prototype.readAndCheckSignature=function(u){return u===this.readData(4)},o.prototype.readData=function(u){this.checkOffset(u);var l=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,n,a){var t=e("./ArrayReader");function o(u){t.call(this,u)}e("../utils").inherits(o,t),o.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,n,a){var t=e("../utils"),o=e("../support"),u=e("./ArrayReader"),l=e("./StringReader"),f=e("./NodeBufferReader"),p=e("./Uint8ArrayReader");n.exports=function(b){var w=t.getTypeOf(b);return t.checkSupport(w),w!=="string"||o.uint8array?w==="nodebuffer"?new f(b):o.uint8array?new p(t.transformTo("uint8array",b)):new u(t.transformTo("array",b)):new l(b)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,n,a){a.LOCAL_FILE_HEADER="PK",a.CENTRAL_FILE_HEADER="PK",a.CENTRAL_DIRECTORY_END="PK",a.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",a.ZIP64_CENTRAL_DIRECTORY_END="PK",a.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,n,a){var t=e("./GenericWorker"),o=e("../utils");function u(l){t.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(u,t),u.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=u},{"../utils":32,"./GenericWorker":28}],25:[function(e,n,a){var t=e("./GenericWorker"),o=e("../crc32");function u(){t.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(u,t),u.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,n,a){var t=e("../utils"),o=e("./GenericWorker");function u(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}t.inherits(u,o),u.prototype.processChunk=function(l){if(l){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=u},{"../utils":32,"./GenericWorker":28}],27:[function(e,n,a){var t=e("../utils"),o=e("./GenericWorker");function u(l){o.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(p){f.dataIsReady=!0,f.data=p,f.max=p&&p.length||0,f.type=t.getTypeOf(p),f.isPaused||f._tickAndRepeat()},function(p){f.error(p)})}t.inherits(u,o),u.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,t.delay(this._tickAndRepeat,[],this)),!0)},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(t.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,f);break;case"uint8array":l=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":l=this.data.slice(this.index,f)}return this.index=f,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(e,n,a){function t(o){this.name=o||"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}t.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,u){return this._listeners[o].push(u),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,u){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,u)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var u=this;return o.on("data",function(l){u.processChunk(l)}),o.on("end",function(){u.end()}),o.on("error",function(l){u.error(l)}),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 o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,u){return this.extraStreamInfo[o]=u,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},n.exports=t},{}],29:[function(e,n,a){var t=e("../utils"),o=e("./ConvertWorker"),u=e("./GenericWorker"),l=e("../base64"),f=e("../support"),p=e("../external"),b=null;if(f.nodestream)try{b=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(v,k){return new p.Promise(function(d,m){var y=[],S=v._internalType,x=v._outputType,C=v._mimeType;v.on("data",function(D,F){y.push(D),k&&k(F)}).on("error",function(D){y=[],m(D)}).on("end",function(){try{var D=function(F,U,N){switch(F){case"blob":return t.newBlob(t.transformTo("arraybuffer",U),N);case"base64":return l.encode(U);default:return t.transformTo(F,U)}}(x,function(F,U){var N,G=0,Q=null,P=0;for(N=0;N<U.length;N++)P+=U[N].length;switch(F){case"string":return U.join("");case"array":return Array.prototype.concat.apply([],U);case"uint8array":for(Q=new Uint8Array(P),N=0;N<U.length;N++)Q.set(U[N],G),G+=U[N].length;return Q;case"nodebuffer":return Buffer.concat(U);default:throw new Error("concat : unsupported type '"+F+"'")}}(S,y),C);d(D)}catch(F){m(F)}y=[]}).resume()})}function h(v,k,d){var m=k;switch(k){case"blob":case"arraybuffer":m="uint8array";break;case"base64":m="string"}try{this._internalType=m,this._outputType=k,this._mimeType=d,t.checkSupport(m),this._worker=v.pipe(new o(m)),v.lock()}catch(y){this._worker=new u("error"),this._worker.error(y)}}h.prototype={accumulate:function(v){return w(this,v)},on:function(v,k){var d=this;return v==="data"?this._worker.on(v,function(m){k.call(d,m.data,m.meta)}):this._worker.on(v,function(){t.delay(k,arguments,d)}),this},resume:function(){return t.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(v){if(t.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new b(this,{objectMode:this._outputType!=="nodebuffer"},v)}},n.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,n,a){if(a.base64=!0,a.array=!0,a.string=!0,a.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",a.nodebuffer=typeof Buffer<"u",a.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")a.blob=!1;else{var t=new ArrayBuffer(0);try{a.blob=new Blob([t],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(t),a.blob=o.getBlob("application/zip").size===0}catch{a.blob=!1}}}try{a.nodestream=!!e("readable-stream").Readable}catch{a.nodestream=!1}},{"readable-stream":16}],31:[function(e,n,a){for(var t=e("./utils"),o=e("./support"),u=e("./nodejsUtils"),l=e("./stream/GenericWorker"),f=new Array(256),p=0;p<256;p++)f[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;f[254]=f[254]=1;function b(){l.call(this,"utf-8 decode"),this.leftOver=null}function w(){l.call(this,"utf-8 encode")}a.utf8encode=function(h){return o.nodebuffer?u.newBufferFrom(h,"utf-8"):function(v){var k,d,m,y,S,x=v.length,C=0;for(y=0;y<x;y++)(64512&(d=v.charCodeAt(y)))==55296&&y+1<x&&(64512&(m=v.charCodeAt(y+1)))==56320&&(d=65536+(d-55296<<10)+(m-56320),y++),C+=d<128?1:d<2048?2:d<65536?3:4;for(k=o.uint8array?new Uint8Array(C):new Array(C),y=S=0;S<C;y++)(64512&(d=v.charCodeAt(y)))==55296&&y+1<x&&(64512&(m=v.charCodeAt(y+1)))==56320&&(d=65536+(d-55296<<10)+(m-56320),y++),d<128?k[S++]=d:(d<2048?k[S++]=192|d>>>6:(d<65536?k[S++]=224|d>>>12:(k[S++]=240|d>>>18,k[S++]=128|d>>>12&63),k[S++]=128|d>>>6&63),k[S++]=128|63&d);return k}(h)},a.utf8decode=function(h){return o.nodebuffer?t.transformTo("nodebuffer",h).toString("utf-8"):function(v){var k,d,m,y,S=v.length,x=new Array(2*S);for(k=d=0;k<S;)if((m=v[k++])<128)x[d++]=m;else if(4<(y=f[m]))x[d++]=65533,k+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&k<S;)m=m<<6|63&v[k++],y--;1<y?x[d++]=65533:m<65536?x[d++]=m:(m-=65536,x[d++]=55296|m>>10&1023,x[d++]=56320|1023&m)}return x.length!==d&&(x.subarray?x=x.subarray(0,d):x.length=d),t.applyFromCharCode(x)}(h=t.transformTo(o.uint8array?"uint8array":"array",h))},t.inherits(b,l),b.prototype.processChunk=function(h){var v=t.transformTo(o.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var k=v;(v=new Uint8Array(k.length+this.leftOver.length)).set(this.leftOver,0),v.set(k,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var d=function(y,S){var x;for((S=S||y.length)>y.length&&(S=y.length),x=S-1;0<=x&&(192&y[x])==128;)x--;return x<0||x===0?S:x+f[y[x]]>S?x:S}(v),m=v;d!==v.length&&(o.uint8array?(m=v.subarray(0,d),this.leftOver=v.subarray(d,v.length)):(m=v.slice(0,d),this.leftOver=v.slice(d,v.length))),this.push({data:a.utf8decode(m),meta:h.meta})},b.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:a.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},a.Utf8DecodeWorker=b,t.inherits(w,l),w.prototype.processChunk=function(h){this.push({data:a.utf8encode(h.data),meta:h.meta})},a.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,n,a){var t=e("./support"),o=e("./base64"),u=e("./nodejsUtils"),l=e("set-immediate-shim"),f=e("./external");function p(d){return d}function b(d,m){for(var y=0;y<d.length;++y)m[y]=255&d.charCodeAt(y);return m}a.newBlob=function(d,m){a.checkSupport("blob");try{return new Blob([d],{type:m})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(d),y.getBlob(m)}catch{throw new Error("Bug : can't construct the Blob.")}}};var w={stringifyByChunk:function(d,m,y){var S=[],x=0,C=d.length;if(C<=y)return String.fromCharCode.apply(null,d);for(;x<C;)m==="array"||m==="nodebuffer"?S.push(String.fromCharCode.apply(null,d.slice(x,Math.min(x+y,C)))):S.push(String.fromCharCode.apply(null,d.subarray(x,Math.min(x+y,C)))),x+=y;return S.join("")},stringifyByChar:function(d){for(var m="",y=0;y<d.length;y++)m+=String.fromCharCode(d[y]);return m},applyCanBeUsed:{uint8array:function(){try{return t.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return t.nodebuffer&&String.fromCharCode.apply(null,u.allocBuffer(1)).length===1}catch{return!1}}()}};function h(d){var m=65536,y=a.getTypeOf(d),S=!0;if(y==="uint8array"?S=w.applyCanBeUsed.uint8array:y==="nodebuffer"&&(S=w.applyCanBeUsed.nodebuffer),S)for(;1<m;)try{return w.stringifyByChunk(d,y,m)}catch{m=Math.floor(m/2)}return w.stringifyByChar(d)}function v(d,m){for(var y=0;y<d.length;y++)m[y]=d[y];return m}a.applyFromCharCode=h;var k={};k.string={string:p,array:function(d){return b(d,new Array(d.length))},arraybuffer:function(d){return k.string.uint8array(d).buffer},uint8array:function(d){return b(d,new Uint8Array(d.length))},nodebuffer:function(d){return b(d,u.allocBuffer(d.length))}},k.array={string:h,array:p,arraybuffer:function(d){return new Uint8Array(d).buffer},uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return u.newBufferFrom(d)}},k.arraybuffer={string:function(d){return h(new Uint8Array(d))},array:function(d){return v(new Uint8Array(d),new Array(d.byteLength))},arraybuffer:p,uint8array:function(d){return new Uint8Array(d)},nodebuffer:function(d){return u.newBufferFrom(new Uint8Array(d))}},k.uint8array={string:h,array:function(d){return v(d,new Array(d.length))},arraybuffer:function(d){return d.buffer},uint8array:p,nodebuffer:function(d){return u.newBufferFrom(d)}},k.nodebuffer={string:h,array:function(d){return v(d,new Array(d.length))},arraybuffer:function(d){return k.nodebuffer.uint8array(d).buffer},uint8array:function(d){return v(d,new Uint8Array(d.length))},nodebuffer:p},a.transformTo=function(d,m){if(m=m||"",!d)return m;a.checkSupport(d);var y=a.getTypeOf(m);return k[y][d](m)},a.resolve=function(d){for(var m=d.split("/"),y=[],S=0;S<m.length;S++){var x=m[S];x==="."||x===""&&S!==0&&S!==m.length-1||(x===".."?y.pop():y.push(x))}return y.join("/")},a.getTypeOf=function(d){return typeof d=="string"?"string":Object.prototype.toString.call(d)==="[object Array]"?"array":t.nodebuffer&&u.isBuffer(d)?"nodebuffer":t.uint8array&&d instanceof Uint8Array?"uint8array":t.arraybuffer&&d instanceof ArrayBuffer?"arraybuffer":void 0},a.checkSupport=function(d){if(!t[d.toLowerCase()])throw new Error(d+" is not supported by this platform")},a.MAX_VALUE_16BITS=65535,a.MAX_VALUE_32BITS=-1,a.pretty=function(d){var m,y,S="";for(y=0;y<(d||"").length;y++)S+="\\x"+((m=d.charCodeAt(y))<16?"0":"")+m.toString(16).toUpperCase();return S},a.delay=function(d,m,y){l(function(){d.apply(y||null,m||[])})},a.inherits=function(d,m){function y(){}y.prototype=m.prototype,d.prototype=new y},a.extend=function(){var d,m,y={};for(d=0;d<arguments.length;d++)for(m in arguments[d])arguments[d].hasOwnProperty(m)&&y[m]===void 0&&(y[m]=arguments[d][m]);return y},a.prepareContent=function(d,m,y,S,x){return f.Promise.resolve(m).then(function(C){return t.blob&&(C instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(C))!==-1)&&typeof FileReader<"u"?new f.Promise(function(D,F){var U=new FileReader;U.onload=function(N){D(N.target.result)},U.onerror=function(N){F(N.target.error)},U.readAsArrayBuffer(C)}):C}).then(function(C){var D=a.getTypeOf(C);return D?(D==="arraybuffer"?C=a.transformTo("uint8array",C):D==="string"&&(x?C=o.decode(C):y&&S!==!0&&(C=function(F){return b(F,t.uint8array?new Uint8Array(F.length):new Array(F.length))}(C))),C):f.Promise.reject(new Error("Can't read the data of '"+d+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,n,a){var t=e("./reader/readerFor"),o=e("./utils"),u=e("./signature"),l=e("./zipEntry"),f=(e("./utf8"),e("./support"));function p(b){this.files=[],this.loadOptions=b}p.prototype={checkSignature:function(b){if(!this.reader.readAndCheckSignature(b)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(w)+", expected "+o.pretty(b)+")")}},isSignature:function(b,w){var h=this.reader.index;this.reader.setIndex(b);var v=this.reader.readString(4)===w;return this.reader.setIndex(h),v},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 b=this.reader.readData(this.zipCommentLength),w=f.uint8array?"uint8array":"array",h=o.transformTo(w,b);this.zipComment=this.loadOptions.decodeFileName(h)},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 b,w,h,v=this.zip64EndOfCentralSize-44;0<v;)b=this.reader.readInt(2),w=this.reader.readInt(4),h=this.reader.readData(w),this.zip64ExtensibleData[b]={id:b,length:w,value:h}},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 new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var b,w;for(b=0;b<this.files.length;b++)w=this.files[b],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(u.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var b;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(u.CENTRAL_FILE_HEADER);)(b=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(b);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var b=this.reader.lastIndexOfSignature(u.CENTRAL_DIRECTORY_END);if(b<0)throw this.isSignature(0,u.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(b);var w=b;if(this.checkSignature(u.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(b=this.reader.lastIndexOfSignature(u.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(b),this.checkSignature(u.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,u.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(u.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(u.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var v=w-h;if(0<v)this.isSignature(w,u.CENTRAL_FILE_HEADER)||(this.reader.zero=v);else if(v<0)throw new Error("Corrupted zip: missing "+Math.abs(v)+" bytes.")},prepareReader:function(b){this.reader=t(b)},load:function(b){this.prepareReader(b),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=p},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,n,a){var t=e("./reader/readerFor"),o=e("./utils"),u=e("./compressedObject"),l=e("./crc32"),f=e("./utf8"),p=e("./compressions"),b=e("./support");function w(h,v){this.options=h,this.loadOptions=v}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var v,k;if(h.skip(22),this.fileNameLength=h.readInt(2),k=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(k),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((v=function(d){for(var m in p)if(p.hasOwnProperty(m)&&p[m].magic===d)return p[m];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new u(this.compressedSize,this.uncompressedSize,this.crc32,v,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var v=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt