gerbers-renderer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,100 @@
1
+ (function(zt,xt){typeof exports=="object"&&typeof module<"u"?xt(exports):typeof define=="function"&&define.amd?define(["exports"],xt):(zt=typeof globalThis<"u"?globalThis:zt||self,xt(zt.GerbersRenderer={}))})(this,(function(zt){"use strict";var xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qt(M){return M&&M.__esModule&&Object.prototype.hasOwnProperty.call(M,"default")?M.default:M}function Tt(M){throw new Error('Could not dynamically require "'+M+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Dt={exports:{}};var jt;function Kt(){return jt||(jt=1,(function(M,k){(function(a){M.exports=a()})(function(){return(function a(v,m,l){function i(b,y){if(!m[b]){if(!v[b]){var _=typeof Tt=="function"&&Tt;if(!y&&_)return _(b,!0);if(r)return r(b,!0);var d=new Error("Cannot find module '"+b+"'");throw d.code="MODULE_NOT_FOUND",d}var s=m[b]={exports:{}};v[b][0].call(s.exports,function(p){var n=v[b][1][p];return i(n||p)},s,s.exports,a,v,m,l)}return m[b].exports}for(var r=typeof Tt=="function"&&Tt,o=0;o<l.length;o++)i(l[o]);return i})({1:[function(a,v,m){var l=a("./utils"),i=a("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";m.encode=function(o){for(var b,y,_,d,s,p,n,h=[],c=0,g=o.length,x=g,z=l.getTypeOf(o)!=="string";c<o.length;)x=g-c,_=z?(b=o[c++],y=c<g?o[c++]:0,c<g?o[c++]:0):(b=o.charCodeAt(c++),y=c<g?o.charCodeAt(c++):0,c<g?o.charCodeAt(c++):0),d=b>>2,s=(3&b)<<4|y>>4,p=1<x?(15&y)<<2|_>>6:64,n=2<x?63&_:64,h.push(r.charAt(d)+r.charAt(s)+r.charAt(p)+r.charAt(n));return h.join("")},m.decode=function(o){var b,y,_,d,s,p,n=0,h=0,c="data:";if(o.substr(0,c.length)===c)throw new Error("Invalid base64 input, it looks like a data url.");var g,x=3*(o=o.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(o.charAt(o.length-1)===r.charAt(64)&&x--,o.charAt(o.length-2)===r.charAt(64)&&x--,x%1!=0)throw new Error("Invalid base64 input, bad content length.");for(g=i.uint8array?new Uint8Array(0|x):new Array(0|x);n<o.length;)b=r.indexOf(o.charAt(n++))<<2|(d=r.indexOf(o.charAt(n++)))>>4,y=(15&d)<<4|(s=r.indexOf(o.charAt(n++)))>>2,_=(3&s)<<6|(p=r.indexOf(o.charAt(n++))),g[h++]=b,s!==64&&(g[h++]=y),p!==64&&(g[h++]=_);return g}},{"./support":30,"./utils":32}],2:[function(a,v,m){var l=a("./external"),i=a("./stream/DataWorker"),r=a("./stream/Crc32Probe"),o=a("./stream/DataLengthProbe");function b(y,_,d,s,p){this.compressedSize=y,this.uncompressedSize=_,this.crc32=d,this.compression=s,this.compressedContent=p}b.prototype={getContentWorker:function(){var y=new i(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("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 i(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},b.createWorkerFrom=function(y,_,d){return y.pipe(new r).pipe(new o("uncompressedSize")).pipe(_.compressWorker(d)).pipe(new o("compressedSize")).withStreamInfo("compression",_)},v.exports=b},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,v,m){var l=a("./stream/GenericWorker");m.STORE={magic:"\0\0",compressWorker:function(){return new l("STORE compression")},uncompressWorker:function(){return new l("STORE decompression")}},m.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,v,m){var l=a("./utils"),i=(function(){for(var r,o=[],b=0;b<256;b++){r=b;for(var y=0;y<8;y++)r=1&r?3988292384^r>>>1:r>>>1;o[b]=r}return o})();v.exports=function(r,o){return r!==void 0&&r.length?l.getTypeOf(r)!=="string"?(function(b,y,_,d){var s=i,p=d+_;b^=-1;for(var n=d;n<p;n++)b=b>>>8^s[255&(b^y[n])];return-1^b})(0|o,r,r.length,0):(function(b,y,_,d){var s=i,p=d+_;b^=-1;for(var n=d;n<p;n++)b=b>>>8^s[255&(b^y.charCodeAt(n))];return-1^b})(0|o,r,r.length,0):0}},{"./utils":32}],5:[function(a,v,m){m.base64=!1,m.binary=!1,m.dir=!1,m.createFolders=!0,m.date=null,m.compression=null,m.compressionOptions=null,m.comment=null,m.unixPermissions=null,m.dosPermissions=null},{}],6:[function(a,v,m){var l=null;l=typeof Promise<"u"?Promise:a("lie"),v.exports={Promise:l}},{lie:37}],7:[function(a,v,m){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=a("pako"),r=a("./utils"),o=a("./stream/GenericWorker"),b=l?"uint8array":"array";function y(_,d){o.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=d,this.meta={}}m.magic="\b\0",r.inherits(y,o),y.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(b,_.data),!1)},y.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(d){_.push({data:d,meta:_.meta})}},m.compressWorker=function(_){return new y("Deflate",_)},m.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(a,v,m){function l(s,p){var n,h="";for(n=0;n<p;n++)h+=String.fromCharCode(255&s),s>>>=8;return h}function i(s,p,n,h,c,g){var x,z,C=s.file,D=s.compression,T=g!==b.utf8encode,P=r.transformTo("string",g(C.name)),O=r.transformTo("string",b.utf8encode(C.name)),W=C.comment,V=r.transformTo("string",g(W)),w=r.transformTo("string",b.utf8encode(W)),R=O.length!==C.name.length,e=w.length!==W.length,N="",tt="",U="",et=C.dir,X=C.date,J={crc32:0,compressedSize:0,uncompressedSize:0};p&&!n||(J.crc32=s.crc32,J.compressedSize=s.compressedSize,J.uncompressedSize=s.uncompressedSize);var B=0;p&&(B|=8),T||!R&&!e||(B|=2048);var A=0,K=0;et&&(A|=16),c==="UNIX"?(K=798,A|=(function($,ut){var dt=$;return $||(dt=ut?16893:33204),(65535&dt)<<16})(C.unixPermissions,et)):(K=20,A|=(function($){return 63&($||0)})(C.dosPermissions)),x=X.getUTCHours(),x<<=6,x|=X.getUTCMinutes(),x<<=5,x|=X.getUTCSeconds()/2,z=X.getUTCFullYear()-1980,z<<=4,z|=X.getUTCMonth()+1,z<<=5,z|=X.getUTCDate(),R&&(tt=l(1,1)+l(y(P),4)+O,N+="up"+l(tt.length,2)+tt),e&&(U=l(1,1)+l(y(V),4)+w,N+="uc"+l(U.length,2)+U);var H="";return H+=`
2
+ \0`,H+=l(B,2),H+=D.magic,H+=l(x,2),H+=l(z,2),H+=l(J.crc32,4),H+=l(J.compressedSize,4),H+=l(J.uncompressedSize,4),H+=l(P.length,2),H+=l(N.length,2),{fileRecord:_.LOCAL_FILE_HEADER+H+P+N,dirRecord:_.CENTRAL_FILE_HEADER+l(K,2)+H+l(V.length,2)+"\0\0\0\0"+l(A,4)+l(h,4)+P+N+V}}var r=a("../utils"),o=a("../stream/GenericWorker"),b=a("../utf8"),y=a("../crc32"),_=a("../signature");function d(s,p,n,h){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=n,this.encodeFileName=h,this.streamFiles=s,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(d,o),d.prototype.push=function(s){var p=s.meta.percent||0,n=this.entriesCount,h=this._sources.length;this.accumulate?this.contentBuffer.push(s):(this.bytesWritten+=s.data.length,o.prototype.push.call(this,{data:s.data,meta:{currentFile:this.currentFile,percent:n?(p+100*(n-h-1))/n:100}}))},d.prototype.openedSource=function(s){this.currentSourceOffset=this.bytesWritten,this.currentFile=s.file.name;var p=this.streamFiles&&!s.file.dir;if(p){var n=i(s,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(s){this.accumulate=!1;var p=this.streamFiles&&!s.file.dir,n=i(s,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),p)this.push({data:(function(h){return _.DATA_DESCRIPTOR+l(h.crc32,4)+l(h.compressedSize,4)+l(h.uncompressedSize,4)})(s),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var s=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var n=this.bytesWritten-s,h=(function(c,g,x,z,C){var D=r.transformTo("string",C(z));return _.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(c,2)+l(c,2)+l(g,4)+l(x,4)+l(D.length,2)+D})(this.dirRecords.length,n,s,this.zipComment,this.encodeFileName);this.push({data:h,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(s){this._sources.push(s);var p=this;return s.on("data",function(n){p.processChunk(n)}),s.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),s.on("error",function(n){p.error(n)}),this},d.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(s){var p=this._sources;if(!o.prototype.error.call(this,s))return!1;for(var n=0;n<p.length;n++)try{p[n].error(s)}catch{}return!0},d.prototype.lock=function(){o.prototype.lock.call(this);for(var s=this._sources,p=0;p<s.length;p++)s[p].lock()},v.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(a,v,m){var l=a("../compressions"),i=a("./ZipFileWorker");m.generateWorker=function(r,o,b){var y=new i(o.streamFiles,b,o.platform,o.encodeFileName),_=0;try{r.forEach(function(d,s){_++;var p=(function(g,x){var z=g||x,C=l[z];if(!C)throw new Error(z+" is not a valid compression method !");return C})(s.options.compression,o.compression),n=s.options.compressionOptions||o.compressionOptions||{},h=s.dir,c=s.date;s._compressWorker(p,n).withStreamInfo("file",{name:d,dir:h,date:c,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(y)}),y.entriesCount=_}catch(d){y.error(d)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(a,v,m){function l(){if(!(this instanceof l))return new l;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 i=new l;for(var r in this)typeof this[r]!="function"&&(i[r]=this[r]);return i}}(l.prototype=a("./object")).loadAsync=a("./load"),l.support=a("./support"),l.defaults=a("./defaults"),l.version="3.10.1",l.loadAsync=function(i,r){return new l().loadAsync(i,r)},l.external=a("./external"),v.exports=l},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(a,v,m){var l=a("./utils"),i=a("./external"),r=a("./utf8"),o=a("./zipEntries"),b=a("./stream/Crc32Probe"),y=a("./nodejsUtils");function _(d){return new i.Promise(function(s,p){var n=d.decompressed.getContentWorker().pipe(new b);n.on("error",function(h){p(h)}).on("end",function(){n.streamInfo.crc32!==d.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):s()}).resume()})}v.exports=function(d,s){var p=this;return s=l.extend(s||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),y.isNode&&y.isStream(d)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):l.prepareContent("the loaded zip file",d,!0,s.optimizedBinaryString,s.base64).then(function(n){var h=new o(s);return h.load(n),h}).then(function(n){var h=[i.Promise.resolve(n)],c=n.files;if(s.checkCRC32)for(var g=0;g<c.length;g++)h.push(_(c[g]));return i.Promise.all(h)}).then(function(n){for(var h=n.shift(),c=h.files,g=0;g<c.length;g++){var x=c[g],z=x.fileNameStr,C=l.resolve(x.fileNameStr);p.file(C,x.decompressed,{binary:!0,optimizedBinaryString:!0,date:x.date,dir:x.dir,comment:x.fileCommentStr.length?x.fileCommentStr:null,unixPermissions:x.unixPermissions,dosPermissions:x.dosPermissions,createFolders:s.createFolders}),x.dir||(p.file(C).unsafeOriginalName=z)}return h.zipComment.length&&(p.comment=h.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(a,v,m){var l=a("../utils"),i=a("../stream/GenericWorker");function r(o,b){i.call(this,"Nodejs stream input adapter for "+o),this._upstreamEnded=!1,this._bindStream(b)}l.inherits(r,i),r.prototype._bindStream=function(o){var b=this;(this._stream=o).pause(),o.on("data",function(y){b.push({data:y,meta:{percent:0}})}).on("error",function(y){b.isPaused?this.generatedError=y:b.error(y)}).on("end",function(){b.isPaused?b._upstreamEnded=!0:b.end()})},r.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},v.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(a,v,m){var l=a("readable-stream").Readable;function i(r,o,b){l.call(this,o),this._helper=r;var y=this;r.on("data",function(_,d){y.push(_)||y._helper.pause(),b&&b(d)}).on("error",function(_){y.emit("error",_)}).on("end",function(){y.push(null)})}a("../utils").inherits(i,l),i.prototype._read=function(){this._helper.resume()},v.exports=i},{"../utils":32,"readable-stream":16}],14:[function(a,v,m){v.exports={isNode:typeof Buffer<"u",newBufferFrom:function(l,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(l,i);if(typeof l=="number")throw new Error('The "data" argument must not be a number');return new Buffer(l,i)},allocBuffer:function(l){if(Buffer.alloc)return Buffer.alloc(l);var i=new Buffer(l);return i.fill(0),i},isBuffer:function(l){return Buffer.isBuffer(l)},isStream:function(l){return l&&typeof l.on=="function"&&typeof l.pause=="function"&&typeof l.resume=="function"}}},{}],15:[function(a,v,m){function l(C,D,T){var P,O=r.getTypeOf(D),W=r.extend(T||{},y);W.date=W.date||new Date,W.compression!==null&&(W.compression=W.compression.toUpperCase()),typeof W.unixPermissions=="string"&&(W.unixPermissions=parseInt(W.unixPermissions,8)),W.unixPermissions&&16384&W.unixPermissions&&(W.dir=!0),W.dosPermissions&&16&W.dosPermissions&&(W.dir=!0),W.dir&&(C=c(C)),W.createFolders&&(P=h(C))&&g.call(this,P,!0);var V=O==="string"&&W.binary===!1&&W.base64===!1;T&&T.binary!==void 0||(W.binary=!V),(D instanceof _&&D.uncompressedSize===0||W.dir||!D||D.length===0)&&(W.base64=!1,W.binary=!0,D="",W.compression="STORE",O="string");var w=null;w=D instanceof _||D instanceof o?D:p.isNode&&p.isStream(D)?new n(C,D):r.prepareContent(C,D,W.binary,W.optimizedBinaryString,W.base64);var R=new d(C,w,W);this.files[C]=R}var i=a("./utf8"),r=a("./utils"),o=a("./stream/GenericWorker"),b=a("./stream/StreamHelper"),y=a("./defaults"),_=a("./compressedObject"),d=a("./zipObject"),s=a("./generate"),p=a("./nodejsUtils"),n=a("./nodejs/NodejsStreamInputAdapter"),h=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var D=C.lastIndexOf("/");return 0<D?C.substring(0,D):""},c=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},g=function(C,D){return D=D!==void 0?D:y.createFolders,C=c(C),this.files[C]||l.call(this,C,null,{dir:!0,createFolders:D}),this.files[C]};function x(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var z={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var D,T,P;for(D in this.files)P=this.files[D],(T=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&C(T,P)},filter:function(C){var D=[];return this.forEach(function(T,P){C(T,P)&&D.push(P)}),D},file:function(C,D,T){if(arguments.length!==1)return C=this.root+C,l.call(this,C,D,T),this;if(x(C)){var P=C;return this.filter(function(W,V){return!V.dir&&P.test(W)})}var O=this.files[this.root+C];return O&&!O.dir?O:null},folder:function(C){if(!C)return this;if(x(C))return this.filter(function(O,W){return W.dir&&C.test(O)});var D=this.root+C,T=g.call(this,D),P=this.clone();return P.root=T.name,P},remove:function(C){C=this.root+C;var D=this.files[C];if(D||(C.slice(-1)!=="/"&&(C+="/"),D=this.files[C]),D&&!D.dir)delete this.files[C];else for(var T=this.filter(function(O,W){return W.name.slice(0,C.length)===C}),P=0;P<T.length;P++)delete this.files[T[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var D,T={};try{if((T=r.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=T.type.toLowerCase(),T.compression=T.compression.toUpperCase(),T.type==="binarystring"&&(T.type="string"),!T.type)throw new Error("No output type specified.");r.checkSupport(T.type),T.platform!=="darwin"&&T.platform!=="freebsd"&&T.platform!=="linux"&&T.platform!=="sunos"||(T.platform="UNIX"),T.platform==="win32"&&(T.platform="DOS");var P=T.comment||this.comment||"";D=s.generateWorker(this,T,P)}catch(O){(D=new o("error")).error(O)}return new b(D,T.type||"string",T.mimeType)},generateAsync:function(C,D){return this.generateInternalStream(C).accumulate(D)},generateNodeStream:function(C,D){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(D)}};v.exports=z},{"./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(a,v,m){v.exports=a("stream")},{stream:void 0}],17:[function(a,v,m){var l=a("./DataReader");function i(r){l.call(this,r);for(var o=0;o<this.data.length;o++)r[o]=255&r[o]}a("../utils").inherits(i,l),i.prototype.byteAt=function(r){return this.data[this.zero+r]},i.prototype.lastIndexOfSignature=function(r){for(var o=r.charCodeAt(0),b=r.charCodeAt(1),y=r.charCodeAt(2),_=r.charCodeAt(3),d=this.length-4;0<=d;--d)if(this.data[d]===o&&this.data[d+1]===b&&this.data[d+2]===y&&this.data[d+3]===_)return d-this.zero;return-1},i.prototype.readAndCheckSignature=function(r){var o=r.charCodeAt(0),b=r.charCodeAt(1),y=r.charCodeAt(2),_=r.charCodeAt(3),d=this.readData(4);return o===d[0]&&b===d[1]&&y===d[2]&&_===d[3]},i.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var o=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},v.exports=i},{"../utils":32,"./DataReader":18}],18:[function(a,v,m){var l=a("../utils");function i(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}i.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 o,b=0;for(this.checkOffset(r),o=this.index+r-1;o>=this.index;o--)b=(b<<8)+this.byteAt(o);return this.index+=r,b},readString:function(r){return l.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))}},v.exports=i},{"../utils":32}],19:[function(a,v,m){var l=a("./Uint8ArrayReader");function i(r){l.call(this,r)}a("../utils").inherits(i,l),i.prototype.readData=function(r){this.checkOffset(r);var o=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},v.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(a,v,m){var l=a("./DataReader");function i(r){l.call(this,r)}a("../utils").inherits(i,l),i.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},i.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},i.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},i.prototype.readData=function(r){this.checkOffset(r);var o=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},v.exports=i},{"../utils":32,"./DataReader":18}],21:[function(a,v,m){var l=a("./ArrayReader");function i(r){l.call(this,r)}a("../utils").inherits(i,l),i.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var o=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},v.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(a,v,m){var l=a("../utils"),i=a("../support"),r=a("./ArrayReader"),o=a("./StringReader"),b=a("./NodeBufferReader"),y=a("./Uint8ArrayReader");v.exports=function(_){var d=l.getTypeOf(_);return l.checkSupport(d),d!=="string"||i.uint8array?d==="nodebuffer"?new b(_):i.uint8array?new y(l.transformTo("uint8array",_)):new r(l.transformTo("array",_)):new o(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(a,v,m){m.LOCAL_FILE_HEADER="PK",m.CENTRAL_FILE_HEADER="PK",m.CENTRAL_DIRECTORY_END="PK",m.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",m.ZIP64_CENTRAL_DIRECTORY_END="PK",m.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(a,v,m){var l=a("./GenericWorker"),i=a("../utils");function r(o){l.call(this,"ConvertWorker to "+o),this.destType=o}i.inherits(r,l),r.prototype.processChunk=function(o){this.push({data:i.transformTo(this.destType,o.data),meta:o.meta})},v.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(a,v,m){var l=a("./GenericWorker"),i=a("../crc32");function r(){l.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}a("../utils").inherits(r,l),r.prototype.processChunk=function(o){this.streamInfo.crc32=i(o.data,this.streamInfo.crc32||0),this.push(o)},v.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(a,v,m){var l=a("../utils"),i=a("./GenericWorker");function r(o){i.call(this,"DataLengthProbe for "+o),this.propName=o,this.withStreamInfo(o,0)}l.inherits(r,i),r.prototype.processChunk=function(o){if(o){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+o.data.length}i.prototype.processChunk.call(this,o)},v.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(a,v,m){var l=a("../utils"),i=a("./GenericWorker");function r(o){i.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,o.then(function(y){b.dataIsReady=!0,b.data=y,b.max=y&&y.length||0,b.type=l.getTypeOf(y),b.isPaused||b._tickAndRepeat()},function(y){b.error(y)})}l.inherits(r,i),r.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,l.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(l.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var o=null,b=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":o=this.data.substring(this.index,b);break;case"uint8array":o=this.data.subarray(this.index,b);break;case"array":case"nodebuffer":o=this.data.slice(this.index,b)}return this.index=b,this.push({data:o,meta:{percent:this.max?this.index/this.max*100:0}})},v.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(a,v,m){function l(i){this.name=i||"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}l.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,r){return this._listeners[i].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,r){if(this._listeners[i])for(var o=0;o<this._listeners[i].length;o++)this._listeners[i][o].call(this,r)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var r=this;return i.on("data",function(o){r.processChunk(o)}),i.on("end",function(){r.end()}),i.on("error",function(o){r.error(o)}),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 i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,r){return this.extraStreamInfo[i]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},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 i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},v.exports=l},{}],29:[function(a,v,m){var l=a("../utils"),i=a("./ConvertWorker"),r=a("./GenericWorker"),o=a("../base64"),b=a("../support"),y=a("../external"),_=null;if(b.nodestream)try{_=a("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(p,n){return new y.Promise(function(h,c){var g=[],x=p._internalType,z=p._outputType,C=p._mimeType;p.on("data",function(D,T){g.push(D),n&&n(T)}).on("error",function(D){g=[],c(D)}).on("end",function(){try{var D=(function(T,P,O){switch(T){case"blob":return l.newBlob(l.transformTo("arraybuffer",P),O);case"base64":return o.encode(P);default:return l.transformTo(T,P)}})(z,(function(T,P){var O,W=0,V=null,w=0;for(O=0;O<P.length;O++)w+=P[O].length;switch(T){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(V=new Uint8Array(w),O=0;O<P.length;O++)V.set(P[O],W),W+=P[O].length;return V;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+T+"'")}})(x,g),C);h(D)}catch(T){c(T)}g=[]}).resume()})}function s(p,n,h){var c=n;switch(n){case"blob":case"arraybuffer":c="uint8array";break;case"base64":c="string"}try{this._internalType=c,this._outputType=n,this._mimeType=h,l.checkSupport(c),this._worker=p.pipe(new i(c)),p.lock()}catch(g){this._worker=new r("error"),this._worker.error(g)}}s.prototype={accumulate:function(p){return d(this,p)},on:function(p,n){var h=this;return p==="data"?this._worker.on(p,function(c){n.call(h,c.data,c.meta)}):this._worker.on(p,function(){l.delay(n,arguments,h)}),this},resume:function(){return l.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(l.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new _(this,{objectMode:this._outputType!=="nodebuffer"},p)}},v.exports=s},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(a,v,m){if(m.base64=!0,m.array=!0,m.string=!0,m.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",m.nodebuffer=typeof Buffer<"u",m.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")m.blob=!1;else{var l=new ArrayBuffer(0);try{m.blob=new Blob([l],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(l),m.blob=i.getBlob("application/zip").size===0}catch{m.blob=!1}}}try{m.nodestream=!!a("readable-stream").Readable}catch{m.nodestream=!1}},{"readable-stream":16}],31:[function(a,v,m){for(var l=a("./utils"),i=a("./support"),r=a("./nodejsUtils"),o=a("./stream/GenericWorker"),b=new Array(256),y=0;y<256;y++)b[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;b[254]=b[254]=1;function _(){o.call(this,"utf-8 decode"),this.leftOver=null}function d(){o.call(this,"utf-8 encode")}m.utf8encode=function(s){return i.nodebuffer?r.newBufferFrom(s,"utf-8"):(function(p){var n,h,c,g,x,z=p.length,C=0;for(g=0;g<z;g++)(64512&(h=p.charCodeAt(g)))==55296&&g+1<z&&(64512&(c=p.charCodeAt(g+1)))==56320&&(h=65536+(h-55296<<10)+(c-56320),g++),C+=h<128?1:h<2048?2:h<65536?3:4;for(n=i.uint8array?new Uint8Array(C):new Array(C),g=x=0;x<C;g++)(64512&(h=p.charCodeAt(g)))==55296&&g+1<z&&(64512&(c=p.charCodeAt(g+1)))==56320&&(h=65536+(h-55296<<10)+(c-56320),g++),h<128?n[x++]=h:(h<2048?n[x++]=192|h>>>6:(h<65536?n[x++]=224|h>>>12:(n[x++]=240|h>>>18,n[x++]=128|h>>>12&63),n[x++]=128|h>>>6&63),n[x++]=128|63&h);return n})(s)},m.utf8decode=function(s){return i.nodebuffer?l.transformTo("nodebuffer",s).toString("utf-8"):(function(p){var n,h,c,g,x=p.length,z=new Array(2*x);for(n=h=0;n<x;)if((c=p[n++])<128)z[h++]=c;else if(4<(g=b[c]))z[h++]=65533,n+=g-1;else{for(c&=g===2?31:g===3?15:7;1<g&&n<x;)c=c<<6|63&p[n++],g--;1<g?z[h++]=65533:c<65536?z[h++]=c:(c-=65536,z[h++]=55296|c>>10&1023,z[h++]=56320|1023&c)}return z.length!==h&&(z.subarray?z=z.subarray(0,h):z.length=h),l.applyFromCharCode(z)})(s=l.transformTo(i.uint8array?"uint8array":"array",s))},l.inherits(_,o),_.prototype.processChunk=function(s){var p=l.transformTo(i.uint8array?"uint8array":"array",s.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var n=p;(p=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),p.set(n,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var h=(function(g,x){var z;for((x=x||g.length)>g.length&&(x=g.length),z=x-1;0<=z&&(192&g[z])==128;)z--;return z<0||z===0?x:z+b[g[z]]>x?z:x})(p),c=p;h!==p.length&&(i.uint8array?(c=p.subarray(0,h),this.leftOver=p.subarray(h,p.length)):(c=p.slice(0,h),this.leftOver=p.slice(h,p.length))),this.push({data:m.utf8decode(c),meta:s.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:m.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},m.Utf8DecodeWorker=_,l.inherits(d,o),d.prototype.processChunk=function(s){this.push({data:m.utf8encode(s.data),meta:s.meta})},m.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(a,v,m){var l=a("./support"),i=a("./base64"),r=a("./nodejsUtils"),o=a("./external");function b(n){return n}function y(n,h){for(var c=0;c<n.length;++c)h[c]=255&n.charCodeAt(c);return h}a("setimmediate"),m.newBlob=function(n,h){m.checkSupport("blob");try{return new Blob([n],{type:h})}catch{try{var c=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return c.append(n),c.getBlob(h)}catch{throw new Error("Bug : can't construct the Blob.")}}};var _={stringifyByChunk:function(n,h,c){var g=[],x=0,z=n.length;if(z<=c)return String.fromCharCode.apply(null,n);for(;x<z;)h==="array"||h==="nodebuffer"?g.push(String.fromCharCode.apply(null,n.slice(x,Math.min(x+c,z)))):g.push(String.fromCharCode.apply(null,n.subarray(x,Math.min(x+c,z)))),x+=c;return g.join("")},stringifyByChar:function(n){for(var h="",c=0;c<n.length;c++)h+=String.fromCharCode(n[c]);return h},applyCanBeUsed:{uint8array:(function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function d(n){var h=65536,c=m.getTypeOf(n),g=!0;if(c==="uint8array"?g=_.applyCanBeUsed.uint8array:c==="nodebuffer"&&(g=_.applyCanBeUsed.nodebuffer),g)for(;1<h;)try{return _.stringifyByChunk(n,c,h)}catch{h=Math.floor(h/2)}return _.stringifyByChar(n)}function s(n,h){for(var c=0;c<n.length;c++)h[c]=n[c];return h}m.applyFromCharCode=d;var p={};p.string={string:b,array:function(n){return y(n,new Array(n.length))},arraybuffer:function(n){return p.string.uint8array(n).buffer},uint8array:function(n){return y(n,new Uint8Array(n.length))},nodebuffer:function(n){return y(n,r.allocBuffer(n.length))}},p.array={string:d,array:b,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},p.arraybuffer={string:function(n){return d(new Uint8Array(n))},array:function(n){return s(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:b,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},p.uint8array={string:d,array:function(n){return s(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:b,nodebuffer:function(n){return r.newBufferFrom(n)}},p.nodebuffer={string:d,array:function(n){return s(n,new Array(n.length))},arraybuffer:function(n){return p.nodebuffer.uint8array(n).buffer},uint8array:function(n){return s(n,new Uint8Array(n.length))},nodebuffer:b},m.transformTo=function(n,h){if(h=h||"",!n)return h;m.checkSupport(n);var c=m.getTypeOf(h);return p[c][n](h)},m.resolve=function(n){for(var h=n.split("/"),c=[],g=0;g<h.length;g++){var x=h[g];x==="."||x===""&&g!==0&&g!==h.length-1||(x===".."?c.pop():c.push(x))}return c.join("/")},m.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":l.nodebuffer&&r.isBuffer(n)?"nodebuffer":l.uint8array&&n instanceof Uint8Array?"uint8array":l.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},m.checkSupport=function(n){if(!l[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},m.MAX_VALUE_16BITS=65535,m.MAX_VALUE_32BITS=-1,m.pretty=function(n){var h,c,g="";for(c=0;c<(n||"").length;c++)g+="\\x"+((h=n.charCodeAt(c))<16?"0":"")+h.toString(16).toUpperCase();return g},m.delay=function(n,h,c){setImmediate(function(){n.apply(c||null,h||[])})},m.inherits=function(n,h){function c(){}c.prototype=h.prototype,n.prototype=new c},m.extend=function(){var n,h,c={};for(n=0;n<arguments.length;n++)for(h in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],h)&&c[h]===void 0&&(c[h]=arguments[n][h]);return c},m.prepareContent=function(n,h,c,g,x){return o.Promise.resolve(h).then(function(z){return l.blob&&(z instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(z))!==-1)&&typeof FileReader<"u"?new o.Promise(function(C,D){var T=new FileReader;T.onload=function(P){C(P.target.result)},T.onerror=function(P){D(P.target.error)},T.readAsArrayBuffer(z)}):z}).then(function(z){var C=m.getTypeOf(z);return C?(C==="arraybuffer"?z=m.transformTo("uint8array",z):C==="string"&&(x?z=i.decode(z):c&&g!==!0&&(z=(function(D){return y(D,l.uint8array?new Uint8Array(D.length):new Array(D.length))})(z))),z):o.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(a,v,m){var l=a("./reader/readerFor"),i=a("./utils"),r=a("./signature"),o=a("./zipEntry"),b=a("./support");function y(_){this.files=[],this.loadOptions=_}y.prototype={checkSignature:function(_){if(!this.reader.readAndCheckSignature(_)){this.reader.index-=4;var d=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(d)+", expected "+i.pretty(_)+")")}},isSignature:function(_,d){var s=this.reader.index;this.reader.setIndex(_);var p=this.reader.readString(4)===d;return this.reader.setIndex(s),p},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),d=b.uint8array?"uint8array":"array",s=i.transformTo(d,_);this.zipComment=this.loadOptions.decodeFileName(s)},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 _,d,s,p=this.zip64EndOfCentralSize-44;0<p;)_=this.reader.readInt(2),d=this.reader.readInt(4),s=this.reader.readData(d),this.zip64ExtensibleData[_]={id:_,length:d,value:s}},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 _,d;for(_=0;_<this.files.length;_++)d=this.files[_],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var _;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(_=new o({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 d=_;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.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 s=this.centralDirOffset+this.centralDirSize;this.zip64&&(s+=20,s+=12+this.zip64EndOfCentralSize);var p=d-s;if(0<p)this.isSignature(d,r.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(_){this.reader=l(_)},load:function(_){this.prepareReader(_),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},v.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(a,v,m){var l=a("./reader/readerFor"),i=a("./utils"),r=a("./compressedObject"),o=a("./crc32"),b=a("./utf8"),y=a("./compressions"),_=a("./support");function d(s,p){this.options=s,this.loadOptions=p}d.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(s){var p,n;if(s.skip(22),this.fileNameLength=s.readInt(2),n=s.readInt(2),this.fileName=s.readData(this.fileNameLength),s.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((p=(function(h){for(var c in y)if(Object.prototype.hasOwnProperty.call(y,c)&&y[c].magic===h)return y[c];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,p,s.readData(this.compressedSize))},readCentralPart:function(s){this.versionMadeBy=s.readInt(2),s.skip(2),this.bitFlag=s.readInt(2),this.compressionMethod=s.readString(2),this.date=s.readDate(),this.crc32=s.readInt(4),this.compressedSize=s.readInt(4),this.uncompressedSize=s.readInt(4);var p=s.readInt(2);if(this.extraFieldsLength=s.readInt(2),this.fileCommentLength=s.readInt(2),this.diskNumberStart=s.readInt(2),this.internalFileAttributes=s.readInt(2),this.externalFileAttributes=s.readInt(4),this.localHeaderOffset=s.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");s.skip(p),this.readExtraFields(s),this.parseZIP64ExtraField(s),this.fileComment=s.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var s=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),s==0&&(this.dosPermissions=63&this.externalFileAttributes),s==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var s=l(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=s.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=s.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=s.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=s.readInt(4))}},readExtraFields:function(s){var p,n,h,c=s.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});s.index+4<c;)p=s.readInt(2),n=s.readInt(2),h=s.readData(n),this.extraFields[p]={id:p,length:n,value:h};s.setIndex(c)},handleUTF8:function(){var s=_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=b.utf8decode(this.fileName),this.fileCommentStr=b.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var n=i.transformTo(s,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var h=this.findExtraFieldUnicodeComment();if(h!==null)this.fileCommentStr=h;else{var c=i.transformTo(s,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(c)}}},findExtraFieldUnicodePath:function(){var s=this.extraFields[28789];if(s){var p=l(s.value);return p.readInt(1)!==1||o(this.fileName)!==p.readInt(4)?null:b.utf8decode(p.readData(s.length-5))}return null},findExtraFieldUnicodeComment:function(){var s=this.extraFields[25461];if(s){var p=l(s.value);return p.readInt(1)!==1||o(this.fileComment)!==p.readInt(4)?null:b.utf8decode(p.readData(s.length-5))}return null}},v.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(a,v,m){function l(p,n,h){this.name=p,this.dir=h.dir,this.date=h.date,this.comment=h.comment,this.unixPermissions=h.unixPermissions,this.dosPermissions=h.dosPermissions,this._data=n,this._dataBinary=h.binary,this.options={compression:h.compression,compressionOptions:h.compressionOptions}}var i=a("./stream/StreamHelper"),r=a("./stream/DataWorker"),o=a("./utf8"),b=a("./compressedObject"),y=a("./stream/GenericWorker");l.prototype={internalStream:function(p){var n=null,h="string";try{if(!p)throw new Error("No output type specified.");var c=(h=p.toLowerCase())==="string"||h==="text";h!=="binarystring"&&h!=="text"||(h="string"),n=this._decompressWorker();var g=!this._dataBinary;g&&!c&&(n=n.pipe(new o.Utf8EncodeWorker)),!g&&c&&(n=n.pipe(new o.Utf8DecodeWorker))}catch(x){(n=new y("error")).error(x)}return new i(n,h,"")},async:function(p,n){return this.internalStream(p).accumulate(n)},nodeStream:function(p,n){return this.internalStream(p||"nodebuffer").toNodejsStream(n)},_compressWorker:function(p,n){if(this._data instanceof b&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var h=this._decompressWorker();return this._dataBinary||(h=h.pipe(new o.Utf8EncodeWorker)),b.createWorkerFrom(h,p,n)},_decompressWorker:function(){return this._data instanceof b?this._data.getContentWorker():this._data instanceof y?this._data:new r(this._data)}};for(var _=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},s=0;s<_.length;s++)l.prototype[_[s]]=d;v.exports=l},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(a,v,m){(function(l){var i,r,o=l.MutationObserver||l.WebKitMutationObserver;if(o){var b=0,y=new o(p),_=l.document.createTextNode("");y.observe(_,{characterData:!0}),i=function(){_.data=b=++b%2}}else if(l.setImmediate||l.MessageChannel===void 0)i="document"in l&&"onreadystatechange"in l.document.createElement("script")?function(){var n=l.document.createElement("script");n.onreadystatechange=function(){p(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},l.document.documentElement.appendChild(n)}:function(){setTimeout(p,0)};else{var d=new l.MessageChannel;d.port1.onmessage=p,i=function(){d.port2.postMessage(0)}}var s=[];function p(){var n,h;r=!0;for(var c=s.length;c;){for(h=s,s=[],n=-1;++n<c;)h[n]();c=s.length}r=!1}v.exports=function(n){s.push(n)!==1||r||i()}}).call(this,typeof xt<"u"?xt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(a,v,m){var l=a("immediate");function i(){}var r={},o=["REJECTED"],b=["FULFILLED"],y=["PENDING"];function _(c){if(typeof c!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,c!==i&&n(this,c)}function d(c,g,x){this.promise=c,typeof g=="function"&&(this.onFulfilled=g,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}function s(c,g,x){l(function(){var z;try{z=g(x)}catch(C){return r.reject(c,C)}z===c?r.reject(c,new TypeError("Cannot resolve promise with itself")):r.resolve(c,z)})}function p(c){var g=c&&c.then;if(c&&(typeof c=="object"||typeof c=="function")&&typeof g=="function")return function(){g.apply(c,arguments)}}function n(c,g){var x=!1;function z(T){x||(x=!0,r.reject(c,T))}function C(T){x||(x=!0,r.resolve(c,T))}var D=h(function(){g(C,z)});D.status==="error"&&z(D.value)}function h(c,g){var x={};try{x.value=c(g),x.status="success"}catch(z){x.status="error",x.value=z}return x}(v.exports=_).prototype.finally=function(c){if(typeof c!="function")return this;var g=this.constructor;return this.then(function(x){return g.resolve(c()).then(function(){return x})},function(x){return g.resolve(c()).then(function(){throw x})})},_.prototype.catch=function(c){return this.then(null,c)},_.prototype.then=function(c,g){if(typeof c!="function"&&this.state===b||typeof g!="function"&&this.state===o)return this;var x=new this.constructor(i);return this.state!==y?s(x,this.state===b?c:g,this.outcome):this.queue.push(new d(x,c,g)),x},d.prototype.callFulfilled=function(c){r.resolve(this.promise,c)},d.prototype.otherCallFulfilled=function(c){s(this.promise,this.onFulfilled,c)},d.prototype.callRejected=function(c){r.reject(this.promise,c)},d.prototype.otherCallRejected=function(c){s(this.promise,this.onRejected,c)},r.resolve=function(c,g){var x=h(p,g);if(x.status==="error")return r.reject(c,x.value);var z=x.value;if(z)n(c,z);else{c.state=b,c.outcome=g;for(var C=-1,D=c.queue.length;++C<D;)c.queue[C].callFulfilled(g)}return c},r.reject=function(c,g){c.state=o,c.outcome=g;for(var x=-1,z=c.queue.length;++x<z;)c.queue[x].callRejected(g);return c},_.resolve=function(c){return c instanceof this?c:r.resolve(new this(i),c)},_.reject=function(c){var g=new this(i);return r.reject(g,c)},_.all=function(c){var g=this;if(Object.prototype.toString.call(c)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=c.length,z=!1;if(!x)return this.resolve([]);for(var C=new Array(x),D=0,T=-1,P=new this(i);++T<x;)O(c[T],T);return P;function O(W,V){g.resolve(W).then(function(w){C[V]=w,++D!==x||z||(z=!0,r.resolve(P,C))},function(w){z||(z=!0,r.reject(P,w))})}},_.race=function(c){var g=this;if(Object.prototype.toString.call(c)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=c.length,z=!1;if(!x)return this.resolve([]);for(var C=-1,D=new this(i);++C<x;)T=c[C],g.resolve(T).then(function(P){z||(z=!0,r.resolve(D,P))},function(P){z||(z=!0,r.reject(D,P))});var T;return D}},{immediate:36}],38:[function(a,v,m){var l={};(0,a("./lib/utils/common").assign)(l,a("./lib/deflate"),a("./lib/inflate"),a("./lib/zlib/constants")),v.exports=l},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(a,v,m){var l=a("./zlib/deflate"),i=a("./utils/common"),r=a("./utils/strings"),o=a("./zlib/messages"),b=a("./zlib/zstream"),y=Object.prototype.toString,_=0,d=-1,s=0,p=8;function n(c){if(!(this instanceof n))return new n(c);this.options=i.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:s,to:""},c||{});var g=this.options;g.raw&&0<g.windowBits?g.windowBits=-g.windowBits:g.gzip&&0<g.windowBits&&g.windowBits<16&&(g.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var x=l.deflateInit2(this.strm,g.level,g.method,g.windowBits,g.memLevel,g.strategy);if(x!==_)throw new Error(o[x]);if(g.header&&l.deflateSetHeader(this.strm,g.header),g.dictionary){var z;if(z=typeof g.dictionary=="string"?r.string2buf(g.dictionary):y.call(g.dictionary)==="[object ArrayBuffer]"?new Uint8Array(g.dictionary):g.dictionary,(x=l.deflateSetDictionary(this.strm,z))!==_)throw new Error(o[x]);this._dict_set=!0}}function h(c,g){var x=new n(g);if(x.push(c,!0),x.err)throw x.msg||o[x.err];return x.result}n.prototype.push=function(c,g){var x,z,C=this.strm,D=this.options.chunkSize;if(this.ended)return!1;z=g===~~g?g:g===!0?4:0,typeof c=="string"?C.input=r.string2buf(c):y.call(c)==="[object ArrayBuffer]"?C.input=new Uint8Array(c):C.input=c,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new i.Buf8(D),C.next_out=0,C.avail_out=D),(x=l.deflate(C,z))!==1&&x!==_)return this.onEnd(x),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(i.shrinkBuf(C.output,C.next_out))):this.onData(i.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&x!==1);return z===4?(x=l.deflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===_):z!==2||(this.onEnd(_),!(C.avail_out=0))},n.prototype.onData=function(c){this.chunks.push(c)},n.prototype.onEnd=function(c){c===_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=c,this.msg=this.strm.msg},m.Deflate=n,m.deflate=h,m.deflateRaw=function(c,g){return(g=g||{}).raw=!0,h(c,g)},m.gzip=function(c,g){return(g=g||{}).gzip=!0,h(c,g)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(a,v,m){var l=a("./zlib/inflate"),i=a("./utils/common"),r=a("./utils/strings"),o=a("./zlib/constants"),b=a("./zlib/messages"),y=a("./zlib/zstream"),_=a("./zlib/gzheader"),d=Object.prototype.toString;function s(n){if(!(this instanceof s))return new s(n);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},n||{});var h=this.options;h.raw&&0<=h.windowBits&&h.windowBits<16&&(h.windowBits=-h.windowBits,h.windowBits===0&&(h.windowBits=-15)),!(0<=h.windowBits&&h.windowBits<16)||n&&n.windowBits||(h.windowBits+=32),15<h.windowBits&&h.windowBits<48&&(15&h.windowBits)==0&&(h.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var c=l.inflateInit2(this.strm,h.windowBits);if(c!==o.Z_OK)throw new Error(b[c]);this.header=new _,l.inflateGetHeader(this.strm,this.header)}function p(n,h){var c=new s(h);if(c.push(n,!0),c.err)throw c.msg||b[c.err];return c.result}s.prototype.push=function(n,h){var c,g,x,z,C,D,T=this.strm,P=this.options.chunkSize,O=this.options.dictionary,W=!1;if(this.ended)return!1;g=h===~~h?h:h===!0?o.Z_FINISH:o.Z_NO_FLUSH,typeof n=="string"?T.input=r.binstring2buf(n):d.call(n)==="[object ArrayBuffer]"?T.input=new Uint8Array(n):T.input=n,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new i.Buf8(P),T.next_out=0,T.avail_out=P),(c=l.inflate(T,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&O&&(D=typeof O=="string"?r.string2buf(O):d.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,c=l.inflateSetDictionary(this.strm,D)),c===o.Z_BUF_ERROR&&W===!0&&(c=o.Z_OK,W=!1),c!==o.Z_STREAM_END&&c!==o.Z_OK)return this.onEnd(c),!(this.ended=!0);T.next_out&&(T.avail_out!==0&&c!==o.Z_STREAM_END&&(T.avail_in!==0||g!==o.Z_FINISH&&g!==o.Z_SYNC_FLUSH)||(this.options.to==="string"?(x=r.utf8border(T.output,T.next_out),z=T.next_out-x,C=r.buf2string(T.output,x),T.next_out=z,T.avail_out=P-z,z&&i.arraySet(T.output,T.output,x,z,0),this.onData(C)):this.onData(i.shrinkBuf(T.output,T.next_out)))),T.avail_in===0&&T.avail_out===0&&(W=!0)}while((0<T.avail_in||T.avail_out===0)&&c!==o.Z_STREAM_END);return c===o.Z_STREAM_END&&(g=o.Z_FINISH),g===o.Z_FINISH?(c=l.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===o.Z_OK):g!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(T.avail_out=0))},s.prototype.onData=function(n){this.chunks.push(n)},s.prototype.onEnd=function(n){n===o.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},m.Inflate=s,m.inflate=p,m.inflateRaw=function(n,h){return(h=h||{}).raw=!0,p(n,h)},m.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(a,v,m){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";m.assign=function(o){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var y=b.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var _ in y)y.hasOwnProperty(_)&&(o[_]=y[_])}}return o},m.shrinkBuf=function(o,b){return o.length===b?o:o.subarray?o.subarray(0,b):(o.length=b,o)};var i={arraySet:function(o,b,y,_,d){if(b.subarray&&o.subarray)o.set(b.subarray(y,y+_),d);else for(var s=0;s<_;s++)o[d+s]=b[y+s]},flattenChunks:function(o){var b,y,_,d,s,p;for(b=_=0,y=o.length;b<y;b++)_+=o[b].length;for(p=new Uint8Array(_),b=d=0,y=o.length;b<y;b++)s=o[b],p.set(s,d),d+=s.length;return p}},r={arraySet:function(o,b,y,_,d){for(var s=0;s<_;s++)o[d+s]=b[y+s]},flattenChunks:function(o){return[].concat.apply([],o)}};m.setTyped=function(o){o?(m.Buf8=Uint8Array,m.Buf16=Uint16Array,m.Buf32=Int32Array,m.assign(m,i)):(m.Buf8=Array,m.Buf16=Array,m.Buf32=Array,m.assign(m,r))},m.setTyped(l)},{}],42:[function(a,v,m){var l=a("./common"),i=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var o=new l.Buf8(256),b=0;b<256;b++)o[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;function y(_,d){if(d<65537&&(_.subarray&&r||!_.subarray&&i))return String.fromCharCode.apply(null,l.shrinkBuf(_,d));for(var s="",p=0;p<d;p++)s+=String.fromCharCode(_[p]);return s}o[254]=o[254]=1,m.string2buf=function(_){var d,s,p,n,h,c=_.length,g=0;for(n=0;n<c;n++)(64512&(s=_.charCodeAt(n)))==55296&&n+1<c&&(64512&(p=_.charCodeAt(n+1)))==56320&&(s=65536+(s-55296<<10)+(p-56320),n++),g+=s<128?1:s<2048?2:s<65536?3:4;for(d=new l.Buf8(g),n=h=0;h<g;n++)(64512&(s=_.charCodeAt(n)))==55296&&n+1<c&&(64512&(p=_.charCodeAt(n+1)))==56320&&(s=65536+(s-55296<<10)+(p-56320),n++),s<128?d[h++]=s:(s<2048?d[h++]=192|s>>>6:(s<65536?d[h++]=224|s>>>12:(d[h++]=240|s>>>18,d[h++]=128|s>>>12&63),d[h++]=128|s>>>6&63),d[h++]=128|63&s);return d},m.buf2binstring=function(_){return y(_,_.length)},m.binstring2buf=function(_){for(var d=new l.Buf8(_.length),s=0,p=d.length;s<p;s++)d[s]=_.charCodeAt(s);return d},m.buf2string=function(_,d){var s,p,n,h,c=d||_.length,g=new Array(2*c);for(s=p=0;s<c;)if((n=_[s++])<128)g[p++]=n;else if(4<(h=o[n]))g[p++]=65533,s+=h-1;else{for(n&=h===2?31:h===3?15:7;1<h&&s<c;)n=n<<6|63&_[s++],h--;1<h?g[p++]=65533:n<65536?g[p++]=n:(n-=65536,g[p++]=55296|n>>10&1023,g[p++]=56320|1023&n)}return y(g,p)},m.utf8border=function(_,d){var s;for((d=d||_.length)>_.length&&(d=_.length),s=d-1;0<=s&&(192&_[s])==128;)s--;return s<0||s===0?d:s+o[_[s]]>d?s:d}},{"./common":41}],43:[function(a,v,m){v.exports=function(l,i,r,o){for(var b=65535&l|0,y=l>>>16&65535|0,_=0;r!==0;){for(r-=_=2e3<r?2e3:r;y=y+(b=b+i[o++]|0)|0,--_;);b%=65521,y%=65521}return b|y<<16|0}},{}],44:[function(a,v,m){v.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(a,v,m){var l=(function(){for(var i,r=[],o=0;o<256;o++){i=o;for(var b=0;b<8;b++)i=1&i?3988292384^i>>>1:i>>>1;r[o]=i}return r})();v.exports=function(i,r,o,b){var y=l,_=b+o;i^=-1;for(var d=b;d<_;d++)i=i>>>8^y[255&(i^r[d])];return-1^i}},{}],46:[function(a,v,m){var l,i=a("../utils/common"),r=a("./trees"),o=a("./adler32"),b=a("./crc32"),y=a("./messages"),_=0,d=4,s=0,p=-2,n=-1,h=4,c=2,g=8,x=9,z=286,C=30,D=19,T=2*z+1,P=15,O=3,W=258,V=W+O+1,w=42,R=113,e=1,N=2,tt=3,U=4;function et(t,F){return t.msg=y[F],F}function X(t){return(t<<1)-(4<t?9:0)}function J(t){for(var F=t.length;0<=--F;)t[F]=0}function B(t){var F=t.state,I=F.pending;I>t.avail_out&&(I=t.avail_out),I!==0&&(i.arraySet(t.output,F.pending_buf,F.pending_out,I,t.next_out),t.next_out+=I,F.pending_out+=I,t.total_out+=I,t.avail_out-=I,F.pending-=I,F.pending===0&&(F.pending_out=0))}function A(t,F){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,F),t.block_start=t.strstart,B(t.strm)}function K(t,F){t.pending_buf[t.pending++]=F}function H(t,F){t.pending_buf[t.pending++]=F>>>8&255,t.pending_buf[t.pending++]=255&F}function $(t,F){var I,f,u=t.max_chain_length,S=t.strstart,L=t.prev_length,j=t.nice_match,E=t.strstart>t.w_size-V?t.strstart-(t.w_size-V):0,Z=t.window,q=t.w_mask,Y=t.prev,Q=t.strstart+W,lt=Z[S+L-1],st=Z[S+L];t.prev_length>=t.good_match&&(u>>=2),j>t.lookahead&&(j=t.lookahead);do if(Z[(I=F)+L]===st&&Z[I+L-1]===lt&&Z[I]===Z[S]&&Z[++I]===Z[S+1]){S+=2,I++;do;while(Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&Z[++S]===Z[++I]&&S<Q);if(f=W-(Q-S),S=Q-W,L<f){if(t.match_start=F,j<=(L=f))break;lt=Z[S+L-1],st=Z[S+L]}}while((F=Y[F&q])>E&&--u!=0);return L<=t.lookahead?L:t.lookahead}function ut(t){var F,I,f,u,S,L,j,E,Z,q,Y=t.w_size;do{if(u=t.window_size-t.lookahead-t.strstart,t.strstart>=Y+(Y-V)){for(i.arraySet(t.window,t.window,Y,Y,0),t.match_start-=Y,t.strstart-=Y,t.block_start-=Y,F=I=t.hash_size;f=t.head[--F],t.head[F]=Y<=f?f-Y:0,--I;);for(F=I=Y;f=t.prev[--F],t.prev[F]=Y<=f?f-Y:0,--I;);u+=Y}if(t.strm.avail_in===0)break;if(L=t.strm,j=t.window,E=t.strstart+t.lookahead,Z=u,q=void 0,q=L.avail_in,Z<q&&(q=Z),I=q===0?0:(L.avail_in-=q,i.arraySet(j,L.input,L.next_in,q,E),L.state.wrap===1?L.adler=o(L.adler,j,q,E):L.state.wrap===2&&(L.adler=b(L.adler,j,q,E)),L.next_in+=q,L.total_in+=q,q),t.lookahead+=I,t.lookahead+t.insert>=O)for(S=t.strstart-t.insert,t.ins_h=t.window[S],t.ins_h=(t.ins_h<<t.hash_shift^t.window[S+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[S+O-1])&t.hash_mask,t.prev[S&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=S,S++,t.insert--,!(t.lookahead+t.insert<O)););}while(t.lookahead<V&&t.strm.avail_in!==0)}function dt(t,F){for(var I,f;;){if(t.lookahead<V){if(ut(t),t.lookahead<V&&F===_)return e;if(t.lookahead===0)break}if(I=0,t.lookahead>=O&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,I=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),I!==0&&t.strstart-I<=t.w_size-V&&(t.match_length=$(t,I)),t.match_length>=O)if(f=r._tr_tally(t,t.strstart-t.match_start,t.match_length-O),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=O){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,I=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 f=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(f&&(A(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<O-1?t.strstart:O-1,F===d?(A(t,!0),t.strm.avail_out===0?tt:U):t.last_lit&&(A(t,!1),t.strm.avail_out===0)?e:N}function rt(t,F){for(var I,f,u;;){if(t.lookahead<V){if(ut(t),t.lookahead<V&&F===_)return e;if(t.lookahead===0)break}if(I=0,t.lookahead>=O&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,I=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=O-1,I!==0&&t.prev_length<t.max_lazy_match&&t.strstart-I<=t.w_size-V&&(t.match_length=$(t,I),t.match_length<=5&&(t.strategy===1||t.match_length===O&&4096<t.strstart-t.match_start)&&(t.match_length=O-1)),t.prev_length>=O&&t.match_length<=t.prev_length){for(u=t.strstart+t.lookahead-O,f=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-O),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+O-1])&t.hash_mask,I=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=O-1,t.strstart++,f&&(A(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((f=r._tr_tally(t,0,t.window[t.strstart-1]))&&A(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&&(f=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<O-1?t.strstart:O-1,F===d?(A(t,!0),t.strm.avail_out===0?tt:U):t.last_lit&&(A(t,!1),t.strm.avail_out===0)?e:N}function nt(t,F,I,f,u){this.good_length=t,this.max_lazy=F,this.nice_length=I,this.max_chain=f,this.func=u}function ot(){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=g,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 i.Buf16(2*T),this.dyn_dtree=new i.Buf16(2*(2*C+1)),this.bl_tree=new i.Buf16(2*(2*D+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(P+1),this.heap=new i.Buf16(2*z+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*z+1),J(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 at(t){var F;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=c,(F=t.state).pending=0,F.pending_out=0,F.wrap<0&&(F.wrap=-F.wrap),F.status=F.wrap?w:R,t.adler=F.wrap===2?0:1,F.last_flush=_,r._tr_init(F),s):et(t,p)}function it(t){var F=at(t);return F===s&&(function(I){I.window_size=2*I.w_size,J(I.head),I.max_lazy_match=l[I.level].max_lazy,I.good_match=l[I.level].good_length,I.nice_match=l[I.level].nice_length,I.max_chain_length=l[I.level].max_chain,I.strstart=0,I.block_start=0,I.lookahead=0,I.insert=0,I.match_length=I.prev_length=O-1,I.match_available=0,I.ins_h=0})(t.state),F}function G(t,F,I,f,u,S){if(!t)return p;var L=1;if(F===n&&(F=6),f<0?(L=0,f=-f):15<f&&(L=2,f-=16),u<1||x<u||I!==g||f<8||15<f||F<0||9<F||S<0||h<S)return et(t,p);f===8&&(f=9);var j=new ot;return(t.state=j).strm=t,j.wrap=L,j.gzhead=null,j.w_bits=f,j.w_size=1<<j.w_bits,j.w_mask=j.w_size-1,j.hash_bits=u+7,j.hash_size=1<<j.hash_bits,j.hash_mask=j.hash_size-1,j.hash_shift=~~((j.hash_bits+O-1)/O),j.window=new i.Buf8(2*j.w_size),j.head=new i.Buf16(j.hash_size),j.prev=new i.Buf16(j.w_size),j.lit_bufsize=1<<u+6,j.pending_buf_size=4*j.lit_bufsize,j.pending_buf=new i.Buf8(j.pending_buf_size),j.d_buf=1*j.lit_bufsize,j.l_buf=3*j.lit_bufsize,j.level=F,j.strategy=S,j.method=I,it(t)}l=[new nt(0,0,0,0,function(t,F){var I=65535;for(I>t.pending_buf_size-5&&(I=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ut(t),t.lookahead===0&&F===_)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+I;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,A(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-V&&(A(t,!1),t.strm.avail_out===0))return e}return t.insert=0,F===d?(A(t,!0),t.strm.avail_out===0?tt:U):(t.strstart>t.block_start&&(A(t,!1),t.strm.avail_out),e)}),new nt(4,4,8,4,dt),new nt(4,5,16,8,dt),new nt(4,6,32,32,dt),new nt(4,4,16,16,rt),new nt(8,16,32,32,rt),new nt(8,16,128,128,rt),new nt(8,32,128,256,rt),new nt(32,128,258,1024,rt),new nt(32,258,258,4096,rt)],m.deflateInit=function(t,F){return G(t,F,g,15,8,0)},m.deflateInit2=G,m.deflateReset=it,m.deflateResetKeep=at,m.deflateSetHeader=function(t,F){return t&&t.state?t.state.wrap!==2?p:(t.state.gzhead=F,s):p},m.deflate=function(t,F){var I,f,u,S;if(!t||!t.state||5<F||F<0)return t?et(t,p):p;if(f=t.state,!t.output||!t.input&&t.avail_in!==0||f.status===666&&F!==d)return et(t,t.avail_out===0?-5:p);if(f.strm=t,I=f.last_flush,f.last_flush=F,f.status===w)if(f.wrap===2)t.adler=0,K(f,31),K(f,139),K(f,8),f.gzhead?(K(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),K(f,255&f.gzhead.time),K(f,f.gzhead.time>>8&255),K(f,f.gzhead.time>>16&255),K(f,f.gzhead.time>>24&255),K(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),K(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(K(f,255&f.gzhead.extra.length),K(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=b(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(K(f,0),K(f,0),K(f,0),K(f,0),K(f,0),K(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),K(f,3),f.status=R);else{var L=g+(f.w_bits-8<<4)<<8;L|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(L|=32),L+=31-L%31,f.status=R,H(f,L),f.strstart!==0&&(H(f,t.adler>>>16),H(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(u=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>u&&(t.adler=b(t.adler,f.pending_buf,f.pending-u,u)),B(t),u=f.pending,f.pending!==f.pending_buf_size));)K(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>u&&(t.adler=b(t.adler,f.pending_buf,f.pending-u,u)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){u=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>u&&(t.adler=b(t.adler,f.pending_buf,f.pending-u,u)),B(t),u=f.pending,f.pending===f.pending_buf_size)){S=1;break}S=f.gzindex<f.gzhead.name.length?255&f.gzhead.name.charCodeAt(f.gzindex++):0,K(f,S)}while(S!==0);f.gzhead.hcrc&&f.pending>u&&(t.adler=b(t.adler,f.pending_buf,f.pending-u,u)),S===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){u=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>u&&(t.adler=b(t.adler,f.pending_buf,f.pending-u,u)),B(t),u=f.pending,f.pending===f.pending_buf_size)){S=1;break}S=f.gzindex<f.gzhead.comment.length?255&f.gzhead.comment.charCodeAt(f.gzindex++):0,K(f,S)}while(S!==0);f.gzhead.hcrc&&f.pending>u&&(t.adler=b(t.adler,f.pending_buf,f.pending-u,u)),S===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&B(t),f.pending+2<=f.pending_buf_size&&(K(f,255&t.adler),K(f,t.adler>>8&255),t.adler=0,f.status=R)):f.status=R),f.pending!==0){if(B(t),t.avail_out===0)return f.last_flush=-1,s}else if(t.avail_in===0&&X(F)<=X(I)&&F!==d)return et(t,-5);if(f.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||f.lookahead!==0||F!==_&&f.status!==666){var j=f.strategy===2?(function(E,Z){for(var q;;){if(E.lookahead===0&&(ut(E),E.lookahead===0)){if(Z===_)return e;break}if(E.match_length=0,q=r._tr_tally(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++,q&&(A(E,!1),E.strm.avail_out===0))return e}return E.insert=0,Z===d?(A(E,!0),E.strm.avail_out===0?tt:U):E.last_lit&&(A(E,!1),E.strm.avail_out===0)?e:N})(f,F):f.strategy===3?(function(E,Z){for(var q,Y,Q,lt,st=E.window;;){if(E.lookahead<=W){if(ut(E),E.lookahead<=W&&Z===_)return e;if(E.lookahead===0)break}if(E.match_length=0,E.lookahead>=O&&0<E.strstart&&(Y=st[Q=E.strstart-1])===st[++Q]&&Y===st[++Q]&&Y===st[++Q]){lt=E.strstart+W;do;while(Y===st[++Q]&&Y===st[++Q]&&Y===st[++Q]&&Y===st[++Q]&&Y===st[++Q]&&Y===st[++Q]&&Y===st[++Q]&&Y===st[++Q]&&Q<lt);E.match_length=W-(lt-Q),E.match_length>E.lookahead&&(E.match_length=E.lookahead)}if(E.match_length>=O?(q=r._tr_tally(E,1,E.match_length-O),E.lookahead-=E.match_length,E.strstart+=E.match_length,E.match_length=0):(q=r._tr_tally(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++),q&&(A(E,!1),E.strm.avail_out===0))return e}return E.insert=0,Z===d?(A(E,!0),E.strm.avail_out===0?tt:U):E.last_lit&&(A(E,!1),E.strm.avail_out===0)?e:N})(f,F):l[f.level].func(f,F);if(j!==tt&&j!==U||(f.status=666),j===e||j===tt)return t.avail_out===0&&(f.last_flush=-1),s;if(j===N&&(F===1?r._tr_align(f):F!==5&&(r._tr_stored_block(f,0,0,!1),F===3&&(J(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),B(t),t.avail_out===0))return f.last_flush=-1,s}return F!==d?s:f.wrap<=0?1:(f.wrap===2?(K(f,255&t.adler),K(f,t.adler>>8&255),K(f,t.adler>>16&255),K(f,t.adler>>24&255),K(f,255&t.total_in),K(f,t.total_in>>8&255),K(f,t.total_in>>16&255),K(f,t.total_in>>24&255)):(H(f,t.adler>>>16),H(f,65535&t.adler)),B(t),0<f.wrap&&(f.wrap=-f.wrap),f.pending!==0?s:1)},m.deflateEnd=function(t){var F;return t&&t.state?(F=t.state.status)!==w&&F!==69&&F!==73&&F!==91&&F!==103&&F!==R&&F!==666?et(t,p):(t.state=null,F===R?et(t,-3):s):p},m.deflateSetDictionary=function(t,F){var I,f,u,S,L,j,E,Z,q=F.length;if(!t||!t.state||(S=(I=t.state).wrap)===2||S===1&&I.status!==w||I.lookahead)return p;for(S===1&&(t.adler=o(t.adler,F,q,0)),I.wrap=0,q>=I.w_size&&(S===0&&(J(I.head),I.strstart=0,I.block_start=0,I.insert=0),Z=new i.Buf8(I.w_size),i.arraySet(Z,F,q-I.w_size,I.w_size,0),F=Z,q=I.w_size),L=t.avail_in,j=t.next_in,E=t.input,t.avail_in=q,t.next_in=0,t.input=F,ut(I);I.lookahead>=O;){for(f=I.strstart,u=I.lookahead-(O-1);I.ins_h=(I.ins_h<<I.hash_shift^I.window[f+O-1])&I.hash_mask,I.prev[f&I.w_mask]=I.head[I.ins_h],I.head[I.ins_h]=f,f++,--u;);I.strstart=f,I.lookahead=O-1,ut(I)}return I.strstart+=I.lookahead,I.block_start=I.strstart,I.insert=I.lookahead,I.lookahead=0,I.match_length=I.prev_length=O-1,I.match_available=0,t.next_in=j,t.input=E,t.avail_in=L,I.wrap=S,s},m.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(a,v,m){v.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(a,v,m){v.exports=function(l,i){var r,o,b,y,_,d,s,p,n,h,c,g,x,z,C,D,T,P,O,W,V,w,R,e,N;r=l.state,o=l.next_in,e=l.input,b=o+(l.avail_in-5),y=l.next_out,N=l.output,_=y-(i-l.avail_out),d=y+(l.avail_out-257),s=r.dmax,p=r.wsize,n=r.whave,h=r.wnext,c=r.window,g=r.hold,x=r.bits,z=r.lencode,C=r.distcode,D=(1<<r.lenbits)-1,T=(1<<r.distbits)-1;t:do{x<15&&(g+=e[o++]<<x,x+=8,g+=e[o++]<<x,x+=8),P=z[g&D];e:for(;;){if(g>>>=O=P>>>24,x-=O,(O=P>>>16&255)===0)N[y++]=65535&P;else{if(!(16&O)){if((64&O)==0){P=z[(65535&P)+(g&(1<<O)-1)];continue e}if(32&O){r.mode=12;break t}l.msg="invalid literal/length code",r.mode=30;break t}W=65535&P,(O&=15)&&(x<O&&(g+=e[o++]<<x,x+=8),W+=g&(1<<O)-1,g>>>=O,x-=O),x<15&&(g+=e[o++]<<x,x+=8,g+=e[o++]<<x,x+=8),P=C[g&T];r:for(;;){if(g>>>=O=P>>>24,x-=O,!(16&(O=P>>>16&255))){if((64&O)==0){P=C[(65535&P)+(g&(1<<O)-1)];continue r}l.msg="invalid distance code",r.mode=30;break t}if(V=65535&P,x<(O&=15)&&(g+=e[o++]<<x,(x+=8)<O&&(g+=e[o++]<<x,x+=8)),s<(V+=g&(1<<O)-1)){l.msg="invalid distance too far back",r.mode=30;break t}if(g>>>=O,x-=O,(O=y-_)<V){if(n<(O=V-O)&&r.sane){l.msg="invalid distance too far back",r.mode=30;break t}if(R=c,(w=0)===h){if(w+=p-O,O<W){for(W-=O;N[y++]=c[w++],--O;);w=y-V,R=N}}else if(h<O){if(w+=p+h-O,(O-=h)<W){for(W-=O;N[y++]=c[w++],--O;);if(w=0,h<W){for(W-=O=h;N[y++]=c[w++],--O;);w=y-V,R=N}}}else if(w+=h-O,O<W){for(W-=O;N[y++]=c[w++],--O;);w=y-V,R=N}for(;2<W;)N[y++]=R[w++],N[y++]=R[w++],N[y++]=R[w++],W-=3;W&&(N[y++]=R[w++],1<W&&(N[y++]=R[w++]))}else{for(w=y-V;N[y++]=N[w++],N[y++]=N[w++],N[y++]=N[w++],2<(W-=3););W&&(N[y++]=N[w++],1<W&&(N[y++]=N[w++]))}break}}break}}while(o<b&&y<d);o-=W=x>>3,g&=(1<<(x-=W<<3))-1,l.next_in=o,l.next_out=y,l.avail_in=o<b?b-o+5:5-(o-b),l.avail_out=y<d?d-y+257:257-(y-d),r.hold=g,r.bits=x}},{}],49:[function(a,v,m){var l=a("../utils/common"),i=a("./adler32"),r=a("./crc32"),o=a("./inffast"),b=a("./inftrees"),y=1,_=2,d=0,s=-2,p=1,n=852,h=592;function c(w){return(w>>>24&255)+(w>>>8&65280)+((65280&w)<<8)+((255&w)<<24)}function g(){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 l.Buf16(320),this.work=new l.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function x(w){var R;return w&&w.state?(R=w.state,w.total_in=w.total_out=R.total=0,w.msg="",R.wrap&&(w.adler=1&R.wrap),R.mode=p,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new l.Buf32(n),R.distcode=R.distdyn=new l.Buf32(h),R.sane=1,R.back=-1,d):s}function z(w){var R;return w&&w.state?((R=w.state).wsize=0,R.whave=0,R.wnext=0,x(w)):s}function C(w,R){var e,N;return w&&w.state?(N=w.state,R<0?(e=0,R=-R):(e=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15<R)?s:(N.window!==null&&N.wbits!==R&&(N.window=null),N.wrap=e,N.wbits=R,z(w))):s}function D(w,R){var e,N;return w?(N=new g,(w.state=N).window=null,(e=C(w,R))!==d&&(w.state=null),e):s}var T,P,O=!0;function W(w){if(O){var R;for(T=new l.Buf32(512),P=new l.Buf32(32),R=0;R<144;)w.lens[R++]=8;for(;R<256;)w.lens[R++]=9;for(;R<280;)w.lens[R++]=7;for(;R<288;)w.lens[R++]=8;for(b(y,w.lens,0,288,T,0,w.work,{bits:9}),R=0;R<32;)w.lens[R++]=5;b(_,w.lens,0,32,P,0,w.work,{bits:5}),O=!1}w.lencode=T,w.lenbits=9,w.distcode=P,w.distbits=5}function V(w,R,e,N){var tt,U=w.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new l.Buf8(U.wsize)),N>=U.wsize?(l.arraySet(U.window,R,e-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(N<(tt=U.wsize-U.wnext)&&(tt=N),l.arraySet(U.window,R,e-N,tt,U.wnext),(N-=tt)?(l.arraySet(U.window,R,e-N,N,0),U.wnext=N,U.whave=U.wsize):(U.wnext+=tt,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=tt))),0}m.inflateReset=z,m.inflateReset2=C,m.inflateResetKeep=x,m.inflateInit=function(w){return D(w,15)},m.inflateInit2=D,m.inflate=function(w,R){var e,N,tt,U,et,X,J,B,A,K,H,$,ut,dt,rt,nt,ot,at,it,G,t,F,I,f,u=0,S=new l.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!w||!w.state||!w.output||!w.input&&w.avail_in!==0)return s;(e=w.state).mode===12&&(e.mode=13),et=w.next_out,tt=w.output,J=w.avail_out,U=w.next_in,N=w.input,X=w.avail_in,B=e.hold,A=e.bits,K=X,H=J,F=d;t:for(;;)switch(e.mode){case p:if(e.wrap===0){e.mode=13;break}for(;A<16;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(2&e.wrap&&B===35615){S[e.check=0]=255&B,S[1]=B>>>8&255,e.check=r(e.check,S,2,0),A=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){w.msg="incorrect header check",e.mode=30;break}if((15&B)!=8){w.msg="unknown compression method",e.mode=30;break}if(A-=4,t=8+(15&(B>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){w.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,w.adler=e.check=1,e.mode=512&B?10:12,A=B=0;break;case 2:for(;A<16;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(e.flags=B,(255&e.flags)!=8){w.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){w.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=B>>8&1),512&e.flags&&(S[0]=255&B,S[1]=B>>>8&255,e.check=r(e.check,S,2,0)),A=B=0,e.mode=3;case 3:for(;A<32;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}e.head&&(e.head.time=B),512&e.flags&&(S[0]=255&B,S[1]=B>>>8&255,S[2]=B>>>16&255,S[3]=B>>>24&255,e.check=r(e.check,S,4,0)),A=B=0,e.mode=4;case 4:for(;A<16;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}e.head&&(e.head.xflags=255&B,e.head.os=B>>8),512&e.flags&&(S[0]=255&B,S[1]=B>>>8&255,e.check=r(e.check,S,2,0)),A=B=0,e.mode=5;case 5:if(1024&e.flags){for(;A<16;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}e.length=B,e.head&&(e.head.extra_len=B),512&e.flags&&(S[0]=255&B,S[1]=B>>>8&255,e.check=r(e.check,S,2,0)),A=B=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(X<($=e.length)&&($=X),$&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),l.arraySet(e.head.extra,N,U,$,t)),512&e.flags&&(e.check=r(e.check,N,$,U)),X-=$,U+=$,e.length-=$),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(X===0)break t;for($=0;t=N[U+$++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&$<X;);if(512&e.flags&&(e.check=r(e.check,N,$,U)),X-=$,U+=$,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(X===0)break t;for($=0;t=N[U+$++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&$<X;);if(512&e.flags&&(e.check=r(e.check,N,$,U)),X-=$,U+=$,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;A<16;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(B!==(65535&e.check)){w.msg="header crc mismatch",e.mode=30;break}A=B=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),w.adler=e.check=0,e.mode=12;break;case 10:for(;A<32;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}w.adler=e.check=c(B),A=B=0,e.mode=11;case 11:if(e.havedict===0)return w.next_out=et,w.avail_out=J,w.next_in=U,w.avail_in=X,e.hold=B,e.bits=A,2;w.adler=e.check=1,e.mode=12;case 12:if(R===5||R===6)break t;case 13:if(e.last){B>>>=7&A,A-=7&A,e.mode=27;break}for(;A<3;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}switch(e.last=1&B,A-=1,3&(B>>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,R!==6)break;B>>>=2,A-=2;break t;case 2:e.mode=17;break;case 3:w.msg="invalid block type",e.mode=30}B>>>=2,A-=2;break;case 14:for(B>>>=7&A,A-=7&A;A<32;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if((65535&B)!=(B>>>16^65535)){w.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&B,A=B=0,e.mode=15,R===6)break t;case 15:e.mode=16;case 16:if($=e.length){if(X<$&&($=X),J<$&&($=J),$===0)break t;l.arraySet(tt,N,U,$,et),X-=$,U+=$,J-=$,et+=$,e.length-=$;break}e.mode=12;break;case 17:for(;A<14;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(e.nlen=257+(31&B),B>>>=5,A-=5,e.ndist=1+(31&B),B>>>=5,A-=5,e.ncode=4+(15&B),B>>>=4,A-=4,286<e.nlen||30<e.ndist){w.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(;A<3;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}e.lens[L[e.have++]]=7&B,B>>>=3,A-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,I={bits:e.lenbits},F=b(0,e.lens,0,19,e.lencode,0,e.work,I),e.lenbits=I.bits,F){w.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(;nt=(u=e.lencode[B&(1<<e.lenbits)-1])>>>16&255,ot=65535&u,!((rt=u>>>24)<=A);){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(ot<16)B>>>=rt,A-=rt,e.lens[e.have++]=ot;else{if(ot===16){for(f=rt+2;A<f;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(B>>>=rt,A-=rt,e.have===0){w.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],$=3+(3&B),B>>>=2,A-=2}else if(ot===17){for(f=rt+3;A<f;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}A-=rt,t=0,$=3+(7&(B>>>=rt)),B>>>=3,A-=3}else{for(f=rt+7;A<f;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}A-=rt,t=0,$=11+(127&(B>>>=rt)),B>>>=7,A-=7}if(e.have+$>e.nlen+e.ndist){w.msg="invalid bit length repeat",e.mode=30;break}for(;$--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){w.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,I={bits:e.lenbits},F=b(y,e.lens,0,e.nlen,e.lencode,0,e.work,I),e.lenbits=I.bits,F){w.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,I={bits:e.distbits},F=b(_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,I),e.distbits=I.bits,F){w.msg="invalid distances set",e.mode=30;break}if(e.mode=20,R===6)break t;case 20:e.mode=21;case 21:if(6<=X&&258<=J){w.next_out=et,w.avail_out=J,w.next_in=U,w.avail_in=X,e.hold=B,e.bits=A,o(w,H),et=w.next_out,tt=w.output,J=w.avail_out,U=w.next_in,N=w.input,X=w.avail_in,B=e.hold,A=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;nt=(u=e.lencode[B&(1<<e.lenbits)-1])>>>16&255,ot=65535&u,!((rt=u>>>24)<=A);){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(nt&&(240&nt)==0){for(at=rt,it=nt,G=ot;nt=(u=e.lencode[G+((B&(1<<at+it)-1)>>at)])>>>16&255,ot=65535&u,!(at+(rt=u>>>24)<=A);){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}B>>>=at,A-=at,e.back+=at}if(B>>>=rt,A-=rt,e.back+=rt,e.length=ot,nt===0){e.mode=26;break}if(32&nt){e.back=-1,e.mode=12;break}if(64&nt){w.msg="invalid literal/length code",e.mode=30;break}e.extra=15&nt,e.mode=22;case 22:if(e.extra){for(f=e.extra;A<f;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}e.length+=B&(1<<e.extra)-1,B>>>=e.extra,A-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;nt=(u=e.distcode[B&(1<<e.distbits)-1])>>>16&255,ot=65535&u,!((rt=u>>>24)<=A);){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if((240&nt)==0){for(at=rt,it=nt,G=ot;nt=(u=e.distcode[G+((B&(1<<at+it)-1)>>at)])>>>16&255,ot=65535&u,!(at+(rt=u>>>24)<=A);){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}B>>>=at,A-=at,e.back+=at}if(B>>>=rt,A-=rt,e.back+=rt,64&nt){w.msg="invalid distance code",e.mode=30;break}e.offset=ot,e.extra=15&nt,e.mode=24;case 24:if(e.extra){for(f=e.extra;A<f;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}e.offset+=B&(1<<e.extra)-1,B>>>=e.extra,A-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){w.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(J===0)break t;if($=H-J,e.offset>$){if(($=e.offset-$)>e.whave&&e.sane){w.msg="invalid distance too far back",e.mode=30;break}ut=$>e.wnext?($-=e.wnext,e.wsize-$):e.wnext-$,$>e.length&&($=e.length),dt=e.window}else dt=tt,ut=et-e.offset,$=e.length;for(J<$&&($=J),J-=$,e.length-=$;tt[et++]=dt[ut++],--$;);e.length===0&&(e.mode=21);break;case 26:if(J===0)break t;tt[et++]=e.length,J--,e.mode=21;break;case 27:if(e.wrap){for(;A<32;){if(X===0)break t;X--,B|=N[U++]<<A,A+=8}if(H-=J,w.total_out+=H,e.total+=H,H&&(w.adler=e.check=e.flags?r(e.check,tt,H,et-H):i(e.check,tt,H,et-H)),H=J,(e.flags?B:c(B))!==e.check){w.msg="incorrect data check",e.mode=30;break}A=B=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;A<32;){if(X===0)break t;X--,B+=N[U++]<<A,A+=8}if(B!==(4294967295&e.total)){w.msg="incorrect length check",e.mode=30;break}A=B=0}e.mode=29;case 29:F=1;break t;case 30:F=-3;break t;case 31:return-4;case 32:default:return s}return w.next_out=et,w.avail_out=J,w.next_in=U,w.avail_in=X,e.hold=B,e.bits=A,(e.wsize||H!==w.avail_out&&e.mode<30&&(e.mode<27||R!==4))&&V(w,w.output,w.next_out,H-w.avail_out)?(e.mode=31,-4):(K-=w.avail_in,H-=w.avail_out,w.total_in+=K,w.total_out+=H,e.total+=H,e.wrap&&H&&(w.adler=e.check=e.flags?r(e.check,tt,H,w.next_out-H):i(e.check,tt,H,w.next_out-H)),w.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(K==0&&H===0||R===4)&&F===d&&(F=-5),F)},m.inflateEnd=function(w){if(!w||!w.state)return s;var R=w.state;return R.window&&(R.window=null),w.state=null,d},m.inflateGetHeader=function(w,R){var e;return w&&w.state?(2&(e=w.state).wrap)==0?s:((e.head=R).done=!1,d):s},m.inflateSetDictionary=function(w,R){var e,N=R.length;return w&&w.state?(e=w.state).wrap!==0&&e.mode!==11?s:e.mode===11&&i(1,R,N,0)!==e.check?-3:V(w,R,N,N)?(e.mode=31,-4):(e.havedict=1,d):s},m.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(a,v,m){var l=a("../utils/common"),i=[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],o=[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],b=[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];v.exports=function(y,_,d,s,p,n,h,c){var g,x,z,C,D,T,P,O,W,V=c.bits,w=0,R=0,e=0,N=0,tt=0,U=0,et=0,X=0,J=0,B=0,A=null,K=0,H=new l.Buf16(16),$=new l.Buf16(16),ut=null,dt=0;for(w=0;w<=15;w++)H[w]=0;for(R=0;R<s;R++)H[_[d+R]]++;for(tt=V,N=15;1<=N&&H[N]===0;N--);if(N<tt&&(tt=N),N===0)return p[n++]=20971520,p[n++]=20971520,c.bits=1,0;for(e=1;e<N&&H[e]===0;e++);for(tt<e&&(tt=e),w=X=1;w<=15;w++)if(X<<=1,(X-=H[w])<0)return-1;if(0<X&&(y===0||N!==1))return-1;for($[1]=0,w=1;w<15;w++)$[w+1]=$[w]+H[w];for(R=0;R<s;R++)_[d+R]!==0&&(h[$[_[d+R]]++]=R);if(T=y===0?(A=ut=h,19):y===1?(A=i,K-=257,ut=r,dt-=257,256):(A=o,ut=b,-1),w=e,D=n,et=R=B=0,z=-1,C=(J=1<<(U=tt))-1,y===1&&852<J||y===2&&592<J)return 1;for(;;){for(P=w-et,W=h[R]<T?(O=0,h[R]):h[R]>T?(O=ut[dt+h[R]],A[K+h[R]]):(O=96,0),g=1<<w-et,e=x=1<<U;p[D+(B>>et)+(x-=g)]=P<<24|O<<16|W|0,x!==0;);for(g=1<<w-1;B&g;)g>>=1;if(g!==0?(B&=g-1,B+=g):B=0,R++,--H[w]==0){if(w===N)break;w=_[d+h[R]]}if(tt<w&&(B&C)!==z){for(et===0&&(et=tt),D+=e,X=1<<(U=w-et);U+et<N&&!((X-=H[U+et])<=0);)U++,X<<=1;if(J+=1<<U,y===1&&852<J||y===2&&592<J)return 1;p[z=B&C]=tt<<24|U<<16|D-n|0}}return B!==0&&(p[D+B]=w-et<<24|64<<16|0),c.bits=tt,0}},{"../utils/common":41}],51:[function(a,v,m){v.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(a,v,m){var l=a("../utils/common"),i=0,r=1;function o(u){for(var S=u.length;0<=--S;)u[S]=0}var b=0,y=29,_=256,d=_+1+y,s=30,p=19,n=2*d+1,h=15,c=16,g=7,x=256,z=16,C=17,D=18,T=[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],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],V=new Array(2*(d+2));o(V);var w=new Array(2*s);o(w);var R=new Array(512);o(R);var e=new Array(256);o(e);var N=new Array(y);o(N);var tt,U,et,X=new Array(s);function J(u,S,L,j,E){this.static_tree=u,this.extra_bits=S,this.extra_base=L,this.elems=j,this.max_length=E,this.has_stree=u&&u.length}function B(u,S){this.dyn_tree=u,this.max_code=0,this.stat_desc=S}function A(u){return u<256?R[u]:R[256+(u>>>7)]}function K(u,S){u.pending_buf[u.pending++]=255&S,u.pending_buf[u.pending++]=S>>>8&255}function H(u,S,L){u.bi_valid>c-L?(u.bi_buf|=S<<u.bi_valid&65535,K(u,u.bi_buf),u.bi_buf=S>>c-u.bi_valid,u.bi_valid+=L-c):(u.bi_buf|=S<<u.bi_valid&65535,u.bi_valid+=L)}function $(u,S,L){H(u,L[2*S],L[2*S+1])}function ut(u,S){for(var L=0;L|=1&u,u>>>=1,L<<=1,0<--S;);return L>>>1}function dt(u,S,L){var j,E,Z=new Array(h+1),q=0;for(j=1;j<=h;j++)Z[j]=q=q+L[j-1]<<1;for(E=0;E<=S;E++){var Y=u[2*E+1];Y!==0&&(u[2*E]=ut(Z[Y]++,Y))}}function rt(u){var S;for(S=0;S<d;S++)u.dyn_ltree[2*S]=0;for(S=0;S<s;S++)u.dyn_dtree[2*S]=0;for(S=0;S<p;S++)u.bl_tree[2*S]=0;u.dyn_ltree[2*x]=1,u.opt_len=u.static_len=0,u.last_lit=u.matches=0}function nt(u){8<u.bi_valid?K(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 ot(u,S,L,j){var E=2*S,Z=2*L;return u[E]<u[Z]||u[E]===u[Z]&&j[S]<=j[L]}function at(u,S,L){for(var j=u.heap[L],E=L<<1;E<=u.heap_len&&(E<u.heap_len&&ot(S,u.heap[E+1],u.heap[E],u.depth)&&E++,!ot(S,j,u.heap[E],u.depth));)u.heap[L]=u.heap[E],L=E,E<<=1;u.heap[L]=j}function it(u,S,L){var j,E,Z,q,Y=0;if(u.last_lit!==0)for(;j=u.pending_buf[u.d_buf+2*Y]<<8|u.pending_buf[u.d_buf+2*Y+1],E=u.pending_buf[u.l_buf+Y],Y++,j===0?$(u,E,S):($(u,(Z=e[E])+_+1,S),(q=T[Z])!==0&&H(u,E-=N[Z],q),$(u,Z=A(--j),L),(q=P[Z])!==0&&H(u,j-=X[Z],q)),Y<u.last_lit;);$(u,x,S)}function G(u,S){var L,j,E,Z=S.dyn_tree,q=S.stat_desc.static_tree,Y=S.stat_desc.has_stree,Q=S.stat_desc.elems,lt=-1;for(u.heap_len=0,u.heap_max=n,L=0;L<Q;L++)Z[2*L]!==0?(u.heap[++u.heap_len]=lt=L,u.depth[L]=0):Z[2*L+1]=0;for(;u.heap_len<2;)Z[2*(E=u.heap[++u.heap_len]=lt<2?++lt:0)]=1,u.depth[E]=0,u.opt_len--,Y&&(u.static_len-=q[2*E+1]);for(S.max_code=lt,L=u.heap_len>>1;1<=L;L--)at(u,Z,L);for(E=Q;L=u.heap[1],u.heap[1]=u.heap[u.heap_len--],at(u,Z,1),j=u.heap[1],u.heap[--u.heap_max]=L,u.heap[--u.heap_max]=j,Z[2*E]=Z[2*L]+Z[2*j],u.depth[E]=(u.depth[L]>=u.depth[j]?u.depth[L]:u.depth[j])+1,Z[2*L+1]=Z[2*j+1]=E,u.heap[1]=E++,at(u,Z,1),2<=u.heap_len;);u.heap[--u.heap_max]=u.heap[1],(function(st,ct){var mt,bt,Ft,ft,Rt,Ut,kt=ct.dyn_tree,Gt=ct.max_code,fe=ct.stat_desc.static_tree,pe=ct.stat_desc.has_stree,me=ct.stat_desc.extra_bits,Ht=ct.stat_desc.extra_base,Ot=ct.stat_desc.max_length,Pt=0;for(ft=0;ft<=h;ft++)st.bl_count[ft]=0;for(kt[2*st.heap[st.heap_max]+1]=0,mt=st.heap_max+1;mt<n;mt++)Ot<(ft=kt[2*kt[2*(bt=st.heap[mt])+1]+1]+1)&&(ft=Ot,Pt++),kt[2*bt+1]=ft,Gt<bt||(st.bl_count[ft]++,Rt=0,Ht<=bt&&(Rt=me[bt-Ht]),Ut=kt[2*bt],st.opt_len+=Ut*(ft+Rt),pe&&(st.static_len+=Ut*(fe[2*bt+1]+Rt)));if(Pt!==0){do{for(ft=Ot-1;st.bl_count[ft]===0;)ft--;st.bl_count[ft]--,st.bl_count[ft+1]+=2,st.bl_count[Ot]--,Pt-=2}while(0<Pt);for(ft=Ot;ft!==0;ft--)for(bt=st.bl_count[ft];bt!==0;)Gt<(Ft=st.heap[--mt])||(kt[2*Ft+1]!==ft&&(st.opt_len+=(ft-kt[2*Ft+1])*kt[2*Ft],kt[2*Ft+1]=ft),bt--)}})(u,S),dt(Z,lt,u.bl_count)}function t(u,S,L){var j,E,Z=-1,q=S[1],Y=0,Q=7,lt=4;for(q===0&&(Q=138,lt=3),S[2*(L+1)+1]=65535,j=0;j<=L;j++)E=q,q=S[2*(j+1)+1],++Y<Q&&E===q||(Y<lt?u.bl_tree[2*E]+=Y:E!==0?(E!==Z&&u.bl_tree[2*E]++,u.bl_tree[2*z]++):Y<=10?u.bl_tree[2*C]++:u.bl_tree[2*D]++,Z=E,lt=(Y=0)===q?(Q=138,3):E===q?(Q=6,3):(Q=7,4))}function F(u,S,L){var j,E,Z=-1,q=S[1],Y=0,Q=7,lt=4;for(q===0&&(Q=138,lt=3),j=0;j<=L;j++)if(E=q,q=S[2*(j+1)+1],!(++Y<Q&&E===q)){if(Y<lt)for(;$(u,E,u.bl_tree),--Y!=0;);else E!==0?(E!==Z&&($(u,E,u.bl_tree),Y--),$(u,z,u.bl_tree),H(u,Y-3,2)):Y<=10?($(u,C,u.bl_tree),H(u,Y-3,3)):($(u,D,u.bl_tree),H(u,Y-11,7));Z=E,lt=(Y=0)===q?(Q=138,3):E===q?(Q=6,3):(Q=7,4)}}o(X);var I=!1;function f(u,S,L,j){H(u,(b<<1)+(j?1:0),3),(function(E,Z,q,Y){nt(E),K(E,q),K(E,~q),l.arraySet(E.pending_buf,E.window,Z,q,E.pending),E.pending+=q})(u,S,L)}m._tr_init=function(u){I||((function(){var S,L,j,E,Z,q=new Array(h+1);for(E=j=0;E<y-1;E++)for(N[E]=j,S=0;S<1<<T[E];S++)e[j++]=E;for(e[j-1]=E,E=Z=0;E<16;E++)for(X[E]=Z,S=0;S<1<<P[E];S++)R[Z++]=E;for(Z>>=7;E<s;E++)for(X[E]=Z<<7,S=0;S<1<<P[E]-7;S++)R[256+Z++]=E;for(L=0;L<=h;L++)q[L]=0;for(S=0;S<=143;)V[2*S+1]=8,S++,q[8]++;for(;S<=255;)V[2*S+1]=9,S++,q[9]++;for(;S<=279;)V[2*S+1]=7,S++,q[7]++;for(;S<=287;)V[2*S+1]=8,S++,q[8]++;for(dt(V,d+1,q),S=0;S<s;S++)w[2*S+1]=5,w[2*S]=ut(S,5);tt=new J(V,T,_+1,d,h),U=new J(w,P,0,s,h),et=new J(new Array(0),O,0,p,g)})(),I=!0),u.l_desc=new B(u.dyn_ltree,tt),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,rt(u)},m._tr_stored_block=f,m._tr_flush_block=function(u,S,L,j){var E,Z,q=0;0<u.level?(u.strm.data_type===2&&(u.strm.data_type=(function(Y){var Q,lt=4093624447;for(Q=0;Q<=31;Q++,lt>>>=1)if(1&lt&&Y.dyn_ltree[2*Q]!==0)return i;if(Y.dyn_ltree[18]!==0||Y.dyn_ltree[20]!==0||Y.dyn_ltree[26]!==0)return r;for(Q=32;Q<_;Q++)if(Y.dyn_ltree[2*Q]!==0)return r;return i})(u)),G(u,u.l_desc),G(u,u.d_desc),q=(function(Y){var Q;for(t(Y,Y.dyn_ltree,Y.l_desc.max_code),t(Y,Y.dyn_dtree,Y.d_desc.max_code),G(Y,Y.bl_desc),Q=p-1;3<=Q&&Y.bl_tree[2*W[Q]+1]===0;Q--);return Y.opt_len+=3*(Q+1)+5+5+4,Q})(u),E=u.opt_len+3+7>>>3,(Z=u.static_len+3+7>>>3)<=E&&(E=Z)):E=Z=L+5,L+4<=E&&S!==-1?f(u,S,L,j):u.strategy===4||Z===E?(H(u,2+(j?1:0),3),it(u,V,w)):(H(u,4+(j?1:0),3),(function(Y,Q,lt,st){var ct;for(H(Y,Q-257,5),H(Y,lt-1,5),H(Y,st-4,4),ct=0;ct<st;ct++)H(Y,Y.bl_tree[2*W[ct]+1],3);F(Y,Y.dyn_ltree,Q-1),F(Y,Y.dyn_dtree,lt-1)})(u,u.l_desc.max_code+1,u.d_desc.max_code+1,q+1),it(u,u.dyn_ltree,u.dyn_dtree)),rt(u),j&&nt(u)},m._tr_tally=function(u,S,L){return u.pending_buf[u.d_buf+2*u.last_lit]=S>>>8&255,u.pending_buf[u.d_buf+2*u.last_lit+1]=255&S,u.pending_buf[u.l_buf+u.last_lit]=255&L,u.last_lit++,S===0?u.dyn_ltree[2*L]++:(u.matches++,S--,u.dyn_ltree[2*(e[L]+_+1)]++,u.dyn_dtree[2*A(S)]++),u.last_lit===u.lit_bufsize-1},m._tr_align=function(u){H(u,2,3),$(u,x,V),(function(S){S.bi_valid===16?(K(S,S.bi_buf),S.bi_buf=0,S.bi_valid=0):8<=S.bi_valid&&(S.pending_buf[S.pending++]=255&S.bi_buf,S.bi_buf>>=8,S.bi_valid-=8)})(u)}},{"../utils/common":41}],53:[function(a,v,m){v.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(a,v,m){(function(l){(function(i,r){if(!i.setImmediate){var o,b,y,_,d=1,s={},p=!1,n=i.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(i);h=h&&h.setTimeout?h:i,o={}.toString.call(i.process)==="[object process]"?function(z){process.nextTick(function(){g(z)})}:(function(){if(i.postMessage&&!i.importScripts){var z=!0,C=i.onmessage;return i.onmessage=function(){z=!1},i.postMessage("","*"),i.onmessage=C,z}})()?(_="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",x,!1):i.attachEvent("onmessage",x),function(z){i.postMessage(_+z,"*")}):i.MessageChannel?((y=new MessageChannel).port1.onmessage=function(z){g(z.data)},function(z){y.port2.postMessage(z)}):n&&"onreadystatechange"in n.createElement("script")?(b=n.documentElement,function(z){var C=n.createElement("script");C.onreadystatechange=function(){g(z),C.onreadystatechange=null,b.removeChild(C),C=null},b.appendChild(C)}):function(z){setTimeout(g,0,z)},h.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var C=new Array(arguments.length-1),D=0;D<C.length;D++)C[D]=arguments[D+1];var T={callback:z,args:C};return s[d]=T,o(d),d++},h.clearImmediate=c}function c(z){delete s[z]}function g(z){if(p)setTimeout(g,0,z);else{var C=s[z];if(C){p=!0;try{(function(D){var T=D.callback,P=D.args;switch(P.length){case 0:T();break;case 1:T(P[0]);break;case 2:T(P[0],P[1]);break;case 3:T(P[0],P[1],P[2]);break;default:T.apply(r,P)}})(C)}finally{c(z),p=!1}}}}function x(z){z.source===i&&typeof z.data=="string"&&z.data.indexOf(_)===0&&g(+z.data.slice(_.length))}})(typeof self>"u"?l===void 0?this:l:self)}).call(this,typeof xt<"u"?xt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Dt)),Dt.exports}var Vt=Kt();const Jt=qt(Vt);function Nt(M){return M.toLowerCase()}function St(M,k){const a=new Set(k.map(m=>m.toLowerCase()));return M.filter(m=>{const l=Nt(m),i=l.lastIndexOf(".");return i<0?!1:a.has(l.slice(i))}).sort((m,l)=>m.length-l.length)[0]}function ht(M,k){const a=k.map(m=>m.toLowerCase());return M.filter(m=>{const l=Nt(m);return a.every(i=>l.includes(i))}).sort((m,l)=>m.length-l.length)[0]}function Qt(M){const k=M.filter(y=>{const _=Nt(y);return!(_.endsWith("/")||_.includes("__macosx")||_.endsWith(".ds_store"))}),a=St(k,[".gtl"])||ht(k,["f_cu"])||ht(k,["top","cu"])||ht(k,["top","copper"]),v=St(k,[".gbl"])||ht(k,["b_cu"])||ht(k,["bottom","cu"])||ht(k,["bottom","copper"]),m=St(k,[".gts"])||ht(k,["f_mask"])||ht(k,["top","mask"]),l=St(k,[".gbs"])||ht(k,["b_mask"])||ht(k,["bottom","mask"]),i=St(k,[".gto"])||ht(k,["f_silks"])||ht(k,["f_silk"])||ht(k,["top","silk"]),r=St(k,[".gbo"])||ht(k,["b_silks"])||ht(k,["b_silk"])||ht(k,["bottom","silk"]),o=St(k,[".gko",".gm1"])||ht(k,["edge","cuts"])||ht(k,["outline"])||ht(k,["board","outline"]),b=St(k,[".drl",".xln"])||ht(k,["drill"])||ht(k,["drills"])||ht(k,["npth"])||ht(k,["pth"]);return{top_copper:a,bottom_copper:v,top_mask:m,bottom_mask:l,top_silk:i,bottom_silk:r,outline:o,drills:b}}const te=.8;function At(M,k,a){const v={unitScale:1,fmtInt:2,fmtDec:4,x:0,y:0,apertures:new Map,currentAperture:null,inRegion:!1,regionPaths:[],currentPath:[],tracks:[],arcs:[],flashes:[],regions:[]},m=k.split(/\r?\n/);for(const l of m){let i=l.trim();if(i&&!i.startsWith("G04")){if(i.startsWith("%")&&i.endsWith("%")){ee(i,v);continue}i.endsWith("*")&&(i=i.slice(0,-1)),re(i,v)}}return v.inRegion&&(v.currentPath.length>=3&&v.regionPaths.push(v.currentPath),v.regionPaths.length>0&&v.regions.push({boundary:v.regionPaths[0],holes:v.regionPaths.slice(1)}),v.inRegion=!1,v.regionPaths=[],v.currentPath=[]),{tracks:v.tracks,arcs:v.arcs,flashes:v.flashes,regions:v.regions}}function ee(M,k){let a=M;if(a.startsWith("%")&&(a=a.slice(1)),a.endsWith("%")&&(a=a.slice(0,-1)),a.endsWith("*")&&(a=a.slice(0,-1)),a.startsWith("FS")){const v=/FS..X(\d)(\d)Y(\d)(\d)/.exec(a);if(v){const m=parseInt(v[1],10),l=parseInt(v[2],10);parseInt(v[4],10),k.fmtInt=m,k.fmtDec=l}return}if(a.startsWith("MO")){const v=k.unitScale;let m=v;if(a.includes("MOMM")?m=1:a.includes("MOIN")&&(m=25.4),m!==v){const l=m/v;for(const i of k.apertures.values())i.diameterMm!==void 0&&(i.diameterMm*=l),i.widthMm!==void 0&&(i.widthMm*=l),i.heightMm!==void 0&&(i.heightMm*=l);k.unitScale=m}return}if(a.startsWith("AD")){const v=/AD(D?)(\d+)([A-Z]),?([0-9.Xx]*)/.exec(a);if(!v)return;const m=parseInt(v[2],10),l=v[3],i=v[4]??"";let r,o,b;if(i){const _=i.split(/[Xx]/),d=_[0]?parseFloat(_[0])*k.unitScale:void 0,s=_[1]?parseFloat(_[1])*k.unitScale:void 0;l==="C"?r=d:l==="R"||l==="O"?(o=d,b=s,d!==void 0&&s!==void 0?r=Math.min(d,s):r=d??s):r=d??s}const y={code:m,shape:l,diameterMm:r,widthMm:o,heightMm:b};k.apertures.set(m,y);return}}function re(M,k){if(M==="G36"){k.inRegion=!0,k.regionPaths=[],k.currentPath=[];return}if(M==="G37"){k.currentPath.length>=3&&k.regionPaths.push(k.currentPath),k.inRegion=!1,k.regionPaths.length>0&&k.regions.push({boundary:k.regionPaths[0],holes:k.regionPaths.slice(1)}),k.regionPaths=[],k.currentPath=[];return}let a=null;const v=/D0?(\d{1,3})$/.exec(M);if(v&&(a=parseInt(v[1],10),M=M.slice(0,M.length-v[0].length)),a!==null&&a>=10){const y=k.apertures.get(a);y&&(k.currentAperture=y);return}const m=/X([+\-]?\d+)/.exec(M),l=/Y([+\-]?\d+)/.exec(M);let i=k.x,r=k.y;if(m&&(i=Wt(m[1],k)),l&&(r=Wt(l[1],k)),a===null){k.x=i,k.y=r;return}if(k.inRegion){const y=k.x,_=k.y;a===1?(k.currentPath.length===0&&k.currentPath.push({x:y,y:_}),k.currentPath.push({x:i,y:r})):a===2&&(k.currentPath.length>=3&&k.regionPaths.push(k.currentPath),k.currentPath=[]),k.x=i,k.y=r;return}const o=k.x,b=k.y;if(a===1){if(!k.currentAperture){k.x=i,k.y=r;return}const y=k.currentAperture.diameterMm!==void 0?k.currentAperture.diameterMm:.2;k.tracks.push({start:{x:o,y:b},end:{x:i,y:r},width:y}),k.x=i,k.y=r;return}if(a===2){k.x=i,k.y=r;return}if(a===3){if(k.currentAperture){const y=k.currentAperture,_=y.diameterMm!==void 0?y.diameterMm:te,d={position:{x:i,y:r},diameterMm:_,shape:y.shape};y.widthMm!==void 0&&(d.widthMm=y.widthMm),y.heightMm!==void 0&&(d.heightMm=y.heightMm),k.flashes.push(d)}k.x=i,k.y=r;return}}function Wt(M,k){const a=M.startsWith("-")?-1:1,v=M.replace(/[+\-]/g,""),m=parseInt(v,10);if(Number.isNaN(m))return 0;const l=Math.pow(10,k.fmtDec),i=m/l*k.unitScale;return a*i}function ne(M,k){const a=k.split(/\r?\n/),v=new Map;let m=null;const l=[];for(const i of a){const r=i.trim();if(r&&!r.startsWith(";")){if(r.startsWith("T")&&r.includes("C")){const o=/^T(\d+)[C]([\d.]+)/i.exec(r);if(o){const b=o[1],y=parseFloat(o[2]);Number.isNaN(y)||v.set(b,y)}continue}if(r.startsWith("T")&&!r.includes("C")){const o=/^T(\d+)/i.exec(r);o&&(m=o[1]);continue}if(r[0]==="X"||r.includes("X")){const o=/X([\-0-9.]+)Y([\-0-9.]+)/i.exec(r);if(!o)continue;const b=o[1],y=o[2],_=parseFloat(b),d=parseFloat(y);if(Number.isNaN(_)||Number.isNaN(d))continue;const s=m&&v.has(m)?v.get(m):.6;l.push({x:_,y:d,diameter:s,plated:!0});continue}}}return{name:M,holes:l}}function ie(M){return{w:M.maxX-M.minX,h:M.maxY-M.minY}}function It(M){const{w:k,h:a}=ie(M);return Number.isFinite(k)&&Number.isFinite(a)&&k>1&&a>1&&k<2e3&&a<2e3}function Et(M,k){if(!Number.isFinite(M)||!Number.isFinite(k)||M<=0||k<=0)return 1;const a=M/k;return a>20&&a<35?1/25.4:a>.02&&a<.06?25.4:1}function Bt(M,k){return k===1?M:{...M,tracks:M.tracks.map(a=>({...a,start:{x:a.start.x*k,y:a.start.y*k},end:{x:a.end.x*k,y:a.end.y*k},width:(a.width??0)*k})),flashes:M.flashes.map(a=>({...a,position:{x:a.position.x*k,y:a.position.y*k},diameterMm:(a.diameterMm??0)*k,widthMm:(a.widthMm??0)*k,heightMm:(a.heightMm??0)*k})),regions:M.regions.map(a=>({...a,boundary:a.boundary.map(v=>({x:v.x*k,y:v.y*k})),holes:a.holes.map(v=>v.map(m=>({x:m.x*k,y:m.y*k})))}))}}function se(M,k){return k===1?M:M.map(a=>({x:a.x*k,y:a.y*k,diameter:(a.diameter??0)*k}))}function ae(M){return URL.createObjectURL(new Blob([M],{type:"image/svg+xml"}))}function gt(M,k,a){M.minX=Math.min(M.minX,k),M.minY=Math.min(M.minY,a),M.maxX=Math.max(M.maxX,k),M.maxY=Math.max(M.maxY,a)}function Lt(){return{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ct(M){const k=Lt();for(const a of M.tracks){gt(k,a.start.x,a.start.y),gt(k,a.end.x,a.end.y);const v=(a.width??0)/2;gt(k,a.start.x-v,a.start.y-v),gt(k,a.start.x+v,a.start.y+v),gt(k,a.end.x-v,a.end.y-v),gt(k,a.end.x+v,a.end.y+v)}for(const a of M.flashes){const v=(a.widthMm??a.diameterMm)||0,m=(a.heightMm??a.diameterMm)||0;gt(k,a.position.x-v/2,a.position.y-m/2),gt(k,a.position.x+v/2,a.position.y+m/2)}for(const a of M.regions){for(const v of a.boundary)gt(k,v.x,v.y);for(const v of a.holes)for(const m of v)gt(k,m.x,m.y)}return k}function oe(M){const k=Lt();for(const a of M){const v=(a.diameter||0)/2;gt(k,a.x-v,a.y-v),gt(k,a.x+v,a.y+v)}return k}function Xt(M,k){return{minX:Math.min(M.minX,k.minX),minY:Math.min(M.minY,k.minY),maxX:Math.max(M.maxX,k.maxX),maxY:Math.max(M.maxY,k.maxY)}}function yt(M){return!Number.isFinite(M.minX)||!Number.isFinite(M.minY)||!Number.isFinite(M.maxX)||!Number.isFinite(M.maxY)?{minX:0,minY:0,maxX:80,maxY:60}:(M.maxX-M.minX<1e-6&&(M.maxX=M.minX+1),M.maxY-M.minY<1e-6&&(M.maxY=M.minY+1),M)}const le=1e3;function _t(M){return M/25.4*le}function vt(M,k,a){const v=M-a.minX,m=a.maxY-k;return{x:v,y:m}}function Zt(M,k){return`
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="${M}" height="${k}" viewBox="0 0 ${M} ${k}">
4
+ <rect width="${M}" height="${k}" fill="white"/>
5
+ </svg>`.trim()}function $t(M,k,a,v){const m=k.maxX-k.minX,l=k.maxY-k.minY,i=Math.round(_t(m)),r=Math.round(_t(l)),o=_t(1),b=M.tracks.map(d=>{const s=vt(d.start.x,d.start.y,k),p=vt(d.end.x,d.end.y,k),n=Math.max(1,(d.width||.2)*o);return`<line x1="${(s.x*o).toFixed(2)}" y1="${(s.y*o).toFixed(2)}" x2="${(p.x*o).toFixed(2)}" y2="${(p.y*o).toFixed(2)}" stroke="${a}" stroke-width="${n.toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" />`}),y=M.flashes.map(d=>{const s=vt(d.position.x,d.position.y,k),p=s.x*o,n=s.y*o,h=(d.widthMm??d.diameterMm)||.8,c=(d.heightMm??d.diameterMm)||.8;if(d.shape==="R"||d.shape==="O"){const x=h*o,z=c*o,C=p-x/2,D=n-z/2,T=d.shape==="O"?Math.min(x,z)*.4:0;return`<rect x="${C.toFixed(2)}" y="${D.toFixed(2)}" width="${x.toFixed(2)}" height="${z.toFixed(2)}" rx="${T.toFixed(2)}" fill="${v}" />`}const g=(d.diameterMm||.8)*o/2;return`<circle cx="${p.toFixed(2)}" cy="${n.toFixed(2)}" r="${Math.max(1,g).toFixed(2)}" fill="${v}" />`}),_=M.regions.map(d=>`<polygon points="${d.boundary.map(p=>{const n=vt(p.x,p.y,k);return`${(n.x*o).toFixed(2)},${(n.y*o).toFixed(2)}`}).join(" ")}" fill="${v}" opacity="0.9" />`);return`
6
+ <svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${r}" viewBox="0 0 ${i} ${r}">
7
+ ${b.join(`
8
+ `)}
9
+ ${y.join(`
10
+ `)}
11
+ ${_.join(`
12
+ `)}
13
+ </svg>`.trim()}function Yt(M,k){const a=k.maxX-k.minX,v=k.maxY-k.minY,m=Math.max(1,Math.round(_t(a))),l=Math.max(1,Math.round(_t(v))),i=Math.max(1e-6,_t(1)),r="rgba(255,255,255,0.95)",o="rgba(255,255,255,0.95)",b=M.tracks.map(d=>{const s=vt(d.start.x,d.start.y,k),p=vt(d.end.x,d.end.y,k),n=Math.max(1,(d.width||.15)*i);return`<line x1="${(s.x*i).toFixed(2)}" y1="${(s.y*i).toFixed(2)}" x2="${(p.x*i).toFixed(2)}" y2="${(p.y*i).toFixed(2)}" stroke="${r}" stroke-width="${n.toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" />`}),y=M.flashes.map(d=>{const s=vt(d.position.x,d.position.y,k),p=s.x*i,n=s.y*i,h=(d.widthMm??d.diameterMm)||.6,c=(d.heightMm??d.diameterMm)||.6;if(d.shape==="R"||d.shape==="O"){const x=h*i,z=c*i,C=p-x/2,D=n-z/2,T=d.shape==="O"?Math.min(x,z)*.35:0;return`<rect x="${C.toFixed(2)}" y="${D.toFixed(2)}" width="${x.toFixed(2)}" height="${z.toFixed(2)}" rx="${T.toFixed(2)}" fill="${o}" />`}const g=(d.diameterMm||.6)*i/2;return`<circle cx="${p.toFixed(2)}" cy="${n.toFixed(2)}" r="${Math.max(1,g).toFixed(2)}" fill="${o}" />`}),_=M.regions.map(d=>`<polygon points="${d.boundary.map(p=>{const n=vt(p.x,p.y,k);return`${(n.x*i).toFixed(2)},${(n.y*i).toFixed(2)}`}).join(" ")}" fill="${o}" opacity="0.95" />`);return`
14
+ <svg xmlns="http://www.w3.org/2000/svg" width="${m}" height="${l}" viewBox="0 0 ${m} ${l}">
15
+ ${b.join(`
16
+ `)}
17
+ ${y.join(`
18
+ `)}
19
+ ${_.join(`
20
+ `)}
21
+ </svg>`.trim()}function ce(M,k){const a=k.maxX-k.minX,v=k.maxY-k.minY,m=Math.round(_t(a)),l=Math.round(_t(v)),i=_t(1),r=M.map(o=>{const b=vt(o.x,o.y,k),y=b.x*i,_=b.y*i,d=(o.diameter||.6)*i/2;return`<circle cx="${y.toFixed(2)}" cy="${_.toFixed(2)}" r="${Math.max(1,d).toFixed(2)}" fill="none" stroke="#e5e7eb" stroke-width="3" />`});return`
22
+ <svg xmlns="http://www.w3.org/2000/svg" width="${m}" height="${l}" viewBox="0 0 ${m} ${l}">
23
+ ${r.join(`
24
+ `)}
25
+ </svg>`.trim()}async function ue(M){const k=await Jt.loadAsync(M),a=Object.keys(k.files).filter(it=>!k.files[it].dir),v=Qt(a);async function m(it){if(!it)return null;const G=k.file(it);return G?await G.async("text"):null}const l=await m(v.top_copper),i=await m(v.bottom_copper),r=await m(v.outline),o=await m(v.drills),b=await m(v.top_silk),y=await m(v.bottom_silk),_=l?At(v.top_copper||"top",l):null,d=i?At(v.bottom_copper||"bot",i):null,s=r?At(v.outline||"outline",r):null,p=o?ne(v.drills||"drills",o):null,n=b?At(v.top_silk||"top_silk",b):null,h=y?At(v.bottom_silk||"bot_silk",y):null;console.log("[silk parsed]",{top:n?{tracks:n.tracks.length,flashes:n.flashes.length,regions:n.regions.length}:null,bottom:h?{tracks:h.tracks.length,flashes:h.flashes.length,regions:h.regions.length}:null});const c=p?p.holes.map(it=>({x:it.x,y:it.y,diameter:it.diameter})):[],g=_?yt(Ct(_)):null,x=d?yt(Ct(d)):null,z=s?yt(Ct(s)):null,C=c.length?yt(oe(c)):null,D=n?yt(Ct(n)):null,T=h?yt(Ct(h)):null,P=(z&&It(z)?z:null)||(g&&It(g)?g:null)||(x&&It(x)?x:null)||(C&&It(C)?C:null),O=P?P.maxX-P.minX:1,W=g?Et(g.maxX-g.minX,O):1,V=x?Et(x.maxX-x.minX,O):1,w=z?Et(z.maxX-z.minX,O):1,R=C?Et(C.maxX-C.minX,O):1,e=D?Et(D.maxX-D.minX,O):1,N=T?Et(T.maxX-T.minX,O):1;console.log("[scale factors]",{topScale:W,botScale:V,outScale:w,drlScale:R,topSilkScale:e,botSilkScale:N});const tt=_?Bt(_,W):null,U=d?Bt(d,V):null,et=s?Bt(s,w):null,X=c.length?se(c,R):[],J=n?Bt(n,e):null,B=h?Bt(h,N):null;let A=null;if(et){const it=yt(Ct(et));It(it)&&(A=it)}if(!A){let it=Lt();tt&&(it=Xt(it,Ct(tt))),U&&(it=Xt(it,Ct(U))),it=yt(it),A=it}const K=yt(A),H=K.maxX-K.minX,$=K.maxY-K.minY,ut={board:{width_in:H/25.4,height_in:$/25.4,mm_bounds:{min_x_mm:K.minX,min_y_mm:K.minY,max_x_mm:K.maxX,max_y_mm:K.maxY}}},dt=Math.max(1,Math.round(_t(H))),rt=Math.max(1,Math.round(_t($))),nt=[],ot=it=>{const G=ae(it);return nt.push(G),G},at={top_board_mask:ot(Zt(dt,rt)),bottom_board_mask:ot(Zt(dt,rt))};return tt&&(at.top_copper=ot($t(tt,K,"#fbbf24","#fbbf24"))),U&&(at.bottom_copper=ot($t(U,K,"#38bdf8","#38bdf8"))),X.length&&(at.drills=ot(ce(X,K))),J&&(at.top_silk=ot(Yt(J,K))),B&&(at.bottom_silk=ot(Yt(B,K))),{boardGeom:ut,layers:at,revoke:()=>nt.forEach(it=>URL.revokeObjectURL(it))}}function he(M,k,a){return Math.max(k,Math.min(a,M))}function Mt(M,k){return!Number.isFinite(M)||!Number.isFinite(k)||k<=0?0:(M%k+k)%k}function wt(M,k){k&&k.startsWith("blob:")||k&&k.length>0?M.setAttribute("src",k):M.removeAttribute("src")}function pt(M,k){const a=M.querySelector(k);if(!a)throw new Error(`Missing required element: ${k}`);return a}function de(M,k={}){const a=`
26
+ <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
27
+ <path d="M12 3v10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
28
+ <path d="M8 11l4 4 4-4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
29
+ <path d="M4 17v3h16v-3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
30
+ </svg>
31
+ `;M.innerHTML=`
32
+ <div class="board-viewer-root">
33
+ <div class="viewer-header">
34
+ <div class="viewer-header-left">
35
+ <p class="viewer-header-title">Board viewer</p>
36
+ <p class="viewer-header-sub" id="viewer-subtitle">Scroll to zoom, drag to pan</p>
37
+ </div>
38
+
39
+ <div class="viewer-header-right">
40
+ <div class="controls">
41
+ <div class="segment" title="Side">
42
+ <input id="side-top" type="radio" name="side" value="top" checked />
43
+ <label for="side-top">Top</label>
44
+
45
+ <input id="side-bottom" type="radio" name="side" value="bottom" />
46
+ <label for="side-bottom">Bottom</label>
47
+ </div>
48
+
49
+ <label class="toggle" title="Grid">
50
+ <input type="checkbox" id="grid-toggle" />
51
+ Grid
52
+ </label>
53
+
54
+ <div class="select" title="Grid units">
55
+ Units
56
+ <select id="grid-units">
57
+ <option value="in" selected>in</option>
58
+ <option value="mm">mm</option>
59
+ </select>
60
+ </div>
61
+
62
+ <button class="btn" id="fit-btn" type="button" title="Fit to viewport">Fit</button>
63
+ <button class="btn btn-primary" id="download-btn" type="button" title="Download">
64
+ ${a}
65
+ Download
66
+ </button>
67
+ </div>
68
+ </div>
69
+ </div>
70
+
71
+ <div class="viewer-body">
72
+ <div id="board-viewport">
73
+ <canvas id="grid-canvas"></canvas>
74
+ <div id="board-content">
75
+ <div id="board-stage">
76
+ <div class="board-clip" id="boardClip">
77
+ <div class="layer-frame" id="layer-fr4" style="z-index:0;">
78
+ <img class="layer fr4" id="img-fr4" alt="FR4" />
79
+ </div>
80
+
81
+ <div class="layer-frame" id="layer-bottom-copper"><img class="layer" id="img-bottom-copper" alt="Bottom copper" /></div>
82
+ <div class="layer-frame" id="layer-bottom-mask"><img class="layer" id="img-bottom-mask" alt="Bottom mask" /></div>
83
+ <div class="layer-frame" id="layer-bottom-silk"><img class="layer" id="img-bottom-silk" alt="Bottom silk" /></div>
84
+
85
+ <div class="layer-frame" id="layer-top-copper"><img class="layer" id="img-top-copper" alt="Top copper" /></div>
86
+ <div class="layer-frame" id="layer-top-mask"><img class="layer" id="img-top-mask" alt="Top mask" /></div>
87
+ <div class="layer-frame" id="layer-top-silk"><img class="layer" id="img-top-silk" alt="Top silk" /></div>
88
+
89
+ <div class="layer-frame" id="layer-drills"><img class="layer" id="img-drills" alt="Drills" /></div>
90
+ <div class="layer-frame" id="layer-vias"><img class="layer" id="img-vias" alt="Vias" /></div>
91
+ </div>
92
+ </div>
93
+ </div>
94
+
95
+ <div class="board-viewer-hint">Scroll to zoom, drag to pan.</div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ `;const v=M.firstElementChild,m=pt(v,"#board-viewport"),l=pt(v,"#board-content"),i=pt(v,"#board-stage"),r=pt(v,"#boardClip"),o=pt(v,"#grid-canvas"),b=pt(v,"#grid-toggle"),y=pt(v,"#grid-units"),_=pt(v,"#fit-btn"),d=pt(v,"#download-btn"),s=Array.from(v.querySelectorAll('input[name="side"]')),p=pt(v,"#img-fr4"),n=pt(v,"#img-top-copper"),h=pt(v,"#img-bottom-copper"),c=pt(v,"#img-top-mask"),g=pt(v,"#img-bottom-mask"),x=pt(v,"#img-top-silk"),z=pt(v,"#img-bottom-silk"),C=pt(v,"#img-drills"),D=pt(v,"#img-vias");let T=null,P={},O=1,W=0,V=0,w=!1,R=0,e=0,N=0,tt=0,U=!1,et=!1;function X(G){return he(G,.2,8)}function J(){U||(U=!0,requestAnimationFrame(()=>{U=!1,l.style.transform=`translate3d(${W}px, ${V}px, 0) scale(${O})`,b.checked&&H()}))}function B(G=.08){const t=m.getBoundingClientRect(),F=i.offsetWidth||1,I=i.offsetHeight||1,f=Math.max(1,t.width*(1-2*G)),u=Math.max(1,t.height*(1-2*G));O=X(Math.min(f/F,u/I)),W=(t.width-O*F)/2,V=(t.height-O*I)/2,J()}function A(){let G=1e3;if(T?.board?.width_in){const F=i.getBoundingClientRect().width/O;Number.isFinite(F)&&F>0&&(G=F/T.board.width_in)}return G}function K(){const G=window.devicePixelRatio||1,t=m.getBoundingClientRect();o.width=Math.max(1,Math.floor(t.width*G)),o.height=Math.max(1,Math.floor(t.height*G)),o.style.width=`${t.width}px`,o.style.height=`${t.height}px`}function H(){if(!b.checked){o.style.display="none";return}o.style.display="block";const G=o.getContext("2d");if(!G)return;const t=window.devicePixelRatio||1,F=m.getBoundingClientRect(),I=F.width,f=F.height;G.setTransform(t,0,0,t,0,0),G.clearRect(0,0,I,f);const u=A(),S=u/25.4,L=y.value,j=L==="mm"?S*1:u*.1,E=L==="mm"?S*10:u*1,Z=j*O,q=E*O;if(!Number.isFinite(Z)||Z<6)return;const Y=Mt(W,Z),Q=Mt(V,Z),lt=Mt(W,q),st=Mt(V,q);G.lineWidth=1,G.strokeStyle="rgba(17, 24, 39, 0.12)",G.beginPath();for(let ct=Y;ct<I;ct+=Z){const mt=Math.round(ct)+.5;G.moveTo(mt,0),G.lineTo(mt,f)}for(let ct=Q;ct<f;ct+=Z){const mt=Math.round(ct)+.5;G.moveTo(0,mt),G.lineTo(I,mt)}if(G.stroke(),Number.isFinite(q)&&q>=12){G.strokeStyle="rgba(17, 24, 39, 0.22)",G.beginPath();for(let ct=lt;ct<I;ct+=q){const mt=Math.round(ct)+.5;G.moveTo(mt,0),G.lineTo(mt,f)}for(let ct=st;ct<f;ct+=q){const mt=Math.round(ct)+.5;G.moveTo(0,mt),G.lineTo(I,mt)}G.stroke()}}function $(G,t){const F=v.querySelector(`#${G}`);F&&(F.style.display=t?"block":"none")}function ut(G){G&&r.style.setProperty("--board-mask-url",`url('${G}')`)}function dt(G){const t=G==="top",F=G==="bottom";$("layer-top-copper",t&&!!P.top_copper),$("layer-top-mask",t&&!!P.top_mask),$("layer-top-silk",t&&!!P.top_silk),$("layer-bottom-copper",F&&!!P.bottom_copper),$("layer-bottom-mask",F&&!!P.bottom_mask),$("layer-bottom-silk",F&&!!P.bottom_silk),$("layer-drills",!!P.drills),$("layer-vias",!!P.vias);const I=G==="bottom"?P.bottom_board_mask??P.top_board_mask:P.top_board_mask??P.bottom_board_mask;I&&ut(I)}function rt(){if(!T?.board)return;const G=1e3,t=Math.round((T.board.width_in||1)*G),F=Math.round((T.board.height_in||1)*G);i.style.width=`${t}px`,i.style.height=`${F}px`}m.addEventListener("wheel",G=>{G.preventDefault(),et=!0;const t=m.getBoundingClientRect(),F=G.clientX-t.left,I=G.clientY-t.top,f=O,u=1.1;O=G.deltaY<0?X(O*u):X(O/u);const S=O/f;W=F-(F-W)*S,V=I-(I-V)*S,J()},{passive:!1}),m.addEventListener("mousedown",G=>{G.button===0&&(G.preventDefault(),et=!0,w=!0,m.classList.add("grabbing"),R=G.clientX,e=G.clientY,N=W,tt=V)});const nt=G=>{if(!w)return;const t=G.clientX-R,F=G.clientY-e;W=N+t,V=tt+F,J()},ot=()=>{w&&(w=!1,m.classList.remove("grabbing"))};window.addEventListener("mousemove",nt),window.addEventListener("mouseup",ot),b.addEventListener("change",()=>{K(),H()}),y.addEventListener("change",H),_.addEventListener("click",()=>B(.08)),d.addEventListener("click",()=>{k.onDownload?.()}),s.forEach(G=>{G.addEventListener("change",()=>{const t=s.find(F=>F.checked)?.value||"top";dt(t)})}),window.addEventListener("resize",()=>{K(),et?J():B(.08)});function at(G){T=G.boardGeom,P=G.layers,wt(n,P.top_copper),wt(h,P.bottom_copper),wt(c,P.top_mask),wt(g,P.bottom_mask),wt(x,P.top_silk),wt(z,P.bottom_silk),wt(C,P.drills),wt(D,P.vias),wt(p,P.top_copper??P.bottom_copper),rt(),K(),B(.08);const t=s.find(F=>F.checked)?.value||"top";dt(t),J()}function it(){window.removeEventListener("mousemove",nt),window.removeEventListener("mouseup",ot),M.innerHTML=""}return{setData:at,setSideMode:G=>{const t=s.find(F=>F.value===G);t&&(t.checked=!0),dt(G)},fit:()=>B(.08),dispose:it}}zt.createBoardViewer=de,zt.renderGerbersZip=ue,Object.defineProperty(zt,Symbol.toStringTag,{value:"Module"})}));
100
+ //# sourceMappingURL=gerbers-renderer.umd.js.map