id-scanner-lib
Version:
一款纯前端实现的TypeScript身份证&二维码识别库,无需后端支持,所有处理在浏览器端完成,新增图像批处理与优化
1 lines • 71.4 kB
JavaScript
var global,factory;global=this,factory=function(t,r){"use strict";class n{constructor(t={}){this.options=t,this.stream=null,this.videoElement=null,this.options={width:640,height:480,facingMode:"environment",...t}}async start(t){return this.initialize(t)}stop(){this.release()}async initialize(t){this.videoElement=t;try{const t={video:{width:{ideal:this.options.width},height:{ideal:this.options.height},facingMode:this.options.facingMode}};this.stream=await navigator.mediaDevices.getUserMedia(t),this.videoElement&&(this.videoElement.srcObject=this.stream,await new Promise((t=>{this.videoElement&&(this.videoElement.onloadedmetadata=()=>{this.videoElement&&this.videoElement.play().then((()=>t()))})})))}catch(t){throw Error("无法访问摄像头。请确保已授予摄像头访问权限,并且摄像头未被其他应用程序占用。")}}captureFrame(){if(!this.videoElement)return null;const t=document.createElement("canvas");t.width=this.videoElement.videoWidth,t.height=this.videoElement.videoHeight;const r=t.getContext("2d");return r?(r.drawImage(this.videoElement,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)):null}release(){this.stream&&(this.stream.getTracks().forEach((t=>t.stop())),this.stream=null),this.videoElement&&(this.videoElement.srcObject=null,this.videoElement=null)}}function e(t,r){return new Promise((function(n,e){let o;return i(t).then((function(t){try{return o=t,n(new Blob([r.slice(0,2),o,r.slice(2)],{type:"image/jpeg"}))}catch(t){return e(t)}}),e)}))}const i=t=>new Promise(((r,n)=>{const e=new FileReader;e.addEventListener("load",(({target:{result:t}})=>{const e=new DataView(t);let i=0;if(65496!==e.getUint16(i))return n("not a valid JPEG");for(i+=2;;){const o=e.getUint16(i);if(65498===o)break;const s=e.getUint16(i+2);if(65505===o&&1165519206===e.getUint32(i+4)){const o=i+10;let a;switch(e.getUint16(o)){case 18761:a=!0;break;case 19789:a=!1;break;default:return n("TIFF header contains invalid endian")}if(42!==e.getUint16(o+2,a))return n("TIFF header contains invalid version");const c=e.getUint32(o+4,a),f=o+c+2+12*e.getUint16(o+c,a);for(let t=o+c+2;t<f;t+=12)if(274==e.getUint16(t,a)){if(3!==e.getUint16(t+2,a))return n("Orientation data type is invalid");if(1!==e.getUint32(t+4,a))return n("Orientation data count is invalid");e.setUint16(t+8,1,a);break}return r(t.slice(i,i+2+s))}i+=2+s}return r(new Blob)})),e.readAsArrayBuffer(t)}));var o={},s={get exports(){return o},set exports(t){o=t}};!function(){var t,r,n={};s.exports=n,n.parse=function(t,r){for(var e=n.bin.readUshort,i=n.bin.readUint,o=0,s={},a=new Uint8Array(t),c=a.length-4;101010256!=i(a,c);)c--;o=c,o+=4;var f=e(a,o+=4);e(a,o+=2);var u=i(a,o+=2),l=i(a,o+=4);o+=4,o=l;for(var h=0;h<f;h++){i(a,o),o+=4,o+=4,o+=4,i(a,o+=4),u=i(a,o+=4);var A=i(a,o+=4),d=e(a,o+=4),w=e(a,o+2),v=e(a,o+4);o+=6;var y=i(a,o+=8);o+=4,o+=d+w+v,n.o(a,y,s,u,A,r)}return s},n.o=function(t,r,e,i,o,s){var a=n.bin.readUshort,c=n.bin.readUint;c(t,r),a(t,r+=4),a(t,r+=2);var f=a(t,r+=2);c(t,r+=2),c(t,r+=4),r+=4;var u=a(t,r+=8),l=a(t,r+=2);r+=2;var h=n.bin.readUTF8(t,r,u);if(r+=u,r+=l,s)e[h]={size:o,csize:i};else{var A=new Uint8Array(t.buffer,r);if(0==f)e[h]=new Uint8Array(A.buffer.slice(r,r+i));else{if(8!=f)throw"unknown compression method: "+f;var d=new Uint8Array(o);n.inflateRaw(A,d),e[h]=d}}},n.inflateRaw=function(t,r){return n.F.inflate(t,r)},n.inflate=function(t,r){return n.inflateRaw(new Uint8Array(t.buffer,t.byteOffset+2,t.length-6),r)},n.deflate=function(t,r){null==r&&(r={level:6});var e=0,i=new Uint8Array(50+Math.floor(1.1*t.length));i[e]=120,i[e+1]=156,e+=2,e=n.F.deflateRaw(t,i,e,r.level);var o=n.adler(t,0,t.length);return i[e+0]=o>>>24&255,i[e+1]=o>>>16&255,i[e+2]=o>>>8&255,i[e+3]=o>>>0&255,new Uint8Array(i.buffer,0,e+4)},n.deflateRaw=function(t,r){null==r&&(r={level:6});var e=new Uint8Array(50+Math.floor(1.1*t.length)),i=n.F.deflateRaw(t,e,i,r.level);return new Uint8Array(e.buffer,0,i)},n.encode=function(t,r){null==r&&(r=!1);var e=0,i=n.bin.writeUint,o=n.bin.writeUshort,s={};for(var a in t){var c=!n.B(a)&&!r,f=t[a],u=n.crc.crc(f,0,f.length);s[a]={cpr:c,usize:f.length,crc:u,file:c?n.deflateRaw(f):f}}for(var a in s)e+=s[a].file.length+30+46+2*n.bin.sizeUTF8(a);e+=22;var l=new Uint8Array(e),h=0,A=[];for(var a in s){var d=s[a];A.push(h),h=n.P(l,h,a,d,0)}var w=0,v=h;for(var a in s)d=s[a],A.push(h),h=n.P(l,h,a,d,1,A[w++]);var y=h-v;return i(l,h,101010256),h+=4,o(l,h+=4,w),o(l,h+=2,w),i(l,h+=2,y),i(l,h+=4,v),h+=4,h+=2,l.buffer},n.B=function(t){var r=t.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(r)},n.P=function(t,r,e,i,o,s){var a=n.bin.writeUint,c=n.bin.writeUshort,f=i.file;return a(t,r,0==o?67324752:33639248),r+=4,1==o&&(r+=2),c(t,r,20),c(t,r+=2,0),c(t,r+=2,i.cpr?8:0),a(t,r+=2,0),a(t,r+=4,i.crc),a(t,r+=4,f.length),a(t,r+=4,i.usize),c(t,r+=4,n.bin.sizeUTF8(e)),c(t,r+=2,0),r+=2,1==o&&(r+=2,r+=2,a(t,r+=6,s),r+=4),r+=n.bin.writeUTF8(t,r,e),0==o&&(t.set(f,r),r+=f.length),r},n.crc={table:function(){for(var t=new Uint32Array(256),r=0;r<256;r++){for(var n=r,e=0;e<8;e++)1&n?n=3988292384^n>>>1:n>>>=1;t[r]=n}return t}(),update:function(t,r,e,i){for(var o=0;o<i;o++)t=n.crc.table[255&(t^r[e+o])]^t>>>8;return t},crc:function(t,r,e){return 4294967295^n.crc.update(4294967295,t,r,e)}},n.adler=function(t,r,n){for(var e=1,i=0,o=r,s=r+n;o<s;){for(var a=Math.min(o+5552,s);o<a;)i+=e+=t[o++];e%=65521,i%=65521}return i<<16|e},n.bin={readUshort:function(t,r){return t[r]|t[r+1]<<8},writeUshort:function(t,r,n){t[r]=255&n,t[r+1]=n>>8&255},readUint:function(t,r){return 16777216*t[r+3]+(t[r+2]<<16|t[r+1]<<8|t[r])},writeUint:function(t,r,n){t[r]=255&n,t[r+1]=n>>8&255,t[r+2]=n>>16&255,t[r+3]=n>>24&255},readASCII:function(t,r,n){for(var e="",i=0;i<n;i++)e+=String.fromCharCode(t[r+i]);return e},writeASCII:function(t,r,n){for(var e=0;e<n.length;e++)t[r+e]=n.charCodeAt(e)},pad:function(t){return t.length<2?"0"+t:t},readUTF8:function(t,r,e){for(var i,o="",s=0;s<e;s++)o+="%"+n.bin.pad(t[r+s].toString(16));try{i=decodeURIComponent(o)}catch(i){return n.bin.readASCII(t,r,e)}return i},writeUTF8:function(t,r,n){for(var e=n.length,i=0,o=0;o<e;o++){var s=n.charCodeAt(o);if(4294967168&s)if(4294965248&s)if(4294901760&s){if(4292870144&s)throw"e";t[r+i]=240|s>>18,t[r+i+1]=128|s>>12&63,t[r+i+2]=128|s>>6&63,t[r+i+3]=128|63&s,i+=4}else t[r+i]=224|s>>12,t[r+i+1]=128|s>>6&63,t[r+i+2]=128|63&s,i+=3;else t[r+i]=192|s>>6,t[r+i+1]=128|63&s,i+=2;else t[r+i]=s,i++}return i},sizeUTF8:function(t){for(var r=t.length,n=0,e=0;e<r;e++){var i=t.charCodeAt(e);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw"e";n+=4}else n+=3;else n+=2;else n++}return n}},n.F={},n.F.deflateRaw=function(t,r,e,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],s=n.F.U,a=n.F.O,c=n.F._,f=0,u=e<<3,l=0,h=t.length;if(0==i){for(;f<h;)c(r,u,f+(M=Math.min(65535,h-f))==h?1:0),u=n.F.G(t,f,M,r,u+8),f+=M;return u>>>3}var A=s.lits,d=s.strt,w=s.prev,v=0,y=0,m=0,p=0,g=0,E=0;for(h>2&&(d[E=n.F.tt(t,0)]=0),f=0;f<h;f++){if(g=E,f+1<h-2){E=n.F.tt(t,f+1);var b=f+1&32767;w[b]=d[E],d[E]=b}if(l<=f){(v>14e3||y>26697)&&h-f>100&&(l<f&&(A[v]=f-l,v+=2,l=f),u=n.F.rt(f==h-1||l==h?1:0,A,v,p,t,m,f-m,r,u),v=y=p=0,m=f);var U=0;f<h-2&&(U=n.F.nt(t,f,w,g,Math.min(o[2],h-f),o[3]));var M=U>>>16,I=65535&U;if(0!=U){I=65535&U;var B=a(M=U>>>16,s.of0);s.lhst[257+B]++;var C=a(I,s.df0);s.dhst[C]++,p+=s.exb[B]+s.dxb[C],A[v]=M<<23|f-l,A[v+1]=I<<16|B<<8|C,v+=2,l=f+M}else s.lhst[t[f]]++;y++}}for(m==f&&0!=t.length||(l<f&&(A[v]=f-l,v+=2,l=f),u=n.F.rt(1,A,v,p,t,m,f-m,r,u),v=0,y=0,v=y=p=0,m=f);7&u;)u++;return u>>>3},n.F.nt=function(t,r,e,i,o,s){var a=32767&r,c=e[a],f=a-c+32768&32767;if(c==a||i!=n.F.tt(t,r-f))return 0;for(var u=0,l=0,h=Math.min(32767,r);f<=h&&0!=--s&&c!=a;){if(0==u||t[r+u]==t[r+u-f]){var A=n.F.et(t,r,f);if(A>u){if(l=f,(u=A)>=o)break;f+2<A&&(A=f+2);for(var d=0,w=0;w<A-2;w++){var v=r-f+w+32768&32767,y=v-e[v]+32768&32767;y>d&&(d=y,c=v)}}}f+=(a=c)-(c=e[a])+32768&32767}return u<<16|l},n.F.et=function(t,r,n){if(t[r]!=t[r-n]||t[r+1]!=t[r+1-n]||t[r+2]!=t[r+2-n])return 0;var e=r,i=Math.min(t.length,r+258);for(r+=3;r<i&&t[r]==t[r-n];)r++;return r-e},n.F.tt=function(t,r){return(t[r]<<8|t[r+1])+(t[r+2]<<4)&65535},n.saved=0,n.F.rt=function(t,r,e,i,o,s,a,c,f){var u,l,h,A,d,w,v,y,m,p=n.F.U,g=n.F.it,E=n.F._;p.lhst[256]++,l=(u=n.F.getTrees())[0],h=u[1],A=u[2],d=u[3],w=u[4],v=u[5],y=u[6],m=u[7];var b=32+(f+3&7?8-(f+3&7):0)+(a<<3),U=i+n.F.contSize(p.fltree,p.lhst)+n.F.contSize(p.fdtree,p.dhst),M=i+n.F.contSize(p.ltree,p.lhst)+n.F.contSize(p.dtree,p.dhst);M+=14+3*v+n.F.contSize(p.itree,p.ihst)+(2*p.ihst[16]+3*p.ihst[17]+7*p.ihst[18]);for(var I=0;I<286;I++)p.lhst[I]=0;for(I=0;I<30;I++)p.dhst[I]=0;for(I=0;I<19;I++)p.ihst[I]=0;var B=b<U&&b<M?0:U<M?1:2;if(g(c,f,t),g(c,f+1,B),f+=3,0==B){for(;7&f;)f++;f=n.F.G(o,s,a,c,f)}else{var C,D;if(1==B&&(C=p.fltree,D=p.fdtree),2==B){n.F.makeCodes(p.ltree,l),n.F.revCodes(p.ltree,l),n.F.makeCodes(p.dtree,h),n.F.revCodes(p.dtree,h),n.F.makeCodes(p.itree,A),n.F.revCodes(p.itree,A),C=p.ltree,D=p.dtree,E(c,f,d-257),E(c,f+=5,w-1),E(c,f+=5,v-4),f+=4;for(var Q=0;Q<v;Q++)E(c,f+3*Q,p.itree[1+(p.ordr[Q]<<1)]);f+=3*v,f=n.F.ot(y,p.itree,c,f),f=n.F.ot(m,p.itree,c,f)}for(var k=s,R=0;R<e;R+=2){for(var S=r[R],T=S>>>23,x=k+(8388607&S);k<x;)f=n.F.st(o[k++],C,c,f);if(0!=T){var F=r[R+1],P=F>>16,O=F>>8&255,j=255&F;E(c,f=n.F.st(257+O,C,c,f),T-p.of0[O]),f+=p.exb[O],g(c,f=n.F.st(j,D,c,f),P-p.df0[j]),f+=p.dxb[j],k+=T}}f=n.F.st(256,C,c,f)}return f},n.F.G=function(t,r,n,e,i){var o=i>>>3;return e[o]=n,e[o+1]=n>>>8,e[o+2]=255-e[o],e[o+3]=255-e[o+1],o+=4,e.set(new Uint8Array(t.buffer,r,n),o),i+(n+4<<3)},n.F.getTrees=function(){for(var t=n.F.U,r=n.F.ct(t.lhst,t.ltree,15),e=n.F.ct(t.dhst,t.dtree,15),i=[],o=n.F.ft(t.ltree,i),s=[],a=n.F.ft(t.dtree,s),c=0;c<i.length;c+=2)t.ihst[i[c]]++;for(c=0;c<s.length;c+=2)t.ihst[s[c]]++;for(var f=n.F.ct(t.ihst,t.itree,7),u=19;u>4&&0==t.itree[1+(t.ordr[u-1]<<1)];)u--;return[r,e,f,o,a,u,i,s]},n.F.getSecond=function(t){for(var r=[],n=0;n<t.length;n+=2)r.push(t[n+1]);return r},n.F.nonZero=function(t){for(var r="",n=0;n<t.length;n+=2)0!=t[n+1]&&(r+=(n>>1)+",");return r},n.F.contSize=function(t,r){for(var n=0,e=0;e<r.length;e++)n+=r[e]*t[1+(e<<1)];return n},n.F.ot=function(t,r,e,i){for(var o=0;o<t.length;o+=2){var s=t[o],a=t[o+1];i=n.F.st(s,r,e,i);var c=16==s?2:17==s?3:7;s>15&&(n.F._(e,i,a,c),i+=c)}return i},n.F.ft=function(t,r){for(var n=t.length;2!=n&&0==t[n-1];)n-=2;for(var e=0;e<n;e+=2){var i=t[e+1],o=e+3<n?t[e+3]:-1,s=e+5<n?t[e+5]:-1,a=0==e?-1:t[e-1];if(0==i&&o==i&&s==i){for(var c=e+5;c+2<n&&t[c+2]==i;)c+=2;(f=Math.min(c+1-e>>>1,138))<11?r.push(17,f-3):r.push(18,f-11),e+=2*f-2}else if(i==a&&o==i&&s==i){for(c=e+5;c+2<n&&t[c+2]==i;)c+=2;var f=Math.min(c+1-e>>>1,6);r.push(16,f-3),e+=2*f-2}else r.push(i,0)}return n>>>1},n.F.ct=function(t,r,e){var i=[],o=t.length,s=r.length,a=0;for(a=0;a<s;a+=2)r[a]=0,r[a+1]=0;for(a=0;a<o;a++)0!=t[a]&&i.push({lit:a,f:t[a]});var c=i.length,f=i.slice(0);if(0==c)return 0;if(1==c){var u=i[0].lit;return f=0==u?1:0,r[1+(u<<1)]=1,r[1+(f<<1)]=1,1}i.sort((function(t,r){return t.f-r.f}));var l=i[0],h=i[1],A=0,d=1,w=2;for(i[0]={lit:-1,f:l.f+h.f,l:l,r:h,d:0};d!=c-1;)l=A!=d&&(w==c||i[A].f<i[w].f)?i[A++]:i[w++],h=A!=d&&(w==c||i[A].f<i[w].f)?i[A++]:i[w++],i[d++]={lit:-1,f:l.f+h.f,l:l,r:h};var v=n.F.setDepth(i[d-1],0);for(v>e&&(n.F.restrictDepth(f,e,v),v=e),a=0;a<c;a++)r[1+(f[a].lit<<1)]=f[a].d;return v},n.F.setDepth=function(t,r){return-1!=t.lit?(t.d=r,r):Math.max(n.F.setDepth(t.l,r+1),n.F.setDepth(t.r,r+1))},n.F.restrictDepth=function(t,r,n){var e=0,i=1<<n-r,o=0;for(t.sort((function(t,r){return r.d==t.d?t.f-r.f:r.d-t.d})),e=0;e<t.length&&t[e].d>r;e++){var s=t[e].d;t[e].d=r,o+=i-(1<<n-s)}for(o>>>=n-r;o>0;)(s=t[e].d)<r?(t[e].d++,o-=1<<r-s-1):e++;for(;e>=0;e--)t[e].d==r&&o<0&&(t[e].d--,o++)},n.F.O=function(t,r){var n=0;return r[16|n]<=t&&(n|=16),r[8|n]<=t&&(n|=8),r[4|n]<=t&&(n|=4),r[2|n]<=t&&(n|=2),r[1|n]<=t&&(n|=1),n},n.F.st=function(t,r,e,i){return n.F.it(e,i,r[t<<1]),i+r[1+(t<<1)]},n.F.inflate=function(t,r){var e=Uint8Array;if(3==t[0]&&0==t[1])return r||new e(0);var i=n.F,o=i.ut,s=i.lt,a=i.ht,c=i.makeCodes,f=i.codes2map,u=i.At,l=i.U,h=null==r;h&&(r=new e(t.length>>>2<<3));for(var A,d,w=0,v=0,y=0,m=0,p=0,g=0,E=0,b=0,U=0;0==w;)if(w=o(t,U,1),v=o(t,U+1,2),U+=3,0!=v){if(h&&(r=n.F.dt(r,b+(1<<17))),1==v&&(A=l.flmap,d=l.fdmap,g=511,E=31),2==v){y=s(t,U,5)+257,m=s(t,U+5,5)+1,p=s(t,U+10,4)+4,U+=14;for(var M=0;M<38;M+=2)l.itree[M]=0,l.itree[M+1]=0;var I=1;for(M=0;M<p;M++){var B=s(t,U+3*M,3);l.itree[1+(l.ordr[M]<<1)]=B,B>I&&(I=B)}U+=3*p,c(l.itree,I),f(l.itree,I,l.imap),A=l.lmap,d=l.dmap,U=a(l.imap,(1<<I)-1,y+m,t,U,l.ttree);var C=i.wt(l.ttree,0,y,l.ltree);g=(1<<C)-1;var D=i.wt(l.ttree,y,m,l.dtree);E=(1<<D)-1,c(l.ltree,C),f(l.ltree,C,A),c(l.dtree,D),f(l.dtree,D,d)}for(;;){var Q=A[u(t,U)&g];U+=15&Q;var k=Q>>>4;if(k>>>8==0)r[b++]=k;else{if(256==k)break;var R=b+k-254;if(k>264){var S=l.ldef[k-257];R=b+(S>>>3)+s(t,U,7&S),U+=7&S}var T=d[u(t,U)&E];U+=15&T;var x=T>>>4,F=l.ddef[x],P=(F>>>4)+o(t,U,15&F);for(U+=15&F,h&&(r=n.F.dt(r,b+(1<<17)));b<R;)r[b]=r[b++-P],r[b]=r[b++-P],r[b]=r[b++-P],r[b]=r[b++-P];b=R}}}else{7&U&&(U+=8-(7&U));var O=4+(U>>>3),j=t[O-4]|t[O-3]<<8;h&&(r=n.F.dt(r,b+j)),r.set(new e(t.buffer,t.byteOffset+O,j),b),U=O+j<<3,b+=j}return r.length==b?r:r.slice(0,b)},n.F.dt=function(t,r){var n=t.length;if(r<=n)return t;var e=new Uint8Array(Math.max(n<<1,r));return e.set(t,0),e},n.F.ht=function(t,r,e,i,o,s){for(var a=n.F.lt,c=n.F.At,f=0;f<e;){var u=t[c(i,o)&r];o+=15&u;var l=u>>>4;if(l<=15)s[f]=l,f++;else{var h=0,A=0;16==l?(A=3+a(i,o,2),o+=2,h=s[f-1]):17==l?(A=3+a(i,o,3),o+=3):18==l&&(A=11+a(i,o,7),o+=7);for(var d=f+A;f<d;)s[f]=h,f++}}return o},n.F.wt=function(t,r,n,e){for(var i=0,o=0,s=e.length>>>1;o<n;){var a=t[o+r];e[o<<1]=0,e[1+(o<<1)]=a,a>i&&(i=a),o++}for(;o<s;)e[o<<1]=0,e[1+(o<<1)]=0,o++;return i},n.F.makeCodes=function(t,r){for(var e,i,o,s,a=n.F.U,c=t.length,f=a.bl_count,u=0;u<=r;u++)f[u]=0;for(u=1;u<c;u+=2)f[t[u]]++;var l=a.next_code;for(e=0,f[0]=0,i=1;i<=r;i++)e=e+f[i-1]<<1,l[i]=e;for(o=0;o<c;o+=2)0!=(s=t[o+1])&&(t[o]=l[s],l[s]++)},n.F.codes2map=function(t,r,e){for(var i=t.length,o=n.F.U.rev15,s=0;s<i;s+=2)if(0!=t[s+1])for(var a=s>>1,c=t[s+1],f=a<<4|c,u=r-c,l=t[s]<<u,h=l+(1<<u);l!=h;)e[o[l]>>>15-r]=f,l++},n.F.revCodes=function(t,r){for(var e=n.F.U.rev15,i=15-r,o=0;o<t.length;o+=2){var s=t[o]<<r-t[o+1];t[o]=e[s]>>>i}},n.F._=function(t,r,n){n<<=7&r;var e=r>>>3;t[e]|=n,t[e+1]|=n>>>8},n.F.it=function(t,r,n){n<<=7&r;var e=r>>>3;t[e]|=n,t[e+1]|=n>>>8,t[e+2]|=n>>>16},n.F.lt=function(t,r,n){return(t[r>>>3]|t[1+(r>>>3)]<<8)>>>(7&r)&(1<<n)-1},n.F.ut=function(t,r,n){return(t[r>>>3]|t[1+(r>>>3)]<<8|t[2+(r>>>3)]<<16)>>>(7&r)&(1<<n)-1},n.F.At=function(t,r){return(t[r>>>3]|t[1+(r>>>3)]<<8|t[2+(r>>>3)]<<16)>>>(7&r)},n.F.vt=function(t,r){return(t[r>>>3]|t[1+(r>>>3)]<<8|t[2+(r>>>3)]<<16|t[3+(r>>>3)]<<24)>>>(7&r)},n.F.U=(t=Uint16Array,r=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[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,999,999,999],exb:[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,0,0,0],ldef:new t(32),df0:[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,65535,65535],dxb:[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,0,0],ddef:new r(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new r(286),dhst:new r(30),ihst:new r(19),lits:new r(15e3),strt:new t(65536),prev:new t(32768)}),function(){for(var t=n.F.U,r=0;r<32768;r++){var e=r;e=(4278255360&(e=(4042322160&(e=(3435973836&(e=(2863311530&e)>>>1|(1431655765&e)<<1))>>>2|(858993459&e)<<2))>>>4|(252645135&e)<<4))>>>8|(16711935&e)<<8,t.rev15[r]=(e>>>16|e<<16)>>>17}function i(t,r,n){for(;0!=r--;)t.push(0,n)}for(r=0;r<32;r++)t.ldef[r]=t.of0[r]<<3|t.exb[r],t.ddef[r]=t.df0[r]<<4|t.dxb[r];i(t.fltree,144,8),i(t.fltree,112,9),i(t.fltree,24,7),i(t.fltree,8,8),n.F.makeCodes(t.fltree,9),n.F.codes2map(t.fltree,9,t.flmap),n.F.revCodes(t.fltree,9),i(t.fdtree,32,5),n.F.makeCodes(t.fdtree,5),n.F.codes2map(t.fdtree,5,t.fdmap),n.F.revCodes(t.fdtree,5),i(t.itree,19,0),i(t.ltree,286,0),i(t.dtree,30,0),i(t.ttree,320,0)}()}();var a=function(t,r){return r.forEach((function(r){r&&"string"!=typeof r&&!Array.isArray(r)&&Object.keys(r).forEach((function(n){if("default"!==n&&!(n in t)){var e=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,e.get?e:{enumerable:!0,get:function(){return r[n]}})}}))})),Object.freeze(t)}({__proto__:null,default:o},[o]);const c=function(){var t={nextZero(t,r){for(;0!=t[r];)r++;return r},readUshort:(t,r)=>t[r]<<8|t[r+1],writeUshort(t,r,n){t[r]=n>>8&255,t[r+1]=255&n},readUint:(t,r)=>16777216*t[r]+(t[r+1]<<16|t[r+2]<<8|t[r+3]),writeUint(t,r,n){t[r]=n>>24&255,t[r+1]=n>>16&255,t[r+2]=n>>8&255,t[r+3]=255&n},readASCII(t,r,n){let e="";for(let i=0;i<n;i++)e+=String.fromCharCode(t[r+i]);return e},writeASCII(t,r,n){for(let e=0;e<n.length;e++)t[r+e]=n.charCodeAt(e)},readBytes(t,r,n){const e=[];for(let i=0;i<n;i++)e.push(t[r+i]);return e},pad:t=>t.length<2?"0"+t:t,readUTF8(r,n,e){let i,o="";for(let i=0;i<e;i++)o+="%"+t.pad(r[n+i].toString(16));try{i=decodeURIComponent(o)}catch(i){return t.readASCII(r,n,e)}return i}};function r(r,n,e,i){const s=n*e,a=o(i),c=Math.ceil(n*a/8),f=new Uint8Array(4*s),u=new Uint32Array(f.buffer),{ctype:l}=i,{depth:h}=i,A=t.readUshort;if(6==l){const t=s<<2;if(8==h)for(var d=0;d<t;d+=4)f[d]=r[d],f[d+1]=r[d+1],f[d+2]=r[d+2],f[d+3]=r[d+3];if(16==h)for(d=0;d<t;d++)f[d]=r[d<<1]}else if(2==l){const t=i.tabs.tRNS;if(null==t){if(8==h)for(d=0;d<s;d++){var w=3*d;u[d]=255<<24|r[w+2]<<16|r[w+1]<<8|r[w]}if(16==h)for(d=0;d<s;d++)w=6*d,u[d]=255<<24|r[w+4]<<16|r[w+2]<<8|r[w]}else{var v=t[0];const n=t[1],e=t[2];if(8==h)for(d=0;d<s;d++){var y=d<<2;w=3*d,u[d]=255<<24|r[w+2]<<16|r[w+1]<<8|r[w],r[w]==v&&r[w+1]==n&&r[w+2]==e&&(f[y+3]=0)}if(16==h)for(d=0;d<s;d++)y=d<<2,w=6*d,u[d]=255<<24|r[w+4]<<16|r[w+2]<<8|r[w],A(r,w)==v&&A(r,w+2)==n&&A(r,w+4)==e&&(f[y+3]=0)}}else if(3==l){const t=i.tabs.PLTE,o=i.tabs.tRNS,a=o?o.length:0;if(1==h)for(var m=0;m<e;m++){var p=m*c,g=m*n;for(d=0;d<n;d++){y=g+d<<2;var E=3*(b=r[p+(d>>3)]>>7-(7&d)&1);f[y]=t[E],f[y+1]=t[E+1],f[y+2]=t[E+2],f[y+3]=b<a?o[b]:255}}if(2==h)for(m=0;m<e;m++)for(p=m*c,g=m*n,d=0;d<n;d++)y=g+d<<2,E=3*(b=r[p+(d>>2)]>>6-((3&d)<<1)&3),f[y]=t[E],f[y+1]=t[E+1],f[y+2]=t[E+2],f[y+3]=b<a?o[b]:255;if(4==h)for(m=0;m<e;m++)for(p=m*c,g=m*n,d=0;d<n;d++)y=g+d<<2,E=3*(b=r[p+(d>>1)]>>4-((1&d)<<2)&15),f[y]=t[E],f[y+1]=t[E+1],f[y+2]=t[E+2],f[y+3]=b<a?o[b]:255;if(8==h)for(d=0;d<s;d++){var b;y=d<<2,E=3*(b=r[d]),f[y]=t[E],f[y+1]=t[E+1],f[y+2]=t[E+2],f[y+3]=b<a?o[b]:255}}else if(4==l){if(8==h)for(d=0;d<s;d++){y=d<<2;var U=r[M=d<<1];f[y]=U,f[y+1]=U,f[y+2]=U,f[y+3]=r[M+1]}if(16==h)for(d=0;d<s;d++){var M;y=d<<2,U=r[M=d<<2],f[y]=U,f[y+1]=U,f[y+2]=U,f[y+3]=r[M+2]}}else if(0==l)for(v=i.tabs.tRNS?i.tabs.tRNS:-1,m=0;m<e;m++){const t=m*c,e=m*n;if(1==h)for(var I=0;I<n;I++){var B=(U=255*(r[t+(I>>>3)]>>>7-(7&I)&1))==255*v?0:255;u[e+I]=B<<24|U<<16|U<<8|U}else if(2==h)for(I=0;I<n;I++)B=(U=85*(r[t+(I>>>2)]>>>6-((3&I)<<1)&3))==85*v?0:255,u[e+I]=B<<24|U<<16|U<<8|U;else if(4==h)for(I=0;I<n;I++)B=(U=17*(r[t+(I>>>1)]>>>4-((1&I)<<2)&15))==17*v?0:255,u[e+I]=B<<24|U<<16|U<<8|U;else if(8==h)for(I=0;I<n;I++)B=(U=r[t+I])==v?0:255,u[e+I]=B<<24|U<<16|U<<8|U;else if(16==h)for(I=0;I<n;I++)U=r[t+(I<<1)],B=A(r,t+(I<<1))==v?0:255,u[e+I]=B<<24|U<<16|U<<8|U}return f}function n(t,r,n,a){const c=o(t),f=new Uint8Array((Math.ceil(n*c/8)+1+t.interlace)*a);return r=t.tabs.CgBI?i(r,f):e(r,f),0==t.interlace?r=s(r,t,0,n,a):1==t.interlace&&(r=function(t,r){const n=r.width,e=r.height,i=o(r),a=i>>3,c=Math.ceil(n*i/8),f=new Uint8Array(e*c);let u=0;const l=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],A=[8,8,8,4,4,2,2],d=[8,8,4,4,2,2,1];let w=0;for(;w<7;){const o=A[w],y=d[w];let m=0,p=0,g=l[w];for(;g<e;)g+=o,p++;let E=h[w];for(;E<n;)E+=y,m++;const b=Math.ceil(m*i/8);s(t,r,u,m,p);let U=0,M=l[w];for(;M<e;){let r=h[w],e=u+U*b<<3;for(;r<n;){var v;if(1==i&&(v=(v=t[e>>3])>>7-(7&e)&1,f[M*c+(r>>3)]|=v<<7-(7&r)),2==i&&(v=(v=t[e>>3])>>6-(7&e)&3,f[M*c+(r>>2)]|=v<<6-((3&r)<<1)),4==i&&(v=(v=t[e>>3])>>4-(7&e)&15,f[M*c+(r>>1)]|=v<<4-((1&r)<<2)),i>=8){const n=M*c+r*a;for(let r=0;r<a;r++)f[n+r]=t[(e>>3)+r]}e+=i,r+=y}U++,M+=o}m*p!=0&&(u+=p*(1+b)),w+=1}return f}(r,t)),r}function e(t,r){return i(new Uint8Array(t.buffer,2,t.length-6),r)}var i=function(){const t={H:{}};return t.H.N=function(r,n){const e=Uint8Array;let i,o,s=0,a=0,c=0,f=0,u=0,l=0,h=0,A=0,d=0;if(3==r[0]&&0==r[1])return n||new e(0);const w=t.H,v=w.b,y=w.e,m=w.R,p=w.n,g=w.A,E=w.Z,b=w.m,U=null==n;for(U&&(n=new e(r.length>>>2<<5));0==s;)if(s=v(r,d,1),a=v(r,d+1,2),d+=3,0!=a){if(U&&(n=t.H.W(n,A+(1<<17))),1==a&&(i=b.J,o=b.h,l=511,h=31),2==a){c=y(r,d,5)+257,f=y(r,d+5,5)+1,u=y(r,d+10,4)+4,d+=14;let t=1;for(var M=0;M<38;M+=2)b.Q[M]=0,b.Q[M+1]=0;for(M=0;M<u;M++){const n=y(r,d+3*M,3);b.Q[1+(b.X[M]<<1)]=n,n>t&&(t=n)}d+=3*u,p(b.Q,t),g(b.Q,t,b.u),i=b.w,o=b.d,d=m(b.u,(1<<t)-1,c+f,r,d,b.v);const n=w.V(b.v,0,c,b.C);l=(1<<n)-1;const e=w.V(b.v,c,f,b.D);h=(1<<e)-1,p(b.C,n),g(b.C,n,i),p(b.D,e),g(b.D,e,o)}for(;;){const t=i[E(r,d)&l];d+=15&t;const e=t>>>4;if(e>>>8==0)n[A++]=e;else{if(256==e)break;{let t=A+e-254;if(e>264){const n=b.q[e-257];t=A+(n>>>3)+y(r,d,7&n),d+=7&n}const i=o[E(r,d)&h];d+=15&i;const s=i>>>4,a=b.c[s],c=(a>>>4)+v(r,d,15&a);for(d+=15&a;A<t;)n[A]=n[A++-c],n[A]=n[A++-c],n[A]=n[A++-c],n[A]=n[A++-c];A=t}}}}else{7&d&&(d+=8-(7&d));const i=4+(d>>>3),o=r[i-4]|r[i-3]<<8;U&&(n=t.H.W(n,A+o)),n.set(new e(r.buffer,r.byteOffset+i,o),A),d=i+o<<3,A+=o}return n.length==A?n:n.slice(0,A)},t.H.W=function(t,r){const n=t.length;if(r<=n)return t;const e=new Uint8Array(n<<1);return e.set(t,0),e},t.H.R=function(r,n,e,i,o,s){const a=t.H.e,c=t.H.Z;let f=0;for(;f<e;){const t=r[c(i,o)&n];o+=15&t;const e=t>>>4;if(e<=15)s[f]=e,f++;else{let t=0,r=0;16==e?(r=3+a(i,o,2),o+=2,t=s[f-1]):17==e?(r=3+a(i,o,3),o+=3):18==e&&(r=11+a(i,o,7),o+=7);const n=f+r;for(;f<n;)s[f]=t,f++}}return o},t.H.V=function(t,r,n,e){let i=0,o=0;const s=e.length>>>1;for(;o<n;){const n=t[o+r];e[o<<1]=0,e[1+(o<<1)]=n,n>i&&(i=n),o++}for(;o<s;)e[o<<1]=0,e[1+(o<<1)]=0,o++;return i},t.H.n=function(r,n){const e=t.H.m,i=r.length;let o,s,a,c;const f=e.j;for(var u=0;u<=n;u++)f[u]=0;for(u=1;u<i;u+=2)f[r[u]]++;const l=e.K;for(o=0,f[0]=0,s=1;s<=n;s++)o=o+f[s-1]<<1,l[s]=o;for(a=0;a<i;a+=2)c=r[a+1],0!=c&&(r[a]=l[c],l[c]++)},t.H.A=function(r,n,e){const i=r.length,o=t.H.m.r;for(let t=0;t<i;t+=2)if(0!=r[t+1]){const i=t>>1,s=r[t+1],a=i<<4|s,c=n-s;let f=r[t]<<c;const u=f+(1<<c);for(;f!=u;)e[o[f]>>>15-n]=a,f++}},t.H.l=function(r,n){const e=t.H.m.r,i=15-n;for(let t=0;t<r.length;t+=2){const o=r[t]<<n-r[t+1];r[t]=e[o]>>>i}},t.H.M=function(t,r,n){n<<=7&r;const e=r>>>3;t[e]|=n,t[e+1]|=n>>>8},t.H.I=function(t,r,n){n<<=7&r;const e=r>>>3;t[e]|=n,t[e+1]|=n>>>8,t[e+2]|=n>>>16},t.H.e=function(t,r,n){return(t[r>>>3]|t[1+(r>>>3)]<<8)>>>(7&r)&(1<<n)-1},t.H.b=function(t,r,n){return(t[r>>>3]|t[1+(r>>>3)]<<8|t[2+(r>>>3)]<<16)>>>(7&r)&(1<<n)-1},t.H.Z=function(t,r){return(t[r>>>3]|t[1+(r>>>3)]<<8|t[2+(r>>>3)]<<16)>>>(7&r)},t.H.i=function(t,r){return(t[r>>>3]|t[1+(r>>>3)]<<8|t[2+(r>>>3)]<<16|t[3+(r>>>3)]<<24)>>>(7&r)},t.H.m=function(){const t=Uint16Array,r=Uint32Array;return{K:new t(16),j:new t(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[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,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new t(32),p:[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,65535,65535],z:[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,0,0],c:new r(32),J:new t(512),yt:[],h:new t(32),$:[],w:new t(32768),C:[],v:[],d:new t(32768),D:[],u:new t(512),Q:[],r:new t(32768),s:new r(286),Y:new r(30),a:new r(19),t:new r(15e3),k:new t(65536),g:new t(32768)}}(),function(){const r=t.H.m;for(var n=0;n<32768;n++){let t=n;t=(2863311530&t)>>>1|(1431655765&t)<<1,t=(3435973836&t)>>>2|(858993459&t)<<2,t=(4042322160&t)>>>4|(252645135&t)<<4,t=(4278255360&t)>>>8|(16711935&t)<<8,r.r[n]=(t>>>16|t<<16)>>>17}function e(t,r,n){for(;0!=r--;)t.push(0,n)}for(n=0;n<32;n++)r.q[n]=r.S[n]<<3|r.T[n],r.c[n]=r.p[n]<<4|r.z[n];e(r.yt,144,8),e(r.yt,112,9),e(r.yt,24,7),e(r.yt,8,8),t.H.n(r.yt,9),t.H.A(r.yt,9,r.J),t.H.l(r.yt,9),e(r.$,32,5),t.H.n(r.$,5),t.H.A(r.$,5,r.h),t.H.l(r.$,5),e(r.Q,19,0),e(r.C,286,0),e(r.D,30,0),e(r.v,320,0)}(),t.H.N}();function o(t){return[1,null,3,1,2,null,4][t.ctype]*t.depth}function s(t,r,n,e,i){let s=o(r);const c=Math.ceil(e*s/8);let f,u;s=Math.ceil(s/8);let l=t[n],h=0;if(l>1&&(t[n]=[0,0,1][l-2]),3==l)for(h=s;h<c;h++)t[h+1]=t[h+1]+(t[h+1-s]>>>1)&255;for(let r=0;r<i;r++)if(f=n+r*c,u=f+r+1,l=t[u-1],h=0,0==l)for(;h<c;h++)t[f+h]=t[u+h];else if(1==l){for(;h<s;h++)t[f+h]=t[u+h];for(;h<c;h++)t[f+h]=t[u+h]+t[f+h-s]}else if(2==l)for(;h<c;h++)t[f+h]=t[u+h]+t[f+h-c];else if(3==l){for(;h<s;h++)t[f+h]=t[u+h]+(t[f+h-c]>>>1);for(;h<c;h++)t[f+h]=t[u+h]+(t[f+h-c]+t[f+h-s]>>>1)}else{for(;h<s;h++)t[f+h]=t[u+h]+a(0,t[f+h-c],0);for(;h<c;h++)t[f+h]=t[u+h]+a(t[f+h-s],t[f+h-c],t[f+h-s-c])}return t}function a(t,r,n){const e=t+r-n,i=e-t,o=e-r,s=e-n;return i*i<=o*o&&i*i<=s*s?t:o*o<=s*s?r:n}function c(r,n,e){e.width=t.readUint(r,n),n+=4,e.height=t.readUint(r,n),n+=4,e.depth=r[n],n++,e.ctype=r[n],n++,e.compress=r[n],n++,e.filter=r[n],n++,e.interlace=r[n],n++}function f(t,r,n,e,i,o,s,a,c){const f=Math.min(r,i),u=Math.min(n,o);let l=0,h=0;for(let n=0;n<u;n++)for(let o=0;o<f;o++)if(s>=0&&a>=0?(l=n*r+o<<2,h=(a+n)*i+s+o<<2):(l=(-a+n)*r-s+o<<2,h=n*i+o<<2),0==c)e[h]=t[l],e[h+1]=t[l+1],e[h+2]=t[l+2],e[h+3]=t[l+3];else if(1==c){var A=t[l+3]*(1/255),d=t[l]*A,w=t[l+1]*A,v=t[l+2]*A,y=e[h+3]*(1/255),m=e[h]*y,p=e[h+1]*y,g=e[h+2]*y;const r=1-A,n=A+y*r,i=0==n?0:1/n;e[h+3]=255*n,e[h+0]=(d+m*r)*i,e[h+1]=(w+p*r)*i,e[h+2]=(v+g*r)*i}else if(2==c)A=t[l+3],d=t[l],w=t[l+1],v=t[l+2],y=e[h+3],m=e[h],p=e[h+1],g=e[h+2],A==y&&d==m&&w==p&&v==g?(e[h]=0,e[h+1]=0,e[h+2]=0,e[h+3]=0):(e[h]=d,e[h+1]=w,e[h+2]=v,e[h+3]=A);else if(3==c){if(A=t[l+3],d=t[l],w=t[l+1],v=t[l+2],y=e[h+3],m=e[h],p=e[h+1],g=e[h+2],A==y&&d==m&&w==p&&v==g)continue;if(A<220&&y>20)return!1}return!0}return{decode:function(r){const o=new Uint8Array(r);let s=8;const a=t,f=a.readUshort,u=a.readUint,l={tabs:{},frames:[]},h=new Uint8Array(o.length);let A,d=0,w=0;const v=[137,80,78,71,13,10,26,10];for(var y=0;y<8;y++)if(o[y]!=v[y])throw"The input is not a PNG file!";for(;s<o.length;){const t=a.readUint(o,s);s+=4;const r=a.readASCII(o,s,4);if(s+=4,"IHDR"==r)c(o,s,l);else if("iCCP"==r){for(var m=s;0!=o[m];)m++;a.readASCII(o,s,m-s);const n=o.slice(m+2,s+t);let c=null;try{c=e(n)}catch(t){c=i(n)}l.tabs[r]=c}else if("CgBI"==r)l.tabs[r]=o.slice(s,s+4);else if("IDAT"==r){for(y=0;y<t;y++)h[d+y]=o[s+y];d+=t}else if("acTL"==r)l.tabs[r]={num_frames:u(o,s),num_plays:u(o,s+4)},A=new Uint8Array(o.length);else if("fcTL"==r){0!=w&&((M=l.frames[l.frames.length-1]).data=n(l,A.slice(0,w),M.rect.width,M.rect.height),w=0);const t={x:u(o,s+12),y:u(o,s+16),width:u(o,s+4),height:u(o,s+8)};let r=f(o,s+22);r=f(o,s+20)/(0==r?100:r);const e={rect:t,delay:Math.round(1e3*r),dispose:o[s+24],blend:o[s+25]};l.frames.push(e)}else if("fdAT"==r){for(y=0;y<t-4;y++)A[w+y]=o[s+y+4];w+=t-4}else if("pHYs"==r)l.tabs[r]=[a.readUint(o,s),a.readUint(o,s+4),o[s+8]];else if("cHRM"==r)for(l.tabs[r]=[],y=0;y<8;y++)l.tabs[r].push(a.readUint(o,s+4*y));else if("tEXt"==r||"zTXt"==r){null==l.tabs[r]&&(l.tabs[r]={});var p=a.nextZero(o,s),g=a.readASCII(o,s,p-s),E=s+t-p-1;if("tEXt"==r)U=a.readASCII(o,p+1,E);else{var b=e(o.slice(p+2,p+2+E));U=a.readUTF8(b,0,b.length)}l.tabs[r][g]=U}else if("iTXt"==r){null==l.tabs[r]&&(l.tabs[r]={}),p=0,m=s,p=a.nextZero(o,m),g=a.readASCII(o,m,p-m);const n=o[m=p+1];var U;m+=2,p=a.nextZero(o,m),a.readASCII(o,m,p-m),m=p+1,p=a.nextZero(o,m),a.readUTF8(o,m,p-m),E=t-((m=p+1)-s),0==n?U=a.readUTF8(o,m,E):(b=e(o.slice(m,m+E)),U=a.readUTF8(b,0,b.length)),l.tabs[r][g]=U}else if("PLTE"==r)l.tabs[r]=a.readBytes(o,s,t);else if("hIST"==r){const t=l.tabs.PLTE.length/3;for(l.tabs[r]=[],y=0;y<t;y++)l.tabs[r].push(f(o,s+2*y))}else if("tRNS"==r)3==l.ctype?l.tabs[r]=a.readBytes(o,s,t):0==l.ctype?l.tabs[r]=f(o,s):2==l.ctype&&(l.tabs[r]=[f(o,s),f(o,s+2),f(o,s+4)]);else if("gAMA"==r)l.tabs[r]=a.readUint(o,s)/1e5;else if("sRGB"==r)l.tabs[r]=o[s];else if("bKGD"==r)0==l.ctype||4==l.ctype?l.tabs[r]=[f(o,s)]:2==l.ctype||6==l.ctype?l.tabs[r]=[f(o,s),f(o,s+2),f(o,s+4)]:3==l.ctype&&(l.tabs[r]=o[s]);else if("IEND"==r)break;s+=t,a.readUint(o,s),s+=4}var M;return 0!=w&&((M=l.frames[l.frames.length-1]).data=n(l,A.slice(0,w),M.rect.width,M.rect.height)),l.data=n(l,h,l.width,l.height),delete l.compress,delete l.interlace,delete l.filter,l},toRGBA8:function(t){const n=t.width,e=t.height;if(null==t.tabs.acTL)return[r(t.data,n,e,t).buffer];const i=[];null==t.frames[0].data&&(t.frames[0].data=t.data);const o=n*e*4,s=new Uint8Array(o),a=new Uint8Array(o),c=new Uint8Array(o);for(let l=0;l<t.frames.length;l++){const h=t.frames[l],A=h.rect.x,d=h.rect.y,w=h.rect.width,v=h.rect.height,y=r(h.data,w,v,t);if(0!=l)for(var u=0;u<o;u++)c[u]=s[u];if(0==h.blend?f(y,w,v,s,n,e,A,d,0):1==h.blend&&f(y,w,v,s,n,e,A,d,1),i.push(s.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)f(a,w,v,s,n,e,A,d,0);else if(2==h.dispose)for(u=0;u<o;u++)s[u]=c[u]}return i},gt:a,Et:f,bt:t}}();!function(){const{Et:t}=c,{bt:r}=c,n=c.gt;var e={table:function(){const t=new Uint32Array(256);for(let r=0;r<256;r++){let n=r;for(let t=0;t<8;t++)1&n?n=3988292384^n>>>1:n>>>=1;t[r]=n}return t}(),update(t,r,n,i){for(let o=0;o<i;o++)t=e.table[255&(t^r[n+o])]^t>>>8;return t},crc:(t,r,n)=>4294967295^e.update(4294967295,t,r,n)};function i(t,r,n,e){r[n]+=t[0]*e>>4,r[n+1]+=t[1]*e>>4,r[n+2]+=t[2]*e>>4,r[n+3]+=t[3]*e>>4}function o(t){return Math.max(0,Math.min(255,t))}function s(t,r){const n=t[0]-r[0],e=t[1]-r[1],i=t[2]-r[2],o=t[3]-r[3];return n*n+e*e+i*i+o*o}function f(t,r,n,e,a,c,f){null==f&&(f=1);const u=e.length,l=[];for(var h=0;h<u;h++){const t=e[h];l.push([t>>>0&255,t>>>8&255,t>>>16&255,t>>>24&255])}for(h=0;h<u;h++){let t=4294967295;for(var A=0,d=0;d<u;d++){var w=s(l[h],l[d]);d!=h&&w<t&&(t=w,A=d)}}const v=new Uint32Array(a.buffer),y=new Int16Array(r*n*4),m=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<m.length;h++)m[h]=255*((m[h]+.5)/16-.5);for(let a=0;a<n;a++)for(let g=0;g<r;g++){var p;h=4*(a*r+g),2!=f?p=[o(t[h]+y[h]),o(t[h+1]+y[h+1]),o(t[h+2]+y[h+2]),o(t[h+3]+y[h+3])]:(w=m[4*(3&a)+(3&g)],p=[o(t[h]+w),o(t[h+1]+w),o(t[h+2]+w),o(t[h+3]+w)]),A=0;let E=16777215;for(d=0;d<u;d++){const t=s(p,l[d]);t<E&&(E=t,A=d)}const b=l[A],U=[p[0]-b[0],p[1]-b[1],p[2]-b[2],p[3]-b[3]];1==f&&(g!=r-1&&i(U,y,h+4,7),a!=n-1&&(0!=g&&i(U,y,h+4*r-4,3),i(U,y,h+4*r,5),g!=r-1&&i(U,y,h+4*r+4,1))),c[h>>2]=A,v[h>>2]=e[A]}}function u(t,n,i,o,s){null==s&&(s={});const{crc:a}=e,c=r.writeUint,f=r.writeUshort,u=r.writeASCII;let l=8;const h=t.frames.length>1;let A,d=!1,w=33+(h?20:0);if(null!=s.sRGB&&(w+=13),null!=s.pHYs&&(w+=21),null!=s.iCCP&&(A=pako.deflate(s.iCCP),w+=21+A.length+4),3==t.ctype){for(var v=t.plte.length,y=0;y<v;y++)t.plte[y]>>>24!=255&&(d=!0);w+=8+3*v+4+(d?8+1*v+4:0)}for(var m=0;m<t.frames.length;m++)h&&(w+=38),w+=(b=t.frames[m]).cimg.length+12,0!=m&&(w+=4);w+=12;const p=new Uint8Array(w),g=[137,80,78,71,13,10,26,10];for(y=0;y<8;y++)p[y]=g[y];if(c(p,l,13),l+=4,u(p,l,"IHDR"),l+=4,c(p,l,n),l+=4,c(p,l,i),l+=4,p[l]=t.depth,l++,p[l]=t.ctype,l++,p[l]=0,l++,p[l]=0,l++,p[l]=0,l++,c(p,l,a(p,l-17,17)),l+=4,null!=s.sRGB&&(c(p,l,1),l+=4,u(p,l,"sRGB"),l+=4,p[l]=s.sRGB,l++,c(p,l,a(p,l-5,5)),l+=4),null!=s.iCCP){const t=13+A.length;c(p,l,t),l+=4,u(p,l,"iCCP"),l+=4,u(p,l,"ICC profile"),l+=11,l+=2,p.set(A,l),l+=A.length,c(p,l,a(p,l-(t+4),t+4)),l+=4}if(null!=s.pHYs&&(c(p,l,9),l+=4,u(p,l,"pHYs"),l+=4,c(p,l,s.pHYs[0]),l+=4,c(p,l,s.pHYs[1]),l+=4,p[l]=s.pHYs[2],l++,c(p,l,a(p,l-13,13)),l+=4),h&&(c(p,l,8),l+=4,u(p,l,"acTL"),l+=4,c(p,l,t.frames.length),l+=4,c(p,l,null!=s.loop?s.loop:0),l+=4,c(p,l,a(p,l-12,12)),l+=4),3==t.ctype){for(c(p,l,3*(v=t.plte.length)),l+=4,u(p,l,"PLTE"),l+=4,y=0;y<v;y++){const r=3*y,n=t.plte[y],e=255&n,i=n>>>8&255,o=n>>>16&255;p[l+r+0]=e,p[l+r+1]=i,p[l+r+2]=o}if(l+=3*v,c(p,l,a(p,l-3*v-4,3*v+4)),l+=4,d){for(c(p,l,v),l+=4,u(p,l,"tRNS"),l+=4,y=0;y<v;y++)p[l+y]=t.plte[y]>>>24&255;l+=v,c(p,l,a(p,l-v-4,v+4)),l+=4}}let E=0;for(m=0;m<t.frames.length;m++){var b=t.frames[m];h&&(c(p,l,26),l+=4,u(p,l,"fcTL"),l+=4,c(p,l,E++),l+=4,c(p,l,b.rect.width),l+=4,c(p,l,b.rect.height),l+=4,c(p,l,b.rect.x),l+=4,c(p,l,b.rect.y),l+=4,f(p,l,o[m]),l+=2,f(p,l,1e3),l+=2,p[l]=b.dispose,l++,p[l]=b.blend,l++,c(p,l,a(p,l-30,30)),l+=4);const r=b.cimg;c(p,l,(v=r.length)+(0==m?0:4)),l+=4;const n=l;u(p,l,0==m?"IDAT":"fdAT"),l+=4,0!=m&&(c(p,l,E++),l+=4),p.set(r,l),l+=v,c(p,l,a(p,n,l-n)),l+=4}return c(p,l,0),l+=4,u(p,l,"IEND"),l+=4,c(p,l,a(p,l-4,4)),l+=4,p.buffer}function l(t,r,n){for(let e=0;e<t.frames.length;e++){const i=t.frames[e],o=i.rect.height,s=new Uint8Array(o*i.bpl+o);i.cimg=w(i.img,o,i.bpp,i.bpl,s,r,n)}}function h(r,n,e,i,o){const s=o[0],a=o[1],c=o[2],u=o[3],l=o[4],h=o[5];let w=6,v=8,m=255;for(var p=0;p<r.length;p++){const t=new Uint8Array(r[p]);for(var g=t.length,E=0;E<g;E+=4)m&=t[E+3]}const b=255!=m,U=function(r,n,e,i,o,s){const a=[];for(var c=0;c<r.length;c++){const l=new Uint8Array(r[c]),A=new Uint32Array(l.buffer);var f;let w=0,v=0,y=n,m=e,p=i?1:0;if(0!=c){const g=s||i||1==c||0!=a[c-2].dispose?1:2;let E=0,b=1e9;for(let t=0;t<g;t++){var u=new Uint8Array(r[c-1-t]);const i=new Uint32Array(r[c-1-t]);let s=n,a=e,f=-1,l=-1;for(let t=0;t<e;t++)for(let r=0;r<n;r++)A[h=t*n+r]!=i[h]&&(r<s&&(s=r),r>f&&(f=r),t<a&&(a=t),t>l&&(l=t));-1==f&&(s=a=f=l=0),o&&(!(1&~s)&&s--,!(1&~a)&&a--);const d=(f-s+1)*(l-a+1);d<b&&(b=d,E=t,w=s,v=a,y=f-s+1,m=l-a+1)}u=new Uint8Array(r[c-1-E]),1==E&&(a[c-1].dispose=2),f=new Uint8Array(y*m*4),t(u,n,e,f,y,m,-w,-v,0),p=t(l,n,e,f,y,m,-w,-v,3)?1:0,1==p?d(l,n,e,f,{x:w,y:v,width:y,height:m}):t(l,n,e,f,y,m,-w,-v,0)}else f=l.slice(0);a.push({rect:{x:w,y:v,width:y,height:m},img:f,blend:p,dispose:0})}if(i)for(c=0;c<a.length;c++){if(1==(w=a[c]).blend)continue;const t=w.rect,i=a[c-1].rect,s=Math.min(t.x,i.x),f=Math.min(t.y,i.y),u={x:s,y:f,width:Math.max(t.x+t.width,i.x+i.width)-s,height:Math.max(t.y+t.height,i.y+i.height)-f};a[c-1].dispose=1,c-1!=0&&A(r,n,e,a,c-1,u,o),A(r,n,e,a,c,u,o)}let l=0;if(1!=r.length)for(var h=0;h<a.length;h++){var w;l+=(w=a[h]).rect.width*w.rect.height}return a}(r,n,e,s,a,c),M={},I=[],B=[];if(0!=i){const t=[];for(E=0;E<U.length;E++)t.push(U[E].img.buffer);const r=function(t){let r=0;for(var n=0;n<t.length;n++)r+=t[n].byteLength;const e=new Uint8Array(r);let i=0;for(n=0;n<t.length;n++){const r=new Uint8Array(t[n]),o=r.length;for(let t=0;t<o;t+=4){let n=r[t],o=r[t+1],s=r[t+2];const a=r[t+3];0==a&&(n=o=s=0),e[i+t]=n,e[i+t+1]=o,e[i+t+2]=s,e[i+t+3]=a}i+=o}return e.buffer}(t),n=y(r,i);for(E=0;E<n.plte.length;E++)I.push(n.plte[E].est.rgba);let e=0;for(E=0;E<U.length;E++){const t=(D=U[E]).img.length;var C=new Uint8Array(n.inds.buffer,e>>2,t>>2);B.push(C);const r=new Uint8Array(n.abuf,e,t);h&&f(D.img,D.rect.width,D.rect.height,I,r,C),D.img.set(r),e+=t}}else for(p=0;p<U.length;p++){var D=U[p];const t=new Uint32Array(D.img.buffer);var Q=D.rect.width;for(g=t.length,C=new Uint8Array(g),B.push(C),E=0;E<g;E++){const r=t[E];if(0!=E&&r==t[E-1])C[E]=C[E-1];else if(E>Q&&r==t[E-Q])C[E]=C[E-Q];else{let t=M[r];if(null==t&&(M[r]=t=I.length,I.push(r),I.length>=300))break;C[E]=t}}}const k=I.length;for(k<=256&&0==l&&(v=k<=2?1:k<=4?2:k<=16?4:8,v=Math.max(v,u)),p=0;p<U.length;p++){(D=U[p]).rect.x,Q=D.rect.width;const t=D.rect.height;let r=D.img,n=4*Q,e=4;if(k<=256&&0==l){n=Math.ceil(v*Q/8);var R=new Uint8Array(n*t);const i=B[p];for(let r=0;r<t;r++){E=r*n;const t=r*Q;if(8==v)for(var S=0;S<Q;S++)R[E+S]=i[t+S];else if(4==v)for(S=0;S<Q;S++)R[E+(S>>1)]|=i[t+S]<<4-4*(1&S);else if(2==v)for(S=0;S<Q;S++)R[E+(S>>2)]|=i[t+S]<<6-2*(3&S);else if(1==v)for(S=0;S<Q;S++)R[E+(S>>3)]|=i[t+S]<<7-1*(7&S)}r=R,w=3,e=1}else if(0==b&&1==U.length){R=new Uint8Array(Q*t*3);const i=Q*t;for(E=0;E<i;E++){const t=3*E,n=4*E;R[t]=r[n],R[t+1]=r[n+1],R[t+2]=r[n+2]}r=R,w=2,e=3,n=3*Q}D.img=r,D.bpl=n,D.bpp=e}return{ctype:w,depth:v,plte:I,frames:U}}function A(r,n,e,i,o,s,a){const c=Uint8Array,f=Uint32Array,u=new c(r[o-1]),l=new f(r[o-1]),h=o+1<r.length?new c(r[o+1]):null,A=new c(r[o]),w=new f(A.buffer);let v=n,y=e,m=-1,p=-1;for(let t=0;t<s.height;t++)for(let r=0;r<s.width;r++){const e=s.x+r,a=s.y+t,c=a*n+e,f=w[c];0==f||0==i[o-1].dispose&&l[c]==f&&(null==h||0!=h[4*c+3])||(e<v&&(v=e),e>m&&(m=e),a<y&&(y=a),a>p&&(p=a))}-1==m&&(v=y=m=p=0),a&&(!(1&~v)&&v--,!(1&~y)&&y--),s={x:v,y:y,width:m-v+1,height:p-y+1};const g=i[o];g.rect=s,g.blend=1,g.img=new Uint8Array(s.width*s.height*4),0==i[o-1].dispose?(t(u,n,e,g.img,s.width,s.height,-s.x,-s.y,0),d(A,n,e,g.img,s)):t(A,n,e,g.img,s.width,s.height,-s.x,-s.y,0)}function d(r,n,e,i,o){t(r,n,e,i,o.width,o.height,-o.x,-o.y,2)}function w(t,r,n,e,i,o,s){const c=[];let f,u=[0,1,2,3,4];-1!=o?u=[o]:(r*e>5e5||1==n)&&(u=[0]),s&&(f={level:0});const l=a;for(var h=0;h<u.length;h++){for(let o=0;o<r;o++)v(i,t,o,e,n,u[h]);c.push(l.deflate(i,f))}let A,d=1e9;for(h=0;h<c.length;h++)c[h].length<d&&(A=h,d=c[h].length);return c[A]}function v(t,r,e,i,o,s){const a=e*i;let c=a+e;if(t[c]=s,c++,0==s)if(i<500)for(var f=0;f<i;f++)t[c+f]=r[a+f];else t.set(new Uint8Array(r.buffer,a,i),c);else if(1==s){for(f=0;f<o;f++)t[c+f]=r[a+f];for(f=o;f<i;f++)t[c+f]=r[a+f]-r[a+f-o]+256&255}else if(0==e){for(f=0;f<o;f++)t[c+f]=r[a+f];if(2==s)for(f=o;f<i;f++)t[c+f]=r[a+f];if(3==s)for(f=o;f<i;f++)t[c+f]=r[a+f]-(r[a+f-o]>>1)+256&255;if(4==s)for(f=o;f<i;f++)t[c+f]=r[a+f]-n(r[a+f-o],0,0)+256&255}else{if(2==s)for(f=0;f<i;f++)t[c+f]=r[a+f]+256-r[a+f-i]&255;if(3==s){for(f=0;f<o;f++)t[c+f]=r[a+f]+256-(r[a+f-i]>>1)&255;for(f=o;f<i;f++)t[c+f]=r[a+f]+256-(r[a+f-i]+r[a+f-o]>>1)&255}if(4==s){for(f=0;f<o;f++)t[c+f]=r[a+f]+256-n(0,r[a+f-i],0)&255;for(f=o;f<i;f++)t[c+f]=r[a+f]+256-n(r[a+f-o],r[a+f-i],r[a+f-o-i])&255}}}function y(t,r){const n=new Uint8Array(t),e=n.slice(0),i=new Uint32Array(e.buffer),o=m(e,r),s=o[0],a=o[1],c=n.length,f=new Uint8Array(c>>2);let u;if(n.length<2e7)for(var l=0;l<c;l+=4)u=p(s,h=n[l]*(1/255),A=n[l+1]*(1/255),d=n[l+2]*(1/255),w=n[l+3]*(1/255)),f[l>>2]=u.ind,i[l>>2]=u.est.rgba;else for(l=0;l<c;l+=4){var h=n[l]*(1/255),A=n[l+1]*(1/255),d=n[l+2]*(1/255),w=n[l+3]*(1/255);for(u=s;u.left;)u=g(u.est,h,A,d,w)<=0?u.left:u.right;f[l>>2]=u.ind,i[l>>2]=u.est.rgba}return{abuf:e.buffer,inds:f,plte:a}}function m(t,r,n){null==n&&(n=1e-4);const e=new Uint32Array(t.buffer),i={i0:0,i1:t.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=U(t,i.i0,i.i1),i.est=M(i.bst);const o=[i];for(;o.length<r;){let r=0,i=0;for(var s=0;s<o.length;s++)o[s].est.L>r&&(r=o[s].est.L,i=s);if(r<n)break;const a=o[i],c=E(t,e,a.i0,a.i1,a.est.e,a.est.eMq255);if(a.i0>=c||a.i1<=c){a.est.L=0;continue}const f={i0:a.i0,i1:c,bst:null,est:null,tdst:0,left:null,right:null};f.bst=U(t,f.i0,f.i1),f.est=M(f.bst);const u={i0:c,i1:a.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:a.bst.N-f.bst.N},s=0;s<16;s++)u.bst.R[s]=a.bst.R[s]-f.bst.R[s];for(s=0;s<4;s++)u.bst.m[s]=a.bst.m[s]-f.bst.m[s];u.est=M(u.bst),a.left=f,a.right=u,o[i]=f,o.push(u)}for(o.sort(((t,r)=>r.bst.N-t.bst.N)),s=0;s<o.length;s++)o[s].ind=s;return[i,o]}function p(t,r,n,e,i){if(null==t.left)return t.tdst=function(t,r,n,e,i){const o=r-t[0],s=n-t[1],a=e-t[2],c=i-t[3];return o*o+s*s+a*a+c*c}(t.est.q,r,n,e,i),t;const o=g(t.est,r,n,e,i);let s=t.left,a=t.right;o>0&&(s=t.right,a=t.left);const c=p(s,r,n,e,i);if(c.tdst<=o*o)return c;const f=p(a,r,n,e,i);return f.tdst<c.tdst?f:c}function g(t,r,n,e,i){const{e:o}=t;return o[0]*r+o[1]*n+o[2]*e+o[3]*i-t.eMq}function E(t,r,n,e,i,o){for(e-=4;n<e;){for(;b(t,n,i)<=o;)n+=4;for(;b(t,e,i)>o;)e-=4;if(n>=e)break;const s=r[n>>2];r[n>>2]=r[e>>2],r[e>>2]=s,n+=4,e-=4}for(;b(t,n,i)>o;)n-=4;return n+4}function b(t,r,n){return t[r]*n[0]+t[r+1]*n[1]+t[r+2]*n[2]+t[r+3]*n[3]}function U(t,r,n){const e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=n-r>>2;for(let o=r;o<n;o+=4){const r=t[o]*(1/255),n=t[o+1]*(1/255),s=t[o+2]*(1/255),a=t[o+3]*(1/255);i[0]+=r,i[1]+=n,i[2]+=s,i[3]+=a,e[0]+=r*r,e[1]+=r*n,e[2]+=r*s,e[3]+=r*a,e[5]+=n*n,e[6]+=n*s,e[7]+=n*a,e[10]+=s*s,e[11]+=s*a,e[15]+=a*a}return e[4]=e[1],e[8]=e[2],e[9]=e[6],e[12]=e[3],e[13]=e[7],e[14]=e[11],{R:e,m:i,N:o}}function M(t){const{R:r}=t,{m:n}=t,{N:e}=t,i=n[0],o=n[1],s=n[2],a=n[3],c=0==e?0:1/e,f=[r[0]-i*i*c,r[1]-i*o*c,r[2]-i*s*c,r[3]-i*a*c,r[4]-o*i*c,r[5]-o*o*c,r[6]-o*s*c,r[7]-o*a*c,r[8]-s*i*c,r[9]-s*o*c,r[10]-s*s*c,r[11]-s*a*c,r[12]-a*i*c,r[13]-a*o*c,r[14]-a*s*c,r[15]-a*a*c],u=f,l=I;let h=[Math.random(),Math.random(),Math.random(),Math.random()],A=0,d=0;if(0!=e)for(let t=0;t<16&&(h=l.multVec(u,h),d=Math.sqrt(l.dot(h,h)),h=l.sml(1/d,h),!(0!=t&&Math.abs(d-A)<1e-9));t++)A=d;const w=[i*c,o*c,s*c,a*c];return{Cov:f,q:w,e:h,L:A,eMq255:l.dot(l.sml(255,w),h),eMq:l.dot(h,w),rgba:(Math.round(255*w[3])<<24|Math.round(255*w[2])<<16|Math.round(255*w[1])<<8|Math.round(255*w[0]))>>>0}}var I={multVec:(t,r)=>[t[0]*r[0]+t[1]*r[1]+t[2]*r[2]+t[3]*r[3],t[4]*r[0]+t[5]*r[1]+t[6]*r[2]+t[7]*r[3],t[8]*r[0]+t[9]*r[1]+t[10]*r[2]+t[11]*r[3],t[12]*r[0]+t[13]*r[1]+t[14]*r[2]+t[15]*r[3]],dot:(t,r)=>t[0]*r[0]+t[1]*r[1]+t[2]*r[2]+t[3]*r[3],sml:(t,r)=>[t*r[0],t*r[1],t*r[2],t*r[3]]};c.encode=function(t,r,n,e,i,o,s){null==e&&(e=0),null==s&&(s=!1);const a=h(t,r,n,e,[!1,!1,!1,0,s,!1]);return l(a,-1),u(a,r,n,i,o)},c.encodeLL=function(t,r,n,e,i,o,s,a){const c={ctype:0+(1==e?0:2)+(0==i?0:4),depth:o,frames:[]},f=(e+i)*o,h=f*r;for(let e=0;e<t.length;e++)c.frames.push({rect:{x:0,y:0,width:r,height:n},img:new Uint8Array(t[e]),blend:0,dispose:1,bpp:Math.ceil(f/8),bpl:Math.ceil(h/8)});return l(c,0,!0),u(c,r,n,s,a)},c.encode.compress=h,c.encode.dither=f,c.quantize=y,c.quantize.getKDtree=m,c.quantize.getNearest=p}();const f={toArrayBuffer(t,r){const n=t.width,e=t.height,i=n<<2,o=t.getContext("2d").getImageData(0,0,n,e),s=new Uint32Array(o.data.buffer),a=(32*n+31)/32<<2,c=a*e,u=122+c,l=new ArrayBuffer(u),h=new DataView(l),A=1<<20;let d,w,v,y,m=A,p=0,g=0,E=0;function b(t){h.setUint16(g,t,!0),g+=2}function U(t){h.setUint32(g,t,!0),g+=4}function M(t){g+=t}b(19778),U(u),M(4),U(122),U(108),U(n),U(-e>>>0),b(1),b(32),U(3),U(c),U(2835),U(2835),M(8),U(16711680),U(65280),U(255),U(4278190080),U(1466527264),function t(){for(;p<e&&m>0;){for(y=122+p*a,d=0;d<i;)m--,w=s[E++],v=w>>>24,h.setUint32(y+d,w<<8|v),d+=4;p++}E<s.length?(m=A,setTimeout(t,f.Ut)):r(l)}()},toBlob(t,r){this.toArrayBuffer(t,(t=>{r(new Blob([t],{type:"image/bmp"}))}))},Ut:9};var u={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},l={[u.CHROME]:16384,[u.FIREFOX]:11180,[u.DESKTOP_SAFARI]:16384,[u.IE]:8192,[u.IOS]:4096,[u.ETC]:8192};const h="undefined"!=typeof window,A="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,d=h&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),w=(h||A)&&(d&&d.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),v=(h||A)&&(d&&d.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function y(t,r,n=Date.now()){return new Promise((e=>{const i=t.split(","),o=i[0].match(/:(.*?);/)[1],s=globalThis.atob(i[1]);let a=s.length;const c=new Uint8Array(a);for(;a--;)c[a]=s.charCodeAt(a);const f=new Blob([c],{type:o});f.name=r,f.lastModified=n,e(f)}))}function m(t){return new Promise(((r,n)=>{const e=new v;e.onload=()=>r(e.result),e.onerror=t=>n(t),e.readAsDataURL(t)}))}function p(t){return new Promise(((r,n)=>{const e=new Image;e.onload=()=>r(e),e.onerror=t=>n(t),e.src=t}))}function g(){if(void 0!==g.cachedResult)return g.cachedResult;let t=u.ETC;const{userAgent:r}=navigator;return/Chrom(e|ium)/i.test(r)?t=u.CHROME:/iP(ad|od|hone)/i.test(r)&&/WebKit/i.test(r)?t=u.IOS:/Safari/i.test(r)?t=u.DESKTOP_SAFARI:/Firefox/i.test(r)?t=u.FIREFOX:(/MSIE/i.test(r)||1==!!document.documentMode)&&(t=u.IE),g.cachedResult=t,g.cachedResult}function E(t,r){const n=g(),e=l[n];let i=t,o=r,s=i*o;const a=i>o?o/i:i/o;for(;s>e*e;){const t=(e+i)/2,r=(e+o)/2;t<r?(o=r,i=r*a):(o=t*a,i=t),s=i*o}return{width:i,height:o}}function b(t,r){let n,e;try{if(n=new OffscreenCanvas(t,r),e=n.getContext("2d"),null===e)throw Error("getContext of OffscreenCanvas returns null")}catch(t){n=document.createElement("canvas"),e=n.getContext("2d")}return n.width=t,n.height=r,[n,e]}function U(t,r){const{width:n,height:e}=E(t.width,t.height),[i,o]=b(n,e);return r&&/jpe?g/.test(r)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(t,0,0,i.width,i.height),i}function M(){return void 0!==M.cachedResult||(M.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),M.cachedResult}function I(t,r={}){return new Promise((function(n,e){let i,o;var s=function(){try{return o=U(i,r.fileType||t.type),n([i,o])}catch(t){return e(t)}},a=function(r){try{var n=function(t){try{throw t}catch(t){return e(t)}};try{let r;return m(t).then((function(t){try{return r=t,p(r).then((function(t){try{return i=t,function(){try{return s()}catch(t){return e(t)}}()}catch(t){return n(t)}}),n)}catch(t){return n(t)}}),n)}catch(t){n(t)}}catch(t){return e(t)}};try{if(M()||[u.DESKTOP_SAFARI,u.MOBILE_SAFARI].includes(g()))throw Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(t).then((function(t){try{return i=t,s()}catch(t){return a()}}),a)}catch(t){a()}}))}function B(t,r,n,e,i=1){return new Promise((function(o,s){let a;if("image/png"===r){let l,h,A;return l=t.getContext("2d"),({data:h}=l.getImageData(0,0,t.width,t.height)),A=c.encode([h.buffer],t.width,t.height,4096*i),a=new Blob([A],{type:r}),a.name=n,a.lastModified=e,u()}{if("image/bmp"===r)return new Promise((r=>f.toBlob(t,r))).then(function(t){try{return a=t,a.name=n,a.lastModified=e,d()}catch(t){return s(t)}}.bind(this),s);{if("function"==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)return t.convertToBlob({type:r,quality:i}).then(function(t){try{return a=t,a.name=n,a.lastModified=e,w()}catch(t){return s(t)}}.bind(this),s);{let v;return v=t.toDataURL(r,i),y(v,n,e).then(function(t){try{return a=t,w()}catch(t){return s(t)}}.bind(this),s)}function w(){return d()}}function d(){return u()}}function u(){return o(a)}}))}function C(t){t.width=0,t.height=0}function D(){return new Promise((function(t,r){let n,e,i,o;return void 0!==D.cachedResult?t(D.cachedResult):y("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(s){try{return n=s,I(n).then((function(s){try{return e=s[1],B(e,n.type,n.name,n.lastModified).then((function(n){try{return i=n,C(e),I(i).then((function(n){try{return o=n[0],D.cachedResult=1===o.width&&2===o.height,t(D.cachedResult)}catch(t){return r(t)}}),r)}catch(t){return r(t)}}),r)}catch(t){return r(t)}}),r)}catch(t){return r(t)}}),r)}))}function Q(t){return new Promise(((r,n)=>{const e=new v;e.onload=t=>{const n=new DataView(t.target.result);if(65496!=n.getUint16(0,!1))return r(-2);const e=n.byteLength;let i=2;for(;i<e;){if(n.getUint16(i+2,!1)<=8)return r(-1);const t=n.getUint16(i,!1);if(i+=2,65505==t){if(1165519206!=n.getUint32(i+=2,!1))return r(-1);const t=18761==n.getUint16(i+=6,!1);i+=n.getUint32(i+4,t);const e=n.getUint16(i,t);i+=2;for(let o=0;o<e;o++)if(274==n.getUint16(i+12*o,t))return r(n.getUint16(i+12*o+8,t))}else{if(65280&~t)break;i+=n.getUint16(i,!1)}}return r(-1)},e.onerror=t=>n(t),e.readAsArrayBuffer(t)}))}function k(t,r){const{width:n}=t,{height:e}=t,{maxWidthOrHeight:i}=r;let o,s=t;return isFinite(i)&&(n>i||e>i)&&([s,o]=b(n,e),n>e?(s.width=i,s.height=e/n*i):(s.width=n/e*i,s.height=i),o.drawImage(t,0,0,s.width,s.height),C(t)),s}function R(t,r){const{width:n}=t,{height:e}=t,[i,o]=b(n,e);switch(r>4&&r<9?(i.width=e,i.height=n):(i.width=n,i.height=e),r){case 2:o.transform(-1,0,0,1,n,0);break;case 3:o.transform(-1,0,0,-1,n,e);break;case 4:o.transform(1,0,0,-1,0,e);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,e,0);break;case 7:o.transform(0,-1,-1,0,e,n);break;case 8:o.transform(0,-1,1,0,0,n)}return o.drawImage(t,0,0,n,e),C(t),i}function S(t,r,n=0){return new Promise((function(e,i){let o,s,a,c,f,u,l,h,A,d,w,v,y,m,p,g,E,U,M,S;function T(t=5){if(r.signal&&r.signal.aborted)throw r.signal.reason;o+=t,r.onProgress(Math.min(o,100))}function x(t){if(r.signal&&r.signal.aborted)throw r.signal.reason;o=Math.min(Math.max(t,o),100),r.onProgress(o)}return o=n,s=r.maxIteration||10,a=1024*r.maxSizeMB*1024,T(),I(t,r).then(function(n){try{return[,c]=n,T(),f=k(c,r),T(),new Promise((function(n,e){var i;if(!(i=r.exifOrientation))return Q(t).then(function(t){try{return i=t,o()}catch(t){return e(t)}}.bind(this),e);function o(){return n(i)}return o()})).then(function(n){try{return u=n,T(),D().then(function(n){try{return l=n?f:R(f,u),T(),h=r.initialQuality||1,A=r.fileType||t.type,B(l,A,t.name,t.lastModified,h).then(function(n){try{{if(d=n,T(),w=d.size>a,v=d.size>t.size,!w&&!v)return x(100),e(d);var o;function u(){if(s--&&(p>a||p>y)){let r,n;return r=S?.95*M.width:M.width,n=S?.95*M.height:M.height,[E,U]=b(r,n),U.drawImage(M,0,0,r,n),h*="image/png"===A?.85:.95,B(E,A,t.name,t.lastModified,h).then((function(t){try{return g=t,C(M),M=E,p=g.size,x(Math.min(99,Math.floor((m-p)/(m-a)*100))),u}catch(t){return i(t)}}),i)}return[1]}return y=t.size,m=d.size,p=m,M=l,S=!r.alwaysKeepResolution&&w,(o=function(t){for(;t;){if(t.then)return void t.then(o,i);try{if(t.pop){if(t.length)return t.pop()?(C(M),C(E),C(f),C(l),C(c),x(100),e(g)):t;t=u}else t=t.call(this)}catch(t){return i(t)}