musicbrainz.user.js 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // ==UserScript==
  2. // @namespace ame-musicbrainz
  3. // @name Ame (MusicBrainz)
  4. // @version 1.8.2
  5. // @author SuperSaltyGamer
  6. // @run-at document-end
  7. // @match https://musicbrainz.org/*
  8. // @match https://beta.musicbrainz.org/*
  9. // @grant GM.addStyle
  10. // @grant GM.xmlHttpRequest
  11. // @downloadURL https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/musicbrainz.user.js
  12. // @updateURL https://notabug.org/SuperSaltyGamer/ame/raw/main/dist/musicbrainz.user.js
  13. // ==/UserScript==
  14. (function(le){typeof define=="function"&&define.amd?define(le):le()})(function(){"use strict";function le(k){const L=document.createElement("template");return L.innerHTML=k,L.content.firstElementChild}function Re(k){return k.trim().replace(/[\/\?<>\\:\*\|":]/g,"_").replace(/\.+$/,"_")}function Xe(k){const[L,i]=k.split(":").map(Number);return L*60+i}var ve=(k=>(k.Incompatible="incompatible",k.Deduced="deduced",k.Exact="exact",k))(ve||{});function Ue(k){return k=k.toLowerCase().replace(/[^a-z+]/g,""),k.includes("digitalmedia")||k.includes("cd")||k.includes("disc")}function De(){return location.pathname.split("/")[2]}function xe(){var s;const k=De();let L=(s=document.querySelector(".barcode"))==null?void 0:s.innerText;L==="[none]"&&(L=void 0);const i=document.querySelector("dd.format").innerText,x=document.querySelector(".tabs a[href$='/discids']"),d=x&&x.textContent!=="Disc IDs (0)";return{id:k,title:document.querySelector("h1 a").innerText,artist:document.querySelector(".subheader bdi").innerText,barcode:L,catalogs:Array.from(document.querySelectorAll(".catalog-number")).map(c=>c.innerText).filter(c=>c!="[none]"),tocType:d?"exact":Ue(i)?"deduced":"incompatible",trackCounts:Array.from(document.querySelectorAll("table.medium")).map(c=>c.querySelectorAll("td.pos").length)}}async function Le(k){if(k.tocType==="incompatible")return null;if(k.tocType==="deduced"){const L=Fe();if(L)return L}try{const L=await fetch(`https://musicbrainz.org/ws/2/release/${k.id}?fmt=json&inc=recordings+discids`).then(d=>d.json()),i=L.media.flatMap(d=>d.discs).filter(d=>d.offsets.length)[0];if(i)return[1,i.offsets.length,i.sectors].concat(i.offsets).join(" ");const x=L.media.filter(d=>Ue(d.format))[0];if(x){let d="0",s=0;for(const c of x.tracks)s+=c.length/1e3*75,d+=`:${s}`;return d}}catch(L){console.error(L)}return Fe()}function Fe(){const k=[];let L=0;for(const i of document.querySelectorAll("table.medium")){k.push("0");for(const x of i.querySelectorAll("td.treleases"))L+=Xe(x.innerHTML)*75,k[k.length-1]+=`:${L}`}return k.length?k[0]:null}const Se=document.querySelector("form[action='/search']")??document.createElement("form"),ge=document.querySelector("#headerid-query")??document.createElement("input"),fe=document.querySelector("#headerid-type")??document.createElement("select"),Ke=document.querySelector("form[action='/search'] button")??document.createElement("input");ge.focus(),ge.placeholder="Enhanced search",fe.options.add(le('<option value="barcode">Barcode</option>')),fe.options.add(le('<option value="catalog">Catalog</option>')),fe.options.add(le('<option value="toc">CD TOC</option>')),fe.options.add(le('<option value="isrc">ISRC</option>')),fe.options.add(le('<option value="iswc">ISWC</option>')),ge.addEventListener("input",()=>{const k=$e(ge.value);switch(k&&(ge.value=k),Ne(ge.value)){case"barcode":fe.value="barcode";break;case"catalog":fe.value="catalog";break;case"isrc":fe.value="isrc";break;case"iswc":fe.value="iswc";break;case"toc":fe.value="toc";break}}),Se.addEventListener("dragover",k=>{k.preventDefault();const L=k.dataTransfer;L&&(L.dropEffect="link")}),Se.addEventListener("drop",async k=>{k.preventDefault();const L=k.dataTransfer;if(!L)return;const i=L.files.item(0);if(!(i!=null&&i.name.match(/\.log$/)))return;const x=new FileReader;x.readAsText(i),x.onload=()=>{ge.value=x.result,ge.dispatchEvent(new Event("input")),Ke.click()}}),Se.addEventListener("submit",k=>{const i=new FormData(Se).get("query").trim(),x=Ne(i);if(x!=="unknown")switch(k.preventDefault(),x){case"barcode":location.href=`https://musicbrainz.org/search?type=release&method=advanced&query=barcode:${encodeURIComponent(i)}`;break;case"catalog":location.href=`https://musicbrainz.org/search?type=release&method=advanced&query=catno:${encodeURIComponent(Je(i))}`;break;case"isrc":location.href=`https://musicbrainz.org/search?type=recording&method=advanced&query=isrc:${encodeURIComponent(i)}`;break;case"iswc":location.href=`https://musicbrainz.org/search?type=work&method=advanced&query=iswc:${encodeURIComponent(i)}`;break;case"toc":let d=`?toc=${i}`;location.pathname.startsWith("/release/")&&(d+=`&filter-release.query=${De()}`),location.href=`https://musicbrainz.org/cdtoc/attach${d}`;break}});function Ne(k){return/^(\d{8}|\d{12}|\d{13}|\d{14})$/.test(k)?"barcode":/^[a-zA-Z]{5}[0-9]{7}$/.test(k)?"isrc":/^T-\d{3}.\d{3}.\d{3}-\d$/.test(k)?"iswc":k===k.toUpperCase()&&/\d/.test(k)&&/[a-zA-Z]/.test(k)&&/[ ~-]/.test(k)?"catalog":k.split(" ").filter(Number).length>=4?"toc":"unknown"}function Je(k){return/^(.+)([1-9][0-9]*)~([0-9]+)$/.test(k)?k.split("~")[0]:k}function $e(k){const L=[[]];if(k.includes("Exact Audio Copy")||k.includes("X Lossless Decoder")){let d=0;for(const s of k.matchAll(/ *\d+:\d+.\d+ *\| *\d+:\d+.\d+ *\| *(\d+) *\| *(\d+)/g)){const c={startSector:Number(s[1]),endSector:Number(s[2])};c.startSector<d&&L.push([]),d=c.startSector,L[L.length-1].push(c)}}else if(k.includes("Log created by: whipper"))for(const d of k.matchAll(/ Start sector: (\d+)\r?\n +End sector: (\d+)/g))L[L.length-1].push({startSector:Number(d[1]),endSector:Number(d[2])});const i=L[L.length-1];if(!i.length)return null;if(i.length>=2)for(let d=1;d<i.length;d++){const s=i[d].startSector-i[d-1].endSector;s!==11400&&s!==11401||i.splice(d,1)}const x=i.map(d=>d.startSector).concat([i[i.length-1].endSector+1]);return[1,x.length-1,x[x.length-1]+150].concat(x.slice(0,-1).map(d=>d+150)).join(" ")}const He=new Map;function We(k,L){return new Promise((i,x)=>{const d=He.get(k);if(d){i(d.clone());return}GM.xmlHttpRequest({url:k,method:(L==null?void 0:L.method)??"GET",headers:Object.fromEntries(new Headers(L==null?void 0:L.headers)),responseType:"blob",onload(s){if((s.status<200||s.status>299)&&s.status!==404){x(new Error(`Fetching "${k}" responded with an erroneous status code.`));return}const c=s.responseHeaders.split(`\r
  15. `).slice(0,-1).map(l=>l.split(": ")),r=new Response(s.response,{headers:Object.fromEntries(c),status:s.status,statusText:s.statusText});Object.defineProperty(r,"url",{value:k}),He.set(k,r.clone()),i(r)},onerror(){x(new Error("Network request errored."))},ontimeout(){x(new Error("Network request timed out."))}})})}const _e=(unsafeWindow==null?void 0:unsafeWindow.wrappedJSObject)??unsafeWindow,Qe=typeof cloneInto=="function"?cloneInto:k=>k,et=typeof exportFunction=="function"?exportFunction:k=>k;function tt(k){return Qe(k,_e,{cloneFunctions:!0,wrapReflectors:!0})}function rt(k){return et(k,_e)}function nt(k,L){return L??(L=_e),function(...i){return k.call(L,...tt(i))}}const Ie={},it=nt(_e.history.pushState,_e.history);_e.history.pushState=rt(at);function at(k,L,i){it(k,L,i),je()}addEventListener("popstate",()=>{je()});function je(){for(const k of Object.values(Ie)){const L=k.pattern.test(location.pathname)?k.onCallbacks:k.offCallbacks;for(const i of L)i()}}function st(k){const L=new RegExp(`^/${k.replaceAll("/","\\/")}$`);let i=Ie[k];return i||(i={pattern:L,onCallbacks:[],offCallbacks:[]},Ie[k]=i,i)}function Te(k,L){const i=st(k),x=i.pattern.test(location.pathname);i.onCallbacks.push(L),x&&L()}const ot="release/[0-9a-f-]+",At="release/[0-9a-f-]+/cover-art",ct="release/[0-9a-f-]+/add-cover-art";function Ze(k){Te(ot,k)}function lt(k){Te(At,k)}function ut(k){Te(ct,k)}ut(()=>{const k=document.querySelector(".fileinput-button.buttons");if(!k)return;const L=xe();if(!L)return;const i=le(`
  16. <select>
  17. <option value="" disabled selected>Search MH Covers...</option>
  18. <option value="search">by Artist and Album</option>
  19. ${L.barcode?'<option value="barcode">by Barcode</option>':""}
  20. ${L.catalogs.length?'<option value="catalog">by Catalog</option>':""}
  21. ${L.tocType===ve.Exact||L.tocType===ve.Deduced?'<option value="toc">by TOC</option>':""}
  22. </select>
  23. `);i.addEventListener("input",async()=>{const x=i.value;i.value="",await ht(L,x)}),k.appendChild(i)});async function ht(k,L){const i=new URLSearchParams;switch(i.set("remote.port","browser"),i.set("remote.agent","Ame - MusicBrainz"),i.set("remote.text","Pick cover for MusicBrainz release."),L){case"search":i.set("artist",k.artist),i.set("album",k.title);break;case"barcode":if(!k.barcode)return;i.set("barcode",k.barcode);break;case"catalog":if(!k.catalogs.length)return;i.set("catalog",k.catalogs[0]);break;case"toc":const d=await Le(k);if(!d)return;i.set("toc",d);break;default:return}const x=open(`https://covers.musichoarders.xyz?${i}`,"_blank");x&&(addEventListener("beforeunload",()=>{x.close()}),addEventListener("message",async d=>{try{if(d.source!==x)return;const s=JSON.parse(d.data);switch(s.action){case"primary":case"secondary":x==null||x.close(),await ft(s);break}}catch{}},!1))}async function ft(k){var l;const i=await(await We(k.bigCoverUrl)).blob(),x=new DataTransfer;Object.defineProperty(x,"files",{value:[i]});const d=new DragEvent("drop",{dataTransfer:x});(l=document.querySelector("#drop-zone"))==null||l.dispatchEvent(d);const s=document.querySelector("#add-cover-art tr:last-of-type");if(!s)return;const c=s.querySelector('input[type="checkbox"]');c&&c.click();const r=document.body.querySelector(".edit-note");if(r){let _="Seeded with Ame through https://covers.musichoarders.xyz";k.releaseInfo.url&&(_+=` for ${k.releaseInfo.url}`),_+=` from ${k.bigCoverUrl}`,r.value=_}}var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dt(k){return k&&k.__esModule&&Object.prototype.hasOwnProperty.call(k,"default")?k.default:k}function ze(k){throw new Error('Could not dynamically require "'+k+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qe={exports:{}};/*!
  24. JSZip v3.9.1 - A JavaScript class for generating and reading zip files
  25. <http://stuartk.com/jszip>
  26. (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
  27. Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
  28. JSZip uses the library pako released under the MIT license :
  29. https://github.com/nodeca/pako/blob/master/LICENSE
  30. */(function(k,L){(function(i){k.exports=i()})(function(){return function i(x,d,s){function c(_,b){if(!d[_]){if(!x[_]){var m=typeof ze=="function"&&ze;if(!b&&m)return m(_,!0);if(r)return r(_,!0);var v=new Error("Cannot find module '"+_+"'");throw v.code="MODULE_NOT_FOUND",v}var a=d[_]={exports:{}};x[_][0].call(a.exports,function(f){var p=x[_][1][f];return c(p||f)},a,a.exports,i,x,d,s)}return d[_].exports}for(var r=typeof ze=="function"&&ze,l=0;l<s.length;l++)c(s[l]);return c}({1:[function(i,x,d){var s=i("./utils"),c=i("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";d.encode=function(l){for(var _,b,m,v,a,f,p,n=[],o=0,u=l.length,w=u,I=s.getTypeOf(l)!=="string";o<l.length;)w=u-o,m=I?(_=l[o++],b=o<u?l[o++]:0,o<u?l[o++]:0):(_=l.charCodeAt(o++),b=o<u?l.charCodeAt(o++):0,o<u?l.charCodeAt(o++):0),v=_>>2,a=(3&_)<<4|b>>4,f=1<w?(15&b)<<2|m>>6:64,p=2<w?63&m:64,n.push(r.charAt(v)+r.charAt(a)+r.charAt(f)+r.charAt(p));return n.join("")},d.decode=function(l){var _,b,m,v,a,f,p=0,n=0,o="data:";if(l.substr(0,o.length)===o)throw new Error("Invalid base64 input, it looks like a data url.");var u,w=3*(l=l.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(l.charAt(l.length-1)===r.charAt(64)&&w--,l.charAt(l.length-2)===r.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=c.uint8array?new Uint8Array(0|w):new Array(0|w);p<l.length;)_=r.indexOf(l.charAt(p++))<<2|(v=r.indexOf(l.charAt(p++)))>>4,b=(15&v)<<4|(a=r.indexOf(l.charAt(p++)))>>2,m=(3&a)<<6|(f=r.indexOf(l.charAt(p++))),u[n++]=_,a!==64&&(u[n++]=b),f!==64&&(u[n++]=m);return u}},{"./support":30,"./utils":32}],2:[function(i,x,d){var s=i("./external"),c=i("./stream/DataWorker"),r=i("./stream/Crc32Probe"),l=i("./stream/DataLengthProbe");function _(b,m,v,a,f){this.compressedSize=b,this.uncompressedSize=m,this.crc32=v,this.compression=a,this.compressedContent=f}_.prototype={getContentWorker:function(){var b=new c(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),m=this;return b.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),b},getCompressedWorker:function(){return new c(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},_.createWorkerFrom=function(b,m,v){return b.pipe(new r).pipe(new l("uncompressedSize")).pipe(m.compressWorker(v)).pipe(new l("compressedSize")).withStreamInfo("compression",m)},x.exports=_},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(i,x,d){var s=i("./stream/GenericWorker");d.STORE={magic:"\0\0",compressWorker:function(c){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},d.DEFLATE=i("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(i,x,d){var s=i("./utils"),c=function(){for(var r,l=[],_=0;_<256;_++){r=_;for(var b=0;b<8;b++)r=1&r?3988292384^r>>>1:r>>>1;l[_]=r}return l}();x.exports=function(r,l){return r!==void 0&&r.length?s.getTypeOf(r)!=="string"?function(_,b,m,v){var a=c,f=v+m;_^=-1;for(var p=v;p<f;p++)_=_>>>8^a[255&(_^b[p])];return-1^_}(0|l,r,r.length,0):function(_,b,m,v){var a=c,f=v+m;_^=-1;for(var p=v;p<f;p++)_=_>>>8^a[255&(_^b.charCodeAt(p))];return-1^_}(0|l,r,r.length,0):0}},{"./utils":32}],5:[function(i,x,d){d.base64=!1,d.binary=!1,d.dir=!1,d.createFolders=!0,d.date=null,d.compression=null,d.compressionOptions=null,d.comment=null,d.unixPermissions=null,d.dosPermissions=null},{}],6:[function(i,x,d){var s=null;s=typeof Promise<"u"?Promise:i("lie"),x.exports={Promise:s}},{lie:37}],7:[function(i,x,d){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",c=i("pako"),r=i("./utils"),l=i("./stream/GenericWorker"),_=s?"uint8array":"array";function b(m,v){l.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=v,this.meta={}}d.magic="\b\0",r.inherits(b,l),b.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(_,m.data),!1)},b.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},b.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},b.prototype._createPako=function(){this._pako=new c[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(v){m.push({data:v,meta:m.meta})}},d.compressWorker=function(m){return new b("Deflate",m)},d.uncompressWorker=function(){return new b("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(i,x,d){function s(a,f){var p,n="";for(p=0;p<f;p++)n+=String.fromCharCode(255&a),a>>>=8;return n}function c(a,f,p,n,o,u){var w,I,S=a.file,N=a.compression,O=u!==_.utf8encode,q=r.transformTo("string",u(S.name)),D=r.transformTo("string",_.utf8encode(S.name)),M=S.comment,J=r.transformTo("string",u(M)),g=r.transformTo("string",_.utf8encode(M)),T=D.length!==S.name.length,t=g.length!==M.length,R="",Q="",H="",ee=S.dir,W=S.date,$={crc32:0,compressedSize:0,uncompressedSize:0};f&&!p||($.crc32=a.crc32,$.compressedSize=a.compressedSize,$.uncompressedSize=a.uncompressedSize);var C=0;f&&(C|=8),O||!T&&!t||(C|=2048);var E=0,K=0;ee&&(E|=16),o==="UNIX"?(K=798,E|=function(V,ae){var ce=V;return V||(ce=ae?16893:33204),(65535&ce)<<16}(S.unixPermissions,ee)):(K=20,E|=function(V){return 63&(V||0)}(S.dosPermissions)),w=W.getUTCHours(),w<<=6,w|=W.getUTCMinutes(),w<<=5,w|=W.getUTCSeconds()/2,I=W.getUTCFullYear()-1980,I<<=4,I|=W.getUTCMonth()+1,I<<=5,I|=W.getUTCDate(),T&&(Q=s(1,1)+s(b(q),4)+D,R+="up"+s(Q.length,2)+Q),t&&(H=s(1,1)+s(b(J),4)+g,R+="uc"+s(H.length,2)+H);var G="";return G+=`
  31. \0`,G+=s(C,2),G+=N.magic,G+=s(w,2),G+=s(I,2),G+=s($.crc32,4),G+=s($.compressedSize,4),G+=s($.uncompressedSize,4),G+=s(q.length,2),G+=s(R.length,2),{fileRecord:m.LOCAL_FILE_HEADER+G+q+R,dirRecord:m.CENTRAL_FILE_HEADER+s(K,2)+G+s(J.length,2)+"\0\0\0\0"+s(E,4)+s(n,4)+q+R+J}}var r=i("../utils"),l=i("../stream/GenericWorker"),_=i("../utf8"),b=i("../crc32"),m=i("../signature");function v(a,f,p,n){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=f,this.zipPlatform=p,this.encodeFileName=n,this.streamFiles=a,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(v,l),v.prototype.push=function(a){var f=a.meta.percent||0,p=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(a):(this.bytesWritten+=a.data.length,l.prototype.push.call(this,{data:a.data,meta:{currentFile:this.currentFile,percent:p?(f+100*(p-n-1))/p:100}}))},v.prototype.openedSource=function(a){this.currentSourceOffset=this.bytesWritten,this.currentFile=a.file.name;var f=this.streamFiles&&!a.file.dir;if(f){var p=c(a,f,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},v.prototype.closedSource=function(a){this.accumulate=!1;var f=this.streamFiles&&!a.file.dir,p=c(a,f,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),f)this.push({data:function(n){return m.DATA_DESCRIPTOR+s(n.crc32,4)+s(n.compressedSize,4)+s(n.uncompressedSize,4)}(a),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},v.prototype.flush=function(){for(var a=this.bytesWritten,f=0;f<this.dirRecords.length;f++)this.push({data:this.dirRecords[f],meta:{percent:100}});var p=this.bytesWritten-a,n=function(o,u,w,I,S){var N=r.transformTo("string",S(I));return m.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(o,2)+s(o,2)+s(u,4)+s(w,4)+s(N.length,2)+N}(this.dirRecords.length,p,a,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},v.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},v.prototype.registerPrevious=function(a){this._sources.push(a);var f=this;return a.on("data",function(p){f.processChunk(p)}),a.on("end",function(){f.closedSource(f.previous.streamInfo),f._sources.length?f.prepareNextSource():f.end()}),a.on("error",function(p){f.error(p)}),this},v.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},v.prototype.error=function(a){var f=this._sources;if(!l.prototype.error.call(this,a))return!1;for(var p=0;p<f.length;p++)try{f[p].error(a)}catch{}return!0},v.prototype.lock=function(){l.prototype.lock.call(this);for(var a=this._sources,f=0;f<a.length;f++)a[f].lock()},x.exports=v},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(i,x,d){var s=i("../compressions"),c=i("./ZipFileWorker");d.generateWorker=function(r,l,_){var b=new c(l.streamFiles,_,l.platform,l.encodeFileName),m=0;try{r.forEach(function(v,a){m++;var f=function(u,w){var I=u||w,S=s[I];if(!S)throw new Error(I+" is not a valid compression method !");return S}(a.options.compression,l.compression),p=a.options.compressionOptions||l.compressionOptions||{},n=a.dir,o=a.date;a._compressWorker(f,p).withStreamInfo("file",{name:v,dir:n,date:o,comment:a.comment||"",unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions}).pipe(b)}),b.entriesCount=m}catch(v){b.error(v)}return b}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(i,x,d){function s(){if(!(this instanceof s))return new s;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 c=new s;for(var r in this)typeof this[r]!="function"&&(c[r]=this[r]);return c}}(s.prototype=i("./object")).loadAsync=i("./load"),s.support=i("./support"),s.defaults=i("./defaults"),s.version="3.9.1",s.loadAsync=function(c,r){return new s().loadAsync(c,r)},s.external=i("./external"),x.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(i,x,d){var s=i("./utils"),c=i("./external"),r=i("./utf8"),l=i("./zipEntries"),_=i("./stream/Crc32Probe"),b=i("./nodejsUtils");function m(v){return new c.Promise(function(a,f){var p=v.decompressed.getContentWorker().pipe(new _);p.on("error",function(n){f(n)}).on("end",function(){p.streamInfo.crc32!==v.decompressed.crc32?f(new Error("Corrupted zip : CRC32 mismatch")):a()}).resume()})}x.exports=function(v,a){var f=this;return a=s.extend(a||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),b.isNode&&b.isStream(v)?c.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",v,!0,a.optimizedBinaryString,a.base64).then(function(p){var n=new l(a);return n.load(p),n}).then(function(p){var n=[c.Promise.resolve(p)],o=p.files;if(a.checkCRC32)for(var u=0;u<o.length;u++)n.push(m(o[u]));return c.Promise.all(n)}).then(function(p){for(var n=p.shift(),o=n.files,u=0;u<o.length;u++){var w=o[u],I=w.fileNameStr,S=s.resolve(w.fileNameStr);f.file(S,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:a.createFolders}),w.dir||(f.file(S).unsafeOriginalName=I)}return n.zipComment.length&&(f.comment=n.zipComment),f})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(i,x,d){var s=i("../utils"),c=i("../stream/GenericWorker");function r(l,_){c.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(_)}s.inherits(r,c),r.prototype._bindStream=function(l){var _=this;(this._stream=l).pause(),l.on("data",function(b){_.push({data:b,meta:{percent:0}})}).on("error",function(b){_.isPaused?this.generatedError=b:_.error(b)}).on("end",function(){_.isPaused?_._upstreamEnded=!0:_.end()})},r.prototype.pause=function(){return!!c.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},x.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(i,x,d){var s=i("readable-stream").Readable;function c(r,l,_){s.call(this,l),this._helper=r;var b=this;r.on("data",function(m,v){b.push(m)||b._helper.pause(),_&&_(v)}).on("error",function(m){b.emit("error",m)}).on("end",function(){b.push(null)})}i("../utils").inherits(c,s),c.prototype._read=function(){this._helper.resume()},x.exports=c},{"../utils":32,"readable-stream":16}],14:[function(i,x,d){x.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,c){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,c);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,c)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var c=new Buffer(s);return c.fill(0),c},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(i,x,d){function s(S,N,O){var q,D=r.getTypeOf(N),M=r.extend(O||{},b);M.date=M.date||new Date,M.compression!==null&&(M.compression=M.compression.toUpperCase()),typeof M.unixPermissions=="string"&&(M.unixPermissions=parseInt(M.unixPermissions,8)),M.unixPermissions&&16384&M.unixPermissions&&(M.dir=!0),M.dosPermissions&&16&M.dosPermissions&&(M.dir=!0),M.dir&&(S=o(S)),M.createFolders&&(q=n(S))&&u.call(this,q,!0);var J=D==="string"&&M.binary===!1&&M.base64===!1;O&&O.binary!==void 0||(M.binary=!J),(N instanceof m&&N.uncompressedSize===0||M.dir||!N||N.length===0)&&(M.base64=!1,M.binary=!0,N="",M.compression="STORE",D="string");var g=null;g=N instanceof m||N instanceof l?N:f.isNode&&f.isStream(N)?new p(S,N):r.prepareContent(S,N,M.binary,M.optimizedBinaryString,M.base64);var T=new v(S,g,M);this.files[S]=T}var c=i("./utf8"),r=i("./utils"),l=i("./stream/GenericWorker"),_=i("./stream/StreamHelper"),b=i("./defaults"),m=i("./compressedObject"),v=i("./zipObject"),a=i("./generate"),f=i("./nodejsUtils"),p=i("./nodejs/NodejsStreamInputAdapter"),n=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var N=S.lastIndexOf("/");return 0<N?S.substring(0,N):""},o=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},u=function(S,N){return N=N!==void 0?N:b.createFolders,S=o(S),this.files[S]||s.call(this,S,null,{dir:!0,createFolders:N}),this.files[S]};function w(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var I={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var N,O,q;for(N in this.files)q=this.files[N],(O=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&S(O,q)},filter:function(S){var N=[];return this.forEach(function(O,q){S(O,q)&&N.push(q)}),N},file:function(S,N,O){if(arguments.length!==1)return S=this.root+S,s.call(this,S,N,O),this;if(w(S)){var q=S;return this.filter(function(M,J){return!J.dir&&q.test(M)})}var D=this.files[this.root+S];return D&&!D.dir?D:null},folder:function(S){if(!S)return this;if(w(S))return this.filter(function(D,M){return M.dir&&S.test(D)});var N=this.root+S,O=u.call(this,N),q=this.clone();return q.root=O.name,q},remove:function(S){S=this.root+S;var N=this.files[S];if(N||(S.slice(-1)!=="/"&&(S+="/"),N=this.files[S]),N&&!N.dir)delete this.files[S];else for(var O=this.filter(function(D,M){return M.name.slice(0,S.length)===S}),q=0;q<O.length;q++)delete this.files[O[q].name];return this},generate:function(S){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var N,O={};try{if((O=r.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:c.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");r.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var q=O.comment||this.comment||"";N=a.generateWorker(this,O,q)}catch(D){(N=new l("error")).error(D)}return new _(N,O.type||"string",O.mimeType)},generateAsync:function(S,N){return this.generateInternalStream(S).accumulate(N)},generateNodeStream:function(S,N){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(N)}};x.exports=I},{"./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(i,x,d){x.exports=i("stream")},{stream:void 0}],17:[function(i,x,d){var s=i("./DataReader");function c(r){s.call(this,r);for(var l=0;l<this.data.length;l++)r[l]=255&r[l]}i("../utils").inherits(c,s),c.prototype.byteAt=function(r){return this.data[this.zero+r]},c.prototype.lastIndexOfSignature=function(r){for(var l=r.charCodeAt(0),_=r.charCodeAt(1),b=r.charCodeAt(2),m=r.charCodeAt(3),v=this.length-4;0<=v;--v)if(this.data[v]===l&&this.data[v+1]===_&&this.data[v+2]===b&&this.data[v+3]===m)return v-this.zero;return-1},c.prototype.readAndCheckSignature=function(r){var l=r.charCodeAt(0),_=r.charCodeAt(1),b=r.charCodeAt(2),m=r.charCodeAt(3),v=this.readData(4);return l===v[0]&&_===v[1]&&b===v[2]&&m===v[3]},c.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},x.exports=c},{"../utils":32,"./DataReader":18}],18:[function(i,x,d){var s=i("../utils");function c(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}c.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(r){},readInt:function(r){var l,_=0;for(this.checkOffset(r),l=this.index+r-1;l>=this.index;l--)_=(_<<8)+this.byteAt(l);return this.index+=r,_},readString:function(r){return s.transformTo("string",this.readData(r))},readData:function(r){},lastIndexOfSignature:function(r){},readAndCheckSignature:function(r){},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))}},x.exports=c},{"../utils":32}],19:[function(i,x,d){var s=i("./Uint8ArrayReader");function c(r){s.call(this,r)}i("../utils").inherits(c,s),c.prototype.readData=function(r){this.checkOffset(r);var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},x.exports=c},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(i,x,d){var s=i("./DataReader");function c(r){s.call(this,r)}i("../utils").inherits(c,s),c.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},c.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},c.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},c.prototype.readData=function(r){this.checkOffset(r);var l=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},x.exports=c},{"../utils":32,"./DataReader":18}],21:[function(i,x,d){var s=i("./ArrayReader");function c(r){s.call(this,r)}i("../utils").inherits(c,s),c.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,l},x.exports=c},{"../utils":32,"./ArrayReader":17}],22:[function(i,x,d){var s=i("../utils"),c=i("../support"),r=i("./ArrayReader"),l=i("./StringReader"),_=i("./NodeBufferReader"),b=i("./Uint8ArrayReader");x.exports=function(m){var v=s.getTypeOf(m);return s.checkSupport(v),v!=="string"||c.uint8array?v==="nodebuffer"?new _(m):c.uint8array?new b(s.transformTo("uint8array",m)):new r(s.transformTo("array",m)):new l(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(i,x,d){d.LOCAL_FILE_HEADER="PK",d.CENTRAL_FILE_HEADER="PK",d.CENTRAL_DIRECTORY_END="PK",d.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",d.ZIP64_CENTRAL_DIRECTORY_END="PK",d.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(i,x,d){var s=i("./GenericWorker"),c=i("../utils");function r(l){s.call(this,"ConvertWorker to "+l),this.destType=l}c.inherits(r,s),r.prototype.processChunk=function(l){this.push({data:c.transformTo(this.destType,l.data),meta:l.meta})},x.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(i,x,d){var s=i("./GenericWorker"),c=i("../crc32");function r(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}i("../utils").inherits(r,s),r.prototype.processChunk=function(l){this.streamInfo.crc32=c(l.data,this.streamInfo.crc32||0),this.push(l)},x.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(i,x,d){var s=i("../utils"),c=i("./GenericWorker");function r(l){c.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(r,c),r.prototype.processChunk=function(l){if(l){var _=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=_+l.data.length}c.prototype.processChunk.call(this,l)},x.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(i,x,d){var s=i("../utils"),c=i("./GenericWorker");function r(l){c.call(this,"DataWorker");var _=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(b){_.dataIsReady=!0,_.data=b,_.max=b&&b.length||0,_.type=s.getTypeOf(b),_.isPaused||_._tickAndRepeat()},function(b){_.error(b)})}s.inherits(r,c),r.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,_=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,_);break;case"uint8array":l=this.data.subarray(this.index,_);break;case"array":case"nodebuffer":l=this.data.slice(this.index,_)}return this.index=_,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},x.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(i,x,d){function s(c){this.name=c||"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}s.prototype={push:function(c){this.emit("data",c)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(c){this.emit("error",c)}return!0},error:function(c){return!this.isFinished&&(this.isPaused?this.generatedError=c:(this.isFinished=!0,this.emit("error",c),this.previous&&this.previous.error(c),this.cleanUp()),!0)},on:function(c,r){return this._listeners[c].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(c,r){if(this._listeners[c])for(var l=0;l<this._listeners[c].length;l++)this._listeners[c][l].call(this,r)},pipe:function(c){return c.registerPrevious(this)},registerPrevious:function(c){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=c.streamInfo,this.mergeStreamInfo(),this.previous=c;var r=this;return c.on("data",function(l){r.processChunk(l)}),c.on("end",function(){r.end()}),c.on("error",function(l){r.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var c=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),c=!0),this.previous&&this.previous.resume(),!c},flush:function(){},processChunk:function(c){this.push(c)},withStreamInfo:function(c,r){return this.extraStreamInfo[c]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var c in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(c)&&(this.streamInfo[c]=this.extraStreamInfo[c])},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 c="Worker "+this.name;return this.previous?this.previous+" -> "+c:c}},x.exports=s},{}],29:[function(i,x,d){var s=i("../utils"),c=i("./ConvertWorker"),r=i("./GenericWorker"),l=i("../base64"),_=i("../support"),b=i("../external"),m=null;if(_.nodestream)try{m=i("../nodejs/NodejsStreamOutputAdapter")}catch{}function v(f,p){return new b.Promise(function(n,o){var u=[],w=f._internalType,I=f._outputType,S=f._mimeType;f.on("data",function(N,O){u.push(N),p&&p(O)}).on("error",function(N){u=[],o(N)}).on("end",function(){try{var N=function(O,q,D){switch(O){case"blob":return s.newBlob(s.transformTo("arraybuffer",q),D);case"base64":return l.encode(q);default:return s.transformTo(O,q)}}(I,function(O,q){var D,M=0,J=null,g=0;for(D=0;D<q.length;D++)g+=q[D].length;switch(O){case"string":return q.join("");case"array":return Array.prototype.concat.apply([],q);case"uint8array":for(J=new Uint8Array(g),D=0;D<q.length;D++)J.set(q[D],M),M+=q[D].length;return J;case"nodebuffer":return Buffer.concat(q);default:throw new Error("concat : unsupported type '"+O+"'")}}(w,u),S);n(N)}catch(O){o(O)}u=[]}).resume()})}function a(f,p,n){var o=p;switch(p){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=p,this._mimeType=n,s.checkSupport(o),this._worker=f.pipe(new c(o)),f.lock()}catch(u){this._worker=new r("error"),this._worker.error(u)}}a.prototype={accumulate:function(f){return v(this,f)},on:function(f,p){var n=this;return f==="data"?this._worker.on(f,function(o){p.call(n,o.data,o.meta)}):this._worker.on(f,function(){s.delay(p,arguments,n)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(f){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new m(this,{objectMode:this._outputType!=="nodebuffer"},f)}},x.exports=a},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(i,x,d){if(d.base64=!0,d.array=!0,d.string=!0,d.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",d.nodebuffer=typeof Buffer<"u",d.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")d.blob=!1;else{var s=new ArrayBuffer(0);try{d.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var c=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);c.append(s),d.blob=c.getBlob("application/zip").size===0}catch{d.blob=!1}}}try{d.nodestream=!!i("readable-stream").Readable}catch{d.nodestream=!1}},{"readable-stream":16}],31:[function(i,x,d){for(var s=i("./utils"),c=i("./support"),r=i("./nodejsUtils"),l=i("./stream/GenericWorker"),_=new Array(256),b=0;b<256;b++)_[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;_[254]=_[254]=1;function m(){l.call(this,"utf-8 decode"),this.leftOver=null}function v(){l.call(this,"utf-8 encode")}d.utf8encode=function(a){return c.nodebuffer?r.newBufferFrom(a,"utf-8"):function(f){var p,n,o,u,w,I=f.length,S=0;for(u=0;u<I;u++)(64512&(n=f.charCodeAt(u)))==55296&&u+1<I&&(64512&(o=f.charCodeAt(u+1)))==56320&&(n=65536+(n-55296<<10)+(o-56320),u++),S+=n<128?1:n<2048?2:n<65536?3:4;for(p=c.uint8array?new Uint8Array(S):new Array(S),u=w=0;w<S;u++)(64512&(n=f.charCodeAt(u)))==55296&&u+1<I&&(64512&(o=f.charCodeAt(u+1)))==56320&&(n=65536+(n-55296<<10)+(o-56320),u++),n<128?p[w++]=n:(n<2048?p[w++]=192|n>>>6:(n<65536?p[w++]=224|n>>>12:(p[w++]=240|n>>>18,p[w++]=128|n>>>12&63),p[w++]=128|n>>>6&63),p[w++]=128|63&n);return p}(a)},d.utf8decode=function(a){return c.nodebuffer?s.transformTo("nodebuffer",a).toString("utf-8"):function(f){var p,n,o,u,w=f.length,I=new Array(2*w);for(p=n=0;p<w;)if((o=f[p++])<128)I[n++]=o;else if(4<(u=_[o]))I[n++]=65533,p+=u-1;else{for(o&=u===2?31:u===3?15:7;1<u&&p<w;)o=o<<6|63&f[p++],u--;1<u?I[n++]=65533:o<65536?I[n++]=o:(o-=65536,I[n++]=55296|o>>10&1023,I[n++]=56320|1023&o)}return I.length!==n&&(I.subarray?I=I.subarray(0,n):I.length=n),s.applyFromCharCode(I)}(a=s.transformTo(c.uint8array?"uint8array":"array",a))},s.inherits(m,l),m.prototype.processChunk=function(a){var f=s.transformTo(c.uint8array?"uint8array":"array",a.data);if(this.leftOver&&this.leftOver.length){if(c.uint8array){var p=f;(f=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),f.set(p,this.leftOver.length)}else f=this.leftOver.concat(f);this.leftOver=null}var n=function(u,w){var I;for((w=w||u.length)>u.length&&(w=u.length),I=w-1;0<=I&&(192&u[I])==128;)I--;return I<0||I===0?w:I+_[u[I]]>w?I:w}(f),o=f;n!==f.length&&(c.uint8array?(o=f.subarray(0,n),this.leftOver=f.subarray(n,f.length)):(o=f.slice(0,n),this.leftOver=f.slice(n,f.length))),this.push({data:d.utf8decode(o),meta:a.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:d.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},d.Utf8DecodeWorker=m,s.inherits(v,l),v.prototype.processChunk=function(a){this.push({data:d.utf8encode(a.data),meta:a.meta})},d.Utf8EncodeWorker=v},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(i,x,d){var s=i("./support"),c=i("./base64"),r=i("./nodejsUtils"),l=i("set-immediate-shim"),_=i("./external");function b(n){return n}function m(n,o){for(var u=0;u<n.length;++u)o[u]=255&n.charCodeAt(u);return o}d.newBlob=function(n,o){d.checkSupport("blob");try{return new Blob([n],{type:o})}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return u.append(n),u.getBlob(o)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(n,o,u){var w=[],I=0,S=n.length;if(S<=u)return String.fromCharCode.apply(null,n);for(;I<S;)o==="array"||o==="nodebuffer"?w.push(String.fromCharCode.apply(null,n.slice(I,Math.min(I+u,S)))):w.push(String.fromCharCode.apply(null,n.subarray(I,Math.min(I+u,S)))),I+=u;return w.join("")},stringifyByChar:function(n){for(var o="",u=0;u<n.length;u++)o+=String.fromCharCode(n[u]);return o},applyCanBeUsed:{uint8array:function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}}()}};function a(n){var o=65536,u=d.getTypeOf(n),w=!0;if(u==="uint8array"?w=v.applyCanBeUsed.uint8array:u==="nodebuffer"&&(w=v.applyCanBeUsed.nodebuffer),w)for(;1<o;)try{return v.stringifyByChunk(n,u,o)}catch{o=Math.floor(o/2)}return v.stringifyByChar(n)}function f(n,o){for(var u=0;u<n.length;u++)o[u]=n[u];return o}d.applyFromCharCode=a;var p={};p.string={string:b,array:function(n){return m(n,new Array(n.length))},arraybuffer:function(n){return p.string.uint8array(n).buffer},uint8array:function(n){return m(n,new Uint8Array(n.length))},nodebuffer:function(n){return m(n,r.allocBuffer(n.length))}},p.array={string:a,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 a(new Uint8Array(n))},array:function(n){return f(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:a,array:function(n){return f(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:b,nodebuffer:function(n){return r.newBufferFrom(n)}},p.nodebuffer={string:a,array:function(n){return f(n,new Array(n.length))},arraybuffer:function(n){return p.nodebuffer.uint8array(n).buffer},uint8array:function(n){return f(n,new Uint8Array(n.length))},nodebuffer:b},d.transformTo=function(n,o){if(o=o||"",!n)return o;d.checkSupport(n);var u=d.getTypeOf(o);return p[u][n](o)},d.resolve=function(n){for(var o=n.split("/"),u=[],w=0;w<o.length;w++){var I=o[w];I==="."||I===""&&w!==0&&w!==o.length-1||(I===".."?u.pop():u.push(I))}return u.join("/")},d.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":s.nodebuffer&&r.isBuffer(n)?"nodebuffer":s.uint8array&&n instanceof Uint8Array?"uint8array":s.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},d.checkSupport=function(n){if(!s[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},d.MAX_VALUE_16BITS=65535,d.MAX_VALUE_32BITS=-1,d.pretty=function(n){var o,u,w="";for(u=0;u<(n||"").length;u++)w+="\\x"+((o=n.charCodeAt(u))<16?"0":"")+o.toString(16).toUpperCase();return w},d.delay=function(n,o,u){l(function(){n.apply(u||null,o||[])})},d.inherits=function(n,o){function u(){}u.prototype=o.prototype,n.prototype=new u},d.extend=function(){var n,o,u={};for(n=0;n<arguments.length;n++)for(o in arguments[n])arguments[n].hasOwnProperty(o)&&u[o]===void 0&&(u[o]=arguments[n][o]);return u},d.prepareContent=function(n,o,u,w,I){return _.Promise.resolve(o).then(function(S){return s.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new _.Promise(function(N,O){var q=new FileReader;q.onload=function(D){N(D.target.result)},q.onerror=function(D){O(D.target.error)},q.readAsArrayBuffer(S)}):S}).then(function(S){var N=d.getTypeOf(S);return N?(N==="arraybuffer"?S=d.transformTo("uint8array",S):N==="string"&&(I?S=c.decode(S):u&&w!==!0&&(S=function(O){return m(O,s.uint8array?new Uint8Array(O.length):new Array(O.length))}(S))),S):_.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,"set-immediate-shim":54}],33:[function(i,x,d){var s=i("./reader/readerFor"),c=i("./utils"),r=i("./signature"),l=i("./zipEntry"),_=(i("./utf8"),i("./support"));function b(m){this.files=[],this.loadOptions=m}b.prototype={checkSignature:function(m){if(!this.reader.readAndCheckSignature(m)){this.reader.index-=4;var v=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+c.pretty(v)+", expected "+c.pretty(m)+")")}},isSignature:function(m,v){var a=this.reader.index;this.reader.setIndex(m);var f=this.reader.readString(4)===v;return this.reader.setIndex(a),f},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 m=this.reader.readData(this.zipCommentLength),v=_.uint8array?"uint8array":"array",a=c.transformTo(v,m);this.zipComment=this.loadOptions.decodeFileName(a)},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 m,v,a,f=this.zip64EndOfCentralSize-44;0<f;)m=this.reader.readInt(2),v=this.reader.readInt(4),a=this.reader.readData(v),this.zip64ExtensibleData[m]={id:m,length:v,value:a}},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 m,v;for(m=0;m<this.files.length;m++)v=this.files[m],this.reader.setIndex(v.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),v.readLocalPart(this.reader),v.handleUTF8(),v.processAttributes()},readCentralDir:function(){var m;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(m=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(m);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 m=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(m<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(m);var v=m;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===c.MAX_VALUE_16BITS||this.diskWithCentralDirStart===c.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===c.MAX_VALUE_16BITS||this.centralDirRecords===c.MAX_VALUE_16BITS||this.centralDirSize===c.MAX_VALUE_32BITS||this.centralDirOffset===c.MAX_VALUE_32BITS){if(this.zip64=!0,(m=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(m),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 a=this.centralDirOffset+this.centralDirSize;this.zip64&&(a+=20,a+=12+this.zip64EndOfCentralSize);var f=v-a;if(0<f)this.isSignature(v,r.CENTRAL_FILE_HEADER)||(this.reader.zero=f);else if(f<0)throw new Error("Corrupted zip: missing "+Math.abs(f)+" bytes.")},prepareReader:function(m){this.reader=s(m)},load:function(m){this.prepareReader(m),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},x.exports=b},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(i,x,d){var s=i("./reader/readerFor"),c=i("./utils"),r=i("./compressedObject"),l=i("./crc32"),_=i("./utf8"),b=i("./compressions"),m=i("./support");function v(a,f){this.options=a,this.loadOptions=f}v.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(a){var f,p;if(a.skip(22),this.fileNameLength=a.readInt(2),p=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(p),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((f=function(n){for(var o in b)if(b.hasOwnProperty(o)&&b[o].magic===n)return b[o];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+c.pretty(this.compressionMethod)+" unknown (inner file : "+c.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,f,a.readData(this.compressedSize))},readCentralPart:function(a){this.versionMadeBy=a.readInt(2),a.skip(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4);var f=a.readInt(2);if(this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");a.skip(f),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a==0&&(this.dosPermissions=63&this.externalFileAttributes),a==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(a){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===c.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===c.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===c.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===c.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(a){var f,p,n,o=a.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});a.index+4<o;)f=a.readInt(2),p=a.readInt(2),n=a.readData(p),this.extraFields[f]={id:f,length:p,value:n};a.setIndex(o)},handleUTF8:function(){var a=m.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=_.utf8decode(this.fileName),this.fileCommentStr=_.utf8decode(this.fileComment);else{var f=this.findExtraFieldUnicodePath();if(f!==null)this.fileNameStr=f;else{var p=c.transformTo(a,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(p)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var o=c.transformTo(a,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var a=this.extraFields[28789];if(a){var f=s(a.value);return f.readInt(1)!==1||l(this.fileName)!==f.readInt(4)?null:_.utf8decode(f.readData(a.length-5))}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var f=s(a.value);return f.readInt(1)!==1||l(this.fileComment)!==f.readInt(4)?null:_.utf8decode(f.readData(a.length-5))}return null}},x.exports=v},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(i,x,d){function s(f,p,n){this.name=f,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=p,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var c=i("./stream/StreamHelper"),r=i("./stream/DataWorker"),l=i("./utf8"),_=i("./compressedObject"),b=i("./stream/GenericWorker");s.prototype={internalStream:function(f){var p=null,n="string";try{if(!f)throw new Error("No output type specified.");var o=(n=f.toLowerCase())==="string"||n==="text";n!=="binarystring"&&n!=="text"||(n="string"),p=this._decompressWorker();var u=!this._dataBinary;u&&!o&&(p=p.pipe(new l.Utf8EncodeWorker)),!u&&o&&(p=p.pipe(new l.Utf8DecodeWorker))}catch(w){(p=new b("error")).error(w)}return new c(p,n,"")},async:function(f,p){return this.internalStream(f).accumulate(p)},nodeStream:function(f,p){return this.internalStream(f||"nodebuffer").toNodejsStream(p)},_compressWorker:function(f,p){if(this._data instanceof _&&this._data.compression.magic===f.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new l.Utf8EncodeWorker)),_.createWorkerFrom(n,f,p)},_decompressWorker:function(){return this._data instanceof _?this._data.getContentWorker():this._data instanceof b?this._data:new r(this._data)}};for(var m=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],v=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},a=0;a<m.length;a++)s.prototype[m[a]]=v;x.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(i,x,d){(function(s){var c,r,l=s.MutationObserver||s.WebKitMutationObserver;if(l){var _=0,b=new l(f),m=s.document.createTextNode("");b.observe(m,{characterData:!0}),c=function(){m.data=_=++_%2}}else if(s.setImmediate||s.MessageChannel===void 0)c="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var p=s.document.createElement("script");p.onreadystatechange=function(){f(),p.onreadystatechange=null,p.parentNode.removeChild(p),p=null},s.document.documentElement.appendChild(p)}:function(){setTimeout(f,0)};else{var v=new s.MessageChannel;v.port1.onmessage=f,c=function(){v.port2.postMessage(0)}}var a=[];function f(){var p,n;r=!0;for(var o=a.length;o;){for(n=a,a=[],p=-1;++p<o;)n[p]();o=a.length}r=!1}x.exports=function(p){a.push(p)!==1||r||c()}}).call(this,typeof Me<"u"?Me:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(i,x,d){var s=i("immediate");function c(){}var r={},l=["REJECTED"],_=["FULFILLED"],b=["PENDING"];function m(o){if(typeof o!="function")throw new TypeError("resolver must be a function");this.state=b,this.queue=[],this.outcome=void 0,o!==c&&p(this,o)}function v(o,u,w){this.promise=o,typeof u=="function"&&(this.onFulfilled=u,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function a(o,u,w){s(function(){var I;try{I=u(w)}catch(S){return r.reject(o,S)}I===o?r.reject(o,new TypeError("Cannot resolve promise with itself")):r.resolve(o,I)})}function f(o){var u=o&&o.then;if(o&&(typeof o=="object"||typeof o=="function")&&typeof u=="function")return function(){u.apply(o,arguments)}}function p(o,u){var w=!1;function I(O){w||(w=!0,r.reject(o,O))}function S(O){w||(w=!0,r.resolve(o,O))}var N=n(function(){u(S,I)});N.status==="error"&&I(N.value)}function n(o,u){var w={};try{w.value=o(u),w.status="success"}catch(I){w.status="error",w.value=I}return w}(x.exports=m).prototype.finally=function(o){if(typeof o!="function")return this;var u=this.constructor;return this.then(function(w){return u.resolve(o()).then(function(){return w})},function(w){return u.resolve(o()).then(function(){throw w})})},m.prototype.catch=function(o){return this.then(null,o)},m.prototype.then=function(o,u){if(typeof o!="function"&&this.state===_||typeof u!="function"&&this.state===l)return this;var w=new this.constructor(c);return this.state!==b?a(w,this.state===_?o:u,this.outcome):this.queue.push(new v(w,o,u)),w},v.prototype.callFulfilled=function(o){r.resolve(this.promise,o)},v.prototype.otherCallFulfilled=function(o){a(this.promise,this.onFulfilled,o)},v.prototype.callRejected=function(o){r.reject(this.promise,o)},v.prototype.otherCallRejected=function(o){a(this.promise,this.onRejected,o)},r.resolve=function(o,u){var w=n(f,u);if(w.status==="error")return r.reject(o,w.value);var I=w.value;if(I)p(o,I);else{o.state=_,o.outcome=u;for(var S=-1,N=o.queue.length;++S<N;)o.queue[S].callFulfilled(u)}return o},r.reject=function(o,u){o.state=l,o.outcome=u;for(var w=-1,I=o.queue.length;++w<I;)o.queue[w].callRejected(u);return o},m.resolve=function(o){return o instanceof this?o:r.resolve(new this(c),o)},m.reject=function(o){var u=new this(c);return r.reject(u,o)},m.all=function(o){var u=this;if(Object.prototype.toString.call(o)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=o.length,I=!1;if(!w)return this.resolve([]);for(var S=new Array(w),N=0,O=-1,q=new this(c);++O<w;)D(o[O],O);return q;function D(M,J){u.resolve(M).then(function(g){S[J]=g,++N!==w||I||(I=!0,r.resolve(q,S))},function(g){I||(I=!0,r.reject(q,g))})}},m.race=function(o){var u=this;if(Object.prototype.toString.call(o)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=o.length,I=!1;if(!w)return this.resolve([]);for(var S=-1,N=new this(c);++S<w;)O=o[S],u.resolve(O).then(function(q){I||(I=!0,r.resolve(N,q))},function(q){I||(I=!0,r.reject(N,q))});var O;return N}},{immediate:36}],38:[function(i,x,d){var s={};(0,i("./lib/utils/common").assign)(s,i("./lib/deflate"),i("./lib/inflate"),i("./lib/zlib/constants")),x.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(i,x,d){var s=i("./zlib/deflate"),c=i("./utils/common"),r=i("./utils/strings"),l=i("./zlib/messages"),_=i("./zlib/zstream"),b=Object.prototype.toString,m=0,v=-1,a=0,f=8;function p(o){if(!(this instanceof p))return new p(o);this.options=c.assign({level:v,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:a,to:""},o||{});var u=this.options;u.raw&&0<u.windowBits?u.windowBits=-u.windowBits:u.gzip&&0<u.windowBits&&u.windowBits<16&&(u.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _,this.strm.avail_out=0;var w=s.deflateInit2(this.strm,u.level,u.method,u.windowBits,u.memLevel,u.strategy);if(w!==m)throw new Error(l[w]);if(u.header&&s.deflateSetHeader(this.strm,u.header),u.dictionary){var I;if(I=typeof u.dictionary=="string"?r.string2buf(u.dictionary):b.call(u.dictionary)==="[object ArrayBuffer]"?new Uint8Array(u.dictionary):u.dictionary,(w=s.deflateSetDictionary(this.strm,I))!==m)throw new Error(l[w]);this._dict_set=!0}}function n(o,u){var w=new p(u);if(w.push(o,!0),w.err)throw w.msg||l[w.err];return w.result}p.prototype.push=function(o,u){var w,I,S=this.strm,N=this.options.chunkSize;if(this.ended)return!1;I=u===~~u?u:u===!0?4:0,typeof o=="string"?S.input=r.string2buf(o):b.call(o)==="[object ArrayBuffer]"?S.input=new Uint8Array(o):S.input=o,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new c.Buf8(N),S.next_out=0,S.avail_out=N),(w=s.deflate(S,I))!==1&&w!==m)return this.onEnd(w),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||I!==4&&I!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(c.shrinkBuf(S.output,S.next_out))):this.onData(c.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&w!==1);return I===4?(w=s.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===m):I!==2||(this.onEnd(m),!(S.avail_out=0))},p.prototype.onData=function(o){this.chunks.push(o)},p.prototype.onEnd=function(o){o===m&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=o,this.msg=this.strm.msg},d.Deflate=p,d.deflate=n,d.deflateRaw=function(o,u){return(u=u||{}).raw=!0,n(o,u)},d.gzip=function(o,u){return(u=u||{}).gzip=!0,n(o,u)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(i,x,d){var s=i("./zlib/inflate"),c=i("./utils/common"),r=i("./utils/strings"),l=i("./zlib/constants"),_=i("./zlib/messages"),b=i("./zlib/zstream"),m=i("./zlib/gzheader"),v=Object.prototype.toString;function a(p){if(!(this instanceof a))return new a(p);this.options=c.assign({chunkSize:16384,windowBits:0,to:""},p||{});var n=this.options;n.raw&&0<=n.windowBits&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),!(0<=n.windowBits&&n.windowBits<16)||p&&p.windowBits||(n.windowBits+=32),15<n.windowBits&&n.windowBits<48&&!(15&n.windowBits)&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var o=s.inflateInit2(this.strm,n.windowBits);if(o!==l.Z_OK)throw new Error(_[o]);this.header=new m,s.inflateGetHeader(this.strm,this.header)}function f(p,n){var o=new a(n);if(o.push(p,!0),o.err)throw o.msg||_[o.err];return o.result}a.prototype.push=function(p,n){var o,u,w,I,S,N,O=this.strm,q=this.options.chunkSize,D=this.options.dictionary,M=!1;if(this.ended)return!1;u=n===~~n?n:n===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof p=="string"?O.input=r.binstring2buf(p):v.call(p)==="[object ArrayBuffer]"?O.input=new Uint8Array(p):O.input=p,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new c.Buf8(q),O.next_out=0,O.avail_out=q),(o=s.inflate(O,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&D&&(N=typeof D=="string"?r.string2buf(D):v.call(D)==="[object ArrayBuffer]"?new Uint8Array(D):D,o=s.inflateSetDictionary(this.strm,N)),o===l.Z_BUF_ERROR&&M===!0&&(o=l.Z_OK,M=!1),o!==l.Z_STREAM_END&&o!==l.Z_OK)return this.onEnd(o),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&o!==l.Z_STREAM_END&&(O.avail_in!==0||u!==l.Z_FINISH&&u!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=r.utf8border(O.output,O.next_out),I=O.next_out-w,S=r.buf2string(O.output,w),O.next_out=I,O.avail_out=q-I,I&&c.arraySet(O.output,O.output,w,I,0),this.onData(S)):this.onData(c.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(M=!0)}while((0<O.avail_in||O.avail_out===0)&&o!==l.Z_STREAM_END);return o===l.Z_STREAM_END&&(u=l.Z_FINISH),u===l.Z_FINISH?(o=s.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===l.Z_OK):u!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(O.avail_out=0))},a.prototype.onData=function(p){this.chunks.push(p)},a.prototype.onEnd=function(p){p===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=c.flattenChunks(this.chunks)),this.chunks=[],this.err=p,this.msg=this.strm.msg},d.Inflate=a,d.inflate=f,d.inflateRaw=function(p,n){return(n=n||{}).raw=!0,f(p,n)},d.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(i,x,d){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";d.assign=function(l){for(var _=Array.prototype.slice.call(arguments,1);_.length;){var b=_.shift();if(b){if(typeof b!="object")throw new TypeError(b+"must be non-object");for(var m in b)b.hasOwnProperty(m)&&(l[m]=b[m])}}return l},d.shrinkBuf=function(l,_){return l.length===_?l:l.subarray?l.subarray(0,_):(l.length=_,l)};var c={arraySet:function(l,_,b,m,v){if(_.subarray&&l.subarray)l.set(_.subarray(b,b+m),v);else for(var a=0;a<m;a++)l[v+a]=_[b+a]},flattenChunks:function(l){var _,b,m,v,a,f;for(_=m=0,b=l.length;_<b;_++)m+=l[_].length;for(f=new Uint8Array(m),_=v=0,b=l.length;_<b;_++)a=l[_],f.set(a,v),v+=a.length;return f}},r={arraySet:function(l,_,b,m,v){for(var a=0;a<m;a++)l[v+a]=_[b+a]},flattenChunks:function(l){return[].concat.apply([],l)}};d.setTyped=function(l){l?(d.Buf8=Uint8Array,d.Buf16=Uint16Array,d.Buf32=Int32Array,d.assign(d,c)):(d.Buf8=Array,d.Buf16=Array,d.Buf32=Array,d.assign(d,r))},d.setTyped(s)},{}],42:[function(i,x,d){var s=i("./common"),c=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var l=new s.Buf8(256),_=0;_<256;_++)l[_]=252<=_?6:248<=_?5:240<=_?4:224<=_?3:192<=_?2:1;function b(m,v){if(v<65537&&(m.subarray&&r||!m.subarray&&c))return String.fromCharCode.apply(null,s.shrinkBuf(m,v));for(var a="",f=0;f<v;f++)a+=String.fromCharCode(m[f]);return a}l[254]=l[254]=1,d.string2buf=function(m){var v,a,f,p,n,o=m.length,u=0;for(p=0;p<o;p++)(64512&(a=m.charCodeAt(p)))==55296&&p+1<o&&(64512&(f=m.charCodeAt(p+1)))==56320&&(a=65536+(a-55296<<10)+(f-56320),p++),u+=a<128?1:a<2048?2:a<65536?3:4;for(v=new s.Buf8(u),p=n=0;n<u;p++)(64512&(a=m.charCodeAt(p)))==55296&&p+1<o&&(64512&(f=m.charCodeAt(p+1)))==56320&&(a=65536+(a-55296<<10)+(f-56320),p++),a<128?v[n++]=a:(a<2048?v[n++]=192|a>>>6:(a<65536?v[n++]=224|a>>>12:(v[n++]=240|a>>>18,v[n++]=128|a>>>12&63),v[n++]=128|a>>>6&63),v[n++]=128|63&a);return v},d.buf2binstring=function(m){return b(m,m.length)},d.binstring2buf=function(m){for(var v=new s.Buf8(m.length),a=0,f=v.length;a<f;a++)v[a]=m.charCodeAt(a);return v},d.buf2string=function(m,v){var a,f,p,n,o=v||m.length,u=new Array(2*o);for(a=f=0;a<o;)if((p=m[a++])<128)u[f++]=p;else if(4<(n=l[p]))u[f++]=65533,a+=n-1;else{for(p&=n===2?31:n===3?15:7;1<n&&a<o;)p=p<<6|63&m[a++],n--;1<n?u[f++]=65533:p<65536?u[f++]=p:(p-=65536,u[f++]=55296|p>>10&1023,u[f++]=56320|1023&p)}return b(u,f)},d.utf8border=function(m,v){var a;for((v=v||m.length)>m.length&&(v=m.length),a=v-1;0<=a&&(192&m[a])==128;)a--;return a<0||a===0?v:a+l[m[a]]>v?a:v}},{"./common":41}],43:[function(i,x,d){x.exports=function(s,c,r,l){for(var _=65535&s|0,b=s>>>16&65535|0,m=0;r!==0;){for(r-=m=2e3<r?2e3:r;b=b+(_=_+c[l++]|0)|0,--m;);_%=65521,b%=65521}return _|b<<16|0}},{}],44:[function(i,x,d){x.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(i,x,d){var s=function(){for(var c,r=[],l=0;l<256;l++){c=l;for(var _=0;_<8;_++)c=1&c?3988292384^c>>>1:c>>>1;r[l]=c}return r}();x.exports=function(c,r,l,_){var b=s,m=_+l;c^=-1;for(var v=_;v<m;v++)c=c>>>8^b[255&(c^r[v])];return-1^c}},{}],46:[function(i,x,d){var s,c=i("../utils/common"),r=i("./trees"),l=i("./adler32"),_=i("./crc32"),b=i("./messages"),m=0,v=4,a=0,f=-2,p=-1,n=4,o=2,u=8,w=9,I=286,S=30,N=19,O=2*I+1,q=15,D=3,M=258,J=M+D+1,g=42,T=113,t=1,R=2,Q=3,H=4;function ee(e,B){return e.msg=b[B],B}function W(e){return(e<<1)-(4<e?9:0)}function $(e){for(var B=e.length;0<=--B;)e[B]=0}function C(e){var B=e.state,P=B.pending;P>e.avail_out&&(P=e.avail_out),P!==0&&(c.arraySet(e.output,B.pending_buf,B.pending_out,P,e.next_out),e.next_out+=P,B.pending_out+=P,e.total_out+=P,e.avail_out-=P,B.pending-=P,B.pending===0&&(B.pending_out=0))}function E(e,B){r._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,B),e.block_start=e.strstart,C(e.strm)}function K(e,B){e.pending_buf[e.pending++]=B}function G(e,B){e.pending_buf[e.pending++]=B>>>8&255,e.pending_buf[e.pending++]=255&B}function V(e,B){var P,h,A=e.max_chain_length,y=e.strstart,U=e.prev_length,F=e.nice_match,z=e.strstart>e.w_size-J?e.strstart-(e.w_size-J):0,j=e.window,Y=e.w_mask,Z=e.prev,X=e.strstart+M,ie=j[y+U-1],re=j[y+U];e.prev_length>=e.good_match&&(A>>=2),F>e.lookahead&&(F=e.lookahead);do if(j[(P=B)+U]===re&&j[P+U-1]===ie&&j[P]===j[y]&&j[++P]===j[y+1]){y+=2,P++;do;while(j[++y]===j[++P]&&j[++y]===j[++P]&&j[++y]===j[++P]&&j[++y]===j[++P]&&j[++y]===j[++P]&&j[++y]===j[++P]&&j[++y]===j[++P]&&j[++y]===j[++P]&&y<X);if(h=M-(X-y),y=X-M,U<h){if(e.match_start=B,F<=(U=h))break;ie=j[y+U-1],re=j[y+U]}}while((B=Z[B&Y])>z&&--A!=0);return U<=e.lookahead?U:e.lookahead}function ae(e){var B,P,h,A,y,U,F,z,j,Y,Z=e.w_size;do{if(A=e.window_size-e.lookahead-e.strstart,e.strstart>=Z+(Z-J)){for(c.arraySet(e.window,e.window,Z,Z,0),e.match_start-=Z,e.strstart-=Z,e.block_start-=Z,B=P=e.hash_size;h=e.head[--B],e.head[B]=Z<=h?h-Z:0,--P;);for(B=P=Z;h=e.prev[--B],e.prev[B]=Z<=h?h-Z:0,--P;);A+=Z}if(e.strm.avail_in===0)break;if(U=e.strm,F=e.window,z=e.strstart+e.lookahead,j=A,Y=void 0,Y=U.avail_in,j<Y&&(Y=j),P=Y===0?0:(U.avail_in-=Y,c.arraySet(F,U.input,U.next_in,Y,z),U.state.wrap===1?U.adler=l(U.adler,F,Y,z):U.state.wrap===2&&(U.adler=_(U.adler,F,Y,z)),U.next_in+=Y,U.total_in+=Y,Y),e.lookahead+=P,e.lookahead+e.insert>=D)for(y=e.strstart-e.insert,e.ins_h=e.window[y],e.ins_h=(e.ins_h<<e.hash_shift^e.window[y+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[y+D-1])&e.hash_mask,e.prev[y&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=y,y++,e.insert--,!(e.lookahead+e.insert<D)););}while(e.lookahead<J&&e.strm.avail_in!==0)}function ce(e,B){for(var P,h;;){if(e.lookahead<J){if(ae(e),e.lookahead<J&&B===m)return t;if(e.lookahead===0)break}if(P=0,e.lookahead>=D&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,P=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),P!==0&&e.strstart-P<=e.w_size-J&&(e.match_length=V(e,P)),e.match_length>=D)if(h=r._tr_tally(e,e.strstart-e.match_start,e.match_length-D),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=D){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,P=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else h=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(h&&(E(e,!1),e.strm.avail_out===0))return t}return e.insert=e.strstart<D-1?e.strstart:D-1,B===v?(E(e,!0),e.strm.avail_out===0?Q:H):e.last_lit&&(E(e,!1),e.strm.avail_out===0)?t:R}function te(e,B){for(var P,h,A;;){if(e.lookahead<J){if(ae(e),e.lookahead<J&&B===m)return t;if(e.lookahead===0)break}if(P=0,e.lookahead>=D&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,P=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=D-1,P!==0&&e.prev_length<e.max_lazy_match&&e.strstart-P<=e.w_size-J&&(e.match_length=V(e,P),e.match_length<=5&&(e.strategy===1||e.match_length===D&&4096<e.strstart-e.match_start)&&(e.match_length=D-1)),e.prev_length>=D&&e.match_length<=e.prev_length){for(A=e.strstart+e.lookahead-D,h=r._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-D),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=A&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+D-1])&e.hash_mask,P=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=D-1,e.strstart++,h&&(E(e,!1),e.strm.avail_out===0))return t}else if(e.match_available){if((h=r._tr_tally(e,0,e.window[e.strstart-1]))&&E(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return t}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(h=r._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<D-1?e.strstart:D-1,B===v?(E(e,!0),e.strm.avail_out===0?Q:H):e.last_lit&&(E(e,!1),e.strm.avail_out===0)?t:R}function ne(e,B,P,h,A){this.good_length=e,this.max_lazy=B,this.nice_length=P,this.max_chain=h,this.func=A}function Ae(){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=u,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 c.Buf16(2*O),this.dyn_dtree=new c.Buf16(2*(2*S+1)),this.bl_tree=new c.Buf16(2*(2*N+1)),$(this.dyn_ltree),$(this.dyn_dtree),$(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new c.Buf16(q+1),this.heap=new c.Buf16(2*I+1),$(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new c.Buf16(2*I+1),$(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 se(e){var B;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=o,(B=e.state).pending=0,B.pending_out=0,B.wrap<0&&(B.wrap=-B.wrap),B.status=B.wrap?g:T,e.adler=B.wrap===2?0:1,B.last_flush=m,r._tr_init(B),a):ee(e,f)}function de(e){var B=se(e);return B===a&&function(P){P.window_size=2*P.w_size,$(P.head),P.max_lazy_match=s[P.level].max_lazy,P.good_match=s[P.level].good_length,P.nice_match=s[P.level].nice_length,P.max_chain_length=s[P.level].max_chain,P.strstart=0,P.block_start=0,P.lookahead=0,P.insert=0,P.match_length=P.prev_length=D-1,P.match_available=0,P.ins_h=0}(e.state),B}function he(e,B,P,h,A,y){if(!e)return f;var U=1;if(B===p&&(B=6),h<0?(U=0,h=-h):15<h&&(U=2,h-=16),A<1||w<A||P!==u||h<8||15<h||B<0||9<B||y<0||n<y)return ee(e,f);h===8&&(h=9);var F=new Ae;return(e.state=F).strm=e,F.wrap=U,F.gzhead=null,F.w_bits=h,F.w_size=1<<F.w_bits,F.w_mask=F.w_size-1,F.hash_bits=A+7,F.hash_size=1<<F.hash_bits,F.hash_mask=F.hash_size-1,F.hash_shift=~~((F.hash_bits+D-1)/D),F.window=new c.Buf8(2*F.w_size),F.head=new c.Buf16(F.hash_size),F.prev=new c.Buf16(F.w_size),F.lit_bufsize=1<<A+6,F.pending_buf_size=4*F.lit_bufsize,F.pending_buf=new c.Buf8(F.pending_buf_size),F.d_buf=1*F.lit_bufsize,F.l_buf=3*F.lit_bufsize,F.level=B,F.strategy=y,F.method=P,de(e)}s=[new ne(0,0,0,0,function(e,B){var P=65535;for(P>e.pending_buf_size-5&&(P=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ae(e),e.lookahead===0&&B===m)return t;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var h=e.block_start+P;if((e.strstart===0||e.strstart>=h)&&(e.lookahead=e.strstart-h,e.strstart=h,E(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-J&&(E(e,!1),e.strm.avail_out===0))return t}return e.insert=0,B===v?(E(e,!0),e.strm.avail_out===0?Q:H):(e.strstart>e.block_start&&(E(e,!1),e.strm.avail_out),t)}),new ne(4,4,8,4,ce),new ne(4,5,16,8,ce),new ne(4,6,32,32,ce),new ne(4,4,16,16,te),new ne(8,16,32,32,te),new ne(8,16,128,128,te),new ne(8,32,128,256,te),new ne(32,128,258,1024,te),new ne(32,258,258,4096,te)],d.deflateInit=function(e,B){return he(e,B,u,15,8,0)},d.deflateInit2=he,d.deflateReset=de,d.deflateResetKeep=se,d.deflateSetHeader=function(e,B){return e&&e.state?e.state.wrap!==2?f:(e.state.gzhead=B,a):f},d.deflate=function(e,B){var P,h,A,y;if(!e||!e.state||5<B||B<0)return e?ee(e,f):f;if(h=e.state,!e.output||!e.input&&e.avail_in!==0||h.status===666&&B!==v)return ee(e,e.avail_out===0?-5:f);if(h.strm=e,P=h.last_flush,h.last_flush=B,h.status===g)if(h.wrap===2)e.adler=0,K(h,31),K(h,139),K(h,8),h.gzhead?(K(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),K(h,255&h.gzhead.time),K(h,h.gzhead.time>>8&255),K(h,h.gzhead.time>>16&255),K(h,h.gzhead.time>>24&255),K(h,h.level===9?2:2<=h.strategy||h.level<2?4:0),K(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(K(h,255&h.gzhead.extra.length),K(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(e.adler=_(e.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=69):(K(h,0),K(h,0),K(h,0),K(h,0),K(h,0),K(h,h.level===9?2:2<=h.strategy||h.level<2?4:0),K(h,3),h.status=T);else{var U=u+(h.w_bits-8<<4)<<8;U|=(2<=h.strategy||h.level<2?0:h.level<6?1:h.level===6?2:3)<<6,h.strstart!==0&&(U|=32),U+=31-U%31,h.status=T,G(h,U),h.strstart!==0&&(G(h,e.adler>>>16),G(h,65535&e.adler)),e.adler=1}if(h.status===69)if(h.gzhead.extra){for(A=h.pending;h.gzindex<(65535&h.gzhead.extra.length)&&(h.pending!==h.pending_buf_size||(h.gzhead.hcrc&&h.pending>A&&(e.adler=_(e.adler,h.pending_buf,h.pending-A,A)),C(e),A=h.pending,h.pending!==h.pending_buf_size));)K(h,255&h.gzhead.extra[h.gzindex]),h.gzindex++;h.gzhead.hcrc&&h.pending>A&&(e.adler=_(e.adler,h.pending_buf,h.pending-A,A)),h.gzindex===h.gzhead.extra.length&&(h.gzindex=0,h.status=73)}else h.status=73;if(h.status===73)if(h.gzhead.name){A=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>A&&(e.adler=_(e.adler,h.pending_buf,h.pending-A,A)),C(e),A=h.pending,h.pending===h.pending_buf_size)){y=1;break}y=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,K(h,y)}while(y!==0);h.gzhead.hcrc&&h.pending>A&&(e.adler=_(e.adler,h.pending_buf,h.pending-A,A)),y===0&&(h.gzindex=0,h.status=91)}else h.status=91;if(h.status===91)if(h.gzhead.comment){A=h.pending;do{if(h.pending===h.pending_buf_size&&(h.gzhead.hcrc&&h.pending>A&&(e.adler=_(e.adler,h.pending_buf,h.pending-A,A)),C(e),A=h.pending,h.pending===h.pending_buf_size)){y=1;break}y=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,K(h,y)}while(y!==0);h.gzhead.hcrc&&h.pending>A&&(e.adler=_(e.adler,h.pending_buf,h.pending-A,A)),y===0&&(h.status=103)}else h.status=103;if(h.status===103&&(h.gzhead.hcrc?(h.pending+2>h.pending_buf_size&&C(e),h.pending+2<=h.pending_buf_size&&(K(h,255&e.adler),K(h,e.adler>>8&255),e.adler=0,h.status=T)):h.status=T),h.pending!==0){if(C(e),e.avail_out===0)return h.last_flush=-1,a}else if(e.avail_in===0&&W(B)<=W(P)&&B!==v)return ee(e,-5);if(h.status===666&&e.avail_in!==0)return ee(e,-5);if(e.avail_in!==0||h.lookahead!==0||B!==m&&h.status!==666){var F=h.strategy===2?function(z,j){for(var Y;;){if(z.lookahead===0&&(ae(z),z.lookahead===0)){if(j===m)return t;break}if(z.match_length=0,Y=r._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++,Y&&(E(z,!1),z.strm.avail_out===0))return t}return z.insert=0,j===v?(E(z,!0),z.strm.avail_out===0?Q:H):z.last_lit&&(E(z,!1),z.strm.avail_out===0)?t:R}(h,B):h.strategy===3?function(z,j){for(var Y,Z,X,ie,re=z.window;;){if(z.lookahead<=M){if(ae(z),z.lookahead<=M&&j===m)return t;if(z.lookahead===0)break}if(z.match_length=0,z.lookahead>=D&&0<z.strstart&&(Z=re[X=z.strstart-1])===re[++X]&&Z===re[++X]&&Z===re[++X]){ie=z.strstart+M;do;while(Z===re[++X]&&Z===re[++X]&&Z===re[++X]&&Z===re[++X]&&Z===re[++X]&&Z===re[++X]&&Z===re[++X]&&Z===re[++X]&&X<ie);z.match_length=M-(ie-X),z.match_length>z.lookahead&&(z.match_length=z.lookahead)}if(z.match_length>=D?(Y=r._tr_tally(z,1,z.match_length-D),z.lookahead-=z.match_length,z.strstart+=z.match_length,z.match_length=0):(Y=r._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++),Y&&(E(z,!1),z.strm.avail_out===0))return t}return z.insert=0,j===v?(E(z,!0),z.strm.avail_out===0?Q:H):z.last_lit&&(E(z,!1),z.strm.avail_out===0)?t:R}(h,B):s[h.level].func(h,B);if(F!==Q&&F!==H||(h.status=666),F===t||F===Q)return e.avail_out===0&&(h.last_flush=-1),a;if(F===R&&(B===1?r._tr_align(h):B!==5&&(r._tr_stored_block(h,0,0,!1),B===3&&($(h.head),h.lookahead===0&&(h.strstart=0,h.block_start=0,h.insert=0))),C(e),e.avail_out===0))return h.last_flush=-1,a}return B!==v?a:h.wrap<=0?1:(h.wrap===2?(K(h,255&e.adler),K(h,e.adler>>8&255),K(h,e.adler>>16&255),K(h,e.adler>>24&255),K(h,255&e.total_in),K(h,e.total_in>>8&255),K(h,e.total_in>>16&255),K(h,e.total_in>>24&255)):(G(h,e.adler>>>16),G(h,65535&e.adler)),C(e),0<h.wrap&&(h.wrap=-h.wrap),h.pending!==0?a:1)},d.deflateEnd=function(e){var B;return e&&e.state?(B=e.state.status)!==g&&B!==69&&B!==73&&B!==91&&B!==103&&B!==T&&B!==666?ee(e,f):(e.state=null,B===T?ee(e,-3):a):f},d.deflateSetDictionary=function(e,B){var P,h,A,y,U,F,z,j,Y=B.length;if(!e||!e.state||(y=(P=e.state).wrap)===2||y===1&&P.status!==g||P.lookahead)return f;for(y===1&&(e.adler=l(e.adler,B,Y,0)),P.wrap=0,Y>=P.w_size&&(y===0&&($(P.head),P.strstart=0,P.block_start=0,P.insert=0),j=new c.Buf8(P.w_size),c.arraySet(j,B,Y-P.w_size,P.w_size,0),B=j,Y=P.w_size),U=e.avail_in,F=e.next_in,z=e.input,e.avail_in=Y,e.next_in=0,e.input=B,ae(P);P.lookahead>=D;){for(h=P.strstart,A=P.lookahead-(D-1);P.ins_h=(P.ins_h<<P.hash_shift^P.window[h+D-1])&P.hash_mask,P.prev[h&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=h,h++,--A;);P.strstart=h,P.lookahead=D-1,ae(P)}return P.strstart+=P.lookahead,P.block_start=P.strstart,P.insert=P.lookahead,P.lookahead=0,P.match_length=P.prev_length=D-1,P.match_available=0,e.next_in=F,e.input=z,e.avail_in=U,P.wrap=y,a},d.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(i,x,d){x.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(i,x,d){x.exports=function(s,c){var r,l,_,b,m,v,a,f,p,n,o,u,w,I,S,N,O,q,D,M,J,g,T,t,R;r=s.state,l=s.next_in,t=s.input,_=l+(s.avail_in-5),b=s.next_out,R=s.output,m=b-(c-s.avail_out),v=b+(s.avail_out-257),a=r.dmax,f=r.wsize,p=r.whave,n=r.wnext,o=r.window,u=r.hold,w=r.bits,I=r.lencode,S=r.distcode,N=(1<<r.lenbits)-1,O=(1<<r.distbits)-1;e:do{w<15&&(u+=t[l++]<<w,w+=8,u+=t[l++]<<w,w+=8),q=I[u&N];t:for(;;){if(u>>>=D=q>>>24,w-=D,(D=q>>>16&255)===0)R[b++]=65535&q;else{if(!(16&D)){if(!(64&D)){q=I[(65535&q)+(u&(1<<D)-1)];continue t}if(32&D){r.mode=12;break e}s.msg="invalid literal/length code",r.mode=30;break e}M=65535&q,(D&=15)&&(w<D&&(u+=t[l++]<<w,w+=8),M+=u&(1<<D)-1,u>>>=D,w-=D),w<15&&(u+=t[l++]<<w,w+=8,u+=t[l++]<<w,w+=8),q=S[u&O];r:for(;;){if(u>>>=D=q>>>24,w-=D,!(16&(D=q>>>16&255))){if(!(64&D)){q=S[(65535&q)+(u&(1<<D)-1)];continue r}s.msg="invalid distance code",r.mode=30;break e}if(J=65535&q,w<(D&=15)&&(u+=t[l++]<<w,(w+=8)<D&&(u+=t[l++]<<w,w+=8)),a<(J+=u&(1<<D)-1)){s.msg="invalid distance too far back",r.mode=30;break e}if(u>>>=D,w-=D,(D=b-m)<J){if(p<(D=J-D)&&r.sane){s.msg="invalid distance too far back",r.mode=30;break e}if(T=o,(g=0)===n){if(g+=f-D,D<M){for(M-=D;R[b++]=o[g++],--D;);g=b-J,T=R}}else if(n<D){if(g+=f+n-D,(D-=n)<M){for(M-=D;R[b++]=o[g++],--D;);if(g=0,n<M){for(M-=D=n;R[b++]=o[g++],--D;);g=b-J,T=R}}}else if(g+=n-D,D<M){for(M-=D;R[b++]=o[g++],--D;);g=b-J,T=R}for(;2<M;)R[b++]=T[g++],R[b++]=T[g++],R[b++]=T[g++],M-=3;M&&(R[b++]=T[g++],1<M&&(R[b++]=T[g++]))}else{for(g=b-J;R[b++]=R[g++],R[b++]=R[g++],R[b++]=R[g++],2<(M-=3););M&&(R[b++]=R[g++],1<M&&(R[b++]=R[g++]))}break}}break}}while(l<_&&b<v);l-=M=w>>3,u&=(1<<(w-=M<<3))-1,s.next_in=l,s.next_out=b,s.avail_in=l<_?_-l+5:5-(l-_),s.avail_out=b<v?v-b+257:257-(b-v),r.hold=u,r.bits=w}},{}],49:[function(i,x,d){var s=i("../utils/common"),c=i("./adler32"),r=i("./crc32"),l=i("./inffast"),_=i("./inftrees"),b=1,m=2,v=0,a=-2,f=1,p=852,n=592;function o(g){return(g>>>24&255)+(g>>>8&65280)+((65280&g)<<8)+((255&g)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(g){var T;return g&&g.state?(T=g.state,g.total_in=g.total_out=T.total=0,g.msg="",T.wrap&&(g.adler=1&T.wrap),T.mode=f,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new s.Buf32(p),T.distcode=T.distdyn=new s.Buf32(n),T.sane=1,T.back=-1,v):a}function I(g){var T;return g&&g.state?((T=g.state).wsize=0,T.whave=0,T.wnext=0,w(g)):a}function S(g,T){var t,R;return g&&g.state?(R=g.state,T<0?(t=0,T=-T):(t=1+(T>>4),T<48&&(T&=15)),T&&(T<8||15<T)?a:(R.window!==null&&R.wbits!==T&&(R.window=null),R.wrap=t,R.wbits=T,I(g))):a}function N(g,T){var t,R;return g?(R=new u,(g.state=R).window=null,(t=S(g,T))!==v&&(g.state=null),t):a}var O,q,D=!0;function M(g){if(D){var T;for(O=new s.Buf32(512),q=new s.Buf32(32),T=0;T<144;)g.lens[T++]=8;for(;T<256;)g.lens[T++]=9;for(;T<280;)g.lens[T++]=7;for(;T<288;)g.lens[T++]=8;for(_(b,g.lens,0,288,O,0,g.work,{bits:9}),T=0;T<32;)g.lens[T++]=5;_(m,g.lens,0,32,q,0,g.work,{bits:5}),D=!1}g.lencode=O,g.lenbits=9,g.distcode=q,g.distbits=5}function J(g,T,t,R){var Q,H=g.state;return H.window===null&&(H.wsize=1<<H.wbits,H.wnext=0,H.whave=0,H.window=new s.Buf8(H.wsize)),R>=H.wsize?(s.arraySet(H.window,T,t-H.wsize,H.wsize,0),H.wnext=0,H.whave=H.wsize):(R<(Q=H.wsize-H.wnext)&&(Q=R),s.arraySet(H.window,T,t-R,Q,H.wnext),(R-=Q)?(s.arraySet(H.window,T,t-R,R,0),H.wnext=R,H.whave=H.wsize):(H.wnext+=Q,H.wnext===H.wsize&&(H.wnext=0),H.whave<H.wsize&&(H.whave+=Q))),0}d.inflateReset=I,d.inflateReset2=S,d.inflateResetKeep=w,d.inflateInit=function(g){return N(g,15)},d.inflateInit2=N,d.inflate=function(g,T){var t,R,Q,H,ee,W,$,C,E,K,G,V,ae,ce,te,ne,Ae,se,de,he,e,B,P,h,A=0,y=new s.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!g||!g.state||!g.output||!g.input&&g.avail_in!==0)return a;(t=g.state).mode===12&&(t.mode=13),ee=g.next_out,Q=g.output,$=g.avail_out,H=g.next_in,R=g.input,W=g.avail_in,C=t.hold,E=t.bits,K=W,G=$,B=v;e:for(;;)switch(t.mode){case f:if(t.wrap===0){t.mode=13;break}for(;E<16;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(2&t.wrap&&C===35615){y[t.check=0]=255&C,y[1]=C>>>8&255,t.check=r(t.check,y,2,0),E=C=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&C)<<8)+(C>>8))%31){g.msg="incorrect header check",t.mode=30;break}if((15&C)!=8){g.msg="unknown compression method",t.mode=30;break}if(E-=4,e=8+(15&(C>>>=4)),t.wbits===0)t.wbits=e;else if(e>t.wbits){g.msg="invalid window size",t.mode=30;break}t.dmax=1<<e,g.adler=t.check=1,t.mode=512&C?10:12,E=C=0;break;case 2:for(;E<16;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(t.flags=C,(255&t.flags)!=8){g.msg="unknown compression method",t.mode=30;break}if(57344&t.flags){g.msg="unknown header flags set",t.mode=30;break}t.head&&(t.head.text=C>>8&1),512&t.flags&&(y[0]=255&C,y[1]=C>>>8&255,t.check=r(t.check,y,2,0)),E=C=0,t.mode=3;case 3:for(;E<32;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}t.head&&(t.head.time=C),512&t.flags&&(y[0]=255&C,y[1]=C>>>8&255,y[2]=C>>>16&255,y[3]=C>>>24&255,t.check=r(t.check,y,4,0)),E=C=0,t.mode=4;case 4:for(;E<16;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}t.head&&(t.head.xflags=255&C,t.head.os=C>>8),512&t.flags&&(y[0]=255&C,y[1]=C>>>8&255,t.check=r(t.check,y,2,0)),E=C=0,t.mode=5;case 5:if(1024&t.flags){for(;E<16;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}t.length=C,t.head&&(t.head.extra_len=C),512&t.flags&&(y[0]=255&C,y[1]=C>>>8&255,t.check=r(t.check,y,2,0)),E=C=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&(W<(V=t.length)&&(V=W),V&&(t.head&&(e=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),s.arraySet(t.head.extra,R,H,V,e)),512&t.flags&&(t.check=r(t.check,R,V,H)),W-=V,H+=V,t.length-=V),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(W===0)break e;for(V=0;e=R[H+V++],t.head&&e&&t.length<65536&&(t.head.name+=String.fromCharCode(e)),e&&V<W;);if(512&t.flags&&(t.check=r(t.check,R,V,H)),W-=V,H+=V,e)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=8;case 8:if(4096&t.flags){if(W===0)break e;for(V=0;e=R[H+V++],t.head&&e&&t.length<65536&&(t.head.comment+=String.fromCharCode(e)),e&&V<W;);if(512&t.flags&&(t.check=r(t.check,R,V,H)),W-=V,H+=V,e)break e}else t.head&&(t.head.comment=null);t.mode=9;case 9:if(512&t.flags){for(;E<16;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(C!==(65535&t.check)){g.msg="header crc mismatch",t.mode=30;break}E=C=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),g.adler=t.check=0,t.mode=12;break;case 10:for(;E<32;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}g.adler=t.check=o(C),E=C=0,t.mode=11;case 11:if(t.havedict===0)return g.next_out=ee,g.avail_out=$,g.next_in=H,g.avail_in=W,t.hold=C,t.bits=E,2;g.adler=t.check=1,t.mode=12;case 12:if(T===5||T===6)break e;case 13:if(t.last){C>>>=7&E,E-=7&E,t.mode=27;break}for(;E<3;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}switch(t.last=1&C,E-=1,3&(C>>>=1)){case 0:t.mode=14;break;case 1:if(M(t),t.mode=20,T!==6)break;C>>>=2,E-=2;break e;case 2:t.mode=17;break;case 3:g.msg="invalid block type",t.mode=30}C>>>=2,E-=2;break;case 14:for(C>>>=7&E,E-=7&E;E<32;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if((65535&C)!=(C>>>16^65535)){g.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&C,E=C=0,t.mode=15,T===6)break e;case 15:t.mode=16;case 16:if(V=t.length){if(W<V&&(V=W),$<V&&(V=$),V===0)break e;s.arraySet(Q,R,H,V,ee),W-=V,H+=V,$-=V,ee+=V,t.length-=V;break}t.mode=12;break;case 17:for(;E<14;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(t.nlen=257+(31&C),C>>>=5,E-=5,t.ndist=1+(31&C),C>>>=5,E-=5,t.ncode=4+(15&C),C>>>=4,E-=4,286<t.nlen||30<t.ndist){g.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have<t.ncode;){for(;E<3;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}t.lens[U[t.have++]]=7&C,C>>>=3,E-=3}for(;t.have<19;)t.lens[U[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,P={bits:t.lenbits},B=_(0,t.lens,0,19,t.lencode,0,t.work,P),t.lenbits=P.bits,B){g.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have<t.nlen+t.ndist;){for(;ne=(A=t.lencode[C&(1<<t.lenbits)-1])>>>16&255,Ae=65535&A,!((te=A>>>24)<=E);){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(Ae<16)C>>>=te,E-=te,t.lens[t.have++]=Ae;else{if(Ae===16){for(h=te+2;E<h;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(C>>>=te,E-=te,t.have===0){g.msg="invalid bit length repeat",t.mode=30;break}e=t.lens[t.have-1],V=3+(3&C),C>>>=2,E-=2}else if(Ae===17){for(h=te+3;E<h;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}E-=te,e=0,V=3+(7&(C>>>=te)),C>>>=3,E-=3}else{for(h=te+7;E<h;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}E-=te,e=0,V=11+(127&(C>>>=te)),C>>>=7,E-=7}if(t.have+V>t.nlen+t.ndist){g.msg="invalid bit length repeat",t.mode=30;break}for(;V--;)t.lens[t.have++]=e}}if(t.mode===30)break;if(t.lens[256]===0){g.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,P={bits:t.lenbits},B=_(b,t.lens,0,t.nlen,t.lencode,0,t.work,P),t.lenbits=P.bits,B){g.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,P={bits:t.distbits},B=_(m,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,P),t.distbits=P.bits,B){g.msg="invalid distances set",t.mode=30;break}if(t.mode=20,T===6)break e;case 20:t.mode=21;case 21:if(6<=W&&258<=$){g.next_out=ee,g.avail_out=$,g.next_in=H,g.avail_in=W,t.hold=C,t.bits=E,l(g,G),ee=g.next_out,Q=g.output,$=g.avail_out,H=g.next_in,R=g.input,W=g.avail_in,C=t.hold,E=t.bits,t.mode===12&&(t.back=-1);break}for(t.back=0;ne=(A=t.lencode[C&(1<<t.lenbits)-1])>>>16&255,Ae=65535&A,!((te=A>>>24)<=E);){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(ne&&!(240&ne)){for(se=te,de=ne,he=Ae;ne=(A=t.lencode[he+((C&(1<<se+de)-1)>>se)])>>>16&255,Ae=65535&A,!(se+(te=A>>>24)<=E);){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}C>>>=se,E-=se,t.back+=se}if(C>>>=te,E-=te,t.back+=te,t.length=Ae,ne===0){t.mode=26;break}if(32&ne){t.back=-1,t.mode=12;break}if(64&ne){g.msg="invalid literal/length code",t.mode=30;break}t.extra=15&ne,t.mode=22;case 22:if(t.extra){for(h=t.extra;E<h;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}t.length+=C&(1<<t.extra)-1,C>>>=t.extra,E-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;ne=(A=t.distcode[C&(1<<t.distbits)-1])>>>16&255,Ae=65535&A,!((te=A>>>24)<=E);){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(!(240&ne)){for(se=te,de=ne,he=Ae;ne=(A=t.distcode[he+((C&(1<<se+de)-1)>>se)])>>>16&255,Ae=65535&A,!(se+(te=A>>>24)<=E);){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}C>>>=se,E-=se,t.back+=se}if(C>>>=te,E-=te,t.back+=te,64&ne){g.msg="invalid distance code",t.mode=30;break}t.offset=Ae,t.extra=15&ne,t.mode=24;case 24:if(t.extra){for(h=t.extra;E<h;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}t.offset+=C&(1<<t.extra)-1,C>>>=t.extra,E-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){g.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if($===0)break e;if(V=G-$,t.offset>V){if((V=t.offset-V)>t.whave&&t.sane){g.msg="invalid distance too far back",t.mode=30;break}ae=V>t.wnext?(V-=t.wnext,t.wsize-V):t.wnext-V,V>t.length&&(V=t.length),ce=t.window}else ce=Q,ae=ee-t.offset,V=t.length;for($<V&&(V=$),$-=V,t.length-=V;Q[ee++]=ce[ae++],--V;);t.length===0&&(t.mode=21);break;case 26:if($===0)break e;Q[ee++]=t.length,$--,t.mode=21;break;case 27:if(t.wrap){for(;E<32;){if(W===0)break e;W--,C|=R[H++]<<E,E+=8}if(G-=$,g.total_out+=G,t.total+=G,G&&(g.adler=t.check=t.flags?r(t.check,Q,G,ee-G):c(t.check,Q,G,ee-G)),G=$,(t.flags?C:o(C))!==t.check){g.msg="incorrect data check",t.mode=30;break}E=C=0}t.mode=28;case 28:if(t.wrap&&t.flags){for(;E<32;){if(W===0)break e;W--,C+=R[H++]<<E,E+=8}if(C!==(4294967295&t.total)){g.msg="incorrect length check",t.mode=30;break}E=C=0}t.mode=29;case 29:B=1;break e;case 30:B=-3;break e;case 31:return-4;case 32:default:return a}return g.next_out=ee,g.avail_out=$,g.next_in=H,g.avail_in=W,t.hold=C,t.bits=E,(t.wsize||G!==g.avail_out&&t.mode<30&&(t.mode<27||T!==4))&&J(g,g.output,g.next_out,G-g.avail_out)?(t.mode=31,-4):(K-=g.avail_in,G-=g.avail_out,g.total_in+=K,g.total_out+=G,t.total+=G,t.wrap&&G&&(g.adler=t.check=t.flags?r(t.check,Q,G,g.next_out-G):c(t.check,Q,G,g.next_out-G)),g.data_type=t.bits+(t.last?64:0)+(t.mode===12?128:0)+(t.mode===20||t.mode===15?256:0),(K==0&&G===0||T===4)&&B===v&&(B=-5),B)},d.inflateEnd=function(g){if(!g||!g.state)return a;var T=g.state;return T.window&&(T.window=null),g.state=null,v},d.inflateGetHeader=function(g,T){var t;return g&&g.state&&2&(t=g.state).wrap?((t.head=T).done=!1,v):a},d.inflateSetDictionary=function(g,T){var t,R=T.length;return g&&g.state?(t=g.state).wrap!==0&&t.mode!==11?a:t.mode===11&&c(1,T,R,0)!==t.check?-3:J(g,T,R,R)?(t.mode=31,-4):(t.havedict=1,v):a},d.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(i,x,d){var s=i("../utils/common"),c=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],_=[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];x.exports=function(b,m,v,a,f,p,n,o){var u,w,I,S,N,O,q,D,M,J=o.bits,g=0,T=0,t=0,R=0,Q=0,H=0,ee=0,W=0,$=0,C=0,E=null,K=0,G=new s.Buf16(16),V=new s.Buf16(16),ae=null,ce=0;for(g=0;g<=15;g++)G[g]=0;for(T=0;T<a;T++)G[m[v+T]]++;for(Q=J,R=15;1<=R&&G[R]===0;R--);if(R<Q&&(Q=R),R===0)return f[p++]=20971520,f[p++]=20971520,o.bits=1,0;for(t=1;t<R&&G[t]===0;t++);for(Q<t&&(Q=t),g=W=1;g<=15;g++)if(W<<=1,(W-=G[g])<0)return-1;if(0<W&&(b===0||R!==1))return-1;for(V[1]=0,g=1;g<15;g++)V[g+1]=V[g]+G[g];for(T=0;T<a;T++)m[v+T]!==0&&(n[V[m[v+T]]++]=T);if(O=b===0?(E=ae=n,19):b===1?(E=c,K-=257,ae=r,ce-=257,256):(E=l,ae=_,-1),g=t,N=p,ee=T=C=0,I=-1,S=($=1<<(H=Q))-1,b===1&&852<$||b===2&&592<$)return 1;for(;;){for(q=g-ee,M=n[T]<O?(D=0,n[T]):n[T]>O?(D=ae[ce+n[T]],E[K+n[T]]):(D=96,0),u=1<<g-ee,t=w=1<<H;f[N+(C>>ee)+(w-=u)]=q<<24|D<<16|M|0,w!==0;);for(u=1<<g-1;C&u;)u>>=1;if(u!==0?(C&=u-1,C+=u):C=0,T++,--G[g]==0){if(g===R)break;g=m[v+n[T]]}if(Q<g&&(C&S)!==I){for(ee===0&&(ee=Q),N+=t,W=1<<(H=g-ee);H+ee<R&&!((W-=G[H+ee])<=0);)H++,W<<=1;if($+=1<<H,b===1&&852<$||b===2&&592<$)return 1;f[I=C&S]=Q<<24|H<<16|N-p|0}}return C!==0&&(f[N+C]=g-ee<<24|64<<16|0),o.bits=Q,0}},{"../utils/common":41}],51:[function(i,x,d){x.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(i,x,d){var s=i("../utils/common"),c=0,r=1;function l(A){for(var y=A.length;0<=--y;)A[y]=0}var _=0,b=29,m=256,v=m+1+b,a=30,f=19,p=2*v+1,n=15,o=16,u=7,w=256,I=16,S=17,N=18,O=[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],q=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=new Array(2*(v+2));l(J);var g=new Array(2*a);l(g);var T=new Array(512);l(T);var t=new Array(256);l(t);var R=new Array(b);l(R);var Q,H,ee,W=new Array(a);function $(A,y,U,F,z){this.static_tree=A,this.extra_bits=y,this.extra_base=U,this.elems=F,this.max_length=z,this.has_stree=A&&A.length}function C(A,y){this.dyn_tree=A,this.max_code=0,this.stat_desc=y}function E(A){return A<256?T[A]:T[256+(A>>>7)]}function K(A,y){A.pending_buf[A.pending++]=255&y,A.pending_buf[A.pending++]=y>>>8&255}function G(A,y,U){A.bi_valid>o-U?(A.bi_buf|=y<<A.bi_valid&65535,K(A,A.bi_buf),A.bi_buf=y>>o-A.bi_valid,A.bi_valid+=U-o):(A.bi_buf|=y<<A.bi_valid&65535,A.bi_valid+=U)}function V(A,y,U){G(A,U[2*y],U[2*y+1])}function ae(A,y){for(var U=0;U|=1&A,A>>>=1,U<<=1,0<--y;);return U>>>1}function ce(A,y,U){var F,z,j=new Array(n+1),Y=0;for(F=1;F<=n;F++)j[F]=Y=Y+U[F-1]<<1;for(z=0;z<=y;z++){var Z=A[2*z+1];Z!==0&&(A[2*z]=ae(j[Z]++,Z))}}function te(A){var y;for(y=0;y<v;y++)A.dyn_ltree[2*y]=0;for(y=0;y<a;y++)A.dyn_dtree[2*y]=0;for(y=0;y<f;y++)A.bl_tree[2*y]=0;A.dyn_ltree[2*w]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function ne(A){8<A.bi_valid?K(A,A.bi_buf):0<A.bi_valid&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function Ae(A,y,U,F){var z=2*y,j=2*U;return A[z]<A[j]||A[z]===A[j]&&F[y]<=F[U]}function se(A,y,U){for(var F=A.heap[U],z=U<<1;z<=A.heap_len&&(z<A.heap_len&&Ae(y,A.heap[z+1],A.heap[z],A.depth)&&z++,!Ae(y,F,A.heap[z],A.depth));)A.heap[U]=A.heap[z],U=z,z<<=1;A.heap[U]=F}function de(A,y,U){var F,z,j,Y,Z=0;if(A.last_lit!==0)for(;F=A.pending_buf[A.d_buf+2*Z]<<8|A.pending_buf[A.d_buf+2*Z+1],z=A.pending_buf[A.l_buf+Z],Z++,F===0?V(A,z,y):(V(A,(j=t[z])+m+1,y),(Y=O[j])!==0&&G(A,z-=R[j],Y),V(A,j=E(--F),U),(Y=q[j])!==0&&G(A,F-=W[j],Y)),Z<A.last_lit;);V(A,w,y)}function he(A,y){var U,F,z,j=y.dyn_tree,Y=y.stat_desc.static_tree,Z=y.stat_desc.has_stree,X=y.stat_desc.elems,ie=-1;for(A.heap_len=0,A.heap_max=p,U=0;U<X;U++)j[2*U]!==0?(A.heap[++A.heap_len]=ie=U,A.depth[U]=0):j[2*U+1]=0;for(;A.heap_len<2;)j[2*(z=A.heap[++A.heap_len]=ie<2?++ie:0)]=1,A.depth[z]=0,A.opt_len--,Z&&(A.static_len-=Y[2*z+1]);for(y.max_code=ie,U=A.heap_len>>1;1<=U;U--)se(A,j,U);for(z=X;U=A.heap[1],A.heap[1]=A.heap[A.heap_len--],se(A,j,1),F=A.heap[1],A.heap[--A.heap_max]=U,A.heap[--A.heap_max]=F,j[2*z]=j[2*U]+j[2*F],A.depth[z]=(A.depth[U]>=A.depth[F]?A.depth[U]:A.depth[F])+1,j[2*U+1]=j[2*F+1]=z,A.heap[1]=z++,se(A,j,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],function(re,ue){var we,pe,ye,oe,Ce,Oe,me=ue.dyn_tree,Ge=ue.max_code,Ct=ue.stat_desc.static_tree,Pt=ue.stat_desc.has_stree,Dt=ue.stat_desc.extra_bits,Ye=ue.stat_desc.extra_base,ke=ue.stat_desc.max_length,Pe=0;for(oe=0;oe<=n;oe++)re.bl_count[oe]=0;for(me[2*re.heap[re.heap_max]+1]=0,we=re.heap_max+1;we<p;we++)ke<(oe=me[2*me[2*(pe=re.heap[we])+1]+1]+1)&&(oe=ke,Pe++),me[2*pe+1]=oe,Ge<pe||(re.bl_count[oe]++,Ce=0,Ye<=pe&&(Ce=Dt[pe-Ye]),Oe=me[2*pe],re.opt_len+=Oe*(oe+Ce),Pt&&(re.static_len+=Oe*(Ct[2*pe+1]+Ce)));if(Pe!==0){do{for(oe=ke-1;re.bl_count[oe]===0;)oe--;re.bl_count[oe]--,re.bl_count[oe+1]+=2,re.bl_count[ke]--,Pe-=2}while(0<Pe);for(oe=ke;oe!==0;oe--)for(pe=re.bl_count[oe];pe!==0;)Ge<(ye=re.heap[--we])||(me[2*ye+1]!==oe&&(re.opt_len+=(oe-me[2*ye+1])*me[2*ye],me[2*ye+1]=oe),pe--)}}(A,y),ce(j,ie,A.bl_count)}function e(A,y,U){var F,z,j=-1,Y=y[1],Z=0,X=7,ie=4;for(Y===0&&(X=138,ie=3),y[2*(U+1)+1]=65535,F=0;F<=U;F++)z=Y,Y=y[2*(F+1)+1],++Z<X&&z===Y||(Z<ie?A.bl_tree[2*z]+=Z:z!==0?(z!==j&&A.bl_tree[2*z]++,A.bl_tree[2*I]++):Z<=10?A.bl_tree[2*S]++:A.bl_tree[2*N]++,j=z,ie=(Z=0)===Y?(X=138,3):z===Y?(X=6,3):(X=7,4))}function B(A,y,U){var F,z,j=-1,Y=y[1],Z=0,X=7,ie=4;for(Y===0&&(X=138,ie=3),F=0;F<=U;F++)if(z=Y,Y=y[2*(F+1)+1],!(++Z<X&&z===Y)){if(Z<ie)for(;V(A,z,A.bl_tree),--Z!=0;);else z!==0?(z!==j&&(V(A,z,A.bl_tree),Z--),V(A,I,A.bl_tree),G(A,Z-3,2)):Z<=10?(V(A,S,A.bl_tree),G(A,Z-3,3)):(V(A,N,A.bl_tree),G(A,Z-11,7));j=z,ie=(Z=0)===Y?(X=138,3):z===Y?(X=6,3):(X=7,4)}}l(W);var P=!1;function h(A,y,U,F){G(A,(_<<1)+(F?1:0),3),function(z,j,Y,Z){ne(z),Z&&(K(z,Y),K(z,~Y)),s.arraySet(z.pending_buf,z.window,j,Y,z.pending),z.pending+=Y}(A,y,U,!0)}d._tr_init=function(A){P||(function(){var y,U,F,z,j,Y=new Array(n+1);for(z=F=0;z<b-1;z++)for(R[z]=F,y=0;y<1<<O[z];y++)t[F++]=z;for(t[F-1]=z,z=j=0;z<16;z++)for(W[z]=j,y=0;y<1<<q[z];y++)T[j++]=z;for(j>>=7;z<a;z++)for(W[z]=j<<7,y=0;y<1<<q[z]-7;y++)T[256+j++]=z;for(U=0;U<=n;U++)Y[U]=0;for(y=0;y<=143;)J[2*y+1]=8,y++,Y[8]++;for(;y<=255;)J[2*y+1]=9,y++,Y[9]++;for(;y<=279;)J[2*y+1]=7,y++,Y[7]++;for(;y<=287;)J[2*y+1]=8,y++,Y[8]++;for(ce(J,v+1,Y),y=0;y<a;y++)g[2*y+1]=5,g[2*y]=ae(y,5);Q=new $(J,O,m+1,v,n),H=new $(g,q,0,a,n),ee=new $(new Array(0),D,0,f,u)}(),P=!0),A.l_desc=new C(A.dyn_ltree,Q),A.d_desc=new C(A.dyn_dtree,H),A.bl_desc=new C(A.bl_tree,ee),A.bi_buf=0,A.bi_valid=0,te(A)},d._tr_stored_block=h,d._tr_flush_block=function(A,y,U,F){var z,j,Y=0;0<A.level?(A.strm.data_type===2&&(A.strm.data_type=function(Z){var X,ie=4093624447;for(X=0;X<=31;X++,ie>>>=1)if(1&ie&&Z.dyn_ltree[2*X]!==0)return c;if(Z.dyn_ltree[18]!==0||Z.dyn_ltree[20]!==0||Z.dyn_ltree[26]!==0)return r;for(X=32;X<m;X++)if(Z.dyn_ltree[2*X]!==0)return r;return c}(A)),he(A,A.l_desc),he(A,A.d_desc),Y=function(Z){var X;for(e(Z,Z.dyn_ltree,Z.l_desc.max_code),e(Z,Z.dyn_dtree,Z.d_desc.max_code),he(Z,Z.bl_desc),X=f-1;3<=X&&Z.bl_tree[2*M[X]+1]===0;X--);return Z.opt_len+=3*(X+1)+5+5+4,X}(A),z=A.opt_len+3+7>>>3,(j=A.static_len+3+7>>>3)<=z&&(z=j)):z=j=U+5,U+4<=z&&y!==-1?h(A,y,U,F):A.strategy===4||j===z?(G(A,2+(F?1:0),3),de(A,J,g)):(G(A,4+(F?1:0),3),function(Z,X,ie,re){var ue;for(G(Z,X-257,5),G(Z,ie-1,5),G(Z,re-4,4),ue=0;ue<re;ue++)G(Z,Z.bl_tree[2*M[ue]+1],3);B(Z,Z.dyn_ltree,X-1),B(Z,Z.dyn_dtree,ie-1)}(A,A.l_desc.max_code+1,A.d_desc.max_code+1,Y+1),de(A,A.dyn_ltree,A.dyn_dtree)),te(A),F&&ne(A)},d._tr_tally=function(A,y,U){return A.pending_buf[A.d_buf+2*A.last_lit]=y>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&y,A.pending_buf[A.l_buf+A.last_lit]=255&U,A.last_lit++,y===0?A.dyn_ltree[2*U]++:(A.matches++,y--,A.dyn_ltree[2*(t[U]+m+1)]++,A.dyn_dtree[2*E(y)]++),A.last_lit===A.lit_bufsize-1},d._tr_align=function(A){G(A,2,3),V(A,w,J),function(y){y.bi_valid===16?(K(y,y.bi_buf),y.bi_buf=0,y.bi_valid=0):8<=y.bi_valid&&(y.pending_buf[y.pending++]=255&y.bi_buf,y.bi_buf>>=8,y.bi_valid-=8)}(A)}},{"../utils/common":41}],53:[function(i,x,d){x.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(i,x,d){x.exports=typeof setImmediate=="function"?setImmediate:function(){var s=[].slice.apply(arguments);s.splice(1,0,0),setTimeout.apply(null,s)}},{}]},{},[10])(10)})})(qe);var pt=qe.exports;const mt=dt(pt);function gt(k){return new Promise(L=>{setTimeout(L,k)})}function _t(k,L){const i=URL.createObjectURL(k),x=document.createElement("a");x.style.display="none",x.download=L,x.href=i,document.body.appendChild(x),x.click(),URL.revokeObjectURL(i)}lt(()=>{const k=document.querySelectorAll(".artwork-cont");if(!k.length)return;const L=document.querySelector(".buttons.ui-helper-clearfix"),i=le('<a class="ame-download-scans"><bdi>Download all scans</bdi></a>');L.appendChild(i);let x=!1;i.addEventListener("click",async()=>{if(!x){x=!0;try{await vt(k,i)}catch(d){i.innerHTML="Download all scans (Retry)",console.error(d)}x=!1}})});async function vt(k,L){var l;const i=new mt,x=xe();if(!x)return;const d={};let s=0;L.innerHTML=`Download all scans (0/${k.length})`;for(const _ of k){s++;const b=_.querySelector("a:last-child");if(!b)continue;const m=(l=_.querySelector("p"))==null?void 0:l.innerText.replace("Types:","").trim();if(!m)continue;d[m]=Number(d[m])+1||1;const v=d[m];for(let a=0;a<5;a++)try{const f=`${m} ${v}.${b.href.split(".").at(-1)}`,p=await We(b.href).then(n=>n.blob());i.file(Re(f),p),L.innerHTML=`Download all scans (${s}/${k.length})`,await gt(100);break}catch(f){console.error(f)}}L.innerHTML="Download all scans (Zipping 0%)";const c=`Scans {${x.catalogs[0]||x.barcode||x.id}}`,r=await i.generateAsync({type:"blob"},_=>{L.innerHTML=`Download all scans (Zipping ${_.percent.toFixed(0)}%)`});_t(r,Re(`${c}.zip`)),L.innerHTML="Download all scans (Done)"}function bt(k,L){let i=document.querySelector(k);if(i)return Ve(i);try{L()}catch{console.error(`Could not create menu reference element for selector "${k}".`)}if(i=document.querySelector(k),i)return Ve(i);throw new Error(`Could not find menu reference element by selector "${k}".`)}function Ve(k){return k.addMenuItem=(L,i)=>{let x=k;for(let d=0;d<100;d++){const s=x.nextElementSibling;if(!s||Number(s.getAttribute("data-index"))>i)break;x=s}return L.setAttribute("data-index",i.toString()),x.after(L),L},k}function wt(k,L,i,x){const d=bt("#ame-sidebar",()=>{const c=document.querySelector(k),r=le("<h2>Ame</h2>"),l=le(`
  32. <ul class="external_links">
  33. <li id="ame-sidebar" style="display: none;"></li>
  34. </ul>
  35. `);c.before(r),c.before(l)}),s=le(`
  36. <li data-index="${L}" style="background: transparent url('${i}') center left no-repeat; background-size: 16px 16px;">
  37. ${x}
  38. </li>
  39. `);return d.addMenuItem(s,100)}function be(k,L,i,x){return wt(".release-information",k,L,`<a target="_blank" href="${x}">${i}</a>`)}const Ee="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3e%3c!--!%20Font%20Awesome%20Pro%206.2.0%20by%20@fontawesome%20-%20https://fontawesome.com%20License%20-%20https://fontawesome.com/license%20(Commercial%20License)%20Copyright%202022%20Fonticons,%20Inc.%20--%3e%3cpath%20fill='%23dedede'%20d='M512%20255.1c0%201.8-.9%202.7-.9%203.6.5%2036.5-32.7%2060.4-69.2%2060.4H344c-26.5%200-48%2022.4-48%2048.9%200%203.4.4%206.7%201%209.9%202.2%2010.2%206.5%2019.2%2010.9%2029.9%206%2013.8%2012.1%2027.5%2012.1%2042%200%2031.9-21.6%2060.7-53.4%2062-3.5.1-7.1.2-10.6.2C114.6%20512%200%20397.4%200%20256S114.6%200%20256%200s256%20114.6%20256%20256v-.9zm-416%200c-17.67%200-32%2015.2-32%2032%200%2018.6%2014.33%2032%2032%2032%2017.7%200%2032-13.4%2032-32%200-16.8-14.3-32-32-32zm32-64c17.7%200%2032-13.4%2032-32%200-16.8-14.3-32-32-32s-32%2015.2-32%2032c0%2018.6%2014.3%2032%2032%2032zm128-128c-17.7%200-32%2015.23-32%2032%200%2018.6%2014.3%2032%2032%2032s32-13.4%2032-32c0-16.77-14.3-32-32-32zm128%20128c17.7%200%2032-13.4%2032-32%200-16.8-14.3-32-32-32s-32%2015.2-32%2032c0%2018.6%2014.3%2032%2032%2032z'%20/%3e%3c/svg%3e",yt="data:image/x-icon;base64,AAABAAEAQBsAAAEAIAAAHAAAFgAAACgAAABAAAAANgAAAAEAIAAAAAAAABsAABILAAASCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wf4/vINq8+BDI+2dxbP4cJHrsyOTYGuSExlmyZMPX4ATI61aIikxIevosKDrouzX66HsFeuh7BYroewWK6HsFeui7NfrqLCg66kxIevjrVoiD1+AExlmyZMga5ITK7Mjk3P4cJHj7Z3FqvPgQz4/vIN////B////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wDw9vcA/v//CtHkviZ6qUgrqMaNZnWlO3R3pEmiha1XyWmbJ8dTiw7PZ5cr9GSWIvhckBH4V40J+FCIAfhUigb8VosJ/1aLCf9Viwb/VYsG/1aLBv9Wiwb/VYsG/1WLBv9Wiwn/VosJ/1SKBvxQiAH4V40J+FyQEfhkliL4Z5cr9FOLDs9pmyfHha1XyXekSaJ1pTt0qMaNZnqpSCvR5L4m+/z/CvL4+AD///8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8B5O7XDqnHkCeGsFlTf6pRkG6eMrtunTXpWY8Q7FqOEvtYjQn/UokB/1GIAP9SiAD/UogA/0+GAP9OhgD/UIcA/1OJAv9Viwn/VosL/1iMEP9YjBD/WIwR/1eME/9XjBP/V4wT/1eME/9YjBH/WIwQ/1iMEP9Wiwv/VYsJ/1OJAv9QhwD/ToYA/0+GAP9SiAD/UogA/1GIAP9SiQH/WI0J/1qOEvtZjxDsbZwz6W2dObuDrFeQha9YU6nHkCfk7tcO////Af///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8Ax9nIAPf6+w6806Y8i7JhgXqlSMVdkRrkW48R/lOJA/9TiQD/UIcA/1GHAP9RiAH/U4kH/1+RGf9pmC//c6A7/4OqT/+XuHP/oL6E/6fDi/+3zpn/xdew/8rbuP/W48v/1uPK/9nl0P/c59b/3OfV/9zn1f/c59b/2eXQ/9bjyv/W48v/ytu4/8XXsP+3zpn/p8OL/6C+hP+XuHP/g6pP/3OgO/9pmC//X5EZ/1OJB/9RiAH/UYcA/0+GAP9TiQH/U4kD/1uPEf5dkRrkeqVIxYuyYYG806Y89/r7DsfZyAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAACav20A2+jKDpy9dVV/qVO7Zpcp81aMCv5SiAH/UYgA/1CHAf9XjA7/Z5co/36nT/+Vtm3/tMya/8vbvP/e6dL/8PXt//b59P/6/Pj//v7+/////////////////////////////////////////////////////////////////////////////////////////////////////////////v7+//r8+P/2+fT/8PXt/97p0v/L27z/tMya/5S2bf+Dqlf/Z5cp/1eMDv9QhwH/UYgA/1KIAf9WjAr+Zpcp83+oUrubvHZV2ujKDpq+bAAAAAAAAAAAAPz/8AAAAAAAxNmsRoGqUr1ckBX3U4kC/1CHAP9SiAT/YJIe/4SrVf+rxY//0N/A/+vx5f/5+/f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P37/+vx5v/Q38D/q8WP/4SrVf9gkh7/UokG/1CHAP9TiQL/XJAV94GqUr3D2KtGAAAAAPn/6QAABAAAeahDTGeYKuRUigb/UIcA/1uPFv+Cqlb/ts2d/+Ls2f/7/Pr////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7/Pr/4+zb/73SqP+CqVX/WI0S/1CHAP9Vigj/apox5I62ZEwAMQAAv9amUnGgQeNekR7/YpQj/5G0Z//Z5c3/+fv4////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+Pr3/9PhxP+Wt2z/Y5Uh/16RHf9xn0HjwNemUouzVKx2oj//gKlL/8XYrv/7/Pn///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////7+/f/7/fz/+/z8//3+/f//////////////////////+/z5/8bYrv9/qEv/eKNA/4uzVax2pjWtfqhD/8nasf/////////////////+/v7/uc+k/5u7dv+dvHn/nLt3/7DJlv/6/Pn/1eLE/5u7dv+dvHn/nbx5/569ev/l7tv/+fv4/6vFkP+cu3f/nbx5/5q6dv/K27v//////9zn0/+bu3n/nbx5/528ef+bunb/wdWs///////b5tH/m7t4/528ef+dvHn/m7p2/8LWrv//////v9Sn/5u6dv+dvHn/nbx5/5u7d//Y5cn/////////////////8fbt/7nPof+LsF7/eKJL/3ehSf+Fq1T/psKI/9Tiyf/4+vb/////////////////yNqw/3+pRv93pjWtnsBvqpC0Xv/m7tz//////////////////P38/4GoWP9NhQD/UYgA/06FAP9znz//9/r1/7nPnP9OhgH/UYgA/1GHAP9Vigz/1ePE//P38f9nlzH/T4YA/1GIAP9LhAD/n72C//////+/067/TYUD/1GIAP9RiAD/TIQA/5G0av//////vNGq/0yEAv9RiAD/UYgA/0yEAP+Utm7//////5O2Z/9MhAD/UYgA/1GIAP9PhgL/v9Ok////////////3+nS/3ylSf9RiAT/UYgA/1GHAP9PhgL/T4YF/0yEAv9VihD/mrp0//z9/P///////////+jv3/+QtF7/nsBvqs3etFmjwXrzwtap//v8+v////////////z9/P+Eq1j/UogA/1aLAf9TiQD/d6JB//j69f+70Z7/U4kC/1aLAf9WiwD/WY4N/9bjxf/z9/H/a5oy/1SKAP9WiwH/UYcA/6G/g///////wdSu/1KIBP9XiwH/VosB/1GIAP+Utmz//////77Tq/9SiAP/V4sB/1aLAf9RiAD/l7hv//////+WuGn/UYgA/1aLAf9WiwH/VIoE/8DVpv//////7fPp/3WhP/9RhwD/VosB/1SKAP9gkh7/r8iS/9Hfxf+zy5j/aZgs/1+SJf/p8OH///////z9+//D16r/osB488zes1n///8Izt64fLHLj/HH2a//9Pfv///////8/fz/hKtY/1KIAP9WiwH/U4kA/3eiQP/4+vX/u9Ge/1OJAv9WiwH/VosA/1mNDf/W48X/8/fx/2uZMv9UigD/VosB/1CHAP+hv4P//////8HUrv9SiAT/VosB/1aLAf9RiAD/lLZr//////++06v/UYgD/1aLAf9WiwH/UYgA/5e4b///////lrdp/1GIAP9WiwH/VosB/1SKBP/A1Kb//////7HKmf9QhwP/VosB/1aLAf9TiQX/sMmX/////////////////+Dq1f/H2bX/+vz4//P37v/J2rL/ssuP8c7euHz///8I+vz3AP///wbZ6MZJvdOfysHVpvzZ5cj/8/fv/4SrWf9SiAD/VosB/1OJAP93okD/+Pr1/7vRnv9TiQL/VosB/1aLAP9ZjQ3/1uPF//P38f9rmTL/VIoA/1aLAf9QhwD/ob+D///////B1K7/UogE/1aLAf9WiwH/UYgA/5S2a///////vtOr/1GIA/9WiwH/VosB/1GIAP+XuG///////5a3af9RiAD/VosB/1aLAf9UigT/wNWm//////+CqVj/UYgA/1aLAf9VigD/XI8Z/97o1f//////////////////////9fjx/9nmyv+906D8vdOfytnoxkn///8G+vz4AAAAAAD///8A////AO/25xbW5cNoxdmsyt7p0POFrFr/UogA/1aLAf9TiQD/d6JB//j69f+70Z7/U4kC/1aLAf9WiwD/WY0N/9bjxf/z9/H/a5ky/1SKAP9WiwH/UIcA/6G/g///////wdSu/1KIBP9WiwH/VosB/1GIAP+Utmv//////77Tq/9RiAP/VosB/1aLAf9RiAD/l7hv//////+Wt2n/UYgA/1aLAf9WiwH/VIoE/8HVpv/9/v7/fKVO/1KIAP9WiwH/VYoA/16RIf/p8OX//v7+//T48P/n797/1uTF/8rcsvHJ27HK2efHaO304xb///8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAA6ffcAPX87w/0+PB/hata/1KIAP9WiwH/U4kA/3iiQv/w9ev/uM+a/1OJAv9WiwH/VosA/1mODf/X5MX/8/fy/2uZMv9UigD/VosB/1CHAP+hv4P//////8HUrv9SiAT/VosB/1aLAf9RiAD/lLZr//////++06v/UYgD/1aLAf9WiwH/UYgA/5e4cP//////lrhp/1GIAP9WiwH/VosB/1SKBP/B1ab//////4GpVf9SiAD/VosB/1WKAP9ekSH/2OXP/9/q0fvX5MX62+fM/uny3sPz+Oxt8/nsE+764wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD09/AA+Pv4aoWrWv9SiAD/VosB/1OJAP92oj//6PDg/67Ikv9SiAH/VosB/1aLAf9Wiwv/z9/A//D17P9qmS7/VIoA/1aLAf9QhwD/ob6D///////B1K7/UogE/1aLAf9WiwH/UYgA/5S2a///////vtOr/1GIA/9WiwH/VosB/1GIAP+Vt2z//////46yZP9RiAD/VosB/1aLAf9UigT/u9Gf//f69f+hv33/UIcA/1aLAf9ViwD/XZAZ/9LhxOru9eZs+/33esrbwP6fvYP41OLHzf///xz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9PfwAPj7+GqFq1r/UogA/1aLAf9VigD/YJIa/7/TqP+DqlP/UogA/1aLAf9WiwH/UogB/5W2bv+tx5H/V4wL/1aLAP9WiwH/T4YA/6fCi//7/Pn/v9Os/1KIBP9WiwH/VosB/1GIAP+TtWv/+/z5/73Sqv9RiAP/VosB/1aLAf9UiQD/cp44/8XYsP9rmi//VIkA/1aLAf9ViwD/WIwS/8nbtuv1+e+33OfQ4WeXLP9SiAD/VosB/1OJA/+oxIn1/v7/gOrx4555o0j/SIEA/5++gPf///8//P37AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPP38AD4+vhqg6pa/06FAP9SiAD/UogA/1CHAP9SiQb/U4kD/1aLAP9UigD/U4kF/12QGf9OhgT/U4kE/1WKAP9VigD/UIcA/2mYLf/a5s7T////lLvRqfFPhgT/U4kA/1KJAP9OhQD/j7Nn+vz++rG4zqTxToYD/1OJAP9SiAD/UogA/1CHAf9TiQf/VIkB/1aLAP9UiQD/UIcB/42xYvzy9vCF////Av///0C80aTcZpYr/1CHAP9SiAD/Wo4U/42xY/19pkr+UokG/06FAP9/p1H/9/r2gfD17AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD1+PIA+fv4aqTAi/99pk//gKhS/3+nUf+Ps2n/kbNp/2OUJf9ajhn/Z5co/5S2dPjV4srqlrdw+WqZLf9ajhn/Y5Qh/3+nUP/F2LHR////Mv///x3J2r3jfaZT/4CoUv+AqFP/fKVO/6zGk/X///9eyNm74n6mVP+AqFL/gKhS/3+nUf+YuHT/hKtW/16RHv9cjxr/bpwz/528ffvg6tSO////DP///wDx9ewA////P9bjzNKYuHP3dqFA/16QHP9Wixb/W44Z/3CdNP+Kr2L+xNex3/z9+2D3+fQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v7+AP7//i/3+vZz9fj0cvX49HL1+PRy+Pr3cvf69XXd6NSz1+PQyd3o0p/3+vZX////J/v8+l3h69im1uPPyN7o1MHv9OmB////Lv///wD///8M/f79evf59e7d6NH/2ubM//L27/j9/v2T////KPr8+WX1+PNz9fj0cvX49HL1+PNy+vz6cvH17H7a5tG/2OTQyefu3qr9/v5g////Df///wAAAAAA////AP///wD///8a/v//Uenw4X/Z5dC+1uPPx9nl0MDg6tSA+/z7av///yb///8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8A////B////wr///8F////AAAAAAD///8A////Bv///wr///8J////Av///wD///8A////CvD17J2dvHz9X5Ea/1yQFP+Fq13/3+nZrP///wr///8AAAAAAAAAAAAAAAAAAAAAAP///wD///8B////Cf///wr///8G////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///8B////Cf///wr///8J////Av///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///zO/06rsU4kK/1WKAP9VigD/T4YA/5W2cPL///43+Pr0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wD///9nob98/1CHAP9WiwH/VosB/1KJAP97pUP37fPlPfD16gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////N7zSpu1SiAn/VYoA/1aLAP9PhgD/krRs8/3++zn3+vQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///w3x9u6omrp4/WOUIv9dkBX/g6pc/9/p2rX///8N////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////F/X48nnR4MCvwtWpr+vy6Ir///8k////AP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//4AAAAH////QAAAAAAv//gAAAAAAAH/4AAAAAAAAH+AAAAAAAAAHwAAAAAAAAAOAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAP4AAAAAAAAH/wAAAAAAAAf/AAAAAAAAB/8AAAAAAAAH/wAAAAAAwAf/AAAgAAHAB//8OGAfh/g/////4B/////////gH////////+Af////////4B/////////wP////8=";Ze(async()=>{const k=xe();k&&await Promise.all([kt(k),xt(k)])});function kt(k){const L=k.barcode??k.catalogs[0];L&&be(200,yt,"音楽の森 <small>(Search)</small>",`https://search.minc.or.jp/product/list/?type=search-form-diskno&dn=${L}`)}async function xt(k){if(be(300,Ee,"MH Covers <small>(Search)</small>",`https://covers.musichoarders.xyz?artist=${encodeURIComponent(k.artist)}&album=${encodeURIComponent(k.title)}`),k.tocType===ve.Exact||k.tocType===ve.Deduced){const L=await Le(k);L&&be(400,Ee,"MH Covers <small>(Search by TOC)</small>",`https://covers.musichoarders.xyz?toc=${encodeURIComponent(L)}`)}k.barcode&&be(500,Ee,"MH Covers <small>(Search by Barcode)</small>",`https://covers.musichoarders.xyz?barcode=${encodeURIComponent(k.barcode)}`),k.catalogs.length&&be(600,Ee,"MH Covers <small>(Search by Catalog)</small>",`https://covers.musichoarders.xyz?catalog=${encodeURIComponent(k.catalogs[0])}`)}const St=/[A-Z]{2}-?[A-Z0-9]{3}-?[0-9]{2}-?[0-9]{5}/g,Be=document.querySelector("#headerid-query");Ze(()=>{Be.addEventListener("input",()=>{const k=zt(Be.value);if(k.length===0)return;const L=xe();L!=null&&k.length===L.trackCounts.reduce((i,x)=>i+x,0)&&(Be.value="",location.href=Et(De(),k))})});function zt(k){const L=k.matchAll(St);return Array.from(L).map(i=>i[0])}function Et(k,L){let i=`https://magicisrc.kepstin.ca?mbid=${k}`;for(let x=0;x<L.length;x++)i+=`&isrc${x+1}=${L[x]}`;return i}GM.addStyle("span.fileinput-button.buttons{display:inline-flex;flex-direction:column;gap:.5rem}.cover-art-image img{width:100%;aspect-ratio:1;object-fit:contain}.buttons select{float:left;margin:0 7px 0 0;background-image:none;background-color:#eee;border:1px solid #CCC;border-top:1px solid #EEE;border-left:1px solid #EEE;font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:1rem;line-height:130%;text-decoration:none;font-weight:700;color:#666;cursor:pointer;padding:5px 10px 6px 7px}.buttons select:hover,.buttons select:focus{background-color:#dff4ff;border:1px solid #C2E1EF;color:#369}")});