(()=>{var Ie;(function(){Ie=function(){var U,h,M,D,B,k,V,J;S.load=function(e,t,o){var f,n=this;return typeof t=="function"&&(o=t),f=new XMLHttpRequest,f.open("GET",e,!0),f.responseType="arraybuffer",f.onload=function(){var s,b;return s=new Uint8Array(f.response||f.mozResponseArrayBuffer),b=new S(s),typeof t?.getContext=="function"&&b.render(t),typeof o=="function"?o(b):void 0},f.send(null)},D=0,M=1,B=2,h=0,U=1;function S(e){var t,o,f,n,s,b,g,d,Z,X,re,O,G,K;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(t=this.readUInt32(),Z=function(){var a,u;for(u=[],b=a=0;a<4;b=++a)u.push(String.fromCharCode(this.data[this.pos++]));return u}.call(this).join(""),Z){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(t);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},n=this.readUInt16(),f=this.readUInt16()||100,s.delay=1e3*n/f,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for(Z==="fdAT"&&(this.pos+=4,t-=4),e=s?.data||this.imgData,b=O=0;0<=t?O<t:O>t;b=0<=t?++O:--O)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(t),X=255-this.transparency.indexed.length,X>0)for(b=G=0;0<=X?G<X:G>X;b=0<=X?++G:--G)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":re=this.read(t),g=re.indexOf(0),d=String.fromCharCode.apply(String,re.slice(0,g)),this.text[d]=String.fromCharCode.apply(String,re.slice(g+1));break;case"IEND":s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(K=this.colorType)===4||K===6,o=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*o,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),this.imgData=new Uint8Array(this.imgData);return;default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return S.prototype.read=function(e){var t,o,f;for(f=[],t=o=0;0<=e?o<e:o>e;t=0<=e?++o:--o)f.push(this.data[this.pos++]);return f},S.prototype.readUInt32=function(){var e,t,o,f;return e=this.data[this.pos++]<<24,t=this.data[this.pos++]<<16,o=this.data[this.pos++]<<8,f=this.data[this.pos++],e|t|o|f},S.prototype.readUInt16=function(){var e,t;return e=this.data[this.pos++]<<8,t=this.data[this.pos++],e|t},S.prototype.decodePixels=function(e){var t,o,f,n,s,b,g,d,Z,X,re,O,G,K,a,u,r,y,c,P,v,C,T;if(e==null&&(e=this.imgData),e.length===0)return new Uint8Array(0);for(e=new FlateStream(e),e=e.getBytes(),O=this.pixelBitlength/8,u=O*this.width,G=new Uint8Array(u*this.height),b=e.length,a=0,K=0,o=0;K<b;){switch(e[K++]){case 0:for(n=c=0;c<u;n=c+=1)G[o++]=e[K++];break;case 1:for(n=P=0;P<u;n=P+=1)t=e[K++],s=n<O?0:G[o-O],G[o++]=(t+s)%256;break;case 2:for(n=v=0;v<u;n=v+=1)t=e[K++],f=(n-n%O)/O,r=a&&G[(a-1)*u+f*O+n%O],G[o++]=(r+t)%256;break;case 3:for(n=C=0;C<u;n=C+=1)t=e[K++],f=(n-n%O)/O,s=n<O?0:G[o-O],r=a&&G[(a-1)*u+f*O+n%O],G[o++]=(t+Math.floor((s+r)/2))%256;break;case 4:for(n=T=0;T<u;n=T+=1)t=e[K++],f=(n-n%O)/O,s=n<O?0:G[o-O],a===0?r=y=0:(r=G[(a-1)*u+f*O+n%O],y=f&&G[(a-1)*u+(f-1)*O+n%O]),g=s+r-y,d=Math.abs(g-s),X=Math.abs(g-r),re=Math.abs(g-y),d<=X&&d<=re?Z=s:X<=re?Z=r:Z=y,G[o++]=(t+Z)%256;break;default:throw new Error("Invalid filter algorithm: "+e[K-1])}a++}return G},S.prototype.decodePalette=function(){var e,t,o,f,n,s,b,g,d,Z;for(f=this.palette,b=this.transparency.indexed||[],s=new Uint8Array((b.length||0)+f.length),n=0,o=f.length,e=0,t=g=0,d=f.length;g<d;t=g+=3)s[n++]=f[t],s[n++]=f[t+1],s[n++]=f[t+2],s[n++]=(Z=b[e++])!=null?Z:255;return s},S.prototype.copyToImageData=function(e,t){var o,f,n,s,b,g,d,Z,X,re,O;if(f=this.colors,X=null,o=this.hasAlphaChannel,this.palette.length&&(X=(O=this._decodedPalette)!=null?O:this._decodedPalette=this.decodePalette(),f=4,o=!0),n=e.data||e,Z=n.length,b=X||t,s=g=0,f===1)for(;s<Z;)d=X?t[s/4]*4:g,re=b[d++],n[s++]=re,n[s++]=re,n[s++]=re,n[s++]=o?b[d++]:255,g=d;else for(;s<Z;)d=X?t[s/4]*4:g,n[s++]=b[d++],n[s++]=b[d++],n[s++]=b[d++],n[s++]=o?b[d++]:255,g=d},S.prototype.decode=function(){var e;return e=new Uint8Array(this.width*this.height*4),this.copyToImageData(e,this.decodePixels()),e},k=function(e){var t;return J.width=e.width,J.height=e.height,J.clearRect(0,0,e.width,e.height),J.putImageData(e,0,0),t=new Image,t.src=V.toDataURL(),t},S.prototype.decodeFrames=function(e){var t,o,f,n,s,b,g,d;if(!!this.animation){for(g=this.animation.frames,d=[],o=s=0,b=g.length;s<b;o=++s)t=g[o],f=e.createImageData(t.width,t.height),n=this.decodePixels(new Uint8Array(t.data)),this.copyToImageData(f,n),t.imageData=f,d.push(t.image=k(f));return d}},S.prototype.renderFrame=function(e,t){var o,f,n;return f=this.animation.frames,o=f[t],n=f[t-1],t===0&&e.clearRect(0,0,this.width,this.height),n?.disposeOp===M?e.clearRect(n.xOffset,n.yOffset,n.width,n.height):n?.disposeOp===B&&e.putImageData(n.imageData,n.xOffset,n.yOffset),o.blendOp===h&&e.clearRect(o.xOffset,o.yOffset,o.width,o.height),e.drawImage(o.image,o.xOffset,o.yOffset)},S.prototype.animate=function(e){var t,o,f,n,s,b,g=this;return o=0,b=this.animation,n=b.numFrames,f=b.frames,s=b.numPlays,(t=function(){var d,Z;if(d=o++%n,Z=f[d],g.renderFrame(e,d),n>1&&o/n<s)return g.animation._timeout=setTimeout(t,Z.delay)})()},S.prototype.stopAnimation=function(){var e;return clearTimeout((e=this.animation)!=null?e._timeout:void 0)},S.prototype.render=function(e){var t,o;return e._png&&e._png.stopAnimation(),e._png=this,e.width=this.width,e.height=this.height,t=e.getContext("2d"),this.animation?(this.decodeFrames(t),this.animate(t)):(o=t.createImageData(this.width,this.height),this.copyToImageData(o,this.decodePixels()),t.putImageData(o,0,0))},S}(),this.PNG=Ie}).call(void 0);var Pe=Ie;var Ue;(function(){Ue=function(){Math.fmod=function(h,M){return Number((h-Math.floor(h/M)*M).toPrecision(8))},aPRE_LINEBLOCKS=16,aPRE_BLOCKSIZE=16,aPRE_MINBITS=4,aPRE_MAXBITS=4;function U(){this.m_arrfmin=new Float32Array(aPRE_LINEBLOCKS*aPRE_LINEBLOCKS),this.m_arrfmax=new Float32Array(aPRE_LINEBLOCKS*aPRE_LINEBLOCKS),this.floatBufferOut=new Float32Array(256*256)}return U.prototype.Decompress=function(){var h=0,M=0},U.prototype.ElevDecompress=function(h,M,D,B){var k,V,J=0,S,e,t=B-D,o=t/(1<<aPRE_MINBITS),f=0;for(V=0;V<aPRE_LINEBLOCKS;V++)for(k=0;k<aPRE_LINEBLOCKS;k++){if(aPRE_MINBITS==4&&aPRE_MAXBITS==4){var n=M[J++];S=n&15,e=n>>4}else aPRE_MINBITS<=8&&aPRE_MAXBITS<=8?(S=M[J++],e=M[J++]):console.error("Error - jpeg decompression");var s=D+o*S,b=(B-s)/(1<<2*aPRE_MAXBITS);this.m_arrfmin[f]=s;var g=s+b*((e+1)*(e+1));this.m_arrfmax[f]=g,f++}for(f=0,V=0;V<aPRE_LINEBLOCKS;V++)for(k=0;k<aPRE_LINEBLOCKS;k++){var s=this.m_arrfmin[f],g=this.m_arrfmax[f],d=(g-s)/255;s<d&&d>0&&(s+=Math.fmod(Math.abs(s),d));for(var Z=s,X=k*aPRE_BLOCKSIZE+V*aPRE_BLOCKSIZE*256,re=0;re<aPRE_BLOCKSIZE;re++){for(var O=0;O<aPRE_BLOCKSIZE;O++){var G=h.data[X*4],K=G*d+Z;this.floatBufferOut.buffer[X]=K,X++}X+=256-aPRE_BLOCKSIZE}f++}return this.floatBufferOut.buffer},U}(),this.JPEGElevDecompress=Ue}).call(void 0);var Re=Ue;var Ve=function(){"use strict";var h=new Uint8Array([0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0]),M=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11]),D=new Uint8Array([0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0]),B=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11]),k=new Uint8Array([0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125]),V=new Uint8Array([1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250]),J=new Uint8Array([0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119]),S=new Uint8Array([0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250]),e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,o=799,f=3406,n=2276,s=1567,b=3784,g=5793,d=2896;function Z(){}function X(K,a){for(var u=0,r=[],y,c,P=16;P>0&&!K[P-1];)P--;r.push({children:[],index:0});var v=r[0],C;for(y=0;y<P;y++){for(c=0;c<K[y];c++){for(v=r.pop(),v.children[v.index]=a[u];v.index>0;)v=r.pop();for(v.index++,r.push(v);r.length<=y;)r.push(C={children:[],index:0}),v.children[v.index]=C.children,v=C;u++}y+1<P&&(r.push(C={children:[],index:0}),v.children[v.index]=C.children,v=C)}return r[0].children}function re(K,a,u,r,y,c,P,v,C){var T=u.precision,te=u.samplesPerLine,_=u.scanLines,oe=u.mcusPerLine,F=u.progressive,R=u.maxH,j=u.maxV,q=a,Q=0,ne=0;function se(){if(ne>0)return ne--,Q>>ne&1;if(Q=K[a++],Q==255){var N=K[a++];if(N)throw"unexpected marker: "+(Q<<8|N).toString(16)}return ne=7,Q>>>7}function xe(N){for(var E=N,Y;(Y=se())!==null;){if(E=E[Y],typeof E=="number")return E;if(typeof E!="object")throw"invalid huffman sequence"}return null}function H(N){for(var E=0;N>0;){var Y=se();if(Y===null)return;E=E<<1|Y,N--}return E}function m(N){var E=H(N);return E>=1<<N-1?E:E+(-1<<N)+1}function p(N,E){var Y=xe(N.huffmanTableDC),ce=Y===0?0:m(Y);E[0]=N.pred+=ce;for(var ee=1;ee<64;){var ie=xe(N.huffmanTableAC),he=ie&15,fe=ie>>4;if(he===0){if(fe<15)break;ee+=16;continue}ee+=fe;var ae=e[ee];E[ae]=m(he),ee++}}function W(N,E){var Y=xe(N.huffmanTableDC),ce=Y===0?0:m(Y)<<C;E[0]=N.pred+=ce}function l(N,E){E[0]|=se()<<C}var L=0;function $(N,E){if(L>0){L--;return}for(var Y=c,ce=P;Y<=ce;){var ee=xe(N.huffmanTableAC),ie=ee&15,he=ee>>4;if(ie===0){if(he<15){L=H(he)+(1<<he)-1;break}Y+=16;continue}Y+=he;var fe=e[Y];E[fe]=m(ie)*(1<<C),Y++}}var w=0,x;function i(N,E){for(var Y=c,ce=P,ee=0;Y<=ce;){var ie=e[Y];switch(w){case 0:var he=xe(N.huffmanTableAC),fe=he&15,ee=he>>4;if(fe===0)ee<15?(L=H(ee)+(1<<ee),w=4):(ee=16,w=1);else{if(fe!==1)throw"invalid ACn encoding";x=m(fe),w=ee?2:3}continue;case 1:case 2:E[ie]?E[ie]+=se()<<C:(ee--,ee===0&&(w=w==2?3:0));break;case 3:E[ie]?E[ie]+=se()<<C:(E[ie]=x<<C,w=0);break;case 4:E[ie]&&(E[ie]+=se()<<C);break}Y++}w===4&&(L--,L===0&&(w=0))}function z(N,E,Y,ce,ee){var ie=Y/oe|0,he=Y%oe,fe=ie*N.v+ce,ae=he*N.h+ee;E(N,N.blocks[fe][ae])}function A(N,E,Y){var ce=Y/N.blocksPerLine|0,ee=Y%N.blocksPerLine;E(N,N.blocks[ce][ee])}var I=r.length,ue,ve,Fe,we,pe,be;F?c===0?be=v===0?W:l:be=v===0?$:i:be=p;var de=0,me,ge;I==1?ge=r[0].blocksPerLine*r[0].blocksPerColumn:ge=oe*u.mcusPerColumn,y||(y=ge);for(var Ce,Ae;de<ge;){for(ve=0;ve<I;ve++)r[ve].pred=0;if(L=0,I==1)for(ue=r[0],pe=0;pe<y;pe++)A(ue,be,de),de++;else for(pe=0;pe<y;pe++){for(ve=0;ve<I;ve++)for(ue=r[ve],Ce=ue.h,Ae=ue.v,Fe=0;Fe<Ae;Fe++)for(we=0;we<Ce;we++)z(ue,be,de,Fe,we);if(de++,de===ge)break}if(ne=0,me=K[a]<<8|K[a+1],me<65280)throw"marker was not found";if(me>=65488&&me<=65495)a+=2;else break}return a-q}function O(K,a){var u=[],r=a.blocksPerLine,y=a.blocksPerColumn,c=r<<3,P=new Int32Array(64),v=new Uint8Array(64);function C(Q,ne,se){var xe=a.quantizationTable,H,m,p,W,l,L,$,w,x,i=se,z;for(z=0;z<64;z++)i[z]=Q[z]*xe[z];for(z=0;z<8;++z){var A=8*z;if(i[1+A]==0&&i[2+A]==0&&i[3+A]==0&&i[4+A]==0&&i[5+A]==0&&i[6+A]==0&&i[7+A]==0){x=g*i[0+A]+512>>10,i[0+A]=x,i[1+A]=x,i[2+A]=x,i[3+A]=x,i[4+A]=x,i[5+A]=x,i[6+A]=x,i[7+A]=x;continue}H=g*i[0+A]+128>>8,m=g*i[4+A]+128>>8,p=i[2+A],W=i[6+A],l=d*(i[1+A]-i[7+A])+128>>8,w=d*(i[1+A]+i[7+A])+128>>8,L=i[3+A]<<4,$=i[5+A]<<4,x=H-m+1>>1,H=H+m+1>>1,m=x,x=p*b+W*s+128>>8,p=p*s-W*b+128>>8,W=x,x=l-$+1>>1,l=l+$+1>>1,$=x,x=w+L+1>>1,L=w-L+1>>1,w=x,x=H-W+1>>1,H=H+W+1>>1,W=x,x=m-p+1>>1,m=m+p+1>>1,p=x,x=l*n+w*f+2048>>12,l=l*f-w*n+2048>>12,w=x,x=L*o+$*t+2048>>12,L=L*t-$*o+2048>>12,$=x,i[0+A]=H+w,i[7+A]=H-w,i[1+A]=m+$,i[6+A]=m-$,i[2+A]=p+L,i[5+A]=p-L,i[3+A]=W+l,i[4+A]=W-l}for(z=0;z<8;++z){var I=z;if(i[8+I]==0&&i[16+I]==0&&i[24+I]==0&&i[32+I]==0&&i[40+I]==0&&i[48+I]==0&&i[56+I]==0){x=g*se[z+0]+8192>>14,i[0+I]=x,i[8+I]=x,i[16+I]=x,i[24+I]=x,i[32+I]=x,i[40+I]=x,i[48+I]=x,i[56+I]=x;continue}H=g*i[0+I]+2048>>12,m=g*i[32+I]+2048>>12,p=i[16+I],W=i[48+I],l=d*(i[8+I]-i[56+I])+2048>>12,w=d*(i[8+I]+i[56+I])+2048>>12,L=i[24+I],$=i[40+I],x=H-m+1>>1,H=H+m+1>>1,m=x,x=p*b+W*s+2048>>12,p=p*s-W*b+2048>>12,W=x,x=l-$+1>>1,l=l+$+1>>1,$=x,x=w+L+1>>1,L=w-L+1>>1,w=x,x=H-W+1>>1,H=H+W+1>>1,W=x,x=m-p+1>>1,m=m+p+1>>1,p=x,x=l*n+w*f+2048>>12,l=l*f-w*n+2048>>12,w=x,x=L*o+$*t+2048>>12,L=L*t-$*o+2048>>12,$=x,i[0+I]=H+w,i[56+I]=H-w,i[8+I]=m+$,i[48+I]=m-$,i[16+I]=p+L,i[40+I]=p-L,i[24+I]=W+l,i[32+I]=W-l}for(z=0;z<64;++z){var ue=128+(i[z]+8>>4);ne[z]=ue<0?0:ue>255?255:ue}}for(var T,te,_=0;_<y;_++){var oe=_<<3;for(T=0;T<8;T++)u.push(new Uint8Array(c));for(var F=0;F<r;F++){C(a.blocks[_][F],v,P);var R=0,j=F<<3;for(te=0;te<8;te++){var q=u[oe+te];for(T=0;T<8;T++)q[j+T]=v[R++]}}}return u}function G(K){return K<0?0:K>255?255:K}return Z.prototype={load:function(a){var u=new XMLHttpRequest;u.open("GET",a,!0),u.responseType="arraybuffer",u.onload=function(){var r=new Uint8Array(u.response||u.mozResponseArrayBuffer);this.parse(r),this.onload&&this.onload()}.bind(this),u.send(null)},parse:function(a,u){var r=0,y=a.length;function c(){var ae=a[r]<<8|a[r+1];return r+=2,ae}function P(){var ae=c(),ye=a.subarray(r,r+ae-2);return r+=ye.length,ye}function v(ae){var ye=0,Ee=0,le,_e;for(_e in ae.components)ae.components.hasOwnProperty(_e)&&(le=ae.components[_e],ye<le.h&&(ye=le.h),Ee<le.v&&(Ee=le.v));var ke=Math.ceil(ae.samplesPerLine/8/ye),Le=Math.ceil(ae.scanLines/8/Ee);for(_e in ae.components)if(ae.components.hasOwnProperty(_e)){le=ae.components[_e];for(var Se=Math.ceil(Math.ceil(ae.samplesPerLine/8)*le.h/ye),Ge=Math.ceil(Math.ceil(ae.scanLines/8)*le.v/Ee),Xe=ke*le.h,Ke=Le*le.v,Oe=[],Te=0;Te<Ke;Te++){for(var Ne=[],Be=0;Be<Xe;Be++)Ne.push(new Int32Array(64));Oe.push(Ne)}le.blocksPerLine=Se,le.blocksPerColumn=Ge,le.blocks=Oe}ae.maxH=ye,ae.maxV=Ee,ae.mcusPerLine=ke,ae.mcusPerColumn=Le}var C=null,T=null,te=null,_,oe,F=[],R=[],j=[],q=[],Q=c();if(Q!=65496)throw"SOI not found";var ne=a[5];(ne<=0||ne>100)&&(ne=90);var se=0;se=a[4];var xe,H;for(ne>=0&&(xe=Me(ne,0),H=Me(ne,1)),u&&(a[2]=255,a[3]=224,a[4]=0,a[5]=16,a[6]=74,a[7]=70,a[8]=73,a[9]=70,se&1&&(F[0]=xe,F[1]=H),se&2&&(q[0]=X(h,M),j[0]=X(k,V),q[1]=X(D,B),j[1]=X(J,S))),Q=c();Q!=65497;){var m,p,W;switch(Q){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var l=P();Q===65504&&l[0]===74&&l[1]===70&&l[2]===73&&l[3]===70&&l[4]===0&&(C={version:{major:l[5],minor:l[6]},densityUnits:l[7],xDensity:l[8]<<8|l[9],yDensity:l[10]<<8|l[11],thumbWidth:l[12],thumbHeight:l[13],thumbData:l.subarray(14,14+3*l[12]*l[13])}),Q===65518&&l[0]===65&&l[1]===100&&l[2]===111&&l[3]===98&&l[4]===101&&l[5]===0&&(T={version:l[6],flags0:l[7]<<8|l[8],flags1:l[9]<<8|l[10],transformCode:l[11]});break;case 65499:for(var L=c(),$=L+r-2;r<$;){var w=a[r++],x=new Int32Array(64);if(w>>4===0)for(p=0;p<64;p++){var i=e[p];x[i]=a[r++]}else if(w>>4===1)for(p=0;p<64;p++){var i=e[p];x[i]=c()}else throw"DQT: invalid table spec";F[w&15]=x}break;case 65472:case 65473:case 65474:c(),_={},_.extended=Q===65473,_.progressive=Q===65474,_.precision=a[r++],_.scanLines=c(),_.samplesPerLine=c(),_.components={},_.componentsOrder=[];var z=a[r++],A,I=0,ue=0;for(m=0;m<z;m++){A=a[r];var ve=a[r+1]>>4,Fe=a[r+1]&15,we=a[r+2];_.componentsOrder.push(A),_.components[A]={h:ve,v:Fe,quantizationIdx:we},r+=3}v(_),R.push(_);break;case 65476:var pe=c();for(m=2;m<pe;){var be=a[r++],de=new Uint8Array(16),me=0;for(p=0;p<16;p++,r++)me+=de[p]=a[r];var ge=new Uint8Array(me);for(p=0;p<me;p++,r++)ge[p]=a[r];m+=17+me,(be>>4===0?q:j)[be&15]=X(de,ge)}break;case 65501:c(),oe=c();break;case 65498:var Ce=c(),Ae=a[r++],N=[],E;for(m=0;m<Ae;m++){E=_.components[a[r++]];var Y=a[r++];E.huffmanTableDC=q[Y>>4],E.huffmanTableAC=j[Y&15],N.push(E)}var ce=a[r++],ee=a[r++],ie=a[r++],he=re(a,r,_,N,oe,ce,ee,ie>>4,ie&15);r+=he;break;default:if(a[r-3]==255&&a[r-2]>=192&&a[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+Q.toString(16)}Q=c()}if(R.length!=1)throw"only single frame JPEGs supported";for(var m=0;m<R.length;m++){var fe=R[m].components;for(var p in fe)fe[p].quantizationTable=F[fe[p].quantizationIdx],delete fe[p].quantizationIdx}this.width=_.samplesPerLine,this.height=_.scanLines,this.jfif=C,this.adobe=T,this.components=[];for(var m=0;m<_.componentsOrder.length;m++){var E=_.components[_.componentsOrder[m]];this.components.push({lines:O(_,E),scaleX:E.h/_.maxH,scaleY:E.v/_.maxV})}},getData:function(a,u){var r=this.width/a,y=this.height/u,c,P,v,C,T,te,_,oe,F,R,j=0,q,Q,ne,se,xe,H,m,p,W,l,L,$=a*u*this.components.length,w=new Uint8Array($);switch(this.components.length){case 1:for(c=this.components[0],R=0;R<u;R++)for(T=c.lines[0|R*c.scaleY*y],F=0;F<a;F++)q=T[0|F*c.scaleX*r],w[j++]=q;break;case 2:for(c=this.components[0],P=this.components[1],R=0;R<u;R++)for(T=c.lines[0|R*c.scaleY*y],te=P.lines[0|R*P.scaleY*y],F=0;F<a;F++)q=T[0|F*c.scaleX*r],w[j++]=q,q=te[0|F*P.scaleX*r],w[j++]=q;break;case 3:for(L=!0,this.adobe&&this.adobe.transformCode?L=!0:typeof this.colorTransform<"u"&&(L=!!this.colorTransform),c=this.components[0],P=this.components[1],v=this.components[2],R=0;R<u;R++)for(T=c.lines[0|R*c.scaleY*y],te=P.lines[0|R*P.scaleY*y],_=v.lines[0|R*v.scaleY*y],F=0;F<a;F++)L?(q=T[0|F*c.scaleX*r],Q=te[0|F*P.scaleX*r],ne=_[0|F*v.scaleX*r],p=G(q+1.402*(ne-128)),W=G(q-.3441363*(Q-128)-.71413636*(ne-128)),l=G(q+1.772*(Q-128))):(p=T[0|F*c.scaleX*r],W=te[0|F*P.scaleX*r],l=_[0|F*v.scaleX*r]),w[j++]=p,w[j++]=W,w[j++]=l;break;case 4:if(!this.adobe)throw"Unsupported color mode (4 components)";for(L=!1,this.adobe&&this.adobe.transformCode?L=!0:typeof this.colorTransform<"u"&&(L=!!this.colorTransform),c=this.components[0],P=this.components[1],v=this.components[2],C=this.components[3],R=0;R<u;R++)for(T=c.lines[0|R*c.scaleY*y],te=P.lines[0|R*P.scaleY*y],_=v.lines[0|R*v.scaleY*y],oe=C.lines[0|R*C.scaleY*y],F=0;F<a;F++)L?(q=T[0|F*c.scaleX*r],Q=te[0|F*P.scaleX*r],ne=_[0|F*v.scaleX*r],se=oe[0|F*C.scaleX*r],xe=255-G(q+1.402*(ne-128)),H=255-G(q-.3441363*(Q-128)-.71413636*(ne-128)),m=255-G(q+1.772*(Q-128))):(xe=T[0|F*c.scaleX*r],H=te[0|F*P.scaleX*r],m=_[0|F*v.scaleX*r],se=oe[0|F*C.scaleX*r]),w[j++]=255-xe,w[j++]=255-H,w[j++]=255-m,w[j++]=255-se;break;default:throw"Unsupported color mode"}return w},copyToImageData:function(a){var u=a.width,r=a.height,y=a.data,c=this.getData(u,r),P=0,v=0,C,T,te,_,oe,F,R,j,q;switch(this.components.length){case 1:for(T=0;T<r;T++)for(C=0;C<u;C++)te=c[P++],y[v++]=te,y[v++]=te,y[v++]=te,y[v++]=255;break;case 3:for(T=0;T<r;T++)for(C=0;C<u;C++)R=c[P++],j=c[P++],q=c[P++],y[v++]=R,y[v++]=j,y[v++]=q,y[v++]=255;break;case 4:for(T=0;T<r;T++)for(C=0;C<u;C++)oe=c[P++],F=c[P++],te=c[P++],_=c[P++],R=255-G(oe*(1-_/255)+_),j=255-G(F*(1-_/255)+_),q=255-G(te*(1-_/255)+_),y[v++]=R,y[v++]=j,y[v++]=q,y[v++]=255;break;default:throw"Unsupported color mode"}}},Z}();function De(U,h,M){var D=new Ve;D.parse(U,M);var B={compNum:D.components.length,width:D.width,height:D.height,data:h?new Uint8Array(D.width*D.height*4):new Buffer(D.width*D.height*4)};return D.copyToImageData(B),B}function Me(U,h){var M=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],D=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],B=new Uint32Array(64);U<=0&&(U=1),U>100&&(U=100),U<50?U=5e3/U:U=200-U*2;var k;k=[M,D][h];for(var V=0;V<64;V++)temp=parseInt((k[V]*U+50)/100),temp<=0&&(temp=1),temp>32767&&(temp=32767),temp>255&&(temp=255),B[V]=temp;return B}self.addEventListener("message",function(U){var h=U.data;if(h.rejected=!1,Ye(h)){for(var M=new Pe(new Uint8Array(h.buffer)),D=M.decodePixels(),B=new Int16Array(D.length/2),k=0;k<D.length/2;k++)B[k]=D[k*2]<<8|D[k*2+1],B[k]!=65535&&(B[k]=B[k]*.3048);h.buffer=B,postMessage(h)}else if(He(h)){var V=96,J=new DataView(h.buffer),S=J.getUint32(64,!0),e=J.getUint32(68,!0),t=J.getUint32(72,!0),o=J.getUint32(76,!0),f=(J.getUint32(V+4,!0)&16777215)-(J.getUint32(V+0,!0)&16777215),n=(J.getUint32(V+8,!0)&16777215)-(J.getUint32(V+4,!0)&16777215),s=V+f+S,b=J.getUint32(s+0,!0)&16777215,g=J.getUint32(s+4,!0),d=String.fromCharCode(g>>24),Z=s+b,X=Z+n;if(d=="N"){var re=qe(h.buffer.slice(Z,X));h.buffer=re,postMessage(h)}else if(d=="B"){for(var re=Je(h.buffer.slice(Z,X)),B=new Float32Array(256*256),k=0;k<256*256;k++)B[k]=re[k];h.buffer=B,postMessage(h)}else if(d=="A"){var B=Ze(h.buffer.slice(Z,X));h.buffer=B,postMessage(h)}else h.rejected=!0,postMessage(h)}else h.rejected=!0,postMessage(h)});function Ye(U){if(U.buffer.byteLength>2){var h=new Uint8Array(U.buffer.byteLength>0?U.buffer.slice(1,4):0),M=h.length==0||h[0]=="P".charCodeAt()&&h[1]=="N".charCodeAt()&&h[2]=="G".charCodeAt();return M}return!1}function He(U){if(U.buffer.byteLength>80){var h=96,M=new DataView(U.buffer),D=M.getUint32(64,!0),B=M.getUint32(68,!0),k=M.getUint32(72,!0),V=M.getUint32(76,!0);return V==1}return!1}Math.fmod=function(U,h){return Number((U-Math.floor(U/h)*h).toPrecision(8))};function Je(U){var h=0,M=0,D,B=new Uint8Array(U),k=new DataView(B.buffer);h=k.getFloat32(0,!0),M=k.getFloat32(4,!0),D=B.slice(8,8+256);var V=B.slice(256+8,B.byteLength),J=De(V,!0,1);if(isNaN(J.data[0]))console.error("Error while JPEG Decompressing");else{var S=new Re,e=S.ElevDecompress(J,D,h,M);return e}}function Ze(U){for(var h=new Uint8Array(U),M=new DataView(U),D=M.getFloat32(0,!0),B=M.getFloat32(4,!0),k=B-D,V=h.slice(8,h.buffer.byteLength),J=new Pe(new Uint8Array(V)),S=J.decodePixels(),e=new Float32Array(S.length/2),t=new DataView(S.buffer),o=0;o<S.length/2;o++)e[o]=t.getUint16(o*2),e[o]=e[o]*k/65535+D;return e}function qe(U){var h=0,M=0,D=new Uint8Array(U),B=new DataView(D.buffer);h=B.getUint32(0,!0),M=B.getUint32(4,!0);for(var k=8+h+M,V=D.slice(8,8+h),J=new Pe(new Uint8Array(V)),S=J.decodePixels(),e=new DataView(S.buffer),t=D.slice(8+h,k),o=new Pe(new Uint8Array(t)),f=o.decodePixels(),n=new DataView(S.buffer),s=new Float32Array(256*256),b=.3048,g=0;g<256;g++)for(var d=0;d<256;d++)s[d+g*256]=(e.getInt16((d+g*256)*2)+f[d+g*256]/256)*b;return s}})();
|