bok-reader 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,7 +25,13 @@ function MyBookViewer() {
25
25
  const epubUrl = "path/to/your/book.epub"; // Can be a URL, File object, or ArrayBuffer
26
26
 
27
27
  return (
28
- <div style={{ height: "100vh", width: "100vw" }}>
28
+ <div style={{
29
+ height: "100vh",
30
+ width: "100vw",
31
+ // the --safari-is-stupid-width is here basically because safari needs some explicit pointers on how big the colums are in column view, instead of inferring like chrome and firefox.
32
+ // @ts-expect-error sorry ts, we need this stupid variable for stupid safari
33
+ --safari-is-stupid-width: "100vw"
34
+ }}>
29
35
  <BokReader epubDataSource={epubUrl} />
30
36
  </div>
31
37
  );
package/dist/bok.es.js CHANGED
@@ -2444,7 +2444,7 @@ function qt() {
2444
2444
  `);
2445
2445
  X = x(X), g += X;
2446
2446
  let h = C.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, "");
2447
- return h = await S(h, z), h;
2447
+ return h = h.replace(/<link[^>]*?>/gi, ""), h = h.replace(/<title[^>]*>[\s\S]*?<\/title>/gi, ""), h = await S(h, z), h;
2448
2448
  }
2449
2449
  function x(C) {
2450
2450
  const z = [
@@ -3191,8 +3191,8 @@ const he = Ut.div`
3191
3191
  // Enable horizontal scrolling of the columns
3192
3192
  overflow-x: hidden;
3193
3193
  overflow-y: hidden; // Prevent vertical scrollbar on the container itself
3194
- scroll-snap-type: x mandatory; // Snap pages (columns)
3195
- scroll-behavior: auto; // Let JS handle smooth scrolling during page turns
3194
+ // scroll-snap-type: x mandatory; // Snap pages (columns)
3195
+ // scroll-behavior: auto; // Let JS handle smooth scrolling during page turns
3196
3196
  -webkit-overflow-scrolling: touch;
3197
3197
  box-sizing: border-box;
3198
3198
 
@@ -3225,7 +3225,6 @@ const he = Ut.div`
3225
3225
  max-width: calc(100% - 2 * var(--side-padding)) !important;
3226
3226
  margin-bottom: 10px;
3227
3227
  }
3228
-
3229
3228
  }
3230
3229
  }
3231
3230
 
package/dist/bok.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(_t,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react/jsx-runtime"),require("react"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","styled-components"],K):(_t=typeof globalThis<"u"?globalThis:_t||self,K(_t.Bok={},_t.jsxRuntime,_t.React,_t.styled))})(this,function(_t,K,tt,Ot){"use strict";function Ut(W){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(W){for(const f in W)if(f!=="default"){const A=Object.getOwnPropertyDescriptor(W,f);Object.defineProperty(Y,f,A.get?A:{enumerable:!0,get:()=>W[f]})}}return Y.default=W,Object.freeze(Y)}const vt=Ut(tt);var St=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}function Et(W){throw new Error('Could not dynamically require "'+W+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Tt={exports:{}};/*!
1
+ (function(_t,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react/jsx-runtime"),require("react"),require("styled-components")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","styled-components"],K):(_t=typeof globalThis<"u"?globalThis:_t||self,K(_t.Bok={},_t.jsxRuntime,_t.React,_t.styled))})(this,function(_t,K,tt,Ot){"use strict";function Ut(W){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(W){for(const h in W)if(h!=="default"){const A=Object.getOwnPropertyDescriptor(W,h);Object.defineProperty(Y,h,A.get?A:{enumerable:!0,get:()=>W[h]})}}return Y.default=W,Object.freeze(Y)}const vt=Ut(tt);var St=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jt(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}function Et(W){throw new Error('Could not dynamically require "'+W+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Tt={exports:{}};/*!
2
2
 
3
3
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
4
4
  <http://stuartk.com/jszip>
@@ -8,15 +8,15 @@
8
8
 
9
9
  JSZip uses the library pako released under the MIT license :
10
10
  https://github.com/nodeca/pako/blob/main/LICENSE
11
- */(function(W,Y){(function(f){W.exports=f()})(function(){return function f(A,v,a){function o(g,y){if(!v[g]){if(!A[g]){var _=typeof Et=="function"&&Et;if(!y&&_)return _(g,!0);if(r)return r(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=v[g]={exports:{}};A[g][0].call(i.exports,function(d){var n=A[g][1][d];return o(n||d)},i,i.exports,f,A,v,a)}return v[g].exports}for(var r=typeof Et=="function"&&Et,l=0;l<a.length;l++)o(a[l]);return o}({1:[function(f,A,v){var a=f("./utils"),o=f("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";v.encode=function(l){for(var g,y,_,b,i,d,n,c=[],s=0,m=l.length,w=m,x=a.getTypeOf(l)!=="string";s<l.length;)w=m-s,_=x?(g=l[s++],y=s<m?l[s++]:0,s<m?l[s++]:0):(g=l.charCodeAt(s++),y=s<m?l.charCodeAt(s++):0,s<m?l.charCodeAt(s++):0),b=g>>2,i=(3&g)<<4|y>>4,d=1<w?(15&y)<<2|_>>6:64,n=2<w?63&_:64,c.push(r.charAt(b)+r.charAt(i)+r.charAt(d)+r.charAt(n));return c.join("")},v.decode=function(l){var g,y,_,b,i,d,n=0,c=0,s="data:";if(l.substr(0,s.length)===s)throw new Error("Invalid base64 input, it looks like a data url.");var m,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===r.charAt(64)&&w--,l.charAt(l.length-2)===r.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(m=o.uint8array?new Uint8Array(0|w):new Array(0|w);n<l.length;)g=r.indexOf(l.charAt(n++))<<2|(b=r.indexOf(l.charAt(n++)))>>4,y=(15&b)<<4|(i=r.indexOf(l.charAt(n++)))>>2,_=(3&i)<<6|(d=r.indexOf(l.charAt(n++))),m[c++]=g,i!==64&&(m[c++]=y),d!==64&&(m[c++]=_);return m}},{"./support":30,"./utils":32}],2:[function(f,A,v){var a=f("./external"),o=f("./stream/DataWorker"),r=f("./stream/Crc32Probe"),l=f("./stream/DataLengthProbe");function g(y,_,b,i,d){this.compressedSize=y,this.uncompressedSize=_,this.crc32=b,this.compression=i,this.compressedContent=d}g.prototype={getContentWorker:function(){var y=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),_=this;return y.on("end",function(){if(this.streamInfo.data_length!==_.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(y,_,b){return y.pipe(new r).pipe(new l("uncompressedSize")).pipe(_.compressWorker(b)).pipe(new l("compressedSize")).withStreamInfo("compression",_)},A.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(f,A,v){var a=f("./stream/GenericWorker");v.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},v.DEFLATE=f("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(f,A,v){var a=f("./utils"),o=function(){for(var r,l=[],g=0;g<256;g++){r=g;for(var y=0;y<8;y++)r=1&r?3988292384^r>>>1:r>>>1;l[g]=r}return l}();A.exports=function(r,l){return r!==void 0&&r.length?a.getTypeOf(r)!=="string"?function(g,y,_,b){var i=o,d=b+_;g^=-1;for(var n=b;n<d;n++)g=g>>>8^i[255&(g^y[n])];return-1^g}(0|l,r,r.length,0):function(g,y,_,b){var i=o,d=b+_;g^=-1;for(var n=b;n<d;n++)g=g>>>8^i[255&(g^y.charCodeAt(n))];return-1^g}(0|l,r,r.length,0):0}},{"./utils":32}],5:[function(f,A,v){v.base64=!1,v.binary=!1,v.dir=!1,v.createFolders=!0,v.date=null,v.compression=null,v.compressionOptions=null,v.comment=null,v.unixPermissions=null,v.dosPermissions=null},{}],6:[function(f,A,v){var a=null;a=typeof Promise<"u"?Promise:f("lie"),A.exports={Promise:a}},{lie:37}],7:[function(f,A,v){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=f("pako"),r=f("./utils"),l=f("./stream/GenericWorker"),g=a?"uint8array":"array";function y(_,b){l.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=b,this.meta={}}v.magic="\b\0",r.inherits(y,l),y.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(g,_.data),!1)},y.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(b){_.push({data:b,meta:_.meta})}},v.compressWorker=function(_){return new y("Deflate",_)},v.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(f,A,v){function a(i,d){var n,c="";for(n=0;n<d;n++)c+=String.fromCharCode(255&i),i>>>=8;return c}function o(i,d,n,c,s,m){var w,x,S=i.file,D=i.compression,E=m!==g.utf8encode,N=r.transformTo("string",m(S.name)),C=r.transformTo("string",g.utf8encode(S.name)),z=S.comment,X=r.transformTo("string",m(z)),h=r.transformTo("string",g.utf8encode(z)),T=C.length!==S.name.length,e=h.length!==z.length,F="",V="",U="",et=S.dir,M=S.date,rt={crc32:0,compressedSize:0,uncompressedSize:0};d&&!n||(rt.crc32=i.crc32,rt.compressedSize=i.compressedSize,rt.uncompressedSize=i.uncompressedSize);var B=0;d&&(B|=8),E||!T&&!e||(B|=2048);var I=0,Q=0;et&&(I|=16),s==="UNIX"?(Q=798,I|=function(G,ot){var ht=G;return G||(ht=ot?16893:33204),(65535&ht)<<16}(S.unixPermissions,et)):(Q=20,I|=function(G){return 63&(G||0)}(S.dosPermissions)),w=M.getUTCHours(),w<<=6,w|=M.getUTCMinutes(),w<<=5,w|=M.getUTCSeconds()/2,x=M.getUTCFullYear()-1980,x<<=4,x|=M.getUTCMonth()+1,x<<=5,x|=M.getUTCDate(),T&&(V=a(1,1)+a(y(N),4)+C,F+="up"+a(V.length,2)+V),e&&(U=a(1,1)+a(y(X),4)+h,F+="uc"+a(U.length,2)+U);var $="";return $+=`
12
- \0`,$+=a(B,2),$+=D.magic,$+=a(w,2),$+=a(x,2),$+=a(rt.crc32,4),$+=a(rt.compressedSize,4),$+=a(rt.uncompressedSize,4),$+=a(N.length,2),$+=a(F.length,2),{fileRecord:_.LOCAL_FILE_HEADER+$+N+F,dirRecord:_.CENTRAL_FILE_HEADER+a(Q,2)+$+a(X.length,2)+"\0\0\0\0"+a(I,4)+a(c,4)+N+F+X}}var r=f("../utils"),l=f("../stream/GenericWorker"),g=f("../utf8"),y=f("../crc32"),_=f("../signature");function b(i,d,n,c){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=n,this.encodeFileName=c,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(b,l),b.prototype.push=function(i){var d=i.meta.percent||0,n=this.entriesCount,c=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,l.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:n?(d+100*(n-c-1))/n:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var d=this.streamFiles&&!i.file.dir;if(d){var n=o(i,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var d=this.streamFiles&&!i.file.dir,n=o(i,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),d)this.push({data:function(c){return _.DATA_DESCRIPTOR+a(c.crc32,4)+a(c.compressedSize,4)+a(c.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var n=this.bytesWritten-i,c=function(s,m,w,x,S){var D=r.transformTo("string",S(x));return _.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(s,2)+a(s,2)+a(m,4)+a(w,4)+a(D.length,2)+D}(this.dirRecords.length,n,i,this.zipComment,this.encodeFileName);this.push({data:c,meta:{percent:100}})},b.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},b.prototype.registerPrevious=function(i){this._sources.push(i);var d=this;return i.on("data",function(n){d.processChunk(n)}),i.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),i.on("error",function(n){d.error(n)}),this},b.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))},b.prototype.error=function(i){var d=this._sources;if(!l.prototype.error.call(this,i))return!1;for(var n=0;n<d.length;n++)try{d[n].error(i)}catch{}return!0},b.prototype.lock=function(){l.prototype.lock.call(this);for(var i=this._sources,d=0;d<i.length;d++)i[d].lock()},A.exports=b},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(f,A,v){var a=f("../compressions"),o=f("./ZipFileWorker");v.generateWorker=function(r,l,g){var y=new o(l.streamFiles,g,l.platform,l.encodeFileName),_=0;try{r.forEach(function(b,i){_++;var d=function(m,w){var x=m||w,S=a[x];if(!S)throw new Error(x+" is not a valid compression method !");return S}(i.options.compression,l.compression),n=i.options.compressionOptions||l.compressionOptions||{},c=i.dir,s=i.date;i._compressWorker(d,n).withStreamInfo("file",{name:b,dir:c,date:s,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(y)}),y.entriesCount=_}catch(b){y.error(b)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(f,A,v){function a(){if(!(this instanceof a))return new a;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 a;for(var r in this)typeof this[r]!="function"&&(o[r]=this[r]);return o}}(a.prototype=f("./object")).loadAsync=f("./load"),a.support=f("./support"),a.defaults=f("./defaults"),a.version="3.10.1",a.loadAsync=function(o,r){return new a().loadAsync(o,r)},a.external=f("./external"),A.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(f,A,v){var a=f("./utils"),o=f("./external"),r=f("./utf8"),l=f("./zipEntries"),g=f("./stream/Crc32Probe"),y=f("./nodejsUtils");function _(b){return new o.Promise(function(i,d){var n=b.decompressed.getContentWorker().pipe(new g);n.on("error",function(c){d(c)}).on("end",function(){n.streamInfo.crc32!==b.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}A.exports=function(b,i){var d=this;return i=a.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),y.isNode&&y.isStream(b)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",b,!0,i.optimizedBinaryString,i.base64).then(function(n){var c=new l(i);return c.load(n),c}).then(function(n){var c=[o.Promise.resolve(n)],s=n.files;if(i.checkCRC32)for(var m=0;m<s.length;m++)c.push(_(s[m]));return o.Promise.all(c)}).then(function(n){for(var c=n.shift(),s=c.files,m=0;m<s.length;m++){var w=s[m],x=w.fileNameStr,S=a.resolve(w.fileNameStr);d.file(S,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:i.createFolders}),w.dir||(d.file(S).unsafeOriginalName=x)}return c.zipComment.length&&(d.comment=c.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(f,A,v){var a=f("../utils"),o=f("../stream/GenericWorker");function r(l,g){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(g)}a.inherits(r,o),r.prototype._bindStream=function(l){var g=this;(this._stream=l).pause(),l.on("data",function(y){g.push({data:y,meta:{percent:0}})}).on("error",function(y){g.isPaused?this.generatedError=y:g.error(y)}).on("end",function(){g.isPaused?g._upstreamEnded=!0:g.end()})},r.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},A.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(f,A,v){var a=f("readable-stream").Readable;function o(r,l,g){a.call(this,l),this._helper=r;var y=this;r.on("data",function(_,b){y.push(_)||y._helper.pause(),g&&g(b)}).on("error",function(_){y.emit("error",_)}).on("end",function(){y.push(null)})}f("../utils").inherits(o,a),o.prototype._read=function(){this._helper.resume()},A.exports=o},{"../utils":32,"readable-stream":16}],14:[function(f,A,v){A.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,o);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,o)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var o=new Buffer(a);return o.fill(0),o},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(f,A,v){function a(S,D,E){var N,C=r.getTypeOf(D),z=r.extend(E||{},y);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(S=s(S)),z.createFolders&&(N=c(S))&&m.call(this,N,!0);var X=C==="string"&&z.binary===!1&&z.base64===!1;E&&E.binary!==void 0||(z.binary=!X),(D instanceof _&&D.uncompressedSize===0||z.dir||!D||D.length===0)&&(z.base64=!1,z.binary=!0,D="",z.compression="STORE",C="string");var h=null;h=D instanceof _||D instanceof l?D:d.isNode&&d.isStream(D)?new n(S,D):r.prepareContent(S,D,z.binary,z.optimizedBinaryString,z.base64);var T=new b(S,h,z);this.files[S]=T}var o=f("./utf8"),r=f("./utils"),l=f("./stream/GenericWorker"),g=f("./stream/StreamHelper"),y=f("./defaults"),_=f("./compressedObject"),b=f("./zipObject"),i=f("./generate"),d=f("./nodejsUtils"),n=f("./nodejs/NodejsStreamInputAdapter"),c=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var D=S.lastIndexOf("/");return 0<D?S.substring(0,D):""},s=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},m=function(S,D){return D=D!==void 0?D:y.createFolders,S=s(S),this.files[S]||a.call(this,S,null,{dir:!0,createFolders:D}),this.files[S]};function w(S){return Object.prototype.toString.call(S)==="[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(S){var D,E,N;for(D in this.files)N=this.files[D],(E=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&S(E,N)},filter:function(S){var D=[];return this.forEach(function(E,N){S(E,N)&&D.push(N)}),D},file:function(S,D,E){if(arguments.length!==1)return S=this.root+S,a.call(this,S,D,E),this;if(w(S)){var N=S;return this.filter(function(z,X){return!X.dir&&N.test(z)})}var C=this.files[this.root+S];return C&&!C.dir?C:null},folder:function(S){if(!S)return this;if(w(S))return this.filter(function(C,z){return z.dir&&S.test(C)});var D=this.root+S,E=m.call(this,D),N=this.clone();return N.root=E.name,N},remove:function(S){S=this.root+S;var D=this.files[S];if(D||(S.slice(-1)!=="/"&&(S+="/"),D=this.files[S]),D&&!D.dir)delete this.files[S];else for(var E=this.filter(function(C,z){return z.name.slice(0,S.length)===S}),N=0;N<E.length;N++)delete this.files[E[N].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var D,E={};try{if((E=r.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=E.type.toLowerCase(),E.compression=E.compression.toUpperCase(),E.type==="binarystring"&&(E.type="string"),!E.type)throw new Error("No output type specified.");r.checkSupport(E.type),E.platform!=="darwin"&&E.platform!=="freebsd"&&E.platform!=="linux"&&E.platform!=="sunos"||(E.platform="UNIX"),E.platform==="win32"&&(E.platform="DOS");var N=E.comment||this.comment||"";D=i.generateWorker(this,E,N)}catch(C){(D=new l("error")).error(C)}return new g(D,E.type||"string",E.mimeType)},generateAsync:function(S,D){return this.generateInternalStream(S).accumulate(D)},generateNodeStream:function(S,D){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(D)}};A.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(f,A,v){A.exports=f("stream")},{stream:void 0}],17:[function(f,A,v){var a=f("./DataReader");function o(r){a.call(this,r);for(var l=0;l<this.data.length;l++)r[l]=255&r[l]}f("../utils").inherits(o,a),o.prototype.byteAt=function(r){return this.data[this.zero+r]},o.prototype.lastIndexOfSignature=function(r){for(var l=r.charCodeAt(0),g=r.charCodeAt(1),y=r.charCodeAt(2),_=r.charCodeAt(3),b=this.length-4;0<=b;--b)if(this.data[b]===l&&this.data[b+1]===g&&this.data[b+2]===y&&this.data[b+3]===_)return b-this.zero;return-1},o.prototype.readAndCheckSignature=function(r){var l=r.charCodeAt(0),g=r.charCodeAt(1),y=r.charCodeAt(2),_=r.charCodeAt(3),b=this.readData(4);return l===b[0]&&g===b[1]&&y===b[2]&&_===b[3]},o.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./DataReader":18}],18:[function(f,A,v){var a=f("../utils");function o(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var l,g=0;for(this.checkOffset(r),l=this.index+r-1;l>=this.index;l--)g=(g<<8)+this.byteAt(l);return this.index+=r,g},readString:function(r){return a.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},A.exports=o},{"../utils":32}],19:[function(f,A,v){var a=f("./Uint8ArrayReader");function o(r){a.call(this,r)}f("../utils").inherits(o,a),o.prototype.readData=function(r){this.checkOffset(r);var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(f,A,v){var a=f("./DataReader");function o(r){a.call(this,r)}f("../utils").inherits(o,a),o.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},o.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},o.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},o.prototype.readData=function(r){this.checkOffset(r);var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./DataReader":18}],21:[function(f,A,v){var a=f("./ArrayReader");function o(r){a.call(this,r)}f("../utils").inherits(o,a),o.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(f,A,v){var a=f("../utils"),o=f("../support"),r=f("./ArrayReader"),l=f("./StringReader"),g=f("./NodeBufferReader"),y=f("./Uint8ArrayReader");A.exports=function(_){var b=a.getTypeOf(_);return a.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(_):o.uint8array?new y(a.transformTo("uint8array",_)):new r(a.transformTo("array",_)):new l(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(f,A,v){v.LOCAL_FILE_HEADER="PK",v.CENTRAL_FILE_HEADER="PK",v.CENTRAL_DIRECTORY_END="PK",v.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",v.ZIP64_CENTRAL_DIRECTORY_END="PK",v.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(f,A,v){var a=f("./GenericWorker"),o=f("../utils");function r(l){a.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(r,a),r.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},A.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(f,A,v){var a=f("./GenericWorker"),o=f("../crc32");function r(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}f("../utils").inherits(r,a),r.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},A.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(f,A,v){var a=f("../utils"),o=f("./GenericWorker");function r(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}a.inherits(r,o),r.prototype.processChunk=function(l){if(l){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+l.data.length}o.prototype.processChunk.call(this,l)},A.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(f,A,v){var a=f("../utils"),o=f("./GenericWorker");function r(l){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(y){g.dataIsReady=!0,g.data=y,g.max=y&&y.length||0,g.type=a.getTypeOf(y),g.isPaused||g._tickAndRepeat()},function(y){g.error(y)})}a.inherits(r,o),r.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,g=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,g);break;case"uint8array":l=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":l=this.data.slice(this.index,g)}return this.index=g,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},A.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(f,A,v){function a(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}a.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,r){return this._listeners[o].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,r){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,r)},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 r=this;return o.on("data",function(l){r.processChunk(l)}),o.on("end",function(){r.end()}),o.on("error",function(l){r.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,r){return this.extraStreamInfo[o]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,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}},A.exports=a},{}],29:[function(f,A,v){var a=f("../utils"),o=f("./ConvertWorker"),r=f("./GenericWorker"),l=f("../base64"),g=f("../support"),y=f("../external"),_=null;if(g.nodestream)try{_=f("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(d,n){return new y.Promise(function(c,s){var m=[],w=d._internalType,x=d._outputType,S=d._mimeType;d.on("data",function(D,E){m.push(D),n&&n(E)}).on("error",function(D){m=[],s(D)}).on("end",function(){try{var D=function(E,N,C){switch(E){case"blob":return a.newBlob(a.transformTo("arraybuffer",N),C);case"base64":return l.encode(N);default:return a.transformTo(E,N)}}(x,function(E,N){var C,z=0,X=null,h=0;for(C=0;C<N.length;C++)h+=N[C].length;switch(E){case"string":return N.join("");case"array":return Array.prototype.concat.apply([],N);case"uint8array":for(X=new Uint8Array(h),C=0;C<N.length;C++)X.set(N[C],z),z+=N[C].length;return X;case"nodebuffer":return Buffer.concat(N);default:throw new Error("concat : unsupported type '"+E+"'")}}(w,m),S);c(D)}catch(E){s(E)}m=[]}).resume()})}function i(d,n,c){var s=n;switch(n){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=n,this._mimeType=c,a.checkSupport(s),this._worker=d.pipe(new o(s)),d.lock()}catch(m){this._worker=new r("error"),this._worker.error(m)}}i.prototype={accumulate:function(d){return b(this,d)},on:function(d,n){var c=this;return d==="data"?this._worker.on(d,function(s){n.call(c,s.data,s.meta)}):this._worker.on(d,function(){a.delay(n,arguments,c)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new _(this,{objectMode:this._outputType!=="nodebuffer"},d)}},A.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(f,A,v){if(v.base64=!0,v.array=!0,v.string=!0,v.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",v.nodebuffer=typeof Buffer<"u",v.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")v.blob=!1;else{var a=new ArrayBuffer(0);try{v.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),v.blob=o.getBlob("application/zip").size===0}catch{v.blob=!1}}}try{v.nodestream=!!f("readable-stream").Readable}catch{v.nodestream=!1}},{"readable-stream":16}],31:[function(f,A,v){for(var a=f("./utils"),o=f("./support"),r=f("./nodejsUtils"),l=f("./stream/GenericWorker"),g=new Array(256),y=0;y<256;y++)g[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;g[254]=g[254]=1;function _(){l.call(this,"utf-8 decode"),this.leftOver=null}function b(){l.call(this,"utf-8 encode")}v.utf8encode=function(i){return o.nodebuffer?r.newBufferFrom(i,"utf-8"):function(d){var n,c,s,m,w,x=d.length,S=0;for(m=0;m<x;m++)(64512&(c=d.charCodeAt(m)))==55296&&m+1<x&&(64512&(s=d.charCodeAt(m+1)))==56320&&(c=65536+(c-55296<<10)+(s-56320),m++),S+=c<128?1:c<2048?2:c<65536?3:4;for(n=o.uint8array?new Uint8Array(S):new Array(S),m=w=0;w<S;m++)(64512&(c=d.charCodeAt(m)))==55296&&m+1<x&&(64512&(s=d.charCodeAt(m+1)))==56320&&(c=65536+(c-55296<<10)+(s-56320),m++),c<128?n[w++]=c:(c<2048?n[w++]=192|c>>>6:(c<65536?n[w++]=224|c>>>12:(n[w++]=240|c>>>18,n[w++]=128|c>>>12&63),n[w++]=128|c>>>6&63),n[w++]=128|63&c);return n}(i)},v.utf8decode=function(i){return o.nodebuffer?a.transformTo("nodebuffer",i).toString("utf-8"):function(d){var n,c,s,m,w=d.length,x=new Array(2*w);for(n=c=0;n<w;)if((s=d[n++])<128)x[c++]=s;else if(4<(m=g[s]))x[c++]=65533,n+=m-1;else{for(s&=m===2?31:m===3?15:7;1<m&&n<w;)s=s<<6|63&d[n++],m--;1<m?x[c++]=65533:s<65536?x[c++]=s:(s-=65536,x[c++]=55296|s>>10&1023,x[c++]=56320|1023&s)}return x.length!==c&&(x.subarray?x=x.subarray(0,c):x.length=c),a.applyFromCharCode(x)}(i=a.transformTo(o.uint8array?"uint8array":"array",i))},a.inherits(_,l),_.prototype.processChunk=function(i){var d=a.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var n=d;(d=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),d.set(n,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var c=function(m,w){var x;for((w=w||m.length)>m.length&&(w=m.length),x=w-1;0<=x&&(192&m[x])==128;)x--;return x<0||x===0?w:x+g[m[x]]>w?x:w}(d),s=d;c!==d.length&&(o.uint8array?(s=d.subarray(0,c),this.leftOver=d.subarray(c,d.length)):(s=d.slice(0,c),this.leftOver=d.slice(c,d.length))),this.push({data:v.utf8decode(s),meta:i.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:v.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},v.Utf8DecodeWorker=_,a.inherits(b,l),b.prototype.processChunk=function(i){this.push({data:v.utf8encode(i.data),meta:i.meta})},v.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(f,A,v){var a=f("./support"),o=f("./base64"),r=f("./nodejsUtils"),l=f("./external");function g(n){return n}function y(n,c){for(var s=0;s<n.length;++s)c[s]=255&n.charCodeAt(s);return c}f("setimmediate"),v.newBlob=function(n,c){v.checkSupport("blob");try{return new Blob([n],{type:c})}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(n),s.getBlob(c)}catch{throw new Error("Bug : can't construct the Blob.")}}};var _={stringifyByChunk:function(n,c,s){var m=[],w=0,x=n.length;if(x<=s)return String.fromCharCode.apply(null,n);for(;w<x;)c==="array"||c==="nodebuffer"?m.push(String.fromCharCode.apply(null,n.slice(w,Math.min(w+s,x)))):m.push(String.fromCharCode.apply(null,n.subarray(w,Math.min(w+s,x)))),w+=s;return m.join("")},stringifyByChar:function(n){for(var c="",s=0;s<n.length;s++)c+=String.fromCharCode(n[s]);return c},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}}()}};function b(n){var c=65536,s=v.getTypeOf(n),m=!0;if(s==="uint8array"?m=_.applyCanBeUsed.uint8array:s==="nodebuffer"&&(m=_.applyCanBeUsed.nodebuffer),m)for(;1<c;)try{return _.stringifyByChunk(n,s,c)}catch{c=Math.floor(c/2)}return _.stringifyByChar(n)}function i(n,c){for(var s=0;s<n.length;s++)c[s]=n[s];return c}v.applyFromCharCode=b;var d={};d.string={string:g,array:function(n){return y(n,new Array(n.length))},arraybuffer:function(n){return d.string.uint8array(n).buffer},uint8array:function(n){return y(n,new Uint8Array(n.length))},nodebuffer:function(n){return y(n,r.allocBuffer(n.length))}},d.array={string:b,array:g,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},d.arraybuffer={string:function(n){return b(new Uint8Array(n))},array:function(n){return i(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:g,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},d.uint8array={string:b,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:g,nodebuffer:function(n){return r.newBufferFrom(n)}},d.nodebuffer={string:b,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return d.nodebuffer.uint8array(n).buffer},uint8array:function(n){return i(n,new Uint8Array(n.length))},nodebuffer:g},v.transformTo=function(n,c){if(c=c||"",!n)return c;v.checkSupport(n);var s=v.getTypeOf(c);return d[s][n](c)},v.resolve=function(n){for(var c=n.split("/"),s=[],m=0;m<c.length;m++){var w=c[m];w==="."||w===""&&m!==0&&m!==c.length-1||(w===".."?s.pop():s.push(w))}return s.join("/")},v.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":a.nodebuffer&&r.isBuffer(n)?"nodebuffer":a.uint8array&&n instanceof Uint8Array?"uint8array":a.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},v.checkSupport=function(n){if(!a[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},v.MAX_VALUE_16BITS=65535,v.MAX_VALUE_32BITS=-1,v.pretty=function(n){var c,s,m="";for(s=0;s<(n||"").length;s++)m+="\\x"+((c=n.charCodeAt(s))<16?"0":"")+c.toString(16).toUpperCase();return m},v.delay=function(n,c,s){setImmediate(function(){n.apply(s||null,c||[])})},v.inherits=function(n,c){function s(){}s.prototype=c.prototype,n.prototype=new s},v.extend=function(){var n,c,s={};for(n=0;n<arguments.length;n++)for(c in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],c)&&s[c]===void 0&&(s[c]=arguments[n][c]);return s},v.prepareContent=function(n,c,s,m,w){return l.Promise.resolve(c).then(function(x){return a.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new l.Promise(function(S,D){var E=new FileReader;E.onload=function(N){S(N.target.result)},E.onerror=function(N){D(N.target.error)},E.readAsArrayBuffer(x)}):x}).then(function(x){var S=v.getTypeOf(x);return S?(S==="arraybuffer"?x=v.transformTo("uint8array",x):S==="string"&&(w?x=o.decode(x):s&&m!==!0&&(x=function(D){return y(D,a.uint8array?new Uint8Array(D.length):new Array(D.length))}(x))),x):l.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(f,A,v){var a=f("./reader/readerFor"),o=f("./utils"),r=f("./signature"),l=f("./zipEntry"),g=f("./support");function y(_){this.files=[],this.loadOptions=_}y.prototype={checkSignature:function(_){if(!this.reader.readAndCheckSignature(_)){this.reader.index-=4;var b=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(b)+", expected "+o.pretty(_)+")")}},isSignature:function(_,b){var i=this.reader.index;this.reader.setIndex(_);var d=this.reader.readString(4)===b;return this.reader.setIndex(i),d},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 _=this.reader.readData(this.zipCommentLength),b=g.uint8array?"uint8array":"array",i=o.transformTo(b,_);this.zipComment=this.loadOptions.decodeFileName(i)},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,i,d=this.zip64EndOfCentralSize-44;0<d;)_=this.reader.readInt(2),b=this.reader.readInt(4),i=this.reader.readData(b),this.zip64ExtensibleData[_]={id:_,length:b,value:i}},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;for(_=0;_<this.files.length;_++)b=this.files[_],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var _;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(_=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(_);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 _=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(_<0)throw this.isSignature(0,r.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(_);var b=_;if(this.checkSignature(r.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,(_=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(_),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var d=b-i;if(0<d)this.isSignature(b,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(_){this.reader=a(_)},load:function(_){this.prepareReader(_),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},A.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(f,A,v){var a=f("./reader/readerFor"),o=f("./utils"),r=f("./compressedObject"),l=f("./crc32"),g=f("./utf8"),y=f("./compressions"),_=f("./support");function b(i,d){this.options=i,this.loadOptions=d}b.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var d,n;if(i.skip(22),this.fileNameLength=i.readInt(2),n=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.skip(n),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((d=function(c){for(var s in y)if(Object.prototype.hasOwnProperty.call(y,s)&&y[s].magic===c)return y[s];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 r(this.compressedSize,this.uncompressedSize,this.crc32,d,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var d=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(d),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var d,n,c,s=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<s;)d=i.readInt(2),n=i.readInt(2),c=i.readData(n),this.extraFields[d]={id:d,length:n,value:c};i.setIndex(s)},handleUTF8:function(){var i=_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=g.utf8decode(this.fileName),this.fileCommentStr=g.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var n=o.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var c=this.findExtraFieldUnicodeComment();if(c!==null)this.fileCommentStr=c;else{var s=o.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var d=a(i.value);return d.readInt(1)!==1||l(this.fileName)!==d.readInt(4)?null:g.utf8decode(d.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var d=a(i.value);return d.readInt(1)!==1||l(this.fileComment)!==d.readInt(4)?null:g.utf8decode(d.readData(i.length-5))}return null}},A.exports=b},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(f,A,v){function a(d,n,c){this.name=d,this.dir=c.dir,this.date=c.date,this.comment=c.comment,this.unixPermissions=c.unixPermissions,this.dosPermissions=c.dosPermissions,this._data=n,this._dataBinary=c.binary,this.options={compression:c.compression,compressionOptions:c.compressionOptions}}var o=f("./stream/StreamHelper"),r=f("./stream/DataWorker"),l=f("./utf8"),g=f("./compressedObject"),y=f("./stream/GenericWorker");a.prototype={internalStream:function(d){var n=null,c="string";try{if(!d)throw new Error("No output type specified.");var s=(c=d.toLowerCase())==="string"||c==="text";c!=="binarystring"&&c!=="text"||(c="string"),n=this._decompressWorker();var m=!this._dataBinary;m&&!s&&(n=n.pipe(new l.Utf8EncodeWorker)),!m&&s&&(n=n.pipe(new l.Utf8DecodeWorker))}catch(w){(n=new y("error")).error(w)}return new o(n,c,"")},async:function(d,n){return this.internalStream(d).accumulate(n)},nodeStream:function(d,n){return this.internalStream(d||"nodebuffer").toNodejsStream(n)},_compressWorker:function(d,n){if(this._data instanceof g&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var c=this._decompressWorker();return this._dataBinary||(c=c.pipe(new l.Utf8EncodeWorker)),g.createWorkerFrom(c,d,n)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof y?this._data:new r(this._data)}};for(var _=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],b=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<_.length;i++)a.prototype[_[i]]=b;A.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(f,A,v){(function(a){var o,r,l=a.MutationObserver||a.WebKitMutationObserver;if(l){var g=0,y=new l(d),_=a.document.createTextNode("");y.observe(_,{characterData:!0}),o=function(){_.data=g=++g%2}}else if(a.setImmediate||a.MessageChannel===void 0)o="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var n=a.document.createElement("script");n.onreadystatechange=function(){d(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},a.document.documentElement.appendChild(n)}:function(){setTimeout(d,0)};else{var b=new a.MessageChannel;b.port1.onmessage=d,o=function(){b.port2.postMessage(0)}}var i=[];function d(){var n,c;r=!0;for(var s=i.length;s;){for(c=i,i=[],n=-1;++n<s;)c[n]();s=i.length}r=!1}A.exports=function(n){i.push(n)!==1||r||o()}}).call(this,typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(f,A,v){var a=f("immediate");function o(){}var r={},l=["REJECTED"],g=["FULFILLED"],y=["PENDING"];function _(s){if(typeof s!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,s!==o&&n(this,s)}function b(s,m,w){this.promise=s,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function i(s,m,w){a(function(){var x;try{x=m(w)}catch(S){return r.reject(s,S)}x===s?r.reject(s,new TypeError("Cannot resolve promise with itself")):r.resolve(s,x)})}function d(s){var m=s&&s.then;if(s&&(typeof s=="object"||typeof s=="function")&&typeof m=="function")return function(){m.apply(s,arguments)}}function n(s,m){var w=!1;function x(E){w||(w=!0,r.reject(s,E))}function S(E){w||(w=!0,r.resolve(s,E))}var D=c(function(){m(S,x)});D.status==="error"&&x(D.value)}function c(s,m){var w={};try{w.value=s(m),w.status="success"}catch(x){w.status="error",w.value=x}return w}(A.exports=_).prototype.finally=function(s){if(typeof s!="function")return this;var m=this.constructor;return this.then(function(w){return m.resolve(s()).then(function(){return w})},function(w){return m.resolve(s()).then(function(){throw w})})},_.prototype.catch=function(s){return this.then(null,s)},_.prototype.then=function(s,m){if(typeof s!="function"&&this.state===g||typeof m!="function"&&this.state===l)return this;var w=new this.constructor(o);return this.state!==y?i(w,this.state===g?s:m,this.outcome):this.queue.push(new b(w,s,m)),w},b.prototype.callFulfilled=function(s){r.resolve(this.promise,s)},b.prototype.otherCallFulfilled=function(s){i(this.promise,this.onFulfilled,s)},b.prototype.callRejected=function(s){r.reject(this.promise,s)},b.prototype.otherCallRejected=function(s){i(this.promise,this.onRejected,s)},r.resolve=function(s,m){var w=c(d,m);if(w.status==="error")return r.reject(s,w.value);var x=w.value;if(x)n(s,x);else{s.state=g,s.outcome=m;for(var S=-1,D=s.queue.length;++S<D;)s.queue[S].callFulfilled(m)}return s},r.reject=function(s,m){s.state=l,s.outcome=m;for(var w=-1,x=s.queue.length;++w<x;)s.queue[w].callRejected(m);return s},_.resolve=function(s){return s instanceof this?s:r.resolve(new this(o),s)},_.reject=function(s){var m=new this(o);return r.reject(m,s)},_.all=function(s){var m=this;if(Object.prototype.toString.call(s)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=s.length,x=!1;if(!w)return this.resolve([]);for(var S=new Array(w),D=0,E=-1,N=new this(o);++E<w;)C(s[E],E);return N;function C(z,X){m.resolve(z).then(function(h){S[X]=h,++D!==w||x||(x=!0,r.resolve(N,S))},function(h){x||(x=!0,r.reject(N,h))})}},_.race=function(s){var m=this;if(Object.prototype.toString.call(s)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=s.length,x=!1;if(!w)return this.resolve([]);for(var S=-1,D=new this(o);++S<w;)E=s[S],m.resolve(E).then(function(N){x||(x=!0,r.resolve(D,N))},function(N){x||(x=!0,r.reject(D,N))});var E;return D}},{immediate:36}],38:[function(f,A,v){var a={};(0,f("./lib/utils/common").assign)(a,f("./lib/deflate"),f("./lib/inflate"),f("./lib/zlib/constants")),A.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(f,A,v){var a=f("./zlib/deflate"),o=f("./utils/common"),r=f("./utils/strings"),l=f("./zlib/messages"),g=f("./zlib/zstream"),y=Object.prototype.toString,_=0,b=-1,i=0,d=8;function n(s){if(!(this instanceof n))return new n(s);this.options=o.assign({level:b,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:i,to:""},s||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var w=a.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(w!==_)throw new Error(l[w]);if(m.header&&a.deflateSetHeader(this.strm,m.header),m.dictionary){var x;if(x=typeof m.dictionary=="string"?r.string2buf(m.dictionary):y.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(w=a.deflateSetDictionary(this.strm,x))!==_)throw new Error(l[w]);this._dict_set=!0}}function c(s,m){var w=new n(m);if(w.push(s,!0),w.err)throw w.msg||l[w.err];return w.result}n.prototype.push=function(s,m){var w,x,S=this.strm,D=this.options.chunkSize;if(this.ended)return!1;x=m===~~m?m:m===!0?4:0,typeof s=="string"?S.input=r.string2buf(s):y.call(s)==="[object ArrayBuffer]"?S.input=new Uint8Array(s):S.input=s,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new o.Buf8(D),S.next_out=0,S.avail_out=D),(w=a.deflate(S,x))!==1&&w!==_)return this.onEnd(w),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(o.shrinkBuf(S.output,S.next_out))):this.onData(o.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&w!==1);return x===4?(w=a.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===_):x!==2||(this.onEnd(_),!(S.avail_out=0))},n.prototype.onData=function(s){this.chunks.push(s)},n.prototype.onEnd=function(s){s===_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=s,this.msg=this.strm.msg},v.Deflate=n,v.deflate=c,v.deflateRaw=function(s,m){return(m=m||{}).raw=!0,c(s,m)},v.gzip=function(s,m){return(m=m||{}).gzip=!0,c(s,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(f,A,v){var a=f("./zlib/inflate"),o=f("./utils/common"),r=f("./utils/strings"),l=f("./zlib/constants"),g=f("./zlib/messages"),y=f("./zlib/zstream"),_=f("./zlib/gzheader"),b=Object.prototype.toString;function i(n){if(!(this instanceof i))return new i(n);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},n||{});var c=this.options;c.raw&&0<=c.windowBits&&c.windowBits<16&&(c.windowBits=-c.windowBits,c.windowBits===0&&(c.windowBits=-15)),!(0<=c.windowBits&&c.windowBits<16)||n&&n.windowBits||(c.windowBits+=32),15<c.windowBits&&c.windowBits<48&&!(15&c.windowBits)&&(c.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var s=a.inflateInit2(this.strm,c.windowBits);if(s!==l.Z_OK)throw new Error(g[s]);this.header=new _,a.inflateGetHeader(this.strm,this.header)}function d(n,c){var s=new i(c);if(s.push(n,!0),s.err)throw s.msg||g[s.err];return s.result}i.prototype.push=function(n,c){var s,m,w,x,S,D,E=this.strm,N=this.options.chunkSize,C=this.options.dictionary,z=!1;if(this.ended)return!1;m=c===~~c?c:c===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof n=="string"?E.input=r.binstring2buf(n):b.call(n)==="[object ArrayBuffer]"?E.input=new Uint8Array(n):E.input=n,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new o.Buf8(N),E.next_out=0,E.avail_out=N),(s=a.inflate(E,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&C&&(D=typeof C=="string"?r.string2buf(C):b.call(C)==="[object ArrayBuffer]"?new Uint8Array(C):C,s=a.inflateSetDictionary(this.strm,D)),s===l.Z_BUF_ERROR&&z===!0&&(s=l.Z_OK,z=!1),s!==l.Z_STREAM_END&&s!==l.Z_OK)return this.onEnd(s),!(this.ended=!0);E.next_out&&(E.avail_out!==0&&s!==l.Z_STREAM_END&&(E.avail_in!==0||m!==l.Z_FINISH&&m!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=r.utf8border(E.output,E.next_out),x=E.next_out-w,S=r.buf2string(E.output,w),E.next_out=x,E.avail_out=N-x,x&&o.arraySet(E.output,E.output,w,x,0),this.onData(S)):this.onData(o.shrinkBuf(E.output,E.next_out)))),E.avail_in===0&&E.avail_out===0&&(z=!0)}while((0<E.avail_in||E.avail_out===0)&&s!==l.Z_STREAM_END);return s===l.Z_STREAM_END&&(m=l.Z_FINISH),m===l.Z_FINISH?(s=a.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===l.Z_OK):m!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(E.avail_out=0))},i.prototype.onData=function(n){this.chunks.push(n)},i.prototype.onEnd=function(n){n===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},v.Inflate=i,v.inflate=d,v.inflateRaw=function(n,c){return(c=c||{}).raw=!0,d(n,c)},v.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(f,A,v){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";v.assign=function(l){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var y=g.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var _ in y)y.hasOwnProperty(_)&&(l[_]=y[_])}}return l},v.shrinkBuf=function(l,g){return l.length===g?l:l.subarray?l.subarray(0,g):(l.length=g,l)};var o={arraySet:function(l,g,y,_,b){if(g.subarray&&l.subarray)l.set(g.subarray(y,y+_),b);else for(var i=0;i<_;i++)l[b+i]=g[y+i]},flattenChunks:function(l){var g,y,_,b,i,d;for(g=_=0,y=l.length;g<y;g++)_+=l[g].length;for(d=new Uint8Array(_),g=b=0,y=l.length;g<y;g++)i=l[g],d.set(i,b),b+=i.length;return d}},r={arraySet:function(l,g,y,_,b){for(var i=0;i<_;i++)l[b+i]=g[y+i]},flattenChunks:function(l){return[].concat.apply([],l)}};v.setTyped=function(l){l?(v.Buf8=Uint8Array,v.Buf16=Uint16Array,v.Buf32=Int32Array,v.assign(v,o)):(v.Buf8=Array,v.Buf16=Array,v.Buf32=Array,v.assign(v,r))},v.setTyped(a)},{}],42:[function(f,A,v){var a=f("./common"),o=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var l=new a.Buf8(256),g=0;g<256;g++)l[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function y(_,b){if(b<65537&&(_.subarray&&r||!_.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(_,b));for(var i="",d=0;d<b;d++)i+=String.fromCharCode(_[d]);return i}l[254]=l[254]=1,v.string2buf=function(_){var b,i,d,n,c,s=_.length,m=0;for(n=0;n<s;n++)(64512&(i=_.charCodeAt(n)))==55296&&n+1<s&&(64512&(d=_.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),n++),m+=i<128?1:i<2048?2:i<65536?3:4;for(b=new a.Buf8(m),n=c=0;c<m;n++)(64512&(i=_.charCodeAt(n)))==55296&&n+1<s&&(64512&(d=_.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),n++),i<128?b[c++]=i:(i<2048?b[c++]=192|i>>>6:(i<65536?b[c++]=224|i>>>12:(b[c++]=240|i>>>18,b[c++]=128|i>>>12&63),b[c++]=128|i>>>6&63),b[c++]=128|63&i);return b},v.buf2binstring=function(_){return y(_,_.length)},v.binstring2buf=function(_){for(var b=new a.Buf8(_.length),i=0,d=b.length;i<d;i++)b[i]=_.charCodeAt(i);return b},v.buf2string=function(_,b){var i,d,n,c,s=b||_.length,m=new Array(2*s);for(i=d=0;i<s;)if((n=_[i++])<128)m[d++]=n;else if(4<(c=l[n]))m[d++]=65533,i+=c-1;else{for(n&=c===2?31:c===3?15:7;1<c&&i<s;)n=n<<6|63&_[i++],c--;1<c?m[d++]=65533:n<65536?m[d++]=n:(n-=65536,m[d++]=55296|n>>10&1023,m[d++]=56320|1023&n)}return y(m,d)},v.utf8border=function(_,b){var i;for((b=b||_.length)>_.length&&(b=_.length),i=b-1;0<=i&&(192&_[i])==128;)i--;return i<0||i===0?b:i+l[_[i]]>b?i:b}},{"./common":41}],43:[function(f,A,v){A.exports=function(a,o,r,l){for(var g=65535&a|0,y=a>>>16&65535|0,_=0;r!==0;){for(r-=_=2e3<r?2e3:r;y=y+(g=g+o[l++]|0)|0,--_;);g%=65521,y%=65521}return g|y<<16|0}},{}],44:[function(f,A,v){A.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(f,A,v){var a=function(){for(var o,r=[],l=0;l<256;l++){o=l;for(var g=0;g<8;g++)o=1&o?3988292384^o>>>1:o>>>1;r[l]=o}return r}();A.exports=function(o,r,l,g){var y=a,_=g+l;o^=-1;for(var b=g;b<_;b++)o=o>>>8^y[255&(o^r[b])];return-1^o}},{}],46:[function(f,A,v){var a,o=f("../utils/common"),r=f("./trees"),l=f("./adler32"),g=f("./crc32"),y=f("./messages"),_=0,b=4,i=0,d=-2,n=-1,c=4,s=2,m=8,w=9,x=286,S=30,D=19,E=2*x+1,N=15,C=3,z=258,X=z+C+1,h=42,T=113,e=1,F=2,V=3,U=4;function et(t,L){return t.msg=y[L],L}function M(t){return(t<<1)-(4<t?9:0)}function rt(t){for(var L=t.length;0<=--L;)t[L]=0}function B(t){var L=t.state,P=L.pending;P>t.avail_out&&(P=t.avail_out),P!==0&&(o.arraySet(t.output,L.pending_buf,L.pending_out,P,t.next_out),t.next_out+=P,L.pending_out+=P,t.total_out+=P,t.avail_out-=P,L.pending-=P,L.pending===0&&(L.pending_out=0))}function I(t,L){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,L),t.block_start=t.strstart,B(t.strm)}function Q(t,L){t.pending_buf[t.pending++]=L}function $(t,L){t.pending_buf[t.pending++]=L>>>8&255,t.pending_buf[t.pending++]=255&L}function G(t,L){var P,p,u=t.max_chain_length,k=t.strstart,j=t.prev_length,R=t.nice_match,O=t.strstart>t.w_size-X?t.strstart-(t.w_size-X):0,Z=t.window,q=t.w_mask,H=t.prev,J=t.strstart+z,st=Z[k+j-1],it=Z[k+j];t.prev_length>=t.good_match&&(u>>=2),R>t.lookahead&&(R=t.lookahead);do if(Z[(P=L)+j]===it&&Z[P+j-1]===st&&Z[P]===Z[k]&&Z[++P]===Z[k+1]){k+=2,P++;do;while(Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&k<J);if(p=z-(J-k),k=J-z,j<p){if(t.match_start=L,R<=(j=p))break;st=Z[k+j-1],it=Z[k+j]}}while((L=H[L&q])>O&&--u!=0);return j<=t.lookahead?j:t.lookahead}function ot(t){var L,P,p,u,k,j,R,O,Z,q,H=t.w_size;do{if(u=t.window_size-t.lookahead-t.strstart,t.strstart>=H+(H-X)){for(o.arraySet(t.window,t.window,H,H,0),t.match_start-=H,t.strstart-=H,t.block_start-=H,L=P=t.hash_size;p=t.head[--L],t.head[L]=H<=p?p-H:0,--P;);for(L=P=H;p=t.prev[--L],t.prev[L]=H<=p?p-H:0,--P;);u+=H}if(t.strm.avail_in===0)break;if(j=t.strm,R=t.window,O=t.strstart+t.lookahead,Z=u,q=void 0,q=j.avail_in,Z<q&&(q=Z),P=q===0?0:(j.avail_in-=q,o.arraySet(R,j.input,j.next_in,q,O),j.state.wrap===1?j.adler=l(j.adler,R,q,O):j.state.wrap===2&&(j.adler=g(j.adler,R,q,O)),j.next_in+=q,j.total_in+=q,q),t.lookahead+=P,t.lookahead+t.insert>=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<<t.hash_shift^t.window[k+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[k+C-1])&t.hash_mask,t.prev[k&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=k,k++,t.insert--,!(t.lookahead+t.insert<C)););}while(t.lookahead<X&&t.strm.avail_in!==0)}function ht(t,L){for(var P,p;;){if(t.lookahead<X){if(ot(t),t.lookahead<X&&L===_)return e;if(t.lookahead===0)break}if(P=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),P!==0&&t.strstart-P<=t.w_size-X&&(t.match_length=G(t,P)),t.match_length>=C)if(p=r._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,--t.match_length!=0;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else p=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(p&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<C-1?t.strstart:C-1,L===b?(I(t,!0),t.strm.avail_out===0?V:U):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:F}function nt(t,L){for(var P,p,u;;){if(t.lookahead<X){if(ot(t),t.lookahead<X&&L===_)return e;if(t.lookahead===0)break}if(P=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=C-1,P!==0&&t.prev_length<t.max_lazy_match&&t.strstart-P<=t.w_size-X&&(t.match_length=G(t,P),t.match_length<=5&&(t.strategy===1||t.match_length===C&&4096<t.strstart-t.match_start)&&(t.match_length=C-1)),t.prev_length>=C&&t.match_length<=t.prev_length){for(u=t.strstart+t.lookahead-C,p=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=u&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),--t.prev_length!=0;);if(t.match_available=0,t.match_length=C-1,t.strstart++,p&&(I(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((p=r._tr_tally(t,0,t.window[t.strstart-1]))&&I(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(p=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<C-1?t.strstart:C-1,L===b?(I(t,!0),t.strm.avail_out===0?V:U):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:F}function at(t,L,P,p,u){this.good_length=t,this.max_lazy=L,this.nice_length=P,this.max_chain=p,this.func=u}function ut(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*E),this.dyn_dtree=new o.Buf16(2*(2*S+1)),this.bl_tree=new o.Buf16(2*(2*D+1)),rt(this.dyn_ltree),rt(this.dyn_dtree),rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(N+1),this.heap=new o.Buf16(2*x+1),rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*x+1),rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function lt(t){var L;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=s,(L=t.state).pending=0,L.pending_out=0,L.wrap<0&&(L.wrap=-L.wrap),L.status=L.wrap?h:T,t.adler=L.wrap===2?0:1,L.last_flush=_,r._tr_init(L),i):et(t,d)}function mt(t){var L=lt(t);return L===i&&function(P){P.window_size=2*P.w_size,rt(P.head),P.max_lazy_match=a[P.level].max_lazy,P.good_match=a[P.level].good_length,P.nice_match=a[P.level].nice_length,P.max_chain_length=a[P.level].max_chain,P.strstart=0,P.block_start=0,P.lookahead=0,P.insert=0,P.match_length=P.prev_length=C-1,P.match_available=0,P.ins_h=0}(t.state),L}function pt(t,L,P,p,u,k){if(!t)return d;var j=1;if(L===n&&(L=6),p<0?(j=0,p=-p):15<p&&(j=2,p-=16),u<1||w<u||P!==m||p<8||15<p||L<0||9<L||k<0||c<k)return et(t,d);p===8&&(p=9);var R=new ut;return(t.state=R).strm=t,R.wrap=j,R.gzhead=null,R.w_bits=p,R.w_size=1<<R.w_bits,R.w_mask=R.w_size-1,R.hash_bits=u+7,R.hash_size=1<<R.hash_bits,R.hash_mask=R.hash_size-1,R.hash_shift=~~((R.hash_bits+C-1)/C),R.window=new o.Buf8(2*R.w_size),R.head=new o.Buf16(R.hash_size),R.prev=new o.Buf16(R.w_size),R.lit_bufsize=1<<u+6,R.pending_buf_size=4*R.lit_bufsize,R.pending_buf=new o.Buf8(R.pending_buf_size),R.d_buf=1*R.lit_bufsize,R.l_buf=3*R.lit_bufsize,R.level=L,R.strategy=k,R.method=P,mt(t)}a=[new at(0,0,0,0,function(t,L){var P=65535;for(P>t.pending_buf_size-5&&(P=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),t.lookahead===0&&L===_)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var p=t.block_start+P;if((t.strstart===0||t.strstart>=p)&&(t.lookahead=t.strstart-p,t.strstart=p,I(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-X&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=0,L===b?(I(t,!0),t.strm.avail_out===0?V:U):(t.strstart>t.block_start&&(I(t,!1),t.strm.avail_out),e)}),new at(4,4,8,4,ht),new at(4,5,16,8,ht),new at(4,6,32,32,ht),new at(4,4,16,16,nt),new at(8,16,32,32,nt),new at(8,16,128,128,nt),new at(8,32,128,256,nt),new at(32,128,258,1024,nt),new at(32,258,258,4096,nt)],v.deflateInit=function(t,L){return pt(t,L,m,15,8,0)},v.deflateInit2=pt,v.deflateReset=mt,v.deflateResetKeep=lt,v.deflateSetHeader=function(t,L){return t&&t.state?t.state.wrap!==2?d:(t.state.gzhead=L,i):d},v.deflate=function(t,L){var P,p,u,k;if(!t||!t.state||5<L||L<0)return t?et(t,d):d;if(p=t.state,!t.output||!t.input&&t.avail_in!==0||p.status===666&&L!==b)return et(t,t.avail_out===0?-5:d);if(p.strm=t,P=p.last_flush,p.last_flush=L,p.status===h)if(p.wrap===2)t.adler=0,Q(p,31),Q(p,139),Q(p,8),p.gzhead?(Q(p,(p.gzhead.text?1:0)+(p.gzhead.hcrc?2:0)+(p.gzhead.extra?4:0)+(p.gzhead.name?8:0)+(p.gzhead.comment?16:0)),Q(p,255&p.gzhead.time),Q(p,p.gzhead.time>>8&255),Q(p,p.gzhead.time>>16&255),Q(p,p.gzhead.time>>24&255),Q(p,p.level===9?2:2<=p.strategy||p.level<2?4:0),Q(p,255&p.gzhead.os),p.gzhead.extra&&p.gzhead.extra.length&&(Q(p,255&p.gzhead.extra.length),Q(p,p.gzhead.extra.length>>8&255)),p.gzhead.hcrc&&(t.adler=g(t.adler,p.pending_buf,p.pending,0)),p.gzindex=0,p.status=69):(Q(p,0),Q(p,0),Q(p,0),Q(p,0),Q(p,0),Q(p,p.level===9?2:2<=p.strategy||p.level<2?4:0),Q(p,3),p.status=T);else{var j=m+(p.w_bits-8<<4)<<8;j|=(2<=p.strategy||p.level<2?0:p.level<6?1:p.level===6?2:3)<<6,p.strstart!==0&&(j|=32),j+=31-j%31,p.status=T,$(p,j),p.strstart!==0&&($(p,t.adler>>>16),$(p,65535&t.adler)),t.adler=1}if(p.status===69)if(p.gzhead.extra){for(u=p.pending;p.gzindex<(65535&p.gzhead.extra.length)&&(p.pending!==p.pending_buf_size||(p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),B(t),u=p.pending,p.pending!==p.pending_buf_size));)Q(p,255&p.gzhead.extra[p.gzindex]),p.gzindex++;p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),p.gzindex===p.gzhead.extra.length&&(p.gzindex=0,p.status=73)}else p.status=73;if(p.status===73)if(p.gzhead.name){u=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),B(t),u=p.pending,p.pending===p.pending_buf_size)){k=1;break}k=p.gzindex<p.gzhead.name.length?255&p.gzhead.name.charCodeAt(p.gzindex++):0,Q(p,k)}while(k!==0);p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),k===0&&(p.gzindex=0,p.status=91)}else p.status=91;if(p.status===91)if(p.gzhead.comment){u=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),B(t),u=p.pending,p.pending===p.pending_buf_size)){k=1;break}k=p.gzindex<p.gzhead.comment.length?255&p.gzhead.comment.charCodeAt(p.gzindex++):0,Q(p,k)}while(k!==0);p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),k===0&&(p.status=103)}else p.status=103;if(p.status===103&&(p.gzhead.hcrc?(p.pending+2>p.pending_buf_size&&B(t),p.pending+2<=p.pending_buf_size&&(Q(p,255&t.adler),Q(p,t.adler>>8&255),t.adler=0,p.status=T)):p.status=T),p.pending!==0){if(B(t),t.avail_out===0)return p.last_flush=-1,i}else if(t.avail_in===0&&M(L)<=M(P)&&L!==b)return et(t,-5);if(p.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||p.lookahead!==0||L!==_&&p.status!==666){var R=p.strategy===2?function(O,Z){for(var q;;){if(O.lookahead===0&&(ot(O),O.lookahead===0)){if(Z===_)return e;break}if(O.match_length=0,q=r._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,q&&(I(O,!1),O.strm.avail_out===0))return e}return O.insert=0,Z===b?(I(O,!0),O.strm.avail_out===0?V:U):O.last_lit&&(I(O,!1),O.strm.avail_out===0)?e:F}(p,L):p.strategy===3?function(O,Z){for(var q,H,J,st,it=O.window;;){if(O.lookahead<=z){if(ot(O),O.lookahead<=z&&Z===_)return e;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=C&&0<O.strstart&&(H=it[J=O.strstart-1])===it[++J]&&H===it[++J]&&H===it[++J]){st=O.strstart+z;do;while(H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&J<st);O.match_length=z-(st-J),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=C?(q=r._tr_tally(O,1,O.match_length-C),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(q=r._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),q&&(I(O,!1),O.strm.avail_out===0))return e}return O.insert=0,Z===b?(I(O,!0),O.strm.avail_out===0?V:U):O.last_lit&&(I(O,!1),O.strm.avail_out===0)?e:F}(p,L):a[p.level].func(p,L);if(R!==V&&R!==U||(p.status=666),R===e||R===V)return t.avail_out===0&&(p.last_flush=-1),i;if(R===F&&(L===1?r._tr_align(p):L!==5&&(r._tr_stored_block(p,0,0,!1),L===3&&(rt(p.head),p.lookahead===0&&(p.strstart=0,p.block_start=0,p.insert=0))),B(t),t.avail_out===0))return p.last_flush=-1,i}return L!==b?i:p.wrap<=0?1:(p.wrap===2?(Q(p,255&t.adler),Q(p,t.adler>>8&255),Q(p,t.adler>>16&255),Q(p,t.adler>>24&255),Q(p,255&t.total_in),Q(p,t.total_in>>8&255),Q(p,t.total_in>>16&255),Q(p,t.total_in>>24&255)):($(p,t.adler>>>16),$(p,65535&t.adler)),B(t),0<p.wrap&&(p.wrap=-p.wrap),p.pending!==0?i:1)},v.deflateEnd=function(t){var L;return t&&t.state?(L=t.state.status)!==h&&L!==69&&L!==73&&L!==91&&L!==103&&L!==T&&L!==666?et(t,d):(t.state=null,L===T?et(t,-3):i):d},v.deflateSetDictionary=function(t,L){var P,p,u,k,j,R,O,Z,q=L.length;if(!t||!t.state||(k=(P=t.state).wrap)===2||k===1&&P.status!==h||P.lookahead)return d;for(k===1&&(t.adler=l(t.adler,L,q,0)),P.wrap=0,q>=P.w_size&&(k===0&&(rt(P.head),P.strstart=0,P.block_start=0,P.insert=0),Z=new o.Buf8(P.w_size),o.arraySet(Z,L,q-P.w_size,P.w_size,0),L=Z,q=P.w_size),j=t.avail_in,R=t.next_in,O=t.input,t.avail_in=q,t.next_in=0,t.input=L,ot(P);P.lookahead>=C;){for(p=P.strstart,u=P.lookahead-(C-1);P.ins_h=(P.ins_h<<P.hash_shift^P.window[p+C-1])&P.hash_mask,P.prev[p&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=p,p++,--u;);P.strstart=p,P.lookahead=C-1,ot(P)}return P.strstart+=P.lookahead,P.block_start=P.strstart,P.insert=P.lookahead,P.lookahead=0,P.match_length=P.prev_length=C-1,P.match_available=0,t.next_in=R,t.input=O,t.avail_in=j,P.wrap=k,i},v.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(f,A,v){A.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(f,A,v){A.exports=function(a,o){var r,l,g,y,_,b,i,d,n,c,s,m,w,x,S,D,E,N,C,z,X,h,T,e,F;r=a.state,l=a.next_in,e=a.input,g=l+(a.avail_in-5),y=a.next_out,F=a.output,_=y-(o-a.avail_out),b=y+(a.avail_out-257),i=r.dmax,d=r.wsize,n=r.whave,c=r.wnext,s=r.window,m=r.hold,w=r.bits,x=r.lencode,S=r.distcode,D=(1<<r.lenbits)-1,E=(1<<r.distbits)-1;t:do{w<15&&(m+=e[l++]<<w,w+=8,m+=e[l++]<<w,w+=8),N=x[m&D];e:for(;;){if(m>>>=C=N>>>24,w-=C,(C=N>>>16&255)===0)F[y++]=65535&N;else{if(!(16&C)){if(!(64&C)){N=x[(65535&N)+(m&(1<<C)-1)];continue e}if(32&C){r.mode=12;break t}a.msg="invalid literal/length code",r.mode=30;break t}z=65535&N,(C&=15)&&(w<C&&(m+=e[l++]<<w,w+=8),z+=m&(1<<C)-1,m>>>=C,w-=C),w<15&&(m+=e[l++]<<w,w+=8,m+=e[l++]<<w,w+=8),N=S[m&E];r:for(;;){if(m>>>=C=N>>>24,w-=C,!(16&(C=N>>>16&255))){if(!(64&C)){N=S[(65535&N)+(m&(1<<C)-1)];continue r}a.msg="invalid distance code",r.mode=30;break t}if(X=65535&N,w<(C&=15)&&(m+=e[l++]<<w,(w+=8)<C&&(m+=e[l++]<<w,w+=8)),i<(X+=m&(1<<C)-1)){a.msg="invalid distance too far back",r.mode=30;break t}if(m>>>=C,w-=C,(C=y-_)<X){if(n<(C=X-C)&&r.sane){a.msg="invalid distance too far back",r.mode=30;break t}if(T=s,(h=0)===c){if(h+=d-C,C<z){for(z-=C;F[y++]=s[h++],--C;);h=y-X,T=F}}else if(c<C){if(h+=d+c-C,(C-=c)<z){for(z-=C;F[y++]=s[h++],--C;);if(h=0,c<z){for(z-=C=c;F[y++]=s[h++],--C;);h=y-X,T=F}}}else if(h+=c-C,C<z){for(z-=C;F[y++]=s[h++],--C;);h=y-X,T=F}for(;2<z;)F[y++]=T[h++],F[y++]=T[h++],F[y++]=T[h++],z-=3;z&&(F[y++]=T[h++],1<z&&(F[y++]=T[h++]))}else{for(h=y-X;F[y++]=F[h++],F[y++]=F[h++],F[y++]=F[h++],2<(z-=3););z&&(F[y++]=F[h++],1<z&&(F[y++]=F[h++]))}break}}break}}while(l<g&&y<b);l-=z=w>>3,m&=(1<<(w-=z<<3))-1,a.next_in=l,a.next_out=y,a.avail_in=l<g?g-l+5:5-(l-g),a.avail_out=y<b?b-y+257:257-(y-b),r.hold=m,r.bits=w}},{}],49:[function(f,A,v){var a=f("../utils/common"),o=f("./adler32"),r=f("./crc32"),l=f("./inffast"),g=f("./inftrees"),y=1,_=2,b=0,i=-2,d=1,n=852,c=592;function s(h){return(h>>>24&255)+(h>>>8&65280)+((65280&h)<<8)+((255&h)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(h){var T;return h&&h.state?(T=h.state,h.total_in=h.total_out=T.total=0,h.msg="",T.wrap&&(h.adler=1&T.wrap),T.mode=d,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new a.Buf32(n),T.distcode=T.distdyn=new a.Buf32(c),T.sane=1,T.back=-1,b):i}function x(h){var T;return h&&h.state?((T=h.state).wsize=0,T.whave=0,T.wnext=0,w(h)):i}function S(h,T){var e,F;return h&&h.state?(F=h.state,T<0?(e=0,T=-T):(e=1+(T>>4),T<48&&(T&=15)),T&&(T<8||15<T)?i:(F.window!==null&&F.wbits!==T&&(F.window=null),F.wrap=e,F.wbits=T,x(h))):i}function D(h,T){var e,F;return h?(F=new m,(h.state=F).window=null,(e=S(h,T))!==b&&(h.state=null),e):i}var E,N,C=!0;function z(h){if(C){var T;for(E=new a.Buf32(512),N=new a.Buf32(32),T=0;T<144;)h.lens[T++]=8;for(;T<256;)h.lens[T++]=9;for(;T<280;)h.lens[T++]=7;for(;T<288;)h.lens[T++]=8;for(g(y,h.lens,0,288,E,0,h.work,{bits:9}),T=0;T<32;)h.lens[T++]=5;g(_,h.lens,0,32,N,0,h.work,{bits:5}),C=!1}h.lencode=E,h.lenbits=9,h.distcode=N,h.distbits=5}function X(h,T,e,F){var V,U=h.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new a.Buf8(U.wsize)),F>=U.wsize?(a.arraySet(U.window,T,e-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(F<(V=U.wsize-U.wnext)&&(V=F),a.arraySet(U.window,T,e-F,V,U.wnext),(F-=V)?(a.arraySet(U.window,T,e-F,F,0),U.wnext=F,U.whave=U.wsize):(U.wnext+=V,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=V))),0}v.inflateReset=x,v.inflateReset2=S,v.inflateResetKeep=w,v.inflateInit=function(h){return D(h,15)},v.inflateInit2=D,v.inflate=function(h,T){var e,F,V,U,et,M,rt,B,I,Q,$,G,ot,ht,nt,at,ut,lt,mt,pt,t,L,P,p,u=0,k=new a.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!h||!h.state||!h.output||!h.input&&h.avail_in!==0)return i;(e=h.state).mode===12&&(e.mode=13),et=h.next_out,V=h.output,rt=h.avail_out,U=h.next_in,F=h.input,M=h.avail_in,B=e.hold,I=e.bits,Q=M,$=rt,L=b;t:for(;;)switch(e.mode){case d:if(e.wrap===0){e.mode=13;break}for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(2&e.wrap&&B===35615){k[e.check=0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0),I=B=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&B)<<8)+(B>>8))%31){h.msg="incorrect header check",e.mode=30;break}if((15&B)!=8){h.msg="unknown compression method",e.mode=30;break}if(I-=4,t=8+(15&(B>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){h.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,h.adler=e.check=1,e.mode=512&B?10:12,I=B=0;break;case 2:for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(e.flags=B,(255&e.flags)!=8){h.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){h.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=B>>8&1),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0)),I=B=0,e.mode=3;case 3:for(;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.head&&(e.head.time=B),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,k[2]=B>>>16&255,k[3]=B>>>24&255,e.check=r(e.check,k,4,0)),I=B=0,e.mode=4;case 4:for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.head&&(e.head.xflags=255&B,e.head.os=B>>8),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0)),I=B=0,e.mode=5;case 5:if(1024&e.flags){for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.length=B,e.head&&(e.head.extra_len=B),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0)),I=B=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(M<(G=e.length)&&(G=M),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),a.arraySet(e.head.extra,F,U,G,t)),512&e.flags&&(e.check=r(e.check,F,G,U)),M-=G,U+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(M===0)break t;for(G=0;t=F[U+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G<M;);if(512&e.flags&&(e.check=r(e.check,F,G,U)),M-=G,U+=G,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(M===0)break t;for(G=0;t=F[U+G++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&G<M;);if(512&e.flags&&(e.check=r(e.check,F,G,U)),M-=G,U+=G,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(B!==(65535&e.check)){h.msg="header crc mismatch",e.mode=30;break}I=B=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),h.adler=e.check=0,e.mode=12;break;case 10:for(;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}h.adler=e.check=s(B),I=B=0,e.mode=11;case 11:if(e.havedict===0)return h.next_out=et,h.avail_out=rt,h.next_in=U,h.avail_in=M,e.hold=B,e.bits=I,2;h.adler=e.check=1,e.mode=12;case 12:if(T===5||T===6)break t;case 13:if(e.last){B>>>=7&I,I-=7&I,e.mode=27;break}for(;I<3;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}switch(e.last=1&B,I-=1,3&(B>>>=1)){case 0:e.mode=14;break;case 1:if(z(e),e.mode=20,T!==6)break;B>>>=2,I-=2;break t;case 2:e.mode=17;break;case 3:h.msg="invalid block type",e.mode=30}B>>>=2,I-=2;break;case 14:for(B>>>=7&I,I-=7&I;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if((65535&B)!=(B>>>16^65535)){h.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&B,I=B=0,e.mode=15,T===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(M<G&&(G=M),rt<G&&(G=rt),G===0)break t;a.arraySet(V,F,U,G,et),M-=G,U+=G,rt-=G,et+=G,e.length-=G;break}e.mode=12;break;case 17:for(;I<14;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(e.nlen=257+(31&B),B>>>=5,I-=5,e.ndist=1+(31&B),B>>>=5,I-=5,e.ncode=4+(15&B),B>>>=4,I-=4,286<e.nlen||30<e.ndist){h.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;I<3;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.lens[j[e.have++]]=7&B,B>>>=3,I-=3}for(;e.have<19;)e.lens[j[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,P={bits:e.lenbits},L=g(0,e.lens,0,19,e.lencode,0,e.work,P),e.lenbits=P.bits,L){h.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;at=(u=e.lencode[B&(1<<e.lenbits)-1])>>>16&255,ut=65535&u,!((nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(ut<16)B>>>=nt,I-=nt,e.lens[e.have++]=ut;else{if(ut===16){for(p=nt+2;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(B>>>=nt,I-=nt,e.have===0){h.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&B),B>>>=2,I-=2}else if(ut===17){for(p=nt+3;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}I-=nt,t=0,G=3+(7&(B>>>=nt)),B>>>=3,I-=3}else{for(p=nt+7;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}I-=nt,t=0,G=11+(127&(B>>>=nt)),B>>>=7,I-=7}if(e.have+G>e.nlen+e.ndist){h.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){h.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,P={bits:e.lenbits},L=g(y,e.lens,0,e.nlen,e.lencode,0,e.work,P),e.lenbits=P.bits,L){h.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,P={bits:e.distbits},L=g(_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,P),e.distbits=P.bits,L){h.msg="invalid distances set",e.mode=30;break}if(e.mode=20,T===6)break t;case 20:e.mode=21;case 21:if(6<=M&&258<=rt){h.next_out=et,h.avail_out=rt,h.next_in=U,h.avail_in=M,e.hold=B,e.bits=I,l(h,$),et=h.next_out,V=h.output,rt=h.avail_out,U=h.next_in,F=h.input,M=h.avail_in,B=e.hold,I=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;at=(u=e.lencode[B&(1<<e.lenbits)-1])>>>16&255,ut=65535&u,!((nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(at&&!(240&at)){for(lt=nt,mt=at,pt=ut;at=(u=e.lencode[pt+((B&(1<<lt+mt)-1)>>lt)])>>>16&255,ut=65535&u,!(lt+(nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}B>>>=lt,I-=lt,e.back+=lt}if(B>>>=nt,I-=nt,e.back+=nt,e.length=ut,at===0){e.mode=26;break}if(32&at){e.back=-1,e.mode=12;break}if(64&at){h.msg="invalid literal/length code",e.mode=30;break}e.extra=15&at,e.mode=22;case 22:if(e.extra){for(p=e.extra;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.length+=B&(1<<e.extra)-1,B>>>=e.extra,I-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;at=(u=e.distcode[B&(1<<e.distbits)-1])>>>16&255,ut=65535&u,!((nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(!(240&at)){for(lt=nt,mt=at,pt=ut;at=(u=e.distcode[pt+((B&(1<<lt+mt)-1)>>lt)])>>>16&255,ut=65535&u,!(lt+(nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}B>>>=lt,I-=lt,e.back+=lt}if(B>>>=nt,I-=nt,e.back+=nt,64&at){h.msg="invalid distance code",e.mode=30;break}e.offset=ut,e.extra=15&at,e.mode=24;case 24:if(e.extra){for(p=e.extra;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.offset+=B&(1<<e.extra)-1,B>>>=e.extra,I-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){h.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(rt===0)break t;if(G=$-rt,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){h.msg="invalid distance too far back",e.mode=30;break}ot=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ht=e.window}else ht=V,ot=et-e.offset,G=e.length;for(rt<G&&(G=rt),rt-=G,e.length-=G;V[et++]=ht[ot++],--G;);e.length===0&&(e.mode=21);break;case 26:if(rt===0)break t;V[et++]=e.length,rt--,e.mode=21;break;case 27:if(e.wrap){for(;I<32;){if(M===0)break t;M--,B|=F[U++]<<I,I+=8}if($-=rt,h.total_out+=$,e.total+=$,$&&(h.adler=e.check=e.flags?r(e.check,V,$,et-$):o(e.check,V,$,et-$)),$=rt,(e.flags?B:s(B))!==e.check){h.msg="incorrect data check",e.mode=30;break}I=B=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(B!==(4294967295&e.total)){h.msg="incorrect length check",e.mode=30;break}I=B=0}e.mode=29;case 29:L=1;break t;case 30:L=-3;break t;case 31:return-4;case 32:default:return i}return h.next_out=et,h.avail_out=rt,h.next_in=U,h.avail_in=M,e.hold=B,e.bits=I,(e.wsize||$!==h.avail_out&&e.mode<30&&(e.mode<27||T!==4))&&X(h,h.output,h.next_out,$-h.avail_out)?(e.mode=31,-4):(Q-=h.avail_in,$-=h.avail_out,h.total_in+=Q,h.total_out+=$,e.total+=$,e.wrap&&$&&(h.adler=e.check=e.flags?r(e.check,V,$,h.next_out-$):o(e.check,V,$,h.next_out-$)),h.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(Q==0&&$===0||T===4)&&L===b&&(L=-5),L)},v.inflateEnd=function(h){if(!h||!h.state)return i;var T=h.state;return T.window&&(T.window=null),h.state=null,b},v.inflateGetHeader=function(h,T){var e;return h&&h.state&&2&(e=h.state).wrap?((e.head=T).done=!1,b):i},v.inflateSetDictionary=function(h,T){var e,F=T.length;return h&&h.state?(e=h.state).wrap!==0&&e.mode!==11?i:e.mode===11&&o(1,T,F,0)!==e.check?-3:X(h,T,F,F)?(e.mode=31,-4):(e.havedict=1,b):i},v.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(f,A,v){var a=f("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],g=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];A.exports=function(y,_,b,i,d,n,c,s){var m,w,x,S,D,E,N,C,z,X=s.bits,h=0,T=0,e=0,F=0,V=0,U=0,et=0,M=0,rt=0,B=0,I=null,Q=0,$=new a.Buf16(16),G=new a.Buf16(16),ot=null,ht=0;for(h=0;h<=15;h++)$[h]=0;for(T=0;T<i;T++)$[_[b+T]]++;for(V=X,F=15;1<=F&&$[F]===0;F--);if(F<V&&(V=F),F===0)return d[n++]=20971520,d[n++]=20971520,s.bits=1,0;for(e=1;e<F&&$[e]===0;e++);for(V<e&&(V=e),h=M=1;h<=15;h++)if(M<<=1,(M-=$[h])<0)return-1;if(0<M&&(y===0||F!==1))return-1;for(G[1]=0,h=1;h<15;h++)G[h+1]=G[h]+$[h];for(T=0;T<i;T++)_[b+T]!==0&&(c[G[_[b+T]]++]=T);if(E=y===0?(I=ot=c,19):y===1?(I=o,Q-=257,ot=r,ht-=257,256):(I=l,ot=g,-1),h=e,D=n,et=T=B=0,x=-1,S=(rt=1<<(U=V))-1,y===1&&852<rt||y===2&&592<rt)return 1;for(;;){for(N=h-et,z=c[T]<E?(C=0,c[T]):c[T]>E?(C=ot[ht+c[T]],I[Q+c[T]]):(C=96,0),m=1<<h-et,e=w=1<<U;d[D+(B>>et)+(w-=m)]=N<<24|C<<16|z|0,w!==0;);for(m=1<<h-1;B&m;)m>>=1;if(m!==0?(B&=m-1,B+=m):B=0,T++,--$[h]==0){if(h===F)break;h=_[b+c[T]]}if(V<h&&(B&S)!==x){for(et===0&&(et=V),D+=e,M=1<<(U=h-et);U+et<F&&!((M-=$[U+et])<=0);)U++,M<<=1;if(rt+=1<<U,y===1&&852<rt||y===2&&592<rt)return 1;d[x=B&S]=V<<24|U<<16|D-n|0}}return B!==0&&(d[D+B]=h-et<<24|64<<16|0),s.bits=V,0}},{"../utils/common":41}],51:[function(f,A,v){A.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(f,A,v){var a=f("../utils/common"),o=0,r=1;function l(u){for(var k=u.length;0<=--k;)u[k]=0}var g=0,y=29,_=256,b=_+1+y,i=30,d=19,n=2*b+1,c=15,s=16,m=7,w=256,x=16,S=17,D=18,E=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],N=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=new Array(2*(b+2));l(X);var h=new Array(2*i);l(h);var T=new Array(512);l(T);var e=new Array(256);l(e);var F=new Array(y);l(F);var V,U,et,M=new Array(i);function rt(u,k,j,R,O){this.static_tree=u,this.extra_bits=k,this.extra_base=j,this.elems=R,this.max_length=O,this.has_stree=u&&u.length}function B(u,k){this.dyn_tree=u,this.max_code=0,this.stat_desc=k}function I(u){return u<256?T[u]:T[256+(u>>>7)]}function Q(u,k){u.pending_buf[u.pending++]=255&k,u.pending_buf[u.pending++]=k>>>8&255}function $(u,k,j){u.bi_valid>s-j?(u.bi_buf|=k<<u.bi_valid&65535,Q(u,u.bi_buf),u.bi_buf=k>>s-u.bi_valid,u.bi_valid+=j-s):(u.bi_buf|=k<<u.bi_valid&65535,u.bi_valid+=j)}function G(u,k,j){$(u,j[2*k],j[2*k+1])}function ot(u,k){for(var j=0;j|=1&u,u>>>=1,j<<=1,0<--k;);return j>>>1}function ht(u,k,j){var R,O,Z=new Array(c+1),q=0;for(R=1;R<=c;R++)Z[R]=q=q+j[R-1]<<1;for(O=0;O<=k;O++){var H=u[2*O+1];H!==0&&(u[2*O]=ot(Z[H]++,H))}}function nt(u){var k;for(k=0;k<b;k++)u.dyn_ltree[2*k]=0;for(k=0;k<i;k++)u.dyn_dtree[2*k]=0;for(k=0;k<d;k++)u.bl_tree[2*k]=0;u.dyn_ltree[2*w]=1,u.opt_len=u.static_len=0,u.last_lit=u.matches=0}function at(u){8<u.bi_valid?Q(u,u.bi_buf):0<u.bi_valid&&(u.pending_buf[u.pending++]=u.bi_buf),u.bi_buf=0,u.bi_valid=0}function ut(u,k,j,R){var O=2*k,Z=2*j;return u[O]<u[Z]||u[O]===u[Z]&&R[k]<=R[j]}function lt(u,k,j){for(var R=u.heap[j],O=j<<1;O<=u.heap_len&&(O<u.heap_len&&ut(k,u.heap[O+1],u.heap[O],u.depth)&&O++,!ut(k,R,u.heap[O],u.depth));)u.heap[j]=u.heap[O],j=O,O<<=1;u.heap[j]=R}function mt(u,k,j){var R,O,Z,q,H=0;if(u.last_lit!==0)for(;R=u.pending_buf[u.d_buf+2*H]<<8|u.pending_buf[u.d_buf+2*H+1],O=u.pending_buf[u.l_buf+H],H++,R===0?G(u,O,k):(G(u,(Z=e[O])+_+1,k),(q=E[Z])!==0&&$(u,O-=F[Z],q),G(u,Z=I(--R),j),(q=N[Z])!==0&&$(u,R-=M[Z],q)),H<u.last_lit;);G(u,w,k)}function pt(u,k){var j,R,O,Z=k.dyn_tree,q=k.stat_desc.static_tree,H=k.stat_desc.has_stree,J=k.stat_desc.elems,st=-1;for(u.heap_len=0,u.heap_max=n,j=0;j<J;j++)Z[2*j]!==0?(u.heap[++u.heap_len]=st=j,u.depth[j]=0):Z[2*j+1]=0;for(;u.heap_len<2;)Z[2*(O=u.heap[++u.heap_len]=st<2?++st:0)]=1,u.depth[O]=0,u.opt_len--,H&&(u.static_len-=q[2*O+1]);for(k.max_code=st,j=u.heap_len>>1;1<=j;j--)lt(u,Z,j);for(O=J;j=u.heap[1],u.heap[1]=u.heap[u.heap_len--],lt(u,Z,1),R=u.heap[1],u.heap[--u.heap_max]=j,u.heap[--u.heap_max]=R,Z[2*O]=Z[2*j]+Z[2*R],u.depth[O]=(u.depth[j]>=u.depth[R]?u.depth[j]:u.depth[R])+1,Z[2*j+1]=Z[2*R+1]=O,u.heap[1]=O++,lt(u,Z,1),2<=u.heap_len;);u.heap[--u.heap_max]=u.heap[1],function(it,dt){var wt,gt,kt,ct,zt,It,bt=dt.dyn_tree,Nt=dt.max_code,se=dt.stat_desc.static_tree,oe=dt.stat_desc.has_stree,le=dt.stat_desc.extra_bits,Lt=dt.stat_desc.extra_base,xt=dt.stat_desc.max_length,At=0;for(ct=0;ct<=c;ct++)it.bl_count[ct]=0;for(bt[2*it.heap[it.heap_max]+1]=0,wt=it.heap_max+1;wt<n;wt++)xt<(ct=bt[2*bt[2*(gt=it.heap[wt])+1]+1]+1)&&(ct=xt,At++),bt[2*gt+1]=ct,Nt<gt||(it.bl_count[ct]++,zt=0,Lt<=gt&&(zt=le[gt-Lt]),It=bt[2*gt],it.opt_len+=It*(ct+zt),oe&&(it.static_len+=It*(se[2*gt+1]+zt)));if(At!==0){do{for(ct=xt-1;it.bl_count[ct]===0;)ct--;it.bl_count[ct]--,it.bl_count[ct+1]+=2,it.bl_count[xt]--,At-=2}while(0<At);for(ct=xt;ct!==0;ct--)for(gt=it.bl_count[ct];gt!==0;)Nt<(kt=it.heap[--wt])||(bt[2*kt+1]!==ct&&(it.opt_len+=(ct-bt[2*kt+1])*bt[2*kt],bt[2*kt+1]=ct),gt--)}}(u,k),ht(Z,st,u.bl_count)}function t(u,k,j){var R,O,Z=-1,q=k[1],H=0,J=7,st=4;for(q===0&&(J=138,st=3),k[2*(j+1)+1]=65535,R=0;R<=j;R++)O=q,q=k[2*(R+1)+1],++H<J&&O===q||(H<st?u.bl_tree[2*O]+=H:O!==0?(O!==Z&&u.bl_tree[2*O]++,u.bl_tree[2*x]++):H<=10?u.bl_tree[2*S]++:u.bl_tree[2*D]++,Z=O,st=(H=0)===q?(J=138,3):O===q?(J=6,3):(J=7,4))}function L(u,k,j){var R,O,Z=-1,q=k[1],H=0,J=7,st=4;for(q===0&&(J=138,st=3),R=0;R<=j;R++)if(O=q,q=k[2*(R+1)+1],!(++H<J&&O===q)){if(H<st)for(;G(u,O,u.bl_tree),--H!=0;);else O!==0?(O!==Z&&(G(u,O,u.bl_tree),H--),G(u,x,u.bl_tree),$(u,H-3,2)):H<=10?(G(u,S,u.bl_tree),$(u,H-3,3)):(G(u,D,u.bl_tree),$(u,H-11,7));Z=O,st=(H=0)===q?(J=138,3):O===q?(J=6,3):(J=7,4)}}l(M);var P=!1;function p(u,k,j,R){$(u,(g<<1)+(R?1:0),3),function(O,Z,q,H){at(O),Q(O,q),Q(O,~q),a.arraySet(O.pending_buf,O.window,Z,q,O.pending),O.pending+=q}(u,k,j)}v._tr_init=function(u){P||(function(){var k,j,R,O,Z,q=new Array(c+1);for(O=R=0;O<y-1;O++)for(F[O]=R,k=0;k<1<<E[O];k++)e[R++]=O;for(e[R-1]=O,O=Z=0;O<16;O++)for(M[O]=Z,k=0;k<1<<N[O];k++)T[Z++]=O;for(Z>>=7;O<i;O++)for(M[O]=Z<<7,k=0;k<1<<N[O]-7;k++)T[256+Z++]=O;for(j=0;j<=c;j++)q[j]=0;for(k=0;k<=143;)X[2*k+1]=8,k++,q[8]++;for(;k<=255;)X[2*k+1]=9,k++,q[9]++;for(;k<=279;)X[2*k+1]=7,k++,q[7]++;for(;k<=287;)X[2*k+1]=8,k++,q[8]++;for(ht(X,b+1,q),k=0;k<i;k++)h[2*k+1]=5,h[2*k]=ot(k,5);V=new rt(X,E,_+1,b,c),U=new rt(h,N,0,i,c),et=new rt(new Array(0),C,0,d,m)}(),P=!0),u.l_desc=new B(u.dyn_ltree,V),u.d_desc=new B(u.dyn_dtree,U),u.bl_desc=new B(u.bl_tree,et),u.bi_buf=0,u.bi_valid=0,nt(u)},v._tr_stored_block=p,v._tr_flush_block=function(u,k,j,R){var O,Z,q=0;0<u.level?(u.strm.data_type===2&&(u.strm.data_type=function(H){var J,st=4093624447;for(J=0;J<=31;J++,st>>>=1)if(1&st&&H.dyn_ltree[2*J]!==0)return o;if(H.dyn_ltree[18]!==0||H.dyn_ltree[20]!==0||H.dyn_ltree[26]!==0)return r;for(J=32;J<_;J++)if(H.dyn_ltree[2*J]!==0)return r;return o}(u)),pt(u,u.l_desc),pt(u,u.d_desc),q=function(H){var J;for(t(H,H.dyn_ltree,H.l_desc.max_code),t(H,H.dyn_dtree,H.d_desc.max_code),pt(H,H.bl_desc),J=d-1;3<=J&&H.bl_tree[2*z[J]+1]===0;J--);return H.opt_len+=3*(J+1)+5+5+4,J}(u),O=u.opt_len+3+7>>>3,(Z=u.static_len+3+7>>>3)<=O&&(O=Z)):O=Z=j+5,j+4<=O&&k!==-1?p(u,k,j,R):u.strategy===4||Z===O?($(u,2+(R?1:0),3),mt(u,X,h)):($(u,4+(R?1:0),3),function(H,J,st,it){var dt;for($(H,J-257,5),$(H,st-1,5),$(H,it-4,4),dt=0;dt<it;dt++)$(H,H.bl_tree[2*z[dt]+1],3);L(H,H.dyn_ltree,J-1),L(H,H.dyn_dtree,st-1)}(u,u.l_desc.max_code+1,u.d_desc.max_code+1,q+1),mt(u,u.dyn_ltree,u.dyn_dtree)),nt(u),R&&at(u)},v._tr_tally=function(u,k,j){return u.pending_buf[u.d_buf+2*u.last_lit]=k>>>8&255,u.pending_buf[u.d_buf+2*u.last_lit+1]=255&k,u.pending_buf[u.l_buf+u.last_lit]=255&j,u.last_lit++,k===0?u.dyn_ltree[2*j]++:(u.matches++,k--,u.dyn_ltree[2*(e[j]+_+1)]++,u.dyn_dtree[2*I(k)]++),u.last_lit===u.lit_bufsize-1},v._tr_align=function(u){$(u,2,3),G(u,w,X),function(k){k.bi_valid===16?(Q(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(u)}},{"../utils/common":41}],53:[function(f,A,v){A.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(f,A,v){(function(a){(function(o,r){if(!o.setImmediate){var l,g,y,_,b=1,i={},d=!1,n=o.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(o);c=c&&c.setTimeout?c:o,l={}.toString.call(o.process)==="[object process]"?function(x){process.nextTick(function(){m(x)})}:function(){if(o.postMessage&&!o.importScripts){var x=!0,S=o.onmessage;return o.onmessage=function(){x=!1},o.postMessage("","*"),o.onmessage=S,x}}()?(_="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(x){o.postMessage(_+x,"*")}):o.MessageChannel?((y=new MessageChannel).port1.onmessage=function(x){m(x.data)},function(x){y.port2.postMessage(x)}):n&&"onreadystatechange"in n.createElement("script")?(g=n.documentElement,function(x){var S=n.createElement("script");S.onreadystatechange=function(){m(x),S.onreadystatechange=null,g.removeChild(S),S=null},g.appendChild(S)}):function(x){setTimeout(m,0,x)},c.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var S=new Array(arguments.length-1),D=0;D<S.length;D++)S[D]=arguments[D+1];var E={callback:x,args:S};return i[b]=E,l(b),b++},c.clearImmediate=s}function s(x){delete i[x]}function m(x){if(d)setTimeout(m,0,x);else{var S=i[x];if(S){d=!0;try{(function(D){var E=D.callback,N=D.args;switch(N.length){case 0:E();break;case 1:E(N[0]);break;case 2:E(N[0],N[1]);break;case 3:E(N[0],N[1],N[2]);break;default:E.apply(r,N)}})(S)}finally{s(x),d=!1}}}}function w(x){x.source===o&&typeof x.data=="string"&&x.data.indexOf(_)===0&&m(+x.data.slice(_.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Tt);var Rt=Tt.exports;const Wt=jt(Rt);function Mt(){const[W,Y]=tt.useState(""),[f,A]=tt.useState(!1),[v,a]=tt.useState(""),[o,r]=tt.useState(null);let l="",g="";const y=tt.useRef(null),_=tt.useRef(null),b={},i=["text/html","text/xml","application/xml","application/xhtml+xml","image/svg+xml"],d=tt.useCallback(async C=>{A(!0),Y(""),a("Loading..."),r(null),_.current&&(document.head.removeChild(_.current),URL.revokeObjectURL(_.current.href),_.current=null);try{let z;if(typeof C=="string"){const X=await fetch(C);if(!X.ok)throw new Error(`HTTP error! status: ${X.status} ${X.statusText}`);z=await X.arrayBuffer()}else C instanceof File?z=await C.arrayBuffer():z=C;if(!z||z.byteLength===0)throw new Error("EPUB source is empty or could not be read.");y.current=await Wt.loadAsync(z),await n()}catch(z){const X=z instanceof Error?z.message:"An unknown error occurred while fetching or loading the EPUB.";console.error("Error processing EPUB source:",z),r(X),Y(""),a(""),A(!1)}},[]);async function n(){if(!y.current)throw new Error("Zip not loaded");const z=y.current.file("META-INF/container.xml");if(!z)throw new Error("META-INF/container.xml not found.");const X=await z.async("text"),h=c(X);if(!h)throw new Error("OPF file path not found in container.xml.");l=h.substring(0,h.lastIndexOf("/")+1);const T=y.current.file(h);if(!T)throw new Error(`OPF file not found at path: ${h}`);const e=await T.async("text"),V=new DOMParser().parseFromString(e,"application/xml"),U=V.querySelector("parsererror");if(U)throw new Error(`Error parsing OPF file: ${U.textContent||"Unknown XML parse error"}`);s(V),await m(V)}function c(C){const h=new DOMParser().parseFromString(C,"application/xml").querySelector('rootfile[media-type="application/oebps-package+xml"]');return(h==null?void 0:h.getAttribute("full-path"))??null}function s(C){const z=C.querySelector("metadata > dc\\:title")||C.querySelector("metadata > title");a((z==null?void 0:z.textContent)||"Untitled Book")}async function m(C){if(!y.current)return;const z={};C.querySelectorAll("manifest > item").forEach(e=>{const F=e.getAttribute("id"),V=e.getAttribute("href"),U=e.getAttribute("media-type");F&&V&&U&&(z[F]={href:decodeURIComponent(V),type:U})});const X=Array.from(C.querySelectorAll("spine > itemref")).map(e=>e.getAttribute("idref"));let h="";const T=new Set;for(const e of X){if(!e)continue;const F=z[e];if(F){const V=l+F.href,U=y.current.file(V);if(U&&(F.type.includes("html")||F.type.includes("xml")))try{const et=await U.async("text"),M=await w(et,F.type);h+=`<div class="bok-chapter">${M}</div>`}catch(et){console.warn(`Failed to process spine item ${V}:`,et)}}}for(const e in z){const F=z[e];if(F.type.includes("css")){const V=l+F.href;if(!T.has(V)){const U=y.current.file(V);if(U)try{g+=await U.async("text")+`
13
- `,T.add(V)}catch(et){console.warn(`Failed to load CSS ${V}:`,et)}}}}N(),Y(h)}async function w(C,z){let X=[...C.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)].map(T=>T[1]).join(`
14
- `);X=x(X),g+=X;let h=C.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"");return h=await S(h,z),h}function x(C){const z=["background-color","color","font-size","font-family","font-weight","line-height","text-align"];return C.split(/}/).map(X=>{const h=X.split(/{/),T=h[0],e=h[1];if(!e)return"";const F=e.split(/;/).map(V=>V.trim()).filter(V=>V?!z.some(U=>new RegExp(`^${U}s*:`,"i").test(V)):!1).join("; ");return F?`${T.trim()} { ${F}; }`:""}).filter(X=>!!X).join(`
15
- `)}async function S(C,z){const X=new DOMParser;if(i.includes(z))try{const h=X.parseFromString(C,z),T=h.querySelector("parsererror");if(T)return console.warn("Parser error in content item during cleanImages, skipping.",T.textContent),C;const e=h.querySelectorAll("img");for(const et of e)await D(et);const F=h.querySelectorAll("image");for(const et of F)await E(et);return new XMLSerializer().serializeToString(h.documentElement||h)}catch(h){return console.error("Error during cleanImages DOM processing:",h),C}else return C}async function D(C){var X;let z=C.getAttribute("src");if(z){for(;z.startsWith(".")||z.startsWith("/");)z=z.slice(1);if(z=l+z,b[z]===void 0){const h=(X=y.current)==null?void 0:X.file(z);if(h)try{const T=await h.async("blob"),e=URL.createObjectURL(T);b[z]=e}catch(T){console.warn(`Could not load image blob (formatImg) ${z}:`,T),b[z]=""}else console.warn(`Image file not found in zip (formatImg): ${z}`),b[z]=""}C.setAttribute("src",b[z])}}async function E(C){var X;let z=C.getAttribute("xlink:href");if(z){for(;z.startsWith(".")||z.startsWith("/");)z=z.slice(1);if(z=l+z,b[z]===void 0){const h=(X=y.current)==null?void 0:X.file(z);if(h)try{const T=await h.async("blob"),e=URL.createObjectURL(T);b[z]=e}catch(T){console.warn(`Could not load image blob (formatXMLImage) ${z}:`,T),b[z]=""}else console.warn(`Image file not found in zip (formatXMLImage): ${z}`),b[z]=""}C.setAttribute("xlink:href",b[z])}}function N(){if(!g.trim())return;const C=new Blob([g],{type:"text/css"}),z=URL.createObjectURL(C);_.current=document.createElement("link"),_.current.href=z,_.current.rel="stylesheet",_.current.setAttribute("data-bok-reader-style","true"),document.head.appendChild(_.current)}return{title:v,rawContent:W,isLoading:f,error:o,loadEpub:d,setIsLoading:A}}function Bt(W){const[Y,f]=tt.useState({width:0,height:0,noOfPages:1});return tt.useEffect(()=>{const A=W==null?void 0:W.current,v=()=>{if(A){const a=A.getBoundingClientRect(),o=a.height<a.width;f(r=>{const l=o?a.width/2:a.width,g=a.height,y=o?2:1;return r.width!==l||r.height!==g||r.noOfPages!==y?{width:l,height:g,noOfPages:y}:r})}else f({width:0,height:0,noOfPages:1})};if(A){v();const a=new ResizeObserver(v);return a.observe(A),()=>{a.unobserve(A)}}},[W]),[Y.width,Y.height,Y.noOfPages]}function Zt(W){const[Y,f]=tt.useState(0),A=tt.useCallback(()=>{if(W.current){const v=W.current.scrollWidth,a=W.current.scrollLeft,o=v>0?a/v:0;f(o)}},[W]);return tt.useEffect(()=>{const v=W.current;if(!v)return;let a=null;const o=100,r=()=>{a&&clearTimeout(a),a=setTimeout(()=>{A()},o)};return v.addEventListener("scroll",r),A(),()=>{a&&clearTimeout(a),v.removeEventListener("scroll",r)}},[A,W]),[Y,f]}function Xt(W,Y,f,A,v){let a="";tt.useEffect(()=>{Y>1e-7&&(a=JSON.stringify({percentRead:Y,padding:f,fontSize:A,fontFamily:v}),localStorage.setItem(W,a))},[W,Y,f,A,v])}const Ht=(W,Y,f,A)=>{const[v,a]=Bt(f),o=tt.useRef(null),r=tt.useRef(""),l=tt.useCallback((g,y)=>{!Y&&!A&&(g/v<=.4&&y/a<.8&&W(-1),g/v>.4&&y/a<.8&&W(1))},[W,Y,v,a]);tt.useEffect(()=>{const g=()=>{var _;const y=(_=window.getSelection())==null?void 0:_.toString();y&&y.length>0?r.current=y:r.current=""};return document.addEventListener("selectionchange",g),()=>{document.removeEventListener("selectionchange",g)}},[]),tt.useEffect(()=>{const g=()=>{o.current=window.setTimeout(()=>{o.current=null},500)},y=_=>{if(o.current&&r.current){clearTimeout(o.current),o.current=null;const{pageX:b,pageY:i}=_.touches[0];l(b,i)}};return window.addEventListener("touchstart",g),window.addEventListener("touchend",y),()=>{window.removeEventListener("touchstart",g),window.removeEventListener("touchend",y)}},[v,l]),tt.useEffect(()=>{const g=f.current,y=()=>{o.current=window.setTimeout(()=>{},200)},_=b=>{o.current&&!r.current&&(clearTimeout(o.current),o.current=null,l(b.clientX,b.clientY))};return g==null||g.addEventListener("mousedown",y),g==null||g.addEventListener("mouseup",_),()=>{g==null||g.removeEventListener("mousedown",y),g==null||g.removeEventListener("mouseup",_)}},[v,Y,l,f])};function Gt({currentPage:W,pages:Y}){return K.jsxs("div",{className:"page-number",children:[W+1,"/",Y]})}function $t({content:W,title:Y,setIsLoading:f,fontSize:A,sidePadding:v,fontFamily:a,isOptionMenuVisible:o,setFontSize:r,setPadding:l,setFontFamily:g,containerElementRef:y,showTutorial:_}){const b=tt.useRef(null),[i,d,n]=Bt(y),[c,s]=Zt(b),[m,w]=tt.useState(1),[x,S]=tt.useState(0);Xt(Y,c,v,A,a);const D=tt.useCallback(E=>{w(N=>{const C=b.current;if(C&&x>0&&n>0&&C.clientWidth>0){let z=N+E;return z<0&&(z=0),z>=x&&(z=x-1),C.scroll({left:z*i*n,behavior:"smooth"}),z}return N})},[i,x,n]);return Ht(D,o,y,_),tt.useEffect(()=>{if(!Y)return;const E=localStorage.getItem(Y);if(E)try{const N=JSON.parse(E);N&&(s(N.percentRead||0),N.fontSize!==void 0&&r(N.fontSize),N.padding!==void 0&&l(N.padding),N.fontFamily!==void 0&&g(N.fontFamily))}catch(N){console.error("Failed to parse local storage for",Y,N),s(0)}else s(0);w(1)},[Y,s,r,l,g]),tt.useEffect(()=>{const E=b.current;if(!E||i<=0||d<=0)return;f(!0);const N=setTimeout(()=>{E.style.setProperty("--side-padding",`${v}px`),E.style.setProperty("--font-size",`${A}em`),E.style.setProperty("--font-family",a),E.style.maxHeight=`${d}px`;const C=E.scrollWidth,z=i>0&&C>0?Math.round(C/i):0,X=n===1?z:Math.round(z/2);if(S(X),X>0&&E.clientWidth>0){let h=Math.round(X*c);h=Math.max(0,Math.min(X-1,h)),m!==h&&(w(h),E.scrollLeft=h*i*n)}else f(!1),w(1);f(!1)},400);return()=>{clearTimeout(N)}},[i,d,v,A,a,n,W,Y,f]),tt.useEffect(()=>{const E=N=>{N.key==="ArrowLeft"?(N.preventDefault(),D(-1)):N.key==="ArrowRight"&&(N.preventDefault(),D(1))};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[D,i,c]),K.jsxs(K.Fragment,{children:[K.jsx("div",{ref:b,dangerouslySetInnerHTML:{__html:W},className:"book-page"}),K.jsx(Gt,{pages:x,currentPage:m})]})}var qt={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function Yt(W){if(typeof W=="number")return{value:W,unit:"px"};var Y,f=(W.match(/^[0-9.]*/)||"").toString();f.includes(".")?Y=parseFloat(f):Y=parseInt(f,10);var A=(W.match(/[^0-9]*$/)||"").toString();return qt[A]?{value:Y,unit:A}:(console.warn("React Spinners: ".concat(W," is not a valid css value. Defaulting to ").concat(Y,"px.")),{value:Y,unit:"px"})}var yt=function(W,Y,f){var A="react-spinners-".concat(W,"-").concat(f);if(typeof window>"u"||!window.document)return A;var v=document.createElement("style");document.head.appendChild(v);var a=v.sheet,o=`
11
+ */(function(W,Y){(function(h){W.exports=h()})(function(){return function h(A,v,a){function o(g,y){if(!v[g]){if(!A[g]){var _=typeof Et=="function"&&Et;if(!y&&_)return _(g,!0);if(r)return r(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=v[g]={exports:{}};A[g][0].call(i.exports,function(d){var n=A[g][1][d];return o(n||d)},i,i.exports,h,A,v,a)}return v[g].exports}for(var r=typeof Et=="function"&&Et,l=0;l<a.length;l++)o(a[l]);return o}({1:[function(h,A,v){var a=h("./utils"),o=h("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";v.encode=function(l){for(var g,y,_,b,i,d,n,c=[],s=0,m=l.length,w=m,x=a.getTypeOf(l)!=="string";s<l.length;)w=m-s,_=x?(g=l[s++],y=s<m?l[s++]:0,s<m?l[s++]:0):(g=l.charCodeAt(s++),y=s<m?l.charCodeAt(s++):0,s<m?l.charCodeAt(s++):0),b=g>>2,i=(3&g)<<4|y>>4,d=1<w?(15&y)<<2|_>>6:64,n=2<w?63&_:64,c.push(r.charAt(b)+r.charAt(i)+r.charAt(d)+r.charAt(n));return c.join("")},v.decode=function(l){var g,y,_,b,i,d,n=0,c=0,s="data:";if(l.substr(0,s.length)===s)throw new Error("Invalid base64 input, it looks like a data url.");var m,w=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===r.charAt(64)&&w--,l.charAt(l.length-2)===r.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(m=o.uint8array?new Uint8Array(0|w):new Array(0|w);n<l.length;)g=r.indexOf(l.charAt(n++))<<2|(b=r.indexOf(l.charAt(n++)))>>4,y=(15&b)<<4|(i=r.indexOf(l.charAt(n++)))>>2,_=(3&i)<<6|(d=r.indexOf(l.charAt(n++))),m[c++]=g,i!==64&&(m[c++]=y),d!==64&&(m[c++]=_);return m}},{"./support":30,"./utils":32}],2:[function(h,A,v){var a=h("./external"),o=h("./stream/DataWorker"),r=h("./stream/Crc32Probe"),l=h("./stream/DataLengthProbe");function g(y,_,b,i,d){this.compressedSize=y,this.uncompressedSize=_,this.crc32=b,this.compression=i,this.compressedContent=d}g.prototype={getContentWorker:function(){var y=new o(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),_=this;return y.on("end",function(){if(this.streamInfo.data_length!==_.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new o(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(y,_,b){return y.pipe(new r).pipe(new l("uncompressedSize")).pipe(_.compressWorker(b)).pipe(new l("compressedSize")).withStreamInfo("compression",_)},A.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(h,A,v){var a=h("./stream/GenericWorker");v.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},v.DEFLATE=h("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(h,A,v){var a=h("./utils"),o=function(){for(var r,l=[],g=0;g<256;g++){r=g;for(var y=0;y<8;y++)r=1&r?3988292384^r>>>1:r>>>1;l[g]=r}return l}();A.exports=function(r,l){return r!==void 0&&r.length?a.getTypeOf(r)!=="string"?function(g,y,_,b){var i=o,d=b+_;g^=-1;for(var n=b;n<d;n++)g=g>>>8^i[255&(g^y[n])];return-1^g}(0|l,r,r.length,0):function(g,y,_,b){var i=o,d=b+_;g^=-1;for(var n=b;n<d;n++)g=g>>>8^i[255&(g^y.charCodeAt(n))];return-1^g}(0|l,r,r.length,0):0}},{"./utils":32}],5:[function(h,A,v){v.base64=!1,v.binary=!1,v.dir=!1,v.createFolders=!0,v.date=null,v.compression=null,v.compressionOptions=null,v.comment=null,v.unixPermissions=null,v.dosPermissions=null},{}],6:[function(h,A,v){var a=null;a=typeof Promise<"u"?Promise:h("lie"),A.exports={Promise:a}},{lie:37}],7:[function(h,A,v){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=h("pako"),r=h("./utils"),l=h("./stream/GenericWorker"),g=a?"uint8array":"array";function y(_,b){l.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=b,this.meta={}}v.magic="\b\0",r.inherits(y,l),y.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(g,_.data),!1)},y.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(b){_.push({data:b,meta:_.meta})}},v.compressWorker=function(_){return new y("Deflate",_)},v.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(h,A,v){function a(i,d){var n,c="";for(n=0;n<d;n++)c+=String.fromCharCode(255&i),i>>>=8;return c}function o(i,d,n,c,s,m){var w,x,S=i.file,D=i.compression,E=m!==g.utf8encode,N=r.transformTo("string",m(S.name)),C=r.transformTo("string",g.utf8encode(S.name)),z=S.comment,X=r.transformTo("string",m(z)),f=r.transformTo("string",g.utf8encode(z)),T=C.length!==S.name.length,e=f.length!==z.length,F="",V="",U="",et=S.dir,M=S.date,rt={crc32:0,compressedSize:0,uncompressedSize:0};d&&!n||(rt.crc32=i.crc32,rt.compressedSize=i.compressedSize,rt.uncompressedSize=i.uncompressedSize);var B=0;d&&(B|=8),E||!T&&!e||(B|=2048);var I=0,Q=0;et&&(I|=16),s==="UNIX"?(Q=798,I|=function(G,ot){var ht=G;return G||(ht=ot?16893:33204),(65535&ht)<<16}(S.unixPermissions,et)):(Q=20,I|=function(G){return 63&(G||0)}(S.dosPermissions)),w=M.getUTCHours(),w<<=6,w|=M.getUTCMinutes(),w<<=5,w|=M.getUTCSeconds()/2,x=M.getUTCFullYear()-1980,x<<=4,x|=M.getUTCMonth()+1,x<<=5,x|=M.getUTCDate(),T&&(V=a(1,1)+a(y(N),4)+C,F+="up"+a(V.length,2)+V),e&&(U=a(1,1)+a(y(X),4)+f,F+="uc"+a(U.length,2)+U);var $="";return $+=`
12
+ \0`,$+=a(B,2),$+=D.magic,$+=a(w,2),$+=a(x,2),$+=a(rt.crc32,4),$+=a(rt.compressedSize,4),$+=a(rt.uncompressedSize,4),$+=a(N.length,2),$+=a(F.length,2),{fileRecord:_.LOCAL_FILE_HEADER+$+N+F,dirRecord:_.CENTRAL_FILE_HEADER+a(Q,2)+$+a(X.length,2)+"\0\0\0\0"+a(I,4)+a(c,4)+N+F+X}}var r=h("../utils"),l=h("../stream/GenericWorker"),g=h("../utf8"),y=h("../crc32"),_=h("../signature");function b(i,d,n,c){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=n,this.encodeFileName=c,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(b,l),b.prototype.push=function(i){var d=i.meta.percent||0,n=this.entriesCount,c=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,l.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:n?(d+100*(n-c-1))/n:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var d=this.streamFiles&&!i.file.dir;if(d){var n=o(i,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var d=this.streamFiles&&!i.file.dir,n=o(i,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),d)this.push({data:function(c){return _.DATA_DESCRIPTOR+a(c.crc32,4)+a(c.compressedSize,4)+a(c.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var n=this.bytesWritten-i,c=function(s,m,w,x,S){var D=r.transformTo("string",S(x));return _.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(s,2)+a(s,2)+a(m,4)+a(w,4)+a(D.length,2)+D}(this.dirRecords.length,n,i,this.zipComment,this.encodeFileName);this.push({data:c,meta:{percent:100}})},b.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},b.prototype.registerPrevious=function(i){this._sources.push(i);var d=this;return i.on("data",function(n){d.processChunk(n)}),i.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),i.on("error",function(n){d.error(n)}),this},b.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))},b.prototype.error=function(i){var d=this._sources;if(!l.prototype.error.call(this,i))return!1;for(var n=0;n<d.length;n++)try{d[n].error(i)}catch{}return!0},b.prototype.lock=function(){l.prototype.lock.call(this);for(var i=this._sources,d=0;d<i.length;d++)i[d].lock()},A.exports=b},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(h,A,v){var a=h("../compressions"),o=h("./ZipFileWorker");v.generateWorker=function(r,l,g){var y=new o(l.streamFiles,g,l.platform,l.encodeFileName),_=0;try{r.forEach(function(b,i){_++;var d=function(m,w){var x=m||w,S=a[x];if(!S)throw new Error(x+" is not a valid compression method !");return S}(i.options.compression,l.compression),n=i.options.compressionOptions||l.compressionOptions||{},c=i.dir,s=i.date;i._compressWorker(d,n).withStreamInfo("file",{name:b,dir:c,date:s,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(y)}),y.entriesCount=_}catch(b){y.error(b)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(h,A,v){function a(){if(!(this instanceof a))return new a;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 a;for(var r in this)typeof this[r]!="function"&&(o[r]=this[r]);return o}}(a.prototype=h("./object")).loadAsync=h("./load"),a.support=h("./support"),a.defaults=h("./defaults"),a.version="3.10.1",a.loadAsync=function(o,r){return new a().loadAsync(o,r)},a.external=h("./external"),A.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(h,A,v){var a=h("./utils"),o=h("./external"),r=h("./utf8"),l=h("./zipEntries"),g=h("./stream/Crc32Probe"),y=h("./nodejsUtils");function _(b){return new o.Promise(function(i,d){var n=b.decompressed.getContentWorker().pipe(new g);n.on("error",function(c){d(c)}).on("end",function(){n.streamInfo.crc32!==b.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}A.exports=function(b,i){var d=this;return i=a.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),y.isNode&&y.isStream(b)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",b,!0,i.optimizedBinaryString,i.base64).then(function(n){var c=new l(i);return c.load(n),c}).then(function(n){var c=[o.Promise.resolve(n)],s=n.files;if(i.checkCRC32)for(var m=0;m<s.length;m++)c.push(_(s[m]));return o.Promise.all(c)}).then(function(n){for(var c=n.shift(),s=c.files,m=0;m<s.length;m++){var w=s[m],x=w.fileNameStr,S=a.resolve(w.fileNameStr);d.file(S,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:i.createFolders}),w.dir||(d.file(S).unsafeOriginalName=x)}return c.zipComment.length&&(d.comment=c.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(h,A,v){var a=h("../utils"),o=h("../stream/GenericWorker");function r(l,g){o.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(g)}a.inherits(r,o),r.prototype._bindStream=function(l){var g=this;(this._stream=l).pause(),l.on("data",function(y){g.push({data:y,meta:{percent:0}})}).on("error",function(y){g.isPaused?this.generatedError=y:g.error(y)}).on("end",function(){g.isPaused?g._upstreamEnded=!0:g.end()})},r.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},A.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(h,A,v){var a=h("readable-stream").Readable;function o(r,l,g){a.call(this,l),this._helper=r;var y=this;r.on("data",function(_,b){y.push(_)||y._helper.pause(),g&&g(b)}).on("error",function(_){y.emit("error",_)}).on("end",function(){y.push(null)})}h("../utils").inherits(o,a),o.prototype._read=function(){this._helper.resume()},A.exports=o},{"../utils":32,"readable-stream":16}],14:[function(h,A,v){A.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,o);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,o)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var o=new Buffer(a);return o.fill(0),o},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(h,A,v){function a(S,D,E){var N,C=r.getTypeOf(D),z=r.extend(E||{},y);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(S=s(S)),z.createFolders&&(N=c(S))&&m.call(this,N,!0);var X=C==="string"&&z.binary===!1&&z.base64===!1;E&&E.binary!==void 0||(z.binary=!X),(D instanceof _&&D.uncompressedSize===0||z.dir||!D||D.length===0)&&(z.base64=!1,z.binary=!0,D="",z.compression="STORE",C="string");var f=null;f=D instanceof _||D instanceof l?D:d.isNode&&d.isStream(D)?new n(S,D):r.prepareContent(S,D,z.binary,z.optimizedBinaryString,z.base64);var T=new b(S,f,z);this.files[S]=T}var o=h("./utf8"),r=h("./utils"),l=h("./stream/GenericWorker"),g=h("./stream/StreamHelper"),y=h("./defaults"),_=h("./compressedObject"),b=h("./zipObject"),i=h("./generate"),d=h("./nodejsUtils"),n=h("./nodejs/NodejsStreamInputAdapter"),c=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var D=S.lastIndexOf("/");return 0<D?S.substring(0,D):""},s=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},m=function(S,D){return D=D!==void 0?D:y.createFolders,S=s(S),this.files[S]||a.call(this,S,null,{dir:!0,createFolders:D}),this.files[S]};function w(S){return Object.prototype.toString.call(S)==="[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(S){var D,E,N;for(D in this.files)N=this.files[D],(E=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&S(E,N)},filter:function(S){var D=[];return this.forEach(function(E,N){S(E,N)&&D.push(N)}),D},file:function(S,D,E){if(arguments.length!==1)return S=this.root+S,a.call(this,S,D,E),this;if(w(S)){var N=S;return this.filter(function(z,X){return!X.dir&&N.test(z)})}var C=this.files[this.root+S];return C&&!C.dir?C:null},folder:function(S){if(!S)return this;if(w(S))return this.filter(function(C,z){return z.dir&&S.test(C)});var D=this.root+S,E=m.call(this,D),N=this.clone();return N.root=E.name,N},remove:function(S){S=this.root+S;var D=this.files[S];if(D||(S.slice(-1)!=="/"&&(S+="/"),D=this.files[S]),D&&!D.dir)delete this.files[S];else for(var E=this.filter(function(C,z){return z.name.slice(0,S.length)===S}),N=0;N<E.length;N++)delete this.files[E[N].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var D,E={};try{if((E=r.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=E.type.toLowerCase(),E.compression=E.compression.toUpperCase(),E.type==="binarystring"&&(E.type="string"),!E.type)throw new Error("No output type specified.");r.checkSupport(E.type),E.platform!=="darwin"&&E.platform!=="freebsd"&&E.platform!=="linux"&&E.platform!=="sunos"||(E.platform="UNIX"),E.platform==="win32"&&(E.platform="DOS");var N=E.comment||this.comment||"";D=i.generateWorker(this,E,N)}catch(C){(D=new l("error")).error(C)}return new g(D,E.type||"string",E.mimeType)},generateAsync:function(S,D){return this.generateInternalStream(S).accumulate(D)},generateNodeStream:function(S,D){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(D)}};A.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(h,A,v){A.exports=h("stream")},{stream:void 0}],17:[function(h,A,v){var a=h("./DataReader");function o(r){a.call(this,r);for(var l=0;l<this.data.length;l++)r[l]=255&r[l]}h("../utils").inherits(o,a),o.prototype.byteAt=function(r){return this.data[this.zero+r]},o.prototype.lastIndexOfSignature=function(r){for(var l=r.charCodeAt(0),g=r.charCodeAt(1),y=r.charCodeAt(2),_=r.charCodeAt(3),b=this.length-4;0<=b;--b)if(this.data[b]===l&&this.data[b+1]===g&&this.data[b+2]===y&&this.data[b+3]===_)return b-this.zero;return-1},o.prototype.readAndCheckSignature=function(r){var l=r.charCodeAt(0),g=r.charCodeAt(1),y=r.charCodeAt(2),_=r.charCodeAt(3),b=this.readData(4);return l===b[0]&&g===b[1]&&y===b[2]&&_===b[3]},o.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./DataReader":18}],18:[function(h,A,v){var a=h("../utils");function o(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var l,g=0;for(this.checkOffset(r),l=this.index+r-1;l>=this.index;l--)g=(g<<8)+this.byteAt(l);return this.index+=r,g},readString:function(r){return a.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},A.exports=o},{"../utils":32}],19:[function(h,A,v){var a=h("./Uint8ArrayReader");function o(r){a.call(this,r)}h("../utils").inherits(o,a),o.prototype.readData=function(r){this.checkOffset(r);var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(h,A,v){var a=h("./DataReader");function o(r){a.call(this,r)}h("../utils").inherits(o,a),o.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},o.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},o.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},o.prototype.readData=function(r){this.checkOffset(r);var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./DataReader":18}],21:[function(h,A,v){var a=h("./ArrayReader");function o(r){a.call(this,r)}h("../utils").inherits(o,a),o.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},A.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(h,A,v){var a=h("../utils"),o=h("../support"),r=h("./ArrayReader"),l=h("./StringReader"),g=h("./NodeBufferReader"),y=h("./Uint8ArrayReader");A.exports=function(_){var b=a.getTypeOf(_);return a.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(_):o.uint8array?new y(a.transformTo("uint8array",_)):new r(a.transformTo("array",_)):new l(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(h,A,v){v.LOCAL_FILE_HEADER="PK",v.CENTRAL_FILE_HEADER="PK",v.CENTRAL_DIRECTORY_END="PK",v.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",v.ZIP64_CENTRAL_DIRECTORY_END="PK",v.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(h,A,v){var a=h("./GenericWorker"),o=h("../utils");function r(l){a.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(r,a),r.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},A.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(h,A,v){var a=h("./GenericWorker"),o=h("../crc32");function r(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}h("../utils").inherits(r,a),r.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},A.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(h,A,v){var a=h("../utils"),o=h("./GenericWorker");function r(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}a.inherits(r,o),r.prototype.processChunk=function(l){if(l){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+l.data.length}o.prototype.processChunk.call(this,l)},A.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(h,A,v){var a=h("../utils"),o=h("./GenericWorker");function r(l){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(y){g.dataIsReady=!0,g.data=y,g.max=y&&y.length||0,g.type=a.getTypeOf(y),g.isPaused||g._tickAndRepeat()},function(y){g.error(y)})}a.inherits(r,o),r.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,g=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,g);break;case"uint8array":l=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":l=this.data.slice(this.index,g)}return this.index=g,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},A.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(h,A,v){function a(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}a.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,r){return this._listeners[o].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,r){if(this._listeners[o])for(var l=0;l<this._listeners[o].length;l++)this._listeners[o][l].call(this,r)},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 r=this;return o.on("data",function(l){r.processChunk(l)}),o.on("end",function(){r.end()}),o.on("error",function(l){r.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,r){return this.extraStreamInfo[o]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,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}},A.exports=a},{}],29:[function(h,A,v){var a=h("../utils"),o=h("./ConvertWorker"),r=h("./GenericWorker"),l=h("../base64"),g=h("../support"),y=h("../external"),_=null;if(g.nodestream)try{_=h("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(d,n){return new y.Promise(function(c,s){var m=[],w=d._internalType,x=d._outputType,S=d._mimeType;d.on("data",function(D,E){m.push(D),n&&n(E)}).on("error",function(D){m=[],s(D)}).on("end",function(){try{var D=function(E,N,C){switch(E){case"blob":return a.newBlob(a.transformTo("arraybuffer",N),C);case"base64":return l.encode(N);default:return a.transformTo(E,N)}}(x,function(E,N){var C,z=0,X=null,f=0;for(C=0;C<N.length;C++)f+=N[C].length;switch(E){case"string":return N.join("");case"array":return Array.prototype.concat.apply([],N);case"uint8array":for(X=new Uint8Array(f),C=0;C<N.length;C++)X.set(N[C],z),z+=N[C].length;return X;case"nodebuffer":return Buffer.concat(N);default:throw new Error("concat : unsupported type '"+E+"'")}}(w,m),S);c(D)}catch(E){s(E)}m=[]}).resume()})}function i(d,n,c){var s=n;switch(n){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=n,this._mimeType=c,a.checkSupport(s),this._worker=d.pipe(new o(s)),d.lock()}catch(m){this._worker=new r("error"),this._worker.error(m)}}i.prototype={accumulate:function(d){return b(this,d)},on:function(d,n){var c=this;return d==="data"?this._worker.on(d,function(s){n.call(c,s.data,s.meta)}):this._worker.on(d,function(){a.delay(n,arguments,c)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new _(this,{objectMode:this._outputType!=="nodebuffer"},d)}},A.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(h,A,v){if(v.base64=!0,v.array=!0,v.string=!0,v.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",v.nodebuffer=typeof Buffer<"u",v.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")v.blob=!1;else{var a=new ArrayBuffer(0);try{v.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(a),v.blob=o.getBlob("application/zip").size===0}catch{v.blob=!1}}}try{v.nodestream=!!h("readable-stream").Readable}catch{v.nodestream=!1}},{"readable-stream":16}],31:[function(h,A,v){for(var a=h("./utils"),o=h("./support"),r=h("./nodejsUtils"),l=h("./stream/GenericWorker"),g=new Array(256),y=0;y<256;y++)g[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;g[254]=g[254]=1;function _(){l.call(this,"utf-8 decode"),this.leftOver=null}function b(){l.call(this,"utf-8 encode")}v.utf8encode=function(i){return o.nodebuffer?r.newBufferFrom(i,"utf-8"):function(d){var n,c,s,m,w,x=d.length,S=0;for(m=0;m<x;m++)(64512&(c=d.charCodeAt(m)))==55296&&m+1<x&&(64512&(s=d.charCodeAt(m+1)))==56320&&(c=65536+(c-55296<<10)+(s-56320),m++),S+=c<128?1:c<2048?2:c<65536?3:4;for(n=o.uint8array?new Uint8Array(S):new Array(S),m=w=0;w<S;m++)(64512&(c=d.charCodeAt(m)))==55296&&m+1<x&&(64512&(s=d.charCodeAt(m+1)))==56320&&(c=65536+(c-55296<<10)+(s-56320),m++),c<128?n[w++]=c:(c<2048?n[w++]=192|c>>>6:(c<65536?n[w++]=224|c>>>12:(n[w++]=240|c>>>18,n[w++]=128|c>>>12&63),n[w++]=128|c>>>6&63),n[w++]=128|63&c);return n}(i)},v.utf8decode=function(i){return o.nodebuffer?a.transformTo("nodebuffer",i).toString("utf-8"):function(d){var n,c,s,m,w=d.length,x=new Array(2*w);for(n=c=0;n<w;)if((s=d[n++])<128)x[c++]=s;else if(4<(m=g[s]))x[c++]=65533,n+=m-1;else{for(s&=m===2?31:m===3?15:7;1<m&&n<w;)s=s<<6|63&d[n++],m--;1<m?x[c++]=65533:s<65536?x[c++]=s:(s-=65536,x[c++]=55296|s>>10&1023,x[c++]=56320|1023&s)}return x.length!==c&&(x.subarray?x=x.subarray(0,c):x.length=c),a.applyFromCharCode(x)}(i=a.transformTo(o.uint8array?"uint8array":"array",i))},a.inherits(_,l),_.prototype.processChunk=function(i){var d=a.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var n=d;(d=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),d.set(n,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var c=function(m,w){var x;for((w=w||m.length)>m.length&&(w=m.length),x=w-1;0<=x&&(192&m[x])==128;)x--;return x<0||x===0?w:x+g[m[x]]>w?x:w}(d),s=d;c!==d.length&&(o.uint8array?(s=d.subarray(0,c),this.leftOver=d.subarray(c,d.length)):(s=d.slice(0,c),this.leftOver=d.slice(c,d.length))),this.push({data:v.utf8decode(s),meta:i.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:v.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},v.Utf8DecodeWorker=_,a.inherits(b,l),b.prototype.processChunk=function(i){this.push({data:v.utf8encode(i.data),meta:i.meta})},v.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(h,A,v){var a=h("./support"),o=h("./base64"),r=h("./nodejsUtils"),l=h("./external");function g(n){return n}function y(n,c){for(var s=0;s<n.length;++s)c[s]=255&n.charCodeAt(s);return c}h("setimmediate"),v.newBlob=function(n,c){v.checkSupport("blob");try{return new Blob([n],{type:c})}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(n),s.getBlob(c)}catch{throw new Error("Bug : can't construct the Blob.")}}};var _={stringifyByChunk:function(n,c,s){var m=[],w=0,x=n.length;if(x<=s)return String.fromCharCode.apply(null,n);for(;w<x;)c==="array"||c==="nodebuffer"?m.push(String.fromCharCode.apply(null,n.slice(w,Math.min(w+s,x)))):m.push(String.fromCharCode.apply(null,n.subarray(w,Math.min(w+s,x)))),w+=s;return m.join("")},stringifyByChar:function(n){for(var c="",s=0;s<n.length;s++)c+=String.fromCharCode(n[s]);return c},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}}()}};function b(n){var c=65536,s=v.getTypeOf(n),m=!0;if(s==="uint8array"?m=_.applyCanBeUsed.uint8array:s==="nodebuffer"&&(m=_.applyCanBeUsed.nodebuffer),m)for(;1<c;)try{return _.stringifyByChunk(n,s,c)}catch{c=Math.floor(c/2)}return _.stringifyByChar(n)}function i(n,c){for(var s=0;s<n.length;s++)c[s]=n[s];return c}v.applyFromCharCode=b;var d={};d.string={string:g,array:function(n){return y(n,new Array(n.length))},arraybuffer:function(n){return d.string.uint8array(n).buffer},uint8array:function(n){return y(n,new Uint8Array(n.length))},nodebuffer:function(n){return y(n,r.allocBuffer(n.length))}},d.array={string:b,array:g,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},d.arraybuffer={string:function(n){return b(new Uint8Array(n))},array:function(n){return i(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:g,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},d.uint8array={string:b,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:g,nodebuffer:function(n){return r.newBufferFrom(n)}},d.nodebuffer={string:b,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return d.nodebuffer.uint8array(n).buffer},uint8array:function(n){return i(n,new Uint8Array(n.length))},nodebuffer:g},v.transformTo=function(n,c){if(c=c||"",!n)return c;v.checkSupport(n);var s=v.getTypeOf(c);return d[s][n](c)},v.resolve=function(n){for(var c=n.split("/"),s=[],m=0;m<c.length;m++){var w=c[m];w==="."||w===""&&m!==0&&m!==c.length-1||(w===".."?s.pop():s.push(w))}return s.join("/")},v.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":a.nodebuffer&&r.isBuffer(n)?"nodebuffer":a.uint8array&&n instanceof Uint8Array?"uint8array":a.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},v.checkSupport=function(n){if(!a[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},v.MAX_VALUE_16BITS=65535,v.MAX_VALUE_32BITS=-1,v.pretty=function(n){var c,s,m="";for(s=0;s<(n||"").length;s++)m+="\\x"+((c=n.charCodeAt(s))<16?"0":"")+c.toString(16).toUpperCase();return m},v.delay=function(n,c,s){setImmediate(function(){n.apply(s||null,c||[])})},v.inherits=function(n,c){function s(){}s.prototype=c.prototype,n.prototype=new s},v.extend=function(){var n,c,s={};for(n=0;n<arguments.length;n++)for(c in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],c)&&s[c]===void 0&&(s[c]=arguments[n][c]);return s},v.prepareContent=function(n,c,s,m,w){return l.Promise.resolve(c).then(function(x){return a.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new l.Promise(function(S,D){var E=new FileReader;E.onload=function(N){S(N.target.result)},E.onerror=function(N){D(N.target.error)},E.readAsArrayBuffer(x)}):x}).then(function(x){var S=v.getTypeOf(x);return S?(S==="arraybuffer"?x=v.transformTo("uint8array",x):S==="string"&&(w?x=o.decode(x):s&&m!==!0&&(x=function(D){return y(D,a.uint8array?new Uint8Array(D.length):new Array(D.length))}(x))),x):l.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(h,A,v){var a=h("./reader/readerFor"),o=h("./utils"),r=h("./signature"),l=h("./zipEntry"),g=h("./support");function y(_){this.files=[],this.loadOptions=_}y.prototype={checkSignature:function(_){if(!this.reader.readAndCheckSignature(_)){this.reader.index-=4;var b=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(b)+", expected "+o.pretty(_)+")")}},isSignature:function(_,b){var i=this.reader.index;this.reader.setIndex(_);var d=this.reader.readString(4)===b;return this.reader.setIndex(i),d},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 _=this.reader.readData(this.zipCommentLength),b=g.uint8array?"uint8array":"array",i=o.transformTo(b,_);this.zipComment=this.loadOptions.decodeFileName(i)},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,i,d=this.zip64EndOfCentralSize-44;0<d;)_=this.reader.readInt(2),b=this.reader.readInt(4),i=this.reader.readData(b),this.zip64ExtensibleData[_]={id:_,length:b,value:i}},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;for(_=0;_<this.files.length;_++)b=this.files[_],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var _;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(_=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(_);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 _=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(_<0)throw this.isSignature(0,r.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(_);var b=_;if(this.checkSignature(r.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,(_=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(_),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.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(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var d=b-i;if(0<d)this.isSignature(b,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(_){this.reader=a(_)},load:function(_){this.prepareReader(_),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},A.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(h,A,v){var a=h("./reader/readerFor"),o=h("./utils"),r=h("./compressedObject"),l=h("./crc32"),g=h("./utf8"),y=h("./compressions"),_=h("./support");function b(i,d){this.options=i,this.loadOptions=d}b.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var d,n;if(i.skip(22),this.fileNameLength=i.readInt(2),n=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.skip(n),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((d=function(c){for(var s in y)if(Object.prototype.hasOwnProperty.call(y,s)&&y[s].magic===c)return y[s];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 r(this.compressedSize,this.uncompressedSize,this.crc32,d,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var d=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(d),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=a(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var d,n,c,s=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<s;)d=i.readInt(2),n=i.readInt(2),c=i.readData(n),this.extraFields[d]={id:d,length:n,value:c};i.setIndex(s)},handleUTF8:function(){var i=_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=g.utf8decode(this.fileName),this.fileCommentStr=g.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var n=o.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var c=this.findExtraFieldUnicodeComment();if(c!==null)this.fileCommentStr=c;else{var s=o.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var d=a(i.value);return d.readInt(1)!==1||l(this.fileName)!==d.readInt(4)?null:g.utf8decode(d.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var d=a(i.value);return d.readInt(1)!==1||l(this.fileComment)!==d.readInt(4)?null:g.utf8decode(d.readData(i.length-5))}return null}},A.exports=b},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(h,A,v){function a(d,n,c){this.name=d,this.dir=c.dir,this.date=c.date,this.comment=c.comment,this.unixPermissions=c.unixPermissions,this.dosPermissions=c.dosPermissions,this._data=n,this._dataBinary=c.binary,this.options={compression:c.compression,compressionOptions:c.compressionOptions}}var o=h("./stream/StreamHelper"),r=h("./stream/DataWorker"),l=h("./utf8"),g=h("./compressedObject"),y=h("./stream/GenericWorker");a.prototype={internalStream:function(d){var n=null,c="string";try{if(!d)throw new Error("No output type specified.");var s=(c=d.toLowerCase())==="string"||c==="text";c!=="binarystring"&&c!=="text"||(c="string"),n=this._decompressWorker();var m=!this._dataBinary;m&&!s&&(n=n.pipe(new l.Utf8EncodeWorker)),!m&&s&&(n=n.pipe(new l.Utf8DecodeWorker))}catch(w){(n=new y("error")).error(w)}return new o(n,c,"")},async:function(d,n){return this.internalStream(d).accumulate(n)},nodeStream:function(d,n){return this.internalStream(d||"nodebuffer").toNodejsStream(n)},_compressWorker:function(d,n){if(this._data instanceof g&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var c=this._decompressWorker();return this._dataBinary||(c=c.pipe(new l.Utf8EncodeWorker)),g.createWorkerFrom(c,d,n)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof y?this._data:new r(this._data)}};for(var _=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],b=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<_.length;i++)a.prototype[_[i]]=b;A.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(h,A,v){(function(a){var o,r,l=a.MutationObserver||a.WebKitMutationObserver;if(l){var g=0,y=new l(d),_=a.document.createTextNode("");y.observe(_,{characterData:!0}),o=function(){_.data=g=++g%2}}else if(a.setImmediate||a.MessageChannel===void 0)o="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var n=a.document.createElement("script");n.onreadystatechange=function(){d(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},a.document.documentElement.appendChild(n)}:function(){setTimeout(d,0)};else{var b=new a.MessageChannel;b.port1.onmessage=d,o=function(){b.port2.postMessage(0)}}var i=[];function d(){var n,c;r=!0;for(var s=i.length;s;){for(c=i,i=[],n=-1;++n<s;)c[n]();s=i.length}r=!1}A.exports=function(n){i.push(n)!==1||r||o()}}).call(this,typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(h,A,v){var a=h("immediate");function o(){}var r={},l=["REJECTED"],g=["FULFILLED"],y=["PENDING"];function _(s){if(typeof s!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,s!==o&&n(this,s)}function b(s,m,w){this.promise=s,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function i(s,m,w){a(function(){var x;try{x=m(w)}catch(S){return r.reject(s,S)}x===s?r.reject(s,new TypeError("Cannot resolve promise with itself")):r.resolve(s,x)})}function d(s){var m=s&&s.then;if(s&&(typeof s=="object"||typeof s=="function")&&typeof m=="function")return function(){m.apply(s,arguments)}}function n(s,m){var w=!1;function x(E){w||(w=!0,r.reject(s,E))}function S(E){w||(w=!0,r.resolve(s,E))}var D=c(function(){m(S,x)});D.status==="error"&&x(D.value)}function c(s,m){var w={};try{w.value=s(m),w.status="success"}catch(x){w.status="error",w.value=x}return w}(A.exports=_).prototype.finally=function(s){if(typeof s!="function")return this;var m=this.constructor;return this.then(function(w){return m.resolve(s()).then(function(){return w})},function(w){return m.resolve(s()).then(function(){throw w})})},_.prototype.catch=function(s){return this.then(null,s)},_.prototype.then=function(s,m){if(typeof s!="function"&&this.state===g||typeof m!="function"&&this.state===l)return this;var w=new this.constructor(o);return this.state!==y?i(w,this.state===g?s:m,this.outcome):this.queue.push(new b(w,s,m)),w},b.prototype.callFulfilled=function(s){r.resolve(this.promise,s)},b.prototype.otherCallFulfilled=function(s){i(this.promise,this.onFulfilled,s)},b.prototype.callRejected=function(s){r.reject(this.promise,s)},b.prototype.otherCallRejected=function(s){i(this.promise,this.onRejected,s)},r.resolve=function(s,m){var w=c(d,m);if(w.status==="error")return r.reject(s,w.value);var x=w.value;if(x)n(s,x);else{s.state=g,s.outcome=m;for(var S=-1,D=s.queue.length;++S<D;)s.queue[S].callFulfilled(m)}return s},r.reject=function(s,m){s.state=l,s.outcome=m;for(var w=-1,x=s.queue.length;++w<x;)s.queue[w].callRejected(m);return s},_.resolve=function(s){return s instanceof this?s:r.resolve(new this(o),s)},_.reject=function(s){var m=new this(o);return r.reject(m,s)},_.all=function(s){var m=this;if(Object.prototype.toString.call(s)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=s.length,x=!1;if(!w)return this.resolve([]);for(var S=new Array(w),D=0,E=-1,N=new this(o);++E<w;)C(s[E],E);return N;function C(z,X){m.resolve(z).then(function(f){S[X]=f,++D!==w||x||(x=!0,r.resolve(N,S))},function(f){x||(x=!0,r.reject(N,f))})}},_.race=function(s){var m=this;if(Object.prototype.toString.call(s)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=s.length,x=!1;if(!w)return this.resolve([]);for(var S=-1,D=new this(o);++S<w;)E=s[S],m.resolve(E).then(function(N){x||(x=!0,r.resolve(D,N))},function(N){x||(x=!0,r.reject(D,N))});var E;return D}},{immediate:36}],38:[function(h,A,v){var a={};(0,h("./lib/utils/common").assign)(a,h("./lib/deflate"),h("./lib/inflate"),h("./lib/zlib/constants")),A.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(h,A,v){var a=h("./zlib/deflate"),o=h("./utils/common"),r=h("./utils/strings"),l=h("./zlib/messages"),g=h("./zlib/zstream"),y=Object.prototype.toString,_=0,b=-1,i=0,d=8;function n(s){if(!(this instanceof n))return new n(s);this.options=o.assign({level:b,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:i,to:""},s||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var w=a.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(w!==_)throw new Error(l[w]);if(m.header&&a.deflateSetHeader(this.strm,m.header),m.dictionary){var x;if(x=typeof m.dictionary=="string"?r.string2buf(m.dictionary):y.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(w=a.deflateSetDictionary(this.strm,x))!==_)throw new Error(l[w]);this._dict_set=!0}}function c(s,m){var w=new n(m);if(w.push(s,!0),w.err)throw w.msg||l[w.err];return w.result}n.prototype.push=function(s,m){var w,x,S=this.strm,D=this.options.chunkSize;if(this.ended)return!1;x=m===~~m?m:m===!0?4:0,typeof s=="string"?S.input=r.string2buf(s):y.call(s)==="[object ArrayBuffer]"?S.input=new Uint8Array(s):S.input=s,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new o.Buf8(D),S.next_out=0,S.avail_out=D),(w=a.deflate(S,x))!==1&&w!==_)return this.onEnd(w),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(o.shrinkBuf(S.output,S.next_out))):this.onData(o.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&w!==1);return x===4?(w=a.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===_):x!==2||(this.onEnd(_),!(S.avail_out=0))},n.prototype.onData=function(s){this.chunks.push(s)},n.prototype.onEnd=function(s){s===_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=s,this.msg=this.strm.msg},v.Deflate=n,v.deflate=c,v.deflateRaw=function(s,m){return(m=m||{}).raw=!0,c(s,m)},v.gzip=function(s,m){return(m=m||{}).gzip=!0,c(s,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(h,A,v){var a=h("./zlib/inflate"),o=h("./utils/common"),r=h("./utils/strings"),l=h("./zlib/constants"),g=h("./zlib/messages"),y=h("./zlib/zstream"),_=h("./zlib/gzheader"),b=Object.prototype.toString;function i(n){if(!(this instanceof i))return new i(n);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},n||{});var c=this.options;c.raw&&0<=c.windowBits&&c.windowBits<16&&(c.windowBits=-c.windowBits,c.windowBits===0&&(c.windowBits=-15)),!(0<=c.windowBits&&c.windowBits<16)||n&&n.windowBits||(c.windowBits+=32),15<c.windowBits&&c.windowBits<48&&!(15&c.windowBits)&&(c.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var s=a.inflateInit2(this.strm,c.windowBits);if(s!==l.Z_OK)throw new Error(g[s]);this.header=new _,a.inflateGetHeader(this.strm,this.header)}function d(n,c){var s=new i(c);if(s.push(n,!0),s.err)throw s.msg||g[s.err];return s.result}i.prototype.push=function(n,c){var s,m,w,x,S,D,E=this.strm,N=this.options.chunkSize,C=this.options.dictionary,z=!1;if(this.ended)return!1;m=c===~~c?c:c===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof n=="string"?E.input=r.binstring2buf(n):b.call(n)==="[object ArrayBuffer]"?E.input=new Uint8Array(n):E.input=n,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new o.Buf8(N),E.next_out=0,E.avail_out=N),(s=a.inflate(E,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&C&&(D=typeof C=="string"?r.string2buf(C):b.call(C)==="[object ArrayBuffer]"?new Uint8Array(C):C,s=a.inflateSetDictionary(this.strm,D)),s===l.Z_BUF_ERROR&&z===!0&&(s=l.Z_OK,z=!1),s!==l.Z_STREAM_END&&s!==l.Z_OK)return this.onEnd(s),!(this.ended=!0);E.next_out&&(E.avail_out!==0&&s!==l.Z_STREAM_END&&(E.avail_in!==0||m!==l.Z_FINISH&&m!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=r.utf8border(E.output,E.next_out),x=E.next_out-w,S=r.buf2string(E.output,w),E.next_out=x,E.avail_out=N-x,x&&o.arraySet(E.output,E.output,w,x,0),this.onData(S)):this.onData(o.shrinkBuf(E.output,E.next_out)))),E.avail_in===0&&E.avail_out===0&&(z=!0)}while((0<E.avail_in||E.avail_out===0)&&s!==l.Z_STREAM_END);return s===l.Z_STREAM_END&&(m=l.Z_FINISH),m===l.Z_FINISH?(s=a.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===l.Z_OK):m!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(E.avail_out=0))},i.prototype.onData=function(n){this.chunks.push(n)},i.prototype.onEnd=function(n){n===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},v.Inflate=i,v.inflate=d,v.inflateRaw=function(n,c){return(c=c||{}).raw=!0,d(n,c)},v.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(h,A,v){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";v.assign=function(l){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var y=g.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var _ in y)y.hasOwnProperty(_)&&(l[_]=y[_])}}return l},v.shrinkBuf=function(l,g){return l.length===g?l:l.subarray?l.subarray(0,g):(l.length=g,l)};var o={arraySet:function(l,g,y,_,b){if(g.subarray&&l.subarray)l.set(g.subarray(y,y+_),b);else for(var i=0;i<_;i++)l[b+i]=g[y+i]},flattenChunks:function(l){var g,y,_,b,i,d;for(g=_=0,y=l.length;g<y;g++)_+=l[g].length;for(d=new Uint8Array(_),g=b=0,y=l.length;g<y;g++)i=l[g],d.set(i,b),b+=i.length;return d}},r={arraySet:function(l,g,y,_,b){for(var i=0;i<_;i++)l[b+i]=g[y+i]},flattenChunks:function(l){return[].concat.apply([],l)}};v.setTyped=function(l){l?(v.Buf8=Uint8Array,v.Buf16=Uint16Array,v.Buf32=Int32Array,v.assign(v,o)):(v.Buf8=Array,v.Buf16=Array,v.Buf32=Array,v.assign(v,r))},v.setTyped(a)},{}],42:[function(h,A,v){var a=h("./common"),o=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var l=new a.Buf8(256),g=0;g<256;g++)l[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function y(_,b){if(b<65537&&(_.subarray&&r||!_.subarray&&o))return String.fromCharCode.apply(null,a.shrinkBuf(_,b));for(var i="",d=0;d<b;d++)i+=String.fromCharCode(_[d]);return i}l[254]=l[254]=1,v.string2buf=function(_){var b,i,d,n,c,s=_.length,m=0;for(n=0;n<s;n++)(64512&(i=_.charCodeAt(n)))==55296&&n+1<s&&(64512&(d=_.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),n++),m+=i<128?1:i<2048?2:i<65536?3:4;for(b=new a.Buf8(m),n=c=0;c<m;n++)(64512&(i=_.charCodeAt(n)))==55296&&n+1<s&&(64512&(d=_.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),n++),i<128?b[c++]=i:(i<2048?b[c++]=192|i>>>6:(i<65536?b[c++]=224|i>>>12:(b[c++]=240|i>>>18,b[c++]=128|i>>>12&63),b[c++]=128|i>>>6&63),b[c++]=128|63&i);return b},v.buf2binstring=function(_){return y(_,_.length)},v.binstring2buf=function(_){for(var b=new a.Buf8(_.length),i=0,d=b.length;i<d;i++)b[i]=_.charCodeAt(i);return b},v.buf2string=function(_,b){var i,d,n,c,s=b||_.length,m=new Array(2*s);for(i=d=0;i<s;)if((n=_[i++])<128)m[d++]=n;else if(4<(c=l[n]))m[d++]=65533,i+=c-1;else{for(n&=c===2?31:c===3?15:7;1<c&&i<s;)n=n<<6|63&_[i++],c--;1<c?m[d++]=65533:n<65536?m[d++]=n:(n-=65536,m[d++]=55296|n>>10&1023,m[d++]=56320|1023&n)}return y(m,d)},v.utf8border=function(_,b){var i;for((b=b||_.length)>_.length&&(b=_.length),i=b-1;0<=i&&(192&_[i])==128;)i--;return i<0||i===0?b:i+l[_[i]]>b?i:b}},{"./common":41}],43:[function(h,A,v){A.exports=function(a,o,r,l){for(var g=65535&a|0,y=a>>>16&65535|0,_=0;r!==0;){for(r-=_=2e3<r?2e3:r;y=y+(g=g+o[l++]|0)|0,--_;);g%=65521,y%=65521}return g|y<<16|0}},{}],44:[function(h,A,v){A.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(h,A,v){var a=function(){for(var o,r=[],l=0;l<256;l++){o=l;for(var g=0;g<8;g++)o=1&o?3988292384^o>>>1:o>>>1;r[l]=o}return r}();A.exports=function(o,r,l,g){var y=a,_=g+l;o^=-1;for(var b=g;b<_;b++)o=o>>>8^y[255&(o^r[b])];return-1^o}},{}],46:[function(h,A,v){var a,o=h("../utils/common"),r=h("./trees"),l=h("./adler32"),g=h("./crc32"),y=h("./messages"),_=0,b=4,i=0,d=-2,n=-1,c=4,s=2,m=8,w=9,x=286,S=30,D=19,E=2*x+1,N=15,C=3,z=258,X=z+C+1,f=42,T=113,e=1,F=2,V=3,U=4;function et(t,L){return t.msg=y[L],L}function M(t){return(t<<1)-(4<t?9:0)}function rt(t){for(var L=t.length;0<=--L;)t[L]=0}function B(t){var L=t.state,P=L.pending;P>t.avail_out&&(P=t.avail_out),P!==0&&(o.arraySet(t.output,L.pending_buf,L.pending_out,P,t.next_out),t.next_out+=P,L.pending_out+=P,t.total_out+=P,t.avail_out-=P,L.pending-=P,L.pending===0&&(L.pending_out=0))}function I(t,L){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,L),t.block_start=t.strstart,B(t.strm)}function Q(t,L){t.pending_buf[t.pending++]=L}function $(t,L){t.pending_buf[t.pending++]=L>>>8&255,t.pending_buf[t.pending++]=255&L}function G(t,L){var P,p,u=t.max_chain_length,k=t.strstart,j=t.prev_length,R=t.nice_match,O=t.strstart>t.w_size-X?t.strstart-(t.w_size-X):0,Z=t.window,q=t.w_mask,H=t.prev,J=t.strstart+z,st=Z[k+j-1],it=Z[k+j];t.prev_length>=t.good_match&&(u>>=2),R>t.lookahead&&(R=t.lookahead);do if(Z[(P=L)+j]===it&&Z[P+j-1]===st&&Z[P]===Z[k]&&Z[++P]===Z[k+1]){k+=2,P++;do;while(Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&Z[++k]===Z[++P]&&k<J);if(p=z-(J-k),k=J-z,j<p){if(t.match_start=L,R<=(j=p))break;st=Z[k+j-1],it=Z[k+j]}}while((L=H[L&q])>O&&--u!=0);return j<=t.lookahead?j:t.lookahead}function ot(t){var L,P,p,u,k,j,R,O,Z,q,H=t.w_size;do{if(u=t.window_size-t.lookahead-t.strstart,t.strstart>=H+(H-X)){for(o.arraySet(t.window,t.window,H,H,0),t.match_start-=H,t.strstart-=H,t.block_start-=H,L=P=t.hash_size;p=t.head[--L],t.head[L]=H<=p?p-H:0,--P;);for(L=P=H;p=t.prev[--L],t.prev[L]=H<=p?p-H:0,--P;);u+=H}if(t.strm.avail_in===0)break;if(j=t.strm,R=t.window,O=t.strstart+t.lookahead,Z=u,q=void 0,q=j.avail_in,Z<q&&(q=Z),P=q===0?0:(j.avail_in-=q,o.arraySet(R,j.input,j.next_in,q,O),j.state.wrap===1?j.adler=l(j.adler,R,q,O):j.state.wrap===2&&(j.adler=g(j.adler,R,q,O)),j.next_in+=q,j.total_in+=q,q),t.lookahead+=P,t.lookahead+t.insert>=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<<t.hash_shift^t.window[k+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[k+C-1])&t.hash_mask,t.prev[k&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=k,k++,t.insert--,!(t.lookahead+t.insert<C)););}while(t.lookahead<X&&t.strm.avail_in!==0)}function ht(t,L){for(var P,p;;){if(t.lookahead<X){if(ot(t),t.lookahead<X&&L===_)return e;if(t.lookahead===0)break}if(P=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),P!==0&&t.strstart-P<=t.w_size-X&&(t.match_length=G(t,P)),t.match_length>=C)if(p=r._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,--t.match_length!=0;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else p=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(p&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<C-1?t.strstart:C-1,L===b?(I(t,!0),t.strm.avail_out===0?V:U):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:F}function nt(t,L){for(var P,p,u;;){if(t.lookahead<X){if(ot(t),t.lookahead<X&&L===_)return e;if(t.lookahead===0)break}if(P=0,t.lookahead>=C&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=C-1,P!==0&&t.prev_length<t.max_lazy_match&&t.strstart-P<=t.w_size-X&&(t.match_length=G(t,P),t.match_length<=5&&(t.strategy===1||t.match_length===C&&4096<t.strstart-t.match_start)&&(t.match_length=C-1)),t.prev_length>=C&&t.match_length<=t.prev_length){for(u=t.strstart+t.lookahead-C,p=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=u&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+C-1])&t.hash_mask,P=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),--t.prev_length!=0;);if(t.match_available=0,t.match_length=C-1,t.strstart++,p&&(I(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((p=r._tr_tally(t,0,t.window[t.strstart-1]))&&I(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(p=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<C-1?t.strstart:C-1,L===b?(I(t,!0),t.strm.avail_out===0?V:U):t.last_lit&&(I(t,!1),t.strm.avail_out===0)?e:F}function at(t,L,P,p,u){this.good_length=t,this.max_lazy=L,this.nice_length=P,this.max_chain=p,this.func=u}function ut(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*E),this.dyn_dtree=new o.Buf16(2*(2*S+1)),this.bl_tree=new o.Buf16(2*(2*D+1)),rt(this.dyn_ltree),rt(this.dyn_dtree),rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(N+1),this.heap=new o.Buf16(2*x+1),rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*x+1),rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function lt(t){var L;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=s,(L=t.state).pending=0,L.pending_out=0,L.wrap<0&&(L.wrap=-L.wrap),L.status=L.wrap?f:T,t.adler=L.wrap===2?0:1,L.last_flush=_,r._tr_init(L),i):et(t,d)}function mt(t){var L=lt(t);return L===i&&function(P){P.window_size=2*P.w_size,rt(P.head),P.max_lazy_match=a[P.level].max_lazy,P.good_match=a[P.level].good_length,P.nice_match=a[P.level].nice_length,P.max_chain_length=a[P.level].max_chain,P.strstart=0,P.block_start=0,P.lookahead=0,P.insert=0,P.match_length=P.prev_length=C-1,P.match_available=0,P.ins_h=0}(t.state),L}function pt(t,L,P,p,u,k){if(!t)return d;var j=1;if(L===n&&(L=6),p<0?(j=0,p=-p):15<p&&(j=2,p-=16),u<1||w<u||P!==m||p<8||15<p||L<0||9<L||k<0||c<k)return et(t,d);p===8&&(p=9);var R=new ut;return(t.state=R).strm=t,R.wrap=j,R.gzhead=null,R.w_bits=p,R.w_size=1<<R.w_bits,R.w_mask=R.w_size-1,R.hash_bits=u+7,R.hash_size=1<<R.hash_bits,R.hash_mask=R.hash_size-1,R.hash_shift=~~((R.hash_bits+C-1)/C),R.window=new o.Buf8(2*R.w_size),R.head=new o.Buf16(R.hash_size),R.prev=new o.Buf16(R.w_size),R.lit_bufsize=1<<u+6,R.pending_buf_size=4*R.lit_bufsize,R.pending_buf=new o.Buf8(R.pending_buf_size),R.d_buf=1*R.lit_bufsize,R.l_buf=3*R.lit_bufsize,R.level=L,R.strategy=k,R.method=P,mt(t)}a=[new at(0,0,0,0,function(t,L){var P=65535;for(P>t.pending_buf_size-5&&(P=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),t.lookahead===0&&L===_)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var p=t.block_start+P;if((t.strstart===0||t.strstart>=p)&&(t.lookahead=t.strstart-p,t.strstart=p,I(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-X&&(I(t,!1),t.strm.avail_out===0))return e}return t.insert=0,L===b?(I(t,!0),t.strm.avail_out===0?V:U):(t.strstart>t.block_start&&(I(t,!1),t.strm.avail_out),e)}),new at(4,4,8,4,ht),new at(4,5,16,8,ht),new at(4,6,32,32,ht),new at(4,4,16,16,nt),new at(8,16,32,32,nt),new at(8,16,128,128,nt),new at(8,32,128,256,nt),new at(32,128,258,1024,nt),new at(32,258,258,4096,nt)],v.deflateInit=function(t,L){return pt(t,L,m,15,8,0)},v.deflateInit2=pt,v.deflateReset=mt,v.deflateResetKeep=lt,v.deflateSetHeader=function(t,L){return t&&t.state?t.state.wrap!==2?d:(t.state.gzhead=L,i):d},v.deflate=function(t,L){var P,p,u,k;if(!t||!t.state||5<L||L<0)return t?et(t,d):d;if(p=t.state,!t.output||!t.input&&t.avail_in!==0||p.status===666&&L!==b)return et(t,t.avail_out===0?-5:d);if(p.strm=t,P=p.last_flush,p.last_flush=L,p.status===f)if(p.wrap===2)t.adler=0,Q(p,31),Q(p,139),Q(p,8),p.gzhead?(Q(p,(p.gzhead.text?1:0)+(p.gzhead.hcrc?2:0)+(p.gzhead.extra?4:0)+(p.gzhead.name?8:0)+(p.gzhead.comment?16:0)),Q(p,255&p.gzhead.time),Q(p,p.gzhead.time>>8&255),Q(p,p.gzhead.time>>16&255),Q(p,p.gzhead.time>>24&255),Q(p,p.level===9?2:2<=p.strategy||p.level<2?4:0),Q(p,255&p.gzhead.os),p.gzhead.extra&&p.gzhead.extra.length&&(Q(p,255&p.gzhead.extra.length),Q(p,p.gzhead.extra.length>>8&255)),p.gzhead.hcrc&&(t.adler=g(t.adler,p.pending_buf,p.pending,0)),p.gzindex=0,p.status=69):(Q(p,0),Q(p,0),Q(p,0),Q(p,0),Q(p,0),Q(p,p.level===9?2:2<=p.strategy||p.level<2?4:0),Q(p,3),p.status=T);else{var j=m+(p.w_bits-8<<4)<<8;j|=(2<=p.strategy||p.level<2?0:p.level<6?1:p.level===6?2:3)<<6,p.strstart!==0&&(j|=32),j+=31-j%31,p.status=T,$(p,j),p.strstart!==0&&($(p,t.adler>>>16),$(p,65535&t.adler)),t.adler=1}if(p.status===69)if(p.gzhead.extra){for(u=p.pending;p.gzindex<(65535&p.gzhead.extra.length)&&(p.pending!==p.pending_buf_size||(p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),B(t),u=p.pending,p.pending!==p.pending_buf_size));)Q(p,255&p.gzhead.extra[p.gzindex]),p.gzindex++;p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),p.gzindex===p.gzhead.extra.length&&(p.gzindex=0,p.status=73)}else p.status=73;if(p.status===73)if(p.gzhead.name){u=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),B(t),u=p.pending,p.pending===p.pending_buf_size)){k=1;break}k=p.gzindex<p.gzhead.name.length?255&p.gzhead.name.charCodeAt(p.gzindex++):0,Q(p,k)}while(k!==0);p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),k===0&&(p.gzindex=0,p.status=91)}else p.status=91;if(p.status===91)if(p.gzhead.comment){u=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),B(t),u=p.pending,p.pending===p.pending_buf_size)){k=1;break}k=p.gzindex<p.gzhead.comment.length?255&p.gzhead.comment.charCodeAt(p.gzindex++):0,Q(p,k)}while(k!==0);p.gzhead.hcrc&&p.pending>u&&(t.adler=g(t.adler,p.pending_buf,p.pending-u,u)),k===0&&(p.status=103)}else p.status=103;if(p.status===103&&(p.gzhead.hcrc?(p.pending+2>p.pending_buf_size&&B(t),p.pending+2<=p.pending_buf_size&&(Q(p,255&t.adler),Q(p,t.adler>>8&255),t.adler=0,p.status=T)):p.status=T),p.pending!==0){if(B(t),t.avail_out===0)return p.last_flush=-1,i}else if(t.avail_in===0&&M(L)<=M(P)&&L!==b)return et(t,-5);if(p.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||p.lookahead!==0||L!==_&&p.status!==666){var R=p.strategy===2?function(O,Z){for(var q;;){if(O.lookahead===0&&(ot(O),O.lookahead===0)){if(Z===_)return e;break}if(O.match_length=0,q=r._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,q&&(I(O,!1),O.strm.avail_out===0))return e}return O.insert=0,Z===b?(I(O,!0),O.strm.avail_out===0?V:U):O.last_lit&&(I(O,!1),O.strm.avail_out===0)?e:F}(p,L):p.strategy===3?function(O,Z){for(var q,H,J,st,it=O.window;;){if(O.lookahead<=z){if(ot(O),O.lookahead<=z&&Z===_)return e;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=C&&0<O.strstart&&(H=it[J=O.strstart-1])===it[++J]&&H===it[++J]&&H===it[++J]){st=O.strstart+z;do;while(H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&H===it[++J]&&J<st);O.match_length=z-(st-J),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=C?(q=r._tr_tally(O,1,O.match_length-C),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(q=r._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),q&&(I(O,!1),O.strm.avail_out===0))return e}return O.insert=0,Z===b?(I(O,!0),O.strm.avail_out===0?V:U):O.last_lit&&(I(O,!1),O.strm.avail_out===0)?e:F}(p,L):a[p.level].func(p,L);if(R!==V&&R!==U||(p.status=666),R===e||R===V)return t.avail_out===0&&(p.last_flush=-1),i;if(R===F&&(L===1?r._tr_align(p):L!==5&&(r._tr_stored_block(p,0,0,!1),L===3&&(rt(p.head),p.lookahead===0&&(p.strstart=0,p.block_start=0,p.insert=0))),B(t),t.avail_out===0))return p.last_flush=-1,i}return L!==b?i:p.wrap<=0?1:(p.wrap===2?(Q(p,255&t.adler),Q(p,t.adler>>8&255),Q(p,t.adler>>16&255),Q(p,t.adler>>24&255),Q(p,255&t.total_in),Q(p,t.total_in>>8&255),Q(p,t.total_in>>16&255),Q(p,t.total_in>>24&255)):($(p,t.adler>>>16),$(p,65535&t.adler)),B(t),0<p.wrap&&(p.wrap=-p.wrap),p.pending!==0?i:1)},v.deflateEnd=function(t){var L;return t&&t.state?(L=t.state.status)!==f&&L!==69&&L!==73&&L!==91&&L!==103&&L!==T&&L!==666?et(t,d):(t.state=null,L===T?et(t,-3):i):d},v.deflateSetDictionary=function(t,L){var P,p,u,k,j,R,O,Z,q=L.length;if(!t||!t.state||(k=(P=t.state).wrap)===2||k===1&&P.status!==f||P.lookahead)return d;for(k===1&&(t.adler=l(t.adler,L,q,0)),P.wrap=0,q>=P.w_size&&(k===0&&(rt(P.head),P.strstart=0,P.block_start=0,P.insert=0),Z=new o.Buf8(P.w_size),o.arraySet(Z,L,q-P.w_size,P.w_size,0),L=Z,q=P.w_size),j=t.avail_in,R=t.next_in,O=t.input,t.avail_in=q,t.next_in=0,t.input=L,ot(P);P.lookahead>=C;){for(p=P.strstart,u=P.lookahead-(C-1);P.ins_h=(P.ins_h<<P.hash_shift^P.window[p+C-1])&P.hash_mask,P.prev[p&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=p,p++,--u;);P.strstart=p,P.lookahead=C-1,ot(P)}return P.strstart+=P.lookahead,P.block_start=P.strstart,P.insert=P.lookahead,P.lookahead=0,P.match_length=P.prev_length=C-1,P.match_available=0,t.next_in=R,t.input=O,t.avail_in=j,P.wrap=k,i},v.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(h,A,v){A.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(h,A,v){A.exports=function(a,o){var r,l,g,y,_,b,i,d,n,c,s,m,w,x,S,D,E,N,C,z,X,f,T,e,F;r=a.state,l=a.next_in,e=a.input,g=l+(a.avail_in-5),y=a.next_out,F=a.output,_=y-(o-a.avail_out),b=y+(a.avail_out-257),i=r.dmax,d=r.wsize,n=r.whave,c=r.wnext,s=r.window,m=r.hold,w=r.bits,x=r.lencode,S=r.distcode,D=(1<<r.lenbits)-1,E=(1<<r.distbits)-1;t:do{w<15&&(m+=e[l++]<<w,w+=8,m+=e[l++]<<w,w+=8),N=x[m&D];e:for(;;){if(m>>>=C=N>>>24,w-=C,(C=N>>>16&255)===0)F[y++]=65535&N;else{if(!(16&C)){if(!(64&C)){N=x[(65535&N)+(m&(1<<C)-1)];continue e}if(32&C){r.mode=12;break t}a.msg="invalid literal/length code",r.mode=30;break t}z=65535&N,(C&=15)&&(w<C&&(m+=e[l++]<<w,w+=8),z+=m&(1<<C)-1,m>>>=C,w-=C),w<15&&(m+=e[l++]<<w,w+=8,m+=e[l++]<<w,w+=8),N=S[m&E];r:for(;;){if(m>>>=C=N>>>24,w-=C,!(16&(C=N>>>16&255))){if(!(64&C)){N=S[(65535&N)+(m&(1<<C)-1)];continue r}a.msg="invalid distance code",r.mode=30;break t}if(X=65535&N,w<(C&=15)&&(m+=e[l++]<<w,(w+=8)<C&&(m+=e[l++]<<w,w+=8)),i<(X+=m&(1<<C)-1)){a.msg="invalid distance too far back",r.mode=30;break t}if(m>>>=C,w-=C,(C=y-_)<X){if(n<(C=X-C)&&r.sane){a.msg="invalid distance too far back",r.mode=30;break t}if(T=s,(f=0)===c){if(f+=d-C,C<z){for(z-=C;F[y++]=s[f++],--C;);f=y-X,T=F}}else if(c<C){if(f+=d+c-C,(C-=c)<z){for(z-=C;F[y++]=s[f++],--C;);if(f=0,c<z){for(z-=C=c;F[y++]=s[f++],--C;);f=y-X,T=F}}}else if(f+=c-C,C<z){for(z-=C;F[y++]=s[f++],--C;);f=y-X,T=F}for(;2<z;)F[y++]=T[f++],F[y++]=T[f++],F[y++]=T[f++],z-=3;z&&(F[y++]=T[f++],1<z&&(F[y++]=T[f++]))}else{for(f=y-X;F[y++]=F[f++],F[y++]=F[f++],F[y++]=F[f++],2<(z-=3););z&&(F[y++]=F[f++],1<z&&(F[y++]=F[f++]))}break}}break}}while(l<g&&y<b);l-=z=w>>3,m&=(1<<(w-=z<<3))-1,a.next_in=l,a.next_out=y,a.avail_in=l<g?g-l+5:5-(l-g),a.avail_out=y<b?b-y+257:257-(y-b),r.hold=m,r.bits=w}},{}],49:[function(h,A,v){var a=h("../utils/common"),o=h("./adler32"),r=h("./crc32"),l=h("./inffast"),g=h("./inftrees"),y=1,_=2,b=0,i=-2,d=1,n=852,c=592;function s(f){return(f>>>24&255)+(f>>>8&65280)+((65280&f)<<8)+((255&f)<<24)}function m(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(f){var T;return f&&f.state?(T=f.state,f.total_in=f.total_out=T.total=0,f.msg="",T.wrap&&(f.adler=1&T.wrap),T.mode=d,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new a.Buf32(n),T.distcode=T.distdyn=new a.Buf32(c),T.sane=1,T.back=-1,b):i}function x(f){var T;return f&&f.state?((T=f.state).wsize=0,T.whave=0,T.wnext=0,w(f)):i}function S(f,T){var e,F;return f&&f.state?(F=f.state,T<0?(e=0,T=-T):(e=1+(T>>4),T<48&&(T&=15)),T&&(T<8||15<T)?i:(F.window!==null&&F.wbits!==T&&(F.window=null),F.wrap=e,F.wbits=T,x(f))):i}function D(f,T){var e,F;return f?(F=new m,(f.state=F).window=null,(e=S(f,T))!==b&&(f.state=null),e):i}var E,N,C=!0;function z(f){if(C){var T;for(E=new a.Buf32(512),N=new a.Buf32(32),T=0;T<144;)f.lens[T++]=8;for(;T<256;)f.lens[T++]=9;for(;T<280;)f.lens[T++]=7;for(;T<288;)f.lens[T++]=8;for(g(y,f.lens,0,288,E,0,f.work,{bits:9}),T=0;T<32;)f.lens[T++]=5;g(_,f.lens,0,32,N,0,f.work,{bits:5}),C=!1}f.lencode=E,f.lenbits=9,f.distcode=N,f.distbits=5}function X(f,T,e,F){var V,U=f.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new a.Buf8(U.wsize)),F>=U.wsize?(a.arraySet(U.window,T,e-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(F<(V=U.wsize-U.wnext)&&(V=F),a.arraySet(U.window,T,e-F,V,U.wnext),(F-=V)?(a.arraySet(U.window,T,e-F,F,0),U.wnext=F,U.whave=U.wsize):(U.wnext+=V,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=V))),0}v.inflateReset=x,v.inflateReset2=S,v.inflateResetKeep=w,v.inflateInit=function(f){return D(f,15)},v.inflateInit2=D,v.inflate=function(f,T){var e,F,V,U,et,M,rt,B,I,Q,$,G,ot,ht,nt,at,ut,lt,mt,pt,t,L,P,p,u=0,k=new a.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!f||!f.state||!f.output||!f.input&&f.avail_in!==0)return i;(e=f.state).mode===12&&(e.mode=13),et=f.next_out,V=f.output,rt=f.avail_out,U=f.next_in,F=f.input,M=f.avail_in,B=e.hold,I=e.bits,Q=M,$=rt,L=b;t:for(;;)switch(e.mode){case d:if(e.wrap===0){e.mode=13;break}for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(2&e.wrap&&B===35615){k[e.check=0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0),I=B=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&B)<<8)+(B>>8))%31){f.msg="incorrect header check",e.mode=30;break}if((15&B)!=8){f.msg="unknown compression method",e.mode=30;break}if(I-=4,t=8+(15&(B>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){f.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,f.adler=e.check=1,e.mode=512&B?10:12,I=B=0;break;case 2:for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(e.flags=B,(255&e.flags)!=8){f.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){f.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=B>>8&1),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0)),I=B=0,e.mode=3;case 3:for(;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.head&&(e.head.time=B),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,k[2]=B>>>16&255,k[3]=B>>>24&255,e.check=r(e.check,k,4,0)),I=B=0,e.mode=4;case 4:for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.head&&(e.head.xflags=255&B,e.head.os=B>>8),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0)),I=B=0,e.mode=5;case 5:if(1024&e.flags){for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.length=B,e.head&&(e.head.extra_len=B),512&e.flags&&(k[0]=255&B,k[1]=B>>>8&255,e.check=r(e.check,k,2,0)),I=B=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(M<(G=e.length)&&(G=M),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),a.arraySet(e.head.extra,F,U,G,t)),512&e.flags&&(e.check=r(e.check,F,G,U)),M-=G,U+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(M===0)break t;for(G=0;t=F[U+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G<M;);if(512&e.flags&&(e.check=r(e.check,F,G,U)),M-=G,U+=G,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(M===0)break t;for(G=0;t=F[U+G++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&G<M;);if(512&e.flags&&(e.check=r(e.check,F,G,U)),M-=G,U+=G,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;I<16;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(B!==(65535&e.check)){f.msg="header crc mismatch",e.mode=30;break}I=B=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),f.adler=e.check=0,e.mode=12;break;case 10:for(;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}f.adler=e.check=s(B),I=B=0,e.mode=11;case 11:if(e.havedict===0)return f.next_out=et,f.avail_out=rt,f.next_in=U,f.avail_in=M,e.hold=B,e.bits=I,2;f.adler=e.check=1,e.mode=12;case 12:if(T===5||T===6)break t;case 13:if(e.last){B>>>=7&I,I-=7&I,e.mode=27;break}for(;I<3;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}switch(e.last=1&B,I-=1,3&(B>>>=1)){case 0:e.mode=14;break;case 1:if(z(e),e.mode=20,T!==6)break;B>>>=2,I-=2;break t;case 2:e.mode=17;break;case 3:f.msg="invalid block type",e.mode=30}B>>>=2,I-=2;break;case 14:for(B>>>=7&I,I-=7&I;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if((65535&B)!=(B>>>16^65535)){f.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&B,I=B=0,e.mode=15,T===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(M<G&&(G=M),rt<G&&(G=rt),G===0)break t;a.arraySet(V,F,U,G,et),M-=G,U+=G,rt-=G,et+=G,e.length-=G;break}e.mode=12;break;case 17:for(;I<14;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(e.nlen=257+(31&B),B>>>=5,I-=5,e.ndist=1+(31&B),B>>>=5,I-=5,e.ncode=4+(15&B),B>>>=4,I-=4,286<e.nlen||30<e.ndist){f.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;I<3;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.lens[j[e.have++]]=7&B,B>>>=3,I-=3}for(;e.have<19;)e.lens[j[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,P={bits:e.lenbits},L=g(0,e.lens,0,19,e.lencode,0,e.work,P),e.lenbits=P.bits,L){f.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;at=(u=e.lencode[B&(1<<e.lenbits)-1])>>>16&255,ut=65535&u,!((nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(ut<16)B>>>=nt,I-=nt,e.lens[e.have++]=ut;else{if(ut===16){for(p=nt+2;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(B>>>=nt,I-=nt,e.have===0){f.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&B),B>>>=2,I-=2}else if(ut===17){for(p=nt+3;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}I-=nt,t=0,G=3+(7&(B>>>=nt)),B>>>=3,I-=3}else{for(p=nt+7;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}I-=nt,t=0,G=11+(127&(B>>>=nt)),B>>>=7,I-=7}if(e.have+G>e.nlen+e.ndist){f.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){f.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,P={bits:e.lenbits},L=g(y,e.lens,0,e.nlen,e.lencode,0,e.work,P),e.lenbits=P.bits,L){f.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,P={bits:e.distbits},L=g(_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,P),e.distbits=P.bits,L){f.msg="invalid distances set",e.mode=30;break}if(e.mode=20,T===6)break t;case 20:e.mode=21;case 21:if(6<=M&&258<=rt){f.next_out=et,f.avail_out=rt,f.next_in=U,f.avail_in=M,e.hold=B,e.bits=I,l(f,$),et=f.next_out,V=f.output,rt=f.avail_out,U=f.next_in,F=f.input,M=f.avail_in,B=e.hold,I=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;at=(u=e.lencode[B&(1<<e.lenbits)-1])>>>16&255,ut=65535&u,!((nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(at&&!(240&at)){for(lt=nt,mt=at,pt=ut;at=(u=e.lencode[pt+((B&(1<<lt+mt)-1)>>lt)])>>>16&255,ut=65535&u,!(lt+(nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}B>>>=lt,I-=lt,e.back+=lt}if(B>>>=nt,I-=nt,e.back+=nt,e.length=ut,at===0){e.mode=26;break}if(32&at){e.back=-1,e.mode=12;break}if(64&at){f.msg="invalid literal/length code",e.mode=30;break}e.extra=15&at,e.mode=22;case 22:if(e.extra){for(p=e.extra;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.length+=B&(1<<e.extra)-1,B>>>=e.extra,I-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;at=(u=e.distcode[B&(1<<e.distbits)-1])>>>16&255,ut=65535&u,!((nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(!(240&at)){for(lt=nt,mt=at,pt=ut;at=(u=e.distcode[pt+((B&(1<<lt+mt)-1)>>lt)])>>>16&255,ut=65535&u,!(lt+(nt=u>>>24)<=I);){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}B>>>=lt,I-=lt,e.back+=lt}if(B>>>=nt,I-=nt,e.back+=nt,64&at){f.msg="invalid distance code",e.mode=30;break}e.offset=ut,e.extra=15&at,e.mode=24;case 24:if(e.extra){for(p=e.extra;I<p;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}e.offset+=B&(1<<e.extra)-1,B>>>=e.extra,I-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){f.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(rt===0)break t;if(G=$-rt,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){f.msg="invalid distance too far back",e.mode=30;break}ot=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ht=e.window}else ht=V,ot=et-e.offset,G=e.length;for(rt<G&&(G=rt),rt-=G,e.length-=G;V[et++]=ht[ot++],--G;);e.length===0&&(e.mode=21);break;case 26:if(rt===0)break t;V[et++]=e.length,rt--,e.mode=21;break;case 27:if(e.wrap){for(;I<32;){if(M===0)break t;M--,B|=F[U++]<<I,I+=8}if($-=rt,f.total_out+=$,e.total+=$,$&&(f.adler=e.check=e.flags?r(e.check,V,$,et-$):o(e.check,V,$,et-$)),$=rt,(e.flags?B:s(B))!==e.check){f.msg="incorrect data check",e.mode=30;break}I=B=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;I<32;){if(M===0)break t;M--,B+=F[U++]<<I,I+=8}if(B!==(4294967295&e.total)){f.msg="incorrect length check",e.mode=30;break}I=B=0}e.mode=29;case 29:L=1;break t;case 30:L=-3;break t;case 31:return-4;case 32:default:return i}return f.next_out=et,f.avail_out=rt,f.next_in=U,f.avail_in=M,e.hold=B,e.bits=I,(e.wsize||$!==f.avail_out&&e.mode<30&&(e.mode<27||T!==4))&&X(f,f.output,f.next_out,$-f.avail_out)?(e.mode=31,-4):(Q-=f.avail_in,$-=f.avail_out,f.total_in+=Q,f.total_out+=$,e.total+=$,e.wrap&&$&&(f.adler=e.check=e.flags?r(e.check,V,$,f.next_out-$):o(e.check,V,$,f.next_out-$)),f.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(Q==0&&$===0||T===4)&&L===b&&(L=-5),L)},v.inflateEnd=function(f){if(!f||!f.state)return i;var T=f.state;return T.window&&(T.window=null),f.state=null,b},v.inflateGetHeader=function(f,T){var e;return f&&f.state&&2&(e=f.state).wrap?((e.head=T).done=!1,b):i},v.inflateSetDictionary=function(f,T){var e,F=T.length;return f&&f.state?(e=f.state).wrap!==0&&e.mode!==11?i:e.mode===11&&o(1,T,F,0)!==e.check?-3:X(f,T,F,F)?(e.mode=31,-4):(e.havedict=1,b):i},v.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(h,A,v){var a=h("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],g=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];A.exports=function(y,_,b,i,d,n,c,s){var m,w,x,S,D,E,N,C,z,X=s.bits,f=0,T=0,e=0,F=0,V=0,U=0,et=0,M=0,rt=0,B=0,I=null,Q=0,$=new a.Buf16(16),G=new a.Buf16(16),ot=null,ht=0;for(f=0;f<=15;f++)$[f]=0;for(T=0;T<i;T++)$[_[b+T]]++;for(V=X,F=15;1<=F&&$[F]===0;F--);if(F<V&&(V=F),F===0)return d[n++]=20971520,d[n++]=20971520,s.bits=1,0;for(e=1;e<F&&$[e]===0;e++);for(V<e&&(V=e),f=M=1;f<=15;f++)if(M<<=1,(M-=$[f])<0)return-1;if(0<M&&(y===0||F!==1))return-1;for(G[1]=0,f=1;f<15;f++)G[f+1]=G[f]+$[f];for(T=0;T<i;T++)_[b+T]!==0&&(c[G[_[b+T]]++]=T);if(E=y===0?(I=ot=c,19):y===1?(I=o,Q-=257,ot=r,ht-=257,256):(I=l,ot=g,-1),f=e,D=n,et=T=B=0,x=-1,S=(rt=1<<(U=V))-1,y===1&&852<rt||y===2&&592<rt)return 1;for(;;){for(N=f-et,z=c[T]<E?(C=0,c[T]):c[T]>E?(C=ot[ht+c[T]],I[Q+c[T]]):(C=96,0),m=1<<f-et,e=w=1<<U;d[D+(B>>et)+(w-=m)]=N<<24|C<<16|z|0,w!==0;);for(m=1<<f-1;B&m;)m>>=1;if(m!==0?(B&=m-1,B+=m):B=0,T++,--$[f]==0){if(f===F)break;f=_[b+c[T]]}if(V<f&&(B&S)!==x){for(et===0&&(et=V),D+=e,M=1<<(U=f-et);U+et<F&&!((M-=$[U+et])<=0);)U++,M<<=1;if(rt+=1<<U,y===1&&852<rt||y===2&&592<rt)return 1;d[x=B&S]=V<<24|U<<16|D-n|0}}return B!==0&&(d[D+B]=f-et<<24|64<<16|0),s.bits=V,0}},{"../utils/common":41}],51:[function(h,A,v){A.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(h,A,v){var a=h("../utils/common"),o=0,r=1;function l(u){for(var k=u.length;0<=--k;)u[k]=0}var g=0,y=29,_=256,b=_+1+y,i=30,d=19,n=2*b+1,c=15,s=16,m=7,w=256,x=16,S=17,D=18,E=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],N=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=new Array(2*(b+2));l(X);var f=new Array(2*i);l(f);var T=new Array(512);l(T);var e=new Array(256);l(e);var F=new Array(y);l(F);var V,U,et,M=new Array(i);function rt(u,k,j,R,O){this.static_tree=u,this.extra_bits=k,this.extra_base=j,this.elems=R,this.max_length=O,this.has_stree=u&&u.length}function B(u,k){this.dyn_tree=u,this.max_code=0,this.stat_desc=k}function I(u){return u<256?T[u]:T[256+(u>>>7)]}function Q(u,k){u.pending_buf[u.pending++]=255&k,u.pending_buf[u.pending++]=k>>>8&255}function $(u,k,j){u.bi_valid>s-j?(u.bi_buf|=k<<u.bi_valid&65535,Q(u,u.bi_buf),u.bi_buf=k>>s-u.bi_valid,u.bi_valid+=j-s):(u.bi_buf|=k<<u.bi_valid&65535,u.bi_valid+=j)}function G(u,k,j){$(u,j[2*k],j[2*k+1])}function ot(u,k){for(var j=0;j|=1&u,u>>>=1,j<<=1,0<--k;);return j>>>1}function ht(u,k,j){var R,O,Z=new Array(c+1),q=0;for(R=1;R<=c;R++)Z[R]=q=q+j[R-1]<<1;for(O=0;O<=k;O++){var H=u[2*O+1];H!==0&&(u[2*O]=ot(Z[H]++,H))}}function nt(u){var k;for(k=0;k<b;k++)u.dyn_ltree[2*k]=0;for(k=0;k<i;k++)u.dyn_dtree[2*k]=0;for(k=0;k<d;k++)u.bl_tree[2*k]=0;u.dyn_ltree[2*w]=1,u.opt_len=u.static_len=0,u.last_lit=u.matches=0}function at(u){8<u.bi_valid?Q(u,u.bi_buf):0<u.bi_valid&&(u.pending_buf[u.pending++]=u.bi_buf),u.bi_buf=0,u.bi_valid=0}function ut(u,k,j,R){var O=2*k,Z=2*j;return u[O]<u[Z]||u[O]===u[Z]&&R[k]<=R[j]}function lt(u,k,j){for(var R=u.heap[j],O=j<<1;O<=u.heap_len&&(O<u.heap_len&&ut(k,u.heap[O+1],u.heap[O],u.depth)&&O++,!ut(k,R,u.heap[O],u.depth));)u.heap[j]=u.heap[O],j=O,O<<=1;u.heap[j]=R}function mt(u,k,j){var R,O,Z,q,H=0;if(u.last_lit!==0)for(;R=u.pending_buf[u.d_buf+2*H]<<8|u.pending_buf[u.d_buf+2*H+1],O=u.pending_buf[u.l_buf+H],H++,R===0?G(u,O,k):(G(u,(Z=e[O])+_+1,k),(q=E[Z])!==0&&$(u,O-=F[Z],q),G(u,Z=I(--R),j),(q=N[Z])!==0&&$(u,R-=M[Z],q)),H<u.last_lit;);G(u,w,k)}function pt(u,k){var j,R,O,Z=k.dyn_tree,q=k.stat_desc.static_tree,H=k.stat_desc.has_stree,J=k.stat_desc.elems,st=-1;for(u.heap_len=0,u.heap_max=n,j=0;j<J;j++)Z[2*j]!==0?(u.heap[++u.heap_len]=st=j,u.depth[j]=0):Z[2*j+1]=0;for(;u.heap_len<2;)Z[2*(O=u.heap[++u.heap_len]=st<2?++st:0)]=1,u.depth[O]=0,u.opt_len--,H&&(u.static_len-=q[2*O+1]);for(k.max_code=st,j=u.heap_len>>1;1<=j;j--)lt(u,Z,j);for(O=J;j=u.heap[1],u.heap[1]=u.heap[u.heap_len--],lt(u,Z,1),R=u.heap[1],u.heap[--u.heap_max]=j,u.heap[--u.heap_max]=R,Z[2*O]=Z[2*j]+Z[2*R],u.depth[O]=(u.depth[j]>=u.depth[R]?u.depth[j]:u.depth[R])+1,Z[2*j+1]=Z[2*R+1]=O,u.heap[1]=O++,lt(u,Z,1),2<=u.heap_len;);u.heap[--u.heap_max]=u.heap[1],function(it,dt){var wt,gt,kt,ct,zt,It,bt=dt.dyn_tree,Nt=dt.max_code,se=dt.stat_desc.static_tree,oe=dt.stat_desc.has_stree,le=dt.stat_desc.extra_bits,Lt=dt.stat_desc.extra_base,xt=dt.stat_desc.max_length,At=0;for(ct=0;ct<=c;ct++)it.bl_count[ct]=0;for(bt[2*it.heap[it.heap_max]+1]=0,wt=it.heap_max+1;wt<n;wt++)xt<(ct=bt[2*bt[2*(gt=it.heap[wt])+1]+1]+1)&&(ct=xt,At++),bt[2*gt+1]=ct,Nt<gt||(it.bl_count[ct]++,zt=0,Lt<=gt&&(zt=le[gt-Lt]),It=bt[2*gt],it.opt_len+=It*(ct+zt),oe&&(it.static_len+=It*(se[2*gt+1]+zt)));if(At!==0){do{for(ct=xt-1;it.bl_count[ct]===0;)ct--;it.bl_count[ct]--,it.bl_count[ct+1]+=2,it.bl_count[xt]--,At-=2}while(0<At);for(ct=xt;ct!==0;ct--)for(gt=it.bl_count[ct];gt!==0;)Nt<(kt=it.heap[--wt])||(bt[2*kt+1]!==ct&&(it.opt_len+=(ct-bt[2*kt+1])*bt[2*kt],bt[2*kt+1]=ct),gt--)}}(u,k),ht(Z,st,u.bl_count)}function t(u,k,j){var R,O,Z=-1,q=k[1],H=0,J=7,st=4;for(q===0&&(J=138,st=3),k[2*(j+1)+1]=65535,R=0;R<=j;R++)O=q,q=k[2*(R+1)+1],++H<J&&O===q||(H<st?u.bl_tree[2*O]+=H:O!==0?(O!==Z&&u.bl_tree[2*O]++,u.bl_tree[2*x]++):H<=10?u.bl_tree[2*S]++:u.bl_tree[2*D]++,Z=O,st=(H=0)===q?(J=138,3):O===q?(J=6,3):(J=7,4))}function L(u,k,j){var R,O,Z=-1,q=k[1],H=0,J=7,st=4;for(q===0&&(J=138,st=3),R=0;R<=j;R++)if(O=q,q=k[2*(R+1)+1],!(++H<J&&O===q)){if(H<st)for(;G(u,O,u.bl_tree),--H!=0;);else O!==0?(O!==Z&&(G(u,O,u.bl_tree),H--),G(u,x,u.bl_tree),$(u,H-3,2)):H<=10?(G(u,S,u.bl_tree),$(u,H-3,3)):(G(u,D,u.bl_tree),$(u,H-11,7));Z=O,st=(H=0)===q?(J=138,3):O===q?(J=6,3):(J=7,4)}}l(M);var P=!1;function p(u,k,j,R){$(u,(g<<1)+(R?1:0),3),function(O,Z,q,H){at(O),Q(O,q),Q(O,~q),a.arraySet(O.pending_buf,O.window,Z,q,O.pending),O.pending+=q}(u,k,j)}v._tr_init=function(u){P||(function(){var k,j,R,O,Z,q=new Array(c+1);for(O=R=0;O<y-1;O++)for(F[O]=R,k=0;k<1<<E[O];k++)e[R++]=O;for(e[R-1]=O,O=Z=0;O<16;O++)for(M[O]=Z,k=0;k<1<<N[O];k++)T[Z++]=O;for(Z>>=7;O<i;O++)for(M[O]=Z<<7,k=0;k<1<<N[O]-7;k++)T[256+Z++]=O;for(j=0;j<=c;j++)q[j]=0;for(k=0;k<=143;)X[2*k+1]=8,k++,q[8]++;for(;k<=255;)X[2*k+1]=9,k++,q[9]++;for(;k<=279;)X[2*k+1]=7,k++,q[7]++;for(;k<=287;)X[2*k+1]=8,k++,q[8]++;for(ht(X,b+1,q),k=0;k<i;k++)f[2*k+1]=5,f[2*k]=ot(k,5);V=new rt(X,E,_+1,b,c),U=new rt(f,N,0,i,c),et=new rt(new Array(0),C,0,d,m)}(),P=!0),u.l_desc=new B(u.dyn_ltree,V),u.d_desc=new B(u.dyn_dtree,U),u.bl_desc=new B(u.bl_tree,et),u.bi_buf=0,u.bi_valid=0,nt(u)},v._tr_stored_block=p,v._tr_flush_block=function(u,k,j,R){var O,Z,q=0;0<u.level?(u.strm.data_type===2&&(u.strm.data_type=function(H){var J,st=4093624447;for(J=0;J<=31;J++,st>>>=1)if(1&st&&H.dyn_ltree[2*J]!==0)return o;if(H.dyn_ltree[18]!==0||H.dyn_ltree[20]!==0||H.dyn_ltree[26]!==0)return r;for(J=32;J<_;J++)if(H.dyn_ltree[2*J]!==0)return r;return o}(u)),pt(u,u.l_desc),pt(u,u.d_desc),q=function(H){var J;for(t(H,H.dyn_ltree,H.l_desc.max_code),t(H,H.dyn_dtree,H.d_desc.max_code),pt(H,H.bl_desc),J=d-1;3<=J&&H.bl_tree[2*z[J]+1]===0;J--);return H.opt_len+=3*(J+1)+5+5+4,J}(u),O=u.opt_len+3+7>>>3,(Z=u.static_len+3+7>>>3)<=O&&(O=Z)):O=Z=j+5,j+4<=O&&k!==-1?p(u,k,j,R):u.strategy===4||Z===O?($(u,2+(R?1:0),3),mt(u,X,f)):($(u,4+(R?1:0),3),function(H,J,st,it){var dt;for($(H,J-257,5),$(H,st-1,5),$(H,it-4,4),dt=0;dt<it;dt++)$(H,H.bl_tree[2*z[dt]+1],3);L(H,H.dyn_ltree,J-1),L(H,H.dyn_dtree,st-1)}(u,u.l_desc.max_code+1,u.d_desc.max_code+1,q+1),mt(u,u.dyn_ltree,u.dyn_dtree)),nt(u),R&&at(u)},v._tr_tally=function(u,k,j){return u.pending_buf[u.d_buf+2*u.last_lit]=k>>>8&255,u.pending_buf[u.d_buf+2*u.last_lit+1]=255&k,u.pending_buf[u.l_buf+u.last_lit]=255&j,u.last_lit++,k===0?u.dyn_ltree[2*j]++:(u.matches++,k--,u.dyn_ltree[2*(e[j]+_+1)]++,u.dyn_dtree[2*I(k)]++),u.last_lit===u.lit_bufsize-1},v._tr_align=function(u){$(u,2,3),G(u,w,X),function(k){k.bi_valid===16?(Q(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(u)}},{"../utils/common":41}],53:[function(h,A,v){A.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(h,A,v){(function(a){(function(o,r){if(!o.setImmediate){var l,g,y,_,b=1,i={},d=!1,n=o.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(o);c=c&&c.setTimeout?c:o,l={}.toString.call(o.process)==="[object process]"?function(x){process.nextTick(function(){m(x)})}:function(){if(o.postMessage&&!o.importScripts){var x=!0,S=o.onmessage;return o.onmessage=function(){x=!1},o.postMessage("","*"),o.onmessage=S,x}}()?(_="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",w,!1):o.attachEvent("onmessage",w),function(x){o.postMessage(_+x,"*")}):o.MessageChannel?((y=new MessageChannel).port1.onmessage=function(x){m(x.data)},function(x){y.port2.postMessage(x)}):n&&"onreadystatechange"in n.createElement("script")?(g=n.documentElement,function(x){var S=n.createElement("script");S.onreadystatechange=function(){m(x),S.onreadystatechange=null,g.removeChild(S),S=null},g.appendChild(S)}):function(x){setTimeout(m,0,x)},c.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var S=new Array(arguments.length-1),D=0;D<S.length;D++)S[D]=arguments[D+1];var E={callback:x,args:S};return i[b]=E,l(b),b++},c.clearImmediate=s}function s(x){delete i[x]}function m(x){if(d)setTimeout(m,0,x);else{var S=i[x];if(S){d=!0;try{(function(D){var E=D.callback,N=D.args;switch(N.length){case 0:E();break;case 1:E(N[0]);break;case 2:E(N[0],N[1]);break;case 3:E(N[0],N[1],N[2]);break;default:E.apply(r,N)}})(S)}finally{s(x),d=!1}}}}function w(x){x.source===o&&typeof x.data=="string"&&x.data.indexOf(_)===0&&m(+x.data.slice(_.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof St<"u"?St:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Tt);var Rt=Tt.exports;const Wt=jt(Rt);function Mt(){const[W,Y]=tt.useState(""),[h,A]=tt.useState(!1),[v,a]=tt.useState(""),[o,r]=tt.useState(null);let l="",g="";const y=tt.useRef(null),_=tt.useRef(null),b={},i=["text/html","text/xml","application/xml","application/xhtml+xml","image/svg+xml"],d=tt.useCallback(async C=>{A(!0),Y(""),a("Loading..."),r(null),_.current&&(document.head.removeChild(_.current),URL.revokeObjectURL(_.current.href),_.current=null);try{let z;if(typeof C=="string"){const X=await fetch(C);if(!X.ok)throw new Error(`HTTP error! status: ${X.status} ${X.statusText}`);z=await X.arrayBuffer()}else C instanceof File?z=await C.arrayBuffer():z=C;if(!z||z.byteLength===0)throw new Error("EPUB source is empty or could not be read.");y.current=await Wt.loadAsync(z),await n()}catch(z){const X=z instanceof Error?z.message:"An unknown error occurred while fetching or loading the EPUB.";console.error("Error processing EPUB source:",z),r(X),Y(""),a(""),A(!1)}},[]);async function n(){if(!y.current)throw new Error("Zip not loaded");const z=y.current.file("META-INF/container.xml");if(!z)throw new Error("META-INF/container.xml not found.");const X=await z.async("text"),f=c(X);if(!f)throw new Error("OPF file path not found in container.xml.");l=f.substring(0,f.lastIndexOf("/")+1);const T=y.current.file(f);if(!T)throw new Error(`OPF file not found at path: ${f}`);const e=await T.async("text"),V=new DOMParser().parseFromString(e,"application/xml"),U=V.querySelector("parsererror");if(U)throw new Error(`Error parsing OPF file: ${U.textContent||"Unknown XML parse error"}`);s(V),await m(V)}function c(C){const f=new DOMParser().parseFromString(C,"application/xml").querySelector('rootfile[media-type="application/oebps-package+xml"]');return(f==null?void 0:f.getAttribute("full-path"))??null}function s(C){const z=C.querySelector("metadata > dc\\:title")||C.querySelector("metadata > title");a((z==null?void 0:z.textContent)||"Untitled Book")}async function m(C){if(!y.current)return;const z={};C.querySelectorAll("manifest > item").forEach(e=>{const F=e.getAttribute("id"),V=e.getAttribute("href"),U=e.getAttribute("media-type");F&&V&&U&&(z[F]={href:decodeURIComponent(V),type:U})});const X=Array.from(C.querySelectorAll("spine > itemref")).map(e=>e.getAttribute("idref"));let f="";const T=new Set;for(const e of X){if(!e)continue;const F=z[e];if(F){const V=l+F.href,U=y.current.file(V);if(U&&(F.type.includes("html")||F.type.includes("xml")))try{const et=await U.async("text"),M=await w(et,F.type);f+=`<div class="bok-chapter">${M}</div>`}catch(et){console.warn(`Failed to process spine item ${V}:`,et)}}}for(const e in z){const F=z[e];if(F.type.includes("css")){const V=l+F.href;if(!T.has(V)){const U=y.current.file(V);if(U)try{g+=await U.async("text")+`
13
+ `,T.add(V)}catch(et){console.warn(`Failed to load CSS ${V}:`,et)}}}}N(),Y(f)}async function w(C,z){let X=[...C.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)].map(T=>T[1]).join(`
14
+ `);X=x(X),g+=X;let f=C.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"");return f=f.replace(/<link[^>]*?>/gi,""),f=f.replace(/<title[^>]*>[\s\S]*?<\/title>/gi,""),f=await S(f,z),f}function x(C){const z=["background-color","color","font-size","font-family","font-weight","line-height","text-align"];return C.split(/}/).map(X=>{const f=X.split(/{/),T=f[0],e=f[1];if(!e)return"";const F=e.split(/;/).map(V=>V.trim()).filter(V=>V?!z.some(U=>new RegExp(`^${U}s*:`,"i").test(V)):!1).join("; ");return F?`${T.trim()} { ${F}; }`:""}).filter(X=>!!X).join(`
15
+ `)}async function S(C,z){const X=new DOMParser;if(i.includes(z))try{const f=X.parseFromString(C,z),T=f.querySelector("parsererror");if(T)return console.warn("Parser error in content item during cleanImages, skipping.",T.textContent),C;const e=f.querySelectorAll("img");for(const et of e)await D(et);const F=f.querySelectorAll("image");for(const et of F)await E(et);return new XMLSerializer().serializeToString(f.documentElement||f)}catch(f){return console.error("Error during cleanImages DOM processing:",f),C}else return C}async function D(C){var X;let z=C.getAttribute("src");if(z){for(;z.startsWith(".")||z.startsWith("/");)z=z.slice(1);if(z=l+z,b[z]===void 0){const f=(X=y.current)==null?void 0:X.file(z);if(f)try{const T=await f.async("blob"),e=URL.createObjectURL(T);b[z]=e}catch(T){console.warn(`Could not load image blob (formatImg) ${z}:`,T),b[z]=""}else console.warn(`Image file not found in zip (formatImg): ${z}`),b[z]=""}C.setAttribute("src",b[z])}}async function E(C){var X;let z=C.getAttribute("xlink:href");if(z){for(;z.startsWith(".")||z.startsWith("/");)z=z.slice(1);if(z=l+z,b[z]===void 0){const f=(X=y.current)==null?void 0:X.file(z);if(f)try{const T=await f.async("blob"),e=URL.createObjectURL(T);b[z]=e}catch(T){console.warn(`Could not load image blob (formatXMLImage) ${z}:`,T),b[z]=""}else console.warn(`Image file not found in zip (formatXMLImage): ${z}`),b[z]=""}C.setAttribute("xlink:href",b[z])}}function N(){if(!g.trim())return;const C=new Blob([g],{type:"text/css"}),z=URL.createObjectURL(C);_.current=document.createElement("link"),_.current.href=z,_.current.rel="stylesheet",_.current.setAttribute("data-bok-reader-style","true"),document.head.appendChild(_.current)}return{title:v,rawContent:W,isLoading:h,error:o,loadEpub:d,setIsLoading:A}}function Bt(W){const[Y,h]=tt.useState({width:0,height:0,noOfPages:1});return tt.useEffect(()=>{const A=W==null?void 0:W.current,v=()=>{if(A){const a=A.getBoundingClientRect(),o=a.height<a.width;h(r=>{const l=o?a.width/2:a.width,g=a.height,y=o?2:1;return r.width!==l||r.height!==g||r.noOfPages!==y?{width:l,height:g,noOfPages:y}:r})}else h({width:0,height:0,noOfPages:1})};if(A){v();const a=new ResizeObserver(v);return a.observe(A),()=>{a.unobserve(A)}}},[W]),[Y.width,Y.height,Y.noOfPages]}function Zt(W){const[Y,h]=tt.useState(0),A=tt.useCallback(()=>{if(W.current){const v=W.current.scrollWidth,a=W.current.scrollLeft,o=v>0?a/v:0;h(o)}},[W]);return tt.useEffect(()=>{const v=W.current;if(!v)return;let a=null;const o=100,r=()=>{a&&clearTimeout(a),a=setTimeout(()=>{A()},o)};return v.addEventListener("scroll",r),A(),()=>{a&&clearTimeout(a),v.removeEventListener("scroll",r)}},[A,W]),[Y,h]}function Xt(W,Y,h,A,v){let a="";tt.useEffect(()=>{Y>1e-7&&(a=JSON.stringify({percentRead:Y,padding:h,fontSize:A,fontFamily:v}),localStorage.setItem(W,a))},[W,Y,h,A,v])}const Ht=(W,Y,h,A)=>{const[v,a]=Bt(h),o=tt.useRef(null),r=tt.useRef(""),l=tt.useCallback((g,y)=>{!Y&&!A&&(g/v<=.4&&y/a<.8&&W(-1),g/v>.4&&y/a<.8&&W(1))},[W,Y,v,a]);tt.useEffect(()=>{const g=()=>{var _;const y=(_=window.getSelection())==null?void 0:_.toString();y&&y.length>0?r.current=y:r.current=""};return document.addEventListener("selectionchange",g),()=>{document.removeEventListener("selectionchange",g)}},[]),tt.useEffect(()=>{const g=()=>{o.current=window.setTimeout(()=>{o.current=null},500)},y=_=>{if(o.current&&r.current){clearTimeout(o.current),o.current=null;const{pageX:b,pageY:i}=_.touches[0];l(b,i)}};return window.addEventListener("touchstart",g),window.addEventListener("touchend",y),()=>{window.removeEventListener("touchstart",g),window.removeEventListener("touchend",y)}},[v,l]),tt.useEffect(()=>{const g=h.current,y=()=>{o.current=window.setTimeout(()=>{},200)},_=b=>{o.current&&!r.current&&(clearTimeout(o.current),o.current=null,l(b.clientX,b.clientY))};return g==null||g.addEventListener("mousedown",y),g==null||g.addEventListener("mouseup",_),()=>{g==null||g.removeEventListener("mousedown",y),g==null||g.removeEventListener("mouseup",_)}},[v,Y,l,h])};function Gt({currentPage:W,pages:Y}){return K.jsxs("div",{className:"page-number",children:[W+1,"/",Y]})}function $t({content:W,title:Y,setIsLoading:h,fontSize:A,sidePadding:v,fontFamily:a,isOptionMenuVisible:o,setFontSize:r,setPadding:l,setFontFamily:g,containerElementRef:y,showTutorial:_}){const b=tt.useRef(null),[i,d,n]=Bt(y),[c,s]=Zt(b),[m,w]=tt.useState(1),[x,S]=tt.useState(0);Xt(Y,c,v,A,a);const D=tt.useCallback(E=>{w(N=>{const C=b.current;if(C&&x>0&&n>0&&C.clientWidth>0){let z=N+E;return z<0&&(z=0),z>=x&&(z=x-1),C.scroll({left:z*i*n,behavior:"smooth"}),z}return N})},[i,x,n]);return Ht(D,o,y,_),tt.useEffect(()=>{if(!Y)return;const E=localStorage.getItem(Y);if(E)try{const N=JSON.parse(E);N&&(s(N.percentRead||0),N.fontSize!==void 0&&r(N.fontSize),N.padding!==void 0&&l(N.padding),N.fontFamily!==void 0&&g(N.fontFamily))}catch(N){console.error("Failed to parse local storage for",Y,N),s(0)}else s(0);w(1)},[Y,s,r,l,g]),tt.useEffect(()=>{const E=b.current;if(!E||i<=0||d<=0)return;h(!0);const N=setTimeout(()=>{E.style.setProperty("--side-padding",`${v}px`),E.style.setProperty("--font-size",`${A}em`),E.style.setProperty("--font-family",a),E.style.maxHeight=`${d}px`;const C=E.scrollWidth,z=i>0&&C>0?Math.round(C/i):0,X=n===1?z:Math.round(z/2);if(S(X),X>0&&E.clientWidth>0){let f=Math.round(X*c);f=Math.max(0,Math.min(X-1,f)),m!==f&&(w(f),E.scrollLeft=f*i*n)}else h(!1),w(1);h(!1)},400);return()=>{clearTimeout(N)}},[i,d,v,A,a,n,W,Y,h]),tt.useEffect(()=>{const E=N=>{N.key==="ArrowLeft"?(N.preventDefault(),D(-1)):N.key==="ArrowRight"&&(N.preventDefault(),D(1))};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[D,i,c]),K.jsxs(K.Fragment,{children:[K.jsx("div",{ref:b,dangerouslySetInnerHTML:{__html:W},className:"book-page"}),K.jsx(Gt,{pages:x,currentPage:m})]})}var qt={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function Yt(W){if(typeof W=="number")return{value:W,unit:"px"};var Y,h=(W.match(/^[0-9.]*/)||"").toString();h.includes(".")?Y=parseFloat(h):Y=parseInt(h,10);var A=(W.match(/[^0-9]*$/)||"").toString();return qt[A]?{value:Y,unit:A}:(console.warn("React Spinners: ".concat(W," is not a valid css value. Defaulting to ").concat(Y,"px.")),{value:Y,unit:"px"})}var yt=function(W,Y,h){var A="react-spinners-".concat(W,"-").concat(h);if(typeof window>"u"||!window.document)return A;var v=document.createElement("style");document.head.appendChild(v);var a=v.sheet,o=`
16
16
  @keyframes `.concat(A,` {
17
17
  `).concat(Y,`
18
18
  }
19
- `);return a&&a.insertRule(o,0),A},Ct=function(){return Ct=Object.assign||function(W){for(var Y,f=1,A=arguments.length;f<A;f++){Y=arguments[f];for(var v in Y)Object.prototype.hasOwnProperty.call(Y,v)&&(W[v]=Y[v])}return W},Ct.apply(this,arguments)},Vt=function(W,Y){var f={};for(var A in W)Object.prototype.hasOwnProperty.call(W,A)&&Y.indexOf(A)<0&&(f[A]=W[A]);if(W!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,A=Object.getOwnPropertySymbols(W);v<A.length;v++)Y.indexOf(A[v])<0&&Object.prototype.propertyIsEnumerable.call(W,A[v])&&(f[A[v]]=W[A[v]]);return f},ft=[1,3,5],Kt=[yt("PropagateLoader","25% {transform: translateX(-".concat(ft[0],`rem) scale(0.75)}
19
+ `);return a&&a.insertRule(o,0),A},Ct=function(){return Ct=Object.assign||function(W){for(var Y,h=1,A=arguments.length;h<A;h++){Y=arguments[h];for(var v in Y)Object.prototype.hasOwnProperty.call(Y,v)&&(W[v]=Y[v])}return W},Ct.apply(this,arguments)},Vt=function(W,Y){var h={};for(var A in W)Object.prototype.hasOwnProperty.call(W,A)&&Y.indexOf(A)<0&&(h[A]=W[A]);if(W!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,A=Object.getOwnPropertySymbols(W);v<A.length;v++)Y.indexOf(A[v])<0&&Object.prototype.propertyIsEnumerable.call(W,A[v])&&(h[A[v]]=W[A[v]]);return h},ft=[1,3,5],Kt=[yt("PropagateLoader","25% {transform: translateX(-".concat(ft[0],`rem) scale(0.75)}
20
20
  50% {transform: translateX(-`).concat(ft[1],`rem) scale(0.6)}
21
21
  75% {transform: translateX(-`).concat(ft[2],`rem) scale(0.5)}
22
22
  95% {transform: translateX(0rem) scale(1)}`),"propogate-0"),yt("PropagateLoader","25% {transform: translateX(-".concat(ft[0],`rem) scale(0.75)}
@@ -32,7 +32,7 @@
32
32
  95% {transform: translateX(0rem) scale(1)}`),"propogate-4"),yt("PropagateLoader","25% {transform: translateX(".concat(ft[0],`rem) scale(0.75)}
33
33
  50% {transform: translateX(`).concat(ft[1],`rem) scale(0.6)}
34
34
  75% {transform: translateX(`).concat(ft[2],`rem) scale(0.5)}
35
- 95% {transform: translateX(0rem) scale(1)}`),"propogate-5")];function Jt(W){var Y=W.loading,f=Y===void 0?!0:Y,A=W.color,v=A===void 0?"#000000":A,a=W.speedMultiplier,o=a===void 0?1:a,r=W.cssOverride,l=r===void 0?{}:r,g=W.size,y=g===void 0?15:g,_=Vt(W,["loading","color","speedMultiplier","cssOverride","size"]),b=Yt(y),i=b.value,d=b.unit,n=Ct({display:"inherit",position:"relative"},l),c=function(s){return{position:"absolute",fontSize:"".concat(i/3).concat(d),width:"".concat(i).concat(d),height:"".concat(i).concat(d),background:v,borderRadius:"50%",animation:"".concat(Kt[s]," ").concat(1.5/o,"s infinite"),animationFillMode:"forwards"}};return f?vt.createElement("span",Ct({style:n},_),vt.createElement("span",{style:c(0)}),vt.createElement("span",{style:c(1)}),vt.createElement("span",{style:c(2)}),vt.createElement("span",{style:c(3)}),vt.createElement("span",{style:c(4)}),vt.createElement("span",{style:c(5)})):null}const Pt={"loading-screen":"_loading-screen_42072_1","loading-screen-gon":"_loading-screen-gon_42072_18"};function Qt({isLoading:W,color:Y}){return K.jsx("div",{className:W?Pt["loading-screen"]:Pt["loading-screen-gon"],children:K.jsx("div",{children:K.jsx(Jt,{color:Y||"red"})})})}function te(){document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():document.documentElement.requestFullscreen()}function ee({onClose:W,fontSize:Y,padding:f,fontFamily:A,setFontSize:v,setPadding:a,setFontFamily:o,supportedFonts:r}){const[l,g]=tt.useState(!1),[y,_]=tt.useState(!1),b=tt.useRef(null),i=tt.useRef(null),d=[{displayName:"System Default",name:"system-ui"},...r];tt.useEffect(()=>{const E=setTimeout(()=>{_(!0)},0);return()=>clearTimeout(E)},[]);const n=()=>{_(!1),g(!0)};tt.useEffect(()=>{if(l){const E=setTimeout(()=>{W()},300);return()=>clearTimeout(E)}},[l,W]);const c=()=>{n()},s=E=>{E.stopPropagation()},m=E=>{E.current&&(E.current.classList.add("value-changed"),setTimeout(()=>{E.current&&E.current.classList.remove("value-changed")},300))},w=()=>{f<=70&&(a(E=>E+5),m(i))},x=()=>{f-5>0&&(a(E=>E-5),m(i))},S=()=>{Y<3&&(v(E=>E+.2),m(b))},D=()=>{Y-.2>.6&&(v(E=>E-.2),m(b))};return K.jsx("div",{className:`options-menu-overlay ${l?"fade-out":""}`,onClick:c,children:K.jsxs("div",{className:`options-menu ${y?"visible":""} ${l?"slide-down":""}`,onClick:s,children:[K.jsx("button",{onClick:n,className:"close-button",children:"✕"}),K.jsx("h2",{children:"Reader Options"}),K.jsxs("div",{className:"options-buttons",children:[K.jsxs("div",{className:"font-family-buttons",children:[K.jsx("select",{value:A,onChange:E=>{for(const N of d)N.name===E.target.value&&o(E.target.value)},children:d.map(E=>K.jsx("option",{value:E.name,children:E.displayName},E.displayName))}),K.jsx("div",{className:"option-label",children:"Font family"})]}),K.jsxs("div",{className:"padding-buttons",children:[K.jsx("button",{onClick:w,children:"+"}),K.jsx("button",{onClick:x,children:"-"}),K.jsxs("div",{children:[K.jsx("span",{className:"option-label",children:"Side padding: "}),K.jsx("span",{ref:i,className:"option-value",children:f})]})]}),K.jsxs("div",{className:"font-buttons",children:[K.jsx("button",{onClick:S,children:"+"}),K.jsx("button",{onClick:D,children:"-"}),K.jsxs("div",{style:{marginLeft:"auto"},children:[K.jsx("span",{className:"option-label",children:"Font size: "}),K.jsx("span",{ref:b,className:"option-value",children:Math.round(Y*10)})]})]}),K.jsx("button",{onClick:te,children:"Toggle fullscreen"})]})]})})}const re=Ot.div`
35
+ 95% {transform: translateX(0rem) scale(1)}`),"propogate-5")];function Jt(W){var Y=W.loading,h=Y===void 0?!0:Y,A=W.color,v=A===void 0?"#000000":A,a=W.speedMultiplier,o=a===void 0?1:a,r=W.cssOverride,l=r===void 0?{}:r,g=W.size,y=g===void 0?15:g,_=Vt(W,["loading","color","speedMultiplier","cssOverride","size"]),b=Yt(y),i=b.value,d=b.unit,n=Ct({display:"inherit",position:"relative"},l),c=function(s){return{position:"absolute",fontSize:"".concat(i/3).concat(d),width:"".concat(i).concat(d),height:"".concat(i).concat(d),background:v,borderRadius:"50%",animation:"".concat(Kt[s]," ").concat(1.5/o,"s infinite"),animationFillMode:"forwards"}};return h?vt.createElement("span",Ct({style:n},_),vt.createElement("span",{style:c(0)}),vt.createElement("span",{style:c(1)}),vt.createElement("span",{style:c(2)}),vt.createElement("span",{style:c(3)}),vt.createElement("span",{style:c(4)}),vt.createElement("span",{style:c(5)})):null}const Pt={"loading-screen":"_loading-screen_42072_1","loading-screen-gon":"_loading-screen-gon_42072_18"};function Qt({isLoading:W,color:Y}){return K.jsx("div",{className:W?Pt["loading-screen"]:Pt["loading-screen-gon"],children:K.jsx("div",{children:K.jsx(Jt,{color:Y||"red"})})})}function te(){document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():document.documentElement.requestFullscreen()}function ee({onClose:W,fontSize:Y,padding:h,fontFamily:A,setFontSize:v,setPadding:a,setFontFamily:o,supportedFonts:r}){const[l,g]=tt.useState(!1),[y,_]=tt.useState(!1),b=tt.useRef(null),i=tt.useRef(null),d=[{displayName:"System Default",name:"system-ui"},...r];tt.useEffect(()=>{const E=setTimeout(()=>{_(!0)},0);return()=>clearTimeout(E)},[]);const n=()=>{_(!1),g(!0)};tt.useEffect(()=>{if(l){const E=setTimeout(()=>{W()},300);return()=>clearTimeout(E)}},[l,W]);const c=()=>{n()},s=E=>{E.stopPropagation()},m=E=>{E.current&&(E.current.classList.add("value-changed"),setTimeout(()=>{E.current&&E.current.classList.remove("value-changed")},300))},w=()=>{h<=70&&(a(E=>E+5),m(i))},x=()=>{h-5>0&&(a(E=>E-5),m(i))},S=()=>{Y<3&&(v(E=>E+.2),m(b))},D=()=>{Y-.2>.6&&(v(E=>E-.2),m(b))};return K.jsx("div",{className:`options-menu-overlay ${l?"fade-out":""}`,onClick:c,children:K.jsxs("div",{className:`options-menu ${y?"visible":""} ${l?"slide-down":""}`,onClick:s,children:[K.jsx("button",{onClick:n,className:"close-button",children:"✕"}),K.jsx("h2",{children:"Reader Options"}),K.jsxs("div",{className:"options-buttons",children:[K.jsxs("div",{className:"font-family-buttons",children:[K.jsx("select",{value:A,onChange:E=>{for(const N of d)N.name===E.target.value&&o(E.target.value)},children:d.map(E=>K.jsx("option",{value:E.name,children:E.displayName},E.displayName))}),K.jsx("div",{className:"option-label",children:"Font family"})]}),K.jsxs("div",{className:"padding-buttons",children:[K.jsx("button",{onClick:w,children:"+"}),K.jsx("button",{onClick:x,children:"-"}),K.jsxs("div",{children:[K.jsx("span",{className:"option-label",children:"Side padding: "}),K.jsx("span",{ref:i,className:"option-value",children:h})]})]}),K.jsxs("div",{className:"font-buttons",children:[K.jsx("button",{onClick:S,children:"+"}),K.jsx("button",{onClick:D,children:"-"}),K.jsxs("div",{style:{marginLeft:"auto"},children:[K.jsx("span",{className:"option-label",children:"Font size: "}),K.jsx("span",{ref:b,className:"option-value",children:Math.round(Y*10)})]})]}),K.jsx("button",{onClick:te,children:"Toggle fullscreen"})]})]})})}const re=Ot.div`
36
36
  position: absolute;
37
37
  top: 0;
38
38
  left: 0;
@@ -143,7 +143,7 @@
143
143
  top: 53%;
144
144
  }
145
145
  }
146
- `,ne=({color:W,onDismiss:Y})=>{const[f,A]=tt.useState(!1),v=()=>{A(!0),setTimeout(Y,350)};return K.jsxs(re,{color:W,onClick:v,className:f?"fade-out":"",children:[K.jsx("div",{className:"tap-circle right"}),K.jsx("div",{className:"tap-circle left"}),K.jsx("div",{className:"tap-circle bottom"}),K.jsx("div",{className:"tutorial-label right",children:"scroll right"}),K.jsx("div",{className:"tutorial-label left",children:"scroll left"}),K.jsx("div",{className:"tutorial-label bottom",children:"open settings"}),K.jsx("div",{className:"dismiss",children:"Tap anywhere to continue"})]})},Ft=Ot.createGlobalStyle`
146
+ `,ne=({color:W,onDismiss:Y})=>{const[h,A]=tt.useState(!1),v=()=>{A(!0),setTimeout(Y,350)};return K.jsxs(re,{color:W,onClick:v,className:h?"fade-out":"",children:[K.jsx("div",{className:"tap-circle right"}),K.jsx("div",{className:"tap-circle left"}),K.jsx("div",{className:"tap-circle bottom"}),K.jsx("div",{className:"tutorial-label right",children:"scroll right"}),K.jsx("div",{className:"tutorial-label left",children:"scroll left"}),K.jsx("div",{className:"tutorial-label bottom",children:"open settings"}),K.jsx("div",{className:"dismiss",children:"Tap anywhere to continue"})]})},Ft=Ot.createGlobalStyle`
147
147
  .bok-reader-container {
148
148
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
149
149
  line-height: 1.5;
@@ -180,8 +180,8 @@
180
180
  // Enable horizontal scrolling of the columns
181
181
  overflow-x: hidden;
182
182
  overflow-y: hidden; // Prevent vertical scrollbar on the container itself
183
- scroll-snap-type: x mandatory; // Snap pages (columns)
184
- scroll-behavior: auto; // Let JS handle smooth scrolling during page turns
183
+ // scroll-snap-type: x mandatory; // Snap pages (columns)
184
+ // scroll-behavior: auto; // Let JS handle smooth scrolling during page turns
185
185
  -webkit-overflow-scrolling: touch;
186
186
  box-sizing: border-box;
187
187
 
@@ -214,7 +214,6 @@
214
214
  max-width: calc(100% - 2 * var(--side-padding)) !important;
215
215
  margin-bottom: 10px;
216
216
  }
217
-
218
217
  }
219
218
  }
220
219
 
@@ -288,4 +287,4 @@
288
287
  position: relative;d
289
288
  overflow: hidden;d
290
289
  overflow-y: hidden;
291
- `;function ie(W,Y){const[f,A]=tt.useState(()=>{const v=localStorage.getItem(W);return v===null?Y:v==="true"});return tt.useEffect(()=>{localStorage.setItem(W,f?"true":"false")},[W,f]),[f,A]}const ae=({epubDataSource:W,onTitleChange:Y,onLoadingChange:f,onError:A,className:v,style:a,color:o,supportedFonts:r=[]})=>{const{title:l,rawContent:g,isLoading:y,error:_,loadEpub:b,setIsLoading:i}=Mt(),[d,n]=tt.useState(!1),[c,s]=tt.useState(1.2),[m,w]=tt.useState(30),[x,S]=tt.useState("Inter"),D=tt.useRef(null),[E,N]=ie("bokreader_tutorial_shown",!1),[C,z]=tt.useState(!E);tt.useEffect(()=>{E&&z(!1)},[E]);const X=()=>{z(!1),N(!0)};tt.useEffect(()=>{W&&b(W)},[W,b]),tt.useEffect(()=>{Y&&Y(l)},[l,Y]),tt.useEffect(()=>{f&&f(y)},[y,f]),tt.useEffect(()=>{_&&A&&A(_)},[_,A]);const h=tt.useMemo(()=>({"--color-tint":o,"--side-padding":`${m}px`,"--top-padding":"30px","--bottom-padding":"70px","--font-size":`${c}em`,"--font-family":x}),[m,c,x]);return _&&!y&&!g?K.jsxs(Dt,{className:`bok-reader-container ${v||""}`,style:a,children:[K.jsx(Ft,{}),K.jsxs("div",{style:{padding:"20px",color:"red"},children:["Error loading EPUB: ",_]})]}):K.jsxs(Dt,{className:`bok-reader-container ${v||""}`,style:{...a,...h},ref:D,children:[K.jsx(Ft,{}),K.jsx(Qt,{isLoading:y,color:o}),g&&K.jsxs(K.Fragment,{children:[C&&!y&&K.jsx(ne,{color:o,onDismiss:X}),K.jsx($t,{content:g,title:l,setIsLoading:i,fontSize:c,sidePadding:m,fontFamily:x,setPadding:w,setFontSize:s,setFontFamily:S,isOptionMenuVisible:d,containerElementRef:D,showTutorial:C}),d&&K.jsx(ee,{onClose:()=>n(!1),fontSize:c,padding:m,fontFamily:x,setPadding:w,setFontSize:s,setFontFamily:S,supportedFonts:r}),!d&&K.jsx("div",{className:"bottom-click-area",onClick:()=>{C||n(!0)},"aria-label":"Open reader options"})]}),!W&&!y&&!_&&K.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"No EPUB loaded."})]})};_t.BokReader=ae,Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"})});
290
+ `;function ie(W,Y){const[h,A]=tt.useState(()=>{const v=localStorage.getItem(W);return v===null?Y:v==="true"});return tt.useEffect(()=>{localStorage.setItem(W,h?"true":"false")},[W,h]),[h,A]}const ae=({epubDataSource:W,onTitleChange:Y,onLoadingChange:h,onError:A,className:v,style:a,color:o,supportedFonts:r=[]})=>{const{title:l,rawContent:g,isLoading:y,error:_,loadEpub:b,setIsLoading:i}=Mt(),[d,n]=tt.useState(!1),[c,s]=tt.useState(1.2),[m,w]=tt.useState(30),[x,S]=tt.useState("Inter"),D=tt.useRef(null),[E,N]=ie("bokreader_tutorial_shown",!1),[C,z]=tt.useState(!E);tt.useEffect(()=>{E&&z(!1)},[E]);const X=()=>{z(!1),N(!0)};tt.useEffect(()=>{W&&b(W)},[W,b]),tt.useEffect(()=>{Y&&Y(l)},[l,Y]),tt.useEffect(()=>{h&&h(y)},[y,h]),tt.useEffect(()=>{_&&A&&A(_)},[_,A]);const f=tt.useMemo(()=>({"--color-tint":o,"--side-padding":`${m}px`,"--top-padding":"30px","--bottom-padding":"70px","--font-size":`${c}em`,"--font-family":x}),[m,c,x]);return _&&!y&&!g?K.jsxs(Dt,{className:`bok-reader-container ${v||""}`,style:a,children:[K.jsx(Ft,{}),K.jsxs("div",{style:{padding:"20px",color:"red"},children:["Error loading EPUB: ",_]})]}):K.jsxs(Dt,{className:`bok-reader-container ${v||""}`,style:{...a,...f},ref:D,children:[K.jsx(Ft,{}),K.jsx(Qt,{isLoading:y,color:o}),g&&K.jsxs(K.Fragment,{children:[C&&!y&&K.jsx(ne,{color:o,onDismiss:X}),K.jsx($t,{content:g,title:l,setIsLoading:i,fontSize:c,sidePadding:m,fontFamily:x,setPadding:w,setFontSize:s,setFontFamily:S,isOptionMenuVisible:d,containerElementRef:D,showTutorial:C}),d&&K.jsx(ee,{onClose:()=>n(!1),fontSize:c,padding:m,fontFamily:x,setPadding:w,setFontSize:s,setFontFamily:S,supportedFonts:r}),!d&&K.jsx("div",{className:"bottom-click-area",onClick:()=>{C||n(!0)},"aria-label":"Open reader options"})]}),!W&&!y&&!_&&K.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"No EPUB loaded."})]})};_t.BokReader=ae,Object.defineProperty(_t,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bok-reader",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "main": "dist/bok.umd.js",
7
7
  "module": "dist/bok.es.js",
@@ -12,6 +12,7 @@
12
12
  "scripts": {
13
13
  "dev": "vite",
14
14
  "build": "rimraf dist && vite build",
15
+ "prepublishOnly": "rimraf dist && vite build",
15
16
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
16
17
  "preview": "vite preview"
17
18
  },