animate-image
Version:
7 lines • 75.1 kB
JavaScript
import"process";import Pt from"fs";import"path";import V from"util";import Mt from"stream";import X from"zlib";import Bn from"assert";import In from"buffer";var Sn=Array.isArray;function j(t){return typeof t=="string"}function oe(t){return t===null}function Ln(t){return typeof t=="boolean"}function Rn(t){return typeof t>"u"}function Pn(t){return typeof t<"u"}var Mn=Pn(globalThis?.window),gt={exports:{}};gt.exports,function(t,e){(function(n){t.exports=n()})(function(n){var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(g,d){var h=g[0],a=g[1],c=g[2],u=g[3];h+=(a&c|~a&u)+d[0]-680876936|0,h=(h<<7|h>>>25)+a|0,u+=(h&a|~h&c)+d[1]-389564586|0,u=(u<<12|u>>>20)+h|0,c+=(u&h|~u&a)+d[2]+606105819|0,c=(c<<17|c>>>15)+u|0,a+=(c&u|~c&h)+d[3]-1044525330|0,a=(a<<22|a>>>10)+c|0,h+=(a&c|~a&u)+d[4]-176418897|0,h=(h<<7|h>>>25)+a|0,u+=(h&a|~h&c)+d[5]+1200080426|0,u=(u<<12|u>>>20)+h|0,c+=(u&h|~u&a)+d[6]-1473231341|0,c=(c<<17|c>>>15)+u|0,a+=(c&u|~c&h)+d[7]-45705983|0,a=(a<<22|a>>>10)+c|0,h+=(a&c|~a&u)+d[8]+1770035416|0,h=(h<<7|h>>>25)+a|0,u+=(h&a|~h&c)+d[9]-1958414417|0,u=(u<<12|u>>>20)+h|0,c+=(u&h|~u&a)+d[10]-42063|0,c=(c<<17|c>>>15)+u|0,a+=(c&u|~c&h)+d[11]-1990404162|0,a=(a<<22|a>>>10)+c|0,h+=(a&c|~a&u)+d[12]+1804603682|0,h=(h<<7|h>>>25)+a|0,u+=(h&a|~h&c)+d[13]-40341101|0,u=(u<<12|u>>>20)+h|0,c+=(u&h|~u&a)+d[14]-1502002290|0,c=(c<<17|c>>>15)+u|0,a+=(c&u|~c&h)+d[15]+1236535329|0,a=(a<<22|a>>>10)+c|0,h+=(a&u|c&~u)+d[1]-165796510|0,h=(h<<5|h>>>27)+a|0,u+=(h&c|a&~c)+d[6]-1069501632|0,u=(u<<9|u>>>23)+h|0,c+=(u&a|h&~a)+d[11]+643717713|0,c=(c<<14|c>>>18)+u|0,a+=(c&h|u&~h)+d[0]-373897302|0,a=(a<<20|a>>>12)+c|0,h+=(a&u|c&~u)+d[5]-701558691|0,h=(h<<5|h>>>27)+a|0,u+=(h&c|a&~c)+d[10]+38016083|0,u=(u<<9|u>>>23)+h|0,c+=(u&a|h&~a)+d[15]-660478335|0,c=(c<<14|c>>>18)+u|0,a+=(c&h|u&~h)+d[4]-405537848|0,a=(a<<20|a>>>12)+c|0,h+=(a&u|c&~u)+d[9]+568446438|0,h=(h<<5|h>>>27)+a|0,u+=(h&c|a&~c)+d[14]-1019803690|0,u=(u<<9|u>>>23)+h|0,c+=(u&a|h&~a)+d[3]-187363961|0,c=(c<<14|c>>>18)+u|0,a+=(c&h|u&~h)+d[8]+1163531501|0,a=(a<<20|a>>>12)+c|0,h+=(a&u|c&~u)+d[13]-1444681467|0,h=(h<<5|h>>>27)+a|0,u+=(h&c|a&~c)+d[2]-51403784|0,u=(u<<9|u>>>23)+h|0,c+=(u&a|h&~a)+d[7]+1735328473|0,c=(c<<14|c>>>18)+u|0,a+=(c&h|u&~h)+d[12]-1926607734|0,a=(a<<20|a>>>12)+c|0,h+=(a^c^u)+d[5]-378558|0,h=(h<<4|h>>>28)+a|0,u+=(h^a^c)+d[8]-2022574463|0,u=(u<<11|u>>>21)+h|0,c+=(u^h^a)+d[11]+1839030562|0,c=(c<<16|c>>>16)+u|0,a+=(c^u^h)+d[14]-35309556|0,a=(a<<23|a>>>9)+c|0,h+=(a^c^u)+d[1]-1530992060|0,h=(h<<4|h>>>28)+a|0,u+=(h^a^c)+d[4]+1272893353|0,u=(u<<11|u>>>21)+h|0,c+=(u^h^a)+d[7]-155497632|0,c=(c<<16|c>>>16)+u|0,a+=(c^u^h)+d[10]-1094730640|0,a=(a<<23|a>>>9)+c|0,h+=(a^c^u)+d[13]+681279174|0,h=(h<<4|h>>>28)+a|0,u+=(h^a^c)+d[0]-358537222|0,u=(u<<11|u>>>21)+h|0,c+=(u^h^a)+d[3]-722521979|0,c=(c<<16|c>>>16)+u|0,a+=(c^u^h)+d[6]+76029189|0,a=(a<<23|a>>>9)+c|0,h+=(a^c^u)+d[9]-640364487|0,h=(h<<4|h>>>28)+a|0,u+=(h^a^c)+d[12]-421815835|0,u=(u<<11|u>>>21)+h|0,c+=(u^h^a)+d[15]+530742520|0,c=(c<<16|c>>>16)+u|0,a+=(c^u^h)+d[2]-995338651|0,a=(a<<23|a>>>9)+c|0,h+=(c^(a|~u))+d[0]-198630844|0,h=(h<<6|h>>>26)+a|0,u+=(a^(h|~c))+d[7]+1126891415|0,u=(u<<10|u>>>22)+h|0,c+=(h^(u|~a))+d[14]-1416354905|0,c=(c<<15|c>>>17)+u|0,a+=(u^(c|~h))+d[5]-57434055|0,a=(a<<21|a>>>11)+c|0,h+=(c^(a|~u))+d[12]+1700485571|0,h=(h<<6|h>>>26)+a|0,u+=(a^(h|~c))+d[3]-1894986606|0,u=(u<<10|u>>>22)+h|0,c+=(h^(u|~a))+d[10]-1051523|0,c=(c<<15|c>>>17)+u|0,a+=(u^(c|~h))+d[1]-2054922799|0,a=(a<<21|a>>>11)+c|0,h+=(c^(a|~u))+d[8]+1873313359|0,h=(h<<6|h>>>26)+a|0,u+=(a^(h|~c))+d[15]-30611744|0,u=(u<<10|u>>>22)+h|0,c+=(h^(u|~a))+d[6]-1560198380|0,c=(c<<15|c>>>17)+u|0,a+=(u^(c|~h))+d[13]+1309151649|0,a=(a<<21|a>>>11)+c|0,h+=(c^(a|~u))+d[4]-145523070|0,h=(h<<6|h>>>26)+a|0,u+=(a^(h|~c))+d[11]-1120210379|0,u=(u<<10|u>>>22)+h|0,c+=(h^(u|~a))+d[2]+718787259|0,c=(c<<15|c>>>17)+u|0,a+=(u^(c|~h))+d[9]-343485551|0,a=(a<<21|a>>>11)+c|0,g[0]=h+g[0]|0,g[1]=a+g[1]|0,g[2]=c+g[2]|0,g[3]=u+g[3]|0}function o(g){var d=[],h;for(h=0;h<64;h+=4)d[h>>2]=g.charCodeAt(h)+(g.charCodeAt(h+1)<<8)+(g.charCodeAt(h+2)<<16)+(g.charCodeAt(h+3)<<24);return d}function s(g){var d=[],h;for(h=0;h<64;h+=4)d[h>>2]=g[h]+(g[h+1]<<8)+(g[h+2]<<16)+(g[h+3]<<24);return d}function l(g){var d=g.length,h=[1732584193,-271733879,-1732584194,271733878],a,c,u,T,B,I;for(a=64;a<=d;a+=64)i(h,o(g.substring(a-64,a)));for(g=g.substring(a-64),c=g.length,u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a<c;a+=1)u[a>>2]|=g.charCodeAt(a)<<(a%4<<3);if(u[a>>2]|=128<<(a%4<<3),a>55)for(i(h,u),a=0;a<16;a+=1)u[a]=0;return T=d*8,T=T.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(T[2],16),I=parseInt(T[1],16)||0,u[14]=B,u[15]=I,i(h,u),h}function f(g){var d=g.length,h=[1732584193,-271733879,-1732584194,271733878],a,c,u,T,B,I;for(a=64;a<=d;a+=64)i(h,s(g.subarray(a-64,a)));for(g=a-64<d?g.subarray(a-64):new Uint8Array(0),c=g.length,u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=0;a<c;a+=1)u[a>>2]|=g[a]<<(a%4<<3);if(u[a>>2]|=128<<(a%4<<3),a>55)for(i(h,u),a=0;a<16;a+=1)u[a]=0;return T=d*8,T=T.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(T[2],16),I=parseInt(T[1],16)||0,u[14]=B,u[15]=I,i(h,u),h}function p(g){var d="",h;for(h=0;h<4;h+=1)d+=r[g>>h*8+4&15]+r[g>>h*8&15];return d}function m(g){var d;for(d=0;d<g.length;d+=1)g[d]=p(g[d]);return g.join("")}m(l("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(d,h){return d=d|0||0,d<0?Math.max(d+h,0):Math.min(d,h)}ArrayBuffer.prototype.slice=function(d,h){var a=this.byteLength,c=g(d,a),u=a,T,B,I,S;return h!==n&&(u=g(h,a)),c>u?new ArrayBuffer(0):(T=u-c,B=new ArrayBuffer(T),I=new Uint8Array(B),S=new Uint8Array(this,c,T),I.set(S),B)}}();function y(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function _(g,d){var h=g.length,a=new ArrayBuffer(h),c=new Uint8Array(a),u;for(u=0;u<h;u+=1)c[u]=g.charCodeAt(u);return d?c:a}function w(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function E(g,d,h){var a=new Uint8Array(g.byteLength+d.byteLength);return a.set(new Uint8Array(g)),a.set(new Uint8Array(d),g.byteLength),h?a:a.buffer}function C(g){var d=[],h=g.length,a;for(a=0;a<h-1;a+=2)d.push(parseInt(g.substr(a,2),16));return String.fromCharCode.apply(String,d)}function b(){this.reset()}return b.prototype.append=function(g){return this.appendBinary(y(g)),this},b.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var d=this._buff.length,h;for(h=64;h<=d;h+=64)i(this._hash,o(this._buff.substring(h-64,h)));return this._buff=this._buff.substring(h-64),this},b.prototype.end=function(g){var d=this._buff,h=d.length,a,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u;for(a=0;a<h;a+=1)c[a>>2]|=d.charCodeAt(a)<<(a%4<<3);return this._finish(c,h),u=m(this._hash),g&&(u=C(u)),this.reset(),u},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(g,d){var h=d,a,c,u;if(g[h>>2]|=128<<(h%4<<3),h>55)for(i(this._hash,g),h=0;h<16;h+=1)g[h]=0;a=this._length*8,a=a.toString(16).match(/(.*?)(.{0,8})$/),c=parseInt(a[2],16),u=parseInt(a[1],16)||0,g[14]=c,g[15]=u,i(this._hash,g)},b.hash=function(g,d){return b.hashBinary(y(g),d)},b.hashBinary=function(g,d){var h=l(g),a=m(h);return d?C(a):a},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(g){var d=E(this._buff.buffer,g,!0),h=d.length,a;for(this._length+=g.byteLength,a=64;a<=h;a+=64)i(this._hash,s(d.subarray(a-64,a)));return this._buff=a-64<h?new Uint8Array(d.buffer.slice(a-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(g){var d=this._buff,h=d.length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c,u;for(c=0;c<h;c+=1)a[c>>2]|=d[c]<<(c%4<<3);return this._finish(a,h),u=m(this._hash),g&&(u=C(u)),this.reset(),u},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var g=b.prototype.getState.call(this);return g.buff=w(g.buff),g},b.ArrayBuffer.prototype.setState=function(g){return g.buff=_(g.buff,!0),b.prototype.setState.call(this,g)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(g,d){var h=f(new Uint8Array(g)),a=m(h);return d?C(a):a},b})}(gt,gt.exports),gt.exports;function se(t,e=!1,n=document){if(!oe(e))return Ln(e)||(n=e,e=!1),Sn(t)?t.reduce((r,i)=>{const o=e?n.querySelectorAll(i):n.querySelector(i);return o?r=e?[...r,...o]:[...r,o]:r},[]):e?n.querySelectorAll(t):n.querySelector(t)}function On(...t){const e=t.length,n=[...t],r=n.slice(0,e-1),i=n.slice(-1)[0];let o=!1,s=!1;l(),document.addEventListener("DOMContentLoaded",l),setTimeout(()=>document.removeEventListener("DOMContentLoaded",l));function l(){if(!s){if(r.forEach((f,p)=>j(f)&&(r[p]=se(f)||f)),!o&&r.some(j))return o=!0;if(r.some(j))throw new Error(`${r.filter(j).join(", ")} is not a HTMLElement`);i?.(...r),s=!0}}}var z={},ae=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Ot={},v={};let vt;const vn=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];v.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},v.getSymbolTotalCodewords=function(e){return vn[e]},v.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},v.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');vt=e},v.isKanjiModeEnabled=function(){return typeof vt<"u"},v.toSJIS=function(e){return vt(e)};var pt={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,i){if(t.isValid(r))return r;try{return e(r)}catch{return i}}})(pt);function le(){this.buffer=[],this.length=0}le.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Nn=le;function tt(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}tt.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},tt.prototype.get=function(t,e){return this.data[t*this.size+e]},tt.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},tt.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Un=tt,he={};(function(t){const e=v.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,o=e(r),s=o===145?26:Math.ceil((o-13)/(2*i-2))*2,l=[o-7];for(let f=1;f<i-1;f++)l[f]=l[f-1]-s;return l.push(6),l.reverse()},t.getPositions=function(r){const i=[],o=t.getRowColCoords(r),s=o.length;for(let l=0;l<s;l++)for(let f=0;f<s;f++)l===0&&f===0||l===0&&f===s-1||l===s-1&&f===0||i.push([o[l],o[f]]);return i}})(he);var fe={};const kn=v.getSymbolSize,ue=7;fe.getPositions=function(e){const n=kn(e);return[[0,0],[n-ue,0],[0,n-ue]]};var ce={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let s=0,l=0,f=0,p=null,m=null;for(let y=0;y<o;y++){l=f=0,p=m=null;for(let _=0;_<o;_++){let w=i.get(y,_);w===p?l++:(l>=5&&(s+=e.N1+(l-5)),p=w,l=1),w=i.get(_,y),w===m?f++:(f>=5&&(s+=e.N1+(f-5)),m=w,f=1)}l>=5&&(s+=e.N1+(l-5)),f>=5&&(s+=e.N1+(f-5))}return s},t.getPenaltyN2=function(i){const o=i.size;let s=0;for(let l=0;l<o-1;l++)for(let f=0;f<o-1;f++){const p=i.get(l,f)+i.get(l,f+1)+i.get(l+1,f)+i.get(l+1,f+1);(p===4||p===0)&&s++}return s*e.N2},t.getPenaltyN3=function(i){const o=i.size;let s=0,l=0,f=0;for(let p=0;p<o;p++){l=f=0;for(let m=0;m<o;m++)l=l<<1&2047|i.get(p,m),m>=10&&(l===1488||l===93)&&s++,f=f<<1&2047|i.get(m,p),m>=10&&(f===1488||f===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let o=0;const s=i.data.length;for(let f=0;f<s;f++)o+=i.data[f];return Math.abs(Math.ceil(o*100/s/5)-10)*e.N4};function n(r,i,o){switch(r){case t.Patterns.PATTERN000:return(i+o)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return o%3===0;case t.Patterns.PATTERN011:return(i+o)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(o/3))%2===0;case t.Patterns.PATTERN101:return i*o%2+i*o%3===0;case t.Patterns.PATTERN110:return(i*o%2+i*o%3)%2===0;case t.Patterns.PATTERN111:return(i*o%3+(i+o)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(i,o){const s=o.size;for(let l=0;l<s;l++)for(let f=0;f<s;f++)o.isReserved(f,l)||o.xor(f,l,n(i,f,l))},t.getBestMask=function(i,o){const s=Object.keys(t.Patterns).length;let l=0,f=1/0;for(let p=0;p<s;p++){o(p),t.applyMask(p,i);const m=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(p,i),m<f&&(f=m,l=p)}return l}})(ce);var mt={};const x=pt,yt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],_t=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];mt.getBlocksCount=function(e,n){switch(n){case x.L:return yt[(e-1)*4+0];case x.M:return yt[(e-1)*4+1];case x.Q:return yt[(e-1)*4+2];case x.H:return yt[(e-1)*4+3];default:return}},mt.getTotalCodewordsCount=function(e,n){switch(n){case x.L:return _t[(e-1)*4+0];case x.M:return _t[(e-1)*4+1];case x.Q:return _t[(e-1)*4+2];case x.H:return _t[(e-1)*4+3];default:return}};var de={},wt={};const et=new Uint8Array(512),bt=new Uint8Array(256);(function(){let e=1;for(let n=0;n<255;n++)et[n]=e,bt[e]=n,e<<=1,e&256&&(e^=285);for(let n=255;n<512;n++)et[n]=et[n-255]})(),wt.log=function(e){if(e<1)throw new Error("log("+e+")");return bt[e]},wt.exp=function(e){return et[e]},wt.mul=function(e,n){return e===0||n===0?0:et[bt[e]+bt[n]]},function(t){const e=wt;t.mul=function(r,i){const o=new Uint8Array(r.length+i.length-1);for(let s=0;s<r.length;s++)for(let l=0;l<i.length;l++)o[s+l]^=e.mul(r[s],i[l]);return o},t.mod=function(r,i){let o=new Uint8Array(r);for(;o.length-i.length>=0;){const s=o[0];for(let f=0;f<i.length;f++)o[f]^=e.mul(i[f],s);let l=0;for(;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},t.generateECPolynomial=function(r){let i=new Uint8Array([1]);for(let o=0;o<r;o++)i=t.mul(i,new Uint8Array([1,e.exp(o)]));return i}}(de);const ge=de;function Nt(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}Nt.prototype.initialize=function(e){this.degree=e,this.genPoly=ge.generateECPolynomial(this.degree)},Nt.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(e.length+this.degree);n.set(e);const r=ge.mod(n,this.genPoly),i=this.degree-r.length;if(i>0){const o=new Uint8Array(this.degree);return o.set(r,i),o}return r};var Fn=Nt,pe={},Y={},Ut={};Ut.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var F={};const me="[0-9]+",Dn="[A-Z $%*+\\-./:]+";let nt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";nt=nt.replace(/u/g,"\\u");const xn="(?:(?![A-Z0-9 $%*+\\-./:]|"+nt+`)(?:.|[\r
]))+`;F.KANJI=new RegExp(nt,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp(xn,"g"),F.NUMERIC=new RegExp(me,"g"),F.ALPHANUMERIC=new RegExp(Dn,"g");const Yn=new RegExp("^"+nt+"$"),$n=new RegExp("^"+me+"$"),Hn=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");F.testKanji=function(e){return Yn.test(e)},F.testNumeric=function(e){return $n.test(e)},F.testAlphanumeric=function(e){return Hn.test(e)},function(t){const e=Ut,n=F;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,s){if(t.isValid(o))return o;try{return r(o)}catch{return s}}}(Y),function(t){const e=v,n=mt,r=pt,i=Y,o=Ut,s=7973,l=e.getBCHDigit(s);function f(_,w,E){for(let C=1;C<=40;C++)if(w<=t.getCapacity(C,E,_))return C}function p(_,w){return i.getCharCountIndicator(_,w)+4}function m(_,w){let E=0;return _.forEach(function(C){const b=p(C.mode,w);E+=b+C.getBitsLength()}),E}function y(_,w){for(let E=1;E<=40;E++)if(m(_,E)<=t.getCapacity(E,w,i.MIXED))return E}t.from=function(w,E){return o.isValid(w)?parseInt(w,10):E},t.getCapacity=function(w,E,C){if(!o.isValid(w))throw new Error("Invalid QR Code version");typeof C>"u"&&(C=i.BYTE);const b=e.getSymbolTotalCodewords(w),g=n.getTotalCodewordsCount(w,E),d=(b-g)*8;if(C===i.MIXED)return d;const h=d-p(C,w);switch(C){case i.NUMERIC:return Math.floor(h/10*3);case i.ALPHANUMERIC:return Math.floor(h/11*2);case i.KANJI:return Math.floor(h/13);case i.BYTE:default:return Math.floor(h/8)}},t.getBestVersionForData=function(w,E){let C;const b=r.from(E,r.M);if(Array.isArray(w)){if(w.length>1)return y(w,b);if(w.length===0)return 1;C=w[0]}else C=w;return f(C.mode,C.getLength(),b)},t.getEncodedBits=function(w){if(!o.isValid(w)||w<7)throw new Error("Invalid QR Code version");let E=w<<12;for(;e.getBCHDigit(E)-l>=0;)E^=s<<e.getBCHDigit(E)-l;return w<<12|E}}(pe);var ye={};const kt=v,_e=1335,zn=21522,we=kt.getBCHDigit(_e);ye.getEncodedBits=function(e,n){const r=e.bit<<3|n;let i=r<<10;for(;kt.getBCHDigit(i)-we>=0;)i^=_e<<kt.getBCHDigit(i)-we;return(r<<10|i)^zn};var be={};const Gn=Y;function K(t){this.mode=Gn.NUMERIC,this.data=t.toString()}K.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},K.prototype.getLength=function(){return this.data.length},K.prototype.getBitsLength=function(){return K.getBitsLength(this.data.length)},K.prototype.write=function(e){let n,r,i;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),i=parseInt(r,10),e.put(i,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),i=parseInt(r,10),e.put(i,o*3+1))};var Vn=K;const jn=Y,Ft=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function W(t){this.mode=jn.ALPHANUMERIC,this.data=t}W.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},W.prototype.getLength=function(){return this.data.length},W.prototype.getBitsLength=function(){return W.getBitsLength(this.data.length)},W.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=Ft.indexOf(this.data[n])*45;r+=Ft.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(Ft.indexOf(this.data[n]),6)};var Kn=W;const Wn=Y;function q(t){this.mode=Wn.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}q.getBitsLength=function(e){return e*8},q.prototype.getLength=function(){return this.data.length},q.prototype.getBitsLength=function(){return q.getBitsLength(this.data.length)},q.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};var qn=q;const Qn=Y,Jn=v;function Q(t){this.mode=Qn.KANJI,this.data=t}Q.getBitsLength=function(e){return e*13},Q.prototype.getLength=function(){return this.data.length},Q.prototype.getBitsLength=function(){return Q.getBitsLength(this.data.length)},Q.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=Jn.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var Zn=Q,Dt={exports:{}};Dt.exports,function(t){var e={single_source_shortest_paths:function(n,r,i){var o={},s={};s[r]=0;var l=e.PriorityQueue.make();l.push(r,0);for(var f,p,m,y,_,w,E,C,b;!l.empty();){f=l.pop(),p=f.value,y=f.cost,_=n[p]||{};for(m in _)_.hasOwnProperty(m)&&(w=_[m],E=y+w,C=s[m],b=typeof s[m]>"u",(b||C>E)&&(s[m]=E,l.push(m,E),o[m]=p))}if(typeof i<"u"&&typeof s[i]>"u"){var g=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(g)}return o},extract_shortest_path_from_predecessor_list:function(n,r){for(var i=[],o=r;o;)i.push(o),n[o],o=n[o];return i.reverse(),i},find_path:function(n,r,i){var o=e.single_source_shortest_paths(n,r,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(n){var r=e.PriorityQueue,i={},o;n=n||{};for(o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);return i.queue=[],i.sorter=n.sorter||r.default_sorter,i},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var i={value:n,cost:r};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e}(Dt);var Xn=Dt.exports;(function(t){const e=Y,n=Vn,r=Kn,i=qn,o=Zn,s=F,l=v,f=Xn;function p(g){return unescape(encodeURIComponent(g)).length}function m(g,d,h){const a=[];let c;for(;(c=g.exec(h))!==null;)a.push({data:c[0],index:c.index,mode:d,length:c[0].length});return a}function y(g){const d=m(s.NUMERIC,e.NUMERIC,g),h=m(s.ALPHANUMERIC,e.ALPHANUMERIC,g);let a,c;return l.isKanjiModeEnabled()?(a=m(s.BYTE,e.BYTE,g),c=m(s.KANJI,e.KANJI,g)):(a=m(s.BYTE_KANJI,e.BYTE,g),c=[]),d.concat(h,a,c).sort(function(T,B){return T.index-B.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function _(g,d){switch(d){case e.NUMERIC:return n.getBitsLength(g);case e.ALPHANUMERIC:return r.getBitsLength(g);case e.KANJI:return o.getBitsLength(g);case e.BYTE:return i.getBitsLength(g)}}function w(g){return g.reduce(function(d,h){const a=d.length-1>=0?d[d.length-1]:null;return a&&a.mode===h.mode?(d[d.length-1].data+=h.data,d):(d.push(h),d)},[])}function E(g){const d=[];for(let h=0;h<g.length;h++){const a=g[h];switch(a.mode){case e.NUMERIC:d.push([a,{data:a.data,mode:e.ALPHANUMERIC,length:a.length},{data:a.data,mode:e.BYTE,length:a.length}]);break;case e.ALPHANUMERIC:d.push([a,{data:a.data,mode:e.BYTE,length:a.length}]);break;case e.KANJI:d.push([a,{data:a.data,mode:e.BYTE,length:p(a.data)}]);break;case e.BYTE:d.push([{data:a.data,mode:e.BYTE,length:p(a.data)}])}}return d}function C(g,d){const h={},a={start:{}};let c=["start"];for(let u=0;u<g.length;u++){const T=g[u],B=[];for(let I=0;I<T.length;I++){const S=T[I],A=""+u+I;B.push(A),h[A]={node:S,lastCount:0},a[A]={};for(let P=0;P<c.length;P++){const N=c[P];h[N]&&h[N].node.mode===S.mode?(a[N][A]=_(h[N].lastCount+S.length,S.mode)-_(h[N].lastCount,S.mode),h[N].lastCount+=S.length):(h[N]&&(h[N].lastCount=S.length),a[N][A]=_(S.length,S.mode)+4+e.getCharCountIndicator(S.mode,d))}}c=B}for(let u=0;u<c.length;u++)a[c[u]].end=0;return{map:a,table:h}}function b(g,d){let h;const a=e.getBestModeForData(g);if(h=e.from(d,a),h!==e.BYTE&&h.bit<a.bit)throw new Error('"'+g+'" cannot be encoded with mode '+e.toString(h)+`.
Suggested mode is: `+e.toString(a));switch(h===e.KANJI&&!l.isKanjiModeEnabled()&&(h=e.BYTE),h){case e.NUMERIC:return new n(g);case e.ALPHANUMERIC:return new r(g);case e.KANJI:return new o(g);case e.BYTE:return new i(g)}}t.fromArray=function(d){return d.reduce(function(h,a){return typeof a=="string"?h.push(b(a,null)):a.data&&h.push(b(a.data,a.mode)),h},[])},t.fromString=function(d,h){const a=y(d,l.isKanjiModeEnabled()),c=E(a),u=C(c,h),T=f.find_path(u.map,"start","end"),B=[];for(let I=1;I<T.length-1;I++)B.push(u.table[T[I]].node);return t.fromArray(w(B))},t.rawSplit=function(d){return t.fromArray(y(d,l.isKanjiModeEnabled()))}})(be);const Et=v,xt=pt,tr=Nn,er=Un,nr=he,rr=fe,Yt=ce,$t=mt,ir=Fn,Ct=pe,or=ye,sr=Y,Ht=be;function ar(t,e){const n=t.size,r=rr.getPositions(e);for(let i=0;i<r.length;i++){const o=r[i][0],s=r[i][1];for(let l=-1;l<=7;l++)if(!(o+l<=-1||n<=o+l))for(let f=-1;f<=7;f++)s+f<=-1||n<=s+f||(l>=0&&l<=6&&(f===0||f===6)||f>=0&&f<=6&&(l===0||l===6)||l>=2&&l<=4&&f>=2&&f<=4?t.set(o+l,s+f,!0,!0):t.set(o+l,s+f,!1,!0))}}function lr(t){const e=t.size;for(let n=8;n<e-8;n++){const r=n%2===0;t.set(n,6,r,!0),t.set(6,n,r,!0)}}function hr(t,e){const n=nr.getPositions(e);for(let r=0;r<n.length;r++){const i=n[r][0],o=n[r][1];for(let s=-2;s<=2;s++)for(let l=-2;l<=2;l++)s===-2||s===2||l===-2||l===2||s===0&&l===0?t.set(i+s,o+l,!0,!0):t.set(i+s,o+l,!1,!0)}}function fr(t,e){const n=t.size,r=Ct.getEncodedBits(e);let i,o,s;for(let l=0;l<18;l++)i=Math.floor(l/3),o=l%3+n-8-3,s=(r>>l&1)===1,t.set(i,o,s,!0),t.set(o,i,s,!0)}function zt(t,e,n){const r=t.size,i=or.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(r-15+o,8,s,!0),o<8?t.set(8,r-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(r-8,8,1,!0)}function ur(t,e){const n=t.size;let r=-1,i=n-1,o=7,s=0;for(let l=n-1;l>0;l-=2)for(l===6&&l--;;){for(let f=0;f<2;f++)if(!t.isReserved(i,l-f)){let p=!1;s<e.length&&(p=(e[s]>>>o&1)===1),t.set(i,l-f,p),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function cr(t,e,n){const r=new tr;n.forEach(function(f){r.put(f.mode.bit,4),r.put(f.getLength(),sr.getCharCountIndicator(f.mode,t)),f.write(r)});const i=Et.getSymbolTotalCodewords(t),o=$t.getTotalCodewordsCount(t,e),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const l=(s-r.getLengthInBits())/8;for(let f=0;f<l;f++)r.put(f%2?17:236,8);return dr(r,t,e)}function dr(t,e,n){const r=Et.getSymbolTotalCodewords(e),i=$t.getTotalCodewordsCount(e,n),o=r-i,s=$t.getBlocksCount(e,n),l=r%s,f=s-l,p=Math.floor(r/s),m=Math.floor(o/s),y=m+1,_=p-m,w=new ir(_);let E=0;const C=new Array(s),b=new Array(s);let g=0;const d=new Uint8Array(t.buffer);for(let T=0;T<s;T++){const B=T<f?m:y;C[T]=d.slice(E,E+B),b[T]=w.encode(C[T]),E+=B,g=Math.max(g,B)}const h=new Uint8Array(r);let a=0,c,u;for(c=0;c<g;c++)for(u=0;u<s;u++)c<C[u].length&&(h[a++]=C[u][c]);for(c=0;c<_;c++)for(u=0;u<s;u++)h[a++]=b[u][c];return h}function gr(t,e,n,r){let i;if(Array.isArray(t))i=Ht.fromArray(t);else if(typeof t=="string"){let p=e;if(!p){const m=Ht.rawSplit(t);p=Ct.getBestVersionForData(m,n)}i=Ht.fromString(t,p||40)}else throw new Error("Invalid data");const o=Ct.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=o;else if(e<o)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+o+`.
`);const s=cr(e,n,i),l=Et.getSymbolSize(e),f=new er(l);return ar(f,e),lr(f),hr(f,e),zt(f,n,0),e>=7&&fr(f,e),ur(f,s),isNaN(r)&&(r=Yt.getBestMask(f,zt.bind(null,f,n))),Yt.applyMask(r,f),zt(f,n,r),{modules:f,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}Ot.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let r=xt.M,i,o;return typeof n<"u"&&(r=xt.from(n.errorCorrectionLevel,xt.M),i=Ct.from(n.version),o=Yt.from(n.maskPattern),n.toSJISFunc&&Et.setToSJISFunction(n.toSJISFunc)),gr(e,i,r,o)};var Ee={},Ce={},Te={exports:{}},Ae={exports:{}};let pr=V,Be=Mt,k=Ae.exports=function(){Be.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};pr.inherits(k,Be),k.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},k.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let n;return Buffer.isBuffer(t)?n=t:n=Buffer.from(t,e||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&this._reads.length===0&&(this._paused=!0),this.writable&&!this._paused},k.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(this._buffers.length===0?this._end():(this._buffers.push(null),this._process()))},k.prototype.destroySoon=k.prototype.end,k.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},k.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},k.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},k.prototype._processRead=function(t){this._reads.shift();let e=0,n=0,r=Buffer.alloc(t.length);for(;e<t.length;){let i=this._buffers[n++],o=Math.min(i.length,t.length-e);i.copy(r,e,0,o),e+=o,o!==i.length&&(this._buffers[--n]=i.slice(o))}n>0&&this._buffers.splice(0,n),this._buffered-=t.length,t.func.call(this,r)},k.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else if(this._buffered>=t.length)this._processRead(t);else break}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}};var Ie=Ae.exports,Se={exports:{}},Le={exports:{}},Tt={};let $=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];Tt.getImagePasses=function(t,e){let n=[],r=t%8,i=e%8,o=(t-r)/8,s=(e-i)/8;for(let l=0;l<$.length;l++){let f=$[l],p=o*f.x.length,m=s*f.y.length;for(let y=0;y<f.x.length&&f.x[y]<r;y++)p++;for(let y=0;y<f.y.length&&f.y[y]<i;y++)m++;p>0&&m>0&&n.push({width:p,height:m,index:l})}return n},Tt.getInterlaceIterator=function(t){return function(e,n,r){let i=e%$[r].x.length,o=(e-i)/$[r].x.length*8+$[r].x[i],s=n%$[r].y.length,l=(n-s)/$[r].y.length*8+$[r].y[s];return o*4+l*t*4}};var Re=function(e,n,r){let i=e+n-r,o=Math.abs(i-e),s=Math.abs(i-n),l=Math.abs(i-r);return o<=s&&o<=l?e:s<=l?n:r};let mr=Tt,yr=Re;function Pe(t,e,n){let r=t*e;return n!==8&&(r=Math.ceil(r/(8/n))),r}let J=Le.exports=function(t,e){let n=t.width,r=t.height,i=t.interlace,o=t.bpp,s=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],i){let l=mr.getImagePasses(n,r);for(let f=0;f<l.length;f++)this._images.push({byteWidth:Pe(l[f].width,o,s),height:l[f].height,lineIndex:0})}else this._images.push({byteWidth:Pe(n,o,s),height:r,lineIndex:0});s===8?this._xComparison=o:s===16?this._xComparison=o*2:this._xComparison=1};J.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},J.prototype._unFilterType1=function(t,e,n){let r=this._xComparison,i=r-1;for(let o=0;o<n;o++){let s=t[1+o],l=o>i?e[o-r]:0;e[o]=s+l}},J.prototype._unFilterType2=function(t,e,n){let r=this._lastLine;for(let i=0;i<n;i++){let o=t[1+i],s=r?r[i]:0;e[i]=o+s}},J.prototype._unFilterType3=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let l=t[1+s],f=o?o[s]:0,p=s>i?e[s-r]:0,m=Math.floor((p+f)/2);e[s]=l+m}},J.prototype._unFilterType4=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let l=t[1+s],f=o?o[s]:0,p=s>i?e[s-r]:0,m=s>i&&o?o[s-r]:0,y=yr(p,f,m);e[s]=l+y}},J.prototype._reverseFilterLine=function(t){let e=t[0],n,r=this._images[this._imageIndex],i=r.byteWidth;if(e===0)n=t.slice(1,i+1);else switch(n=Buffer.alloc(i),e){case 1:this._unFilterType1(t,n,i);break;case 2:this._unFilterType2(t,n,i);break;case 3:this._unFilterType3(t,n,i);break;case 4:this._unFilterType4(t,n,i);break;default:throw new Error("Unrecognised filter type - "+e)}this.write(n),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=n,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())};var Me=Le.exports;let _r=V,Oe=Ie,wr=Me,br=Se.exports=function(t){Oe.call(this);let e=[],n=this;this._filter=new wr(t,{read:this.read.bind(this),write:function(r){e.push(r)},complete:function(){n.emit("complete",Buffer.concat(e))}}),this._filter.start()};_r.inherits(br,Oe);var Er=Se.exports,ve={exports:{}},rt={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5},Ne={exports:{}};let Gt=[];(function(){for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;Gt[t]=e}})();let Vt=Ne.exports=function(){this._crc=-1};Vt.prototype.write=function(t){for(let e=0;e<t.length;e++)this._crc=Gt[(this._crc^t[e])&255]^this._crc>>>8;return!0},Vt.prototype.crc32=function(){return this._crc^-1},Vt.crc32=function(t){let e=-1;for(let n=0;n<t.length;n++)e=Gt[(e^t[n])&255]^e>>>8;return e^-1};var Ue=Ne.exports;let L=rt,Cr=Ue,R=ve.exports=function(t,e){this._options=t,t.checkCRC=t.checkCRC!==!1,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[L.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[L.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[L.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[L.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[L.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[L.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};R.prototype.start=function(){this.read(L.PNG_SIGNATURE.length,this._parseSignature.bind(this))},R.prototype._parseSignature=function(t){let e=L.PNG_SIGNATURE;for(let n=0;n<e.length;n++)if(t[n]!==e[n]){this.error(new Error("Invalid file signature"));return}this.read(8,this._parseChunkBegin.bind(this))},R.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),n=t.readUInt32BE(4),r="";for(let o=4;o<8;o++)r+=String.fromCharCode(t[o]);let i=!!(t[4]&32);if(!this._hasIHDR&&n!==L.TYPE_IHDR){this.error(new Error("Expected IHDR on beggining"));return}if(this._crc=new Cr,this._crc.write(Buffer.from(r)),this._chunks[n])return this._chunks[n](e);if(!i){this.error(new Error("Unsupported critical chunk type "+r));return}this.read(e+4,this._skipChunk.bind(this))},R.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},R.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},R.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),n=this._crc.crc32();if(this._options.checkCRC&&n!==e){this.error(new Error("Crc error - "+e+" - "+n));return}this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},R.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},R.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),n=t.readUInt32BE(4),r=t[8],i=t[9],o=t[10],s=t[11],l=t[12];if(r!==8&&r!==4&&r!==2&&r!==1&&r!==16){this.error(new Error("Unsupported bit depth "+r));return}if(!(i in L.COLORTYPE_TO_BPP_MAP)){this.error(new Error("Unsupported color type"));return}if(o!==0){this.error(new Error("Unsupported compression method"));return}if(s!==0){this.error(new Error("Unsupported filter method"));return}if(l!==0&&l!==1){this.error(new Error("Unsupported interlace method"));return}this._colorType=i;let f=L.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:n,depth:r,interlace:!!l,palette:!!(i&L.COLORTYPE_PALETTE),color:!!(i&L.COLORTYPE_COLOR),alpha:!!(i&L.COLORTYPE_ALPHA),bpp:f,colorType:i}),this._handleChunkEnd()},R.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},R.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let n=0;n<e;n++)this._palette.push([t[n*3],t[n*3+1],t[n*3+2],255]);this.palette(this._palette),this._handleChunkEnd()},R.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},R.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===L.COLORTYPE_PALETTE_COLOR){if(this._palette.length===0){this.error(new Error("Transparency chunk must be after palette"));return}if(t.length>this._palette.length){this.error(new Error("More transparent colors than palette size"));return}for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===L.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===L.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},R.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},R.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/L.GAMMA_DIVISION),this._handleChunkEnd()},R.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},R.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===L.COLORTYPE_PALETTE_COLOR&&this._palette.length===0)throw new Error("Expected palette not found");this.inflateData(e);let n=t-e.length;n>0?this._handleIDAT(n):this._handleChunkEnd()},R.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},R.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()};var ke=ve.exports,jt={};let Fe=Tt,Tr=[function(){},function(t,e,n,r){if(r===e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=255},function(t,e,n,r){if(r+1>=e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=e[r+1]},function(t,e,n,r){if(r+2>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=255},function(t,e,n,r){if(r+3>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=e[r+3]}],Ar=[function(){},function(t,e,n,r){let i=e[0];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=r},function(t,e,n){let r=e[0];t[n]=r,t[n+1]=r,t[n+2]=r,t[n+3]=e[1]},function(t,e,n,r){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=r},function(t,e,n){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3]}];function Br(t,e){let n=[],r=0;function i(){if(r===t.length)throw new Error("Ran out of data");let o=t[r];r++;let s,l,f,p,m,y,_,w;switch(e){default:throw new Error("unrecognised depth");case 16:_=t[r],r++,n.push((o<<8)+_);break;case 4:_=o&15,w=o>>4,n.push(w,_);break;case 2:m=o&3,y=o>>2&3,_=o>>4&3,w=o>>6&3,n.push(w,_,y,m);break;case 1:s=o&1,l=o>>1&1,f=o>>2&1,p=o>>3&1,m=o>>4&1,y=o>>5&1,_=o>>6&1,w=o>>7&1,n.push(w,_,y,m,p,f,l,s);break}}return{get:function(o){for(;n.length<o;)i();let s=n.slice(0,o);return n=n.slice(o),s},resetAfterLine:function(){n.length=0},end:function(){if(r!==t.length)throw new Error("extra data found")}}}function Ir(t,e,n,r,i,o){let s=t.width,l=t.height,f=t.index;for(let p=0;p<l;p++)for(let m=0;m<s;m++){let y=n(m,p,f);Tr[r](e,i,y,o),o+=r}return o}function Sr(t,e,n,r,i,o){let s=t.width,l=t.height,f=t.index;for(let p=0;p<l;p++){for(let m=0;m<s;m++){let y=i.get(r),_=n(m,p,f);Ar[r](e,y,_,o)}i.resetAfterLine()}}jt.dataToBitMap=function(t,e){let n=e.width,r=e.height,i=e.depth,o=e.bpp,s=e.interlace,l;i!==8&&(l=Br(t,i));let f;i<=8?f=Buffer.alloc(n*r*4):f=new Uint16Array(n*r*4);let p=Math.pow(2,i)-1,m=0,y,_;if(s)y=Fe.getImagePasses(n,r),_=Fe.getInterlaceIterator(n,r);else{let w=0;_=function(){let E=w;return w+=4,E},y=[{width:n,height:r}]}for(let w=0;w<y.length;w++)i===8?m=Ir(y[w],f,_,o,t,m):Sr(y[w],f,_,o,l,p);if(i===8){if(m!==t.length)throw new Error("extra data found")}else l.end();return f};function Lr(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let l=0;l<n;l++){let f=i[t[o]];if(!f)throw new Error("index "+t[o]+" not in palette");for(let p=0;p<4;p++)e[o+p]=f[p];o+=4}}function Rr(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let l=0;l<n;l++){let f=!1;if(i.length===1?i[0]===t[o]&&(f=!0):i[0]===t[o]&&i[1]===t[o+1]&&i[2]===t[o+2]&&(f=!0),f)for(let p=0;p<4;p++)e[o+p]=0;o+=4}}function Pr(t,e,n,r,i){let o=255,s=Math.pow(2,i)-1,l=0;for(let f=0;f<r;f++)for(let p=0;p<n;p++){for(let m=0;m<4;m++)e[l+m]=Math.floor(t[l+m]*o/s+.5);l+=4}}var De=function(t,e){let n=e.depth,r=e.width,i=e.height,o=e.colorType,s=e.transColor,l=e.palette,f=t;return o===3?Lr(t,f,r,i,l):(s&&Rr(t,f,r,i,s),n!==8&&(n===16&&(f=Buffer.alloc(r*i*4)),Pr(t,f,r,i,n))),f};let Mr=V,Kt=X,xe=Ie,Or=Er,vr=ke,Nr=jt,Ur=De,D=Te.exports=function(t){xe.call(this),this._parser=new vr(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};Mr.inherits(D,xe),D.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",function(){})),this.errord=!0},D.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=Kt.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let n=((this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3)+1)*this._bitmapInfo.height,r=Math.max(n,Kt.Z_MIN_CHUNK);this._inflate=Kt.createInflate({chunkSize:r});let i=n,o=this.emit.bind(this,"error");this._inflate.on("error",function(l){i&&o(l)}),this._filter.on("complete",this._complete.bind(this));let s=this._filter.write.bind(this._filter);this._inflate.on("data",function(l){i&&(l.length>i&&(l=l.slice(0,i)),i-=l.length,s(l))}),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},D.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new Or(this._bitmapInfo)},D.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},D.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},D.prototype._simpleTransparency=function(){this._metaData.alpha=!0},D.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},D.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},D.prototype._complete=function(t){if(this.errord)return;let e;try{let n=Nr.dataToBitMap(t,this._bitmapInfo);e=Ur(n,this._bitmapInfo),n=null}catch(n){this._handleError(n);return}this.emit("parsed",e)};var kr=Te.exports,Ye={exports:{}},$e={exports:{}};let U=rt;var Fr=function(t,e,n,r){let i=[U.COLORTYPE_COLOR_ALPHA,U.COLORTYPE_ALPHA].indexOf(r.colorType)!==-1;if(r.colorType===r.inputColorType){let E=function(){let C=new ArrayBuffer(2);return new DataView(C).setInt16(0,256,!0),new Int16Array(C)[0]!==256}();if(r.bitDepth===8||r.bitDepth===16&&E)return t}let o=r.bitDepth!==16?t:new Uint16Array(t.buffer),s=255,l=U.COLORTYPE_TO_BPP_MAP[r.inputColorType];l===4&&!r.inputHasAlpha&&(l=3);let f=U.COLORTYPE_TO_BPP_MAP[r.colorType];r.bitDepth===16&&(s=65535,f*=2);let p=Buffer.alloc(e*n*f),m=0,y=0,_=r.bgColor||{};_.red===void 0&&(_.red=s),_.green===void 0&&(_.green=s),_.blue===void 0&&(_.blue=s);function w(){let E,C,b,g=s;switch(r.inputColorType){case U.COLORTYPE_COLOR_ALPHA:g=o[m+3],E=o[m],C=o[m+1],b=o[m+2];break;case U.COLORTYPE_COLOR:E=o[m],C=o[m+1],b=o[m+2];break;case U.COLORTYPE_ALPHA:g=o[m+1],E=o[m],C=E,b=E;break;case U.COLORTYPE_GRAYSCALE:E=o[m],C=E,b=E;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(i||(g/=s,E=Math.min(Math.max(Math.round((1-g)*_.red+g*E),0),s),C=Math.min(Math.max(Math.round((1-g)*_.green+g*C),0),s),b=Math.min(Math.max(Math.round((1-g)*_.blue+g*b),0),s))),{red:E,green:C,blue:b,alpha:g}}for(let E=0;E<n;E++)for(let C=0;C<e;C++){let b=w();switch(r.colorType){case U.COLORTYPE_COLOR_ALPHA:case U.COLORTYPE_COLOR:r.bitDepth===8?(p[y]=b.red,p[y+1]=b.green,p[y+2]=b.blue,i&&(p[y+3]=b.alpha)):(p.writeUInt16BE(b.red,y),p.writeUInt16BE(b.green,y+2),p.writeUInt16BE(b.blue,y+4),i&&p.writeUInt16BE(b.alpha,y+6));break;case U.COLORTYPE_ALPHA:case U.COLORTYPE_GRAYSCALE:{let g=(b.red+b.green+b.blue)/3;r.bitDepth===8?(p[y]=g,i&&(p[y+1]=b.alpha)):(p.writeUInt16BE(g,y),i&&p.writeUInt16BE(b.alpha,y+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}m+=l,y+=f}return p};let He=Re;function Dr(t,e,n,r,i){for(let o=0;o<n;o++)r[i+o]=t[e+o]}function xr(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++)r+=Math.abs(t[o]);return r}function Yr(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,f=t[e+s]-l;r[i+s]=f}}function $r(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,l=t[e+o]-s;i+=Math.abs(l)}return i}function Hr(t,e,n,r,i){for(let o=0;o<n;o++){let s=e>0?t[e+o-n]:0,l=t[e+o]-s;r[i+o]=l}}function zr(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++){let s=e>0?t[o-n]:0,l=t[o]-s;r+=Math.abs(l)}return r}function Gr(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,f=e>0?t[e+s-n]:0,p=t[e+s]-(l+f>>1);r[i+s]=p}}function Vr(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,l=e>0?t[e+o-n]:0,f=t[e+o]-(s+l>>1);i+=Math.abs(f)}return i}function jr(t,e,n,r,i,o){for(let s=0;s<n;s++){let l=s>=o?t[e+s-o]:0,f=e>0?t[e+s-n]:0,p=e>0&&s>=o?t[e+s-(n+o)]:0,m=t[e+s]-He(l,f,p);r[i+s]=m}}function Kr(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,l=e>0?t[e+o-n]:0,f=e>0&&o>=r?t[e+o-(n+r)]:0,p=t[e+o]-He(s,l,f);i+=Math.abs(p)}return i}let Wr={0:Dr,1:Yr,2:Hr,3:Gr,4:jr},qr={0:xr,1:$r,2:zr,3:Vr,4:Kr};var Qr=function(t,e,n,r,i){let o;if(!("filterType"in r)||r.filterType===-1)o=[0,1,2,3,4];else if(typeof r.filterType=="number")o=[r.filterType];else throw new Error("unrecognised filter types");r.bitDepth===16&&(i*=2);let s=e*i,l=0,f=0,p=Buffer.alloc((s+1)*n),m=o[0];for(let y=0;y<n;y++){if(o.length>1){let _=1/0;for(let w=0;w<o.length;w++){let E=qr[o[w]](t,f,s,i);E<_&&(m=o[w],_=E)}}p[l]=m,l++,Wr[m](t,f,s,p,l,i),l+=s,f+=s}return p};let M=rt,Jr=Ue,Zr=Fr,Xr=Qr,ti=X,H=$e.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32*1024,t.deflateLevel=t.deflateLevel!=null?t.deflateLevel:9,t.deflateStrategy=t.deflateStrategy!=null?t.deflateStrategy:3,t.inputHasAlpha=t.inputHasAlpha!=null?t.inputHasAlpha:!0,t.deflateFactory=t.deflateFactory||ti.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType=typeof t.colorType=="number"?t.colorType:M.COLORTYPE_COLOR_ALPHA,t.inputColorType=typeof t.inputColorType=="number"?t.inputColorType:M.COLORTYPE_COLOR_ALPHA,[M.COLORTYPE_GRAYSCALE,M.COLORTYPE_COLOR,M.COLORTYPE_COLOR_ALPHA,M.COLORTYPE_ALPHA].indexOf(t.colorType)===-1)throw new Error("option color type:"+t.colorType+" is not supported at present");if([M.COLORTYPE_GRAYSCALE,M.COLORTYPE_COLOR,M.COLORTYPE_COLOR_ALPHA,M.COLORTYPE_ALPHA].indexOf(t.inputColorType)===-1)throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(t.bitDepth!==8&&t.bitDepth!==16)throw new Error("option bit depth:"+t.bitDepth+" is not supported at prese