var UDOC={};UDOC.B=function(){var i=new Uint8Array(4),J=i.buffer,T=new Int16Array(J),d=new Uint16Array(J),t=new Int32Array(J),s=new Uint32Array(J),m=new Float32Array(J);
return{readShort:function(C,h){i[0]=C[h];i[1]=C[h+1];return T[0]},readUshort:function(C,h){i[0]=C[h];
i[1]=C[h+1];return d[0]},readInt:function(C,h){i[0]=C[h];i[1]=C[h+1];i[2]=C[h+2];i[3]=C[h+3];return t[0]},readUint:function(C,h){i[0]=C[h];
i[1]=C[h+1];i[2]=C[h+2];i[3]=C[h+3];return s[0]},readUintBE:function(C,h){i[3]=C[h];i[2]=C[h+1];i[1]=C[h+2];
i[0]=C[h+3];return s[0]},readFloat:function(C,h){i[0]=C[h];i[1]=C[h+1];i[2]=C[h+2];i[3]=C[h+3];return m[0]},readASCII:function(C,h,P){var A="";
for(var V=0;V<P;V++)A+=String.fromCharCode(C[h+V]);return A}}}();UDOC.G={concat:function(i,J){for(var T=0;
T<J.cmds.length;T++)i.cmds.push(J.cmds[T]);for(var T=0;T<J.crds.length;T++)i.crds.push(J.crds[T])},getBB:function(i){var J=1e99,T=1e99,d=-J,t=-T;
for(var s=0;s<i.length;s+=2){var m=i[s],C=i[s+1];if(m<J)J=m;if(m>d)d=m;if(C<T)T=C;if(C>t)t=C}return[J,T,d,t]},rectToPath:function(i){return{cmds:["M","L","L","L","Z"],crds:[i[0],i[1],i[2],i[1],i[2],i[3],i[0],i[3]]}},insideBox:function(i,J){return J[0]<=i[0]&&J[1]<=i[1]&&i[2]<=J[2]&&i[3]<=J[3]},isBox:function(i,J){var T=function(K,D){for(var Q=0;
Q<8;Q+=2){var n=!0;for(var f=0;f<8;f++)if(Math.abs(D[f]-K[f+Q&7])>=2){n=!1;break}if(n)return!0}return!1},s=!1;
if(i.cmds.length>10)return!1;var d=i.cmds.join(""),t=i.crds;if(d=="MLLLZ"&&t.length==8||(d=="MLLLLZ"||d=="MLLLL")&&t.length==10){if(t.length==10)t=t.slice(0,8);
if(J==null){J=[t[0],t[1],t[0],t[1]];for(var m=0;m<t.length;m+=2){var C=t[m],P=t[m+1];if(C<J[0])J[0]=C;
if(P<J[1])J[1]=P;if(J[2]<C)J[2]=C;if(J[3]<P)J[3]=P}}var A=J[0],l=J[1],V=J[2],Z=J[3];if(!s)s=T(t,[A,l,V,l,V,Z,A,Z]);
if(!s)s=T(t,[A,Z,V,Z,V,l,A,l])}return s},boxArea:function(i){var J=i[2]-i[0],T=i[3]-i[1];return J*T},newPath:function(i){i.pth={cmds:[],crds:[]}},moveTo:function(i,J,T){var d=UDOC.M.multPoint(i.ctm,[J,T]),t=i.pth,s=t.cmds.length;
if(s!=0&&t.cmds[s-1]=="M"){t.cmds.pop();t.crds.pop();t.crds.pop()}i.pth.cmds.push("M");i.pth.crds.push(d[0],d[1]);
i.cpos=d},lineTo:function(i,J,T){var d=UDOC.M.multPoint(i.ctm,[J,T]);if(i.cpos[0]==d[0]&&i.cpos[1]==d[1])return;
i.pth.cmds.push("L");i.pth.crds.push(d[0],d[1]);i.cpos=d},curveTo:function(i,J,T,d,t,s,m){var C;if(i.pth.cmds.length==0)UDOC.G.moveTo(i,0,0);
C=UDOC.M.multPoint(i.ctm,[J,T]);J=C[0];T=C[1];C=UDOC.M.multPoint(i.ctm,[d,t]);d=C[0];t=C[1];C=UDOC.M.multPoint(i.ctm,[s,m]);
s=C[0];m=C[1];i.cpos=C;i.pth.cmds.push("C");i.pth.crds.push(J,T,d,t,s,m)},quadCurveTo:function(i,J,T,d,t){var s;
if(i.pth.cmds.length==0)UDOC.G.moveTo(i,0,0);s=UDOC.M.multPoint(i.ctm,[J,T]);J=s[0];T=s[1];s=UDOC.M.multPoint(i.ctm,[d,t]);
d=s[0];t=s[1];i.cpos=s;i.pth.cmds.push("Q");i.pth.crds.push(J,T,d,t)},closePath:function(i){i.pth.cmds.push("Z")},arc:function(i,J,T,d,t,s,m){if(m)while(s>t)s-=2*Math.PI;
else while(s<t)s+=2*Math.PI;var C=(s-t)/4,h=Math.cos(C/2),P=-Math.sin(C/2),A=(4-h)/3,l=P==0?P:(1-h)*(3-h)/(3*P),V=A,Z=-l,K=h,G=-P,D=[h,P],n=[A,l],f=[V,Z],E=[K,G],N={cmds:[i.pth.cmds.length==0?"M":"L"],crds:[h,P]},k=[1,0,0,1,0,0];
for(var R=0;R<4;R++){n=UDOC.M.multPoint(k,n);f=UDOC.M.multPoint(k,f);E=UDOC.M.multPoint(k,E);N.crds.push(n[0],n[1],f[0],f[1],E[0],E[1]);
N.cmds.push("C");if(R==0)UDOC.M.rotate(k,-C)}var z=[d,0,0,d,J,T];UDOC.M.rotate(k,-t+C/2);UDOC.M.concat(k,z);
UDOC.M.multArray(k,N.crds);UDOC.M.multArray(i.ctm,N.crds);UDOC.G.concat(i.pth,N);var T=N.crds.pop();
J=N.crds.pop();i.cpos=[J,T]},drawRect:function(i,J,T,d,t){UDOC.G.moveTo(i,J,T);UDOC.G.lineTo(i,J+d,T);
UDOC.G.lineTo(i,J+d,T+t);UDOC.G.lineTo(i,J,T+t);UDOC.G.closePath(i)},toPoly:function(i){if(i.cmds[0]!="M"||i.cmds[i.cmds.length-1]!="Z")return null;
for(var J=1;J<i.cmds.length-1;J++)if(i.cmds[J]!="L")return null;var T=[],d=i.crds.length;if(i.crds[0]==i.crds[d-2]&&i.crds[1]==i.crds[d-1])d-=2;
for(var J=0;J<d;J+=2)T.push([i.crds[J],i.crds[J+1]]);if(UDOC.G.polyArea(i.crds)<0)T.reverse();return T},fromPoly:function(i){var J={cmds:[],crds:[]};
for(var T=0;T<i.length;T++){J.crds.push(i[T][0],i[T][1]);J.cmds.push(T==0?"M":"L")}J.cmds.push("Z");
return J},polyArea:function(i){if(i.length<6)return 0;var J=i.length-2,T=(i[0]-i[J])*(i[J+1]+i[1]);for(var d=0;
d<J;d+=2)T+=(i[d+2]-i[d])*(i[d+1]+i[d+3]);return-T*.5},polyClip:function(i,J){var T,d,t,s,m=function(V){return(d[0]-T[0])*(V[1]-T[1])>(d[1]-T[1])*(V[0]-T[0])},C=function(){var V=[T[0]-d[0],T[1]-d[1]],Z=[t[0]-s[0],t[1]-s[1]],K=T[0]*d[1]-T[1]*d[0],G=t[0]*s[1]-t[1]*s[0],D=1/(V[0]*Z[1]-V[1]*Z[0]);
return[(K*Z[0]-G*V[0])*D,(K*Z[1]-G*V[1])*D]},h=i,P,A;T=J[J.length-1];for(A in J){var d=J[A],l=h;h=[];
t=l[l.length-1];for(P in l){var s=l[P];if(m(s)){if(!m(t)){h.push(C())}h.push(s)}else if(m(t)){h.push(C())}t=s}T=d}return h}};
UDOC.M={getScale:function(i){return Math.sqrt(Math.abs(i[0]*i[3]-i[1]*i[2]))},translate:function(i,J,T){UDOC.M.concat(i,[1,0,0,1,J,T])},rotate:function(i,J){UDOC.M.concat(i,[Math.cos(J),-Math.sin(J),Math.sin(J),Math.cos(J),0,0])},scale:function(i,J,T){UDOC.M.concat(i,[J,0,0,T,0,0])},concat:function(i,J){var T=i[0],d=i[1],t=i[2],s=i[3],m=i[4],C=i[5];
i[0]=T*J[0]+d*J[2];i[1]=T*J[1]+d*J[3];i[2]=t*J[0]+s*J[2];i[3]=t*J[1]+s*J[3];i[4]=m*J[0]+C*J[2]+J[4];
i[5]=m*J[1]+C*J[3]+J[5]},invert:function(i){var J=i[0],T=i[1],d=i[2],t=i[3],s=i[4],m=i[5],C=J*t-T*d;
i[0]=t/C;i[1]=-T/C;i[2]=-d/C;i[3]=J/C;i[4]=(d*m-t*s)/C;i[5]=(T*s-J*m)/C},multPoint:function(i,J){var T=J[0],d=J[1];
return[T*i[0]+d*i[2]+i[4],T*i[1]+d*i[3]+i[5]]},multArray:function(i,J){for(var T=0;T<J.length;T+=2){var d=J[T],t=J[T+1];
J[T]=d*i[0]+t*i[2]+i[4];J[T+1]=d*i[1]+t*i[3]+i[5]}}};UDOC.C={srgbGamma:function(i){return i<.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055},cmykToRgb:function(i){var J=i[0],d=i[1],t=i[2],s=i[3],m=255+J*(-4.387332384609988*J+54.48615194189176*d+18.82290502165302*t+212.25662451639585*s+-285.2331026137004)+d*(1.7149763477362134*d-5.6096736904047315*t+-17.873870861415444*s-5.497006427196366)+t*(-2.5217340131683033*t-21.248923337353073*s+17.5119270841813)+s*(-21.86122147463605*s-189.48180835922747),C=255+J*(8.841041422036149*J+60.118027045597366*d+6.871425592049007*t+31.159100130055922*s+-79.2970844816548)+d*(-15.310361306967817*d+17.575251261109482*t+131.35250912493976*s-190.9453302588951)+t*(4.444339102852739*t+9.8632861493405*s-24.86741582555878)+s*(-20.737325471181034*s-187.80453709719578),h=255+J*(.8842522430003296*J+8.078677503112928*d+30.89978309703729*t-.23883238689178934*s+-14.183576799673286)+d*(10.49593273432072*d+63.02378494754052*t+50.606957656360734*s-112.23884253719248)+t*(.03296041114873217*t+115.60384449646641*s+-193.58209356861505)+s*(-22.33816807309886*s-180.12613974708367);
return[Math.max(0,Math.min(1,m/255)),Math.max(0,Math.min(1,C/255)),Math.max(0,Math.min(1,h/255))]},labToRgb:function(i){var J=903.3,T=.008856,d=i[0],s=i[1],m=i[2],C=(d+16)/116,h=C*C*C,P=C-m/200,l=P*P*P,V=s/500+C,Z=V*V*V,K=l>T?l:(116*P-16)/J,G=h>T?h:(116*C-16)/J,D=Z>T?Z:(116*V-16)/J,Q=D*96.72,n=G*100,f=K*81.427,E=[Q/100,n/100,f/100],N=[3.1338561,-1.6168667,-.4906146,-.9787684,1.9161415,.033454,.0719453,-.2289914,1.4052427],k=[N[0]*E[0]+N[1]*E[1]+N[2]*E[2],N[3]*E[0]+N[4]*E[1]+N[5]*E[2],N[6]*E[0]+N[7]*E[1]+N[8]*E[2]];
for(var y=0;y<3;y++)k[y]=Math.max(0,Math.min(1,UDOC.C.srgbGamma(k[y])));return k}};UDOC.getState=function(i){return{font:UDOC.getFont(),dd:{flat:1},ca:1,colr:[0,0,0],space:"/DeviceGray",CA:1,COLR:[0,0,0],sspace:"/DeviceGray",bmode:"/Normal",SA:!1,OPM:0,AIS:!1,OP:!1,op:!1,SMask:"/None",lwidth:1,lcap:0,ljoin:0,mlimit:10,SM:.1,doff:0,dash:[],ctm:[1,0,0,1,0,0],cpos:[0,0],pth:{cmds:[],crds:[]},cpth:i?UDOC.G.rectToPath(i):null,cpstack:[]}};
UDOC.getFont=function(){return{Tc:0,Tw:0,Th:100,Tl:0,Tf:"Helvetica-Bold",Tfs:1,Tmode:0,Trise:0,Tk:0,Tal:0,Tun:0,Tm:[1,0,0,1,0,0],Tlm:[1,0,0,1,0,0],Trm:[1,0,0,1,0,0]}};
function FromPS(){}FromPS.Parse=function(i,J){i=new Uint8Array(i);var T=0,s=null,m=null,D=!0;while(!(i[T]==37&&i[T+1]==33))T++;
var d=FromPS.B.readASCII(i,T,i.length-T),t=d.split(/[\n\r]+/);for(var C=0;C<t.length;C++){var h=t[C].trim();
if(h.charAt(0)=="%"){h=h.slice(1);while(h.charAt(0)=="%")h=h.slice(1);var P=h.split(":");if(P[0]=="BoundingBox"){s=P[1].trim().split(/[ ]+/).map(parseFloat)}if(h.indexOf("!PS-Adobe-3.0 EPSF-3.0")!=-1)m=h;
if(h.indexOf("!PS-Adobe-2.0 EPSF-1.2")!=-1)m=h}}if(m==null||s==null)s=[0,0,595,842];var A=[],l=FromPS._getDictStack([],{}),V=[{typ:"file",val:{buff:i,off:T}}],Z=[],K=FromPS._getEnv(s),G=Date.now();
while(D)D=FromPS.step(A,l,V,Z,K,J);if(K.pgOpen)J.ShowPage();J.Done();console.log(Date.now()-G)};FromPS._getDictStack=function(i,J){var T="def undef known begin end currentfile currentdict currentpacking setpacking currentoverprint setoverprint currentglobal setglobal gcheck currentsystemparams setsystemparams currentuserparams setuserparams currentpagedevice setpagedevice currentflat currentlinewidth currentdash currentpoint currentscreen setscreen currenthalftone currentblackgeneration currentundercolorremoval currentcolortransfer internaldict dict string readstring readhexstring readline getinterval putinterval token array aload astore length maxlength matrix count mark counttomark cleartomark dictstack countdictstack makepattern makefont scalefont stringwidth setfont currentcolorspace setcolorspace setcolor _setHSB_ currentgray currentrgbcolor currentcmykcolor setlinewidth setstrokeadjust setflat setlinecap setlinejoin setmiterlimit setdash clip eoclip clippath pathbbox newpath stroke fill eofill shfill closepath flattenpath showpage print _drawRect_ moveto lineto curveto arc arcn show ashow xshow yshow xyshow widthshow awidthshow charpath cshow rmoveto rlineto rcurveto translate rotate scale concat concatmatrix invertmatrix currentmatrix defaultmatrix setmatrix limitcheck save restore clipsave cliprestore gsave grestore grestorePDF grestoreall usertime readtime flush flushfile readonly executeonly findresource resourcestatus defineresource undefineresource resourceforall image imagemask colorimage xcheck status cachestatus setcachelimit type if ifelse exec stopped stop dup exch copy roll index anchorsearch pop put get load where store repeat for forall pathforall loop exit bind cvi cvr cvs cvx cvn cvlit add sub mul div idiv bitshift mod exp atan neg abs floor ceiling round truncate sqrt ln sin cos srand rand == transform itransform dtransform idtransform eq ge gt le lt ne and or not filter begincmap endcmap begincodespacerange endcodespacerange beginbfrange endbfrange beginbfchar endbfchar".split(" ").concat(i),d="image colorimage repeat for forall loop".split(" ");
for(var t=0;t<d.length;t++)T.push(d[t]+"---");FromPS._myOps=FromPS.makeProcs({CIDSystemInfo:"/CIDSystemInfo",findfont:"/Font findresource",definefont:"/Font defineresource",undefinefont:"/Font undefineresource",selectfont:"exch findfont exch scalefont setfont",rectfill:"gsave newpath _drawRect_  fill   grestore",rectstroke:"gsave newpath _drawRect_  stroke grestore",rectclip:"newpath _drawRect_  clip newpath",setgray:"/DeviceGray setcolorspace setcolor",setrgbcolor:"/DeviceRGB  setcolorspace setcolor",sethsbcolor:"/DeviceRGB  setcolorspace _setHSB_",setcmykcolor:"/DeviceCMYK setcolorspace setcolor",setpattern:"/Pattern    setcolorspace setcolor"});
for(var s in FromPS._myOps)T.push(s);var m=J,C={},P={},A={},l={};C.systemdict={typ:"dict",val:C};C.globaldict={typ:"dict",val:P};
C.userdict={typ:"dict",val:A};C.statusdict={typ:"dict",val:l};C.GlobalFontDirectory=C.SharedFontDirectory={typ:"dict",val:{}};
C.FontDirectory={typ:"dict",val:{}};C.$error={typ:"dict",val:{}};C.errordict={typ:"dict",val:FromPS.makeProcs({handleerror:""})};
C.null={typ:"null",val:null};C.true={typ:"boolean",val:!0};C.false={typ:"boolean",val:!1};C.product={typ:"string",val:FromPS.makeStr("Photopea")};
C.version={typ:"string",val:[51]};C.languagelevel={typ:"integer",val:3};for(var t=0;t<T.length;t++)C[T[t]]={typ:"operator",val:T[t]};
for(var V in m)C[V]=m[V];return[C,P,A]};FromPS._getEnv=function(i){var J={bb:i,gst:UDOC.getState(i),packing:!1,overprint:!1,global:!1,systemparams:{MaxPatternCache:{type:"integer",val:5e3}},userparams:{},pagedevice:{PageSize:{typ:"array",val:[{typ:"real",val:i[2]},{typ:"real",val:i[3]}]}},cmnum:0,fnt:null,res:{},pgOpen:!1,funs:FromPS.makeProcs({blackgeneration:"",undercolorremoval:"pop 0"})},T;
T="Font CIDFont CMap FontSet Form Pattern ProcSet Halftone ColorRendering IdiomSet InkParams TrapParams OutputDevice ControlLanguage Localization PDL HWOptions".split(" ");
for(var d=0;d<T.length;d++)J.res[T[d]]={typ:"dict",val:{},maxl:1e3};T=["Encoding","ColorSpace"];for(var d=0;
d<T.length;d++)J.res[T[d]]={typ:"array",val:[]};J.res.Category={typ:"dict",val:J.res};J.res.ColorSpace.val=[{typ:"array",val:[{typ:"name",val:"/DeviceRGB"}]},{typ:"array",val:[{typ:"name",val:"/DeviceCMYK"}]},{typ:"array",val:[{typ:"name",val:"/DeviceGray"}]}];
for(var d=0;d<T.length;d++)J.res[T[d]]={typ:"dict",val:{},maxl:1e3};return J};FromPS.makeProcs=function(i){var J={};
for(var T in i){var d=i[T].replace(/  +/g," ").split(" ");J[T]={typ:"procedure",val:[]};for(var t=0;
t<d.length;t++)J[T].val.push({typ:"name",val:d[t]})}return J};FromPS.addProc=function(i,J){if(i.val.length==0)return;
if(i.typ!="procedure"){console.log(i);throw i.typ}J.push({typ:"procedure",val:i.val,off:0})};FromPS.stepC=0;
FromPS._f32=new Float32Array(1);FromPS.step=function(i,J,T,d,t,s,m,C){var h=Date.now(),P=FromPS._f32,A=FromPS.getToken,l=t.gst,V=A(T,J),G=!1;
if(V==null)return!1;if(C&&V.typ=="string"&&FromPS.readStr(V.val)=="def")V={typ:"operator",val:"def"};
var Z=V.typ,K=V.val;if(K=="NaN"||K=="INF")Z="integer";if(isNaN(l.cpos[0]))throw"e";if(G)console.log(V,i.slice(0));
if("integer real dict boolean string array procedure null file".split(" ").indexOf(Z)!=-1){i.push(V);
return!0}if(Z!="name"&&Z!="operator")throw"e";if(K.charAt(0)=="/"){i.push(V)}else if(K=="undefined")return!0;
else if(K.startsWith("II*"))return!1;else if(K=="{"){var D=[],Q={typ:"procedure",val:[]},n=A(T,J);while(!0){if(n.val=="{"){var f={typ:"procedure",val:[]};
Q.val.push(f);D.push(Q);Q=f}else if(n.val=="}"){if(D.length==0)break;Q=D.pop()}else Q.val.push(n);n=A(T,J)}i.push(Q)}else if(K=="["||K=="<<")i.push({typ:"mark"});
else if(K=="]"||K==">>"){var E=[];while(i.length!=0){var N=i.pop();if(N.typ=="mark")break;E.push(N)}E.reverse();
if(K=="]")i.push({typ:"array",val:E});else{var k={};for(var y=0;y<E.length;y+=2)k[E[y].val.slice(1)]=E[y+1];
i.push({typ:"dict",val:k,maxl:1e3})}}else{var c=FromPS.getFromStacks(K,J);if(G)console.log("---",c);
if(c==null){if(C||K=="endstream")return!1;else{console.log("unknown operator",K,i,J);throw"e"}}else if(c.typ=="procedure")FromPS.addProc(c,T);
else if("array string dict null integer real boolean state name file".split(" ").indexOf(c.typ)!=-1)i.push(c);
else if(c.typ=="operator"){var R=c.val,z="known if ifelse currentpacking setpacking dict dup begin end put bind def undef where pop get exec ge stop stopped cvr string not and".split(" ");
if(FromPS._myOps[R]){FromPS.addProc(FromPS._myOps[R],T)}else if(R=="flattenpath"||R=="limitcheck"){}else if(R=="def"){var w=i.pop(),v=i.pop();
if(v==null&&C)return!1;v=FromPS.getDKey(v);J[J.length-1][v]=w}else if(R=="undef"||R=="known"){var a=FromPS.getDKey(i.pop()),X=i.pop(),o=X.val;
if(R=="undef")delete o[a];else i.push({typ:"boolean",val:X.typ!="null"&&o[a]!=null})}else if(R=="internaldict"){var F=i.pop().val;
i.push({typ:"dict",val:{},maxl:1e3})}else if(R=="dict"){var F=i.pop().val;i.push({typ:"dict",val:{},maxl:F})}else if(R=="string"){var F=i.pop().val;
i.push({typ:"string",val:new Array(F)})}else if(R=="readstring"||R=="readhexstring"){var r=i.pop(),F=r.val.length,bK=i.pop(),W=FromPS.GetFile(bK).val;
if(R=="readstring"){for(var y=0;y<F;y++)r.val[y]=W.buff[W.off+y];W.off+=F}else FromPS.readHex(W,F,r.val);
i.push(r,{typ:"boolean",val:!0})}else if(R=="readline"){var r=i.pop(),W=FromPS.GetFile(i.pop()).val,y=0;
if(FromPS.isEOL(W.buff[W.off]))W.off++;while(y<r.val.length){var H=W.buff[W.off];W.off++;if(H==null)throw"e";
if(FromPS.isEOL(H)){if(W.buff[W.off]==10)W.off++;break}r.val[y]=H;y++}i.push({typ:"string",val:r.val.slice(0,y)});
i.push({typ:"boolean",val:!0})}else if(R=="getinterval"){var bd=i.pop().val,aF=i.pop().val,bO=i.pop(),x=[];
if(bO.typ=="string"||bO.typ=="array")for(var y=0;y<bd;y++)x.push(bO.val[aF+y]);else throw"e";i.push({typ:bO.typ,val:x})}else if(R=="putinterval"){var bO=i.pop(),aF=i.pop().val,aE=i.pop();
if(aF+bO.val.length>=aE.val.length){}else if(bO.typ=="string")for(var y=0;y<bO.val.length;y++)aE.val[aF+y]=bO.val[y];
else throw"e"}else if(R=="token"){var bO=i.pop();if(bO.typ!="string")throw"e";var E=[];for(var y=0;y<bO.val.length;
y++){var ay=bO.val[y];if(ay==null)break;E.push(ay)}var c5={buff:new Uint8Array(E),off:0},V=A([{typ:"file",val:c5}],J),b_=[];
for(var y=c5.off;y<E.length;y++)b_.push(E[y]);i.push({typ:"string",val:b_},V,{typ:"boolean",val:!0})}else if(R=="array"){var F=i.pop().val;
i.push({typ:"array",val:new Array(F)})}else if(R=="aload"){var N=i.pop(),E=N.val;for(var y=0;y<E.length;
y++)i.push(E[y]);i.push(N)}else if(R=="astore"){var N=i.pop(),E=N.val;for(var y=0;y<E.length;y++)E[E.length-1-y]=i.pop();
i.push(N)}else if(R=="length"){var N=i.pop(),Z=N.typ,F=0;if(Z=="array")F=N.val.length;else if(Z=="procedure")F=N.val.length;
else if(Z=="dict")F=Object.keys(N.val).length;else if(Z=="string")F=N.val.length;else{console.log(N);
throw"e"}i.push({typ:"integer",val:F})}else if(R=="maxlength"){var c1=i.pop();i.push({typ:"integer",val:c1.maxl})}else if(R=="matrix"){i.push({typ:"array",val:FromPS.makeArr([1,0,0,1,0,0],"real")})}else if(R=="count"){i.push({typ:"integer",val:i.length})}else if(R=="mark"){i.push({typ:"mark"})}else if(R=="counttomark"||R=="cleartomark"){var a7=0;
while(a7<i.length&&i[i.length-1-a7].typ!="mark")a7++;if(R=="cleartomark")for(var y=0;y<a7+1;y++)i.pop();
else i.push({typ:"integer",val:a7})}else if(R=="dictstack"){var E=i.pop();for(var y=0;y<J.length;y++)E.val[y]={typ:"dict",val:J[y],maxl:1e3};
i.push(E)}else if(R=="countdictstack"){var an=0;for(var y=0;y<i.length;y++)if(i[y].typ=="dict")an++;
i.push({typ:"integer",val:an})}else if(R=="begin"){var N=i.pop(),o=N.val;if(o==null||N.typ!="dict"){console.log(N,J);
throw"e"}J.push(o)}else if(R=="end"){J.pop();if(J.length==3&&C)return!1}else if(R=="currentfile"){var bS;
for(var y=T.length-1;y>=0;y--)if(T[y].typ=="file"){bS=T[y];break}i.push({typ:"file",val:bS.val})}else if(R=="currentdict"){var o=J[J.length-1];
i.push({typ:"dict",val:o,maxl:1e3})}else if("currentpacking currentoverprint currentglobal currentsystemparams currentuserparams currentpagedevice".split(" ").indexOf(R)!=-1){var w=t[R.slice(7)];
i.push({typ:typeof w=="boolean"?"boolean":"dict",val:w})}else if(R=="gcheck"){var cB=i.pop();i.push({typ:"boolean",val:!1})}else if("setpacking setoverprint setglobal setsystemparams setuserparams setpagedevice".split(" ").indexOf(R)!=-1){t[R.slice(3)]=i.pop().val}else if(R=="currentflat"){i.push({typ:"real",val:1})}else if(R=="currentlinewidth"){i.push({typ:"real",val:l.lwidth})}else if(R=="currentdash"){i.push({typ:"array",val:FromPS.makeArr(l.dash,"integer")},{typ:"real",val:l.doff})}else if(R=="currentpoint"){var bQ=l.ctm.slice(0);
UDOC.M.invert(bQ);var aV=UDOC.M.multPoint(bQ,l.cpos);i.push({typ:"real",val:aV[0]},{typ:"real",val:aV[1]})}else if(R=="currentscreen"){i.push({typ:"int",val:60},{typ:"real",val:0},{typ:"real",val:0})}else if(R=="setscreen"){i.pop();
i.pop();i.pop()}else if(R=="currenthalftone"){i.push({typ:"dict",val:{},maxl:1e3})}else if(R=="currentblackgeneration"||R=="currentundercolorremoval"){i.push(t.funs[R.slice(7)])}else if(R=="currentcolortransfer"){for(var y=0;
y<4;y++)i.push(t.funs.blackgeneration)}else if(R=="findresource"){var a0=i.pop().val.slice(1),bl=i.pop(),a=bl.val.slice(1),cf;
if(a0=="Font"){t.res[a0].val[a]={typ:"dict",val:{FontType:{typ:"integer",val:1},FontMatrix:{typ:"array",val:FromPS.makeArr([1,0,0,1,0,0],"real")},FontName:bl,FID:{typ:"fontID",val:Math.floor(Math.random()*16777215)},Encoding:{typ:"array",val:[]},FontBBox:{typ:"array",val:FromPS.makeArr([0,0,1,1],"real")},PaintType:{typ:"integer",val:0}}}}if(a0=="Category"&&a=="Generic")cf={typ:"dict",val:{},maxl:1e3};
else if((a0=="ProcSet"||a0=="Procset")&&a=="CIDInit")cf={typ:"dict",val:{},maxl:1e3};else cf=t.res[a0].val[a];
if(cf==null)throw"e";i.push(cf)}else if(R=="resourcestatus"){var a0=i.pop().val.slice(1),a=i.pop().val.slice(1),cf=t.res[a0].val[a];
if(cf){i.push({typ:"integer",val:1});i.push({typ:"integer",val:Object.keys(cf.val).length})}i.push({typ:"boolean",val:cf!=null})}else if(R=="defineresource"){var a0=i.pop().val.slice(1),ca=i.pop();
if(i.length==0)return;var a=i.pop().val.slice(1);t.res[a0].val[a]=ca;i.push(ca)}else if(R=="undefineresource"){var a0=i.pop().val.slice(1),a=i.pop().val.slice(1);
delete t.res[a0].val[a]}else if(R=="resourceforall"){var a0=i.pop().val.slice(1),av=i.pop().val,bZ=i.pop(),bq=i.pop().val;
if(bq.length!=1||bq[0]!=42)throw"e";var bN=t.res[a0].val;for(var a in bN){var r=av.slice(0);for(var y=0;
y<a.length;y++)r[y]=a[y];FromPS.addProc(bZ,T);FromPS.addProc({typ:"procedure",val:[{typ:"string",val:r}]},T)}}else if(R=="image"||R=="colorimage"){var ch,az,a3,b3,bL=1,bE=!1,b6=[],top=i.pop();
i.push(top);if(R=="image"&&top.typ=="dict"){var a8=i.pop().val;ch=a8.Width.val;az=a8.Height.val;a3=a8.BitsPerComponent.val;
b3=FromPS.readArr(a8.ImageMatrix.val);bL=a8.NComponents?a8.NComponents.val:1;bE=a8.MultipleDataSources?a8.MultipleDataSources.val:!1;
b6=a8.DataSource.val;if(a8.DataSource.typ=="file")b6=[a8.DataSource]}else{if(R=="colorimage"){bL=i.pop().val;
bE=i.pop().val}if(bE){b6[2]=i.pop();b6[1]=i.pop();b6[0]=i.pop()}else b6=[i.pop()];var b3=FromPS.readArr(i.pop().val),a3=i.pop().val,az=i.pop().val,ch=i.pop().val}if(bL!=1&&bL!=3&&bL!=4)throw"unsupported number of channels "+bL;
if(a3!=8)throw"unsupported bits per channel: "+a3;var a2=new Uint8Array(ch*az*4);for(var y=0;y<a2.length;
y++)a2[y]=255;T.push({typ:"name",val:R+"---",ctx:[ch,az,a3,b3,bL,bE,a2,0,b6]});if(b6[0].typ=="procedure")for(var y=0;
y<b6.length;y++)FromPS.addProc(b6[y],T)}else if(R=="image---"||R=="colorimage---"){var bw=V.ctx,ch=bw[0],az=bw[1],a3=bw[2],b3=bw[3],bL=bw[4],bE=bw[5],a2=bw[6],a$=bw[7],b6=bw[8],aI=0;
if(bE){for(y=0;y<bL;y++){var bU=b6[y];if(bU.typ=="procedure")bU=i.pop().val;else bU=bU.val;aI=bU.length;
if(bL==4)for(var aX=0;aX<aI;aX++)a2[(a$+aX)*4+3-y]=bU[aX];if(bL==3)for(var aX=0;aX<aI;aX++)a2[(a$+aX)*4+2-y]=bU[aX]}}else{var bU;
if(b6[0].typ=="file")bU=FromPS.GetFile(b6[0]).val.buff;else bU=i.pop().val;aI=Math.floor(bU.length/3);
for(var aX=0;aX<aI;aX++){var aW=aX*3,aH=(a$+aX)*4;a2[aH+0]=bU[aW+0];a2[aH+1]=bU[aW+1];a2[aH+2]=bU[aW+2]}}a$+=aI;
FromPS.checkPageStarted(t,s);if(a$==ch*az){var aS=1/255;if(l.space=="/DeviceCMYK")for(var y=0;y<a2.length;
y+=4){var af=[a2[y]*aS,a2[y+1]*aS,a2[y+2]*aS,a2[y+3]*aS],cx=UDOC.C.cmykToRgb(af);a2[y]=cx[0]*255;a2[y+1]=cx[1]*255;
a2[y+2]=cx[2]*255;a2[y+3]=255}var aB=l.ctm.slice(),bB=b3.slice(0);UDOC.M.invert(bB);var a_=[ch,0,0,-az,0,az];
UDOC.M.concat(a_,bB);UDOC.M.concat(l.ctm,a_);s.PutImage(l,a2,ch,az);l.ctm=aB}else{bw[7]=a$;T.push(V);
if(b6[0].typ=="procedure")for(var y=0;y<b6.length;y++)FromPS.addProc(b6[y],T)}}else if(R=="makepattern"){var O=i.pop().val,c1=i.pop().val;
i.push({typ:"array",val:[c1,JSON.parse(JSON.stringify(O))]})}else if(R=="makefont"||R=="scalefont"){var aA=R=="makefont",bw=i.pop().val;
if(aA)bw=FromPS.readArr(bw);var aO=JSON.parse(JSON.stringify(i.pop())),cz=FromPS.readArr(aO.val.FontMatrix.val);
if(aA)UDOC.M.concat(cz,bw);else UDOC.M.scale(cz,bw,bw);aO.val.FontMatrix.val=FromPS.makeArr(cz);i.push(aO)}else if(R=="stringwidth"||R=="charpath"){if(R=="charpath")i.pop();
var cA=i.pop().val,r=FromPS.readStr(cA),bM=UDOC.M.getScale(l.font.Tm)/UDOC.M.getScale(l.ctm),b9=.55*bM*r.length;
if(R=="stringwidth")i.push({typ:"real",val:b9},{typ:"real",val:0});else UDOC.G.drawRect(l,0,0,b9,bM)}else if(R=="setfont"){var aO=i.pop().val;
l.font.Tf=aO.FontName.val.slice(1);l.font.Tm=FromPS.readArr(aO.FontMatrix.val)}else if(R=="setlinewidth")l.lwidth=i.pop().val;
else if(R=="setstrokeadjust")l.SA=i.pop().val;else if(R=="setlinecap")l.lcap=i.pop().val;else if(R=="setlinejoin")l.ljoin=i.pop().val;
else if(R=="setmiterlimit")l.mlimit=i.pop().val;else if(R=="setflat")l.dd.flat=i.pop();else if(R=="setdash"){l.doff=i.pop().val;
l.dash=FromPS.readArr(i.pop().val)}else if(R=="show"||R=="ashow"||R=="xshow"||R=="yshow"||R=="xyshow"||R=="widthshow"||R=="awidthshow"){if(R=="xshow"||R=="xyshow"||R=="yshow")i.pop();
var cA=i.pop().val,r=FromPS.readStr(cA);if(R=="awidthshow"){i.pop();i.pop();i.pop();i.pop()}if(R=="widthshow"){i.pop();
i.pop();i.pop()}if(R=="ashow"){i.pop();i.pop()}var bj=l.ctm;l.ctm=bj.slice(0);l.ctm[4]=l.cpos[0];l.ctm[5]=l.cpos[1];
FromPS.checkPageStarted(t,s);s.PutText(l,r,r.length*.55);l.cpos[0]+=r.length*UDOC.M.getScale(bj)*UDOC.M.getScale(l.font.Tm)*.55;
l.ctm=bj}else if(R=="cshow"){i.pop();i.pop()}else if(R=="currentcolorspace"){i.push({typ:"array",val:[{typ:"name",val:l.space}]})}else if(R=="setcolorspace"){var bf=i.pop();
l.space=bf.val;if(bf.typ=="array")l.space=bf.val[0].val;else if(bf.typ=="name")l.space=bf.val;else{console.log(bf);
throw"e"}}else if(R=="setcolor"||R=="_setHSB_"){var bm;if(l.space=="/Pattern"){var af=i.pop();if(af.typ!="array")throw"e";
var aV=af.val,O=FromPS.readArr(aV[1]);UDOC.M.concat(O,l.ctm);bm=FromPS.getPSShadingFill(aV[0].Shading,O)}else if(l.space=="/DeviceGray"){var b0=FromPS.nrm(i.pop().val);
bm=[b0,b0,b0]}else if(R=="_setHSB_"){var cB=i.pop().val,am=i.pop().val,az=i.pop().val,bc,b0,ae,y,bs,aV,at,al;
y=Math.floor(az*6);bs=az*6-y;aV=cB*(1-am);at=cB*(1-bs*am);al=cB*(1-(1-bs)*am);switch(y%6){case 0:bc=cB,b0=al,ae=aV;
break;case 1:bc=at,b0=cB,ae=aV;break;case 2:bc=aV,b0=cB,ae=al;break;case 3:bc=aV,b0=at,ae=cB;break;case 4:bc=al,b0=aV,ae=cB;
break;case 5:bc=cB,b0=aV,ae=at;break}bm=[FromPS.nrm(bc),FromPS.nrm(b0),FromPS.nrm(ae)]}else if(l.space=="/DeviceRGB"){var ae=i.pop().val,b0=i.pop().val,bc=i.pop().val;
bm=[FromPS.nrm(bc),FromPS.nrm(b0),FromPS.nrm(ae)]}else if(l.space=="/DeviceCMYK"){var c8=i.pop().val,aD=i.pop().val,O=i.pop().val,ba=i.pop().val;
bm=UDOC.C.cmykToRgb([ba,O,aD,c8])}else throw l.space;if(bm)l.colr=l.COLR=bm}else if(R=="currentrgbcolor"){for(var y=0;
y<3;y++)i.push({typ:"real",val:l.colr[y]})}else if(R=="currentcmykcolor"){for(var y=0;y<3;y++)i.push({typ:"real",val:1-l.colr[y]});
i.push({typ:"real",val:0})}else if(R=="currentgray"){i.push({typ:"real",val:(l.colr[0]+l.colr[1]+l.colr[2])/3})}else if(R=="clip"||R=="eoclip"){var aj=UDOC.G.getBB(l.pth.crds),cs=UDOC.G.getBB(l.cpth.crds);
if(UDOC.G.isBox(l.pth,aj)&&UDOC.G.insideBox(cs,aj)){}else if(UDOC.G.isBox(l.cpth,cs)&&UDOC.G.insideBox(aj,cs)){l.cpth=JSON.parse(JSON.stringify(l.pth))}else if(UDOC.G.isBox(l.pth,aj)&&UDOC.G.isBox(l.cpth,cs)){var aR=Math.min(aj[0],cs[0]),aT=Math.min(aj[1],cs[1]),bV=Math.min(aj[2],cs[2]),ax=Math.min(aj[3],cs[3]);
l.cpth={cmds:["M","L","L","L","Z"],crds:[aR,aT,bV,aT,bV,ax,aR,ax]}}else{l.cpth=JSON.parse(JSON.stringify(l.pth.crds.length>l.cpth.crds.length?l.pth:l.cpth))}}else if(R=="clippath"){l.pth=JSON.parse(JSON.stringify(l.cpth))}else if(R=="pathbbox"){var cj=l.pth.crds,aC=UDOC.G.getBB(cj);
cj=[aC[0],aC[1],aC[2],aC[1],aC[0],aC[3],aC[2],aC[3]];var bQ=l.ctm.slice(0);UDOC.M.invert(bQ);UDOC.M.multArray(bQ,cj);
aC=UDOC.G.getBB(cj);P[0]=aC[0];aC[0]=P[0];P[0]=aC[1];aC[1]=P[0];P[0]=aC[2];aC[2]=P[0];P[0]=aC[3];aC[3]=P[0];
aC=FromPS.makeArr(aC,"real");i.push(aC[0],aC[1],aC[2],aC[3])}else if(R=="newpath")UDOC.G.newPath(l);
else if(R=="stroke"){FromPS.checkPageStarted(t,s);s.Stroke(l);UDOC.G.newPath(l)}else if(R=="shfill"){var cv=l.colr,b1=l.pth,aV=i.pop().val,O=l.ctm.slice(0);
l.colr=FromPS.getPSShadingFill({typ:"dict",val:aV,maxl:1e3},O);FromPS.checkPageStarted(t,s);l.pth=l.cpth;
l.cpth=UDOC.G.rectToPath(t.bb);s.Fill(l);l.colr=cv;l.pth=b1}else if(R=="fill"||R=="eofill"){FromPS.checkPageStarted(t,s);
s.Fill(l,R=="eofill");UDOC.G.newPath(l)}else if(R=="showpage"){FromPS.checkPageStarted(t,s);s.ShowPage();
var ck=l.font;l=t.gst=UDOC.getState(t.bb);l.font=ck;t.pgOpen=!1}else if(R=="print"){var cA=i.pop().val,r=FromPS.readStr(cA);
s.Print(r)}else if(R=="_drawRect_"){var az=i.pop();if(az.typ!="real"&&az.typ!="integer")throw"e";az=az.val;
var ch=i.pop().val,aD=i.pop().val,c3=i.pop().val;UDOC.G.drawRect(l,c3,aD,ch,az)}else if(R=="closepath")UDOC.G.closePath(l);
else if(R=="moveto"||R=="lineto"){var aD=i.pop().val,c3=i.pop().val;if(R=="moveto")UDOC.G.moveTo(l,c3,aD);
else UDOC.G.lineTo(l,c3,aD)}else if(R=="rmoveto"||R=="rlineto"){var aD=i.pop().val,c3=i.pop().val,bQ=l.ctm.slice(0);
UDOC.M.invert(bQ);var aV=UDOC.M.multPoint(bQ,l.cpos);aD+=aV[1];c3+=aV[0];if(R=="rmoveto")UDOC.G.moveTo(l,c3,aD);
else UDOC.G.lineTo(l,c3,aD)}else if(R=="curveto"){var aU=i.pop().val,cw=i.pop().val,ac=i.pop().val,cc=i.pop().val,ax=i.pop().val,bV=i.length==0?0:i.pop().val;
UDOC.G.curveTo(l,bV,ax,cc,ac,cw,aU)}else if(R=="arc"||R=="arcn"){var ai=i.pop().val,ce=i.pop().val,bc=i.pop().val,aD=i.pop().val,c3=i.pop().val;
UDOC.G.arc(l,c3,aD,bc,ce*Math.PI/180,ai*Math.PI/180,R=="arcn")}else if(R=="concat"){var O=FromPS.readArr(i.pop().val);
UDOC.M.concat(O,l.ctm);l.ctm=O}else if(["translate","scale","rotate"].indexOf(R)!=-1){var cB=i.pop(),O,c3,aD;
if(cB.typ=="array"){O=FromPS.readArr(cB.val);aD=i.pop().val}else{O=[1,0,0,1,0,0];aD=cB.val}if(R!="rotate")c3=i.pop().val;
if(R=="translate")UDOC.M.translate(O,c3,aD);if(R=="scale")UDOC.M.scale(O,c3,aD);if(R=="rotate")UDOC.M.rotate(O,-aD*Math.PI/180);
if(cB.typ=="array")i.push({typ:"array",val:FromPS.makeArr(O,"real")});else{UDOC.M.concat(O,l.ctm);l.ctm=O}}else if(R=="concatmatrix"){var br=FromPS.readArr,c6=br(i.pop().val),cu=br(i.pop().val),aL=br(i.pop().val),O=aL.slice(0);
UDOC.M.concat(O,cu);O=FromPS.makeArr(O,"real");i.push({typ:"array",val:O})}else if(R=="invertmatrix"){var br=FromPS.readArr,cu=br(i.pop().val),aL=br(i.pop().val),O=aL.slice(0);
UDOC.M.invert(O);O=FromPS.makeArr(O,"real");i.push({typ:"array",val:O})}else if(R=="currentmatrix"||R=="defaultmatrix"){var O=i.pop(),cb=FromPS.makeArr(R=="currentmatrix"?l.ctm:[1,0,0,1,0,0],"real");
for(var y=0;y<6;y++)O.val[y]=cb[y];i.push(O)}else if(R=="setmatrix"){l.ctm=FromPS.readArr(i.pop().val)}else if(R=="cvi"){var N=i.pop(),cB=N.val,x=0;
if(N.typ=="real")x=Math.round(cB);else if(N.typ=="integer")x=cB;else throw"unknown type "+N.typ;i.push({typ:"integer",val:x})}else if(R=="cvr"){var N=i.pop(),cB=N.val,x=0;
if(N.typ=="real")x=cB;else if(N.typ=="integer")x=cB;else if(N.typ=="string")x=parseFloat(FromPS.readStr(cB));
else throw"unknown type "+N.typ;i.push({typ:"real",val:x})}else if(R=="cvs"){var r=i.pop(),aw=i.pop(),w="";
r.val=[];i.push(r);if(aw.typ=="real"||aw.typ=="integer"){if(Math.abs(Math.round(aw.val)-aw.val)<1e-6)w=Math.round(aw.val)+".0";
else w=(Math.round(aw.val*1e6)/1e6).toString()}else if(aw.typ=="name")w=aw.val;else throw"unknown var type: "+aw.typ;
for(var y=0;y<w.length;y++)r.val[y]=w.charCodeAt(y)}else if(R=="cvx"){var N=i.pop(),b5;if(N.typ=="array")b5={typ:"procedure",val:N.val};
else if(N.typ=="name")b5={typ:"name",val:N.val.slice(1)};else if(N.typ=="string"){b5={typ:"file",val:{off:0,buff:new Uint8Array(N.val)}}}else{console.log(N);
throw N.typ}i.push(b5)}else if(R=="cvlit"){var c=i.pop();if(c.typ=="procedure")i.push({typ:"array",val:c.val});
else i.push(c)}else if(R=="cvn"){i.push({typ:"name",val:FromPS.readStr(i.pop().val)})}else if("add sub mul div idiv bitshift mod exp atan".split(" ").indexOf(R)!=-1){var bA=i.pop(),aM=i.pop(),_=aM.val,S=bA.val,x=0,L="";
if(R=="add"||R=="sub"||R=="mul")L=aM.typ=="real"||bA.typ=="real"?"real":"integer";else if(R=="div"||R=="atan"||R=="exp")L="real";
else if(R=="mod"||R=="idiv"||R=="bitshift")L="integer";if(aM.typ=="real"){P[0]=_;_=P[0]}if(bA.typ=="real"){P[0]=S;
S=P[0]}if(R=="add")x=_+S;if(R=="sub")x=_-S;if(R=="mul")x=_*S;if(R=="div")x=_/S;if(R=="idiv")x=~~(_/S);
if(R=="bitshift")x=S>0?_<<S:_>>>-S;if(R=="mod")x=_%S;if(R=="exp")x=Math.pow(_,S);if(R=="atan")x=Math.atan2(_,S)*180/Math.PI;
if(L=="real"){P[0]=x;x=P[0]}i.push({typ:L,val:x})}else if("neg abs floor ceiling round truncate sqrt ln sin cos".split(" ").indexOf(R)!=-1){var aM=i.pop(),_=aM.val,x=0,L="";
if(R=="neg"||R=="abs"||R=="truncate"||R=="floor"||R=="ceiling"||R=="round")L=aM.typ;else if(R=="sqrt"||R=="sin"||R=="cos"||R=="ln")L="real";
if(aM.typ=="real"){P[0]=_;_=P[0]}if(R=="neg")x=-_;if(R=="abs")x=Math.abs(_);if(R=="floor")x=Math.floor(_);
if(R=="ceiling")x=Math.ceil(_);if(R=="round")x=Math.round(_);if(R=="truncate")x=Math.trunc(_);if(R=="sqrt")x=Math.sqrt(_);
if(R=="ln")x=Math.log(_);if(R=="sin")x=Math.sin(_*Math.PI/180);if(R=="cos")x=Math.cos(_*Math.PI/180);
if(R=="ln"&&_<=0)throw"e";if(L=="real"){P[0]=x;x=P[0]}i.push({typ:L,val:x})}else if("eq ge gt le lt ne".split(" ").indexOf(R)!=-1){var bA=i.pop(),aM=i.pop(),g=aM.typ,ah=bA.typ,_=aM.val,S=bA.val,x=!1;
if(R=="eq"||R=="ne"){var aN=aM.typ==bA.typ;if(aN&&["integer","real","name","null","dict"].indexOf(g)!=-1)x=_==S;
else if(g=="real"&&ah=="integer"||ah=="real"&&g=="integer")x=_==S;else if(!aN&&(aM.typ=="null"||bA.typ=="null"))x=!1;
else if(aN&&aM.typ=="string"){if(_.length!=S.length)x=!1;else{x=!0;for(var y=0;y<_.length;y++)if(_[y]!=S[y])x=!1}}else{console.log(R,aM,bA,aM.val==bA.val);
throw"e"}if(R=="ne")x=!x}else if(R=="ge")x=_>=S;else if(R=="gt")x=_>S;else if(R=="le")x=_<=S;else if(R=="lt")x=_<S;
i.push({typ:"boolean",val:x})}else if(["and","or"].indexOf(R)!=-1){var M=i.pop(),b=i.pop(),S=b.val,Y=M.val,j=b.typ=="integer",x;
if(R=="and")x=j?S&Y:S&&Y;if(R=="or")x=j?S|Y:S||Y;i.push({typ:j?"integer":"boolean",val:x})}else if(R=="not"){var ae=i.pop(),cB=ae.val,j=ae.typ=="integer",x=j?~cB:!cB;
i.push({typ:j?"integer":"boolean",val:x})}else if(R=="if"){var bZ=i.pop(),B=i.pop().val;if(B)FromPS.addProc(bZ,T)}else if(R=="ifelse"){var aG=i.pop(),bv=i.pop(),B=i.pop().val;
FromPS.addProc(B?bv:aG,T)}else if(R=="exec"||R=="stopped"){var c=i.pop();if(R=="stopped")FromPS.addProc({typ:"procedure",val:[{typ:"boolean",val:!1}]},T);
if(c.typ=="procedure")FromPS.addProc(c,T);else if(c.typ=="name"||c.typ=="operator"||c.typ=="integer"||c.typ=="real"||c.typ=="array")FromPS.addProc({typ:"procedure",val:[c]},T);
else{console.log(c);throw"unknown executable type: "+c.typ}}else if(R=="stop"){var U=T[T.length-1];if(U.typ=="procedure"&&U.off!=0)T.pop()}else if(R=="dup"){var cB=i.pop();
i.push(cB,cB)}else if(R=="exch"){i.push(i.pop(),i.pop())}else if(R=="copy"){var an=i.pop();if(an.typ=="integer"){var ar=[];
for(var y=0;y<an.val;y++)ar[an.val-1-y]=i.pop();for(var y=0;y<an.val;y++)i.push(ar[y]);for(var y=0;y<an.val;
y++)i.push(ar[y])}else if(an.typ=="array"){var O=i.pop().val;for(var y=0;y<O.length;y++){an.val[y]=O[y];
if(O[y].val==null){console.log(J);throw"e"}}i.push(an)}else if(an.typ=="dict"){var O=i.pop().val;for(var u in O){an.val[u]=O[u]}i.push(an)}else throw"e"}else if(R=="roll"){var aX=i.pop().val,an=i.pop().val,ar=[];
for(var y=0;y<an;y++)ar.push(i.pop());ar.reverse();aX=(an+aX)%an;for(var y=0;y<aX;y++)ar.unshift(ar.pop());
for(var y=0;y<an;y++)i.push(ar[y])}else if(R=="index"){var an=i.pop().val;i.push(i[i.length-1-an])}else if(R=="anchorsearch"){var $=i.pop(),be=i.pop(),cn=$.val,r=be.val,ci=!0;
if(cn.length<=r.length){for(var y=0;y<cn.length;y++)if(cn[y]!=r[y])ci=!1}else ci=!1;if(ci)i.push({typ:"string",val:r.slice(cn.length)},$);
else i.push(be);i.push({typ:"boolean",val:ci})}else if(R=="transform"||R=="itransform"||R=="dtransform"||R=="idtransform"){var O=i.pop(),aD=0,c3=0;
if(O.typ=="array"){O=FromPS.readArr(O.val);aD=i.pop().val}else{aD=O.val;O=l.ctm.slice(0)}if(R=="itransform"||R=="idtransform"){UDOC.M.invert(O)}c3=i.pop().val;
if(R.endsWith("dtransform")){O[4]=0;O[5]=0}var bG=UDOC.M.multPoint(O,[c3,aD]);i.push({typ:"real",val:bG[0]},{typ:"real",val:bG[1]})}else if(R=="pop"||R=="srand"||R=="=="){i.pop()}else if(R=="rand"){i.push({typ:"integer",val:Math.floor(Math.random()*2147483647)})}else if(R=="put"){var K=i.pop(),N=i.pop(),c=i.pop(),L=c.typ;
if(L=="array"){if(N.typ!="integer")throw"e";c.val[N.val]=K}else if(L=="dict"){var v=FromPS.getDKey(N);
c.val[v]=K}else if(L=="string")c.val[N.val]=K.val;else throw L+" e"}else if(R=="get"){var N=i.pop(),c=i.pop(),L=c.typ;
if(L=="string")i.push({typ:"integer",val:c.val[N.val]});else if(L=="array"){var w=c.val[N.val];if(w==null)throw"e";
i.push(w)}else if(L=="dict"){var c8=FromPS.getDKey(N),cB=c.val[c8];if(cB==null){throw"e"}else i.push(cB)}else throw"getting from unknown type "+c.typ}else if(R=="load"){var a=i.pop().val.slice(1),K=FromPS.getFromStacks(a,J);
if(K==null){console.log(a,J);throw"e"}i.push(K)}else if(R=="where"){var a=i.pop().val.slice(1),o=FromPS.where(a,J);
if(o!=null)i.push({typ:"dict",val:o,maxl:1e3});i.push({typ:"boolean",val:o!=null})}else if(R=="store"){var K=i.pop(),a=i.pop().val.slice(1),o=FromPS.where(a,J);
if(o==null)o=J[J.length-1];o[a]=K}else if(R=="repeat"){var bZ=i.pop(),a9=i.pop().val;T.push({typ:"name",val:R+"---",ctx:{proc:bZ,cur:0,cnt:a9}})}else if(R=="repeat---"){var q=V.ctx;
if(q.cur<q.cnt){T.push(V);FromPS.addProc(q.proc,T);q.cur++}}else if(R=="for"){var bZ=i.pop(),a4=i.pop(),b4=i.pop(),c7=i.pop();
T.push({typ:"name",val:R+"---",ctx:{proc:bZ,isInt:c7.typ=="integer"&&b4.typ=="integer",init:c7.val,inc:b4.val,limit:a4.val}})}else if(R=="for---"){var q=V.ctx;
if(q.isInt){if(q.inc>0&&q.init<=q.limit||q.inc<0&&q.init>=q.limit){T.push(V);FromPS.addProc(q.proc,T);
i.push({typ:"integer",val:q.init});q.init+=q.inc}}else{var I=new Float32Array(1);I[0]=q.limit;q.limit=I[0];
I[0]=q.inc;q.inc=I[0];I[0]=q.init;if(q.inc>0&&I[0]<=q.limit||q.inc<0&&I[0]>=q.limit){T.push(V);FromPS.addProc(q.proc,T);
i.push({typ:"real",val:I[0]});I[0]+=q.inc;q.init=I[0]}}}else if(R=="loop"){var bZ=i.pop();T.push({typ:"name",val:R+"---",ctx:{proc:bZ}})}else if(R=="loop---"){var q=V.ctx;
T.push(V);FromPS.addProc(q.proc,T)}else if(R=="pathforall"){var e=i.pop(),c4=i.pop(),ak=i.pop(),a5=i.pop()}else if(R=="forall"){var bZ=i.pop(),c=i.pop(),q=[bZ,c,0];
T.push({typ:"name",val:R+"---",ctx:q})}else if(R=="forall---"){var q=V.ctx,bZ=q[0],c=q[1],y=q[2];if(c.typ=="dict"){var bI=Object.keys(c.val);
if(y<bI.length){T.push(V);FromPS.addProc(bZ,T);i.push({typ:"name",val:"/"+bI[y]});var w=c.val[bI[y]];
if(w==null)throw"e";i.push(w==null?{typ:"null",val:null}:w);q[2]++}}else if(c.typ=="procedure"||c.typ=="array"){if(y<c.val.length){T.push(V);
FromPS.addProc(bZ,T);var bz=c.val[y];i.push(bz==null?{typ:"null",val:null}:bz);q[2]++}}else{console.log(bZ,c);
throw"forall: unknown type: "+c.typ}}else if(R=="exit"){var y=T.length-1;while(y!=0&&(T[y].typ!="name"||!T[y].val.endsWith("---")))y--;
if(y!=0)while(T.length>y)T.pop()}else if(R=="bind"){}else if(R=="xcheck"){var c=i.pop(),Z=c.typ;i.push({typ:"boolean",val:Z=="procedure"})}else if(R=="status"){var r=i.pop();
i.push({typ:"boolean",val:!1})}else if(R=="cachestatus"){for(var y=0;y<7;y++)i.push({typ:"integer",val:5e3})}else if(R=="setcachelimit"){i.pop()}else if(R=="type"){var N=i.pop(),cq={name:"nametype",dict:"dicttype",boolean:"booleantype",procedure:"operatortype",string:"stringtype",null:"nulltype",integer:"integertype",array:"arraytype",operator:"operatortype",real:"realtype"};
if(cq[N.typ]==null){console.log(N);throw N.typ}i.push({typ:"name",val:"/"+cq[N.typ]})}else if(R=="save"){i.push({typ:"state",val:JSON.parse(JSON.stringify(l))})}else if(R=="restore"){l=t.gst=i.pop().val}else if(R=="clipsave"){l.cpstack.push(JSON.parse(JSON.stringify(l.cpth)))}else if(R=="cliprestore"){l.cpath=l.cpstack.pop()}else if(R=="gsave"){d.push(JSON.parse(JSON.stringify(l)))}else if(R=="grestore"||R=="grestorePDF"){var ct=l.pth;
if(d.length!=0)l=t.gst=d.pop();else l=UDOC.getState();if(R=="grestorePDF")l.pth=ct}else if(R=="grestoreall"){while(d.length!=0)l=t.gst=d.pop()}else if(R=="usertime"||R=="realtime")i.push({typ:"integer",val:R=="usertime"?Date.now()-h:Date.now()});
else if(R=="flush"||R=="readonly"||R=="executeonly"){}else if(R=="flushfile"){FromPS.GetFile(i.pop())}else if(R=="filter"){var bT=i.pop().val,bX;
if(bT=="/SubFileDecode"){var r=i.pop();if(r.typ!="string")throw"e";var bd=i.pop().val;r=r.val;bX=[bT,r,bd]}else bX=[bT];
var cp=i.pop();i.push({typ:"file",val:{buff:new Uint8Array,off:0},_flt:bX,_src:cp})}else if(R=="begincmap"||R=="endcmap"){}else if(R=="begincodespacerange"||R=="beginbfrange"||R=="beginbfchar"){t.cmnum=i.pop().val}else if(R=="endcodespacerange"||R=="endbfrange"||R=="endbfchar"){var e=R=="endbfrange"?3:2,bg=R.slice(3),o=J[J.length-1],a3=0;
if(o[bg]==null)o[bg]=[];for(var y=0;y<t.cmnum;y++){var by=[];for(var aX=e-1;aX>=0;aX--){var bk=i.pop(),w;
if(bk==null&&C)return!1;var bx=bk.val;if(bk.typ=="string"){w=FromPS.strToInt(bx);if(aX==0)a3=bx.length}else{w=[];
for(var c8=0;c8<bx.length;c8++)w.push(FromPS.strToInt(bx[c8].val))}by[aX]=w}o[bg]=o[bg].concat(by)}if(R!="endcodespacerange")o.bpc=a3}else if(m)m(R,i,J,T,d,t,s);
else{console.log(K,R);console.log(J,i);throw"e"}}else throw c.typ}return!0};FromPS.strToInt=function(i){var J=0;
for(var T=0;T<i.length;T++)J=J<<8|i[T];return J};FromPS.getDKey=function(i){if(i.typ=="name")return i.val.slice(1);
if(i.typ=="string")return FromPS.readStr(i.val);return i.val};FromPS.GetFile=function(i){if(i._flt==null||i.val.off<i.val.buff.length)return i;
FromPS.GetFile(i._src);var J=i._src.val,T=i._flt,d=T[0],t;if(d=="/ASCII85Decode")t=FromPS.F.ASCII85Decode(J);
else if(d=="/RunLengthDecode")t=FromPS.F.RunLengthDecode(J);else if(d=="/FlateDecode")t=FromPS.F.FlateDecode(J);
else if(d=="/LZWDecode")t=FromPS.F.LZWDecode(J);else if(d=="/SubFileDecode"){var m=T[1],C=T[2],h=J.off,P=0;
while(h<J.buff.length){var A=0;while(A<m.length&&J.buff[h+A]==m[A])A++;if(A==m.length){if(P==C)break;
P++}h++}t=J.buff.slice(J.off,h);J.off=h}else throw d;i.val={buff:t,off:0};return i};FromPS.checkPageStarted=function(i,J){if(!i.pgOpen){J.StartPage(i.bb[0],i.bb[1],i.bb[2],i.bb[3]);
i.pgOpen=!0}};FromPS.getPSShadingFill=function(i,J){function T(t){var s,m=t.typ,C=t.val;if(m=="dict"){s={};
for(var h in C)s["/"+h]=T(C[h])}else if(m=="array"){s=[];for(var P=0;P<C.length;P++)s.push(T(C[P]))}else if(m=="string"){s="";
for(var P=0;P<C.length;P++)s+=String.fromCharCode(C[P])}else if(["boolean","integer","real","name"].indexOf(m)!=-1)s=C;
else if(m=="procedure"){var A="";for(var P=0;P<C.length;P++)A+=C[P].val+" ";A="{ "+A+"}";var l=new Uint8Array(A.length);
for(var P=0;P<A.length;P++)l[P]=A.charCodeAt(P);s={"/FunctionType":4,"/Domain":[0,1],"/Range":[0,1,0,1,0,1,0,1],"/Length":A.length,stream:l}}else{console.log(t);
throw"e"}return s}var d=T(i);return FromPS.getShadingFill(d,J)};FromPS.F={HexDecode:function(i){var J=[];
FromPS.readHex(i,1e9,J);return new Uint8Array(J)},ASCII85Decode:function(i){var J=[85*85*85*85,85*85*85,85*85,85,1],T=[],d=0,t=0,s=i.off,m=i.buff,C=m.length;
while(!0){var P=m[s++];if(FromPS.isWhite(P)){}else if(P==126){var A=T.length;if(d!=0){for(var l=d;l<5;
l++)t+=84*J[d];for(var l=1;l<d;l++)T.push(t>>>32-l*8&255)}i.off=s+1;return new Uint8Array(T)}else if(P==122){T.push(0);
T.push(0);T.push(0);T.push(0)}else{t+=(P-33)*J[d];d++;if(d==5){T.push(t>>>24&255);T.push(t>>>16&255);
T.push(t>>>8&255);T.push(t>>>0&255);d=0;t=0}}}},RunLengthDecode:function(i){var J=[],T=i.off,d=i.buff.length;
while(T<d){var t=i.buff[T];T++;if(t==128){break}if(t<128){for(var s=0;s<t+1;s++)J.push(i.buff[T+s]);
T+=t+1}else{for(var s=0;s<257-t;s++)J.push(i.buff[T]);T++}}i.off=T;return new Uint8Array(J)},FlateDecode:function(i){var J=i.buff;
if(J.length==0)return J;var T=new Uint8Array(J.buffer,J.byteOffset+i.off+2,J.length-2),d=pako.inflateRaw(T);
return d},LZWDecode:function(i){var J=new Uint8Array((i.buff.length-i.off)*20),T=UTIF.decode._decodeLZW(i.buff,i.off,i.buff.length-i.off,J,0,8);
return J.slice(0,T)},_myLZW:function(){var i={},J=function(d,t,s,m,C){for(var P=0;P<C;P+=4){s[m+P]=d[t+P];
s[m+P+1]=d[t+P+1];s[m+P+2]=d[t+P+2];s[m+P+3]=d[t+P+3]}},T=function(d,t,s,m){if(!i.c){var C=new Uint32Array(65535),P=new Uint16Array(65535),A=new Uint8Array(2e6);
for(var l=0;l<256;l++){A[l<<2]=l;C[l]=l<<2;P[l]=1}i.c=[C,P,A]}var V=i.c[0],Z=i.c[1],A=i.c[2],G=258,D=258<<2,Q=9,n=t<<3,f=256,E=257,N=0,k=0,z=0;
while(!0){N=d[n>>>3]<<16|d[n+8>>>3]<<8|d[n+16>>>3];k=N>>24-(n&7)-Q&(1<<Q)-1;n+=Q;if(k==E)break;if(k==f){Q=9;
G=258;D=258<<2;N=d[n>>>3]<<16|d[n+8>>>3]<<8|d[n+16>>>3];k=N>>24-(n&7)-Q&(1<<Q)-1;n+=Q;if(k==E)break;
s[m]=k;m++}else if(k<G){var a=V[k],X=Z[k];J(A,a,s,m,X);m+=X;if(z>=G){V[G]=D;A[V[G]]=a[0];Z[G]=1;D=D+1+3&~3;
G++}else{V[G]=D;var F=V[z],r=Z[z];J(A,F,A,D,r);A[D+r]=A[a];r++;Z[G]=r;G++;D=D+r+3&~3}if(G+1==1<<Q)Q++}else{if(z>=G){V[G]=D;
Z[G]=0;G++}else{V[G]=D;var F=V[z],r=Z[z];J(A,F,A,D,r);A[D+r]=A[D];r++;Z[G]=r;G++;J(A,D,s,m,r);m+=r;D=D+r+3&~3}if(G+1==1<<Q)Q++}z=k}return m};
return T}()};FromPS.B={readUshort:function(i,J){return i[J]<<8|i[J+1]},readUint:function(i,J){return i[J]*(256*256*256)+(i[J+1]<<16|i[J+2]<<8|i[J+3])},readASCII:function(i,J,T){var d="";
for(var t=0;t<T;t++)d+=String.fromCharCode(i[J+t]);return d}};FromPS.nrm=function(i){return Math.max(0,Math.min(1,i))};
FromPS.makeArr=function(i,J){var T=[];for(var d=0;d<i.length;d++)T.push({typ:J,val:i[d]});return T};
FromPS.readArr=function(i){var J=[];for(var T=0;T<i.length;T++)J.push(i[T].val);return J};FromPS.makeStr=function(i){var J=[];
for(var T=0;T<i.length;T++)J.push(i.charCodeAt(T));return J};FromPS.readStr=function(i){var J="";for(var T=0;
T<i.length;T++)J+=String.fromCharCode(i[T]);return J};FromPS.getFromStacks=function(i,J){var T=J.length-1;
while(T>=0){if(J[T][i]!=null)return J[T][i];T--}return null};FromPS.where=function(i,J){var T=J.length-1;
while(T>=0){if(J[T][i]!=null)return J[T];T--}return null};FromPS.skipWhite=function(i){var J=i.off,T=i.buff,d=FromPS.isWhite;
while(d(T[J])||T[J]==37){while(d(T[J]))J++;if(T[J]==37){while(J<T.length&&!FromPS.isEOL(T[J]))J++;J++}}i.off=J};
FromPS.getToken=function(i,J){if(i.length==0)return null;var T=i[i.length-1];if(T.typ=="procedure"){var d=T.val[T.off];
T.off++;if(T.off==T.val.length)i.pop();return d}if(T.typ=="name"){i.pop();return T}var t=FromPS.getFToken(T.val,J);
while(t==null&&i.length>1){i.pop();if(i.length!=0)t=FromPS.getFToken(i[i.length-1].val,J)}return t};
FromPS.getFToken=function(i,J){FromPS.skipWhite(i);var T=FromPS.isWhite,d=FromPS.isSpecl,t=i.off,s=i.buff,m=null;
if(t>=s.length)return null;var C=s[t],P=String.fromCharCode(C);t++;if(P=="("){var A=0,l=t;while(!(s[l]==41&&A==0)){var V=s[l];
if(V==40)A++;else if(V==41)A--;else if(V==92)l++;l++}var Z=[];for(var K=0;K<l-t;K++)Z.push(s[t+K]);t=l+1;
Z=FromPS.getString(Z);m={typ:"string",val:Z}}else if(P=="{"||P=="}"||P=="["||P=="]"){m={typ:"name",val:P}}else if(P=="<"&&s[t]==60||P==">"&&s[t]==62){m={typ:"name",val:P=="<"?"<<":">>"};
t++}else if(P=="<"){var Z;if(s[t]=="~".charCodeAt(0)){i.off=t+1;var G=FromPS.F.ASCII85Decode(i);Z=[];
for(var K=0;K<G.length;K++)Z.push(G[K]);t=i.off}else{var l=t;while(s[l]!=62)l++;var Z=[];FromPS.readHex({buff:s,off:t},1e9,Z);
t=l+1}m={typ:"string",val:Z}}else{var l=t;while(l<s.length&&!T(s[l])&&(!d(s[l])||s[l]==47&&s[l-1]==47&&l==t&&J))l++;
var D=FromPS.B.readASCII(s,t-1,l-t+1);t=l;var Q=parseFloat(D);if(!1){}else if(D=="true"||D=="false")m={typ:"boolean",val:D=="true"};
else if(!isNaN(Q)){var n=new Float32Array(1);n[0]=Q;Q=n[0];m={typ:D.indexOf(".")==-1?"integer":"real",val:Q}}else{if(D.slice(0,2)=="//"&&J){var f=D.slice(2),E=FromPS.getFromStacks(f,J);
if(E!=null)m=E;else m={typ:"name",val:D}}else m={typ:"name",val:D}}}i.off=t;return m};FromPS.isSpecl=function(i){return[40,41,60,62,91,93,123,125,37,47].indexOf(i)!=-1};
FromPS.isWhite=function(i){return i==0||i==9||i==10||i==12||i==13||i==32};FromPS.isEOL=function(i){return i==10||i==13};
FromPS.getString=function(i){var J=[],T="n,r,t,b,f,\\,(,), ,/".split(","),d=["\n","\r","\t","\b","\f","\\","(",")"," ","/"];
for(var t=0;t<i.length;t++){var s=i[t],m=String.fromCharCode(s);if(m=="\\"){var C=String.fromCharCode(i[t+1]);
t++;if(C=="\r"||C=="\n")continue;var P=T.indexOf(C);if(P!=-1)J.push(d[P].charCodeAt(0));else{var A=C+String.fromCharCode(i[t+1])+String.fromCharCode(i[t+2]);
t+=2;J.push(parseInt(A,8))}}else J.push(s)}return J};FromPS.makeString=function(i){var J="n r t b f \\ ( )".split(" "),T=["\n","\r","\t","\b","\f","\\","(",")"],d=[];
for(var t=0;t<i.length;t++){var s=i[t],m=T.indexOf(String.fromCharCode(s));if(m==-1)d.push(s);else d.push(92,J[m].charCodeAt(0))}return d};
FromPS.readHex=function(i,J,T){var d=0,t=-1,s=i.off,m=i.buff.length;while(d!=J&&s<m){var C=i.buff[s],A=0;
s++;if(47<C&&C<58)A=C-48;else if(96<C&&C<103)A=10+C-97;else if(64<C&&C<71)A=10+C-65;else if(C==62)break;
else if(FromPS.isWhite(C))continue;else throw"e";if(t==-1)t=A;else{T[d]=t<<4|A;t=-1;d++}}i.off=s};FromPS.getShadingFill=function(i,J){var T=i["/ShadingType"],d=i["/ColorSpace"],t=i["/Extend"],s=i["/Coords"]?i["/Coords"].slice(0):null,m="",h;
if(t==null)t=[!1,!1];if(T==2)m="lin";else if(T==3)m="rad";else{console.log("Unknown shading type",T);
return}var C=i["/Function"];if(C instanceof Array){var P=C.length,A;for(var l=0;l<P;l++){var V=FromPS.getGrad(C[l],"/DeviceGray");
if(l==0)A=V;else{var K=A.length;for(var G=0;G<K;G++)A[G][1][l]=V[G][1][0]}}if(d=="/DeviceCMYK")for(var l=0;
l<A.length;l++)A[l][1]=UDOC.C.cmykToRgb(A[l][1]);h=A}else h=FromPS.getGrad(C,d);if(m=="rad"&&s[2]>s[5]){s=s.slice(3).concat(s.slice(0,3));
t.reverse();h.reverse();for(var l=0;l<h.length;l++)h[l][0]=1-h[l][0]}if(!t[0]&&m!="rad"){var D=h[0];
D[0]+=.002;h.unshift([.001,D[1].slice(),0])}if(!t[1]){var D=h[h.length-1];D[0]-=.002;h.push([0,999,D[1].slice(),0])}var Q={typ:m,mat:J,grad:h,crds:s};
return Q};FromPS.getGrad=function(i,J){var T=FromPS._normColor,d=i["/Functions"],t=i["/FunctionType"],s=i["/Bounds"],m=i["/Encode"],C;
if(t==0){C=[];var h=Math.min(4,i["/Size"][0]);for(var P=0;P<=h;P++)C.push([P/h,T(i,[P/h],J)])}else if(t==2)C=[[0,T(i,[0],J)],[1,T(i,[1],J)]];
else if(t==3){var A=0;C=[];if(s.length==0||s[0]>0)C.push([0,T(d[0],[m[0]],J)]);for(var P=0;P<s.length;
P++)C.push([s[P],T(d[P],[m[2*P+1]],J)]);if(s.length==0||s[s.length-1]<1)C.push([1,T(d[d.length-1],[m[m.length-1]],J)])}else if(t==4){C=[];
for(var P=0;P<5;P++)C.push([P/5,T(i,[P/5],J)])}return C};FromPS._normColor=function(i,J,T){var d="/DeviceCMYK",t="/DeviceRGB",s,m=FromPS.Func(i,J);
if(T[3]&&T[3]["/Length"]){m=FromPS.Func(T[3],m);if(T[2]==d||m.length==4)s=d;else if(T[2]==t)s=t;else if(T[2]&&T[2][0]=="/Lab")s="/Lab";
else if(T[2]&&T[2][1]&&T[2][1]["/Alternate"]&&T[2][1]["/Alternate"][0]=="/Lab")s="/Lab";else if(T[2]&&T[2][1]&&T[2][1]["/Alternate"]&&T[2][1]["/Alternate"]==t)s=t;
else{console.log(m,T);throw"unknown color profile"}}else if(T[0]=="/ICCBased"&&T[1]){var C=T[1]["/N"];
if(C==4)s=d;else if(C==3)s=t;else throw C}else if(T[0]=="/Separation"){m=FromPS._readSeparation(T,m[0]);
s=t}else if(T.length==1)s=T[0];else if(T[0]=="/Lab")s="/Lab";else if(T[2]==d)s=d;else s=T;if(s==t)m=m;
else if(s==d)m=UDOC.C.cmykToRgb(m);else if(s=="/DeviceGray")m=[m[0],m[0],m[0]];else if(s=="/Lab")m=UDOC.C.labToRgb(m);
else throw"Unknown color space "+s;return m};FromPS._readSeparation=function(i,J){var T=FromPS.Func(i[3],[J]),d;
if(i&&i[2]=="/DeviceCMYK")d=UDOC.C.cmykToRgb(T);else if(i&&i[2]=="/DeviceGray")d=[T[0],T[0],T[0]];else if(i&&i[2]&&i[2][0]&&i[2][0]=="/Lab")d=UDOC.C.labToRgb(T);
else{d=T}return d};FromPS.Func=function(i,J){var T=FromPS.intp,d=i["/Domain"],t=i["/Range"],m=i["/FunctionType"],C=[];
for(var h=0;h<J.length;h++)J[h]=Math.max(d[2*h],Math.min(d[2*h+1],J[h]));if(m==0){var P=i["/Encode"],A=i["/Size"],l=i["/Decode"],V=t.length/2;
if(P==null)P=[0,A[0]-1];if(l==null)l=t;for(var h=0;h<J.length;h++){var K=T(J[h],d[2*h],d[2*h+1],P[2*h],P[2*h+1]);
J[h]=Math.max(0,Math.min(A[h]-1,K))}var G=i["/DataSource"];for(var D=0;D<V;D++){var Q=Math.round(J[0]),n;
if(G)n=G.charCodeAt(V*Q+D);else n=FromPS.GS(i)[V*Q+D];n=T(n,0,255,l[2*D],l[2*D+1]);C.push(n)}}else if(m==2){var f=i["/C0"],E=i["/C1"],N=i["/N"];
if(f==null)f=[0];if(E==null)E=[1];var Q=J[0];for(var h=0;h<f.length;h++)C[h]=f[h]+Math.pow(Q,N)*(E[h]-f[h])}else if(m==4){var k=FromPS._getEnv([0,0,0,0]),w=!0;
k.pgOpen=!0;var c=[],R=[],G=FromPS._getDictStack([],{}),z=[];z.push({typ:"file",val:{buff:FromPS.GS(i),off:0}});
while(w)w=FromPS.step(R,G,z,c,k,{},FromPS.operator);var v=R.pop();v.off=0;z.push(v);for(var h=0;h<J.length;
h++)R.push({typ:"real",val:J[h]});w=!0;while(w)w=FromPS.step(R,G,z,c,k,{},FromPS.operator);for(var h=0;
h<R.length;h++)C.push(R[h].val)}if(t)for(var h=0;h<C.length;h++)C[h]=Math.max(t[2*h],Math.min(t[2*h+1],C[h]));
return C};FromPS.intp=function(i,J,T,d,t){return d+(i-J)*(t-d)/(T-J)};FromPS.GS=function(i){if(i.stream==null){var J=i.buff;
delete i.buff;var T=i["/Filter"],d=i["/DecodeParms"];if(T!=null){var t=typeof T=="string"?[T]:T,s=!1;
for(var m=0;m<t.length;m++){var C=t[m],P={buff:J,off:0};if(C=="/FlateDecode"){J=FromPS.F.FlateDecode(P)}else if(C=="/RunLengthDecode"){J=FromPS.F.RunLengthDecode(P)}else if(C=="/LZWDecode"){J=FromPS.F.LZWDecode(P)}else if(C=="/ASCIIHexDecode"){J=FromPS.F.HexDecode(P)}else if(C=="/ASCII85Decode"||C=="/A85"){J=FromPS.F.ASCII85Decode(P)}else if(C=="/DCTDecode"||C=="/CCITTFaxDecode"||C=="/JPXDecode"||C=="/JBIG2Decode"){s=!0}else{console.log(C,J);
throw"e"}}if(!s)delete i["/Filter"]}if(d!=null){if(d instanceof Array)d=d[0];if(d&&d["/Predictor"]!=null&&d["/Predictor"]!=1){var A=d["/Columns"],l=d["/Colors"]?d["/Colors"]:1,V=l*A,Z=J.length/(V+1);
FromPS._filterZero(J,0,A,Z,l);J=J.slice(0,Z*V)}}i.stream=J}return i.stream};FromPS._filterZero=function(i,J,T,d,t){var s=t*T,m=FromPS._paeth;
for(var h=0;h<d;h++){var P=J+h*s,A=P+h+1,l=i[A-1];if(l==0)for(var V=0;V<s;V++)i[P+V]=i[A+V];else if(l==1){for(var V=0;
V<t;V++)i[P+V]=i[A+V];for(var V=t;V<s;V++)i[P+V]=i[A+V]+i[P+V-t]&255}else if(h==0){for(var V=0;V<t;V++)i[P+V]=i[A+V];
if(l==2)for(var V=t;V<s;V++)i[P+V]=i[A+V]&255;if(l==3)for(var V=t;V<s;V++)i[P+V]=i[A+V]+(i[P+V-t]>>1)&255;
if(l==4)for(var V=t;V<s;V++)i[P+V]=i[A+V]+m(i[P+V-t],0,0)&255}else{if(l==2){for(var V=0;V<s;V++)i[P+V]=i[A+V]+i[P+V-s]&255}if(l==3){for(var V=0;
V<t;V++)i[P+V]=i[A+V]+(i[P+V-s]>>1)&255;for(var V=t;V<s;V++)i[P+V]=i[A+V]+(i[P+V-s]+i[P+V-t]>>1)&255}if(l==4){for(var V=0;
V<t;V++)i[P+V]=i[A+V]+m(0,i[P+V-s],0)&255;for(var V=t;V<s;V++)i[P+V]=i[A+V]+m(i[P+V-t],i[P+V-s],i[P+V-t-s])&255}}}return i};
FromPS._paeth=function(i,J,T){var d=i+J-T,t=Math.abs(d-i),s=Math.abs(d-J),m=Math.abs(d-T);if(t<=s&&t<=m)return i;
else if(s<=m)return J;return T};function FromPDF(){}FromPDF.indexOfXref=function(i){var J=i.length-3;
while(FromPS.B.readASCII(i,J,3)!="%%E")J--;while(i[J-1]==37)J--;var T=J;J--;while(FromPS.isEOL(i[J])||i[J]==32)J--;
while(!FromPS.isEOL(i[J])&&i[J]!=32)J--;J++;var d=parseInt(FromPS.B.readASCII(i,J,T-J));if(isNaN(d))throw"no xref";
return d};FromPDF.Parse=function(i,J){i=new Uint8Array(i);var T=0;while(i[T]==32)T++;if(T!=0)i=new Uint8Array(i.buffer,i.byteOffset+T,i.length-T);
var d=FromPDF.indexOfXref(i),t=[],s=FromPDF.readXrefTrail(i,d,t),m=-1;for(var C=0;C<t.length;C++)if(t[C]==null)m=C;
if(s==null||m!=-1||typeof s["/Root"]!="object"){console.log("PDF is broken, trying to rebuild");while(t.length!=0)t.pop();
s=FromPDF.brokenXrefTrail(i,t)}if(s["/Encrypt"]){alert("Encrypted PDFs are not supported yet.");return}var P={buff:i,off:0},A=s["/Root"];
if(A.typ=="ref")s["/Root"]=FromPDF.getIndirect(A.ind,A.gen,P,t);var l=s["/Root"]["/Pages"];if(l.typ=="ref")s["/Root"]["/Pages"]=FromPDF.getIndirect(l.ind,l.gen,P,t);
var V=[s["/Root"]["/Pages"]];while(V.length!=0){var Z=V.pop();if(Z["/Kids"]){var K=Z["/Kids"];for(var C=0;
C<K.length;C++){if(K[C].typ=="ref")K[C]=FromPDF.getIndirect(K[C].ind,K[C].gen,P,t);FromPDF.solveIndirects(K[C],P,t,0);
V.push(K[C])}}}var G=Date.now();FromPDF.render(s["/Root"],J,s);J.Done()};FromPDF.solveIndirects=function(i,J,T,d){if(d>50)return;
if(typeof i=="object")for(var t in i)if(t.startsWith("/")){if(i[t]&&i[t].typ=="ref"&&T[i[t].ind])i[t]=FromPDF.getIndirect(i[t].ind,i[t].gen,J,T);
FromPDF.solveIndirects(i[t],J,T,d+1)}};FromPDF.render=function(i,J,T){var d="CS cs SCN scn SC sc sh Do gs ID EI cm y v B B* BT ET Tj TJ Tf Tm Td T* Tc Tw Tz TL Tr Ts MP DP BMC BDC EMC BX EX ri TRGR trgr _reset_".split(" "),t={J:"setlinecap",j:"setlinejoin",w:"setlinewidth",d:"setdash",M:"setmiterlimit",i:"setflat",q:"gsave",Q:"grestorePDF",m:"moveto",l:"lineto",c:"curveto",h:"closepath",re:"_drawRect_",W:"clip","W*":"eoclip",f:"fill",F:"fill","f*":"eofill",S:"stroke",b:"h B","b*":"h B*",n:"newpath",RG:"/DeviceRGB  CS SCN",rg:"/DeviceRGB  cs scn",G:"/DeviceGray CS SCN",g:"/DeviceGray cs scn",K:"/DeviceCMYK CS SCN",k:"/DeviceCMYK cs scn",TD:"dup neg TL Td","\"":"exch Tc exch Tw '","'":"T* Tj",s:"h S",BI:"/BI"},m=0;
t=FromPS.makeProcs(t);var s=[i["/Pages"]];while(s.length!=0){var C=s.pop();if(C["/Kids"]){var h=C["/Kids"];
for(var P=h.length-1;P>=0;P--)s.push(h[P]);continue}var A=C["/MediaBox"];if(A==null)A=i["/Pages"]["/MediaBox"];
if(A==null)A=C["/Parent"]["/MediaBox"];m+=(A[2]-A[0])*(A[3]-A[1])}var s=[i["/Pages"]],l=-1,V=[-1e9,1e9];
while(s.length!=0){var C=s.pop();if(C["/Kids"]){var h=C["/Kids"];for(var P=h.length-1;P>=0;P--)s.push(h[P]);
continue}l++;if(l<V[0])continue;if(C["/Resources"]==null)C["/Resources"]=i["/Pages"]["/Resources"];if(C["/Resources"]==null)C["/Resources"]=C["/Parent"]["/Resources"];
var Z=C["/Contents"];if(Z==null)continue;if(Z.length==null)Z=[Z];var K=i["/Pages"]["/Rotate"];if(K==null)K=C["/Rotate"];
var G=K!=null&&(K+36e3)%360==90,A=C["/MediaBox"];if(A==null)A=i["/Pages"]["/MediaBox"];if(A==null)A=C["/Parent"]["/MediaBox"];
if(G)A=[A[0],A[1],A[3],A[2]];var D=FromPS._getEnv(A);D.pgOpen=!0;var Q=[],n=[],f=FromPS._getDictStack(d,t),E=[];
if(G){UDOC.M.rotate(D.gst.ctm,Math.PI/2);UDOC.M.translate(D.gst.ctm,0,A[3])}J.StartPage(A[0],A[1],A[2],A[3],m);
if(T["/Encrypt"]){if(s.length==0)alert("Encrypted PDF is not supported yet.")}else for(var N=0;N<Z.length;
N++){if(Z[N].buff==null||Z[N]["/Length"]==0)continue;var k=FromPS.GS(Z[N]),y=k.length-1,c=!0;while(k[y]==0)y--;
k=new Uint8Array(k.buffer,k.byteOffset,y+1);E.push({typ:"file",val:{buff:k,off:0,extra:C}});while(c){c=FromPS.step(n,f,E,Q,D,J,FromPDF.operator)}}J.ShowPage();
if(l>=V[1])break}};FromPDF.addCmd=function(i,J,T){var d=i.length,t=new Uint8Array(d);for(var s=0;s<d;
s++)t[s]=i.charCodeAt(s);J.push({typ:"file",val:{buff:t,off:0,extra:T}})};FromPDF._pushForm=function(i,J,T,d){var t=FromPS.GS(J);
if(t==null)return;var s=J["/Matrix"];if(T)FromPDF.addCmd("Q TRGR",i,J);if(d)FromPDF.addCmd("Q",i,J);
if(s){var m=s.slice(0);UDOC.M.invert(m);FromPDF.addCmd(m.join(" ")+" cm",i,J)}i.push({typ:"file",val:{buff:t,off:0,extra:J}});
if(s)FromPDF.addCmd(s.join(" ")+" cm",i,J);if(d)FromPDF.addCmd("q",i,J);if(T)FromPDF.addCmd("trgr q _reset_",i,J)};
FromPDF.operator=function(i,J,T,d,t,s,m){var C=s.gst,h=d.length-1;while(d[h].typ!="file")h--;var P=d[h].val,A=P.extra["/Resources"];
if(i=="Do"){var l=J.pop().val,V=A["/XObject"][l],Z=V["/Subtype"];if(Z=="/Form"){var K=V["/Group"],G=K&&K["/S"]=="/Transparency"&&(C.ca!=1||C.bmode!="/Normal");
if(V["/Resources"]==null)V["/Resources"]=A;FromPDF._pushForm(d,V,G)}else if(Z=="/Image"){var D=V["/Width"],Q=V["/Height"],n=V["/ColorSpace"],f=V["/SMask"],E=FromPDF.getImage(V),N=FromPDF.getJBIG2Glob(V),y,c;
if(f&&f["/Width"]){var R=f["/Width"],z=f["/Height"];if(R!=D||z!=Q){var w=new Uint32Array(R*z),v=new Uint32Array(E.buffer.slice(E.byteOffset,E.byteOffset+4));
w.fill(v[0]);D=R;Q=z;E=new Uint8Array(w.buffer)}y=FromPDF.getImage(V["/SMask"]);c=FromPDF.getJBIG2Glob(V["/SMask"])}if(V["/ImageMask"]==!0){y=E;
c=N;E=new Uint8Array(D*Q*4);N=null;var a=C.colr[0]*255,X=C.colr[1]*255,o=C.colr[2]*255;for(var F=0;F<D*Q*4;
F+=4){E[F]=a;E[F+1]=X;E[F+2]=o;E[F+3]=255}}if(E&&E.byteOffset!=0)E=E.slice(0);if(y&&y.byteOffset!=0)y=y.slice(0);
m.PutImage(C,E,D,Q,y,N,c)}else console.log("Unknown XObject",Z)}else if(i=="trgr"){m.StartTGroup(C)}else if(i=="TRGR")m.EndTGroup();
else if(i=="_reset_"){C.ca=C.CA=1;C.bmode="/Normal"}else if(i=="gs"){if(J.length==0)return;var r=J.pop().val,bK=A["/ExtGState"][r];
for(var W in bK){var H=bK[W];if(W=="/Type")continue;else if(W=="/CA")C.CA=H;else if(W=="/ca")C.ca=H;
else if(W=="/BM")C.bmode=H;else if(W=="/LC")C.lcap=H;else if(W=="/LJ")C.ljoin=H;else if(W=="/LW")C.lwidth=H;
else if(W=="/ML")C.mlimit=H;else if(W=="/SA")C.SA=H;else if(W=="/OPM")C.OPM=H;else if(W=="/AIS")C.AIS=H;
else if(W=="/OP")C.OP=H;else if(W=="/op")C.op=H;else if(W=="/SMask"){C.SMask=""}else if(W=="/SM")C.SM=H;
else if(W=="/HT"||W=="/TR"){}else console.log("Unknown gstate property: ",W,H)}}else if(i=="ID"){var bd={};
while(!0){var H=J.pop().val;if(H=="/BI")break;bd[J.pop().val]=H}P.off++;var D=bd["/W"],Q=bd["/H"],aF=D*Q,E=new Uint8Array(aF*4),n=bd["/CS"],bO=bd["/BPC"];
if(n==null)n="/G";var x=P.off,aE=P.buff;while(!FromPS.isWhite(aE[x])||aE[x+1]!=69||aE[x+2]!=73||!FromPS.isWhite(aE[x+3]))x++;
var ay=aE.slice(P.off,x);P.off+=ay.length;if(bd["/F"]=="/Fl"){var c5={buff:ay,"/Filter":"/FlateDecode"};
if(bd["/DP"]){var b_=c5["/DecodeParms"]={},c1=["Predictor","Columns","Colors"];for(var F=0;F<3;F++)if(bd["/DP"][c1[F]])b_["/"+c1[F]]=bd["/DP"][c1[F]].val}ay=FromPS.GS(c5);
delete bd["/F"];delete bd["/DP"]}if(n=="/G"&&bd["/F"]==null){var a7=[0,0,0,255,255,255],an=new Uint8Array(aF*4);
if(bd["/ImageMask"]==!0)a7.reverse();FromPDF.plteImage(ay,0,E,bO==1?a7:null,D,Q,bO)}else if(n=="/RGB"&&bd["/F"]==null&&ay.length==D*Q*3){for(var F=0;
F<aF;F++){var bS=F*3,cB=F*4;E[cB]=ay[bS];E[cB+1]=ay[bS+1];E[cB+2]=ay[bS+2];E[cB+3]=255}}else if(n&&n[0].typ!=null){FromPDF.plteImage(ay,0,E,n[3].val,D,Q,bO)}else E=ay;
m.PutImage(C,E,D,Q)}else if(i=="n"||i=="BT"||i=="EI"){}else if(i=="ET"){C.font.Tm=[1,0,0,1,0,0];C.font.Tlm=C.font.Tm.slice(0)}else if(i=="y"||i=="v"){var bQ=C.ctm.slice(0);
UDOC.M.invert(bQ);var W=UDOC.M.multPoint(bQ,C.cpos),aV=J.pop().val,a0=J.pop().val,bl=J.pop().val,cf=J.pop().val;
if(i=="y")UDOC.G.curveTo(C,cf,bl,a0,aV,a0,aV);else UDOC.G.curveTo(C,W[0],W[1],cf,bl,a0,aV)}else if(i=="B"||i=="B*"){m.Fill(C,i=="B*");
m.Stroke(C);UDOC.G.newPath(C)}else if(i=="cm"||i=="Tm"){var ca=[];for(var F=0;F<6;F++)ca.push(J.pop().val);
ca.reverse();if(i=="cm"){UDOC.M.concat(ca,C.ctm);C.ctm=ca}else{C.font.Tm=ca;C.font.Tlm=ca.slice(0)}}else if(i=="Td"||i=="T*"){var av=0,bZ=0;
if(i=="T*"){av=0;bZ=-C.font.Tl}else{bZ=J.pop().val;av=J.pop().val}var bq=[1,0,0,1,av,bZ];UDOC.M.concat(bq,C.font.Tlm);
C.font.Tm=bq;C.font.Tlm=bq.slice(0)}else if(i=="Tf"){var bN=J.pop().val,ch=J.pop().val;C.font.Tf=ch;
C.font.Tfs=bN}else if(i=="Tj"||i=="TJ"){var az=J.pop();if(az.typ=="string")az=[az];else az=az.val;var a3=C.font.Tf,ch=A["/Font"][a3];
if(ch==null)ch=A["/Font"][a3.replace("_","#5F")];var b3=d[0].val.extra["/Resources"]["/Font"];if(ch==null&&b3)ch=b3[a3];
if(ch==null&&b3)for(var bL in b3){ch=b3[bL];break}if(ch==null)return;var bE=C.font.Tfs/1e3,b6=function(cz,cA){var bM=[1,0,0,1,cA,0];
UDOC.M.concat(bM,cz.Tm);cz.Tm=bM};for(var F=0;F<az.length;F++){if(az[F].typ!="string"){if(F==0)b6(C.font,-bE*az[F].val);
continue}var a8=FromPDF.getString(az[F].val,ch);if(az[F+1]&&az[F+1].typ!="string"){var a2=az[F+1].val;
a8[1]+=-a2;if(-900<a2&&a2<-100)a8[0]+=" "}C.font.Tf=a8[2];m.PutText(C,a8[0],a8[1]/1e3);C.font.Tf=a3;
b6(C.font,bE*a8[1])}}else if(i=="Tc")C.font.Tc=J.pop().val;else if(i=="Tw")C.font.Tw=J.pop().val;else if(i=="Tz")C.font.Th=J.pop().val;
else if(i=="TL")C.font.Tl=J.pop().val;else if(i=="Tr")C.font.Tmode=J.pop().val;else if(i=="Ts")C.font.Trise=J.pop().val;
else if(i=="CS"||i=="cs"){var n=J.pop().val;if(i=="CS")C.sspace=n;else C.space=n}else if(i=="SCN"||i=="scn"||i=="SC"||i=="sc"){var bw=i=="SCN"||i=="SC",a$=bw?C.sspace:C.space,n,aI=null,bU=A?A["/ColorSpace"]:null;
if(bU!=null&&bU[a$]!=null){if(bU[a$][1]&&bU[a$][1]["/Alternate"])n=bU[a$][1]["/Alternate"];else n=typeof bU[a$]=="string"?bU[a$]:bU[a$][0]}else n=a$;
if(n=="/DeviceN"){var aX=bU[a$],aW=aX[1].length;for(var F=0;F<aW;F++)J.pop();aI=[1,0,0]}else if(n=="/Lab"||n=="/DeviceRGB"||n=="/CalRGB"||n=="/ICCBased"&&bU[a$][1]["/N"]==3){aI=[J.pop().val,J.pop().val,J.pop().val];
aI.reverse()}else if(n=="/DeviceCMYK"||n=="/ICCBased"&&bU[a$][1]["/N"]==4){var aH=[J.pop().val,J.pop().val,J.pop().val,J.pop().val];
aH.reverse();aI=UDOC.C.cmykToRgb(aH)}else if(n=="/DeviceGray"||n=="/CalGray"||n=="/ICCBased"&&bU[a$][1]["/N"]==1){var aS=FromPS.nrm(J.pop().val);
aI=[aS,aS,aS]}else if(n=="/Separation"){aI=FromPS._readSeparation(bU[a$],J.pop().val)}else if(n=="/Indexed"){var a7=FromPDF.getPalette(bU[a$]),af=J.pop().val*3;
aI=[a7[af]/255,a7[af+1]/255,a7[af+2]/255]}else if(n=="/Pattern"){var cx=A["/Pattern"][J.pop().val],aB=cx["/PatternType"];
if(aB==1){console.log("tile pattern");FromPDF._pushForm(d,cx,!1,!0);return}var bB=cx["/Matrix"];if(bB==null)bB=[1,0,0,1,0,0];
aI=FromPS.getShadingFill(cx["/Shading"],bB);if(aI==null)aI=[0,0,0]}else{console.log(a$,n,bU,A);throw"e"}if(bw)C.COLR=aI;
else C.colr=aI}else if(i=="sh"){var O=A["/Shading"][J.pop().val],aA=C.colr,aO=C.pth;C.pth=C.cpth;C.cpth=UDOC.G.rectToPath(s.bb);
C.colr=FromPS.getShadingFill(O,C.ctm.slice(0));if(C.colr==null)C.colr=[0,0,0];m.Fill(C);C.colr=aA;C.pth=aO}else if(i=="MP"||i=="BMC"||i=="ri"){J.pop()}else if(i=="DP"||i=="BDC"){J.pop();
J.pop()}else if(i=="EMC"||i=="BX"||i=="EX"){}else throw"Unknown operator",i};FromPDF.getJBIG2Glob=function(i){var J=i;
J=J["/DecodeParms"];if(J==null)return null;if(J.length!=null)J=J[0];J=J["/JBIG2Globals"];if(J==null)return null;
return FromPS.GS(J)};FromPDF.getImage=function(i){var J=i["/Width"],T=i["/Height"],d=J*T,t=FromPS.GS(i),s=i["/Filter"],m=i["/ColorSpace"],h=i["/BitsPerComponent"],P=i["/Matte"],A=i.image;
if(A==null){var l=i["/Mask"];if(m&&m[0]=="/Indexed"){var V=FromPDF.getPalette(m),Z=new Uint8Array(d*4);
FromPDF.plteImage(t,0,Z,V,J,T,h,l);A=Z}else if(s==null&&(m==null||m=="/DeviceGray")){var V=[0,0,0,255,255,255],Z=new Uint8Array(d*4);
if(i["/Decode"]&&i["/Decode"][0]==1){V.reverse()}if(i["/ImageMask"]==!0)V.reverse();FromPDF.plteImage(t,0,Z,h==1?V:null,J,T,h,l);
A=Z}else if(s==null&&m&&(m=="/DeviceCMYK"||m[0]=="/ICCBased"&&m[1]&&m[1]["/N"]==4)){var Z=new Uint8Array(d*4),K=[0,0,0,0];
for(var G=0;G<d;G++){var D=G*4;K[0]=t[D]*(1/255);K[1]=t[D+1]*(1/255);K[2]=t[D+2]*(1/255);K[3]=t[D+3]*(1/255);
var Q=UDOC.C.cmykToRgb(K);Z[D]=~~(Q[0]*255+.5);Z[D+1]=~~(Q[1]*255+.5);Z[D+2]=~~(Q[2]*255+.5);Z[D+3]=255}A=Z}else if(s==null){var n=Math.round(255/((1<<h)-1)),f=Math.ceil(J*3*h/8),Z=new Uint8Array(d*4);
Z.fill(255);var n=Math.round(255/((1<<h)-1));for(var E=0;E<T;E++){var N=f*E;for(var y=0;y<J;y++){var D=(E*J+y)*4,R=3*y;
Z[D]=FromPDF.getBitNum(t,N,R,h)*n;Z[D+1]=FromPDF.getBitNum(t,N,R+1,h)*n;Z[D+2]=FromPDF.getBitNum(t,N,R+2,h)*n}}A=Z}else{A=t}if(P&&P.join("")!="000"){var z=Math.round(P[0]*255),w=Math.round(P[1]*255),v=Math.round(P[2]*255);
for(var G=0;G<A.length;G+=4){A[G]=Math.max(A[G],z);A[G+1]=Math.max(A[G+1],w);A[G+2]=Math.max(A[G+2],v)}}i.image=A}return A};
FromPDF.getPalette=function(i){var J;if(i[3].length!=null){var T=i[3];J=new Uint8Array(256*3);for(var d=0;
d<T.length;d++)J[d]=T.charCodeAt(d)}else J=FromPS.GS(i[3]);if(i[1]=="/DeviceCMYK"||i[1]&&i[1][1]&&i[1][1]["/N"]==4){var t=J,J=new Uint8Array(256*3);
for(var d=0;d<256;d++){var s=d<<2,m=s-d,C=UDOC.C.cmykToRgb([t[s]/255,t[s+1]/255,t[s+2]/255,t[s+3]/255]);
J[m]=C[0]*255;J[m+1]=C[1]*255;J[m+2]=C[2]*255}}return J};FromPDF.plteImage=function(i,J,T,d,t,s,m,h){var P=Math.round(255/((1<<m)-1)),A=Math.ceil(t*m/8);
for(var l=0;l<s;l++){var V=J+A*l;for(var Z=0;Z<t;Z++){var K=FromPDF.getBitNum(i,V,Z,m),G=l*t+Z<<2;if(d){var D=K*3;
T[G]=d[D];T[G+1]=d[D+1];T[G+2]=d[D+2]}else{var Q=K*P;T[G]=Q;T[G+1]=Q;T[G+2]=Q}T[G+3]=255;if(h&&h[0]<=K&&K<=h[1])T[G+3]=0}}};
FromPDF.getBitNum=function(i,J,T,d){var t=0;if(d==8)t=i[J+T];else if(d==4)t=i[J+(T>>1)]>>(1-(T&1)<<2)&15;
else if(d==2)t=i[J+(T>>2)]>>(3-(T&3)<<1)&3;else if(d==1)t=i[J+(T>>3)]>>(7-(T&7)<<0)&1;return t};FromPDF.getString=function(i,J){function T(bK,W){console.log("approximating word widths");
return bK.length*1e3*(W.indexOf("Courier")!=-1?.59:.4)}var d=J["/Subtype"],t="",s=0,m=null,C=J["/ToUnicode"],h=J["/Encoding"],P=J,R;
if(C!=null&&typeof C!="object")C=null;if(d=="/Type0")P=J["/DescendantFonts"][0];if(C!=null)t=FromPDF.toUnicode(i,C);
else if(h=="/WinAnsiEncoding")t=FromPDF.encFromMap(i,FromPDF._win1252);else if(h=="/MacRomanEncoding")t=FromPDF.encFromMap(i,FromPDF._macRoman);
else if(d=="/Type0"){var A=0,l=P["/CIDSystemInfo"]["/Ordering"];if(l=="Identity")A=0;else if(l=="Japan1")A=31;
else if(l=="GB1")A=31;else if(l=="CNS1")A=31;else if(l=="Korea1")A=31;else{console.log("unknown ordering",l);
A=0}for(var Z=0;Z<i.length;Z+=2){var K=i[Z]<<8|i[Z+1];t+=String.fromCharCode(K+A)}}else if(h!=null&&h["/Type"]=="/Encoding"){var G=h["/Differences"],D=h["/BaseEncoding"],Q=null,t="";
if(D=="/WinAnsiEncoding")Q=FromPDF._win1252;if(D=="/MacRomanEncoding")Q=FromPDF._macRoman;for(var f=0;
f<i.length;f++){var E=i[f],N=-5,k=!1;if(G)for(var Z=0;Z<G.length;Z++){if(typeof G[Z]=="string"){if(E==N){t+=FromPDF.fromCName(G[Z].slice(1));
k=!0;break}N++}else N=G[Z]}if(!k&&Q!=null){var y=Q.indexOf(E);if(y!=-1)E=String.fromCharCode(Q[y+1]);
t+=String.fromCharCode(E)}else if(!k)t+=String.fromCharCode(E)}}else{t=FromPS.readStr(i)}var c=P["/FontDescriptor"],z=["","2","3"];
for(var f=0;f<3;f++)if(c&&c["/FontFile"+z[f]])R="/FontFile"+z[f];if(c){if(c.psName)m=c.psName;else if(R){var w=FromPS.GS(c[R]);
if(R!=null&&w&&FromPS.B.readUint(w,0)==65536)m=c.psName=FromPDF._psName(w)}}if(m==null&&J["/BaseFont"])m=J["/BaseFont"].slice(1);
if(m==null||m=="")m="DejaVuSans";if(d=="/Type0"){var v=P["/W"];if(v&&v.length==0)v=null;if(v==null){s=T(t,m)}else for(var f=0;
f<i.length;f+=2){var a=i[f]<<8|i[f+1],X=!1;for(var Z=0;Z<v.length;Z+=2){var o=v[Z],F=v[Z+1];if(F.length){if(0<=a-o&&a-o<F.length){s+=F[a-o];
X=!0}}else{if(o<=a&&a<=F){s+=v[Z+2];X=!0}Z++}}if(!X)s+=v[1].length?v[1][0]:v[2]}}else if(d=="/Type1"||d=="/Type3"||d=="/TrueType"||d=="/MMType1"){var r=J["/FirstChar"],v=J["/Widths"];
if(v)for(var f=0;f<i.length;f++)s+=v[i[f]-r];else{s=T(t,m)}}else throw"unknown font type";return[t,s,m]};
FromPDF._psName=function(i){var J=FromPS.B.readUshort,T=J(i,4),d=0;for(var t=0;t<T;t++){var s=FromPS.B.readASCII(i,12+t*16,4),m=FromPS.B.readUint(i,12+t*16+8);
if(s=="name"){d=m;break}}if(d==0)return null;var C=J(i,d+2),P=d+6,A=d+6;for(var t=0;t<C;t++){var l=J(i,A),V=J(i,A+2),Z=J(i,A+4),K=J(i,A+6),G=J(i,A+8),D=J(i,A+10),Q;
A+=12;var f=P+C*12+D;if(V==1||V==10||V==3||l==3&&V==0){Q="";for(var E=1;E<G;E+=2)Q+=String.fromCharCode(i[f+E])}else if(V==0||V==2)Q=FromPS.B.readASCII(i,f,G);
if(K==6&&Q!=null&&Q.slice(0,3)!="OTS")return Q.replace(/\s/g,"")}return null};FromPDF.encFromMap=function(i,J){var T="";
for(var d=0;d<i.length;d++){var t=i[d],s=J.indexOf(t);if(s!=-1)t=J[s+1];T+=String.fromCharCode(t)}return T};
FromPDF._win1252=[128,8364,130,8218,131,402,132,8222,133,8230,134,8224,135,8225,136,710,137,8240,138,352,139,8249,140,338,142,381,145,8216,146,8217,147,8220,148,8221,149,8226,150,8211,151,8212,152,732,153,8482,154,353,155,8250,156,339,158,382,159,376];
FromPDF._macRoman=[128,196,129,197,130,199,131,201,132,209,133,214,134,220,135,225,136,224,137,226,138,228,139,227,140,229,141,231,142,233,143,232,144,234,145,235,146,237,147,236,148,238,149,239,150,241,151,243,152,242,153,244,154,246,155,245,156,250,157,249,158,251,159,252,160,8224,161,176,162,162,163,163,164,167,165,8226,166,182,167,223,168,174,169,169,170,8482,171,180,172,168,173,9824,174,198,175,216,176,8734,177,177,178,8804,179,8805,180,165,181,181,182,8706,183,8721,184,8719,185,960,186,8747,187,170,188,186,189,937,190,230,191,248,192,191,193,161,194,172,195,8730,196,402,197,8776,198,8710,199,171,200,187,201,8230,202,160,203,192,204,195,205,213,206,338,207,339,208,8211,209,8212,210,8220,211,8221,212,8216,213,8217,214,247,215,9674,216,255,217,376,218,8260,219,8364,220,8249,221,8250,222,64257,223,64258,224,8225,225,183,226,8218,227,8222,228,8240,229,194,230,202,231,193,232,203,233,200,234,205,235,206,236,207,237,204,238,211,239,212,240,63743,241,210,242,218,243,219,244,217,245,305,246,710,247,732,248,175,249,728,250,729,251,730,252,184,253,733,254,731,255,711];
FromPDF.fromCName=function(i){if(i=="f_f_i")return"ffi";if(i.length==1)return i;if(i.slice(0,3)=="uni")return String.fromCharCode(parseInt(i.slice(3),16));
var J={space:32,exclam:33,quotedbl:34,numbersign:35,dollar:36,percent:37,ampersand:38,quotesingle:39,parenleft:40,parenright:41,asterisk:42,plus:43,comma:44,hyphen:45,period:46,slash:47,zero:48,one:49,two:50,three:51,four:52,five:53,six:54,seven:55,eight:56,nine:57,colon:58,semicolon:59,less:60,equal:61,at:64,bracketleft:91,bracketright:93,underscore:95,braceleft:123,braceright:125,dieresis:168,circlecopyrt:169,copyright:169,registered:174,degree:176,plusminus:177,mu:181,periodcentered:183,Eacute:201,Adieresis:196,adieresis:228,Udieresis:220,germandbls:223,udieresis:252,Odieresis:214,agrave:224,ntilde:241,odieresis:246,Cacute:262,cacute:263,Ccaron:268,ccaron:269,Dcroat:272,dcroat:273,Ecaron:283,ecaron:283,dotlessi:305,Scaron:352,scaron:353,Tcaron:356,tcaron:357,Zcaron:381,zcaron:382,alpha:945,phi:966,endash:8211,emdash:8212,asteriskmath:8727,quoteright:8217,quotedblbase:8222,ellipsis:8230,quotedblleft:8220,quotedblright:8221,bullet:8226,minus:8706,fi:64257,fl:64258},T=J[i];
if(T==null){if(i.charAt(0)!="g")console.log("unknown character "+i);return i}return String.fromCharCode(T)};
FromPDF.toUnicode=function(i,J){var T=J.cmap,d="",t;if(T==null){var s={buff:FromPS.GS(J),off:0},m=[],C=FromPS._getDictStack({}),h=[{typ:"file",val:s}],P=[],A=FromPS._getEnv([0,0,1,1]),l=!0;
A.pgOpen=!0;while(l)l=FromPS.step(m,C,h,P,A,null,FromPS.operator,!0);T=A.res.CMap.val;J.cmap=T}for(var V in T){T=T[V].val;
break}var Z=T.bfrange,K=T.bfchar,D=T.bpc;for(var Q=0;Q<i.length;Q+=D){var f=i[Q],E=!1;if(D==2)f=f<<8|i[Q+1];
if(!E&&Z)for(var N=0;N<Z.length;N+=3){var k=Z[N],y=Z[N+1],c=Z[N+2];if(k<=f&&f<=y){if(k==y&&c==0){}else if(c.length==null)f+=c-k;
else f=c[f-k];E=!0;break}}if(!E&&K)for(var N=0;N<K.length;N+=2)if(K[N]==f){f=K[N+1];E=!0;break}if(f>65535)d+=String.fromCharCode(f>>>16);
d+=String.fromCharCode(f)}return d};FromPDF.brokenXrefTrail=function(i,J){function T(Z,K){var G=K;while(48<=Z[K]&&Z[K]<=57)K++;
return FromPS.B.readASCII(Z,G,K-G)}var d,t=i.length;for(var s=0;s<t;s++){if(FromPS.isEOL(i[s])){var m=s;
while(FromPS.isWhite(i[m]))m++;var C=T(i,m);if(C!=""){m+=C.length;while(FromPS.isWhite(i[m]))m++;var P=T(i,m);
if(P!=""){m+=P.length;while(FromPS.isWhite(i[m]))m++;if(FromPS.B.readASCII(i,m,3)=="obj"){var A=parseInt(C),l=parseInt(P);
J[A]={off:s+1,gen:l,chr:"n"};s=m}}}else if(i[m]==116&&i[m+1]==114&&FromPS.B.readASCII(i,m,7)=="trailer"){if(d==null)d=FromPDF._readTrailer(i,m+7,J)}else if(i[m]==115&&i[m+1]==116&&FromPS.B.readASCII(i,m,9)=="startxref"){m+=10;
while(FromPS.isWhite(i[m]))m++;var V=parseInt(T(i,m));if(V!=0&&d==null)d=FromPDF.readXrefTrail(i,V,J)}}}return d};
FromPDF._readTrailer=function(i,J,T){var d={buff:i,off:J},t=FromPDF.readObject(d,d,T);if(t["/Prev"])FromPDF.readXrefTrail(i,t["/Prev"],T);
return t};FromPDF.readXrefTrail=function(i,J,T){var d=FromPS.B.readASCII(i,J,4);if(d=="xref"){var t=J+4;
if(i[t]==13)t++;if(i[t]==10)t++;while(!0){if(FromPS.B.readASCII(i,t,7)=="trailer"){t+=7;if(i[t]==13)t++;
if(i[t]==10)t++;break}var s=t;while(!FromPS.isEOL(i[t]))t++;var m=FromPS.B.readASCII(i,s,t-s);m=m.split(" ");
var C=parseInt(m[0]),h=parseInt(m[1]);if(i[t]==13)t++;if(i[t]==10)t++;for(var P=0;P<h;P++){var A=C+P;
if(T[A]==null)T[A]={off:parseInt(FromPS.B.readASCII(i,t,10)),gen:parseInt(FromPS.B.readASCII(i,t+11,5)),chr:FromPS.B.readASCII(i,t+17,1),val:null,opn:!1};
if(i[t+16]!=32)return null;t+=20}}return FromPDF._readTrailer(i,t,T)}else{var t=J,l=t+32;while(t<l&&FromPS.B.readASCII(i,t,2)!="<<")t++;
if(FromPS.B.readASCII(i,t,2)=="<<"){var V={buff:i,off:t},K=FromPDF.readObject(V,V,null,!0),G=0,D=FromPS.GS(K),Q=K["/W"],n=K["/Index"],f=[],P=0;
if(D==null)return null;if(n){for(P=0;P<n.length;P+=2){for(var E=0;E<n[P+1];E++)f.push(n[P]+E)}}P=0;while(G<D.length){var N=FromPDF.getInt(D,G,Q[0]),t=0,R=0,z="n";
G+=Q[0];var y=FromPDF.getInt(D,G,Q[1]);G+=Q[1];var c=FromPDF.getInt(D,G,Q[2]);G+=Q[2];if(N==0){t=y;R=c;
z="f"}if(N==1){t=y;R=c;z="n"}if(N==2){t=y;R=c;z="s"}T[n?f[P]:P]={off:t,gen:R,chr:z,val:null,opn:!1};
P++}if(K["/Prev"])FromPDF.readXrefTrail(i,K["/Prev"],T);if(K["/Encrypt"])return K;var w={buff:i,off:0},v=["/Root","/Info"];
for(P=0;P<v.length;P++){var a=v[P],X=K[a];if(X&&X.typ=="ref")K[a]=FromPDF.getIndirect(X.ind,X.gen,w,T)}return K}else return null}};
FromPDF.getInt=function(i,T,d){if(d==0)return 0;if(d==1)return i[T];if(d==2)return i[T]<<8|i[T+1];if(d==3)return i[T]<<16|i[T+1]<<8|i[T+2];
if(d==4)return i[T]<<24|i[T+1]<<16|i[T+2]<<8|i[T+3];while(d>4){d--;T++}return i[T]<<24|i[T+1]<<16|i[T+2]<<8|i[T+3]};
FromPDF.getIndirect=function(i,J,T,d){var t=d[i],C;if(t.chr=="f")return null;if(t.val!=null)return t.val;
if(t.opn)return{typ:"ref",ind:i,gen:J};t.opn=!0;var s=T.off;if(t.chr=="s"){var P=FromPDF.getIndirect(t.off,t.gen,T,d),A={buff:FromPS.GS(P),off:0},l=0,V=0;
while(l!=i){l=FromPS.getFToken(A).val;V=FromPS.getFToken(A).val}A.off=V+P["/First"];C=FromPDF.readObject(A,T,d)}else{T.off=t.off;
var Z=FromPS.getFToken(T);if(Z.val!="<<"){var K=FromPS.getFToken(T),G=FromPS.getFToken(T)}else T.off-=2;
C=FromPDF.readObject(T,T,d,!0)}t.val=C;T.off=s;t.opn=!1;return C};FromPDF.readObject=function(i,J,T,d){var t=FromPS.getFToken(i);
if(t.typ=="integer"){var s=i.off,m=FromPS.getFToken(i);if(m&&m.typ=="integer"){FromPS.skipWhite(i);if(i.buff[i.off]==82){i.off++;
if(T&&T[t.val])return FromPDF.getIndirect(t.val,m.val,J,T);else return{typ:"ref",ind:t.val,gen:m.val}}}i.off=s}if(t.val=="<<")return FromPDF.readDict(i,J,T,d);
if(t.val=="[")return FromPDF.readArra(i,J,T);if(t.typ=="string"){var C="";for(var h=0;h<t.val.length;
h++)C+=String.fromCharCode(t.val[h]);return C}if(t.typ=="name"&&t.val==">>"){console.log(JSON.stringify(PUtils.readASCII(i.buff,i.off-32,128)));
console.log(i.off);throw"e"}return t.val};FromPDF.readDict=function(i,J,T,d){var t={};while(!0){var s=i.off,m=FromPS.getFToken(i);
if(m.typ=="name"&&m.val==">>")break;i.off=s;var C=FromPDF.readObject(i,J,T),h=FromPDF.readObject(i,J,T);
t[C]=h}if(t["/Length"]!=null&&d){var P=t["/Length"];if(P.typ&&P.typ=="ref")throw"e";var A=FromPS.getFToken(i);
if(i.buff[i.off]==32)i.off++;if(i.buff[i.off]==13)i.off++;if(i.buff[i.off]==10)i.off++;if(i.off+P>i.buff.length){console.log("too big /Length of a stream",P,i.buff.length-i.off,i.off);
P=i.buff.length-i.off}t.buff=new Uint8Array(i.buff.buffer,i.buff.byteOffset+i.off,P);i.off+=P;FromPS.getFToken(i)}return t};
FromPDF.readArra=function(i,J,T){var d=[];while(!0){var t=i.off,s=FromPS.getFToken(i);if(s.typ=="name"&&s.val=="]")return d;
i.off=t;var m=FromPDF.readObject(i,J,T);d.push(m)}};var FromWMF=function(){var i=0,J=53,T=55,d=258,t=259,s=260,m=261,C=262,h=263,P=264,A=295,l=313,V=322,Z=329,K=513,G=521,D=529,Q=531,n=532,f=544,E=552,N=561,k=564,y=804,c=805,R=522,z=523,w=524,v=525,a=526,X=527,o=1040,F=1042,r=1045,bK=1046,W=1048,H=1049,bd=1065,aF=1078,bO=1313,x=1336,aE=1352,ay=1051,c5=1055,b_=1564,c1=1565,a7=30,an=2074,bS=2851,cB=1574,bQ=298,aV=299,a0=300,bl=301,cf=302,ca=2071,av=2096,bZ=2338,bq=2610,bN=3379,ch=2368,az=2881,a3=3907,b3=496,bL=247,bE=505,b6=762,a8=763,a2=764,bw=1791,a$=1,aI=2,bU=3,aX=4,aW=5,aH=6,aS=7,af=8,cx=9,aB=10,bB=11,a_=12,O=13,aA=14,aO=15,cz=16,cA=17,bM=18,b9=19,bj=20,bf=21,bm=22,b0=23,am=24,bc=25,ae=26,bs=27,at=28,al=29,c8=30,aD=31,ba=32,aj=33,cs=34,aR=35,aT=37,bV=38,ax=42,cj=256,aC=258,cv=512,b1=513,ck=514,c3=2049,aU=3073,cw=4096,ac=4097,cc=4098,ai=4110,ce=4111,br=4112,c6=4115,cu=4116,aL=4117,cb=4118,aw=4119,b5=4120,bA=4121,aM=4122,p=4568,_=UDOC.B;
function S(M,b){M=new Uint8Array(M);var Y=0,j={fill:!1,strk:!1,bb:[0,0,600,600],lbb:[0,0,600,600],scl:1,fnt:{nam:"Arial",hgh:25,und:!1,orn:0,chrst:0},tclr:[0,0,0],talg:0},B=_.readShort,aG=_.readUshort,bv=_.readUint,U=bv(M,0),a4=0;
if(U==2596720087){Y=6;var ar=B(M,Y+8);j.scl=120/ar;for(var u=0;u<4;u++){j.bb[u]=Math.round(B(M,Y)*j.scl);
Y+=2}Y+=2;Y+=6}b.StartPage(j.bb[0],j.bb[1],j.bb[2],j.bb[3]);var $=UDOC.getState(j.bb),be=aG(M,Y);Y+=2;
var cn=aG(M,Y);Y+=2;var aY=aG(M,Y);Y+=2;var ci=bv(M,Y);Y+=4;var bG=aG(M,Y);Y+=2;var a9=bv(M,Y);Y+=4;
var bG=aG(M,Y);Y+=2;var q=[];while(!0){var b4=bv(M,Y)<<1,c4=null;Y+=4;var c7=aG(M,Y);Y+=2;var I=c7,e=Y;
if(!1){}else if(I==i)break;else if(I==cB){var ak=aG(M,Y);e+=2;var a5=ak;console.log(I,a5)}else if(I==t||I==C||I==d){}else if(I==bl){var bI=aG(M,e);
e+=2;var bz=q[bI];if(bz.t=="br"){j.fill=bz.stl!=1;if(bz.stl==0){}else if(bz.stl==1){}else throw bz.stl+" e";
$.colr=bz.clr}else if(bz.t=="pn"){var cq=bz.stl&7;j.strk=cq!=5;if(cq==0||cq==6)$.lwidth=bz.px;else if(cq==5){}else throw cq+" e";
if((bz.stl&4096)!=0)$.ljoin=2;else if((bz.stl&8192)!=0)$.ljoin=0;else $.ljoin=1;$.COLR=bz.clr}else if(bz.t=="fn"){j.fnt=bz;
$.font.Tf=bz.nam;$.font.Tfs=Math.abs(bz.hgh);$.font.Tun=bz.und}else throw"e"}else if(I==b3){var bI=aG(M,e);
e+=2;q[bI]=null}else if(I==z||I==w){var ct=I==z?0:2;j.lbb[ct+1]=B(M,e);e+=2;j.lbb[ct]=B(M,e);e+=2;g(j,$)}else if(I==a2){c4={t:"br"};
c4.stl=aG(M,e);e+=2;c4.clr=[M[e]/255,M[e+1]/255,M[e+2]/255];e+=4;c4.htc=aG(M,e);e+=2}else if(I==b6){c4={t:"pn"};
c4.stl=aG(M,e);e+=2;c4.px=B(M,e);e+=2;c4.py=B(M,e);e+=2;c4.clr=[M[e]/255,M[e+1]/255,M[e+2]/255];e+=4}else if(I==a8){c4={t:"fn",nam:""};
c4.hgh=B(M,e);e+=2;e+=2*2;c4.orn=B(M,e)/10;e+=2;var bT=B(M,e);e+=2;c4.und=M[e+1];e+=2;c4.stk=M[e];c4.chrst=M[Y+1];
e+=2;e+=4;while(M[e]!=0){c4.nam+=String.fromCharCode(M[e]);e++}if(bT>500)c4.nam+="-Bold"}else if(I==bL){c4={t:"pl"}}else if(I==G)j.tclr=[M[e]/255,M[e+1]/255,M[e+2]/255];
else if(I==cf)j.talg=aG(M,e);else if(I==n){UDOC.G.moveTo($,B(M,e+2),B(M,e))}else if(I==Q){if($.pth.cmds.length==0){var bX=$.ctm.slice(0);
UDOC.M.invert(bX);var cp=UDOC.M.multPoint(bX,$.cpos);UDOC.G.moveTo($,cp[0],cp[1])}UDOC.G.lineTo($,B(M,e+2),B(M,e));
var bg=j.fill;j.fill=!1;ah(b,$,j);j.fill=bg}else if(I==x){var by=aG(M,e);e+=2;var bk=e;e+=by*2;for(var u=0;
u<by;u++){var bx=aG(M,bk+u*2);e=aN(M,e,bx,$,!0)}ah(b,$,j)}else if(I==y||I==c){var bx=aG(M,e);e+=2;e=aN(M,e,bx,$,I==y);
var bg=j.fill;j.fill=bg&&I==y;ah(b,$,j);j.fill=bg}else if(I==ay||I==W){var bn=B(M,e);e+=2;var aa=B(M,e);
e+=2;var bp=B(M,e);e+=2;var ad=B(M,e);e+=2;if(I==ay){UDOC.G.moveTo($,ad,bp);UDOC.G.lineTo($,aa,bp);UDOC.G.lineTo($,aa,bn);
UDOC.G.lineTo($,ad,bn)}else{var bW=(ad+aa)/2,ao=(bp+bn)/2;UDOC.G.arc($,bW,ao,(bn-bp)/2,0,2*Math.PI,!1)}UDOC.G.closePath($);
var bg=j.fill;j.fill=!0;ah(b,$,j);j.fill=bg}else if(I==a3||I==az||I==ch){var as=bv(M,e),bH,bR;e+=4;if(I==a3){var bD=aG(M,e);
e+=2}if(I!=ch){bR=B(M,e);e+=2;bH=B(M,e);e+=2}var bh=B(M,e);e+=2;var ag=B(M,e);e+=2;var bb=B(M,e);e+=2;
var au=B(M,e);e+=2;var bt=B(M,e);e+=2;var aJ=B(M,e);e+=2;if(I==ch){bH=au;bR=bb}var cd=L(M,e);if(cd.length>bH*bR*4)cd=cd.slice(0,bH*bR*4);
var c9=$.ctm.slice(0);$.ctm=[1,0,0,1,0,0];UDOC.M.scale($.ctm,au,-bb);UDOC.M.translate($.ctm,aJ,bt+bb);
UDOC.M.concat($.ctm,c9);b.PutImage($,cd,bH,bR);$.ctm=c9}else if(I==bq){var aK=B(M,e),c2="";e+=2;var cg=B(M,e);
e+=2;$.font.Tm=[1,0,0,-1,0,0];UDOC.M.rotate($.font.Tm,j.fnt.orn*Math.PI/180);UDOC.M.translate($.font.Tm,cg,aK);
var b$=j.talg;if((b$&6)==6)$.font.Tal=2;else if((b$&7)==0)$.font.Tal=0;else throw b$+" e";if((b$&24)==24){}else if((b$&24)==0)UDOC.M.translate($.font.Tm,0,$.font.Tfs);
else throw"e";var bi=aG(M,e);e+=2;var bP=aG(M,e);e+=2;if(bP&4)e+=8;for(var u=0;u<bi;u++){var bo=M[e+u];
if(bo>127){u++;bo=bo<<8|M[e+u]}c2+=String.fromCharCode(bo)}var bC=$.colr;$.colr=j.tclr;b.PutText($,c2,c2.length*$.font.Tfs*.5);
$.colr=bC}else if(I==b1){}else{console.log(I.toString(16),b4)}if(c4!=null){var bF=0;while(q[bF]!=null)bF++;
q[bF]=c4}Y+=b4-6}b.ShowPage();b.Done()}function L(M,b){var Y=_.readShort,j=_.readUshort,B=_.readUint,aG=B(M,b),bv,U,ar;
b+=4;if(aG==12)throw"e";else{bv=B(M,b);b+=4;U=B(M,b);b+=4;var u=j(M,b);b+=2;if(u!=1)throw"e";var $=j(M,b);
b+=2;if($!=1&&$!=24&&$!=32)throw $+" e";var be=B(M,b);b+=4;if(be!=0)throw"e";var cn=B(M,b);b+=4;var aY=B(M,b);
b+=4;var ci=B(M,b);b+=4;ar=B(M,b);b+=4;var bG=B(M,b);b+=4}var a9=bv*U,q=new Uint8Array(a9*4),a4=Math.floor((bv*u*$+31&~31)/8);
if($==1)for(var b4=0;b4<U;b4++){var c7=b+ar*4+(U-1-b4)*a4;for(var I=0;I<bv;I++){var e=b4*bv+I<<2,c4=M[c7+(I>>>3)]>>>7-(I&7)&1;
q[e]=M[b+c4*4+2];q[e+1]=M[b+c4*4+1];q[e+2]=M[b+c4*4+0];q[e+3]=255}}if($==24){for(var b4=0;b4<U;b4++)for(var I=0;
I<bv;I++){var e=b4*bv+I<<2,ak=b+(U-1-b4)*a4+I*3;q[e]=M[ak+2];q[e+1]=M[ak+1];q[e+2]=M[ak+0];q[e+3]=255}}if($==32){for(var b4=0;
b4<U;b4++)for(var I=0;I<bv;I++){var e=b4*bv+I<<2,ak=b+(U-1-b4)*a4+I*4;q[e]=M[ak+2];q[e+1]=M[ak+1];q[e+2]=M[ak+0];
q[e+3]=M[ak+3]}}return q}function g(M,b){var Y=[1,0,0,1,0,0],j=M.lbb,B=M.bb;UDOC.M.translate(Y,-j[0],-j[1]);
UDOC.M.scale(Y,1/j[2],1/j[3]);UDOC.M.scale(Y,B[2]-B[0],B[3]-B[1]);UDOC.M.translate(Y,B[0],B[1]);b.ctm=Y}function ah(M,b,Y){if(Y.fill)M.Fill(b,!1);
if(Y.strk&&b.lwidth!=0)M.Stroke(b,!1);UDOC.G.newPath(b)}function aN(M,b,Y,j,B){var aG=_.readShort;for(var bv=0;
bv<Y;bv++){var U=aG(M,b);b+=2;var ar=aG(M,b);b+=2;if(bv==0)UDOC.G.moveTo(j,U,ar);else UDOC.G.lineTo(j,U,ar)}if(B)UDOC.G.closePath(j);
return b}return{Parse:S}}(),FromEMF=function(){var i=1,J=2,T=3,d=4,t=5,s=6,m=7,C=8,h=9,P=10,A=11,l=12,V=13,Z=14,K=15,G=16,D=17,Q=18,n=19,f=20,E=21,N=22,k=23,y=24,c=25,R=26,z=27,w=28,v=29,a=30,X=31,o=32,F=33,r=34,bK=35,W=36,H=37,bd=38,aF=39,bO=40,x=41,aE=42,ay=43,c5=44,b_=45,c1=46,a7=47,an=48,bS=49,cB=50,bQ=51,aV=52,a0=53,bl=54,cf=55,ca=56,av=57,bZ=58,bq=59,bN=60,ch=61,az=62,a3=63,b3=64,bL=65,bE=66,b6=67,a8=68,a2=70,bw=71,a$=72,aI=73,bU=74,aX=75,aW=76,aH=77,aS=78,af=79,cx=80,aB=81,bB=82,a_=83,O=84,aA=85,aO=86,cz=87,cA=88,bM=89,b9=90,bj=91,bf=92,bm=93,b0=94,am=95,bc=96,ae=97,bs=98,at=99,al=100,c8=101,aD=102,ba=103,aj=104,cs=105,aR=106,aT=108,bV=109,ax=110,cj=111,aC=112,cv=113,b1=114,ck=115,c3=116,aU=118,cw=119,ac=120,cc=121,ai=122,ce=UDOC.B,br=null,c6=13369376,cu=15597702,aL=8913094;
function cb(p,_){p=new Uint8Array(p);var S=0,L={fill:!1,strk:!1,bb:[0,0,1,1],wbb:[0,0,1,1],fnt:{nam:"Arial",hgh:25,und:!1,orn:0},tclr:[0,0,0],talg:0},g,ah=[],aN=[],M=ce.readShort,b=ce.readUshort,Y=ce.readInt,j=ce.readUint,B=ce.readFloat,aG=0;
while(!0){var bv=j(p,S),$=null,be=0;S+=4;var U=bv,ar=j(p,S);S+=4;var u=S;if(!1){}else if(U==Z){break}else if(U==i){L.bb=aw(p,u);
u+=16;_.StartPage(L.bb[0],L.bb[1],L.bb[2],L.bb[3]);g=UDOC.getState(L.bb)}else if(U==F)aN.push(JSON.stringify(g),JSON.stringify(L));
else if(U==r){var cn=Y(p,u);u+=4;while(cn<-1){aN.pop();aN.pop();cn++}L=JSON.parse(aN.pop());g=JSON.parse(aN.pop())}else if(U==b6){g.cpth=JSON.parse(JSON.stringify(g.pth))}else if(U==a){var aY=aw(p,u);
u+=16;var ci=g.pth;g.pth={cmds:[],crds:[]};UDOC.G.drawRect(g,aY[0],aY[1],aY[2]-aY[0],aY[3]-aY[1]);g.cpth=g.pth;
g.pth=ci}else if([D,n,Q,bs,f,aX].indexOf(U)!=-1){}else if(U==bZ)g.mlimit=j(p,u);else if(U==y)L.tclr=[p[u]/255,p[u+1]/255,p[u+2]/255];
else if(U==N)L.talg=j(p,u);else if(U==A||U==l){if(L.vbb==null)L.vbb=[];var a9=U==l?0:2;L.vbb[a9]=Y(p,u);
u+=4;L.vbb[a9+1]=Y(p,u);u+=4;if(U==A)b5(L,g)}else if(U==h||U==P){var a9=U==P?0:2;L.wbb[a9]=Y(p,u);u+=4;
L.wbb[a9+1]=Y(p,u);u+=4;if(U==h)b5(L,g)}else if(U==a2){var q=j(p,u);u+=4}else if(U==H){var a4=j(p,u);
u+=4;if(a4==2147483648){L.fill=!0;g.colr=[1,1,1]}else if(a4==2147483653){L.fill=!1}else if(a4==2147483655){L.strk=!0;
L.lwidth=1;g.COLR=[0,0,0]}else if(a4==2147483656){L.strk=!1}else if(a4==2147483661){}else if(a4==2147483662){}else{var b4=ah[a4];
if(b4.t=="b"){L.fill=b4.stl!=1;if(b4.stl==0){}else if(b4.stl==1){}else throw b4.stl+" e";g.colr=b4.clr}else if(b4.t=="p"){L.strk=b4.stl!=5;
g.lwidth=b4.wid;g.COLR=b4.clr}else if(b4.t=="f"){L.fnt=b4;g.font.Tf=b4.nam;g.font.Tfs=Math.abs(b4.hgh);
g.font.Tun=b4.und}else throw"e"}}else if(U==bO){var a4=j(p,u);u+=4;if(ah[a4]!=null)ah[a4]=null;else throw"e"}else if(U==aF){be=j(p,u);
u+=4;$={t:"b"};$.stl=j(p,u);u+=4;$.clr=[p[u]/255,p[u+1]/255,p[u+2]/255];u+=4;$.htc=j(p,u);u+=4}else if(U==b0){be=j(p,u);
u+=4;console.log("unsupported pattern brush");$={t:"b"};$.stl=0}else if(U==bd||U==am){be=j(p,u);u+=4;
$={t:"p"};if(U==am){u+=16;$.stl=j(p,u);u+=4;$.wid=j(p,u);u+=4;u+=4}else{$.stl=j(p,u);u+=4;$.wid=j(p,u);
u+=4;u+=4}$.clr=[p[u]/255,p[u+1]/255,p[u+2]/255];u+=4}else if(U==bB){be=j(p,u);u+=4;$={t:"f",nam:""};
$.hgh=Y(p,u);u+=4;u+=4*2;$.orn=Y(p,u)/10;u+=4;var c7=j(p,u);u+=4;$.und=p[u+1];$.stk=p[u+2];u+=4*2;while(b(p,u)!=0){$.nam+=String.fromCharCode(b(p,u));
u+=2}if(c7>500)$.nam+="-Bold"}else if(U==O){u+=16;var I=j(p,u),cp="";u+=4;var e=B(p,u);u+=4;var c4=B(p,u);
u+=4;var ak=Y(p,u);u+=4;var a5=Y(p,u);u+=4;var bI=g.ctm.slice(0);if(I==1)g.ctm=[1,0,0,1,0,0];g.font.Tm=[1,0,0,-1,0,0];
UDOC.M.rotate(g.font.Tm,L.fnt.orn*Math.PI/180);UDOC.M.translate(g.font.Tm,ak,a5);var bz=L.talg;if((bz&6)==6)g.font.Tal=2;
else if((bz&7)==0)g.font.Tal=0;else throw bz+" e";if((bz&24)==24){}else if((bz&24)==0)UDOC.M.translate(g.font.Tm,0,g.font.Tfs);
else console.log("unknown alignment",bz);var cq=j(p,u);u+=4;var ct=j(p,u);u+=4;var bT=j(p,u);u+=4;u+=16;
var bX=j(p,u);u+=4;ct+=S-8;for(var bg=0;bg<cq;bg++){var by=b(p,ct+bg*2);cp+=String.fromCharCode(by)}var bk=g.colr;
g.colr=L.tclr;_.PutText(g,cp,cp.length*g.font.Tfs*.5);g.colr=bk;g.ctm=bI}else if(U==bq){UDOC.G.newPath(g)}else if(U==bN){}else if(U==ch)UDOC.G.closePath(g);
else if(U==z){UDOC.G.moveTo(g,Y(p,u),Y(p,u+4))}else if(U==bl){if(g.pth.cmds.length==0){var bx=g.ctm.slice(0);
UDOC.M.invert(bx);var bn=UDOC.M.multPoint(bx,g.cpos);UDOC.G.moveTo(g,bn[0],bn[1])}UDOC.G.lineTo(g,Y(p,u),Y(p,u+4))}else if(U==T||U==aO||U==d||U==cz||U==s||U==bM){u+=16;
var aa=U==T||U==aO,bp=U==s||U==bM,ad=j(p,u);u+=4;if(!bp)UDOC.G.newPath(g);u=aM(p,u,ad,g,U==aO||U==cz||U==bM?2:4,aa,bp);
if(!bp)bA(_,g,L,aa)}else if(U==bj){u+=16;var aa=!0,bp=!1,bW=j(p,u);u+=4;u+=4;var ao=u;u+=bW*4;if(!bp)UDOC.G.newPath(g);
for(var bg=0;bg<bW;bg++){var as=b(p,ao+bg*4);u=aM(p,u,as,g,2,aa,bp)}if(!bp)bA(_,g,L,aa)}else if(U==J||U==aA||U==t||U==cA){u+=16;
var bD=U==aA||U==cA,bH=bD?M:Y,bR=bD?2:4,ad=j(p,u);u+=4;if(!(U==t||U==cA)){UDOC.G.moveTo(g,bH(p,u),bH(p,u+bR));
u+=2*bR;ad--}while(ad>0){UDOC.G.curveTo(g,bH(p,u),bH(p,u+bR),bH(p,u+2*bR),bH(p,u+3*bR),bH(p,u+4*bR),bH(p,u+5*bR));
u+=6*bR;ad-=3}}else if(U==ay||U==aE){UDOC.G.newPath(g);var aY=aw(p,u);if(U==ay){UDOC.G.drawRect(g,aY[0],aY[1],aY[2]-aY[0],aY[3]-aY[1])}else{var bh=(aY[0]+aY[2])/2,ag=(aY[1]+aY[3])/2;
UDOC.G.arc(g,bh,ag,(aY[2]-aY[0])/2,0,2*Math.PI,!1)}UDOC.G.closePath(g);bA(_,g,L,!0)}else if(U==az)_.Fill(g,!1);
else if(U==b3)_.Stroke(g);else if(U==a3){_.Fill(g,!1);_.Stroke(g)}else if(U==bK||U==W){var bb=[];for(var bg=0;
bg<6;bg++)bb.push(B(p,u+bg*4));u+=24;if(U==bK)g.ctm=bb;else{var I=j(p,u);u+=4;if(I==2){var au=g.ctm;
g.ctm=bb;UDOC.M.concat(g.ctm,au)}else if(I==4)g.ctm=bb;else throw I}}else if(U==E){var bt=j(p,u);u+=4}else if(U==aB){var aY=aw(p,u);
u+=16;var aJ=Y(p,u);u+=4;var cd=Y(p,u);u+=4;var c9=Y(p,u);u+=4;var aK=Y(p,u);u+=4;var cg=Y(p,u);u+=4;
var b$=Y(p,u);u+=4;var bP=j(p,u)+S-8;u+=4;var c2=j(p,u);u+=4;var bo=j(p,u)+S-8;u+=4;var bC=j(p,u);u+=4;
var bF=j(p,u);u+=4;if(bF!=0)throw"e";var a6=j(p,u);u+=4;if(a6!=c6&&a6!=cu&&a6!=aL)throw a6.toString(16);
var ab=Y(p,u);u+=4;var bu=Y(p,u);u+=4;var bY=j(p,bP);bP+=4;if(bY!=40)throw bY;var cC=j(p,bP);bP+=4;var a1=j(p,bP);
bP+=4;if(cC!=cg||a1!=b$)throw"e";var c0=b(p,bP);bP+=2;if(c0!=1)throw"e";var ap=b(p,bP);bP+=2;if(ap!=1&&ap!=4&&ap!=8&&ap!=16&&ap!=24&&ap!=32)throw ap+" e";
var aP=j(p,bP);bP+=4;if(aP!=0)throw aP+" e";var cy=j(p,bP);bP+=4;var cl=j(p,bP);bP+=4;var aZ=j(p,bP);
bP+=4;var cm=j(p,bP);bP+=4;var b8=j(p,bP);bP+=4;if(b8!=0)throw b8;var b2=Math.floor((cC*c0*ap+31&~31)/8),bJ=new Uint8Array(cC*a1*4);
if(ap==1){for(var ag=0;ag<a1;ag++)for(var bh=0;bh<cC;bh++){var b7=ag*cC+bh<<2,a4=(p[bo+(a1-1-ag)*b2+(bh>>>3)]>>>7-(bh&7)&1)<<2;
bJ[b7]=p[bP+a4+2];bJ[b7+1]=p[bP+a4+1];bJ[b7+2]=p[bP+a4+0];bJ[b7+3]=255}}else if(ap==8){for(var ag=0;
ag<a1;ag++)for(var bh=0;bh<cC;bh++){var b7=ag*cC+bh<<2,a4=p[bo+(a1-1-ag)*b2+bh]<<2;bJ[b7]=p[bP+a4+2];
bJ[b7+1]=p[bP+a4+1];bJ[b7+2]=p[bP+a4+0];bJ[b7+3]=255}}else if(ap==16){for(var ag=0;ag<a1;ag++)for(var bh=0;
bh<cC;bh++){var b7=ag*cC+bh<<2,cr=bo+(a1-1-ag)*b2+bh*2,aQ=p[cr+1]<<8|p[cr];bJ[b7]=(aQ>>>10&31)*(255/31);
bJ[b7+1]=(aQ>>>5&31)*(255/31);bJ[b7+2]=(aQ>>>0&31)*(255/31);bJ[b7+3]=255}}else if(ap==24){for(var ag=0;
ag<a1;ag++)for(var bh=0;bh<cC;bh++){var b7=ag*cC+bh<<2,cr=bo+(a1-1-ag)*b2+bh*3;bJ[b7]=p[cr+2];bJ[b7+1]=p[cr+1];
bJ[b7+2]=p[cr+0];bJ[b7+3]=255}}else if(ap==32){for(var ag=0;ag<a1;ag++)for(var bh=0;bh<cC;bh++){var b7=ag*cC+bh<<2,cr=bo+(a1-1-ag)*b2+bh*4;
bJ[b7]=p[cr+2];bJ[b7+1]=p[cr+1];bJ[b7+2]=p[cr+0];bJ[b7+3]=p[cr+3]}}else console.log("unsupported bit depth",ap,cC,a1);
var aq=g.ctm.slice(0);g.ctm=[1,0,0,1,0,0];UDOC.M.scale(g.ctm,ab,-bu);UDOC.M.translate(g.ctm,aJ,cd+bu);
UDOC.M.concat(g.ctm,aq);if(a6==cu)br=bJ;else if(a6==aL)_.PutImage(g,bJ,cC,a1,br);else _.PutImage(g,bJ,cC,a1);
g.ctm=aq}else{console.log("unknown command",U,ar)}if($!=null)ah[be]=$;S+=ar-8}_.ShowPage();_.Done()}function aw(p,_){var S=[];
for(var L=0;L<4;L++)S[L]=ce.readInt(p,_+L*4);return S}function b5(p,_){var S=[1,0,0,1,0,0],L=p.wbb,g=p.bb,ah=p.vbb&&p.vbb.length==4?p.vbb:p.bb;
UDOC.M.translate(S,-L[0],-L[1]);UDOC.M.scale(S,1/L[2],1/L[3]);UDOC.M.scale(S,ah[2],ah[3]);_.ctm=S}function bA(p,_,S,L){if(S.fill&&L)p.Fill(_,!1);
if(S.strk&&_.lwidth!=0)p.Stroke(_)}function aM(p,_,S,L,g,ah,aN){var M=g==2?ce.readShort:ce.readInt;for(var b=0;
b<S;b++){var Y=M(p,_);_+=g;var j=M(p,_);_+=g;if(b==0&&!aN)UDOC.G.moveTo(L,Y,j);else UDOC.G.lineTo(L,Y,j)}if(ah)UDOC.G.closePath(L);
return _}return{Parse:cb}}(),FromDXF=function(){var i=function(){this.bb=[1e9,1e9,-1e9,-1e9]};i.prototype={StartPage:function(){},PutText:function(){},PutImage:function(){},Stroke:function(C){this.checkPath(C.pth.crds)},Fill:function(C){this.checkPath(C.pth.crds)},PutText:function(C,h,P,A){var l=[0,0,P*C.font.Tfs,0,0,-C.font.Tfs,0,C.font.Tfs];
if(A){l[2]=A[0];l[5]=-A[1]}UDOC.M.multArray(C.ctm,l);UDOC.M.multArray(C.font.Tm,l);this.checkPath(l)},checkPath:function(C){var h=this.bb;
for(var P=0;P<C.length;P+=2){var A=C[P],l=C[P+1];h[0]=Math.min(h[0],A);h[1]=Math.min(h[1],l);h[2]=Math.max(h[2],A);
h[3]=Math.max(h[3],l)}},ShowPage:function(){},Done:function(){}};function J(C,h){C=new Uint8Array(C);
var P=0,A=new TextDecoder().decode(C),l=A.split("\n"),G=2e3,D=100;for(var V=0;V<l.length;V++)l[V]=l[V].trim();
while(l[l.length-1]=="")l.pop();var Z=new i;T(l,Z);var K=Z.bb,Q=(G-D*2)/(K[2]-K[0]),n=Math.round((K[3]-K[1])*Q+D*2),f=[0,0,G,n],E=UDOC.getState(f);
E.lwidth=1/Q;E.ctm=[Q,0,0,-Q,D-K[0]*Q,-D+K[1]*Q+n];T(l,h,E,f)}function T(C,h,P,A){if(P==null){A=[0,0,1e3,1e3];
P=UDOC.getState(A)}h.StartPage(A[0],A[1],A[2],A[3]);var l={tabs:{LTYPE:{}},blocks:{}};t(C,h,P,l,0,C.length);
h.ShowPage();h.Done()}function d(C,h){if(C.startsWith("%%u")){C=C.slice(3);h.font.Tun=1}C=C.split("\\P").join("\n");
C=C.split("%%d").join("'");C=C.split("{").join("");C=C.split("}").join("");while(!0){var P=C.indexOf("\\U+");
if(P==-1)break;C=C.slice(0,P)+String.fromCharCode(parseInt(C.slice(P+3,P+7),16))+C.slice(P+7)}while(!0){var P=C.indexOf("\\"),A=C.indexOf(";");
if(P==-1||A==-1)break;var l=C.slice(P+1,A);if(l.startsWith("pi"))l=" ".repeat(.5*parseFloat(l.slice(2)));
else l="";C=C.slice(0,P)+l+C.slice(A+1)}return C}function t(C,h,P,A,l,V,Z){var K,G,D,Q=!1;while(l<V){var n=parseInt(C[l++]),f=C[l++],E=[10,11,12,13,14,20,21,22,23,24,30,31,32,33,34,40,41,42,43,44,45,46,47,48,49,50,51,52,53,62,70,71,72,73,74,90,370].indexOf(n)!=-1,N=K=="LWPOLYLINE"&&(n==10||n==20||n==30)||K=="LTYPE"&&n==49||K=="SPLINE"&&(n==10||n==20||n==30||n==40)||K=="OLE2FRAME"&&n==310;
if(E)f=parseFloat(f);if(n==999){}else if(f[0]=="$")Q=!0;else if(Q)Q=!1;else if(f=="SECTION")Z=-1;else if(f=="ENDSEC"){}else if(Z==-1)Z=f;
else if(f=="EOF"){}else if(Z=="HEADER"){}else if(Z=="CLASSES"){}else if(Z=="TABLES"||Z=="BLOCKS"){if(f=="ENDBLK"){D[1]=l-2;
D=null}if(n==0){K=f;G={};continue}if(N){if(G[n]==null)G[n]=[];G[n].push(f)}else{G[n]=f}if(C[l]!="0")continue;
if(K=="LTYPE"){if(A.tabs[K][G[2]]!=null)throw"e";A.tabs[K][G[2]]=G}else if(K=="BLOCK"){D=A.blocks[G[2]]=[l]}}else if(Z=="ENTITIES"){if(n==0){K=f;
G={}}else{if(N){if(G[n]==null)G[n]=[];G[n].push(f)}else{G[n]=f}}if(C[l]!="0")continue;if(D==null){P.colr=[0,0,0];
P.ca=1;P.COLR=[0,0,0];P.dash=[];if(G[62]!=null&&G[62]!=256){var k={c0:[0,0,0],c1:[1,0,0],c2:[1,1,0],c4:[0,1,1],c5:[0,0,1],c7:[0,0,0],c8:[0,0,0],c242:[.64,0,.16],c250:[0,0,0]}["c"+G[62]];
if(k)P.COLR=k;else{P.COLR=[0,1,0];console.log(K+" "+G[62])}}if(G[6]!=null){var y=A.tabs.LTYPE[G[6]];
if(y[49]!=null){var c=y[49].slice(0);for(var R=0;R<c.length;R++)c[R]=Math.abs(c[R])*(G[48]?G[48]:1);
P.dash=c}}if(G[8]=="H")P.dash=[.1,.02];UDOC.G.newPath(P)}var z=-1/3.17;if(K=="LINE"){var w=(G[30]?G[30]:0)*z,v=(G[31]?G[31]:0)*z;
UDOC.G.moveTo(P,G[10]+w,G[20]-w);UDOC.G.lineTo(P,G[11]+v,G[21]-v);h.Stroke(P,!1)}else if(K=="POLYLINE"){D=[G,[]]}else if(K=="VERTEX"){D[1].push(G)}else if(K=="SEQEND"){if(D==null)continue;
var a=D[0],X=D[1],o=X.length,F=a[70]==1?o+1:o;UDOC.G.moveTo(P,X[0][10],X[0][20]);for(var R=1;R<F;R++){var r=X[R%o][10],bK=X[R%o][20],W=X[R-1][42];
if(W==null)W=0;if(W==0)UDOC.G.lineTo(P,r,bK);else{var H=X[R-1],bd=H[10],aF=H[20],x=r-bd,aE=bK-aF,ay=-W*Math.PI/2,c5=.42,b_=Math.sin(ay),c1=Math.cos(ay),a7=c1*x-b_*aE,an=b_*x+c1*aE,bS=c1*x+b_*aE,cB=-b_*x+c1*aE;
UDOC.G.curveTo(P,bd+c5*a7,aF+c5*an,r-c5*bS,bK-c5*cB,r,bK)}}h.Stroke(P,!1);D=null}else if(K=="OLE2FRAME"){var bQ=57,aV=295,a0=G[310].join(""),bl=aV*bQ,cf=new Uint8Array(a0.length>>>1);
for(var R=0;R<cf.length;R++)cf[R]=parseInt(a0.slice(R*2,R*2+2),16);var ca=new Float64Array(cf.slice(2,2+12*8).buffer),av=new Uint8Array(bl*4);
new Uint32Array(av.buffer).fill(4281563135);var bZ=P.ctm,bq=[1,0,0,1,0,0],bN=G[11]-G[10],ch=G[21]-G[20];
UDOC.M.scale(bq,bN,ch);UDOC.M.translate(bq,G[10],G[20]);UDOC.M.concat(bq,P.ctm);P.ctm=bq;h.PutImage(P,av,aV,bQ);
P.ctm=bZ}else if(K=="INSERT"){var az=A.blocks[G[2]],a3=P.ctm.slice(0),bq=[1,0,0,1,0,0];if(G[50]!=null)UDOC.M.rotate(bq,G[50]*Math.PI/180);
if(G[41]!=null)UDOC.M.scale(bq,G[41],G[42]);UDOC.M.translate(bq,G[10],G[20]);UDOC.M.concat(bq,P.ctm);
P.ctm=bq;t(C,h,P,A,az[0],az[1],Z);P.ctm=a3}else if(K=="--VIEWPORT"){console.log(G);P.COLR=[1,0,0];UDOC.G.moveTo(P,G[10],G[20]);
UDOC.G.lineTo(P,G[10]+5,G[20]+5);h.Stroke(P,!1)}else if(K=="--DIMENSION"){var b3=G[70]&7;if(b3==0){console.log(G);
P.COLR=[0,.3,.6];var x=0,aE=0;UDOC.G.moveTo(P,G[13]+x,G[23]+aE);UDOC.G.lineTo(P,G[14]+x,G[24]+aE);h.Stroke(P,!1)}}else if(K=="3DFACE"||K=="SOLID"){var w=G[30]*z,v=G[31]*z,bL=G[32]*z,bE=G[33]*z;
UDOC.G.moveTo(P,G[10]+w,G[20]-w);UDOC.G.lineTo(P,G[11]+v,G[21]-v);UDOC.G.lineTo(P,G[12]+bL,G[22]-bL);
UDOC.G.lineTo(P,G[13]+bE,G[23]-bE);UDOC.G.closePath(P);if(K=="3DFACE"){P.colr=[Math.random(),Math.random(),Math.random()];
P.ca=.5}h.Fill(P,!1)}else if(K=="LWPOLYLINE"){for(var R=0;R<G[90];R++){var b6=R==0?UDOC.G.moveTo:UDOC.G.lineTo;
b6(P,G[10][R],G[20][R])}if(G[70]==1)UDOC.G.closePath(P);h.Stroke(P,!1)}else if(K=="CIRCLE"){UDOC.G.arc(P,G[10],G[20],G[40],0,Math.PI*2);
h.Stroke(P,!1)}else if(K=="ELLIPSE"){var a8=P.ctm.slice(0),a2=G[10],bw=G[20],x=G[11],aE=G[21],a$=Math.sqrt(x*x+aE*aE),bq=[1,0,0,1,0,0];
UDOC.M.scale(bq,1,G[40]);UDOC.M.rotate(bq,-Math.atan2(aE,x));UDOC.M.translate(bq,a2,bw);UDOC.M.concat(bq,P.ctm);
P.ctm=bq;UDOC.G.arc(P,0,0,a$,G[41],G[42]);h.Stroke(P,!1);P.ctm=a8}else if(K=="ARC"){UDOC.G.arc(P,G[10],G[20],G[40],G[50]*Math.PI/180,G[51]*Math.PI/180);
h.Stroke(P,!1)}else if(K=="SPLINE"){var aI=G[10],bU=G[20],aX=G[40].slice(0),aW=aI.length-1;UDOC.G.moveTo(P,aI[0],bU[0]);
if(G[71]==3&&G[73]==4){UDOC.G.curveTo(P,aI[1],bU[1],aI[2],bU[2],aI[3],bU[3])}else{var aH=-1e6,aS=1e6;
for(var R=0;R<aX.length;R++){var af=aX[R];if(af<aS)aS=af;if(af>aH)aH=af}for(var R=0;R<aX.length;R++){aX[R]=(aX[R]-aS)/(aH-aS)}var o=aI.length*10;
for(var cx=1;cx<o;cx++){var aB=cx/o,bB=s(aI,bU,G[71],aX,aB);UDOC.G.lineTo(P,bB[0],bB[1])}UDOC.G.lineTo(P,aI[aI.length-1],bU[bU.length-1])}if(G[70]&1)UDOC.G.closePath(P);
h.Stroke(P,!1)}else if(K=="--ATTDEF"||K=="ATTRIB"||K=="TEXT"||K=="MTEXT"){P.font.Tun=0;P.font.Tal=0;
P.font.Tm=[1,0,0,1,0,0];if(G[50])UDOC.M.rotate(P.font.Tm,-G[50]*Math.PI/180);UDOC.M.translate(P.font.Tm,G[10],G[20]);
P.font.Tfs=G[40];var a0=G[K=="ATTDEF"?3:1],O=null;a0=d(a0,P);var a_=G[71]==null?0:(G[71]-1)%3;P.font.Tal=[0,2,1][a_];
if(K=="MTEXT"&&G[41]!=null&&G[41]!=0){var aA=a0.length*P.font.Tfs/G[41];aA=Math.max(aA,a0.split("\n").length);
O=[G[41],aA*P.font.Tfs*1.5];if(a_==0){}else if(a_==2){UDOC.M.translate(P.font.Tm,-G[41],0)}else if(a_==1){UDOC.M.translate(P.font.Tm,-G[41]/2,0)}else console.log("unknown align",G)}else if(K=="MTEXT"&&G[71]!=null){if(G[71]<=3)UDOC.M.translate(P.font.Tm,0,-P.font.Tfs*.8);
else if(G[71]<=6)UDOC.M.translate(P.font.Tm,0,-P.font.Tfs*.4)}h.PutText(P,a0,a0.length*.5,O)}else console.log("unknown command",K)}else if(Z=="OBJECTS"){}else if(Z=="ACDSDATA"){}else{console.log(Z,n,f);
throw Z}}}function s(C,h,P,A,l){var V=0,Z=0;for(var K=0;K<C.length;K++){var G=m(K,P,A,l);V+=C[K]*G;Z+=h[K]*G}return[V,Z]}function m(C,P,A,l){var V=new Float64Array(P+1),Z,K,D=A.Length-1;
if(C==0&&l==A[0]||C==D-P-1&&l==A[D])return 1;if(l<A[C]||l>=A[C+P+1])return 0;for(var Q=0;Q<=P;Q++){if(l>=A[C+Q]&&l<A[C+Q+1])V[Q]=1;
else V[Q]=0}for(var n=1;n<=P;n++){if(V[0]==0)Z=0;else Z=(l-A[C])*V[0]/(A[C+n]-A[C]);for(var Q=0;Q<P-n+1;
Q++){var f=A[C+Q+1],N=A[C+Q+n+1];if(V[Q+1]==0){V[Q]=Z;Z=0}else{K=V[Q+1]/(N-f);V[Q]=Z+(N-l)*K;Z=(l-f)*K}}}return V[0]}return{Parse:J}}(),ToPDF=function(){function i(){this._res={"/Font":{},"/XObject":{},"/ExtGState":{},"/Pattern":{}};
this._xr=[null,{"/Type":"/Catalog","/Pages":{typ:"ref",ind:2}},{"/Type":"/Pages","/Kids":[],"/Count":0},this._res];
this._bnds=[];this._cont="";this._annt=[];this._gst=J();this._stck=[]}function J(){return{colr:"[0,0,0]",COLR:"[0,0,0]",lcap:"0",ljoin:"0",lwidth:"1",mlimit:"10",dash:"[]",doff:"0",bmode:"/Normal",CA:"1",ca:"1"}}i.prototype.StartTGroup=function(y){this.setGState(y,!1);
this._stck.push(this._cont,this._gst);this._cont="";this._gst=J()};i.prototype.EndTGroup=function(){var y={"/Type":"/XObject","/Subtype":"/Form","/Group":{"/Type":"/Group","/S":"/Transparency"},stream:this._cont},c=this._res["/XObject"],R="/I"+(Z(c)+1);
c[R]={typ:"ref",ind:this._xr.length};this._xr.push(y);this._gst=this._stck.pop();this._cont=this._stck.pop();
this._cont+=R+" Do \n"};i.prototype.StartPage=function(y,c,R,z){this._bnds=[y,c,R,z]};i.prototype.AddAnnot=function(y,c){this._annt.push([y,c])};
i.prototype.Stroke=function(y){if(y.CA==0)return;var c=null;if(y.cpth){this._cont+=" q "+P(y.cpth)+" W  n  ";
c=JSON.stringify(this._gst)}this.setGState(y,!0);this._cont+=" S\n";if(y.cpth){this._cont+=" Q ";this._gst=JSON.parse(c)}};
i.prototype.Fill=function(y,c){if(y.ca==0)return;var R=null;if(y.cpth){this._cont+=" q "+P(y.cpth)+" W  n  ";
R=JSON.stringify(this._gst)}this.setGState(y,!0);this._cont+=" f"+(c?"*":"")+"\n";if(y.cpth){this._cont+=" Q ";
this._gst=JSON.parse(R)}};function T(y){return""+parseFloat(y.toFixed(2))}function d(y){return""+parseFloat(y.toFixed(3))}function t(y){return Math.sqrt(Math.abs(y[0]*y[3]-y[1]*y[2]))}function s(y){var c=y.map(T).join(" ");
if(c=="1 0 0 1 0 0")return"";return c+" cm "}function m(y,c){if(y.length!=c.length)return!1;for(var R=0;
R<y.length;R++)if(y[R]!=c[R])return!1;return!0}function C(y){var c=[[255,216,255],[0,0,0,12,106,80,32,32],[0,0,0,0,48,0,1,0]],R=["/DCTDecode","/JPXDecode","/JBIG2Decode"];
for(var z=0;z<c.length;z++){var w=c[z],v=!0;for(var a=0;a<w.length;a++)v=v&&y[a]==w[a];if(v)return R[z]}}i.prototype.setGState=function(y,c){var R=this._gst,z={};
for(var w in y)if(w!="pth"&&w!="cpth")z[w]=typeof y[w]=="string"?y[w]:JSON.stringify(y[w]);var v=t(y.ctm),a=y.dash.slice(0);
for(var X=0;X<a.length;X++)a[X]=T(a[X]*v);var o=this._cont;if(R.lcap!=z.lcap)o+=y.lcap+" J ";if(R.ljoin!=z.ljoin)o+=y.ljoin+" j ";
if(R.lwidth!=z.lwidth)o+=T(y.lwidth*v)+" w ";if(R.mlimit!=z.mlimit)o+=T(y.mlimit)+" M ";if(R.dash!=z.dash||R.doff!=z.doff)o+="["+a.join(" ")+"] "+y.doff+" d ";
if(R.COLR!=z.COLR)o+=h(y.COLR,!1,this._res);if(R.colr!=z.colr)o+=h(y.colr,!0,this._res);var F=this._res["/ExtGState"];
if(R.bmode!=z.bmode){var r=z.bmode;if(F[r]==null)F[r]={"/Type":"/ExtGState","/BM":y.bmode};o+=r+" gs "}if(R.CA!=z.CA){var r="/CA"+Math.round(255*z.CA);
if(F[r]==null)F[r]={"/Type":"/ExtGState","/CA":y.CA};o+=r+" gs "}if(R.ca!=z.ca){var r="/ca"+Math.round(255*z.ca);
if(F[r]==null)F[r]={"/Type":"/ExtGState","/ca":y.ca};o+=r+" gs "}if(c)o+=P(y.pth);this._cont=o;this._gst=z};
function h(y,c,R){if(y.length!=null)return y.map(d).join(" ")+" "+(c?"rg":"RG")+" \n";else{var z=R["/Pattern"],w=y,v="/P"+(Z(z)+1),a={"/ShadingType":w.typ=="lin"?2:3,"/ColorSpace":"/DeviceRGB","/Extend":[!0,!0],"/Function":A(w.grad),"/Coords":w.crds};
z[v]={"/Type":"/Pattern","/PatternType":2,"/Matrix":w.mat,"/Shading":a};return"/Pattern "+(c?"cs "+v+" scn ":"CS "+v+" SCN ")}}function P(y){var c=0,R="",z=T,w=y.crds,v=y.cmds,a=0,X=0,F=0,r=0;
for(var bK=0;bK<v.length;bK++){var W=v[bK];if(W=="M"){for(var H=0;H<2;H++)R+=z(w[c++])+" ";R+="m "}else if(W=="L"){for(var H=0;
H<2;H++)R+=z(w[c++])+" ";R+="l "}else if(W=="Q"){var bd=w[c++],aF=w[c++],bO=w[c++],x=w[c++],aE=[(2*bd+F)/3,(2*aF+r)/3,(2*bd+bO)/3,(2*aF+x)/3,bO,x];
for(var H=0;H<6;H++)R+=z(aE[H])+" ";R+="c "}else if(W=="C"){for(var H=0;H<6;H++)R+=z(w[c++])+" ";R+="c "}else if(W=="Z"){R+="h "}else throw W;
if(W=="Z"){F=a;r=X}else{F=w[c-2];r=w[c-1];if(W=="M"){a=F;X=r}}}return R}function A(y){y=y.slice(0);if(y[0][0]!=0)y.unshift(JSON.parse(JSON.stringify(y[0])));
if(y[y.length-1][0]!=1)y.unshift(JSON.parse(JSON.stringify(y[y.length-1])));y[0][0]=0;y[y.length-1][0]=1;
var c=[],R=[],z=[0,1],w=l;if(y.length==2)return w(y[0][1],y[1][1]);R.push(w(y[0][1],y[1][1]));for(var v=1;
v<y.length-1;v++){c.push(y[v][0]);R.push(w(y[v][1],y[v+1][1]));z.push(0,1)}return{"/FunctionType":3,"/Encode":z,"/Domain":[0,1],"/Bounds":c,"/Functions":R}}function l(y,c){return{"/FunctionType":2,"/C0":y,"/C1":c,"/Domain":[0,1],"/N":1}}i.prototype.PutText=function(y,c,R,z){this.setGState(y,!1);
var w=this.addFont(y.font.Tf,z);this._cont+="q ";if(y.cpth)this._cont+=P(y.cpth)+" W  n  ";this._cont+=s(y.ctm);
this._cont+=s(y.font.Tm);this._cont+="BT  "+w+" "+T(y.font.Tfs)+" Tf  0 0 Td  (";var v=[];if(z==null){var a=[128,8364,130,8218,131,402,132,8222,133,8230,134,8224,135,8225,136,710,137,8240,138,352,139,8249,140,338,142,381,145,8216,146,8217,147,8220,148,8221,149,8226,150,8211,151,8212,152,732,153,8482,154,353,155,8250,156,339,158,382,159,376];
for(var X=0;X<c.length;X++){var o=c.charCodeAt(X);if(o>255){var F=a.indexOf(o);v.push(F==-1?32:a[F-1])}else v.push(o)}}else{for(var X=0;
X<c.length;X++){var o=c.charCodeAt(X);v.push(o&255)}}v=FromPS.makeString(v);for(var X=0;X<v.length;X++)this._cont+=String.fromCharCode(v[X]);
this._cont+=") Tj  ET ";this._cont+=" Q\n"};i.prototype.PutImage=function(y,c,R,z,w){if(c.length==R*z*4&&w==null){var v=R*z,a=new Uint8Array(v),X=255;
for(var o=0;o<v;o++){a[o]=c[(o<<2)+3];X&=c[(o<<2)+3]}if(X!=255)w=a}var F=this.addImage(c,R,z,w);this.setGState(y,!1);
this._cont+="q ";if(y.cpth){this._cont+=P(y.cpth)+" W  n  "}this._cont+=s(y.ctm);this._cont+=F+" Do  Q\n"};
i.prototype.ShowPage=function(){G(this._xr,this._cont,this._bnds,this._annt);this._cont="";this._annt=[];
this._gst=J()};i.prototype.Print=function(y){};i.prototype.Done=function(){var y=this._res;for(var c in y)if(Object.keys(y[c])==0)delete y[c];
this.buffer=D(this._xr)};i.prototype.addImage=function(y,c,R,z){var w,v;if(z){v=z;if(z.length==c*R*4){v=new Uint8Array(c*R);
for(var a=0;a<v.length;a++)v[a]=z[(a<<2)+1]}w=this.addImage(v,c,R,null)}var X=C(y),o=y;if(y.length==c*R*4){o=new Uint8Array(c*R*3);
for(var a=0;a<y.length;a+=4){var F=3*(a>>2);o[F]=y[a+0];o[F+1]=y[a+1];o[F+2]=y[a+2]}}var r=this._res["/XObject"],bK=w!=null?1:0;
for(var W in r){var H=this._xr[r[W].ind],bd=H["/SMask"],aF=bd!=null?1:0;if(!m(H.stream,o)||aF+bK==1)continue;
if(aF+bK==2&&!m(this._xr[bd.ind].stream,v))continue;return W}var W="/I"+(Z(r)+1);r[W]={typ:"ref",ind:this._xr.length};
var bO={"/Type":"/XObject","/Subtype":"/Image","/BitsPerComponent":8,"/ColorSpace":y.length==c*R||X=="/DCTDecode"&&V(y)&&V(y).comps==1?"/DeviceGray":"/DeviceRGB","/Height":R,"/Width":c,stream:o};
if(X!=null)bO["/Filter"]=C(y);if(z){bO["/SMask"]=r[w]}this._xr.push(bO);return W};function V(y){var c=0;
while(c<y.length){while(y[c]==255)c++;var R=y[c];c++;if(R==216)continue;if(R==217)break;if(208<=R&&R<=215)continue;
if(R==1)continue;var z=(y[c]<<8|y[c+1])-2;c+=2;if(R==192)return{bpp:y[c],w:y[c+1]<<8|y[c+2],h:y[c+3]<<8|y[c+4],comps:y[c+5]};
c+=z}}function Z(y){var c;for(var R in y)c=R;return c==null?0:parseInt(c.slice(2))}function K(y){var c=y.toLowerCase(),R="Helvetica Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique Times-Roman Times-Bold Times-Italic Times-BoldItalic".split(" "),z=0;
if(c.indexOf("sans")!=-1)z=0;else if(c.indexOf("serif")!=-1)z=4;var w=c.indexOf("bold")!=-1,v=c.indexOf("italic")!=-1||c.indexOf("oblique")!=-1||c.endsWith("-it");
if(w&&v)z+=3;else if(v)z+=2;else if(w)z+=1;return R[z]}i.prototype.addFont=function(y,c){y=K(y);y="/"+y;
var R=this._res["/Font"];for(var z in R)if(R[z]["/BaseFont"]==y)return z;var z="/F"+(Z(R)+1),w={"/Type":"/Font","/Subtype":"/Type1","/BaseFont":y,"/Encoding":"/WinAnsiEncoding"};
if(c!=null){var v="/CIDInit /ProcSet findresource begin \t12 dict begin \tbegincmap \t/CIDSystemInfo \t<<  /Registry (Adobe) \t/Ordering (UCS) \t/Supplement 0 \t>> def \t/CMapName /Adobe-Identity-UCS def \t/CMapType 2 def \t1 begincodespacerange \t<0000> <FFFF> \tendcodespacerange \t1 beginbfchar \t<0001> <200B> \tendbfchar \tendcmap \tCMapName currentdict /CMap defineresource pop \tend \tend",a=new Uint8Array(v.length);
for(var X=0;X<v.length;X++)a[X]=v.charCodeAt(X);w["/Subtype"]="/TrueType";delete w["/Encoding"];w["/FirstChar"]=0;
w["/Widths"]=[];for(var X=0;X<256;X++)w["/Widths"].push(500);w["/LastChar"]=w["/Widths"].length-1;w["/FontDescriptor"]={"/Ascent":905,"/CapHeight":1010,"/Descent":211,"/Flags":4,"/FontBBox":[-627,-376,2e3,1011],"/FontName":y,"/ItalicAngle":0,"/StemV":80,"/Type":"/FontDescriptor","/FontFile2":{stream:new Uint8Array(c)}}}R[z]=w;
return z};function G(y,c,R,z){var w=[];for(var v=0;v<z.length;v++){var a=z[v];y.push({"/Type":"/Annot","/Subtype":"/Link","/F":4,"/Border":[0,0,0],"/Rect":a[0],"/A":{"/Type":"/Action","/S":"/URI","/URI":"("+a[1]+")"}});
w.push({typ:"ref",ind:y.length-1})}var v=y.length;y[2]["/Kids"].push({typ:"ref",ind:v});y[2]["/Count"]++;
y.push({"/Type":"/Page","/Parent":{typ:"ref",ind:2},"/Resources":{typ:"ref",ind:3},"/MediaBox":R,"/Annots":w,"/Contents":{typ:"ref",ind:v+1}});
y.push({stream:c})}function D(y){var c={file:new k,off:0},R=Q,z=[];R(c,"%PDF-1.1\n");for(var w=1;w<y.length;
w++){z.push(c.off);R(c,w+" 0 obj\n");E(c,y[w],0);R(c,"\nendobj\n")}var v=c.off;R(c,"xref\n");R(c,"0 "+y.length+"\n");
R(c,"0000000000 65535 f \n");for(var w=0;w<z.length;w++){var a=z[w]+"";while(a.length<10)a="0"+a;R(c,a+" 00000 n \n")}R(c,"trailer\n");
E(c,{"/Root":{typ:"ref",ind:1},"/Size":y.length},0);R(c,"\nstartxref\n"+v+"\n%%EOF\n");return c.file.data.buffer.slice(0,c.off)}function Q(y,c){y.file.req(y.off,c.length);
for(var R=0;R<c.length;R++)y.file.data[y.off+R]=c.charCodeAt(R);y.off+=c.length}function n(y){var c="";
for(var R=0;R<y;R++)c+="    ";return c}function f(y,c,R){var z=Q;if(!1){}else if(typeof c=="string")z(y,c);
else if(typeof c=="number")z(y,""+c);else if(typeof c=="boolean")z(y,""+c);else if(c.typ!=null)z(y,c.ind+" 0 R");
else if(c instanceof Array)N(y,c,R+1);else if(c instanceof Object)E(y,c,R+1);else{console.log(c);throw"e"}}function E(y,c,R){var z=Q,w=n,v=c.stream;
if(v){if(typeof v=="string"){var a=new Uint8Array(v.length);for(var X=0;X<v.length;X++)a[X]=v.charCodeAt(X);
v=a}if(c["/Filter"]==null){c["/Filter"]="/FlateDecode";v=pako.deflate(v)}}z(y,"<<\n");for(var F in c){if(F.charAt(0)!="/")continue;
z(y,w(R+1)+F+" ");f(y,c[F],R);z(y,"\n")}if(v)z(y,w(R+1)+"/Length "+v.length+"\n");z(y,w(R)+">>");if(v){z(y,w(R)+"\nstream\n");
y.file.req(y.off,v.length);for(var X=0;X<v.length;X++)y.file.data[y.off+X]=v[X];y.off+=v.length;z(y,w(R)+"\nendstream")}}function N(y,c,R){var z=Q;
z(y,"[ ");for(var w=0;w<c.length;w++){f(y,c[w],R+1);if(w!=c.length-1)z(y," ")}z(y," ]")}var k=function(){this.size=16;
this.data=new Uint8Array(16)};k.prototype.req=function(y,c){if(y+c<=this.size)return;var R=this.size;
while(y+c>this.size)this.size*=2;var z=new Uint8Array(this.size);for(var w=0;w<R;w++)z[w]=this.data[w];
this.data=z};return i}();function ToEMF(){this._file={file:new ToEMF.MFile,off:0};this._lstw=0;this._curx=0;
this._curh=0;this._recs=0;this._lenp=0;this._objs={};this._tabl=1;this._stkf=0;this._tclr=0;this._curt={p:-1,b:-1,t:-1};
this._inited=!1}ToEMF.prototype.StartTGroup=function(){};ToEMF.prototype.EndTGroup=function(){};ToEMF.prototype.StartPage=function(i,J,T,d){this._check();
var t=this._file,m=ToEMF.B.writeUint,C=ToEMF.B.writeInt;this._curh=Math.max(this._curh,d*10);if(!this._inited){this._inited=!0;
this._addRec("HEADER",88);ToEMF._writeHeadBox(t,[i,J,T,d]);t.off+=32;ToEMF.B.writeASCII(t.file,t.off," EMF");
t.off+=4;m(t.file,t.off,65536);t.off+=4;this._lenp=t.off;t.off+=4+4+4;t.off+=4+4+4;C(t.file,t.off,1440);
t.off+=4;C(t.file,t.off,900);t.off+=4;C(t.file,t.off,508);t.off+=4;C(t.file,t.off,318);t.off+=4;this._trsf([.1,0,0,.1,0,0]);
this._addRec("SETBKMODE",12);m(t.file,t.off,1);t.off+=4;this._addRec("SETTEXTALIGN",12);m(t.file,t.off,24);
t.off+=4}else{this._curx+=this._lstw;ToEMF._writeHeadBox(t,[0,0,this._curx+T,Math.round(this._curh/10)])}this._lstw=T};
ToEMF.prototype.Stroke=function(i){this._draw(i,1)};ToEMF.prototype.Fill=function(i,J){this._draw(i,2)};
ToEMF.prototype.PutImage=function(i,J,T,d,t){var s=J.length;if((s&3)!=0)s+=4-(s&3);var m=[1,0,0,-1,0,1];
UDOC.M.concat(m,i.ctm);UDOC.M.scale(m,10,10);UDOC.M.scale(m,1,-1);UDOC.M.translate(m,this._curx,this._curh);
this._trsf(m);var h=this._file,P=ToEMF.B.writeUint,A=ToEMF.B.writeInt,l=ToEMF.B.writeUshort,Z=8+16+14*4;
this._addRec("STRETCHDIBITS",Z+40+s);h.off+=16;A(h.file,h.off,Math.round(0));h.off+=4;A(h.file,h.off,Math.round(0));
h.off+=4;h.off+=8;A(h.file,h.off,T);h.off+=4;A(h.file,h.off,d);h.off+=4;P(h.file,h.off,Z);h.off+=4;P(h.file,h.off,40);
h.off+=4;P(h.file,h.off,Z+40);h.off+=4;P(h.file,h.off,J.length);h.off+=4;h.off+=4;P(h.file,h.off,13369376);
h.off+=4;A(h.file,h.off,Math.round(1));h.off+=4;A(h.file,h.off,Math.round(1));h.off+=4;A(h.file,h.off,40);
h.off+=4;A(h.file,h.off,T);h.off+=4;A(h.file,h.off,d);h.off+=4;l(h.file,h.off,1);h.off+=2;l(h.file,h.off,32);
h.off+=2;A(h.file,h.off,0);h.off+=4;A(h.file,h.off,J.length);h.off+=4;A(h.file,h.off,3800);h.off+=4;
A(h.file,h.off,3800);h.off+=4;h.off+=8;h.file.req(h.off,J.length);if(J.length==T*d*4){for(var K=0;K<d;
K++)for(var G=0;G<T;G++){var D=K*T+G<<2,Q=h.off+((d-1-K)*T+G<<2);h.file.data[Q]=J[D+2];h.file.data[Q+1]=J[D+1];
h.file.data[Q+2]=J[D];h.file.data[Q+3]=J[D+3]}}else for(var n=0;n<J.length;n++)h.file.data[h.off+n]=J[n];
h.off+=s;UDOC.M.invert(m);this._trsf(m)};ToEMF.prototype.PutText=function(i,J,T){var d=J.length,K;if((d&1)==1)d++;
this._check();var t=this._file,m=ToEMF.B.writeUint,C=ToEMF.B.writeInt,h=ToEMF.B.writeUshort,P=ToEMF.B.writeFloat,A=ToEMF._color(i.colr);
if(A!=this._tclr){this._addRec("SETTEXTCOLOR",12);m(t.file,t.off,A);t.off+=4;this._tclr=A}this._setTool("f",[i.font.Tf,Math.round(i.font.Tfs*10)]);
var l=10*(i.ctm[4]+this._curx),V=this._curh-10*i.ctm[5],Z=Math.abs(i.ctm[1])>.05;if(Z){K=i.ctm.slice(0);
K[1]*=-1;K[2]*=-1;K[4]=l;K[5]=V;l=V=0;this._trsf(K)}var G=8+16+12+4*6+16;this._addRec("EXTTEXTOUTW",G+d*2);
t.off+=16;m(t.file,t.off,2);t.off+=4;P(t.file,t.off,31.25);t.off+=4;P(t.file,t.off,31.25);t.off+=4;C(t.file,t.off,Math.round(l));
t.off+=4;C(t.file,t.off,Math.round(V));t.off+=4;m(t.file,t.off,J.length);t.off+=4;m(t.file,t.off,G);
t.off+=4;m(t.file,t.off,0);t.off+=4;t.off+=16;m(t.file,t.off,0);t.off+=4;for(var D=0;D<J.length;D++)h(t.file,t.off+D*2,J.charCodeAt(D));
t.off+=2*d;if(Z){UDOC.M.invert(K);this._trsf(K)}};ToEMF.prototype.ShowPage=function(){this._check()};
ToEMF.prototype.Done=function(){this._check();var i=this._file,J=ToEMF.B.writeUint;this._addRec("EOF",20);
J(i.file,i.off,0);i.off+=4;J(i.file,i.off,16);i.off+=4;J(i.file,i.off,20);i.off+=4;J(i.file,this._lenp,i.off);
J(i.file,this._lenp+4,this._recs);J(i.file,this._lenp+8,this._tabl);this.buffer=i.file.data.buffer.slice(0,i.off)};
ToEMF.prototype._check=function(){var i=this._file,J=this._stkf;if(J==0)return;if(J==1)this._addRec("STROKEPATH",24);
if(J==2)this._addRec("FILLPATH",24);if(J==3)this._addRec("STROKEANDFILLPATH",24);i.off+=16;this._stkf=0};
ToEMF.prototype._addRec=function(i,J){var T=this._file,d=ToEMF.B.writeUint;this._recs++;d(T.file,T.off,ToEMF.C["EMR_"+i]);
T.off+=4;d(T.file,T.off,J);T.off+=4};ToEMF.prototype._trsf=function(i){var J=this._file,T=ToEMF.B.writeInt;
this._addRec("MODIFYWORLDTRANSFORM",36);for(var d=0;d<i.length;d++){ToEMF.B.writeFloat(J.file,J.off,i[d]);
J.off+=4}T(J.file,J.off,2);J.off+=4};ToEMF._writeHeadBox=function(i,J){var T=i.off;i.off=8;ToEMF._writeBox(i,J);
var d=1/72*25.4*100;ToEMF._writeBox(i,[0,0,Math.round((J[2]-J[0])*d),Math.round((J[3]-J[1])*d)]);i.off=T};
ToEMF._writeBox=function(i,J){for(var T=0;T<4;T++){ToEMF.B.writeInt(i.file,i.off,J[T]);i.off+=4}};ToEMF.prototype._draw=function(i,J){var T=this._file,d=ToEMF.B.writeUint,t=ToEMF.B.writeInt,m=i.pth,C=JSON.stringify(m);
if(this._cpth!=C)this._check();if(J==1)this._setTool("p",[i.COLR,i.lwidth,i.ljoin]);else this._setTool("b",[i.colr]);
if(this._cpth==C){this._stkf+=J}else{var h={M:["MOVETOEX",1],L:["LINETO",1],Q:["POLYBEZIERTO",3],C:["POLYBEZIERTO",3],Z:["CLOSEFIGURE",0]},P=0,A=m.cmds.length;
this._addRec("BEGINPATH",8);for(var l=0;l<A;l++){var V=m.cmds[l],Z=h[V],Q=1;if(Z==null)throw V+" e";
var K=Z[1]*2,G=Z[0],D=8+4*K;while(!0){if(l+Q<A&&m.cmds[l+Q]==V)Q++;else break}var n=V=="C"||V=="Q"||V=="L"&&Q>1;
if(n){if(V=="L")G="POLYLINETO";D=8+20+4*K*Q}this._addRec(G,D);if(n){T.off+=16;d(T.file,T.off,Q*Z[1]);
T.off+=4;l+=Q-1}for(var f=0;f<Q;f++){var E=m.crds,N=P;if(V=="Q"){var k=E[N-2],c=E[N-1],R=E[N++],z=E[N++],w=E[N++],v=E[N++];
E=[(2*R+k)/3,(2*z+c)/3,(2*R+w)/3,(2*z+v)/3,w,v];N=0;P-=2}for(var a=0;a<K;a+=2){t(T.file,T.off,Math.round(10*(E[N]+this._curx)));
T.off+=4;N++;t(T.file,T.off,Math.round(this._curh-10*E[N]));T.off+=4;N++}P+=K}}this._addRec("ENDPATH",8);
this._cpth=C;this._stkf=J}};ToEMF.prototype._setTool=function(i,J){var T=this._file,d=ToEMF.B.writeUint,t=ToEMF.B.writeInt,m=i+JSON.stringify(J),C=this._objs[m];
if(C==null){C=this._objs[m]=this._tabl;this._tabl++;if(i=="b")this._addRec("CREATEBRUSHINDIRECT",24);
if(i=="p")this._addRec("CREATEPEN",28);if(i=="f")this._addRec("EXTCREATEFONTINDIRECTW",104);d(T.file,T.off,C);
T.off+=4;if(i=="b"||i=="p"){if(i=="p"){d(T.file,T.off,0);T.off+=4;var h=Math.round(J[1]*10);d(T.file,T.off,h);
T.off+=4;d(T.file,T.off,h);T.off+=4}else{d(T.file,T.off,0);T.off+=4}d(T.file,T.off,ToEMF._color(J[0]));
T.off+=4;if(i=="b"){d(T.file,T.off,0);T.off+=4}}if(i=="f"){var P=J[0],A=P.toLowerCase().indexOf("bold")!=-1;
if(P.endsWith("-Bold"))P=P.slice(0,P.length-5);t(T.file,T.off,-J[1]);T.off+=4;T.off+=12;d(T.file,T.off,A?700:400);
T.off+=4;d(T.file,T.off,0);T.off+=4;d(T.file,T.off,262151);T.off+=4;for(var l=0;l<P.length;l++)ToEMF.B.writeUshort(T.file,T.off+l*2,P.charCodeAt(l));
T.off+=64}}if(this._curt[i]!=C){this._addRec("SELECTOBJECT",12);d(T.file,T.off,C);T.off+=4;this._curt[i]=C}};
ToEMF._color=function(i){var J=i.grad;if(J)i=J[Math.floor(J.length/2)][1];var T=Math.round(i[0]*255),d=Math.round(i[1]*255),t=Math.round(i[2]*255);
return t<<16|d<<8|T<<0};ToEMF.B=function(){var i=new Uint8Array(4),J=i.buffer,T=new Int16Array(J),d=new Uint16Array(J),t=new Int32Array(J),s=new Uint32Array(J),m=new Float32Array(J);
return{writeShort:function(C,h,P){T[0]=P;C.req(h,2);var A=C.data;A[h]=i[0];A[h+1]=i[1]},writeUshort:function(C,h,P){d[0]=P;
C.req(h,2);var A=C.data;A[h]=i[0];A[h+1]=i[1]},writeInt:function(C,h,P){t[0]=P;C.req(h,4);var A=C.data;
A[h]=i[0];A[h+1]=i[1];A[h+2]=i[2];A[h+3]=i[3]},writeUint:function(C,h,P){s[0]=P;C.req(h,4);var A=C.data;
A[h]=i[0];A[h+1]=i[1];A[h+2]=i[2];A[h+3]=i[3]},writeFloat:function(C,h,P){m[0]=P;C.req(h,4);var A=C.data;
A[h]=i[0];A[h+1]=i[1];A[h+2]=i[2];A[h+3]=i[3]},writeASCII:function(C,h,P){C.req(h,P.length);for(var A=0;
A<P.length;A++)C.data[h+A]=P.charCodeAt(A)}}}();ToEMF.MFile=function(){this.size=16;this.data=new Uint8Array(16)};
ToEMF.MFile.prototype.req=function(i,J){if(i+J<=this.size)return;var T=this.size;while(i+J>this.size)this.size*=2;
var d=new Uint8Array(this.size);for(var t=0;t<T;t++)d[t]=this.data[t];this.data=d};ToEMF.C={EMR_HEADER:1,EMR_POLYBEZIER:2,EMR_POLYGON:3,EMR_POLYLINE:4,EMR_POLYBEZIERTO:5,EMR_POLYLINETO:6,EMR_POLYPOLYLINE:7,EMR_POLYPOLYGON:8,EMR_SETWINDOWEXTEX:9,EMR_SETWINDOWORGEX:10,EMR_SETVIEWPORTEXTEX:11,EMR_SETVIEWPORTORGEX:12,EMR_SETBRUSHORGEX:13,EMR_EOF:14,EMR_SETPIXELV:15,EMR_SETMAPPERFLAGS:16,EMR_SETMAPMODE:17,EMR_SETBKMODE:18,EMR_SETPOLYFILLMODE:19,EMR_SETROP2:20,EMR_SETSTRETCHBLTMODE:21,EMR_SETTEXTALIGN:22,EMR_SETCOLORADJUSTMENT:23,EMR_SETTEXTCOLOR:24,EMR_SETBKCOLOR:25,EMR_OFFSETCLIPRGN:26,EMR_MOVETOEX:27,EMR_SETMETARGN:28,EMR_EXCLUDECLIPRECT:29,EMR_INTERSECTCLIPRECT:30,EMR_SCALEVIEWPORTEXTEX:31,EMR_SCALEWINDOWEXTEX:32,EMR_SAVEDC:33,EMR_RESTOREDC:34,EMR_SETWORLDTRANSFORM:35,EMR_MODIFYWORLDTRANSFORM:36,EMR_SELECTOBJECT:37,EMR_CREATEPEN:38,EMR_CREATEBRUSHINDIRECT:39,EMR_DELETEOBJECT:40,EMR_ANGLEARC:41,EMR_ELLIPSE:42,EMR_RECTANGLE:43,EMR_ROUNDRECT:44,EMR_ARC:45,EMR_CHORD:46,EMR_PIE:47,EMR_SELECTPALETTE:48,EMR_CREATEPALETTE:49,EMR_SETPALETTEENTRIES:50,EMR_RESIZEPALETTE:51,EMR_REALIZEPALETTE:52,EMR_EXTFLOODFILL:53,EMR_LINETO:54,EMR_ARCTO:55,EMR_POLYDRAW:56,EMR_SETARCDIRECTION:57,EMR_SETMITERLIMIT:58,EMR_BEGINPATH:59,EMR_ENDPATH:60,EMR_CLOSEFIGURE:61,EMR_FILLPATH:62,EMR_STROKEANDFILLPATH:63,EMR_STROKEPATH:64,EMR_FLATTENPATH:65,EMR_WIDENPATH:66,EMR_SELECTCLIPPATH:67,EMR_ABORTPATH:68,EMR_COMMENT:70,EMR_FILLRGN:71,EMR_FRAMERGN:72,EMR_INVERTRGN:73,EMR_PAINTRGN:74,EMR_EXTSELECTCLIPRGN:75,EMR_BITBLT:76,EMR_STRETCHBLT:77,EMR_MASKBLT:78,EMR_PLGBLT:79,EMR_SETDIBITSTODEVICE:80,EMR_STRETCHDIBITS:81,EMR_EXTCREATEFONTINDIRECTW:82,EMR_EXTTEXTOUTA:83,EMR_EXTTEXTOUTW:84,EMR_POLYBEZIER16:85,EMR_POLYGON16:86,EMR_POLYLINE16:87,EMR_POLYBEZIERTO16:88,EMR_POLYLINETO16:89,EMR_POLYPOLYLINE16:90,EMR_POLYPOLYGON16:91,EMR_POLYDRAW16:92,EMR_CREATEMONOBRUSH:93,EMR_CREATEDIBPATTERNBRUSHPT:94,EMR_EXTCREATEPEN:95,EMR_POLYTEXTOUTA:96,EMR_POLYTEXTOUTW:97,EMR_SETICMMODE:98,EMR_CREATECOLORSPACE:99,EMR_SETCOLORSPACE:100,EMR_DELETECOLORSPACE:101,EMR_GLSRECORD:102,EMR_GLSBOUNDEDRECORD:103,EMR_PIXELFORMAT:104,EMR_DRAWESCAPE:105,EMR_EXTESCAPE:106,EMR_SMALLTEXTOUT:108,EMR_FORCEUFIMAPPING:109,EMR_NAMEDESCAPE:110,EMR_COLORCORRECTPALETTE:111,EMR_SETICMPROFILEA:112,EMR_SETICMPROFILEW:113,EMR_ALPHABLEND:114,EMR_SETLAYOUT:115,EMR_TRANSPARENTBLT:116,EMR_GRADIENTFILL:118,EMR_SETLINKEDUFIS:119,EMR_SETTEXTJUSTIFICATION:120,EMR_COLORMATCHTOTARGETW:121,EMR_CREATECOLORSPACEW:122};
ToEMF.K=[];(function(){var i,J,T;i=ToEMF.C;J=ToEMF.K;T=4;for(var d in i)J[i[d]]=d.slice(T)}());var ToDXF=function(){var i;
function J(){this.buffer=null}J.prototype.StartTGroup=function(){};J.prototype.EndTGroup=function(){};
J.prototype.StartPage=function(){if(i==null)i=[0,"SECTION",2,"ENTITIES"]};J.prototype.ShowPage=function(){};
J.prototype.Done=function(){i.push(0,"ENDSEC",0,"EOF","");var T=i.join("\n"),d=new Uint8Array(T.length);
this.buffer=d.buffer;for(var t=0;t<T.length;t++)d[t]=T.charCodeAt(t);i=null};J.prototype.PutImage=function(){};
J.prototype.PutText=function(T,d,t){while(d.endsWith("\n"))d=d.slice(0,d.length-1);i.push(0,"MTEXT");
i.push(40,T.font.Tfs);i.push(10,T.ctm[4],20,T.ctm[5]);i.push(1,d)};J.prototype.Fill=function(T){this.Stroke(T)};
J.prototype.Stroke=function(T){var d=T.pth.cmds,t=T.pth.crds,s=0,m=0,C=0,h=0,P=0;for(var A=0;A<d.length;
A++){var l=d[A];if(l=="M"){C=t[P++];h=t[P++];s=C;m=h}else if(l=="L"||l=="Z"){if(l=="Z"&&C==s&&h==m)continue;
i.push(0,"LINE",10,C,20,h);if(l=="L"){C=t[P++];h=t[P++]}else{C=s;h=m}i.push(11,C,21,h)}else if(l=="C"){i.push(0,"SPLINE");
i.push(210,0,220,0,230,0);i.push(70,8,71,3,72,8,73,4,74,0,42,0,43,0);for(var V=0;V<8;V++)i.push(40,V<4?0:1);
i.push(10,C,20,h);for(var V=0;V<3;V++){C=t[P++];h=t[P++];i.push(10,C,20,h)}}}};return J}()/* pako 1.0.5 nodeca/pako */
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.pako=t()}}(function(){return function t(e,a,i){function n(s,o){if(!a[s]){if(!e[s]){var l="function"==typeof require&&require;if(!o&&l)return l(s,!0);if(r)return r(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var d=a[s]={exports:{}};e[s][0].call(d.exports,function(t){var a=e[s][1][t];return n(a?a:t)},d,d.exports,t,e,a,i)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=l.assign({level:w,method:v,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==b)throw new Error(d[a]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?h.string2buf(e.dictionary):"[object ArrayBuffer]"===_.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=o.deflateSetDictionary(this.strm,n),a!==b)throw new Error(d[a]);this._dict_set=!0}}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||d[a.err];return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}function s(t,e){return e=e||{},e.gzip=!0,n(t,e)}var o=t("./zlib/deflate"),l=t("./utils/common"),h=t("./utils/strings"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=Object.prototype.toString,u=0,c=4,b=0,g=1,m=2,w=-1,p=0,v=8;i.prototype.push=function(t,e){var a,i,n=this.strm,r=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:e===!0?c:u,"string"==typeof t?n.input=h.string2buf(t):"[object ArrayBuffer]"===_.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new l.Buf8(r),n.next_out=0,n.avail_out=r),a=o.deflate(n,i),a!==g&&a!==b)return this.onEnd(a),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||i!==c&&i!==m)||("string"===this.options.to?this.onData(h.buf2binstring(l.shrinkBuf(n.output,n.next_out))):this.onData(l.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&a!==g);return i===c?(a=o.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===b):i!==m||(this.onEnd(b),n.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===b&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Deflate=i,a.deflate=n,a.deflateRaw=r,a.gzip=s},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(t,e,a){"use strict";function i(t){if(!(this instanceof i))return new i(t);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var a=s.inflateInit2(this.strm,e.windowBits);if(a!==h.Z_OK)throw new Error(d[a]);this.header=new _,s.inflateGetHeader(this.strm,this.header)}function n(t,e){var a=new i(e);if(a.push(t,!0),a.err)throw a.msg||d[a.err];return a.result}function r(t,e){return e=e||{},e.raw=!0,n(t,e)}var s=t("./zlib/inflate"),o=t("./utils/common"),l=t("./utils/strings"),h=t("./zlib/constants"),d=t("./zlib/messages"),f=t("./zlib/zstream"),_=t("./zlib/gzheader"),u=Object.prototype.toString;i.prototype.push=function(t,e){var a,i,n,r,d,f,_=this.strm,c=this.options.chunkSize,b=this.options.dictionary,g=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?h.Z_FINISH:h.Z_NO_FLUSH,"string"==typeof t?_.input=l.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?_.input=new Uint8Array(t):_.input=t,_.next_in=0,_.avail_in=_.input.length;do{if(0===_.avail_out&&(_.output=new o.Buf8(c),_.next_out=0,_.avail_out=c),a=s.inflate(_,h.Z_NO_FLUSH),a===h.Z_NEED_DICT&&b&&(f="string"==typeof b?l.string2buf(b):"[object ArrayBuffer]"===u.call(b)?new Uint8Array(b):b,a=s.inflateSetDictionary(this.strm,f)),a===h.Z_BUF_ERROR&&g===!0&&(a=h.Z_OK,g=!1),a!==h.Z_STREAM_END&&a!==h.Z_OK)return this.onEnd(a),this.ended=!0,!1;_.next_out&&(0!==_.avail_out&&a!==h.Z_STREAM_END&&(0!==_.avail_in||i!==h.Z_FINISH&&i!==h.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(_.output,_.next_out),r=_.next_out-n,d=l.buf2string(_.output,n),_.next_out=r,_.avail_out=c-r,r&&o.arraySet(_.output,_.output,n,r,0),this.onData(d)):this.onData(o.shrinkBuf(_.output,_.next_out)))),0===_.avail_in&&0===_.avail_out&&(g=!0)}while((_.avail_in>0||0===_.avail_out)&&a!==h.Z_STREAM_END);return a===h.Z_STREAM_END&&(i=h.Z_FINISH),i===h.Z_FINISH?(a=s.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===h.Z_OK):i!==h.Z_SYNC_FLUSH||(this.onEnd(h.Z_OK),_.avail_out=0,!0)},i.prototype.onData=function(t){this.chunks.push(t)},i.prototype.onEnd=function(t){t===h.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},a.Inflate=i,a.inflate=n,a.inflateRaw=r,a.ungzip=n},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(t,e,a){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;a.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var i in a)a.hasOwnProperty(i)&&(t[i]=a[i])}}return t},a.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,a,i,n){if(e.subarray&&t.subarray)return void t.set(e.subarray(a,a+i),n);for(var r=0;r<i;r++)t[n+r]=e[a+r]},flattenChunks:function(t){var e,a,i,n,r,s;for(i=0,e=0,a=t.length;e<a;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,a=t.length;e<a;e++)r=t[e],s.set(r,n),n+=r.length;return s}},r={arraySet:function(t,e,a,i,n){for(var r=0;r<i;r++)t[n+r]=e[a+r]},flattenChunks:function(t){return[].concat.apply([],t)}};a.setTyped=function(t){t?(a.Buf8=Uint8Array,a.Buf16=Uint16Array,a.Buf32=Int32Array,a.assign(a,n)):(a.Buf8=Array,a.Buf16=Array,a.Buf32=Array,a.assign(a,r))},a.setTyped(i)},{}],4:[function(t,e,a){"use strict";function i(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var a="",i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a}var n=t("./common"),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new n.Buf8(256),l=0;l<256;l++)o[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;o[254]=o[254]=1,a.string2buf=function(t){var e,a,i,r,s,o=t.length,l=0;for(r=0;r<o;r++)a=t.charCodeAt(r),55296===(64512&a)&&r+1<o&&(i=t.charCodeAt(r+1),56320===(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),r++)),l+=a<128?1:a<2048?2:a<65536?3:4;for(e=new n.Buf8(l),s=0,r=0;s<l;r++)a=t.charCodeAt(r),55296===(64512&a)&&r+1<o&&(i=t.charCodeAt(r+1),56320===(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),r++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},a.buf2binstring=function(t){return i(t,t.length)},a.binstring2buf=function(t){for(var e=new n.Buf8(t.length),a=0,i=e.length;a<i;a++)e[a]=t.charCodeAt(a);return e},a.buf2string=function(t,e){var a,n,r,s,l=e||t.length,h=new Array(2*l);for(n=0,a=0;a<l;)if(r=t[a++],r<128)h[n++]=r;else if(s=o[r],s>4)h[n++]=65533,a+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&a<l;)r=r<<6|63&t[a++],s--;s>1?h[n++]=65533:r<65536?h[n++]=r:(r-=65536,h[n++]=55296|r>>10&1023,h[n++]=56320|1023&r)}return i(h,n)},a.utf8border=function(t,e){var a;for(e=e||t.length,e>t.length&&(e=t.length),a=e-1;a>=0&&128===(192&t[a]);)a--;return a<0?e:0===a?e:a+o[t[a]]>e?a:e}},{"./common":3}],5:[function(t,e,a){"use strict";function i(t,e,a,i){for(var n=65535&t|0,r=t>>>16&65535|0,s=0;0!==a;){s=a>2e3?2e3:a,a-=s;do n=n+e[i++]|0,r=r+n|0;while(--s);n%=65521,r%=65521}return n|r<<16|0}e.exports=i},{}],6:[function(t,e,a){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],7:[function(t,e,a){"use strict";function i(){for(var t,e=[],a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}function n(t,e,a,i){var n=r,s=i+a;t^=-1;for(var o=i;o<s;o++)t=t>>>8^n[255&(t^e[o])];return t^-1}var r=i();e.exports=n},{}],8:[function(t,e,a){"use strict";function i(t,e){return t.msg=D[e],e}function n(t){return(t<<1)-(t>4?9:0)}function r(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(R.arraySet(t.output,e.pending_buf,e.pending_out,a,t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))}function o(t,e){C._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function d(t,e,a,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,R.arraySet(e,t.input,t.next_in,n,a),1===t.state.wrap?t.adler=N(t.adler,e,n,a):2===t.state.wrap&&(t.adler=O(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)}function f(t,e){var a,i,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-ft?t.strstart-(t.w_size-ft):0,h=t.window,d=t.w_mask,f=t.prev,_=t.strstart+dt,u=h[r+s-1],c=h[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(a=e,h[a+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do;while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<_);if(i=dt-(_-r),r=_-dt,i>s){if(t.match_start=e,s=i,i>=o)break;u=h[r+s-1],c=h[r+s]}}while((e=f[e&d])>l&&0!==--n);return s<=t.lookahead?s:t.lookahead}function _(t){var e,a,i,n,r,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-ft)){R.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,a=t.hash_size,e=a;do i=t.head[--e],t.head[e]=i>=s?i-s:0;while(--a);a=s,e=a;do i=t.prev[--e],t.prev[e]=i>=s?i-s:0;while(--a);n+=s}if(0===t.strm.avail_in)break;if(a=d(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=a,t.lookahead+t.insert>=ht)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[r+ht-1])&t.hash_mask,t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<ht)););}while(t.lookahead<ft&&0!==t.strm.avail_in)}function u(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(_(t),0===t.lookahead&&e===I)return vt;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,o(t,!1),0===t.strm.avail_out))return vt;if(t.strstart-t.block_start>=t.w_size-ft&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.strstart>t.block_start&&(o(t,!1),0===t.strm.avail_out)?vt:vt}function c(t,e){for(var a,i;;){if(t.lookahead<ft){if(_(t),t.lookahead<ft&&e===I)return vt;if(0===t.lookahead)break}if(a=0,t.lookahead>=ht&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ft&&(t.match_length=f(t,a)),t.match_length>=ht)if(i=C._tr_tally(t,t.strstart-t.match_start,t.match_length-ht),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ht){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=t.strstart<ht-1?t.strstart:ht-1,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function b(t,e){for(var a,i,n;;){if(t.lookahead<ft){if(_(t),t.lookahead<ft&&e===I)return vt;if(0===t.lookahead)break}if(a=0,t.lookahead>=ht&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ht-1,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-ft&&(t.match_length=f(t,a),t.match_length<=5&&(t.strategy===q||t.match_length===ht&&t.strstart-t.match_start>4096)&&(t.match_length=ht-1)),t.prev_length>=ht&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ht,i=C._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-ht),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+ht-1])&t.hash_mask,a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=ht-1,t.strstart++,i&&(o(t,!1),0===t.strm.avail_out))return vt}else if(t.match_available){if(i=C._tr_tally(t,0,t.window[t.strstart-1]),i&&o(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return vt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=C._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<ht-1?t.strstart:ht-1,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function g(t,e){for(var a,i,n,r,s=t.window;;){if(t.lookahead<=dt){if(_(t),t.lookahead<=dt&&e===I)return vt;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=ht&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){r=t.strstart+dt;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<r);t.match_length=dt-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ht?(a=C._tr_tally(t,1,t.match_length-ht),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function m(t,e){for(var a;;){if(0===t.lookahead&&(_(t),0===t.lookahead)){if(e===I)return vt;break}if(t.match_length=0,a=C._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(o(t,!1),0===t.strm.avail_out))return vt}return t.insert=0,e===F?(o(t,!0),0===t.strm.avail_out?yt:xt):t.last_lit&&(o(t,!1),0===t.strm.avail_out)?vt:kt}function w(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}function p(t){t.window_size=2*t.w_size,r(t.head),t.max_lazy_match=Z[t.level].max_lazy,t.good_match=Z[t.level].good_length,t.nice_match=Z[t.level].nice_length,t.max_chain_length=Z[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ht-1,t.match_available=0,t.ins_h=0}function v(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=V,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new R.Buf16(2*ot),this.dyn_dtree=new R.Buf16(2*(2*rt+1)),this.bl_tree=new R.Buf16(2*(2*st+1)),r(this.dyn_ltree),r(this.dyn_dtree),r(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new R.Buf16(lt+1),this.heap=new R.Buf16(2*nt+1),r(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new R.Buf16(2*nt+1),r(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=Q,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ut:wt,t.adler=2===e.wrap?0:1,e.last_flush=I,C._tr_init(e),H):i(t,K)}function y(t){var e=k(t);return e===H&&p(t.state),e}function x(t,e){return t&&t.state?2!==t.state.wrap?K:(t.state.gzhead=e,H):K}function z(t,e,a,n,r,s){if(!t)return K;var o=1;if(e===Y&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>$||a!==V||n<8||n>15||e<0||e>9||s<0||s>W)return i(t,K);8===n&&(n=9);var l=new v;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+ht-1)/ht),l.window=new R.Buf8(2*l.w_size),l.head=new R.Buf16(l.hash_size),l.prev=new R.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new R.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=s,l.method=a,y(t)}function B(t,e){return z(t,e,V,tt,et,J)}function S(t,e){var a,o,d,f;if(!t||!t.state||e>L||e<0)return t?i(t,K):K;if(o=t.state,!t.output||!t.input&&0!==t.avail_in||o.status===pt&&e!==F)return i(t,0===t.avail_out?P:K);if(o.strm=t,a=o.last_flush,o.last_flush=e,o.status===ut)if(2===o.wrap)t.adler=0,l(o,31),l(o,139),l(o,8),o.gzhead?(l(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),l(o,255&o.gzhead.time),l(o,o.gzhead.time>>8&255),l(o,o.gzhead.time>>16&255),l(o,o.gzhead.time>>24&255),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(l(o,255&o.gzhead.extra.length),l(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(t.adler=O(t.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=ct):(l(o,0),l(o,0),l(o,0),l(o,0),l(o,0),l(o,9===o.level?2:o.strategy>=G||o.level<2?4:0),l(o,zt),o.status=wt);else{var _=V+(o.w_bits-8<<4)<<8,u=-1;u=o.strategy>=G||o.level<2?0:o.level<6?1:6===o.level?2:3,_|=u<<6,0!==o.strstart&&(_|=_t),_+=31-_%31,o.status=wt,h(o,_),0!==o.strstart&&(h(o,t.adler>>>16),h(o,65535&t.adler)),t.adler=1}if(o.status===ct)if(o.gzhead.extra){for(d=o.pending;o.gzindex<(65535&o.gzhead.extra.length)&&(o.pending!==o.pending_buf_size||(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending!==o.pending_buf_size));)l(o,255&o.gzhead.extra[o.gzindex]),o.gzindex++;o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),o.gzindex===o.gzhead.extra.length&&(o.gzindex=0,o.status=bt)}else o.status=bt;if(o.status===bt)if(o.gzhead.name){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,l(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.gzindex=0,o.status=gt)}else o.status=gt;if(o.status===gt)if(o.gzhead.comment){d=o.pending;do{if(o.pending===o.pending_buf_size&&(o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),s(t),d=o.pending,o.pending===o.pending_buf_size)){f=1;break}f=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,l(o,f)}while(0!==f);o.gzhead.hcrc&&o.pending>d&&(t.adler=O(t.adler,o.pending_buf,o.pending-d,d)),0===f&&(o.status=mt)}else o.status=mt;if(o.status===mt&&(o.gzhead.hcrc?(o.pending+2>o.pending_buf_size&&s(t),o.pending+2<=o.pending_buf_size&&(l(o,255&t.adler),l(o,t.adler>>8&255),t.adler=0,o.status=wt)):o.status=wt),0!==o.pending){if(s(t),0===t.avail_out)return o.last_flush=-1,H}else if(0===t.avail_in&&n(e)<=n(a)&&e!==F)return i(t,P);if(o.status===pt&&0!==t.avail_in)return i(t,P);if(0!==t.avail_in||0!==o.lookahead||e!==I&&o.status!==pt){var c=o.strategy===G?m(o,e):o.strategy===X?g(o,e):Z[o.level].func(o,e);if(c!==yt&&c!==xt||(o.status=pt),c===vt||c===yt)return 0===t.avail_out&&(o.last_flush=-1),H;if(c===kt&&(e===U?C._tr_align(o):e!==L&&(C._tr_stored_block(o,0,0,!1),e===T&&(r(o.head),0===o.lookahead&&(o.strstart=0,o.block_start=0,o.insert=0))),s(t),0===t.avail_out))return o.last_flush=-1,H}return e!==F?H:o.wrap<=0?j:(2===o.wrap?(l(o,255&t.adler),l(o,t.adler>>8&255),l(o,t.adler>>16&255),l(o,t.adler>>24&255),l(o,255&t.total_in),l(o,t.total_in>>8&255),l(o,t.total_in>>16&255),l(o,t.total_in>>24&255)):(h(o,t.adler>>>16),h(o,65535&t.adler)),s(t),o.wrap>0&&(o.wrap=-o.wrap),0!==o.pending?H:j)}function E(t){var e;return t&&t.state?(e=t.state.status,e!==ut&&e!==ct&&e!==bt&&e!==gt&&e!==mt&&e!==wt&&e!==pt?i(t,K):(t.state=null,e===wt?i(t,M):H)):K}function A(t,e){var a,i,n,s,o,l,h,d,f=e.length;if(!t||!t.state)return K;if(a=t.state,s=a.wrap,2===s||1===s&&a.status!==ut||a.lookahead)return K;for(1===s&&(t.adler=N(t.adler,e,f,0)),a.wrap=0,f>=a.w_size&&(0===s&&(r(a.head),a.strstart=0,a.block_start=0,a.insert=0),d=new R.Buf8(a.w_size),R.arraySet(d,e,f-a.w_size,a.w_size,0),e=d,f=a.w_size),o=t.avail_in,l=t.next_in,h=t.input,t.avail_in=f,t.next_in=0,t.input=e,_(a);a.lookahead>=ht;){i=a.strstart,n=a.lookahead-(ht-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[i+ht-1])&a.hash_mask,a.prev[i&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=i,i++;while(--n);a.strstart=i,a.lookahead=ht-1,_(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=ht-1,a.match_available=0,t.next_in=l,t.input=h,t.avail_in=o,a.wrap=s,H}var Z,R=t("../utils/common"),C=t("./trees"),N=t("./adler32"),O=t("./crc32"),D=t("./messages"),I=0,U=1,T=3,F=4,L=5,H=0,j=1,K=-2,M=-3,P=-5,Y=-1,q=1,G=2,X=3,W=4,J=0,Q=2,V=8,$=9,tt=15,et=8,at=29,it=256,nt=it+1+at,rt=30,st=19,ot=2*nt+1,lt=15,ht=3,dt=258,ft=dt+ht+1,_t=32,ut=42,ct=69,bt=73,gt=91,mt=103,wt=113,pt=666,vt=1,kt=2,yt=3,xt=4,zt=3;Z=[new w(0,0,0,0,u),new w(4,4,8,4,c),new w(4,5,16,8,c),new w(4,6,32,32,c),new w(4,4,16,16,b),new w(8,16,32,32,b),new w(8,16,128,128,b),new w(8,32,128,256,b),new w(32,128,258,1024,b),new w(32,258,258,4096,b)],a.deflateInit=B,a.deflateInit2=z,a.deflateReset=y,a.deflateResetKeep=k,a.deflateSetHeader=x,a.deflate=S,a.deflateEnd=E,a.deflateSetDictionary=A,a.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(t,e,a){"use strict";function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}e.exports=i},{}],10:[function(t,e,a){"use strict";var i=30,n=12;e.exports=function(t,e){var a,r,s,o,l,h,d,f,_,u,c,b,g,m,w,p,v,k,y,x,z,B,S,E,A;a=t.state,r=t.next_in,E=t.input,s=r+(t.avail_in-5),o=t.next_out,A=t.output,l=o-(e-t.avail_out),h=o+(t.avail_out-257),d=a.dmax,f=a.wsize,_=a.whave,u=a.wnext,c=a.window,b=a.hold,g=a.bits,m=a.lencode,w=a.distcode,p=(1<<a.lenbits)-1,v=(1<<a.distbits)-1;t:do{g<15&&(b+=E[r++]<<g,g+=8,b+=E[r++]<<g,g+=8),k=m[b&p];e:for(;;){if(y=k>>>24,b>>>=y,g-=y,y=k>>>16&255,0===y)A[o++]=65535&k;else{if(!(16&y)){if(0===(64&y)){k=m[(65535&k)+(b&(1<<y)-1)];continue e}if(32&y){a.mode=n;break t}t.msg="invalid literal/length code",a.mode=i;break t}x=65535&k,y&=15,y&&(g<y&&(b+=E[r++]<<g,g+=8),x+=b&(1<<y)-1,b>>>=y,g-=y),g<15&&(b+=E[r++]<<g,g+=8,b+=E[r++]<<g,g+=8),k=w[b&v];a:for(;;){if(y=k>>>24,b>>>=y,g-=y,y=k>>>16&255,!(16&y)){if(0===(64&y)){k=w[(65535&k)+(b&(1<<y)-1)];continue a}t.msg="invalid distance code",a.mode=i;break t}if(z=65535&k,y&=15,g<y&&(b+=E[r++]<<g,g+=8,g<y&&(b+=E[r++]<<g,g+=8)),z+=b&(1<<y)-1,z>d){t.msg="invalid distance too far back",a.mode=i;break t}if(b>>>=y,g-=y,y=o-l,z>y){if(y=z-y,y>_&&a.sane){t.msg="invalid distance too far back",a.mode=i;break t}if(B=0,S=c,0===u){if(B+=f-y,y<x){x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}}else if(u<y){if(B+=f+u-y,y-=u,y<x){x-=y;do A[o++]=c[B++];while(--y);if(B=0,u<x){y=u,x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}}}else if(B+=u-y,y<x){x-=y;do A[o++]=c[B++];while(--y);B=o-z,S=A}for(;x>2;)A[o++]=S[B++],A[o++]=S[B++],A[o++]=S[B++],x-=3;x&&(A[o++]=S[B++],x>1&&(A[o++]=S[B++]))}else{B=o-z;do A[o++]=A[B++],A[o++]=A[B++],A[o++]=A[B++],x-=3;while(x>2);x&&(A[o++]=A[B++],x>1&&(A[o++]=A[B++]))}break}}break}}while(r<s&&o<h);x=g>>3,r-=x,g-=x<<3,b&=(1<<g)-1,t.next_in=r,t.next_out=o,t.avail_in=r<s?5+(s-r):5-(r-s),t.avail_out=o<h?257+(h-o):257-(o-h),a.hold=b,a.bits=g}},{}],11:[function(t,e,a){"use strict";function i(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new w.Buf16(320),this.work=new w.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=T,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new w.Buf32(bt),e.distcode=e.distdyn=new w.Buf32(gt),e.sane=1,e.back=-1,Z):N}function s(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,r(t)):N}function o(t,e){var a,i;return t&&t.state?(i=t.state,e<0?(a=0,e=-e):(a=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?N:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,s(t))):N}function l(t,e){var a,i;return t?(i=new n,t.state=i,i.window=null,a=o(t,e),a!==Z&&(t.state=null),a):N}function h(t){return l(t,wt)}function d(t){if(pt){var e;for(g=new w.Buf32(512),m=new w.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(z,t.lens,0,288,g,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(B,t.lens,0,32,m,0,t.work,{bits:5}),pt=!1}t.lencode=g,t.lenbits=9,t.distcode=m,t.distbits=5}function f(t,e,a,i){var n,r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new w.Buf8(r.wsize)),i>=r.wsize?(w.arraySet(r.window,e,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(n=r.wsize-r.wnext,n>i&&(n=i),w.arraySet(r.window,e,a-i,n,r.wnext),i-=n,i?(w.arraySet(r.window,e,a-i,i,0),r.wnext=i,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=n))),0}function _(t,e){var a,n,r,s,o,l,h,_,u,c,b,g,m,bt,gt,mt,wt,pt,vt,kt,yt,xt,zt,Bt,St=0,Et=new w.Buf8(4),At=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return N;a=t.state,a.mode===X&&(a.mode=W),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,c=l,b=h,xt=Z;t:for(;;)switch(a.mode){case T:if(0===a.wrap){a.mode=W;break}for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(2&a.wrap&&35615===_){a.check=0,Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0),_=0,u=0,a.mode=F;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&_)<<8)+(_>>8))%31){t.msg="incorrect header check",a.mode=_t;break}if((15&_)!==U){t.msg="unknown compression method",a.mode=_t;break}if(_>>>=4,u-=4,yt=(15&_)+8,0===a.wbits)a.wbits=yt;else if(yt>a.wbits){t.msg="invalid window size",a.mode=_t;break}a.dmax=1<<yt,t.adler=a.check=1,a.mode=512&_?q:X,_=0,u=0;break;case F:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(a.flags=_,(255&a.flags)!==U){t.msg="unknown compression method",a.mode=_t;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=_t;break}a.head&&(a.head.text=_>>8&1),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=L;case L:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.head&&(a.head.time=_),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,Et[2]=_>>>16&255,Et[3]=_>>>24&255,a.check=v(a.check,Et,4,0)),_=0,u=0,a.mode=H;case H:for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.head&&(a.head.xflags=255&_,a.head.os=_>>8),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0,a.mode=j;case j:if(1024&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length=_,a.head&&(a.head.extra_len=_),512&a.flags&&(Et[0]=255&_,Et[1]=_>>>8&255,a.check=v(a.check,Et,2,0)),_=0,u=0}else a.head&&(a.head.extra=null);a.mode=K;case K:if(1024&a.flags&&(g=a.length,g>l&&(g=l),g&&(a.head&&(yt=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),w.arraySet(a.head.extra,n,s,g,yt)),512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,a.length-=g),a.length))break t;a.length=0,a.mode=M;case M:if(2048&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.name+=String.fromCharCode(yt));while(yt&&g<l);if(512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,yt)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=P;case P:if(4096&a.flags){if(0===l)break t;g=0;do yt=n[s+g++],a.head&&yt&&a.length<65536&&(a.head.comment+=String.fromCharCode(yt));while(yt&&g<l);if(512&a.flags&&(a.check=v(a.check,n,g,s)),l-=g,s+=g,yt)break t}else a.head&&(a.head.comment=null);a.mode=Y;case Y:if(512&a.flags){for(;u<16;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(65535&a.check)){t.msg="header crc mismatch",a.mode=_t;break}_=0,u=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=X;break;case q:for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}t.adler=a.check=i(_),_=0,u=0,a.mode=G;case G:if(0===a.havedict)return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,C;t.adler=a.check=1,a.mode=X;case X:if(e===E||e===A)break t;case W:if(a.last){_>>>=7&u,u-=7&u,a.mode=ht;break}for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}switch(a.last=1&_,_>>>=1,u-=1,3&_){case 0:a.mode=J;break;case 1:if(d(a),a.mode=at,e===A){_>>>=2,u-=2;break t}break;case 2:a.mode=$;break;case 3:t.msg="invalid block type",a.mode=_t}_>>>=2,u-=2;break;case J:for(_>>>=7&u,u-=7&u;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if((65535&_)!==(_>>>16^65535)){t.msg="invalid stored block lengths",a.mode=_t;break}if(a.length=65535&_,_=0,u=0,a.mode=Q,e===A)break t;case Q:a.mode=V;case V:if(g=a.length){if(g>l&&(g=l),g>h&&(g=h),0===g)break t;w.arraySet(r,n,s,g,o),l-=g,s+=g,h-=g,o+=g,a.length-=g;break}a.mode=X;break;case $:
for(;u<14;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(a.nlen=(31&_)+257,_>>>=5,u-=5,a.ndist=(31&_)+1,_>>>=5,u-=5,a.ncode=(15&_)+4,_>>>=4,u-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=_t;break}a.have=0,a.mode=tt;case tt:for(;a.have<a.ncode;){for(;u<3;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.lens[At[a.have++]]=7&_,_>>>=3,u-=3}for(;a.have<19;)a.lens[At[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,zt={bits:a.lenbits},xt=y(x,a.lens,0,19,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid code lengths set",a.mode=_t;break}a.have=0,a.mode=et;case et:for(;a.have<a.nlen+a.ndist;){for(;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(wt<16)_>>>=gt,u-=gt,a.lens[a.have++]=wt;else{if(16===wt){for(Bt=gt+2;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_>>>=gt,u-=gt,0===a.have){t.msg="invalid bit length repeat",a.mode=_t;break}yt=a.lens[a.have-1],g=3+(3&_),_>>>=2,u-=2}else if(17===wt){for(Bt=gt+3;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=3+(7&_),_>>>=3,u-=3}else{for(Bt=gt+7;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=gt,u-=gt,yt=0,g=11+(127&_),_>>>=7,u-=7}if(a.have+g>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=_t;break}for(;g--;)a.lens[a.have++]=yt}}if(a.mode===_t)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=_t;break}if(a.lenbits=9,zt={bits:a.lenbits},xt=y(z,a.lens,0,a.nlen,a.lencode,0,a.work,zt),a.lenbits=zt.bits,xt){t.msg="invalid literal/lengths set",a.mode=_t;break}if(a.distbits=6,a.distcode=a.distdyn,zt={bits:a.distbits},xt=y(B,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,zt),a.distbits=zt.bits,xt){t.msg="invalid distances set",a.mode=_t;break}if(a.mode=at,e===A)break t;case at:a.mode=it;case it:if(l>=6&&h>=258){t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,k(t,b),o=t.next_out,r=t.output,h=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,_=a.hold,u=a.bits,a.mode===X&&(a.back=-1);break}for(a.back=0;St=a.lencode[_&(1<<a.lenbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(mt&&0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.lencode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,a.length=wt,0===mt){a.mode=lt;break}if(32&mt){a.back=-1,a.mode=X;break}if(64&mt){t.msg="invalid literal/length code",a.mode=_t;break}a.extra=15&mt,a.mode=nt;case nt:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.length+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=rt;case rt:for(;St=a.distcode[_&(1<<a.distbits)-1],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(0===(240&mt)){for(pt=gt,vt=mt,kt=wt;St=a.distcode[kt+((_&(1<<pt+vt)-1)>>pt)],gt=St>>>24,mt=St>>>16&255,wt=65535&St,!(pt+gt<=u);){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}_>>>=pt,u-=pt,a.back+=pt}if(_>>>=gt,u-=gt,a.back+=gt,64&mt){t.msg="invalid distance code",a.mode=_t;break}a.offset=wt,a.extra=15&mt,a.mode=st;case st:if(a.extra){for(Bt=a.extra;u<Bt;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}a.offset+=_&(1<<a.extra)-1,_>>>=a.extra,u-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=_t;break}a.mode=ot;case ot:if(0===h)break t;if(g=b-h,a.offset>g){if(g=a.offset-g,g>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=_t;break}g>a.wnext?(g-=a.wnext,m=a.wsize-g):m=a.wnext-g,g>a.length&&(g=a.length),bt=a.window}else bt=r,m=o-a.offset,g=a.length;g>h&&(g=h),h-=g,a.length-=g;do r[o++]=bt[m++];while(--g);0===a.length&&(a.mode=it);break;case lt:if(0===h)break t;r[o++]=a.length,h--,a.mode=it;break;case ht:if(a.wrap){for(;u<32;){if(0===l)break t;l--,_|=n[s++]<<u,u+=8}if(b-=h,t.total_out+=b,a.total+=b,b&&(t.adler=a.check=a.flags?v(a.check,r,b,o-b):p(a.check,r,b,o-b)),b=h,(a.flags?_:i(_))!==a.check){t.msg="incorrect data check",a.mode=_t;break}_=0,u=0}a.mode=dt;case dt:if(a.wrap&&a.flags){for(;u<32;){if(0===l)break t;l--,_+=n[s++]<<u,u+=8}if(_!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=_t;break}_=0,u=0}a.mode=ft;case ft:xt=R;break t;case _t:xt=O;break t;case ut:return D;case ct:default:return N}return t.next_out=o,t.avail_out=h,t.next_in=s,t.avail_in=l,a.hold=_,a.bits=u,(a.wsize||b!==t.avail_out&&a.mode<_t&&(a.mode<ht||e!==S))&&f(t,t.output,t.next_out,b-t.avail_out)?(a.mode=ut,D):(c-=t.avail_in,b-=t.avail_out,t.total_in+=c,t.total_out+=b,a.total+=b,a.wrap&&b&&(t.adler=a.check=a.flags?v(a.check,r,b,t.next_out-b):p(a.check,r,b,t.next_out-b)),t.data_type=a.bits+(a.last?64:0)+(a.mode===X?128:0)+(a.mode===at||a.mode===Q?256:0),(0===c&&0===b||e===S)&&xt===Z&&(xt=I),xt)}function u(t){if(!t||!t.state)return N;var e=t.state;return e.window&&(e.window=null),t.state=null,Z}function c(t,e){var a;return t&&t.state?(a=t.state,0===(2&a.wrap)?N:(a.head=e,e.done=!1,Z)):N}function b(t,e){var a,i,n,r=e.length;return t&&t.state?(a=t.state,0!==a.wrap&&a.mode!==G?N:a.mode===G&&(i=1,i=p(i,e,r,0),i!==a.check)?O:(n=f(t,e,r,r))?(a.mode=ut,D):(a.havedict=1,Z)):N}var g,m,w=t("../utils/common"),p=t("./adler32"),v=t("./crc32"),k=t("./inffast"),y=t("./inftrees"),x=0,z=1,B=2,S=4,E=5,A=6,Z=0,R=1,C=2,N=-2,O=-3,D=-4,I=-5,U=8,T=1,F=2,L=3,H=4,j=5,K=6,M=7,P=8,Y=9,q=10,G=11,X=12,W=13,J=14,Q=15,V=16,$=17,tt=18,et=19,at=20,it=21,nt=22,rt=23,st=24,ot=25,lt=26,ht=27,dt=28,ft=29,_t=30,ut=31,ct=32,bt=852,gt=592,mt=15,wt=mt,pt=!0;a.inflateReset=s,a.inflateReset2=o,a.inflateResetKeep=r,a.inflateInit=h,a.inflateInit2=l,a.inflate=_,a.inflateEnd=u,a.inflateGetHeader=c,a.inflateSetDictionary=b,a.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(t,e,a){"use strict";var i=t("../utils/common"),n=15,r=852,s=592,o=0,l=1,h=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],f=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(t,e,a,c,b,g,m,w){var p,v,k,y,x,z,B,S,E,A=w.bits,Z=0,R=0,C=0,N=0,O=0,D=0,I=0,U=0,T=0,F=0,L=null,H=0,j=new i.Buf16(n+1),K=new i.Buf16(n+1),M=null,P=0;for(Z=0;Z<=n;Z++)j[Z]=0;for(R=0;R<c;R++)j[e[a+R]]++;for(O=A,N=n;N>=1&&0===j[N];N--);if(O>N&&(O=N),0===N)return b[g++]=20971520,b[g++]=20971520,w.bits=1,0;for(C=1;C<N&&0===j[C];C++);for(O<C&&(O=C),U=1,Z=1;Z<=n;Z++)if(U<<=1,U-=j[Z],U<0)return-1;if(U>0&&(t===o||1!==N))return-1;for(K[1]=0,Z=1;Z<n;Z++)K[Z+1]=K[Z]+j[Z];for(R=0;R<c;R++)0!==e[a+R]&&(m[K[e[a+R]]++]=R);if(t===o?(L=M=m,z=19):t===l?(L=d,H-=257,M=f,P-=257,z=256):(L=_,M=u,z=-1),F=0,R=0,Z=C,x=g,D=O,I=0,k=-1,T=1<<O,y=T-1,t===l&&T>r||t===h&&T>s)return 1;for(;;){B=Z-I,m[R]<z?(S=0,E=m[R]):m[R]>z?(S=M[P+m[R]],E=L[H+m[R]]):(S=96,E=0),p=1<<Z-I,v=1<<D,C=v;do v-=p,b[x+(F>>I)+v]=B<<24|S<<16|E|0;while(0!==v);for(p=1<<Z-1;F&p;)p>>=1;if(0!==p?(F&=p-1,F+=p):F=0,R++,0===--j[Z]){if(Z===N)break;Z=e[a+m[R]]}if(Z>O&&(F&y)!==k){for(0===I&&(I=O),x+=C,D=Z-I,U=1<<D;D+I<N&&(U-=j[D+I],!(U<=0));)D++,U<<=1;if(T+=1<<D,t===l&&T>r||t===h&&T>s)return 1;k=F&y,b[k]=O<<24|D<<16|x-g|0}}return 0!==F&&(b[x+F]=Z-I<<24|64<<16|0),w.bits=O,0}},{"../utils/common":3}],13:[function(t,e,a){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],14:[function(t,e,a){"use strict";function i(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?lt[t]:lt[256+(t>>>7)]}function o(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,a){t.bi_valid>W-a?(t.bi_buf|=e<<t.bi_valid&65535,o(t,t.bi_buf),t.bi_buf=e>>W-t.bi_valid,t.bi_valid+=a-W):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)}function h(t,e,a){l(t,a[2*e],a[2*e+1])}function d(t,e){var a=0;do a|=1&t,t>>>=1,a<<=1;while(--e>0);return a>>>1}function f(t){16===t.bi_valid?(o(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}function _(t,e){var a,i,n,r,s,o,l=e.dyn_tree,h=e.max_code,d=e.stat_desc.static_tree,f=e.stat_desc.has_stree,_=e.stat_desc.extra_bits,u=e.stat_desc.extra_base,c=e.stat_desc.max_length,b=0;for(r=0;r<=X;r++)t.bl_count[r]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<G;a++)i=t.heap[a],r=l[2*l[2*i+1]+1]+1,r>c&&(r=c,b++),l[2*i+1]=r,i>h||(t.bl_count[r]++,s=0,i>=u&&(s=_[i-u]),o=l[2*i],t.opt_len+=o*(r+s),f&&(t.static_len+=o*(d[2*i+1]+s)));if(0!==b){do{for(r=c-1;0===t.bl_count[r];)r--;t.bl_count[r]--,t.bl_count[r+1]+=2,t.bl_count[c]--,b-=2}while(b>0);for(r=c;0!==r;r--)for(i=t.bl_count[r];0!==i;)n=t.heap[--a],n>h||(l[2*n+1]!==r&&(t.opt_len+=(r-l[2*n+1])*l[2*n],l[2*n+1]=r),i--)}}function u(t,e,a){var i,n,r=new Array(X+1),s=0;for(i=1;i<=X;i++)r[i]=s=s+a[i-1]<<1;for(n=0;n<=e;n++){var o=t[2*n+1];0!==o&&(t[2*n]=d(r[o]++,o))}}function c(){var t,e,a,i,r,s=new Array(X+1);for(a=0,i=0;i<K-1;i++)for(dt[i]=a,t=0;t<1<<et[i];t++)ht[a++]=i;for(ht[a-1]=i,r=0,i=0;i<16;i++)for(ft[i]=r,t=0;t<1<<at[i];t++)lt[r++]=i;for(r>>=7;i<Y;i++)for(ft[i]=r<<7,t=0;t<1<<at[i]-7;t++)lt[256+r++]=i;for(e=0;e<=X;e++)s[e]=0;for(t=0;t<=143;)st[2*t+1]=8,t++,s[8]++;for(;t<=255;)st[2*t+1]=9,t++,s[9]++;for(;t<=279;)st[2*t+1]=7,t++,s[7]++;for(;t<=287;)st[2*t+1]=8,t++,s[8]++;for(u(st,P+1,s),t=0;t<Y;t++)ot[2*t+1]=5,ot[2*t]=d(t,5);_t=new n(st,et,M+1,P,X),ut=new n(ot,at,0,Y,X),ct=new n(new Array(0),it,0,q,J)}function b(t){var e;for(e=0;e<P;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Y;e++)t.dyn_dtree[2*e]=0;for(e=0;e<q;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*Q]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function g(t){t.bi_valid>8?o(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function m(t,e,a,i){g(t),i&&(o(t,a),o(t,~a)),N.arraySet(t.pending_buf,t.window,e,a,t.pending),t.pending+=a}function w(t,e,a,i){var n=2*e,r=2*a;return t[n]<t[r]||t[n]===t[r]&&i[e]<=i[a]}function p(t,e,a){for(var i=t.heap[a],n=a<<1;n<=t.heap_len&&(n<t.heap_len&&w(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!w(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i}function v(t,e,a){var i,n,r,o,d=0;if(0!==t.last_lit)do i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],n=t.pending_buf[t.l_buf+d],d++,0===i?h(t,n,e):(r=ht[n],h(t,r+M+1,e),o=et[r],0!==o&&(n-=dt[r],l(t,n,o)),i--,r=s(i),h(t,r,a),o=at[r],0!==o&&(i-=ft[r],l(t,i,o)));while(d<t.last_lit);h(t,Q,e)}function k(t,e){var a,i,n,r=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=G,a=0;a<l;a++)0!==r[2*a]?(t.heap[++t.heap_len]=h=a,t.depth[a]=0):r[2*a+1]=0;for(;t.heap_len<2;)n=t.heap[++t.heap_len]=h<2?++h:0,r[2*n]=1,t.depth[n]=0,t.opt_len--,o&&(t.static_len-=s[2*n+1]);for(e.max_code=h,a=t.heap_len>>1;a>=1;a--)p(t,r,a);n=l;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],p(t,r,1),i=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=i,r[2*n]=r[2*a]+r[2*i],t.depth[n]=(t.depth[a]>=t.depth[i]?t.depth[a]:t.depth[i])+1,r[2*a+1]=r[2*i+1]=n,t.heap[1]=n++,p(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],_(t,e),u(r,h,t.bl_count)}function y(t,e,a){var i,n,r=-1,s=e[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=s,s=e[2*(i+1)+1],++o<l&&n===s||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[2*V]++):o<=10?t.bl_tree[2*$]++:t.bl_tree[2*tt]++,o=0,r=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function x(t,e,a){var i,n,r=-1,s=e[1],o=0,d=7,f=4;for(0===s&&(d=138,f=3),i=0;i<=a;i++)if(n=s,s=e[2*(i+1)+1],!(++o<d&&n===s)){if(o<f){do h(t,n,t.bl_tree);while(0!==--o)}else 0!==n?(n!==r&&(h(t,n,t.bl_tree),o--),h(t,V,t.bl_tree),l(t,o-3,2)):o<=10?(h(t,$,t.bl_tree),l(t,o-3,3)):(h(t,tt,t.bl_tree),l(t,o-11,7));o=0,r=n,0===s?(d=138,f=3):n===s?(d=6,f=3):(d=7,f=4)}}function z(t){var e;for(y(t,t.dyn_ltree,t.l_desc.max_code),y(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=q-1;e>=3&&0===t.bl_tree[2*nt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}function B(t,e,a,i){var n;for(l(t,e-257,5),l(t,a-1,5),l(t,i-4,4),n=0;n<i;n++)l(t,t.bl_tree[2*nt[n]+1],3);x(t,t.dyn_ltree,e-1),x(t,t.dyn_dtree,a-1)}function S(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return D;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return I;for(e=32;e<M;e++)if(0!==t.dyn_ltree[2*e])return I;return D}function E(t){bt||(c(),bt=!0),t.l_desc=new r(t.dyn_ltree,_t),t.d_desc=new r(t.dyn_dtree,ut),t.bl_desc=new r(t.bl_tree,ct),t.bi_buf=0,t.bi_valid=0,b(t)}function A(t,e,a,i){l(t,(T<<1)+(i?1:0),3),m(t,e,a,!0)}function Z(t){l(t,F<<1,3),h(t,Q,st),f(t)}function R(t,e,a,i){var n,r,s=0;t.level>0?(t.strm.data_type===U&&(t.strm.data_type=S(t)),k(t,t.l_desc),k(t,t.d_desc),s=z(t),n=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=n&&(n=r)):n=r=a+5,a+4<=n&&e!==-1?A(t,e,a,i):t.strategy===O||r===n?(l(t,(F<<1)+(i?1:0),3),v(t,st,ot)):(l(t,(L<<1)+(i?1:0),3),B(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),v(t,t.dyn_ltree,t.dyn_dtree)),b(t),i&&g(t)}function C(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(ht[a]+M+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1}var N=t("../utils/common"),O=4,D=0,I=1,U=2,T=0,F=1,L=2,H=3,j=258,K=29,M=256,P=M+1+K,Y=30,q=19,G=2*P+1,X=15,W=16,J=7,Q=256,V=16,$=17,tt=18,et=[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],at=[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],it=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],nt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rt=512,st=new Array(2*(P+2));i(st);var ot=new Array(2*Y);i(ot);var lt=new Array(rt);i(lt);var ht=new Array(j-H+1);i(ht);var dt=new Array(K);i(dt);var ft=new Array(Y);i(ft);var _t,ut,ct,bt=!1;a._tr_init=E,a._tr_stored_block=A,a._tr_flush_block=R,a._tr_tally=C,a._tr_align=Z},{"../utils/common":3}],15:[function(t,e,a){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}e.exports=i},{}],"/":[function(t,e,a){"use strict";var i=t("./lib/utils/common").assign,n=t("./lib/deflate"),r=t("./lib/inflate"),s=t("./lib/zlib/constants"),o={};i(o,n,r,s),e.exports=o},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});
var DNLMarkerError = function() {}
var EOIMarkerError = function() {}

var PDFJS;!function(e){"use strict";var t=function(){function e(e){this.message="JPEG error: "+e}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}(),r=function(){var e=new Uint8Array([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]),r=4017,n=799,i=3406,a=2276,s=1567,o=3784,l=5793,h=2896;function f({decodeTransform:e=null,colorTransform:t=-1}={}){this._decodeTransform=e,this._colorTransform=t}function m(e,t){for(var r,n,i=0,a=[],s=16;s>0&&!e[s-1];)s--;a.push({children:[],index:0});var o,c=a[0];for(r=0;r<s;r++){for(n=0;n<e[r];n++){for((c=a.pop()).children[c.index]=t[i];c.index>0;)c=a.pop();for(c.index++,a.push(c);a.length<=r;)a.push(o={children:[],index:0}),c.children[c.index]=o.children,c=o;i++}r+1<s&&(a.push(o={children:[],index:0}),c.children[c.index]=o.children,c=o)}return a[0].children}function p(e,t,r){return 64*((e.blocksPerLine+1)*t+r)}function d(r,n,i,a,s,o,l,h,f,m=!1){var d=i.mcusPerLine,v=i.progressive;const g=n;let y=0,x=0;function w(){if(x>0)return y>>--x&1;if(255===(y=r[n++])){var e=r[n++];if(e){if(220===e&&m){const e=c(r,n+=2);if(n+=2,e>0&&e!==i.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",e)}else if(217===e){if(m){const e=8*T;if(e>0&&e<i.scanLines/10)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new t(`unexpected marker ${(y<<8|e).toString(16)}`)}}return x=7,y>>>7}function k(e){for(var r=e;;){switch(typeof(r=r[w()])){case"number":return r;case"object":continue}throw new t("invalid huffman sequence")}}function C(e){for(var t=0;e>0;)t=t<<1|w(),e--;return t}function P(e){if(1===e)return 1===w()?1:-1;var t=C(e);return t>=1<<e-1?t:t+(-1<<e)+1}var I=0;var M,S=0;let T=0;function A(e,t,r,n,i){var a=r%d;T=(r/d|0)*e.v+n;var s=a*e.h+i;t(e,p(e,T,s))}function D(e,t,r){T=r/e.blocksPerLine|0;var n=r%e.blocksPerLine;t(e,p(e,T,n))}var L,z,F,O,B,q,R=a.length;q=v?0===o?0===h?function(e,t){var r=k(e.huffmanTableDC),n=0===r?0:P(r)<<f;e.blockData[t]=e.pred+=n}:function(e,t){e.blockData[t]|=w()<<f}:0===h?function(t,r){if(I>0)I--;else for(var n=o,i=l;n<=i;){var a=k(t.huffmanTableAC),s=15&a,c=a>>4;if(0!==s){var h=e[n+=c];t.blockData[r+h]=P(s)*(1<<f),n++}else{if(c<15){I=C(c)+(1<<c)-1;break}n+=16}}}:function(r,n){for(var i,a,s=o,c=l,h=0;s<=c;){const o=n+e[s],c=r.blockData[o]<0?-1:1;switch(S){case 0:if(h=(a=k(r.huffmanTableAC))>>4,0==(i=15&a))h<15?(I=C(h)+(1<<h),S=4):(h=16,S=1);else{if(1!==i)throw new t("invalid ACn encoding");M=P(i),S=h?2:3}continue;case 1:case 2:r.blockData[o]?r.blockData[o]+=c*(w()<<f):0==--h&&(S=2===S?3:0);break;case 3:r.blockData[o]?r.blockData[o]+=c*(w()<<f):(r.blockData[o]=M<<f,S=0);break;case 4:r.blockData[o]&&(r.blockData[o]+=c*(w()<<f))}s++}4===S&&0==--I&&(S=0)}:function(t,r){var n=k(t.huffmanTableDC),i=0===n?0:P(n);t.blockData[r]=t.pred+=i;for(var a=1;a<64;){var s=k(t.huffmanTableAC),o=15&s,c=s>>4;if(0!==o){var l=e[a+=c];t.blockData[r+l]=P(o),a++}else{if(c<15)break;a+=16}}};var E,U,X,H,J=0;for(U=1===R?a[0].blocksPerLine*a[0].blocksPerColumn:d*i.mcusPerColumn;J<=U;){var _=s?Math.min(U-J,s):U;if(_>0){for(z=0;z<R;z++)a[z].pred=0;if(I=0,1===R)for(L=a[0],B=0;B<_;B++)D(L,q,J),J++;else for(B=0;B<_;B++){for(z=0;z<R;z++)for(X=(L=a[z]).h,H=L.v,F=0;F<H;F++)for(O=0;O<X;O++)A(L,q,J,F,O);J++}}if(x=0,!(E=b(r,n)))break;if(E.invalid){u(`decodeScan - ${_>0?"unexpected":"excessive"} MCU data, current marker is: ${E.invalid}`),n=E.offset}if(!(E.marker>=65488&&E.marker<=65495))break;n+=2}return n-g}function v(e,c,f){var u,m,p,d,v,g,b,y,x,w,k,C,P,I,M,S,T,A=e.quantizationTable,D=e.blockData;if(!A)throw new t("missing required Quantization Table.");for(var L=0;L<64;L+=8)x=D[c+L],w=D[c+L+1],k=D[c+L+2],C=D[c+L+3],P=D[c+L+4],I=D[c+L+5],M=D[c+L+6],S=D[c+L+7],x*=A[L],0!=(w|k|C|P|I|M|S)?(w*=A[L+1],k*=A[L+2],C*=A[L+3],P*=A[L+4],I*=A[L+5],M*=A[L+6],S*=A[L+7],m=(u=(u=l*x+128>>8)+(m=l*P+128>>8)+1>>1)-m,T=(p=k)*o+(d=M)*s+128>>8,p=p*s-d*o+128>>8,b=(v=(v=h*(w-S)+128>>8)+(b=I<<4)+1>>1)-b,g=(y=(y=h*(w+S)+128>>8)+(g=C<<4)+1>>1)-g,d=(u=u+(d=T)+1>>1)-d,p=(m=m+p+1>>1)-p,T=v*a+y*i+2048>>12,v=v*i-y*a+2048>>12,y=T,T=g*n+b*r+2048>>12,g=g*r-b*n+2048>>12,b=T,f[L]=u+y,f[L+7]=u-y,f[L+1]=m+b,f[L+6]=m-b,f[L+2]=p+g,f[L+5]=p-g,f[L+3]=d+v,f[L+4]=d-v):(T=l*x+512>>10,f[L]=T,f[L+1]=T,f[L+2]=T,f[L+3]=T,f[L+4]=T,f[L+5]=T,f[L+6]=T,f[L+7]=T);for(var z=0;z<8;++z)x=f[z],0!=((w=f[z+8])|(k=f[z+16])|(C=f[z+24])|(P=f[z+32])|(I=f[z+40])|(M=f[z+48])|(S=f[z+56]))?(m=(u=4112+((u=l*x+2048>>12)+(m=l*P+2048>>12)+1>>1))-m,T=(p=k)*o+(d=M)*s+2048>>12,p=p*s-d*o+2048>>12,d=T,b=(v=(v=h*(w-S)+2048>>12)+(b=I)+1>>1)-b,g=(y=(y=h*(w+S)+2048>>12)+(g=C)+1>>1)-g,T=v*a+y*i+2048>>12,v=v*i-y*a+2048>>12,y=T,T=g*n+b*r+2048>>12,g=g*r-b*n+2048>>12,(x=(u=u+d+1>>1)+y)<16?x=0:x>=4080?x=255:x>>=4,(w=(m=m+p+1>>1)+(b=T))<16?w=0:w>=4080?w=255:w>>=4,(k=(p=m-p)+g)<16?k=0:k>=4080?k=255:k>>=4,(C=(d=u-d)+v)<16?C=0:C>=4080?C=255:C>>=4,(P=d-v)<16?P=0:P>=4080?P=255:P>>=4,(I=p-g)<16?I=0:I>=4080?I=255:I>>=4,(M=m-b)<16?M=0:M>=4080?M=255:M>>=4,(S=u-y)<16?S=0:S>=4080?S=255:S>>=4,D[c+z]=x,D[c+z+8]=w,D[c+z+16]=k,D[c+z+24]=C,D[c+z+32]=P,D[c+z+40]=I,D[c+z+48]=M,D[c+z+56]=S):(T=(T=l*x+8192>>14)<-2040?0:T>=2024?255:T+2056>>4,D[c+z]=T,D[c+z+8]=T,D[c+z+16]=T,D[c+z+24]=T,D[c+z+32]=T,D[c+z+40]=T,D[c+z+48]=T,D[c+z+56]=T)}function g(e,t){for(var r=t.blocksPerLine,n=t.blocksPerColumn,i=new Int16Array(64),a=0;a<n;a++)for(var s=0;s<r;s++){v(t,p(t,a,s),i)}return t.blockData}function b(e,t,r=t){const n=e.length-1;var i=r<t?r:t;if(t>=n)return null;var a=c(e,t);if(a>=65472&&a<=65534)return{invalid:null,marker:a,offset:t};for(var s=c(e,i);!(s>=65472&&s<=65534);){if(++i>=n)return null;s=c(e,i)}return{invalid:a.toString(16),marker:s,offset:i}}return f.prototype={parse(r,{dnlScanLines:n=null}={}){function i(){const e=c(r,l);let t=(l+=2)+e-2;var n=b(r,t,l);n&&n.invalid&&(u("readDataBlock - incorrect length, current marker is: "+n.invalid),t=n.offset);var i=r.subarray(l,t);return l+=i.length,i}function a(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV),n=0;n<e.components.length;n++){X=e.components[n];var i=Math.ceil(Math.ceil(e.samplesPerLine/8)*X.h/e.maxH),a=Math.ceil(Math.ceil(e.scanLines/8)*X.v/e.maxV),s=t*X.h,o=64*(r*X.v)*(s+1);X.blockData=new Int16Array(o),X.blocksPerLine=i,X.blocksPerColumn=a}e.mcusPerLine=t,e.mcusPerColumn=r}var s,o,l=0,h=null,f=null;let p=0;var v=[],y=[],x=[];let w=c(r,l);if(l+=2,65496!==w)throw new t("SOI not found");w=c(r,l),l+=2;e:for(;65497!==w;){var k,C,P;switch(w){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 I=i();65504===w&&74===I[0]&&70===I[1]&&73===I[2]&&70===I[3]&&0===I[4]&&(h={version:{major:I[5],minor:I[6]},densityUnits:I[7],xDensity:I[8]<<8|I[9],yDensity:I[10]<<8|I[11],thumbWidth:I[12],thumbHeight:I[13],thumbData:I.subarray(14,14+3*I[12]*I[13])}),65518===w&&65===I[0]&&100===I[1]&&111===I[2]&&98===I[3]&&101===I[4]&&(f={version:I[5]<<8|I[6],flags0:I[7]<<8|I[8],flags1:I[9]<<8|I[10],transformCode:I[11]});break;case 65499:for(var M=c(r,l)+(l+=2)-2;l<M;){var S=r[l++],T=new Uint16Array(64);if(S>>4==0)for(C=0;C<64;C++)T[e[C]]=r[l++];else{if(S>>4!=1)throw new t("DQT - invalid table spec");for(C=0;C<64;C++)T[e[C]]=c(r,l),l+=2}v[15&S]=T}break;case 65472:case 65473:case 65474:if(s)throw new t("Only single frame JPEGs supported");l+=2,(s={}).extended=65473===w,s.progressive=65474===w,s.precision=r[l++];const g=c(r,l);l+=2,s.scanLines=n||g,s.samplesPerLine=c(r,l),l+=2,s.components=[],s.componentIds={};var A,D=r[l++],L=0,z=0;for(k=0;k<D;k++){A=r[l];var F=r[l+1]>>4,O=15&r[l+1];L<F&&(L=F),z<O&&(z=O);var B=r[l+2];P=s.components.push({h:F,v:O,quantizationId:B,quantizationTable:null}),s.componentIds[A]=P-1,l+=3}s.maxH=L,s.maxV=z,a(s);break;case 65476:const V=c(r,l);for(l+=2,k=2;k<V;){var q=r[l++],R=new Uint8Array(16),E=0;for(C=0;C<16;C++,l++)E+=R[C]=r[l];var U=new Uint8Array(E);for(C=0;C<E;C++,l++)U[C]=r[l];k+=17+E,(q>>4==0?x:y)[15&q]=m(R,U)}break;case 65501:o=c(r,l+=2),l+=2;break;case 65498:const Z=1==++p&&!n;l+=2;var X,H=r[l++],J=[];for(k=0;k<H;k++){const e=r[l++];var _=s.componentIds[e];(X=s.components[_]).index=e;var N=r[l++];X.huffmanTableDC=x[N>>4],X.huffmanTableAC=y[15&N],J.push(X)}var Y=r[l++],G=r[l++],W=r[l++];try{var Q=d(r,l,s,J,o,Y,G,W>>4,15&W,Z);l+=Q}catch(e){if(e instanceof DNLMarkerError)return u(`${e.message} -- attempting to re-parse the JPEG image.`),this.parse(r,{dnlScanLines:e.scanLines});if(e instanceof EOIMarkerError){u(`${e.message} -- ignoring the rest of the image data.`);break e}throw e}break;case 65500:l+=4;break;case 65535:255!==r[l]&&l--;break;default:const j=b(r,l-2,l-3);if(j&&j.invalid){u("JpegImage.parse - unexpected data, current marker is: "+j.invalid),l=j.offset;break}if(l>=r.length-1){u("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new t("JpegImage.parse - unknown marker: "+w.toString(16))}w=c(r,l),l+=2}for(this.width=s.samplesPerLine,this.height=s.scanLines,this.jfif=h,this.adobe=f,this.components=[],k=0;k<s.components.length;k++){var V=v[(X=s.components[k]).quantizationId];V&&(X.quantizationTable=V),this.components.push({index:X.index,output:g(0,X),scaleX:X.h/s.maxH,scaleY:X.v/s.maxV,blocksPerLine:X.blocksPerLine,blocksPerColumn:X.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData(e,t,r=!1){var n,i,a,s,o,c,l,h,f,u,m,p=this.width/e,d=this.height/t,v=0,g=this.components.length,b=e*t*g,y=new Uint8ClampedArray(b),x=new Uint32Array(e);let w;for(l=0;l<g;l++){if(i=(n=this.components[l]).scaleX*p,a=n.scaleY*d,v=l,m=n.output,s=n.blocksPerLine+1<<3,i!==w){for(o=0;o<e;o++)h=0|o*i,x[o]=(4294967288&h)<<3|7&h;w=i}for(c=0;c<t;c++)for(u=s*(4294967288&(h=0|c*a))|(7&h)<<3,o=0;o<e;o++)y[v]=m[u+x[o]],v+=g}let k=this._decodeTransform;if(r||4!==g||k||(k=new Int32Array([-256,255,-256,255,-256,255,-256,255])),k)for(l=0;l<b;)for(h=0,f=0;h<g;h++,l++,f+=2)y[l]=(y[l]*k[f]>>8)+k[f+1];return y},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform},_convertYccToRgb:function(e){for(var t,r,n,i=0,a=e.length;i<a;i+=3)t=e[i],r=e[i+1],n=e[i+2],e[i]=t-179.456+1.402*n,e[i+1]=t+135.459-.344*r-.714*n,e[i+2]=t-226.816+1.772*r;return e},_convertYcckToRgb:function(e){for(var t,r,n,i,a=0,s=0,o=e.length;s<o;s+=4)t=e[s],r=e[s+1],n=e[s+2],i=e[s+3],e[a++]=r*(-660635669420364e-19*r+.000437130475926232*n-54080610064599e-18*t+.00048449797120281*i-.154362151871126)-122.67195406894+n*(-.000957964378445773*n+.000817076911346625*t-.00477271405408747*i+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*i+.48357088451265)+i*(-.000336197177618394*i+.484791561490776),e[a++]=107.268039397724+r*(219927104525741e-19*r-.000640992018297945*n+.000659397001245577*t+.000426105652938837*i-.176491792462875)+n*(-.000778269941513683*n+.00130872261408275*t+.000770482631801132*i-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*i+.25802910206845)+i*(-.000318913117588328*i-.213742400323665),e[a++]=r*(-.000570115196973677*r-263409051004589e-19*n+.0020741088115012*t-.00288260236853442*i+.814272968359295)-20.810012546947+n*(-153496057440975e-19*n-.000132689043961446*t+.000560833691242812*i-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*i+.116935020465145)+i*(-.000343531996510555*i+.24165260232407);return e.subarray(0,a)},_convertYcckToCmyk:function(e){for(var t,r,n,i=0,a=e.length;i<a;i+=4)t=e[i],r=e[i+1],n=e[i+2],e[i]=434.456-t-1.402*n,e[i+1]=119.541-t+.344*r+.714*n,e[i+2]=481.816-t-1.772*r;return e},_convertCmykToRgb:function(e){for(var t,r,n,i,a=0,s=0,o=e.length;s<o;s+=4)t=e[s],r=e[s+1],n=e[s+2],i=e[s+3],e[a++]=255+t*(-6747147073602441e-20*t+.0008379262121013727*r+.0002894718188643294*n+.003264231057537806*i-1.1185611867203937)+r*(26374107616089405e-21*r-8626949158638572e-20*n-.0002748769067499491*i-.02155688794978967)+n*(-3878099212869363e-20*n-.0003267808279485286*i+.0686742238595345)-i*(.0003361971776183937*i+.7430659151342254),e[a++]=255+t*(.00013596372813588848*t+.000924537132573585*r+.00010567359618683593*n+.0004791864687436512*i-.3109689587515875)+r*(-.00023545346108370344*r+.0002702845253534714*n+.0020200308977307156*i-.7488052167015494)+n*(6834815998235662e-20*n+.00015168452363460973*i-.09751927774728933)-i*(.0003189131175883281*i+.7364883807733168),e[a++]=255+t*(13598650411385307e-21*t+.00012423956175490851*r+.0004751985097583589*n-36729317476630422e-22*i-.05562186980264034)+r*(.00016141380598724676*r+.0009692239130725186*n+.0007782692450036253*i-.44015232367526463)+n*(5.068882914068769e-7*n+.0017778369011375071*i-.7591454649749609)-i*(.0003435319965105553*i+.7063770186160144);return e.subarray(0,a)},getData({width:e,height:r,forceRGB:n=!1,isSourcePDF:i=!1}){if(this.numComponents>4)throw new t("Unsupported color mode");var a=this._getLinearizedBlockData(e,r,i);if(1===this.numComponents&&n){for(var s=a.length,o=new Uint8ClampedArray(3*s),c=0,l=0;l<s;l++){var h=a[l];o[c++]=h,o[c++]=h,o[c++]=h}return o}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(a);if(4===this.numComponents){if(this._isColorConversionNeeded)return n?this._convertYcckToRgb(a):this._convertYcckToCmyk(a);if(n)return this._convertCmykToRgb(a)}return a}},f}(),n=function(){var e=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];function t(e,t,r){this.data=e,this.bp=t,this.dataEnd=r,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}return t.prototype={byteIn:function(){var e=this.data,t=this.bp;255===e[t]?e[t+1]>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t):(t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t);this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(t,r){var n,i=t[r]>>1,a=1&t[r],s=e[i],o=s.qe,c=this.a-o;if(this.chigh<o)c<o?(c=o,n=a,i=s.nmps):(c=o,n=1^a,1===s.switchFlag&&(a=n),i=s.nlps);else{if(this.chigh-=o,0!=(32768&c))return this.a=c,a;c<o?(n=1^a,1===s.switchFlag&&(a=n),i=s.nlps):(n=a,i=s.nmps)}do{0===this.ct&&this.byteIn(),c<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--}while(0==(32768&c));return this.a=c,t[r]=i<<1|a,n}},t}(),i=function(){var e={LL:0,LH:1,HL:1,HH:2};function t(){this.failOnCorruptedImage=!1}function r(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz),e.x1=Math.ceil(t.Xsiz/e.XRsiz),e.y0=Math.ceil(t.YOsiz/e.YRsiz),e.y1=Math.ceil(t.Ysiz/e.YRsiz),e.width=e.x1-e.x0,e.height=e.y1-e.y0}function i(e,t){for(var r,n=e.SIZ,i=[],a=Math.ceil((n.Xsiz-n.XTOsiz)/n.XTsiz),s=Math.ceil((n.Ysiz-n.YTOsiz)/n.YTsiz),o=0;o<s;o++)for(var c=0;c<a;c++)(r={}).tx0=Math.max(n.XTOsiz+c*n.XTsiz,n.XOsiz),r.ty0=Math.max(n.YTOsiz+o*n.YTsiz,n.YOsiz),r.tx1=Math.min(n.XTOsiz+(c+1)*n.XTsiz,n.Xsiz),r.ty1=Math.min(n.YTOsiz+(o+1)*n.YTsiz,n.Ysiz),r.width=r.tx1-r.tx0,r.height=r.ty1-r.ty0,r.components=[],i.push(r);e.tiles=i;for(var l=0,h=n.Csiz;l<h;l++)for(var f=t[l],u=0,m=i.length;u<m;u++){var p={};r=i[u],p.tcx0=Math.ceil(r.tx0/f.XRsiz),p.tcy0=Math.ceil(r.ty0/f.YRsiz),p.tcx1=Math.ceil(r.tx1/f.XRsiz),p.tcy1=Math.ceil(r.ty1/f.YRsiz),p.width=p.tcx1-p.tcx0,p.height=p.tcy1-p.tcy0,r.components[l]=p}}function a(e,t,r){var n=t.codingStyleParameters,i={};return n.entropyCoderWithCustomPrecincts?(i.PPx=n.precinctsSizes[r].PPx,i.PPy=n.precinctsSizes[r].PPy):(i.PPx=15,i.PPy=15),i.xcb_=r>0?Math.min(n.xcb,i.PPx-1):Math.min(n.xcb,i.PPx),i.ycb_=r>0?Math.min(n.ycb,i.PPy-1):Math.min(n.ycb,i.PPy),i}function o(e,t,r){var n=1<<r.PPx,i=1<<r.PPy,a=0===t.resLevel,s=1<<r.PPx+(a?0:-1),o=1<<r.PPy+(a?0:-1),c=t.trx1>t.trx0?Math.ceil(t.trx1/n)-Math.floor(t.trx0/n):0,l=t.try1>t.try0?Math.ceil(t.try1/i)-Math.floor(t.try0/i):0,h=c*l;t.precinctParameters={precinctWidth:n,precinctHeight:i,numprecinctswide:c,numprecinctshigh:l,numprecincts:h,precinctWidthInSubband:s,precinctHeightInSubband:o}}function h(e,t,r){var n,i,a,s,o=r.xcb_,c=r.ycb_,l=1<<o,h=1<<c,f=t.tbx0>>o,u=t.tby0>>c,m=t.tbx1+l-1>>o,p=t.tby1+h-1>>c,d=t.resolution.precinctParameters,v=[],g=[];for(i=u;i<p;i++)for(n=f;n<m;n++){if((a={cbx:n,cby:i,tbx0:l*n,tby0:h*i,tbx1:l*(n+1),tby1:h*(i+1)}).tbx0_=Math.max(t.tbx0,a.tbx0),a.tby0_=Math.max(t.tby0,a.tby0),a.tbx1_=Math.min(t.tbx1,a.tbx1),a.tby1_=Math.min(t.tby1,a.tby1),s=Math.floor((a.tbx0_-t.tbx0)/d.precinctWidthInSubband)+Math.floor((a.tby0_-t.tby0)/d.precinctHeightInSubband)*d.numprecinctswide,a.precinctNumber=s,a.subbandType=t.type,a.Lblock=3,!(a.tbx1_<=a.tbx0_||a.tby1_<=a.tby0_)){v.push(a);var b=g[s];void 0!==b?(n<b.cbxMin?b.cbxMin=n:n>b.cbxMax&&(b.cbxMax=n),i<b.cbyMin?b.cbxMin=i:i>b.cbyMax&&(b.cbyMax=i)):g[s]=b={cbxMin:n,cbyMin:i,cbxMax:n,cbyMax:i},a.precinct=b}}t.codeblockParameters={codeblockWidth:o,codeblockHeight:c,numcodeblockwide:m-f+1,numcodeblockhigh:p-u+1},t.codeblocks=v,t.precincts=g}function p(e,t,r){for(var n=[],i=e.subbands,a=0,s=i.length;a<s;a++)for(var o=i[a].codeblocks,c=0,l=o.length;c<l;c++){var h=o[c];h.precinctNumber===t&&n.push(h)}return{layerNumber:r,codeblocks:n}}function d(e){for(var t=e.SIZ,r=e.currentTile.index,n=e.tiles[r],i=n.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=0,o=0;o<a;o++)s=Math.max(s,n.components[o].codingStyleParameters.decompositionLevelsCount);var c=0,l=0,h=0,u=0;this.nextPacket=function(){for(;c<i;c++){for(;l<=s;l++){for(;h<a;h++){var e=n.components[h];if(!(l>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[l],r=t.precinctParameters.numprecincts;u<r;){var o=p(t,u,c);return u++,o}u=0}}h=0}l=0}f("JPX Error: Out of packets")}}function v(e){for(var t=e.SIZ,r=e.currentTile.index,n=e.tiles[r],i=n.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=0,o=0;o<a;o++)s=Math.max(s,n.components[o].codingStyleParameters.decompositionLevelsCount);var c=0,l=0,h=0,u=0;this.nextPacket=function(){for(;c<=s;c++){for(;l<i;l++){for(;h<a;h++){var e=n.components[h];if(!(c>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[c],r=t.precinctParameters.numprecincts;u<r;){var o=p(t,u,l);return u++,o}u=0}}h=0}l=0}f("JPX Error: Out of packets")}}function g(e){var t,r,n,i,a=e.SIZ,s=e.currentTile.index,o=e.tiles[s],c=o.codingStyleDefaultParameters.layersCount,l=a.Csiz,h=0;for(n=0;n<l;n++){var u=o.components[n];h=Math.max(h,u.codingStyleParameters.decompositionLevelsCount)}var m=new Int32Array(h+1);for(r=0;r<=h;++r){var d=0;for(n=0;n<l;++n){var v=o.components[n].resolutions;r<v.length&&(d=Math.max(d,v[r].precinctParameters.numprecincts))}m[r]=d}t=0,r=0,n=0,i=0,this.nextPacket=function(){for(;r<=h;r++){for(;i<m[r];i++){for(;n<l;n++){var e=o.components[n];if(!(r>e.codingStyleParameters.decompositionLevelsCount)){var a=e.resolutions[r],s=a.precinctParameters.numprecincts;if(!(i>=s)){for(;t<c;){var u=p(a,i,t);return t++,u}t=0}}}n=0}i=0}f("JPX Error: Out of packets")}}function b(e){var t=e.SIZ,r=e.currentTile.index,n=e.tiles[r],i=n.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=w(n),o=s,c=0,l=0,h=0,u=0,m=0;this.nextPacket=function(){for(;m<o.maxNumHigh;m++){for(;u<o.maxNumWide;u++){for(;h<a;h++){for(var e=n.components[h],t=e.codingStyleParameters.decompositionLevelsCount;l<=t;l++){var r=e.resolutions[l],d=s.components[h].resolutions[l],v=x(u,m,d,o,r);if(null!==v){for(;c<i;){var g=p(r,v,c);return c++,g}c=0}}l=0}h=0}u=0}f("JPX Error: Out of packets")}}function y(e){var t=e.SIZ,r=e.currentTile.index,n=e.tiles[r],i=n.codingStyleDefaultParameters.layersCount,a=t.Csiz,s=w(n),o=0,c=0,l=0,h=0,u=0;this.nextPacket=function(){for(;l<a;++l){for(var e=n.components[l],t=s.components[l],r=e.codingStyleParameters.decompositionLevelsCount;u<t.maxNumHigh;u++){for(;h<t.maxNumWide;h++){for(;c<=r;c++){var m=e.resolutions[c],d=t.resolutions[c],v=x(h,u,d,t,m);if(null!==v){for(;o<i;){var g=p(m,v,o);return o++,g}o=0}}c=0}h=0}u=0}f("JPX Error: Out of packets")}}function x(e,t,r,n,i){var a=e*n.minWidth,s=t*n.minHeight;if(a%r.width!=0||s%r.height!=0)return null;var o=s/r.width*i.precinctParameters.numprecinctswide;return a/r.height+o}function w(e){for(var t=e.components.length,r=Number.MAX_VALUE,n=Number.MAX_VALUE,i=0,a=0,s=new Array(t),o=0;o<t;o++){for(var c=e.components[o],l=c.codingStyleParameters.decompositionLevelsCount,h=new Array(l+1),f=Number.MAX_VALUE,u=Number.MAX_VALUE,m=0,p=0,d=1,v=l;v>=0;--v){var g=c.resolutions[v],b=d*g.precinctParameters.precinctWidth,y=d*g.precinctParameters.precinctHeight;f=Math.min(f,b),u=Math.min(u,y),m=Math.max(m,g.precinctParameters.numprecinctswide),p=Math.max(p,g.precinctParameters.numprecinctshigh),h[v]={width:b,height:y},d<<=1}r=Math.min(r,f),n=Math.min(n,u),i=Math.max(i,m),a=Math.max(a,p),s[o]={resolutions:h,minWidth:f,minHeight:u,maxNumWide:m,maxNumHigh:p}}return{components:s,minWidth:r,minHeight:n,maxNumWide:i,maxNumHigh:a}}function k(e){for(var t=e.SIZ,r=e.currentTile.index,n=e.tiles[r],i=t.Csiz,s=0;s<i;s++){for(var c=n.components[s],l=c.codingStyleParameters.decompositionLevelsCount,u=[],m=[],p=0;p<=l;p++){var x,w=a(0,c,p),k={},C=1<<l-p;if(k.trx0=Math.ceil(c.tcx0/C),k.try0=Math.ceil(c.tcy0/C),k.trx1=Math.ceil(c.tcx1/C),k.try1=Math.ceil(c.tcy1/C),k.resLevel=p,o(0,k,w),u.push(k),0===p)(x={}).type="LL",x.tbx0=Math.ceil(c.tcx0/C),x.tby0=Math.ceil(c.tcy0/C),x.tbx1=Math.ceil(c.tcx1/C),x.tby1=Math.ceil(c.tcy1/C),x.resolution=k,h(0,x,w),m.push(x),k.subbands=[x];else{var P=1<<l-p+1,I=[];(x={}).type="HL",x.tbx0=Math.ceil(c.tcx0/P-.5),x.tby0=Math.ceil(c.tcy0/P),x.tbx1=Math.ceil(c.tcx1/P-.5),x.tby1=Math.ceil(c.tcy1/P),x.resolution=k,h(0,x,w),m.push(x),I.push(x),(x={}).type="LH",x.tbx0=Math.ceil(c.tcx0/P),x.tby0=Math.ceil(c.tcy0/P-.5),x.tbx1=Math.ceil(c.tcx1/P),x.tby1=Math.ceil(c.tcy1/P-.5),x.resolution=k,h(0,x,w),m.push(x),I.push(x),(x={}).type="HH",x.tbx0=Math.ceil(c.tcx0/P-.5),x.tby0=Math.ceil(c.tcy0/P-.5),x.tbx1=Math.ceil(c.tcx1/P-.5),x.tby1=Math.ceil(c.tcy1/P-.5),x.resolution=k,h(0,x,w),m.push(x),I.push(x),k.subbands=I}}c.resolutions=u,c.subbands=m}var M=n.codingStyleDefaultParameters.progressionOrder;switch(M){case 0:n.packetsIterator=new d(e);break;case 1:n.packetsIterator=new v(e);break;case 2:n.packetsIterator=new g(e);break;case 3:n.packetsIterator=new b(e);break;case 4:n.packetsIterator=new y(e);break;default:f("JPX Error: Unsupported progression order "+M)}}function C(e,t,r,n){var i,a=0,o=0,c=!1;function l(e){for(;o<e;){var n=t[r+a];a++,c?(i=i<<7|n,o+=7,c=!1):(i=i<<8|n,o+=8),255===n&&(c=!0)}return i>>>(o-=e)&(1<<e)-1}function h(e){return 255===t[r+a-1]&&t[r+a]===e?(f(1),!0):255===t[r+a]&&t[r+a+1]===e&&(f(2),!0)}function f(e){a+=e}function u(){o=0,c&&(a++,c=!1)}function m(){if(0===l(1))return 1;if(0===l(1))return 2;var e=l(2);return e<3?e+3:(e=l(5))<31?e+6:(e=l(7))+37}for(var p=e.currentTile.index,d=e.tiles[p],v=e.COD.sopMarkerUsed,g=e.COD.ephMarkerUsed,b=d.packetsIterator;a<n;){u(),v&&h(145)&&f(4);var y=b.nextPacket();if(l(1)){for(var x,w=y.layerNumber,k=[],C=0,P=y.codeblocks.length;C<P;C++){var I=(x=y.codeblocks[C]).precinct,M=x.cbx-I.cbxMin,A=x.cby-I.cbyMin,D=!1,L=!1;if(void 0!==x.included)D=!!l(1);else{var z,F;if(void 0!==(I=x.precinct).inclusionTree)z=I.inclusionTree;else{var O=I.cbxMax-I.cbxMin+1,B=I.cbyMax-I.cbyMin+1;z=new T(O,B,w),F=new S(O,B),I.inclusionTree=z,I.zeroBitPlanesTree=F}if(z.reset(M,A,w))for(;;){if(!l(1)){z.incrementValue(w);break}if(!z.nextLevel()){x.included=!0,D=L=!0;break}}}if(D){if(L){for((F=I.zeroBitPlanesTree).reset(M,A);;)if(l(1)){if(!F.nextLevel())break}else F.incrementValue();x.zeroBitPlanes=F.value}for(var q=m();l(1);)x.Lblock++;var R=s(q),E=l((q<1<<R?R-1:R)+x.Lblock);k.push({codeblock:x,codingpasses:q,dataLength:E})}}for(u(),g&&h(146);k.length>0;){var U=k.shift();void 0===(x=U.codeblock).data&&(x.data=[]),x.data.push({data:t,start:r+a,end:r+a+U.dataLength,codingpasses:U.codingpasses}),a+=U.dataLength}}}return a}function P(e,t,r,i,a,s,o,c){for(var l=i.tbx0,h=i.tby0,f=i.tbx1-i.tbx0,u=i.codeblocks,m="H"===i.type.charAt(0)?1:0,p="H"===i.type.charAt(1)?t:0,d=0,v=u.length;d<v;++d){var g=u[d],b=g.tbx1_-g.tbx0_,y=g.tby1_-g.tby0_;if(0!==b&&0!==y&&void 0!==g.data){var x,w;x=new A(b,y,g.subbandType,g.zeroBitPlanes,s),w=2;var k,C,P,I=g.data,M=0,S=0;for(k=0,C=I.length;k<C;k++)M+=(P=I[k]).end-P.start,S+=P.codingpasses;var T=new Uint8Array(M),D=0;for(k=0,C=I.length;k<C;k++){var L=(P=I[k]).data.subarray(P.start,P.end);T.set(L,D),D+=L.length}var z=new n(T,0,M);for(x.setDecoder(z),k=0;k<S;k++){switch(w){case 0:x.runSignificancePropagationPass();break;case 1:x.runMagnitudeRefinementPass();break;case 2:x.runCleanupPass(),c&&x.checkSegmentationSymbol()}w=(w+1)%3}var F,O,B,q=g.tbx0_-l+(g.tby0_-h)*f,R=x.coefficentsSign,E=x.coefficentsMagnitude,U=x.bitsDecoded,X=o?0:.5;D=0;var H="LL"!==i.type;for(k=0;k<y;k++){var J=2*(q/f|0)*(t-f)+m+p;for(F=0;F<b;F++){if(0!==(O=E[D])){O=(O+X)*a,0!==R[D]&&(O=-O),B=U[D];var _=H?J+(q<<1):q;e[_]=o&&B>=s?O:O*(1<<s-B)}q++,D++}q+=f-b}}}}function I(t,r,n){for(var i=r.components[n],a=i.codingStyleParameters,s=i.quantizationParameters,o=a.decompositionLevelsCount,c=s.SPqcds,l=s.scalarExpounded,h=s.guardBits,f=a.segmentationSymbolUsed,u=t.components[n].precision,m=a.reversibleTransformation,p=m?new z:new L,d=[],v=0,g=0;g<=o;g++){for(var b=i.resolutions[g],y=b.trx1-b.trx0,x=b.try1-b.try0,w=new Float32Array(y*x),k=0,C=b.subbands.length;k<C;k++){var I,M;l?(I=c[v].mu,M=c[v].epsilon,v++):(I=c[0].mu,M=c[0].epsilon+(g>0?1-g:0));var S=b.subbands[k],T=e[S.type];P(w,y,0,S,m?1:Math.pow(2,u+T-M)*(1+I/2048),h+M-1,m,f)}d.push({width:y,height:x,items:w})}var A=p.calculate(d,i.tcx0,i.tcy0);return{left:i.tcx0,top:i.tcy0,width:A.width,height:A.height,items:A.items}}function M(e,t){for(var r=e.SIZ.Csiz,n=e.tiles[t],i=0;i<r;i++){var a=n.components[i],s=void 0!==e.currentTile.QCC[i]?e.currentTile.QCC[i]:e.currentTile.QCD;a.quantizationParameters=s;var o=void 0!==e.currentTile.COC[i]?e.currentTile.COC[i]:e.currentTile.COD;a.codingStyleParameters=o}n.codingStyleDefaultParameters=e.currentTile.COD}t.prototype={parse:function(e){if(65359!==c(e,0))for(var t=0,r=e.length;t<r;){var n=8,i=l(e,t),a=l(e,t+4);t+=n,1===i&&(i=4294967296*l(e,t)+l(e,t+4),t+=8,n+=8),0===i&&(i=r-t+n),i<n&&f("JPX Error: Invalid box field size");var s=i-n,o=!0;switch(a){case 1785737832:o=!1;break;case 1668246642:var h=e[t];if(1===h){var p=l(e,t+3);switch(p){case 16:case 17:case 18:break;default:u("Unknown colorspace "+p)}}else 2===h&&m("ICC profile not supported");break;case 1785737827:this.parseCodestream(e,t,t+s);break;case 1783636e3:218793738!==l(e,t)&&u("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var d=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);u("Unsupported header type "+a+" ("+d+")")}o&&(t+=s)}else this.parseCodestream(e,0,e.length)},parseImageProperties:function(e){for(var t=e.getByte();t>=0;){if(65361===(t<<8|(t=e.getByte()))){e.skip(4);var r=e.getInt32()>>>0,n=e.getInt32()>>>0,i=e.getInt32()>>>0,a=e.getInt32()>>>0;e.skip(16);var s=e.getUint16();return this.width=r-i,this.height=n-a,this.componentsCount=s,void(this.bitsPerComponent=8)}}f("JPX Error: No size marker found in JPX stream")},parseCodestream:function(e,t,n){var a={},s=!1;try{for(var o=t;o+1<n;){var h=c(e,o);o+=2;var m,p,d,v,g,b,y=0;switch(h){case 65359:a.mainHeader=!0;break;case 65497:break;case 65361:y=c(e,o);var x={};x.Xsiz=l(e,o+4),x.Ysiz=l(e,o+8),x.XOsiz=l(e,o+12),x.YOsiz=l(e,o+16),x.XTsiz=l(e,o+20),x.YTsiz=l(e,o+24),x.XTOsiz=l(e,o+28),x.YTOsiz=l(e,o+32);var w=c(e,o+36);x.Csiz=w;var P=[];m=o+38;for(var S=0;S<w;S++){var T={precision:1+(127&e[m]),isSigned:!!(128&e[m]),XRsiz:e[m+1],YRsiz:e[m+1]};r(T,x),P.push(T)}a.SIZ=x,a.components=P,i(a,P),a.QCC=[],a.COC=[];break;case 65372:y=c(e,o);var A={};switch(m=o+2,31&(p=e[m++])){case 0:v=8,g=!0;break;case 1:v=16,g=!1;break;case 2:v=16,g=!0;break;default:throw new Error("Invalid SQcd value "+p)}for(A.noQuantization=8===v,A.scalarExpounded=g,A.guardBits=p>>5,d=[];m<y+o;){var D={};8===v?(D.epsilon=e[m++]>>3,D.mu=0):(D.epsilon=e[m]>>3,D.mu=(7&e[m])<<8|e[m+1],m+=2),d.push(D)}A.SPqcds=d,a.mainHeader?a.QCD=A:(a.currentTile.QCD=A,a.currentTile.QCC=[]);break;case 65373:y=c(e,o);var L,z={};switch(m=o+2,a.SIZ.Csiz<257?L=e[m++]:(L=c(e,m),m+=2),31&(p=e[m++])){case 0:v=8,g=!0;break;case 1:v=16,g=!1;break;case 2:v=16,g=!0;break;default:throw new Error("Invalid SQcd value "+p)}for(z.noQuantization=8===v,z.scalarExpounded=g,z.guardBits=p>>5,d=[];m<y+o;)D={},8===v?(D.epsilon=e[m++]>>3,D.mu=0):(D.epsilon=e[m]>>3,D.mu=(7&e[m])<<8|e[m+1],m+=2),d.push(D);z.SPqcds=d,a.mainHeader?a.QCC[L]=z:a.currentTile.QCC[L]=z;break;case 65362:y=c(e,o);var F={};m=o+2;var O=e[m++];F.entropyCoderWithCustomPrecincts=!!(1&O),F.sopMarkerUsed=!!(2&O),F.ephMarkerUsed=!!(4&O),F.progressionOrder=e[m++],F.layersCount=c(e,m),m+=2,F.multipleComponentTransform=e[m++],F.decompositionLevelsCount=e[m++],F.xcb=2+(15&e[m++]),F.ycb=2+(15&e[m++]);var B=e[m++];if(F.selectiveArithmeticCodingBypass=!!(1&B),F.resetContextProbabilities=!!(2&B),F.terminationOnEachCodingPass=!!(4&B),F.verticalyStripe=!!(8&B),F.predictableTermination=!!(16&B),F.segmentationSymbolUsed=!!(32&B),F.reversibleTransformation=e[m++],F.entropyCoderWithCustomPrecincts){for(var q=[];m<y+o;){var R=e[m++];q.push({PPx:15&R,PPy:R>>4})}F.precinctsSizes=q}var E=[];if(F.selectiveArithmeticCodingBypass&&E.push("selectiveArithmeticCodingBypass"),F.resetContextProbabilities&&E.push("resetContextProbabilities"),F.terminationOnEachCodingPass&&E.push("terminationOnEachCodingPass"),F.verticalyStripe&&E.push("verticalyStripe"),F.predictableTermination&&E.push("predictableTermination"),E.length>0)throw s=!0,new Error("Unsupported COD options ("+E.join(", ")+")");a.mainHeader?a.COD=F:(a.currentTile.COD=F,a.currentTile.COC=[]);break;case 65424:y=c(e,o),(b={}).index=c(e,o+2),b.length=l(e,o+4),b.dataEnd=b.length+o-2,b.partIndex=e[o+8],b.partsCount=e[o+9],a.mainHeader=!1,0===b.partIndex&&(b.COD=a.COD,b.COC=a.COC.slice(0),b.QCD=a.QCD,b.QCC=a.QCC.slice(0)),a.currentTile=b;break;case 65427:0===(b=a.currentTile).partIndex&&(M(a,b.index),k(a)),C(a,e,o,y=b.dataEnd-o);break;case 65365:case 65367:case 65368:case 65380:y=c(e,o);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+h.toString(16))}o+=y}}catch(e){s||this.failOnCorruptedImage?f("JPX Error: "+e.message):u("JPX: Trying to recover from: "+e.message)}this.tiles=function(e){for(var t=e.SIZ,r=e.components,n=t.Csiz,i=[],a=0,s=e.tiles.length;a<s;a++){var o,c=e.tiles[a],l=[];for(o=0;o<n;o++)l[o]=I(e,c,o);var h,f,u,m,p,d,v,g,b,y,x,w,k,C,P,M=l[0],S=new Uint8Array(M.items.length*n),T={left:M.left,top:M.top,width:M.width,height:M.height,items:S},A=0;if(c.codingStyleDefaultParameters.multipleComponentTransform){var D=4===n,L=l[0].items,z=l[1].items,F=l[2].items,O=D?l[3].items:null;h=r[0].precision-8,f=.5+(128<<h),m=-(p=.5*(u=255*(1<<h)));var B=c.components[0],q=n-3;if(v=L.length,B.codingStyleParameters.reversibleTransformation)for(d=0;d<v;d++,A+=q)g=L[d]+f,b=z[d],y=F[d],x=(w=g-(y+b>>2))+y,k=w+b,S[A++]=x<=0?0:x>=u?255:x>>h,S[A++]=w<=0?0:w>=u?255:w>>h,S[A++]=k<=0?0:k>=u?255:k>>h;else for(d=0;d<v;d++,A+=q)g=L[d]+f,b=z[d],y=F[d],x=g+1.402*y,w=g-.34413*b-.71414*y,k=g+1.772*b,S[A++]=x<=0?0:x>=u?255:x>>h,S[A++]=w<=0?0:w>=u?255:w>>h,S[A++]=k<=0?0:k>=u?255:k>>h;if(D)for(d=0,A=3;d<v;d++,A+=4)C=O[d],S[A]=C<=m?0:C>=p?255:C+f>>h}else for(o=0;o<n;o++){var R=l[o].items;for(h=r[o].precision-8,f=.5+(128<<h),m=-(u=127.5*(1<<h)),A=o,d=0,v=R.length;d<v;d++)P=R[d],S[A]=P<=m?0:P>=u?255:P+f>>h,A+=n}i.push(T)}return i}(a),this.width=a.SIZ.Xsiz-a.SIZ.XOsiz,this.height=a.SIZ.Ysiz-a.SIZ.YOsiz,this.componentsCount=a.SIZ.Csiz}};var S=function(){function e(e,t){var r=s(Math.max(e,t))+1;this.levels=[];for(var n=0;n<r;n++){var i={width:e,height:t,items:[]};this.levels.push(i),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t){for(var r,n=0,i=0;n<this.levels.length;){var a=e+t*(r=this.levels[n]).width;if(void 0!==r.items[a]){i=r.items[a];break}r.index=a,e>>=1,t>>=1,n++}n--,(r=this.levels[n]).items[r.index]=i,this.currentLevel=n,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];return--e<0?(this.value=r,!1):(this.currentLevel=e,(t=this.levels[e]).items[t.index]=r,!0)}},e}(),T=function(){function e(e,t,r){var n=s(Math.max(e,t))+1;this.levels=[];for(var i=0;i<n;i++){for(var a=new Uint8Array(e*t),o=0,c=a.length;o<c;o++)a[o]=r;var l={width:e,height:t,items:a};this.levels.push(l),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t,r){for(var n=0;n<this.levels.length;){var i=this.levels[n],a=e+t*i.width;i.index=a;var s=i.items[a];if(255===s)break;if(s>r)return this.currentLevel=n,this.propagateValues(),!1;e>>=1,t>>=1,n++}return this.currentLevel=n-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){for(var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];--e>=0;)(t=this.levels[e]).items[t.index]=r},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],r=t.items[t.index];return t.items[t.index]=255,!(--e<0)&&(this.currentLevel=e,(t=this.levels[e]).items[t.index]=r,!0)}},e}(),A=function(){var e=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),t=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),r=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);function n(n,i,a,s,o){this.width=n,this.height=i,this.contextLabelTable="HH"===a?r:"HL"===a?t:e;var c=n*i;this.neighborsSignificance=new Uint8Array(c),this.coefficentsSign=new Uint8Array(c),this.coefficentsMagnitude=o>14?new Uint32Array(c):o>6?new Uint16Array(c):new Uint8Array(c),this.processingFlags=new Uint8Array(c);var l=new Uint8Array(c);if(0!==s)for(var h=0;h<c;h++)l[h]=s;this.bitsDecoded=l,this.reset()}return n.prototype={setDecoder:function(e){this.decoder=e},reset:function(){this.contexts=new Int8Array(19),this.contexts[0]=8,this.contexts[17]=92,this.contexts[18]=6},setNeighborsSignificance:function(e,t,r){var n,i=this.neighborsSignificance,a=this.width,s=this.height,o=t>0,c=t+1<a;e>0&&(n=r-a,o&&(i[n-1]+=16),c&&(i[n+1]+=16),i[n]+=4),e+1<s&&(n=r+a,o&&(i[n-1]+=16),c&&(i[n+1]+=16),i[n]+=4),o&&(i[r-1]+=1),c&&(i[r+1]+=1),i[r]|=128},runSignificancePropagationPass:function(){for(var e=this.decoder,t=this.width,r=this.height,n=this.coefficentsMagnitude,i=this.coefficentsSign,a=this.neighborsSignificance,s=this.processingFlags,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=0;h<r;h+=4)for(var f=0;f<t;f++)for(var u=h*t+f,m=0;m<4;m++,u+=t){var p=h+m;if(p>=r)break;if(s[u]&=-2,!n[u]&&a[u]){var d=c[a[u]];if(e.readBit(o,d)){var v=this.decodeSignBit(p,f,u);i[u]=v,n[u]=1,this.setNeighborsSignificance(p,f,u),s[u]|=2}l[u]++,s[u]|=1}}},decodeSignBit:function(e,t,r){var n,i,a,s,o,c,l=this.width,h=this.height,f=this.coefficentsMagnitude,u=this.coefficentsSign;s=t>0&&0!==f[r-1],t+1<l&&0!==f[r+1]?(a=u[r+1],n=s?1-a-(i=u[r-1]):1-a-a):n=s?1-(i=u[r-1])-i:0;var m=3*n;return s=e>0&&0!==f[r-l],e+1<h&&0!==f[r+l]?(a=u[r+l],n=s?1-a-(i=u[r-l])+m:1-a-a+m):n=s?1-(i=u[r-l])-i+m:m,n>=0?(o=9+n,c=this.decoder.readBit(this.contexts,o)):(o=9-n,c=1^this.decoder.readBit(this.contexts,o)),c},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,r=this.width,n=this.height,i=this.coefficentsMagnitude,a=this.neighborsSignificance,s=this.contexts,o=this.bitsDecoded,c=this.processingFlags,l=r*n,h=4*r,f=0;f<l;f=e){e=Math.min(l,f+h);for(var u=0;u<r;u++)for(var m=f+u;m<e;m+=r)if(i[m]&&0==(1&c[m])){var p=16;if(0!=(2&c[m]))c[m]^=2,p=0===(127&a[m])?15:14;var d=t.readBit(s,p);i[m]=i[m]<<1|d,o[m]++,c[m]|=1}}},runCleanupPass:function(){for(var e,t=this.decoder,r=this.width,n=this.height,i=this.neighborsSignificance,a=this.coefficentsMagnitude,s=this.coefficentsSign,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=this.processingFlags,f=r,u=2*r,m=3*r,p=0;p<n;p=e){e=Math.min(p+4,n);for(var d=p*r,v=p+3<n,g=0;g<r;g++){var b,y=d+g,x=0,w=y,k=p;if(v&&0===h[y]&&0===h[y+f]&&0===h[y+u]&&0===h[y+m]&&0===i[y]&&0===i[y+f]&&0===i[y+u]&&0===i[y+m]){if(!t.readBit(o,18)){l[y]++,l[y+f]++,l[y+u]++,l[y+m]++;continue}0!==(x=t.readBit(o,17)<<1|t.readBit(o,17))&&(k=p+x,w+=x*r),b=this.decodeSignBit(k,g,w),s[w]=b,a[w]=1,this.setNeighborsSignificance(k,g,w),h[w]|=2,w=y;for(var C=p;C<=k;C++,w+=r)l[w]++;x++}for(k=p+x;k<e;k++,w+=r)if(!a[w]&&0==(1&h[w])){var P=c[i[w]];1===t.readBit(o,P)&&(b=this.decodeSignBit(k,g,w),s[w]=b,a[w]=1,this.setNeighborsSignificance(k,g,w),h[w]|=2),l[w]++}}}},checkSegmentationSymbol:function(){var e=this.decoder,t=this.contexts;10!==(e.readBit(t,17)<<3|e.readBit(t,17)<<2|e.readBit(t,17)<<1|e.readBit(t,17))&&f("JPX Error: Invalid segmentation symbol")}},n}(),D=function(){function e(){}return e.prototype.calculate=function(e,t,r){for(var n=e[0],i=1,a=e.length;i<a;i++)n=this.iterate(n,e[i],t,r);return n},e.prototype.extend=function(e,t,r){var n=t-1,i=t+1,a=t+r-2,s=t+r;e[n--]=e[i++],e[s++]=e[a--],e[n--]=e[i++],e[s++]=e[a--],e[n--]=e[i++],e[s++]=e[a--],e[n]=e[i],e[s]=e[a]},e.prototype.iterate=function(e,t,r,n){var i,a,s,o,c,l,h=e.width,f=e.height,u=e.items,m=t.width,p=t.height,d=t.items;for(s=0,i=0;i<f;i++)for(o=2*i*m,a=0;a<h;a++,s++,o+=2)d[o]=u[s];u=e.items=null;var v=new Float32Array(m+8);if(1===m){if(0!=(1&r))for(l=0,s=0;l<p;l++,s+=m)d[s]*=.5}else for(l=0,s=0;l<p;l++,s+=m)v.set(d.subarray(s,s+m),4),this.extend(v,4,m),this.filter(v,4,m),d.set(v.subarray(4,4+m),s);var g=16,b=[];for(i=0;i<g;i++)b.push(new Float32Array(p+8));var y,x=0;if(e=4+p,1===p){if(0!=(1&n))for(c=0;c<m;c++)d[c]*=.5}else for(c=0;c<m;c++){if(0===x){for(g=Math.min(m-c,g),s=c,o=4;o<e;s+=m,o++)for(y=0;y<g;y++)b[y][o]=d[s+y];x=g}var w=b[--x];if(this.extend(w,4,p),this.filter(w,4,p),0===x)for(s=c-g+1,o=4;o<e;s+=m,o++)for(y=0;y<g;y++)d[s+y]=b[y][o]}return{width:m,height:p,items:d}},e}(),L=function(){function e(){D.call(this)}return e.prototype=Object.create(D.prototype),e.prototype.filter=function(e,t,r){var n,i,a,s,o=r>>1,c=-1.586134342059924,l=-.052980118572961,h=.882911075530934,f=.443506852043971,u=1.230174104914001;for(n=(t|=0)-3,i=o+4;i--;n+=2)e[n]*=.8128930661159609;for(a=f*e[(n=t-2)-1],i=o+3;i--&&(s=f*e[n+1],e[n]=u*e[n]-a-s,i--);n+=2)a=f*e[(n+=2)+1],e[n]=u*e[n]-a-s;for(a=h*e[(n=t-1)-1],i=o+2;i--&&(s=h*e[n+1],e[n]-=a+s,i--);n+=2)a=h*e[(n+=2)+1],e[n]-=a+s;for(a=l*e[(n=t)-1],i=o+1;i--&&(s=l*e[n+1],e[n]-=a+s,i--);n+=2)a=l*e[(n+=2)+1],e[n]-=a+s;if(0!==o)for(a=c*e[(n=t+1)-1],i=o;i--&&(s=c*e[n+1],e[n]-=a+s,i--);n+=2)a=c*e[(n+=2)+1],e[n]-=a+s},e}(),z=function(){function e(){D.call(this)}return e.prototype=Object.create(D.prototype),e.prototype.filter=function(e,t,r){var n,i,a=r>>1;for(n=t|=0,i=a+1;i--;n+=2)e[n]-=e[n-1]+e[n+1]+2>>2;for(n=t+1,i=a;i--;n+=2)e[n]+=e[n-1]+e[n+1]>>1},e}();return t}(),a=function(){function e(){}function t(e,t,r){this.data=e,this.start=t,this.end=r}function r(e,t,r){var n=e.getContexts(t),i=1;function a(e){for(var t=0,a=0;a<e;a++){var s=r.readBit(n,i);i=i<256?i<<1|s:511&(i<<1|s)|256,t=t<<1|s}return t>>>0}var s=a(1),o=a(1)?a(1)?a(1)?a(1)?a(1)?a(32)+4436:a(12)+340:a(8)+84:a(6)+20:a(4)+4:a(2);return 0===s?o:o>0?-o:null}function i(e,t,r){for(var n=e.getContexts("IAID"),i=1,a=0;a<r;a++){i=i<<1|t.readBit(n,i)}return r<31?i&(1<<r)-1:2147483647&i}e.prototype={getContexts:function(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},t.prototype={get decoder(){return h(this,"decoder",new n(this.data,this.start,this.end))},get contextCache(){return h(this,"contextCache",new e)}};var a=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"patternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],u=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],m=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],p=[39717,1941,229,405],d=[32,8];function v(e,t,r,n,i,a,s,o){if(e&&f("JBIG2 error: MMR encoding is not supported"),0===n&&!a&&!i&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function(e,t,r){var n,i,a,s,o,c,l,h=r.decoder,f=r.contextCache.getContexts("GB"),u=[];for(i=0;i<t;i++)for(o=u[i]=new Uint8Array(e),c=i<1?o:u[i-1],n=(l=i<2?o:u[i-2])[0]<<13|l[1]<<12|l[2]<<11|c[0]<<7|c[1]<<6|c[2]<<5|c[3]<<4,a=0;a<e;a++)o[a]=s=h.readBit(f,n),n=(31735&n)<<1|(a+3<e?l[a+3]<<11:0)|(a+4<e?c[a+4]<<4:0)|s;return u}(t,r,o);var c=!!a,l=u[n].concat(s);l.sort(function(e,t){return e.y-t.y||e.x-t.x});var h,m,d=l.length,v=new Int8Array(d),g=new Int8Array(d),b=[],y=0,x=0,w=0,k=0;for(m=0;m<d;m++)v[m]=l[m].x,g[m]=l[m].y,x=Math.min(x,l[m].x),w=Math.max(w,l[m].x),k=Math.min(k,l[m].y),m<d-1&&l[m].y===l[m+1].y&&l[m].x===l[m+1].x-1?y|=1<<d-1-m:b.push(m);var C=b.length,P=new Int8Array(C),I=new Int8Array(C),M=new Uint16Array(C);for(h=0;h<C;h++)m=b[h],P[h]=l[m].x,I[h]=l[m].y,M[h]=1<<d-1-m;for(var S,T,A,D,L,z=-x,F=-k,O=t-w,B=p[n],q=new Uint8Array(t),R=[],E=o.decoder,U=o.contextCache.getContexts("GB"),X=0,H=0,J=0;J<r;J++){if(i)if(X^=E.readBit(U,B)){R.push(q);continue}for(q=new Uint8Array(q),R.push(q),S=0;S<t;S++)if(c&&a[J][S])q[S]=0;else{if(S>=z&&S<O&&J>=F)for(H=H<<1&y,m=0;m<C;m++)T=J+I[m],A=S+P[m],(D=R[T][A])&&(H|=D=M[m]);else for(H=0,L=d-1,m=0;m<d;m++,L--)(A=S+v[m])>=0&&A<t&&(T=J+g[m])>=0&&(D=R[T][A])&&(H|=D<<L);var _=E.readBit(U,H);q[S]=_}}return R}function g(e,t,r,n,i,a,s,o,c){var l=m[r].coding;0===r&&(l=l.concat([o[0]]));var h,u=l.length,p=new Int32Array(u),v=new Int32Array(u);for(h=0;h<u;h++)p[h]=l[h].x,v[h]=l[h].y;var g=m[r].reference;0===r&&(g=g.concat([o[1]]));var b=g.length,y=new Int32Array(b),x=new Int32Array(b);for(h=0;h<b;h++)y[h]=g[h].x,x[h]=g[h].y;for(var w=n[0].length,k=n.length,C=d[r],P=[],I=c.decoder,M=c.contextCache.getContexts("GR"),S=0,T=0;T<t;T++){if(s)(S^=I.readBit(M,C))&&f("JBIG2 error: prediction is not supported");var A=new Uint8Array(e);P.push(A);for(var D=0;D<e;D++){var L,z,F=0;for(h=0;h<u;h++)L=T+v[h],z=D+p[h],L<0||z<0||z>=e?F<<=1:F=F<<1|P[L][z];for(h=0;h<b;h++)L=T+x[h]+a,z=D+y[h]+i,L<0||L>=k||z<0||z>=w?F<<=1:F=F<<1|n[L][z];var O=I.readBit(M,F);A[D]=O}}return P}function b(e,t,n,a,s,o,c,l,h,u,m,p,d,v,b,y,x){e&&f("JBIG2 error: huffman is not supported");var w,k,C=[];for(w=0;w<a;w++){if(k=new Uint8Array(n),s)for(var P=0;P<n;P++)k[P]=s;C.push(k)}var I=x.decoder,M=x.contextCache,S=-r(M,"IADT",I),T=0;for(w=0;w<o;){S+=r(M,"IADT",I);for(var A=T+=r(M,"IAFS",I);;){var D=c*S+(1===c?0:r(M,"IAIT",I)),L=i(M,I,h),z=t&&r(M,"IARI",I),F=l[L],O=F[0].length,B=F.length;if(z){var q=r(M,"IARDW",I),R=r(M,"IARDH",I);F=g(O+=q,B+=R,b,F,(q>>1)+r(M,"IARDX",I),(R>>1)+r(M,"IARDY",I),!1,y,x)}var E,U,X,H=D-(1&p?0:B),J=A-(2&p?O:0);if(u){for(E=0;E<B;E++)if(k=C[J+E]){X=F[E];var _=Math.min(n-H,O);switch(d){case 0:for(U=0;U<_;U++)k[H+U]|=X[U];break;case 2:for(U=0;U<_;U++)k[H+U]^=X[U];break;default:f("JBIG2 error: operator "+d+" is not supported")}}A+=B-1}else{for(U=0;U<B;U++)if(k=C[H+U])switch(X=F[U],d){case 0:for(E=0;E<O;E++)k[J+E]|=X[E];break;case 2:for(E=0;E<O;E++)k[J+E]^=X[E];break;default:f("JBIG2 error: operator "+d+" is not supported")}A+=O-1}w++;var N=r(M,"IADS",I);if(null===N)break;A+=N+m}}return C}function y(e,t){var r={};r.number=l(e,t);var n=e[t+4],i=63&n;a[i]||f("JBIG2 error: invalid segment type: "+i),r.type=i,r.typeName=a[i],r.deferredNonRetain=!!(128&n);var s=!!(64&n),o=e[t+5],h=o>>5&7,u=[31&o],m=t+6;if(7===o){h=536870911&l(e,m-1),m+=3;var p=h+7>>3;for(u[0]=e[m++];--p>0;)u.push(e[m++])}else 5!==o&&6!==o||f("JBIG2 error: invalid referred-to flags");r.retainBits=u;var d,v,g=r.number<=256?1:r.number<=65536?2:4,b=[];for(d=0;d<h;d++){var y=1===g?e[m]:2===g?c(e,m):l(e,m);b.push(y),m+=g}if(r.referredTo=b,s?(r.pageAssociation=l(e,m),m+=4):r.pageAssociation=e[m++],r.length=l(e,m),m+=4,4294967295===r.length)if(38===i){var x=w(e,m),C=!!(1&e[m+k]),P=new Uint8Array(6);for(C||(P[0]=255,P[1]=172),P[2]=x.height>>>24&255,P[3]=x.height>>16&255,P[4]=x.height>>8&255,P[5]=255&x.height,d=m,v=e.length;d<v;d++){for(var I=0;I<6&&P[I]===e[d+I];)I++;if(6===I){r.length=d+6;break}}4294967295===r.length&&f("JBIG2 error: segment end was not found")}else f("JBIG2 error: invalid unknown segment length");return r.headerEnd=m,r}function x(e,t,r,n){for(var i=[],a=r;a<n;){var s=y(t,a);a=s.headerEnd;var o={header:s,data:t};if(e.randomAccess||(o.start=a,a+=s.length,o.end=a),i.push(o),51===s.type)break}if(e.randomAccess)for(var c=0,l=i.length;c<l;c++)i[c].start=a,a+=i[c].header.length,i[c].end=a;return i}function w(e,t){return{width:l(e,t),height:l(e,t+4),x:l(e,t+8),y:l(e,t+12),combinationOperator:7&e[t+16]}}var k=17;function C(e,t){var r,n,i,a,s=e.header,h=e.data,u=e.start,m=e.end;switch(s.type){case 0:var p={},d=c(h,u);if(p.huffman=!!(1&d),p.refinement=!!(2&d),p.huffmanDHSelector=d>>2&3,p.huffmanDWSelector=d>>4&3,p.bitmapSizeSelector=d>>6&1,p.aggregationInstancesSelector=d>>7&1,p.bitmapCodingContextUsed=!!(256&d),p.bitmapCodingContextRetained=!!(512&d),p.template=d>>10&3,p.refinementTemplate=d>>12&1,u+=2,!p.huffman){for(a=0===p.template?4:1,n=[],i=0;i<a;i++)n.push({x:o(h,u),y:o(h,u+1)}),u+=2;p.at=n}if(p.refinement&&!p.refinementTemplate){for(n=[],i=0;i<2;i++)n.push({x:o(h,u),y:o(h,u+1)}),u+=2;p.refinementAt=n}p.numberOfExportedSymbols=l(h,u),u+=4,p.numberOfNewSymbols=l(h,u),u+=4,r=[p,s.number,s.referredTo,h,u,m];break;case 6:case 7:var v={};v.info=w(h,u);var g=c(h,u+=k);if(u+=2,v.huffman=!!(1&g),v.refinement=!!(2&g),v.stripSize=1<<(g>>2&3),v.referenceCorner=g>>4&3,v.transposed=!!(64&g),v.combinationOperator=g>>7&3,v.defaultPixelValue=g>>9&1,v.dsOffset=g<<17>>27,v.refinementTemplate=g>>15&1,v.huffman){var b=c(h,u);u+=2,v.huffmanFS=3&b,v.huffmanDS=b>>2&3,v.huffmanDT=b>>4&3,v.huffmanRefinementDW=b>>6&3,v.huffmanRefinementDH=b>>8&3,v.huffmanRefinementDX=b>>10&3,v.huffmanRefinementDY=b>>12&3,v.huffmanRefinementSizeSelector=!!(14&b)}if(v.refinement&&!v.refinementTemplate){for(n=[],i=0;i<2;i++)n.push({x:o(h,u),y:o(h,u+1)}),u+=2;v.refinementAt=n}v.numberOfSymbolInstances=l(h,u),u+=4,v.huffman&&f("JBIG2 error: huffman is not supported"),r=[v,s.referredTo,h,u,m];break;case 38:case 39:var y={};y.info=w(h,u),u+=k;var x=h[u++];if(y.mmr=!!(1&x),y.template=x>>1&3,y.prediction=!!(8&x),!y.mmr){for(a=0===y.template?4:1,n=[],i=0;i<a;i++)n.push({x:o(h,u),y:o(h,u+1)}),u+=2;y.at=n}r=[y,h,u,m];break;case 48:var C={width:l(h,u),height:l(h,u+4),resolutionX:l(h,u+8),resolutionY:l(h,u+12)};4294967295===C.height&&delete C.height;var P=h[u+16];c(h,u+17),C.lossless=!!(1&P),C.refinement=!!(2&P),C.defaultPixelValue=P>>2&1,C.combinationOperator=P>>3&3,C.requiresBuffer=!!(32&P),C.combinationOperatorOverride=!!(64&P),r=[C];break;case 49:case 50:case 51:case 62:break;default:f("JBIG2 error: segment type "+s.typeName+"("+s.type+") is not implemented")}var I="on"+s.typeName;I in t&&t[I].apply(t,r)}function P(e,t){for(var r=0,n=e.length;r<n;r++)C(e[r],t)}function I(){}function M(){}return I.prototype={onPageInformation:function(e){this.currentPageInfo=e;var t=e.width+7>>3,r=new Uint8Array(t*e.height);if(e.defaultPixelValue)for(var n=0,i=r.length;n<i;n++)r[n]=255;this.buffer=r},drawBitmap:function(e,t){var r,n,i,a,s=this.currentPageInfo,o=e.width,c=e.height,l=s.width+7>>3,h=s.combinationOperatorOverride?e.combinationOperator:s.combinationOperator,u=this.buffer,m=128>>(7&e.x),p=e.y*l+(e.x>>3);switch(h){case 0:for(r=0;r<c;r++){for(i=m,a=p,n=0;n<o;n++)t[r][n]&&(u[a]|=i),(i>>=1)||(i=128,a++);p+=l}break;case 2:for(r=0;r<c;r++){for(i=m,a=p,n=0;n<o;n++)t[r][n]&&(u[a]^=i),(i>>=1)||(i=128,a++);p+=l}break;default:f("JBIG2 error: operator "+h+" is not supported")}},onImmediateGenericRegion:function(e,r,n,i){var a=e.info,s=new t(r,n,i),o=v(e.mmr,a.width,a.height,e.template,e.prediction,null,e.at,s);this.drawBitmap(a,o)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,n,a,o,c,l){e.huffman&&f("JBIG2 error: huffman is not supported");var h=this.symbols;h||(this.symbols=h={});for(var u=[],m=0,p=a.length;m<p;m++)u=u.concat(h[a[m]]);var d=new t(o,c,l);h[n]=function(e,t,n,a,o,c,l,h,u,m,p){e&&f("JBIG2 error: huffman is not supported");for(var d=[],y=0,x=s(n.length+a),w=p.decoder,k=p.contextCache;d.length<a;){y+=r(k,"IADH",w);for(var C=0;;){var P,I=r(k,"IADW",w);if(null===I)break;if(C+=I,t){var M=r(k,"IAAI",w);if(M>1)P=b(e,t,C,y,0,M,1,n.concat(d),x,0,0,1,0,0,u,m,p);else{var S=i(k,w,x),T=r(k,"IARDX",w),A=r(k,"IARDY",w);P=g(C,y,u,S<n.length?n[S]:d[S-n.length],T,A,!1,m,p)}}else P=v(!1,C,y,l,!1,null,h,p);d.push(P)}}for(var D=[],L=[],z=!1,F=n.length+a;L.length<F;){for(var O=r(k,"IAEX",w);O--;)L.push(z);z=!z}for(var B=0,q=n.length;B<q;B++)L[B]&&D.push(n[B]);for(var R=0;R<a;B++,R++)L[B]&&D.push(d[R]);return D}(e.huffman,e.refinement,u,e.numberOfNewSymbols,e.numberOfExportedSymbols,0,e.template,e.at,e.refinementTemplate,e.refinementAt,d)},onImmediateTextRegion:function(e,r,n,i,a){for(var o=e.info,c=this.symbols,l=[],h=0,f=r.length;h<f;h++)l=l.concat(c[r[h]]);var u=s(l.length),m=new t(n,i,a),p=b(e.huffman,e.refinement,o.width,o.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,l,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,0,e.refinementTemplate,e.refinementAt,m);this.drawBitmap(o,p)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)}},M.prototype={parseChunks:function(e){return function(e){for(var t=new I,r=0,n=e.length;r<n;r++){var i=e[r];P(x({},i.data,i.start,i.end),t)}return t.buffer}(e)}},M}();function s(e){for(var t=1,r=0;e>t;)t<<=1,r++;return r}function o(e,t){return e[t]<<24>>24}function c(e,t){return e[t]<<8|e[t+1]}function l(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}var f=function(){throw console.error.apply(console,arguments),new Error("PDFJS error: "+arguments[0])},u=function(){console.warn.apply(console,arguments)},m=function(){console.info.apply(console,arguments)};a.prototype.parse=function(e){var t=0,r=e.length;151===e[t]&&74===e[t+1]&&66===e[t+2]&&50===e[t+3]&&13===e[t+4]&&10===e[t+5]&&26===e[t+6]&&10===e[t+7]||f("JBIG2 error: invalid header");var n={};t+=8;var i=e[t++];n.randomAccess=!(1&i),2&i||(n.numberOfPages=l(e,t),t+=4);for(var a=this.parseChunks([{data:e,start:t,end:r}]),s=a.currentPageInfo.width,o=a.currentPageInfo.height,c=a.buffer,h=(e=new Uint8Array(s*o),0),u=0,m=0;m<o;m++)for(var p,d=0,v=0;v<s;v++)d||(d=128,p=c[u++]),e[h++]=p&d?0:255,d>>=1;this.width=s,this.height=o,this.data=e},e.JpegImage=r,e.JpxImage=i,e.Jbig2Image=a}(PDFJS||(PDFJS={}));

;(function(){var o,X=0,e=null,n=null;o=window.FFT={};var f={o:function(G){if(G!==0&&(G&G-1)===0){X=G;
f.B();f.q();f.i()}else{throw new Error("init: radix-2 required")}},X:function(G,B){f.G(G,B,1)},e:function(G,B){var j=1/X;
f.G(G,B,-1);for(var q=0;q<X;q++){G[q]*=j;B[q]*=j}},n:function(G,B){var j=[],q=[],i=0;for(var m=0;m<X;
m++){i=m*X;for(var Z=0;Z<X;Z++){j[Z]=G[Z+i];q[Z]=B[Z+i]}f.X(j,q);for(var p=0;p<X;p++){G[p+i]=j[p];B[p+i]=q[p]}}for(var C=0;
C<X;C++){for(var a=0;a<X;a++){i=C+a*X;j[a]=G[i];q[a]=B[i]}f.X(j,q);for(var r=0;r<X;r++){i=C+r*X;G[i]=j[r];
B[i]=q[r]}}},f:function(G,B){var j=[],q=[],i=0;for(var m=0;m<X;m++){i=m*X;for(var Z=0;Z<X;Z++){j[Z]=G[Z+i];
q[Z]=B[Z+i]}f.e(j,q);for(var p=0;p<X;p++){G[p+i]=j[p];B[p+i]=q[p]}}for(var C=0;C<X;C++){for(var a=0;
a<X;a++){i=C+a*X;j[a]=G[i];q[a]=B[i]}f.e(j,q);for(var r=0;r<X;r++){i=C+r*X;G[i]=j[r];B[i]=q[r]}}},G:function(G,B,j){var q,i,m,Z,p,C,a,r,M,R=X>>2;
for(var P=0;P<X;P++){Z=e[P];if(P<Z){p=G[P];G[P]=G[Z];G[Z]=p;p=B[P];B[P]=B[Z];B[Z]=p}}for(var y=1;y<X;
y<<=1){i=0;q=X/(y<<1);for(var x=0;x<y;x++){C=n[i+R];a=j*n[i];for(var t=x;t<X;t+=y<<1){m=t+y;r=C*G[m]+a*B[m];
M=C*B[m]-a*G[m];G[m]=G[t]-r;G[t]+=r;B[m]=B[t]-M;B[t]+=M}i+=q}}},B:function(){var G=Uint32Array;if(X<=256)G=Uint8Array;
else if(X<=65536)G=Uint16Array;e=new G(X);n=new Float64Array(X*1.25)},j:function(){},q:function(){var G=0,B=0,q=0;
e[0]=0;while(++G<X){q=X>>1;while(q<=B){B-=q;q>>=1}B+=q;e[G]=B}},i:function(){var G=X>>1,B=X>>2,j=X>>3,q=G+B,i=Math.sin(Math.PI/X),m=2*i*i,Z=Math.sqrt(m*(2-m)),p=n[B]=1,C=n[0]=0;
i=2*m;for(var a=1;a<j;a++){p-=m;m+=i*p;C+=Z;Z-=i*C;n[a]=C;n[B-a]=p}if(j!==0){n[j]=Math.sqrt(.5)}for(var r=0;
r<B;r++){n[G-r]=n[r]}for(var M=0;M<q;M++){n[M+G]=-n[M]}}};o.init=f.o;o.fft2d=f.n;o.ifft2d=f.f}.call(this));
	
(function(r){"object"===typeof exports&&"undefined"!==typeof module?module.exports=r():"function"===typeof define&&define.amd?define([],r):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).acorn=r()})(function(){return function a(l,f,c){function g(d,n){if(!f[d]){if(!l[d]){var e="function"==typeof require&&require;if(!n&&e)return e(d,!0);if(b)return b(d,!0);e=Error("Cannot find module '"+d+"'");throw e.code="MODULE_NOT_FOUND",e;}e=f[d]={exports:{}};
l[d][0].call(e.exports,function(b){var e=l[d][1][b];return g(e?e:b)},e,e.exports,a,l,f,c)}return f[d].exports}for(var b="function"==typeof require&&require,d=0;d<c.length;d++)g(c[d]);return g}({1:[function(a,l,f){var c=a("./tokentype");a=a("./state").Parser.prototype;a.checkPropClash=function(b,c){if(!(6<=this.options.ecmaVersion&&(b.computed||b.method||b.shorthand))){var d=b.key;switch(d.type){case "Identifier":var a=d.name;break;case "Literal":a=String(d.value);break;default:return}var e=b.kind;
if(6<=this.options.ecmaVersion)"__proto__"===a&&"init"===e&&(c.proto&&this.raiseRecoverable(d.start,"Redefinition of __proto__ property"),c.proto=!0);else{a="$"+a;var m=c[a];m?(a="init"!==e,(!this.strict&&!a||!m[e])&&a^m.init||this.raiseRecoverable(d.start,"Redefinition of property")):m=c[a]={init:!1,get:!1,set:!1};m[e]=!0}}};a.parseExpression=function(b,a){var d=this.start,n=this.startLoc,e=this.parseMaybeAssign(b,a);if(this.type===c.types.comma){d=this.startNodeAt(d,n);for(d.expressions=[e];this.eat(c.types.comma);)d.expressions.push(this.parseMaybeAssign(b,
a));return this.finishNode(d,"SequenceExpression")}return e};a.parseMaybeAssign=function(b,a,h){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var d=!1;a||(a={shorthandAssign:0,trailingComma:0},d=!0);var e=this.start,m=this.startLoc;if(this.type==c.types.parenL||this.type==c.types.name)this.potentialArrowAt=this.start;var p=this.parseMaybeConditional(b,a);h&&(p=h.call(this,p,e,m));if(this.type.isAssign)return d&&this.checkPatternErrors(a,!0),h=this.startNodeAt(e,m),h.operator=
this.value,h.left=this.type===c.types.eq?this.toAssignable(p):p,a.shorthandAssign=0,this.checkLVal(p),this.next(),h.right=this.parseMaybeAssign(b),this.finishNode(h,"AssignmentExpression");d&&this.checkExpressionErrors(a,!0);return p};a.parseMaybeConditional=function(b,a){var d=this.start,n=this.startLoc,e=this.parseExprOps(b,a);return this.checkExpressionErrors(a)?e:this.eat(c.types.question)?(d=this.startNodeAt(d,n),d.test=e,d.consequent=this.parseMaybeAssign(),this.expect(c.types.colon),d.alternate=
this.parseMaybeAssign(b),this.finishNode(d,"ConditionalExpression")):e};a.parseExprOps=function(b,c){var a=this.start,d=this.startLoc,e=this.parseMaybeUnary(c,!1);return this.checkExpressionErrors(c)?e:this.parseExprOp(e,a,d,-1,b)};a.parseExprOp=function(b,a,h,n,e){var d=this.type.binop;if(null!=d&&(!e||this.type!==c.types._in)&&d>n){var p=this.type===c.types.logicalOR||this.type===c.types.logicalAND,g=this.value;this.next();var k=this.start,q=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,
!1),k,q,d,e);b=this.buildBinary(a,h,b,d,g,p);return this.parseExprOp(b,a,h,n,e)}return b};a.buildBinary=function(b,c,a,n,e,m){b=this.startNodeAt(b,c);b.left=a;b.operator=e;b.right=n;return this.finishNode(b,m?"LogicalExpression":"BinaryExpression")};a.parseMaybeUnary=function(b,a){var d=this.start,n=this.startLoc;if(this.type.prefix){var e=this.startNode();var m=this.type===c.types.incDec;e.operator=this.value;e.prefix=!0;this.next();e.argument=this.parseMaybeUnary(null,!0);this.checkExpressionErrors(b,
!0);m?this.checkLVal(e.argument):this.strict&&"delete"===e.operator&&"Identifier"===e.argument.type?this.raiseRecoverable(e.start,"Deleting local variable in strict mode"):a=!0;m=this.finishNode(e,m?"UpdateExpression":"UnaryExpression")}else{m=this.parseExprSubscripts(b);if(this.checkExpressionErrors(b))return m;for(;this.type.postfix&&!this.canInsertSemicolon();)e=this.startNodeAt(d,n),e.operator=this.value,e.prefix=!1,e.argument=m,this.checkLVal(m),this.next(),m=this.finishNode(e,"UpdateExpression")}return!a&&
this.eat(c.types.starstar)?this.buildBinary(d,n,m,this.parseMaybeUnary(null,!1),"**",!1):m};a.parseExprSubscripts=function(b){var c=this.start,a=this.startLoc,n=this.parseExprAtom(b),e="ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd);return this.checkExpressionErrors(b)||e?n:this.parseSubscripts(n,c,a)};a.parseSubscripts=function(b,a,h,n){for(var e;;)if(this.eat(c.types.dot))e=this.startNodeAt(a,h),e.object=b,e.property=this.parseIdent(!0),e.computed=!1,
b=this.finishNode(e,"MemberExpression");else if(this.eat(c.types.bracketL))e=this.startNodeAt(a,h),e.object=b,e.property=this.parseExpression(),e.computed=!0,this.expect(c.types.bracketR),b=this.finishNode(e,"MemberExpression");else if(!n&&this.eat(c.types.parenL))e=this.startNodeAt(a,h),e.callee=b,e.arguments=this.parseExprList(c.types.parenR,!1),b=this.finishNode(e,"CallExpression");else if(this.type===c.types.backQuote)e=this.startNodeAt(a,h),e.tag=b,e.quasi=this.parseTemplate(),b=this.finishNode(e,
"TaggedTemplateExpression");else return b};a.parseExprAtom=function(b){var a=this.potentialArrowAt==this.start;switch(this.type){case c.types._super:this.inFunction||this.raise(this.start,"'super' outside of function or class");case c.types._this:return b=this.type===c.types._this?"ThisExpression":"Super",a=this.startNode(),this.next(),this.finishNode(a,b);case c.types.name:b=this.start;var h=this.startLoc,n=this.parseIdent(this.type!==c.types.name);return a&&!this.canInsertSemicolon()&&this.eat(c.types.arrow)?
this.parseArrowExpression(this.startNodeAt(b,h),[n]):n;case c.types.regexp:return b=this.value,a=this.parseLiteral(b.value),a.regex={pattern:b.pattern,flags:b.flags},a;case c.types.num:case c.types.string:return this.parseLiteral(this.value);case c.types._null:case c.types._true:case c.types._false:return a=this.startNode(),a.value=this.type===c.types._null?null:this.type===c.types._true,a.raw=this.type.keyword,this.next(),this.finishNode(a,"Literal");case c.types.parenL:return this.parseParenAndDistinguishExpression(a);
case c.types.bracketL:return a=this.startNode(),this.next(),a.elements=this.parseExprList(c.types.bracketR,!0,!0,b),this.finishNode(a,"ArrayExpression");case c.types.braceL:return this.parseObj(!1,b);case c.types._function:return a=this.startNode(),this.next(),this.parseFunction(a,!1);case c.types._class:return this.parseClass(this.startNode(),!1);case c.types._new:return this.parseNew();case c.types.backQuote:return this.parseTemplate();default:this.unexpected()}};a.parseLiteral=function(b){var a=
this.startNode();a.value=b;a.raw=this.input.slice(this.start,this.end);this.next();return this.finishNode(a,"Literal")};a.parseParenExpression=function(){this.expect(c.types.parenL);var b=this.parseExpression();this.expect(c.types.parenR);return b};a.parseParenAndDistinguishExpression=function(b){var a=this.start,h=this.startLoc;if(6<=this.options.ecmaVersion){this.next();for(var n=this.start,e=this.startLoc,m=[],p=!0,g={shorthandAssign:0,trailingComma:0},k=void 0,q=void 0;this.type!==c.types.parenR;)if(p?
p=!1:this.expect(c.types.comma),this.type===c.types.ellipsis){k=this.start;m.push(this.parseParenItem(this.parseRest()));break}else this.type!==c.types.parenL||q||(q=this.start),m.push(this.parseMaybeAssign(!1,g,this.parseParenItem));var p=this.start,f=this.startLoc;this.expect(c.types.parenR);if(b&&!this.canInsertSemicolon()&&this.eat(c.types.arrow))return this.checkPatternErrors(g,!0),q&&this.unexpected(q),this.parseParenArrowList(a,h,m);m.length||this.unexpected(this.lastTokStart);k&&this.unexpected(k);
this.checkExpressionErrors(g,!0);1<m.length?(b=this.startNodeAt(n,e),b.expressions=m,this.finishNodeAt(b,"SequenceExpression",p,f)):b=m[0]}else b=this.parseParenExpression();return this.options.preserveParens?(a=this.startNodeAt(a,h),a.expression=b,this.finishNode(a,"ParenthesizedExpression")):b};a.parseParenItem=function(b){return b};a.parseParenArrowList=function(b,a,c){return this.parseArrowExpression(this.startNodeAt(b,a),c)};var g=[];a.parseNew=function(){var b=this.startNode(),a=this.parseIdent(!0);
if(6<=this.options.ecmaVersion&&this.eat(c.types.dot))return b.meta=a,b.property=this.parseIdent(!0),"target"!==b.property.name&&this.raiseRecoverable(b.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(b.start,"new.target can only be used in functions"),this.finishNode(b,"MetaProperty");var a=this.start,h=this.startLoc;b.callee=this.parseSubscripts(this.parseExprAtom(),a,h,!0);this.eat(c.types.parenL)?b.arguments=this.parseExprList(c.types.parenR,
!1):b.arguments=g;return this.finishNode(b,"NewExpression")};a.parseTemplateElement=function(){var b=this.startNode();b.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value};this.next();b.tail=this.type===c.types.backQuote;return this.finishNode(b,"TemplateElement")};a.parseTemplate=function(){var b=this.startNode();this.next();b.expressions=[];var a=this.parseTemplateElement();for(b.quasis=[a];!a.tail;)this.expect(c.types.dollarBraceL),b.expressions.push(this.parseExpression()),
this.expect(c.types.braceR),b.quasis.push(a=this.parseTemplateElement());this.next();return this.finishNode(b,"TemplateLiteral")};a.parseObj=function(b,a){var d=this.startNode(),n=!0,e={};d.properties=[];for(this.next();!this.eat(c.types.braceR);){if(n)n=!1;else if(this.expect(c.types.comma),this.afterTrailingComma(c.types.braceR))break;var m=this.startNode(),p=void 0,g=void 0,k=void 0;if(6<=this.options.ecmaVersion){m.method=!1;m.shorthand=!1;if(b||a)g=this.start,k=this.startLoc;b||(p=this.eat(c.types.star))}this.parsePropertyName(m);
this.parsePropertyValue(m,b,p,g,k,a);this.checkPropClash(m,e);d.properties.push(this.finishNode(m,"Property"))}return this.finishNode(d,b?"ObjectPattern":"ObjectExpression")};a.parsePropertyValue=function(b,a,h,n,e,m){this.eat(c.types.colon)?(b.value=a?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,m),b.kind="init"):6<=this.options.ecmaVersion&&this.type===c.types.parenL?(a&&this.unexpected(),b.kind="init",b.method=!0,b.value=this.parseMethod(h)):5<=this.options.ecmaVersion&&
!b.computed&&"Identifier"===b.key.type&&("get"===b.key.name||"set"===b.key.name)&&this.type!=c.types.comma&&this.type!=c.types.braceR?((h||a)&&this.unexpected(),b.kind=b.key.name,this.parsePropertyName(b),b.value=this.parseMethod(!1),b.value.params.length!==("get"===b.kind?0:1)&&(a=b.value.start,"get"===b.kind?this.raiseRecoverable(a,"getter should have no params"):this.raiseRecoverable(a,"setter should have exactly one param")),"set"===b.kind&&"RestElement"===b.value.params[0].type&&this.raiseRecoverable(b.value.params[0].start,
"Setter cannot use rest params")):6<=this.options.ecmaVersion&&!b.computed&&"Identifier"===b.key.type?(b.kind="init",a?((this.keywords.test(b.key.name)||(this.strict?this.reservedWordsStrictBind:this.reservedWords).test(b.key.name)||this.inGenerator&&"yield"==b.key.name)&&this.raiseRecoverable(b.key.start,"Binding "+b.key.name),b.value=this.parseMaybeDefault(n,e,b.key)):this.type===c.types.eq&&m?(m.shorthandAssign||(m.shorthandAssign=this.start),b.value=this.parseMaybeDefault(n,e,b.key)):b.value=
b.key,b.shorthand=!0):this.unexpected()};a.parsePropertyName=function(b){if(6<=this.options.ecmaVersion){if(this.eat(c.types.bracketL))return b.computed=!0,b.key=this.parseMaybeAssign(),this.expect(c.types.bracketR),b.key;b.computed=!1}return b.key=this.type===c.types.num||this.type===c.types.string?this.parseExprAtom():this.parseIdent(!0)};a.initFunction=function(b){b.id=null;6<=this.options.ecmaVersion&&(b.generator=!1,b.expression=!1)};a.parseMethod=function(b){var a=this.startNode(),h=this.inGenerator;
this.inGenerator=b;this.initFunction(a);this.expect(c.types.parenL);a.params=this.parseBindingList(c.types.parenR,!1,!1);6<=this.options.ecmaVersion&&(a.generator=b);this.parseFunctionBody(a,!1);this.inGenerator=h;return this.finishNode(a,"FunctionExpression")};a.parseArrowExpression=function(b,a){var c=this.inGenerator;this.inGenerator=!1;this.initFunction(b);b.params=this.toAssignableList(a,!0);this.parseFunctionBody(b,!0);this.inGenerator=c;return this.finishNode(b,"ArrowFunctionExpression")};
a.parseFunctionBody=function(b,a){var d=a&&this.type!==c.types.braceL;if(d)b.body=this.parseMaybeAssign(),b.expression=!0;else{var n=this.inFunction,e=this.labels;this.inFunction=!0;this.labels=[];b.body=this.parseBlock(!0);b.expression=!1;this.inFunction=n;this.labels=e}this.strict||!d&&b.body.body.length&&this.isUseStrict(b.body.body[0])?(d=this.strict,this.strict=!0,b.id&&this.checkLVal(b.id,!0),this.checkParams(b),this.strict=d):a&&this.checkParams(b)};a.checkParams=function(b){for(var a={},c=
0;c<b.params.length;c++)this.checkLVal(b.params[c],!0,a)};a.parseExprList=function(b,a,h,n){for(var e=[],d=!0;!this.eat(b);){if(d)d=!1;else if(this.expect(c.types.comma),a&&this.afterTrailingComma(b))break;if(h&&this.type===c.types.comma)var p=null;else this.type===c.types.ellipsis?(p=this.parseSpread(n),this.type===c.types.comma&&n&&!n.trailingComma&&(n.trailingComma=this.lastTokStart)):p=this.parseMaybeAssign(!1,n);e.push(p)}return e};a.parseIdent=function(b){var a=this.startNode();b&&"never"==
this.options.allowReserved&&(b=!1);this.type===c.types.name?(!b&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(this.value)&&(6<=this.options.ecmaVersion||-1==this.input.slice(this.start,this.end).indexOf("\\"))&&this.raiseRecoverable(this.start,"The keyword '"+this.value+"' is reserved"),!b&&this.inGenerator&&"yield"===this.value&&this.raiseRecoverable(this.start,"Can not use 'yield' as identifier inside a generator"),a.name=this.value):b&&this.type.keyword?a.name=this.type.keyword:
this.unexpected();this.next();return this.finishNode(a,"Identifier")};a.parseYield=function(){var b=this.startNode();this.next();this.type==c.types.semi||this.canInsertSemicolon()||this.type!=c.types.star&&!this.type.startsExpr?(b.delegate=!1,b.argument=null):(b.delegate=this.eat(c.types.star),b.argument=this.parseMaybeAssign());return this.finishNode(b,"YieldExpression")}},{"./state":10,"./tokentype":14}],2:[function(a,l,f){function c(b,a){for(var e=65536,c=0;c<a.length;c+=2){e+=a[c];if(e>b)return!1;
e+=a[c+1];if(e>=b)return!0}}f.__esModule=!0;f.isIdentifierStart=function(b,a){return 65>b?36===b:91>b?!0:97>b?95===b:123>b?!0:65535>=b?170<=b&&g.test(String.fromCharCode(b)):!1===a?!1:c(b,d)};f.isIdentifierChar=function(a,e){return 48>a?36===a:58>a?!0:65>a?!1:91>a?!0:97>a?95===a:123>a?!0:65535>=a?170<=a&&b.test(String.fromCharCode(a)):!1===e?!1:c(a,d)||c(a,h)};f.reservedWords={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
5:"class enum extends super const export import",6:"enum",7:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"};f.keywords={5:"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",6:"break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this const class extends export import super"};
a="\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b4\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ad\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
var g=new RegExp("["+a+"]"),b=new RegExp("["+a+"\u200c\u200d\u00b7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]");
a=null;var d=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,99,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,287,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,1288,
921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,16481,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,1340,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],h=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,
41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,168,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,316,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,20855,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,3617,6,792618,239]},{}],3:[function(a,l,f){f.__esModule=!0;f.parse=function(a,b){return(new c.Parser(b,a)).parse()};f.parseExpressionAt=function(a,b,d){a=new c.Parser(d,a,b);a.nextToken();
return a.parseExpression()};f.tokenizer=function(a,b){return new c.Parser(b,a)};var c=a("./state");a("./parseutil");a("./statement");a("./lval");a("./expression");a("./location");f.Parser=c.Parser;f.plugins=c.plugins;l=a("./options");f.defaultOptions=l.defaultOptions;l=a("./locutil");f.Position=l.Position;f.SourceLocation=l.SourceLocation;f.getLineInfo=l.getLineInfo;l=a("./node");f.Node=l.Node;l=a("./tokentype");f.TokenType=l.TokenType;f.tokTypes=l.types;l=a("./tokencontext");f.TokContext=l.TokContext;
f.tokContexts=l.types;l=a("./identifier");f.isIdentifierChar=l.isIdentifierChar;f.isIdentifierStart=l.isIdentifierStart;l=a("./tokenize");f.Token=l.Token;a=a("./whitespace");f.isNewLine=a.isNewLine;f.lineBreak=a.lineBreak;f.lineBreakG=a.lineBreakG;f.version="3.1.0"},{"./expression":1,"./identifier":2,"./location":4,"./locutil":5,"./lval":6,"./node":7,"./options":8,"./parseutil":9,"./state":10,"./statement":11,"./tokencontext":12,"./tokenize":13,"./tokentype":14,"./whitespace":16}],4:[function(a,l,
f){l=a("./state");var c=a("./locutil");a=l.Parser.prototype;a.raise=function(a,b){var d=c.getLineInfo(this.input,a);b+=" ("+d.line+":"+d.column+")";var h=new SyntaxError(b);h.pos=a;h.loc=d;h.raisedAt=this.pos;throw h;};a.raiseRecoverable=a.raise;a.curPosition=function(){if(this.options.locations)return new c.Position(this.curLine,this.pos-this.lineStart)}},{"./locutil":5,"./state":10}],5:[function(a,l,f){function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");
}f.__esModule=!0;f.getLineInfo=function(a,c){for(var d=1,e=0;;){g.lineBreakG.lastIndex=e;var m=g.lineBreakG.exec(a);if(m&&m.index<c)++d,e=m.index+m[0].length;else return new b(d,c-e)}};var g=a("./whitespace"),b=function(){function a(b,d){c(this,a);this.line=b;this.column=d}a.prototype.offset=function(b){return new a(this.line,this.column+b)};return a}();f.Position=b;f.SourceLocation=function h(a,b,m){c(this,h);this.start=b;this.end=m;null!==a.sourceFile&&(this.source=a.sourceFile)}},{"./whitespace":16}],
6:[function(a,l,f){var c=a("./tokentype");l=a("./state");var g=a("./util");a=l.Parser.prototype;a.toAssignable=function(a,c){if(6<=this.options.ecmaVersion&&a)switch(a.type){case "Identifier":case "ObjectPattern":case "ArrayPattern":break;case "ObjectExpression":a.type="ObjectPattern";for(var b=0;b<a.properties.length;b++){var d=a.properties[b];"init"!==d.kind&&this.raise(d.key.start,"Object pattern can't contain getter or setter");this.toAssignable(d.value,c)}break;case "ArrayExpression":a.type=
"ArrayPattern";this.toAssignableList(a.elements,c);break;case "AssignmentExpression":if("="===a.operator)a.type="AssignmentPattern",delete a.operator;else{this.raise(a.left.end,"Only '=' operator can be used for specifying default value.");break}case "AssignmentPattern":"YieldExpression"===a.right.type&&this.raise(a.right.start,"Yield expression cannot be a default value");break;case "ParenthesizedExpression":a.expression=this.toAssignable(a.expression,c);break;case "MemberExpression":if(!c)break;
default:this.raise(a.start,"Assigning to rvalue")}return a};a.toAssignableList=function(a,c){var b=a.length;if(b){var d=a[b-1];if(d&&"RestElement"==d.type)--b;else if(d&&"SpreadElement"==d.type){d.type="RestElement";var e=d.argument;this.toAssignable(e,c);"Identifier"!==e.type&&"MemberExpression"!==e.type&&"ArrayPattern"!==e.type&&this.unexpected(e.start);--b}c&&"RestElement"===d.type&&"Identifier"!==d.argument.type&&this.unexpected(d.argument.start)}for(d=0;d<b;d++)(e=a[d])&&this.toAssignable(e,
c);return a};a.parseSpread=function(a){var b=this.startNode();this.next();b.argument=this.parseMaybeAssign(a);return this.finishNode(b,"SpreadElement")};a.parseRest=function(a){var b=this.startNode();this.next();b.argument=a?this.type===c.types.name?this.parseIdent():this.unexpected():this.type===c.types.name||this.type===c.types.bracketL?this.parseBindingAtom():this.unexpected();return this.finishNode(b,"RestElement")};a.parseBindingAtom=function(){if(6>this.options.ecmaVersion)return this.parseIdent();
switch(this.type){case c.types.name:return this.parseIdent();case c.types.bracketL:var a=this.startNode();this.next();a.elements=this.parseBindingList(c.types.bracketR,!0,!0);return this.finishNode(a,"ArrayPattern");case c.types.braceL:return this.parseObj(!0);default:this.unexpected()}};a.parseBindingList=function(a,d,h,n){for(var b=[],m=!0;!this.eat(a);)if(m?m=!1:this.expect(c.types.comma),d&&this.type===c.types.comma)b.push(null);else if(h&&this.afterTrailingComma(a))break;else if(this.type===
c.types.ellipsis){d=this.parseRest(n);this.parseBindingListItem(d);b.push(d);this.type===c.types.comma&&this.raise(this.start,"Comma is not permitted after the rest element");this.expect(a);break}else{var p=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(p);b.push(p)}return b};a.parseBindingListItem=function(a){return a};a.parseMaybeDefault=function(a,d,h){h=h||this.parseBindingAtom();if(6>this.options.ecmaVersion||!this.eat(c.types.eq))return h;a=this.startNodeAt(a,d);
a.left=h;a.right=this.parseMaybeAssign();return this.finishNode(a,"AssignmentPattern")};a.checkLVal=function(a,c,h){switch(a.type){case "Identifier":this.strict&&this.reservedWordsStrictBind.test(a.name)&&this.raiseRecoverable(a.start,(c?"Binding ":"Assigning to ")+a.name+" in strict mode");h&&(g.has(h,a.name)&&this.raiseRecoverable(a.start,"Argument name clash"),h[a.name]=!0);break;case "MemberExpression":c&&this.raiseRecoverable(a.start,(c?"Binding":"Assigning to")+" member expression");break;case "ObjectPattern":for(var b=
0;b<a.properties.length;b++)this.checkLVal(a.properties[b].value,c,h);break;case "ArrayPattern":for(b=0;b<a.elements.length;b++){var e=a.elements[b];e&&this.checkLVal(e,c,h)}break;case "AssignmentPattern":this.checkLVal(a.left,c,h);break;case "RestElement":this.checkLVal(a.argument,c,h);break;case "ParenthesizedExpression":this.checkLVal(a.expression,c,h);break;default:this.raise(a.start,(c?"Binding":"Assigning to")+" rvalue")}}},{"./state":10,"./tokentype":14,"./util":15}],7:[function(a,l,f){function c(a,
b,c,e){a.type=b;a.end=c;this.options.locations&&(a.loc.end=e);this.options.ranges&&(a.range[1]=c);return a}f.__esModule=!0;l=a("./state");var g=a("./locutil"),b=function h(a,b,c){if(!(this instanceof h))throw new TypeError("Cannot call a class as a function");this.type="";this.start=b;this.end=0;a.options.locations&&(this.loc=new g.SourceLocation(a,c));a.options.directSourceFile&&(this.sourceFile=a.options.directSourceFile);a.options.ranges&&(this.range=[b,0])};f.Node=b;a=l.Parser.prototype;a.startNode=
function(){return new b(this,this.start,this.startLoc)};a.startNodeAt=function(a,c){return new b(this,a,c)};a.finishNode=function(a,b){return c.call(this,a,b,this.lastTokEnd,this.lastTokEndLoc)};a.finishNodeAt=function(a,b,e,m){return c.call(this,a,b,e,m)}},{"./locutil":5,"./state":10}],8:[function(a,l,f){function c(a,c){return function(e,m,d,h,k,q){e={type:e?"Block":"Line",value:m,start:d,end:h};a.locations&&(e.loc=new b.SourceLocation(this,k,q));a.ranges&&(e.range=[d,h]);c.push(e)}}f.__esModule=
!0;f.getOptions=function(a){var b={},e;for(e in d)b[e]=a&&g.has(a,e)?a[e]:d[e];null==b.allowReserved&&(b.allowReserved=5>b.ecmaVersion);g.isArray(b.onToken)&&function(){var a=b.onToken;b.onToken=function(b){return a.push(b)}}();g.isArray(b.onComment)&&(b.onComment=c(b,b.onComment));return b};var g=a("./util"),b=a("./locutil"),d={ecmaVersion:6,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,
locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}};f.defaultOptions=d},{"./locutil":5,"./util":15}],9:[function(a,l,f){var c=a("./tokentype");l=a("./state");var g=a("./whitespace");a=l.Parser.prototype;a.isUseStrict=function(a){return 5<=this.options.ecmaVersion&&"ExpressionStatement"===a.type&&"Literal"===a.expression.type&&"use strict"===a.expression.raw.slice(1,-1)};a.eat=function(a){return this.type===a?(this.next(),
!0):!1};a.isContextual=function(a){return this.type===c.types.name&&this.value===a};a.eatContextual=function(a){return this.value===a&&this.eat(c.types.name)};a.expectContextual=function(a){this.eatContextual(a)||this.unexpected()};a.canInsertSemicolon=function(){return this.type===c.types.eof||this.type===c.types.braceR||g.lineBreak.test(this.input.slice(this.lastTokEnd,this.start))};a.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,
this.lastTokEndLoc);return!0}};a.semicolon=function(){this.eat(c.types.semi)||this.insertSemicolon()||this.unexpected()};a.afterTrailingComma=function(a){if(this.type==a){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);this.next();return!0}};a.expect=function(a){this.eat(a)||this.unexpected()};a.unexpected=function(a){this.raise(null!=a?a:this.start,"Unexpected token")};a.checkPatternErrors=function(a,c){var b=a&&a.trailingComma;if(!c)return!!b;
b&&this.raise(b,"Comma is not permitted after the rest element")};a.checkExpressionErrors=function(a,c){var b=a&&a.shorthandAssign;if(!c)return!!b;b&&this.raise(b,"Shorthand property assignments are valid only in destructuring patterns")}},{"./state":10,"./tokentype":14,"./whitespace":16}],10:[function(a,l,f){function c(a){return new RegExp("^("+a.replace(/ /g,"|")+")$")}f.__esModule=!0;var g=a("./identifier"),b=a("./tokentype"),d=a("./whitespace"),h=a("./options"),n={};f.plugins=n;a=function(){function a(e,
p,f){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");this.options=e=h.getOptions(e);this.sourceFile=e.sourceFile;this.keywords=c(g.keywords[6<=e.ecmaVersion?6:5]);var k=e.allowReserved?"":g.reservedWords[e.ecmaVersion]+("module"==e.sourceType?" await":"");this.reservedWords=c(k);k=(k?k+" ":"")+g.reservedWords.strict;this.reservedWordsStrict=c(k);this.reservedWordsStrictBind=c(k+" "+g.reservedWords.strictBind);this.input=String(p);this.containsEsc=!1;this.loadPlugins(e.plugins);
f?(this.pos=f,this.lineStart=Math.max(0,this.input.lastIndexOf("\n",f)),this.curLine=this.input.slice(0,this.lineStart).split(d.lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1);this.type=b.types.eof;this.value=null;this.start=this.end=this.pos;this.startLoc=this.endLoc=this.curPosition();this.lastTokEndLoc=this.lastTokStartLoc=null;this.lastTokStart=this.lastTokEnd=this.pos;this.context=this.initialContext();this.exprAllowed=!0;this.strict=this.inModule="module"===e.sourceType;this.potentialArrowAt=
-1;this.inFunction=this.inGenerator=!1;this.labels=[];0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2)}a.prototype.isKeyword=function(a){return this.keywords.test(a)};a.prototype.isReservedWord=function(a){return this.reservedWords.test(a)};a.prototype.extend=function(a,b){this[a]=b(this[a])};a.prototype.loadPlugins=function(a){for(var b in a){var c=n[b];if(!c)throw Error("Plugin '"+b+"' not found");c(this,a[b])}};a.prototype.parse=function(){var a=this.options.program||
this.startNode();this.nextToken();return this.parseTopLevel(a)};return a}();f.Parser=a},{"./identifier":2,"./options":8,"./tokentype":14,"./whitespace":16}],11:[function(a,l,f){var c=a("./tokentype");l=a("./state");var g=a("./whitespace"),b=a("./identifier");a=l.Parser.prototype;a.parseTopLevel=function(a){var b=!0;a.body||(a.body=[]);for(;this.type!==c.types.eof;){var e=this.parseStatement(!0,!0);a.body.push(e);b&&(this.isUseStrict(e)&&this.setStrict(!0),b=!1)}this.next();6<=this.options.ecmaVersion&&
(a.sourceType=this.options.sourceType);return this.finishNode(a,"Program")};var d={kind:"loop"},h={kind:"switch"};a.isLet=function(){if(this.type!==c.types.name||6>this.options.ecmaVersion||"let"!=this.value)return!1;g.skipWhiteSpace.lastIndex=this.pos;var a=g.skipWhiteSpace.exec(this.input),a=this.pos+a[0].length,d=this.input.charCodeAt(a);if(91===d||123==d)return!0;if(b.isIdentifierStart(d,!0)){for(d=a+1;b.isIdentifierChar(this.input.charCodeAt(d,!0));++d);a=this.input.slice(a,d);if(!this.isKeyword(a))return!0}return!1};
a.parseStatement=function(a,b){var e=this.type,d=this.startNode(),k=void 0;this.isLet()&&(e=c.types._var,k="let");switch(e){case c.types._break:case c.types._continue:return this.parseBreakContinueStatement(d,e.keyword);case c.types._debugger:return this.parseDebuggerStatement(d);case c.types._do:return this.parseDoStatement(d);case c.types._for:return this.parseForStatement(d);case c.types._function:return!a&&6<=this.options.ecmaVersion&&this.unexpected(),this.parseFunctionStatement(d);case c.types._class:return a||
this.unexpected(),this.parseClass(d,!0);case c.types._if:return this.parseIfStatement(d);case c.types._return:return this.parseReturnStatement(d);case c.types._switch:return this.parseSwitchStatement(d);case c.types._throw:return this.parseThrowStatement(d);case c.types._try:return this.parseTryStatement(d);case c.types._const:case c.types._var:return k=k||this.value,a||"var"==k||this.unexpected(),this.parseVarStatement(d,k);case c.types._while:return this.parseWhileStatement(d);case c.types._with:return this.parseWithStatement(d);
case c.types.braceL:return this.parseBlock();case c.types.semi:return this.parseEmptyStatement(d);case c.types._export:case c.types._import:return this.options.allowImportExportEverywhere||(b||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),e===c.types._import?this.parseImport(d):this.parseExport(d);default:var k=this.value,m=this.parseExpression();return e===c.types.name&&
"Identifier"===m.type&&this.eat(c.types.colon)?this.parseLabeledStatement(d,k,m):this.parseExpressionStatement(d,m)}};a.parseBreakContinueStatement=function(a,b){var e="break"==b;this.next();this.eat(c.types.semi)||this.insertSemicolon()?a.label=null:this.type!==c.types.name?this.unexpected():(a.label=this.parseIdent(),this.semicolon());for(var d=0;d<this.labels.length;++d){var k=this.labels[d];if(null==a.label||k.name===a.label.name){if(null!=k.kind&&(e||"loop"===k.kind))break;if(a.label&&e)break}}d===
this.labels.length&&this.raise(a.start,"Unsyntactic "+b);return this.finishNode(a,e?"BreakStatement":"ContinueStatement")};a.parseDebuggerStatement=function(a){this.next();this.semicolon();return this.finishNode(a,"DebuggerStatement")};a.parseDoStatement=function(a){this.next();this.labels.push(d);a.body=this.parseStatement(!1);this.labels.pop();this.expect(c.types._while);a.test=this.parseParenExpression();6<=this.options.ecmaVersion?this.eat(c.types.semi):this.semicolon();return this.finishNode(a,
"DoWhileStatement")};a.parseForStatement=function(a){this.next();this.labels.push(d);this.expect(c.types.parenL);if(this.type===c.types.semi)return this.parseFor(a,null);var b=this.isLet();if(this.type===c.types._var||this.type===c.types._const||b){var e=this.startNode(),b=b?"let":this.value;this.next();this.parseVar(e,!0,b);this.finishNode(e,"VariableDeclaration");return!(this.type===c.types._in||6<=this.options.ecmaVersion&&this.isContextual("of"))||1!==e.declarations.length||"var"!==b&&e.declarations[0].init?
this.parseFor(a,e):this.parseForIn(a,e)}e={shorthandAssign:0,trailingComma:0};b=this.parseExpression(!0,e);if(this.type===c.types._in||6<=this.options.ecmaVersion&&this.isContextual("of"))return this.checkPatternErrors(e,!0),this.toAssignable(b),this.checkLVal(b),this.parseForIn(a,b);this.checkExpressionErrors(e,!0);return this.parseFor(a,b)};a.parseFunctionStatement=function(a){this.next();return this.parseFunction(a,!0)};a.parseIfStatement=function(a){this.next();a.test=this.parseParenExpression();
a.consequent=this.parseStatement(!1);a.alternate=this.eat(c.types._else)?this.parseStatement(!1):null;return this.finishNode(a,"IfStatement")};a.parseReturnStatement=function(a){this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function");this.next();this.eat(c.types.semi)||this.insertSemicolon()?a.argument=null:(a.argument=this.parseExpression(),this.semicolon());return this.finishNode(a,"ReturnStatement")};a.parseSwitchStatement=function(a){this.next();
a.discriminant=this.parseParenExpression();a.cases=[];this.expect(c.types.braceL);this.labels.push(h);for(var b,e=!1;this.type!=c.types.braceR;)if(this.type===c.types._case||this.type===c.types._default){var d=this.type===c.types._case;b&&this.finishNode(b,"SwitchCase");a.cases.push(b=this.startNode());b.consequent=[];this.next();d?b.test=this.parseExpression():(e&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),e=!0,b.test=null);this.expect(c.types.colon)}else b||this.unexpected(),
b.consequent.push(this.parseStatement(!0));b&&this.finishNode(b,"SwitchCase");this.next();this.labels.pop();return this.finishNode(a,"SwitchStatement")};a.parseThrowStatement=function(a){this.next();g.lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw");a.argument=this.parseExpression();this.semicolon();return this.finishNode(a,"ThrowStatement")};var n=[];a.parseTryStatement=function(a){this.next();a.block=this.parseBlock();a.handler=
null;if(this.type===c.types._catch){var b=this.startNode();this.next();this.expect(c.types.parenL);b.param=this.parseBindingAtom();this.checkLVal(b.param,!0);this.expect(c.types.parenR);b.body=this.parseBlock();a.handler=this.finishNode(b,"CatchClause")}a.finalizer=this.eat(c.types._finally)?this.parseBlock():null;a.handler||a.finalizer||this.raise(a.start,"Missing catch or finally clause");return this.finishNode(a,"TryStatement")};a.parseVarStatement=function(a,b){this.next();this.parseVar(a,!1,
b);this.semicolon();return this.finishNode(a,"VariableDeclaration")};a.parseWhileStatement=function(a){this.next();a.test=this.parseParenExpression();this.labels.push(d);a.body=this.parseStatement(!1);this.labels.pop();return this.finishNode(a,"WhileStatement")};a.parseWithStatement=function(a){this.strict&&this.raise(this.start,"'with' in strict mode");this.next();a.object=this.parseParenExpression();a.body=this.parseStatement(!1);return this.finishNode(a,"WithStatement")};a.parseEmptyStatement=
function(a){this.next();return this.finishNode(a,"EmptyStatement")};a.parseLabeledStatement=function(a,b,d){for(var e=0;e<this.labels.length;++e)this.labels[e].name===b&&this.raise(d.start,"Label '"+b+"' is already declared");for(var k=this.type.isLoop?"loop":this.type===c.types._switch?"switch":null,e=this.labels.length-1;0<=e;e--){var q=this.labels[e];if(q.statementStart==a.start)q.statementStart=this.start,q.kind=k;else break}this.labels.push({name:b,kind:k,statementStart:this.start});a.body=this.parseStatement(!0);
this.labels.pop();a.label=d;return this.finishNode(a,"LabeledStatement")};a.parseExpressionStatement=function(a,b){a.expression=b;this.semicolon();return this.finishNode(a,"ExpressionStatement")};a.parseBlock=function(a){var b=this.startNode(),e=!0,d=void 0;b.body=[];for(this.expect(c.types.braceL);!this.eat(c.types.braceR);){var k=this.parseStatement(!0);b.body.push(k);e&&a&&this.isUseStrict(k)&&(d=this.strict,this.setStrict(this.strict=!0));e=!1}!1===d&&this.setStrict(!1);return this.finishNode(b,
"BlockStatement")};a.parseFor=function(a,b){a.init=b;this.expect(c.types.semi);a.test=this.type===c.types.semi?null:this.parseExpression();this.expect(c.types.semi);a.update=this.type===c.types.parenR?null:this.parseExpression();this.expect(c.types.parenR);a.body=this.parseStatement(!1);this.labels.pop();return this.finishNode(a,"ForStatement")};a.parseForIn=function(a,b){var e=this.type===c.types._in?"ForInStatement":"ForOfStatement";this.next();a.left=b;a.right=this.parseExpression();this.expect(c.types.parenR);
a.body=this.parseStatement(!1);this.labels.pop();return this.finishNode(a,e)};a.parseVar=function(a,b,d){a.declarations=[];for(a.kind=d;;){var e=this.startNode();this.parseVarId(e);this.eat(c.types.eq)?e.init=this.parseMaybeAssign(b):"const"!==d||this.type===c.types._in||6<=this.options.ecmaVersion&&this.isContextual("of")?"Identifier"==e.id.type||b&&(this.type===c.types._in||this.isContextual("of"))?e.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):
this.unexpected();a.declarations.push(this.finishNode(e,"VariableDeclarator"));if(!this.eat(c.types.comma))break}return a};a.parseVarId=function(a){a.id=this.parseBindingAtom();this.checkLVal(a.id,!0)};a.parseFunction=function(a,b,d){this.initFunction(a);6<=this.options.ecmaVersion&&(a.generator=this.eat(c.types.star));var e=this.inGenerator;this.inGenerator=a.generator;if(b||this.type===c.types.name)a.id=this.parseIdent();this.parseFunctionParams(a);this.parseFunctionBody(a,d);this.inGenerator=e;
return this.finishNode(a,b?"FunctionDeclaration":"FunctionExpression")};a.parseFunctionParams=function(a){this.expect(c.types.parenL);a.params=this.parseBindingList(c.types.parenR,!1,!1,!0)};a.parseClass=function(a,b){this.next();this.parseClassId(a,b);this.parseClassSuper(a);var e=this.startNode(),d=!1;e.body=[];for(this.expect(c.types.braceL);!this.eat(c.types.braceR);)if(!this.eat(c.types.semi)){var k=this.startNode(),q=this.eat(c.types.star),h=this.type===c.types.name&&"static"===this.value;this.parsePropertyName(k);
k["static"]=h&&this.type!==c.types.parenL;k["static"]&&(q&&this.unexpected(),q=this.eat(c.types.star),this.parsePropertyName(k));k.kind="method";h=!1;if(!k.computed){var f=k.key;q||"Identifier"!==f.type||this.type===c.types.parenL||"get"!==f.name&&"set"!==f.name||(h=!0,k.kind=f.name,f=this.parsePropertyName(k));!k["static"]&&("Identifier"===f.type&&"constructor"===f.name||"Literal"===f.type&&"constructor"===f.value)&&(d&&this.raise(f.start,"Duplicate constructor in the same class"),h&&this.raise(f.start,
"Constructor can't have get/set modifier"),q&&this.raise(f.start,"Constructor can't be a generator"),k.kind="constructor",d=!0)}this.parseClassMethod(e,k,q);h&&(k.value.params.length!==("get"===k.kind?0:1)&&(q=k.value.start,"get"===k.kind?this.raiseRecoverable(q,"getter should have no params"):this.raiseRecoverable(q,"setter should have exactly one param")),"set"===k.kind&&"RestElement"===k.value.params[0].type&&this.raise(k.value.params[0].start,"Setter cannot use rest params"))}a.body=this.finishNode(e,
"ClassBody");return this.finishNode(a,b?"ClassDeclaration":"ClassExpression")};a.parseClassMethod=function(a,b,c){b.value=this.parseMethod(c);a.body.push(this.finishNode(b,"MethodDefinition"))};a.parseClassId=function(a,b){a.id=this.type===c.types.name?this.parseIdent():b?this.unexpected():null};a.parseClassSuper=function(a){a.superClass=this.eat(c.types._extends)?this.parseExprSubscripts():null};a.parseExport=function(a){this.next();if(this.eat(c.types.star))return this.expectContextual("from"),
a.source=this.type===c.types.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(a,"ExportAllDeclaration");if(this.eat(c.types._default)){var b=this.type==c.types.parenL,e=this.parseMaybeAssign(),d=!0;b||"FunctionExpression"!=e.type&&"ClassExpression"!=e.type||(d=!1,e.id&&(e.type="FunctionExpression"==e.type?"FunctionDeclaration":"ClassDeclaration"));a.declaration=e;d&&this.semicolon();return this.finishNode(a,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())a.declaration=
this.parseStatement(!0),a.specifiers=[],a.source=null;else{a.declaration=null;a.specifiers=this.parseExportSpecifiers();if(this.eatContextual("from"))a.source=this.type===c.types.string?this.parseExprAtom():this.unexpected();else{for(b=0;b<a.specifiers.length;b++)(this.keywords.test(a.specifiers[b].local.name)||this.reservedWords.test(a.specifiers[b].local.name))&&this.unexpected(a.specifiers[b].local.start);a.source=null}this.semicolon()}return this.finishNode(a,"ExportNamedDeclaration")};a.shouldParseExportStatement=
function(){return this.type.keyword||this.isLet()};a.parseExportSpecifiers=function(){var a=[],b=!0;for(this.expect(c.types.braceL);!this.eat(c.types.braceR);){if(b)b=!1;else if(this.expect(c.types.comma),this.afterTrailingComma(c.types.braceR))break;var d=this.startNode();d.local=this.parseIdent(this.type===c.types._default);d.exported=this.eatContextual("as")?this.parseIdent(!0):d.local;a.push(this.finishNode(d,"ExportSpecifier"))}return a};a.parseImport=function(a){this.next();this.type===c.types.string?
(a.specifiers=n,a.source=this.parseExprAtom()):(a.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),a.source=this.type===c.types.string?this.parseExprAtom():this.unexpected());this.semicolon();return this.finishNode(a,"ImportDeclaration")};a.parseImportSpecifiers=function(){var a=[],b=!0;if(this.type===c.types.name){var d=this.startNode();d.local=this.parseIdent();this.checkLVal(d.local,!0);a.push(this.finishNode(d,"ImportDefaultSpecifier"));if(!this.eat(c.types.comma))return a}if(this.type===
c.types.star)return d=this.startNode(),this.next(),this.expectContextual("as"),d.local=this.parseIdent(),this.checkLVal(d.local,!0),a.push(this.finishNode(d,"ImportNamespaceSpecifier")),a;for(this.expect(c.types.braceL);!this.eat(c.types.braceR);){if(b)b=!1;else if(this.expect(c.types.comma),this.afterTrailingComma(c.types.braceR))break;d=this.startNode();d.imported=this.parseIdent(!0);this.eatContextual("as")?d.local=this.parseIdent():(d.local=d.imported,this.isKeyword(d.local.name)&&this.unexpected(d.local.start),
this.reservedWordsStrict.test(d.local.name)&&this.raise(d.local.start,"The keyword '"+d.local.name+"' is reserved"));this.checkLVal(d.local,!0);a.push(this.finishNode(d,"ImportSpecifier"))}return a}},{"./identifier":2,"./state":10,"./tokentype":14,"./whitespace":16}],12:[function(a,l,f){f.__esModule=!0;l=a("./state");var c=a("./tokentype"),g=a("./whitespace");a=function h(a,b,c,f){if(!(this instanceof h))throw new TypeError("Cannot call a class as a function");this.token=a;this.isExpr=!!b;this.preserveSpace=
!!c;this.override=f};f.TokContext=a;var b={b_stat:new a("{",!1),b_expr:new a("{",!0),b_tmpl:new a("${",!0),p_stat:new a("(",!1),p_expr:new a("(",!0),q_tmpl:new a("`",!0,!0,function(a){return a.readTmplToken()}),f_expr:new a("function",!0)};f.types=b;f=l.Parser.prototype;f.initialContext=function(){return[b.b_stat]};f.braceIsBlock=function(a){if(a===c.types.colon){var f=this.curContext();if(f===b.b_stat||f===b.b_expr)return!f.isExpr}return a===c.types._return?g.lineBreak.test(this.input.slice(this.lastTokEnd,
this.start)):a===c.types._else||a===c.types.semi||a===c.types.eof||a===c.types.parenR?!0:a==c.types.braceL?this.curContext()===b.b_stat:!this.exprAllowed};f.updateContext=function(a){var b,e=this.type;e.keyword&&a==c.types.dot?this.exprAllowed=!1:(b=e.updateContext)?b.call(this,a):this.exprAllowed=e.beforeExpr};c.types.parenR.updateContext=c.types.braceR.updateContext=function(){if(1==this.context.length)this.exprAllowed=!0;else{var a=this.context.pop();a===b.b_stat&&this.curContext()===b.f_expr?
(this.context.pop(),this.exprAllowed=!1):this.exprAllowed=a===b.b_tmpl?!0:!a.isExpr}};c.types.braceL.updateContext=function(a){this.context.push(this.braceIsBlock(a)?b.b_stat:b.b_expr);this.exprAllowed=!0};c.types.dollarBraceL.updateContext=function(){this.context.push(b.b_tmpl);this.exprAllowed=!0};c.types.parenL.updateContext=function(a){this.context.push(a===c.types._if||a===c.types._for||a===c.types._with||a===c.types._while?b.p_stat:b.p_expr);this.exprAllowed=!0};c.types.incDec.updateContext=
function(){};c.types._function.updateContext=function(a){!a.beforeExpr||a===c.types.semi||a===c.types._else||a===c.types.colon&&this.curContext()===b.b_stat||this.context.push(b.f_expr);this.exprAllowed=!1};c.types.backQuote.updateContext=function(){this.curContext()===b.q_tmpl?this.context.pop():this.context.push(b.q_tmpl);this.exprAllowed=!1}},{"./state":10,"./tokentype":14,"./whitespace":16}],13:[function(a,l,f){function c(a,b,c,d){try{return new RegExp(a,b)}catch(t){if(void 0!==c)throw t instanceof
SyntaxError&&d.raise(c,"Error parsing regular expression: "+t.message),t;}}function g(a){if(65535>=a)return String.fromCharCode(a);a-=65536;return String.fromCharCode((a>>10)+55296,(a&1023)+56320)}f.__esModule=!0;var b=a("./identifier"),d=a("./tokentype");l=a("./state");var h=a("./locutil"),n=a("./whitespace"),e=function k(a){if(!(this instanceof k))throw new TypeError("Cannot call a class as a function");this.type=a.type;this.value=a.value;this.start=a.start;this.end=a.end;a.options.locations&&(this.loc=
new h.SourceLocation(a,a.startLoc,a.endLoc));a.options.ranges&&(this.range=[a.start,a.end])};f.Token=e;a=l.Parser.prototype;var m="object"==typeof Packages&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);a.next=function(){if(this.options.onToken)this.options.onToken(new e(this));this.lastTokEnd=this.end;this.lastTokStart=this.start;this.lastTokEndLoc=this.endLoc;this.lastTokStartLoc=this.startLoc;this.nextToken()};a.getToken=function(){this.next();return new e(this)};"undefined"!==
typeof Symbol&&(a[Symbol.iterator]=function(){var a=this;return{next:function(){var b=a.getToken();return{done:b.type===d.types.eof,value:b}}}});a.setStrict=function(a){this.strict=a;if(this.type===d.types.num||this.type===d.types.string){this.pos=this.start;if(this.options.locations)for(;this.pos<this.lineStart;)this.lineStart=this.input.lastIndexOf("\n",this.lineStart-2)+1,--this.curLine;this.nextToken()}};a.curContext=function(){return this.context[this.context.length-1]};a.nextToken=function(){var a=
this.curContext();a&&a.preserveSpace||this.skipSpace();this.start=this.pos;this.options.locations&&(this.startLoc=this.curPosition());if(this.pos>=this.input.length)return this.finishToken(d.types.eof);if(a.override)return a.override(this);this.readToken(this.fullCharCodeAtPos())};a.readToken=function(a){return b.isIdentifierStart(a,6<=this.options.ecmaVersion)||92===a?this.readWord():this.getTokenFromCode(a)};a.fullCharCodeAtPos=function(){var a=this.input.charCodeAt(this.pos);if(55295>=a||57344<=
a)return a;var b=this.input.charCodeAt(this.pos+1);return(a<<10)+b-56613888};a.skipBlockComment=function(){var a=this.options.onComment&&this.curPosition(),b=this.pos,c=this.input.indexOf("*/",this.pos+=2);-1===c&&this.raise(this.pos-2,"Unterminated comment");this.pos=c+2;if(this.options.locations){n.lineBreakG.lastIndex=b;for(var d=void 0;(d=n.lineBreakG.exec(this.input))&&d.index<this.pos;)++this.curLine,this.lineStart=d.index+d[0].length}if(this.options.onComment)this.options.onComment(!0,this.input.slice(b+
2,c),b,this.pos,a,this.curPosition())};a.skipLineComment=function(a){for(var b=this.pos,c=this.options.onComment&&this.curPosition(),d=this.input.charCodeAt(this.pos+=a);this.pos<this.input.length&&10!==d&&13!==d&&8232!==d&&8233!==d;)++this.pos,d=this.input.charCodeAt(this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(b+a,this.pos),b,this.pos,c,this.curPosition())};a.skipSpace=function(){a:for(;this.pos<this.input.length;){var a=this.input.charCodeAt(this.pos);switch(a){case 32:case 160:++this.pos;
break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos;this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break a}break;default:if(8<a&&14>a||5760<=a&&n.nonASCIIwhitespace.test(String.fromCharCode(a)))++this.pos;else break a}}};a.finishToken=function(a,b){this.end=this.pos;this.options.locations&&
(this.endLoc=this.curPosition());var c=this.type;this.type=a;this.value=b;this.updateContext(c)};a.readToken_dot=function(){var a=this.input.charCodeAt(this.pos+1);if(48<=a&&57>=a)return this.readNumber(!0);var b=this.input.charCodeAt(this.pos+2);if(6<=this.options.ecmaVersion&&46===a&&46===b)return this.pos+=3,this.finishToken(d.types.ellipsis);++this.pos;return this.finishToken(d.types.dot)};a.readToken_slash=function(){var a=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,
this.readRegexp()):61===a?this.finishOp(d.types.assign,2):this.finishOp(d.types.slash,1)};a.readToken_mult_modulo_exp=function(a){var b=this.input.charCodeAt(this.pos+1),c=1;a=42===a?d.types.star:d.types.modulo;7<=this.options.ecmaVersion&&42===b&&(++c,a=d.types.starstar,b=this.input.charCodeAt(this.pos+2));return 61===b?this.finishOp(d.types.assign,c+1):this.finishOp(a,c)};a.readToken_pipe_amp=function(a){var b=this.input.charCodeAt(this.pos+1);return b===a?this.finishOp(124===a?d.types.logicalOR:
d.types.logicalAND,2):61===b?this.finishOp(d.types.assign,2):this.finishOp(124===a?d.types.bitwiseOR:d.types.bitwiseAND,1)};a.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(d.types.assign,2):this.finishOp(d.types.bitwiseXOR,1)};a.readToken_plus_min=function(a){var b=this.input.charCodeAt(this.pos+1);return b===a?45==b&&62==this.input.charCodeAt(this.pos+2)&&n.lineBreak.test(this.input.slice(this.lastTokEnd,this.pos))?(this.skipLineComment(3),this.skipSpace(),
this.nextToken()):this.finishOp(d.types.incDec,2):61===b?this.finishOp(d.types.assign,2):this.finishOp(d.types.plusMin,1)};a.readToken_lt_gt=function(a){var b=this.input.charCodeAt(this.pos+1),c=1;if(b===a)return c=62===a&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+c)?this.finishOp(d.types.assign,c+1):this.finishOp(d.types.bitShift,c);if(33==b&&60==a&&45==this.input.charCodeAt(this.pos+2)&&45==this.input.charCodeAt(this.pos+3))return this.inModule&&this.unexpected(),
this.skipLineComment(4),this.skipSpace(),this.nextToken();61===b&&(c=2);return this.finishOp(d.types.relational,c)};a.readToken_eq_excl=function(a){var b=this.input.charCodeAt(this.pos+1);return 61===b?this.finishOp(d.types.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===a&&62===b&&6<=this.options.ecmaVersion?(this.pos+=2,this.finishToken(d.types.arrow)):this.finishOp(61===a?d.types.eq:d.types.prefix,1)};a.getTokenFromCode=function(a){switch(a){case 46:return this.readToken_dot();case 40:return++this.pos,
this.finishToken(d.types.parenL);case 41:return++this.pos,this.finishToken(d.types.parenR);case 59:return++this.pos,this.finishToken(d.types.semi);case 44:return++this.pos,this.finishToken(d.types.comma);case 91:return++this.pos,this.finishToken(d.types.bracketL);case 93:return++this.pos,this.finishToken(d.types.bracketR);case 123:return++this.pos,this.finishToken(d.types.braceL);case 125:return++this.pos,this.finishToken(d.types.braceR);case 58:return++this.pos,this.finishToken(d.types.colon);case 63:return++this.pos,
this.finishToken(d.types.question);case 96:if(6>this.options.ecmaVersion)break;++this.pos;return this.finishToken(d.types.backQuote);case 48:a=this.input.charCodeAt(this.pos+1);if(120===a||88===a)return this.readRadixNumber(16);if(6<=this.options.ecmaVersion){if(111===a||79===a)return this.readRadixNumber(8);if(98===a||66===a)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(a);case 47:return this.readToken_slash();
case 37:case 42:return this.readToken_mult_modulo_exp(a);case 124:case 38:return this.readToken_pipe_amp(a);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(a);case 60:case 62:return this.readToken_lt_gt(a);case 61:case 33:return this.readToken_eq_excl(a);case 126:return this.finishOp(d.types.prefix,1)}this.raise(this.pos,"Unexpected character '"+g(a)+"'")};a.finishOp=function(a,b){var c=this.input.slice(this.pos,this.pos+b);this.pos+=b;return this.finishToken(a,
c)};var p=!!c("\uffff","u");a.readRegexp=function(){for(var a=this,b=void 0,e=void 0,f=this.pos;;){this.pos>=this.input.length&&this.raise(f,"Unterminated regular expression");var g=this.input.charAt(this.pos);n.lineBreak.test(g)&&this.raise(f,"Unterminated regular expression");if(b)b=!1;else{if("["===g)e=!0;else if("]"===g&&e)e=!1;else if("/"===g&&!e)break;b="\\"===g}++this.pos}b=this.input.slice(f,this.pos);++this.pos;e=this.readWord1();g=b;if(e){var h=/^[gim]*$/;6<=this.options.ecmaVersion&&(h=
/^[gimuy]*$/);h.test(e)||this.raise(f,"Invalid regular expression flag");0<=e.indexOf("u")&&!p&&(g=g.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(b,c,d){c=Number("0x"+c);1114111<c&&a.raise(f+d+3,"Code point out of bounds");return"x"}),g=g.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"))}h=null;m||(c(g,void 0,f,this),h=c(b,e));return this.finishToken(d.types.regexp,{pattern:b,flags:e,value:h})};a.readInt=function(a,b){for(var c=this.pos,d=0,e=0,f=null==b?Infinity:b;e<f;++e){var k=this.input.charCodeAt(this.pos),
k=97<=k?k-97+10:65<=k?k-65+10:48<=k&&57>=k?k-48:Infinity;if(k>=a)break;++this.pos;d=d*a+k}return this.pos===c||null!=b&&this.pos-c!==b?null:d};a.readRadixNumber=function(a){this.pos+=2;var c=this.readInt(a);null==c&&this.raise(this.start+2,"Expected number in radix "+a);b.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");return this.finishToken(d.types.num,c)};a.readNumber=function(a){var c=this.pos,e=!1,f=48===this.input.charCodeAt(this.pos);a||
null!==this.readInt(10)||this.raise(c,"Invalid number");a=this.input.charCodeAt(this.pos);46===a&&(++this.pos,this.readInt(10),e=!0,a=this.input.charCodeAt(this.pos));if(69===a||101===a)a=this.input.charCodeAt(++this.pos),43!==a&&45!==a||++this.pos,null===this.readInt(10)&&this.raise(c,"Invalid number"),e=!0;b.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");a=this.input.slice(c,this.pos);var k=void 0;e?k=parseFloat(a):f&&1!==a.length?/[89]/.test(a)||
this.strict?this.raise(c,"Invalid number"):k=parseInt(a,8):k=parseInt(a,10);return this.finishToken(d.types.num,k)};a.readCodePoint=function(){if(123===this.input.charCodeAt(this.pos)){6>this.options.ecmaVersion&&this.unexpected();var a=++this.pos;var b=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos;1114111<b&&this.raise(a,"Code point out of bounds")}else b=this.readHexChar(4);return b};a.readString=function(a){for(var b="",c=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,
"Unterminated string constant");var e=this.input.charCodeAt(this.pos);if(e===a)break;92===e?(b+=this.input.slice(c,this.pos),b+=this.readEscapedChar(!1),c=this.pos):(n.isNewLine(e)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}b+=this.input.slice(c,this.pos++);return this.finishToken(d.types.string,b)};a.readTmplToken=function(){for(var a="",b=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var c=this.input.charCodeAt(this.pos);if(96===
c||36===c&&123===this.input.charCodeAt(this.pos+1)){if(this.pos===this.start&&this.type===d.types.template){if(36===c)return this.pos+=2,this.finishToken(d.types.dollarBraceL);++this.pos;return this.finishToken(d.types.backQuote)}a+=this.input.slice(b,this.pos);return this.finishToken(d.types.template,a)}if(92===c)a+=this.input.slice(b,this.pos),a+=this.readEscapedChar(!0),b=this.pos;else if(n.isNewLine(c)){a+=this.input.slice(b,this.pos);++this.pos;switch(c){case 13:10===this.input.charCodeAt(this.pos)&&
++this.pos;case 10:a+="\n";break;default:a+=String.fromCharCode(c)}this.options.locations&&(++this.curLine,this.lineStart=this.pos);b=this.pos}else++this.pos}};a.readEscapedChar=function(a){var b=this.input.charCodeAt(++this.pos);++this.pos;switch(b){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return g(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\x0B";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&
++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(48<=b&&55>=b){var b=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],c=parseInt(b,8);255<c&&(b=b.slice(0,-1),c=parseInt(b,8));"0"!==b&&(this.strict||a)&&this.raise(this.pos-2,"Octal literal in strict mode");this.pos+=b.length-1;return String.fromCharCode(c)}return String.fromCharCode(b)}};a.readHexChar=function(a){var b=this.pos;a=this.readInt(16,a);null===a&&this.raise(b,"Bad character escape sequence");
return a};a.readWord1=function(){this.containsEsc=!1;for(var a="",c=!0,d=this.pos,e=6<=this.options.ecmaVersion;this.pos<this.input.length;){var f=this.fullCharCodeAtPos();if(b.isIdentifierChar(f,e))this.pos+=65535>=f?1:2;else if(92===f)this.containsEsc=!0,a+=this.input.slice(d,this.pos),d=this.pos,117!=this.input.charCodeAt(++this.pos)&&this.raise(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos,f=this.readCodePoint(),(c?b.isIdentifierStart:b.isIdentifierChar)(f,e)||this.raise(d,
"Invalid Unicode escape"),a+=g(f),d=this.pos;else break;c=!1}return a+this.input.slice(d,this.pos)};a.readWord=function(){var a=this.readWord1(),b=d.types.name;(6<=this.options.ecmaVersion||!this.containsEsc)&&this.keywords.test(a)&&(b=d.keywords[a]);return this.finishToken(b,a)}},{"./identifier":2,"./locutil":5,"./state":10,"./tokentype":14,"./whitespace":16}],14:[function(a,l,f){function c(a,c){return new b(a,{beforeExpr:!0,binop:c})}function g(a){var c=1>=arguments.length||void 0===arguments[1]?
{}:arguments[1];c.keyword=a;h[a]=d["_"+a]=new b(a,c)}f.__esModule=!0;var b=function e(a){var b=1>=arguments.length||void 0===arguments[1]?{}:arguments[1];if(!(this instanceof e))throw new TypeError("Cannot call a class as a function");this.label=a;this.keyword=b.keyword;this.beforeExpr=!!b.beforeExpr;this.startsExpr=!!b.startsExpr;this.isLoop=!!b.isLoop;this.isAssign=!!b.isAssign;this.prefix=!!b.prefix;this.postfix=!!b.postfix;this.binop=b.binop||null;this.updateContext=null};f.TokenType=b;a={beforeExpr:!0};
l={startsExpr:!0};var d={num:new b("num",l),regexp:new b("regexp",l),string:new b("string",l),name:new b("name",l),eof:new b("eof"),bracketL:new b("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new b("]"),braceL:new b("{",{beforeExpr:!0,startsExpr:!0}),braceR:new b("}"),parenL:new b("(",{beforeExpr:!0,startsExpr:!0}),parenR:new b(")"),comma:new b(",",a),semi:new b(";",a),colon:new b(":",a),dot:new b("."),question:new b("?",a),arrow:new b("=>",a),template:new b("template"),ellipsis:new b("...",a),backQuote:new b("`",
l),dollarBraceL:new b("${",{beforeExpr:!0,startsExpr:!0}),eq:new b("=",{beforeExpr:!0,isAssign:!0}),assign:new b("_=",{beforeExpr:!0,isAssign:!0}),incDec:new b("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new b("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:c("||",1),logicalAND:c("&&",2),bitwiseOR:c("|",3),bitwiseXOR:c("^",4),bitwiseAND:c("&",5),equality:c("==/!=",6),relational:c("</>",7),bitShift:c("<</>>",8),plusMin:new b("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),
modulo:c("%",10),star:c("*",10),slash:c("/",10),starstar:new b("**",{beforeExpr:!0})};f.types=d;var h={};f.keywords=h;g("break");g("case",a);g("catch");g("continue");g("debugger");g("default",a);g("do",{isLoop:!0,beforeExpr:!0});g("else",a);g("finally");g("for",{isLoop:!0});g("function",l);g("if");g("return",a);g("switch");g("throw",a);g("try");g("var");g("const");g("while",{isLoop:!0});g("with");g("new",{beforeExpr:!0,startsExpr:!0});g("this",l);g("super",l);g("class");g("extends",a);g("export");
g("import");g("null",l);g("true",l);g("false",l);g("in",{beforeExpr:!0,binop:7});g("instanceof",{beforeExpr:!0,binop:7});g("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0});g("void",{beforeExpr:!0,prefix:!0,startsExpr:!0});g("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},{}],15:[function(a,l,f){f.__esModule=!0;f.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};f.has=function(a,f){return Object.prototype.hasOwnProperty.call(a,f)}},{}],16:[function(a,l,f){f.__esModule=
!0;f.isNewLine=function(a){return 10===a||13===a||8232===a||8233==a};a=/\r\n?|\n|\u2028|\u2029/;f.lineBreak=a;f.lineBreakG=new RegExp(a.source,"g");f.nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;f.skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g},{}]},{},[3])(3)});
var CR3Parser=(()=>{const t=(t,e)=>{const n=(t.buf[t.pos>>3]<<24+(7&t.pos)|t.buf[t.pos+8>>3]<<16+(7&t.pos)|t.buf[t.pos+16>>3]<<8+(7&t.pos)|t.buf[t.pos+24>>3]<<(7&t.pos))>>>32-e;return t.pos+=e,n},e=t=>t.buf[t.pos>>3]>>7-(7&t.pos++)&1,n=(e,n,a)=>{let i=e.pos,s=e.buf[e.pos>>3]<<24+(7&e.pos)>>>24;if(!s)for(e.pos+=8-(7&e.pos);!(s=e.buf[e.pos>>3]);e.pos+=8);e.pos+=Math.clz32(s)-23;const r=e.pos-i-1;return r>=n?t(e,a):e.k?r<<e.k|t(e,e.k):r},a=(t,e,n)=>{let a=t;return e>>>t>2&&++a,e>>>t>5&&++a,e<1<<t>>>1&&--a,Math.min(a,n)},i=t=>-(1&t)^t>>>1,s=new Uint8Array([40,45,51,57,64,72]),r=t=>t>=36?s[t%6]<<Math.floor(t/6)-6:s[t%6]>>6-Math.floor(t/6),o=(t,e)=>{if(!t.qp)return[];const s={buf:e.subarray(t.offset),pos:0,k:0,s:0},o=(t.planeWidth>>3)+ +(!0&t.planeWidth),l=(t.planeHeight>>1)+(1&t.planeHeight),f=new Int32Array(l*o);let h=0;for(let t=0;t<o;++t){const e=n(s,23,8);s.k=a(s.k,e,7),f[t]=h+=i(e)}let p=0,c=0,u=0;for(let t=1;t<l;++t){const e=t*o,r=e-o+1;let l=h=p=f[e-o],g=p-c;for(let t=0;t<o-1;++t){u=f[r+t];const o=g<0==c<h?h+g:g<0==h<p?h:p,l=n(s,23,8);g=u-p,c=p,p=u,s.k=a(s.k,l+(Math.abs(g)<<1)>>>1,7),f[e+t]=h=o+i(l)}const b=g<0==c<h?h+g:g<0==h<p?h:p,d=n(s,23,8);s.k=a(s.k,d,7),f[e+o-1]=b+i(d),c=l}const g=(t.planeHeight>>3)+ +(!0&t.planeHeight),b=(t.planeHeight>>2)+ +(!0&t.planeHeight),d=(l-1)*o,w=[];switch(t.wavelets){case 3:{const e=new Int32Array(g*o);for(let n=0;n<t.planeHeight>>3;++n){const t=n*o,a=(n<<2)*o,i=a+o,s=i+o,l=s+o;for(let n=0;n<o;++n){const o=f[a+n]+f[i+n]+f[s+n]+f[l+n]+16;e[t+n]=r(3*+(o<0)+o>>2)}}if(!0&t.planeHeight){const n=(t.planeHeight>>3)*o,a=(-4&l)*o,i=Math.min(a+o,d),s=Math.min(i+o,d),h=d;for(let t=0;t<o;++t){const o=f[a+t]+f[i+t]+f[s+t]+f[h+t]+16;e[n+t]=r(3*+(o<0)+o>>2)}}w.push(e)}case 2:{const e=new Int32Array(b*o);for(let n=0;n<t.planeHeight>>2;++n){const t=n*o,a=(n<<1)*o,i=a+o;for(let n=0;n<o;++n)e[t+n]=r(f[a+n]+f[i+n]+8>>1)}if(!0&t.planeHeight){const n=(t.planeHeight>>2)*o,a=(-2&l)*o,i=d;for(let t=0;t<o;++t)e[n+t]=r(f[a+t]+f[i+t]+8>>1)}w.push(e)}case 1:{const t=l*o;for(let e=0;e<t;++e)f[e]=r(f[e]+4);w.push(f)}}return w},l=new Uint8Array([0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,7,8,9,10,11,12,13,14,15]),f=new Uint16Array(32);for(let t=0;t<32;++t)f[t]=1<<l[t];const h=(n,a)=>{let i=a-1;for(;i&&e(n);)i-=f[n.s],i<0?i=0:n.s<31&&++n.s;return i&&(l[n.s]&&(i-=t(n,l[n.s])),n.s&&--n.s),a-i},p=(t,s,r,o,l,f,p)=>{r[0]=0;let c=1;if(o)if(f)for(;c<l;++c){let s=r[c-1];if(Math.abs(s)<=p){if(e(t)){const e=c+h(t,l-c+1);for(;c<e;++c)r[c]=s;if(c>l)break}s=0}const o=n(t,41,21);t.k=a(t.k,o,15);const u=i(o);r[c]=s+(u<<f)+(u>>31)}else for(;c<l;++c){let s=r[c-1];if(!s&&e(t)){const e=c+h(t,l-c+1);for(;c<e;++c)r[c]=0;if(c>l)break}const o=n(t,41,21);t.k=a(t.k,o,15),r[c]=s+i(o)}else for(;c<l;++c){let o=0;if(!r[c-1]){if(e(t)){const e=c+h(t,l-c+1);for(;c<e;++c)r[c]=s[c-1]=0;if(c>l)break}o=1}const f=n(t,41,21);s[c-1]=t.k=a(t.k,f,15),r[c]=i(f+o)}if(c==l){const e=r[c-1],l=n(t,41,21);s[c-1]=t.k=a(t.k,l,15);const h=i(l);r[c++]=(o&&(!f||Math.abs(e)<=p)?e:0)+(o&&f?(h<<f)+(h>>31):h)}r[c]=o?r[c-1]+1:0},c=(t,s,r,o,l,f,p)=>{let c=1,u=0;if(o)if(f){r[0]=s[1];let o=!1,g=r[0],b=g,d=g,w=0;for(;c<l;++c){w=s[c+1];let m=b;if(Math.abs(w-b)>p&&(o=!0)||(o||Math.abs(d-g)>p)&&!(o=!1)){let t=g,e=b;g>b&&(t=b,e=g),m=d>=e?t:d<=t?e:g+b-d}else{if(e(t)){const e=c+h(t,l-c+1);for(;c<e;++c)r[c]=g;if(c>=l){u=1;break}b=s[c],d=s[c-1],w=s[c+1]}o=Math.abs(w-b)>p}const y=n(t,41,21);t.k=a(t.k,y+(Math.abs(w>b?w-b+p-1>>f:-(w-b+p>>f))<<1)>>>1,15);const v=i(y);g=r[c]=m+(v<<f)+(v>>31),d=b,b=w}}else{r[0]=s[1];let o=r[0],f=o,p=s[0],g=0;for(;c<l;++c){g=s[c+1];let b=0;if(o==f&&o==g){if(e(t)){const e=c+h(t,l-c+1);for(;c<e;++c)r[c]=o;if(c>=l){u=1;break}f=s[c],p=s[c-1],g=s[c+1]}b=f}else{let t=o,e=f;o>f&&(t=f,e=o),b=p>=e?t:p<=t?e:o+f-p}const d=n(t,41,21);t.k=a(t.k,d+Math.abs(g-f<<1)>>>1,15),o=r[c]=b+i(d),p=f,f=g}}else{r[0]=0;let o=0,f=s[1],p=0;for(;c<l;++c){p=s[c+1];let g=0;if(!(p|f|o)){if(e(t)){const e=c+h(t,l-c+1);for(;c<e;++c)r[c]=s[c-1]=0;if(c>=l){u=1;break}f=s[c],p=s[c+1]}g=1}const b=n(t,41,21);let d=a(t.k,b,15);r[c]-d>1&&++d,t.k=s[c-1]=d,o=r[c]=i(b+g),f=p}}if(c==l){let e=0;if(o){let t=e=s[c];if(!u){let n=r[c-1],a=s[c-1],i=n,o=t;n>t&&(i=t,o=n),e=a>=o?i:a<=i?o:n+t-a}}const l=n(t,41,21),h=i(o?l:l+u);s[c-1]=t.k=a(t.k,l,15),r[c++]=e+(o&&f?(h<<f)+(h>>31):h)}o&&(r[c]=r[c-1]+1)},u=(t,e,s,o,l,f,h,p)=>{const c=l.width,u=l.height,g=l.xs,b=l.xe,d=l.ys,w=l.ye,m=p[h];if(l.partial&&!m){const t=n(e,23,8);l.qParam+=i(t),e.k=a(e.k,t,7)}let y=0;if(m){const e=(+(!0&f)+(f>>3))*(o<d?0:o<u-w?o-d:u-d-w-1),n=l.qBase,a=l.qMulti,i=Math.max(Math.min(n+(a*m[e]>>3),1474560),1);for(;y<g;++y)s[y]=i*t[y+1];const r=c-b-1;for(;y<r;++y){const i=n+(a*m[e+(y-g>>h)]>>3);s[y]=Math.max(Math.min(i,1474560),1)*t[y+1]}const p=Math.max(Math.min(n+(a*m[e+(y-g>>h)]>>3)));for(;y<c;++y)s[y]=p*t[y+1]}else{const e=r(l.qParam);for(;y<c;++y)s[y]=t[y+1]*e}},g=(t,e,n,a,i)=>{let s=1,r=0,o=0,l=e[0],f=n[0]=t[0]-(l+(a.left?l=e[o=1]:l)+2>>2);const h=i-2;for(;s<h;s+=2){const a=e[++o],i=t[++r]-(l+a+2>>2);n[s]=l+(i+f>>1),n[s+1]=f=i,l=a}if(a.right||1&i){const o=t[r+1]-(l+(a.right?e[s+1]:l)+2>>2);n[s]=l+(o+f>>1),1&i&&(n[s+1]=o)}else n[s]=l+f},b=(t,e,n,a)=>{const i=(i,s,r)=>{const o=e.bandState[i],l=o.prevLineBuf;o.prevLineBuf=o.lineBuf,o.lineBuf=l,r?c(o.state,o.prevLineBuf,o.lineBuf,o.partial,o.w,o.rb,o.rbm):p(o.state,o.prevLineBuf,o.lineBuf,o.partial,o.w,o.rb,o.rbm),u(o.lineBuf,o.state,s,r,e.plane.bands[i],t.planeWidth,a,n)},s=3*a,r=a<t.wavelets-1?e.plane.bands[s+5].width:t.planeWidth;let o=e.tmpL;a?(b(t,e,n,a-1),o=e.out[(a<<1)-1]):i(0,o,0);const l=e.curH[a],f=e.nextH[a],h=e.out[1+(a<<1)],d=e.tmpH;if(i(s+1,d,0),g(o,d,h,t,r),o=e.tmpL,i(s+2,o,0),i(s+3,d,0),g(o,d,t.above?l:f,t,r),t.above){i(s+2,o,1),i(s+3,d,1),g(o,d,f,t,r);for(let t=0;t<r;++t)h[t]-=l[t]+f[t]+2>>2}else for(let t=0;t<r;++t)h[t]-=f[t]+1>>1},d=(t,e,n,a,i)=>{const s=(s,r,o)=>{const l=n.bandState[s],f=l.prevLineBuf;l.prevLineBuf=l.lineBuf,l.lineBuf=f,c(l.state,l.prevLineBuf,l.lineBuf,l.partial,l.w,l.rb,l.rbm),u(l.lineBuf,l.state,r,e+1+o,n.plane.bands[s],t.planeWidth,i,a)},r=3*i,o=i<t.wavelets-1?n.plane.bands[r+4].height:t.planeHeight,l=i<t.wavelets-1?n.plane.bands[r+5].width:t.planeWidth,f=n.nextH[i],h=n.curH[i],p=n.out[i<<1],b=n.out[1+(i<<1)],w=n.tmpH,m=e<<1>o-4&&!t.below;if(m&&!(1&o)){for(let t=0;t<l;++t)p[t]=f[t]+b[t];return}let y=n.tmpL;if(i?1&e?y=n.out[(i<<1)-1]:(d(t,e>>1,n,a,i-1),y=n.out[i-1<<1]):s(0,y,0),s(r+1,w,0),g(y,w,p,t,l),m)for(let t=0;t<l;++t)b[t]=f[t]+((p[t]-=f[t]+1>>1)+b[t]>>1);else{y=n.tmpL,s(r+2,y,+t.above),s(r+3,w,+t.above),g(y,w,h,t,l);for(let t=0;t<l;++t)b[t]=f[t]+((p[t]-=f[t]+h[t]+2>>2)+b[t]>>1)}n.out[i<<1]=b,n.out[1+(i<<1)]=p,n.nextH[i]=h,n.curH[i]=f},w=(t,e,n,a,i,s,r,o)=>{const{left:l,top:f,width:h,height:p}=n;if(0==e.encType){const n=1<<e.medianBits-1,c=(1<<e.medianBits)-1;for(let e=0;e<2;++e){const u=i+2*s+e-f;if(!(u<0||u>=p))for(let i=0;i<2;++i){const s=o[2*e+i],f=u*h+a+i-l,p=Math.min(l-a+h+1-i>>1,r);for(let e=Math.max(l-a+1-i>>1,0);e<p;++e)t[f+(e<<1)]=Math.min(Math.max(n+s[e],0),c)}}}else if(3==e.encType){const n=1<<e.medianBits+9,c=(1<<e.medianBits)-1,u=i+2*s-f;if(u<-1||u>=p)return;const g=Math.max(l-a+1>>1,0),b=Math.min(l-a+h+1>>1,r),d=o[0],w=o[1],m=o[2],y=o[3];let v=u*h+a-l;if(-1==u||u==p-1){const e=-1==u;for(let a=g;a<b;++a){const i=d[a],s=w[a],r=m[a],o=y[a],l=v+(a<<1);let f=n+(i<<10)-168*s-585*o;f=f<0?-(512-f>>9&-2):f+512>>9&-2,e?(t[l+h]=Math.min(Math.max(f-r+1>>1,0),c),t[l+h+1]=Math.min(Math.max(n+(i<<10)+1927*s+512>>10,0),c)):(t[l]=Math.min(Math.max(n+(i<<10)+1510*o+512>>10,0),c),t[l+1]=Math.min(Math.max(r+f+1>>1,0),c))}}else for(let e=g;e<b;++e){const a=d[e],i=w[e],s=m[e],r=y[e],o=v+(e<<1);let l=n+(a<<10)-168*i-585*r;l=l<0?-(512-l>>9&-2):l+512>>9&-2,t[o]=Math.min(Math.max(n+(a<<10)+1510*r+512>>10,0),c),t[o+1]=Math.min(Math.max(s+l+1>>1,0),c),t[o+h]=Math.min(Math.max(l-s+1>>1,0),c),t[o+h+1]=Math.min(Math.max(n+(a<<10)+1927*i+512>>10,0),c)}}},m=new Uint8Array([1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,1,1,0,0,1,0,1,0,0,0,1,2,2,1,0,0,1,1,1,1,0,0,1,1,1,1,0,0,1,0,1,0,0,0,1,2,2,1,0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,0,1,0,1,2,2,2,2,1,1,1,1,2,2,1,1,1,1,2,2,1,1,0,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1]),y=(t,e,n,a)=>{const i=Math.ceil(t.width/t.tileWidth),s=Math.ceil(t.height/t.tileHeight),r=[],l=new DataView(e.buffer,e.byteOffset,t.headerSize);let f=0;for(let e=0,n=0;n<s;++n)for(let a=0;a<i;++a){if(65297!=(16|l.getUint16(e)))throw new Error("invalid tile header");const o=l.getUint16(e+2),h=l.getInt32(e+4);if(n*i+a!=l.getUint16(e+8))throw new Error("invalid tile index");let p=!1,c=0,u=0;16==o&&(p=!0,c=l.getInt32(e+12),u=l.getUint16(e+16)),e+=o+4;const g=0!=n,b=n!=s-1,d=0!=a,w=a!=i-1,y=w?t.tileWidth:t.width-(i-1)*t.tileWidth,v=b?t.tileHeight:t.height-(s-1)*t.tileHeight,M=y>>1,k=v>>1,B=[];let U=0;for(let n=0;n<t.planes;++n){if(65298!=(16|l.getUint16(e)))throw new Error("invalid plane header");const a=l.getUint16(e+2),i=l.getInt32(e+4),s=l.getUint8(e+8);if(n!=s>>4)throw new Error("invalid plane index");const r=s>>3&1,o=s>>1&3;e+=a+4;const f=48*(t.wavelets-1)+6*(7&M),h=48*(t.wavelets-1)+6*(7&k),p=[];let c=0;const u=(t,n,a,i,s,r,o)=>{const f=l.getUint16(e);if(65299!=(16|f))throw new Error("invalid subband header");const h=l.getUint16(e+2),u=l.getInt32(e+4),g=l.getUint16(e+8);if(t!=g>>12)throw new Error("invalid subband index");if(65283==f){const t=g>>11&1,e=g>>3&255;p.push({offset:c,partial:1==t,qParam:e,qBase:0,qMulti:0,width:n,height:a,xs:i,xe:s,ys:r,ye:o})}else{const t=l.getUint16(e+10),f=l.getInt32(e+12);p.push({offset:c,partial:!1,qParam:0,qBase:f,qMulti:t,width:n,height:a,xs:i,xe:s,ys:r,ye:o})}c+=u,e+=h+4};if(t.wavelets)for(let e=t.wavelets;e>0;--e){const n=M+(1<<e-1)-1>>e-1,a=k+(1<<e-1)-1>>e-1,i=1&n,s=1&a,r=n+1>>1,o=a+1>>1,l=f+(e<<1)-2,p=h+(e<<1)-2;let c=+d,y=+g,v=w?m[l]:0,B=b?m[p]:0,U=w?m[l+1]:0,x=b?m[p+1]:0;e==t.wavelets&&u(0,r+U,o+x,0,U,0,x);for(let n=0;n<3;++n)u(3*(t.wavelets-e)+n+1,1&n?r+U:r+c+v-i,n?o+y+B-s:o+x,1&n?0:c,1&n?U:v,n?y:0,n?B:x)}else u(0,M,k,0,0,0,0);B.push({offset:U,partial:1==r,roundedBits:o,bands:p}),U+=i}r.push({offset:f,above:g,below:b,left:d,right:w,qp:p,qpSize:c,qpPad:u,width:y,height:v,planeWidth:M,planeHeight:k,wavelets:t.wavelets,x:a*t.tileWidth,y:n*t.tileHeight,planes:B}),f+=h}((t,e,n,a,i)=>{const s=2+(t.tileWidth>>1);if(t.wavelets){const s=t.tileWidth+14>>2,r=s<<1,l=14*(t.tileWidth>>1)+22*t.wavelets,f=new Int32Array(r+t.planes*l),h=f.subarray(0,s),p=f.subarray(s,r);for(const s of e){const e=o(s,n),c=s.planeHeight-1>>1,u=s.planes.map((a,i)=>{let o=r+i*l;const c=[],u=[],g=[];for(let e=t.wavelets-1;e>=0;--e){const t=3+(s.planeWidth>>e);c.push(f.subarray(o,o+=t)),u.push(f.subarray(o,o+=t)),g.push(f.subarray(o,o+=t),f.subarray(o,o+=t))}const d=a.bands.map((t,e)=>{const i=t.width+2,r=a.roundedBits,l=1<<r-1;return{lineBuf:f.subarray(o,o+=i),prevLineBuf:f.subarray(o,o+=i),state:{buf:n.subarray(s.offset+s.qpSize+s.qpPad+a.offset+t.offset),pos:0,k:0,s:0},partial:a.partial&&!e,rb:r,rbm:l,w:t.width}}),w={plane:a,nextH:u,curH:c,out:g,tmpH:p,tmpL:h,bandState:d};return b(s,w,e,t.wavelets-1),w});w(a,t,i,s.x,s.y,0,s.planeWidth,u.map(e=>e.out[(t.wavelets<<1)-1]));for(let n=0;n<c;++n){for(const a of u)d(s,n,a,e,t.wavelets-1);w(a,t,i,s.x,s.y,1+(n<<1),s.planeWidth,u.map(e=>e.out[t.wavelets-1<<1])),2+(n<<1)<s.planeHeight&&w(a,t,i,s.x,s.y,2+(n<<1),s.planeWidth,u.map(e=>e.out[(t.wavelets<<1)-1]))}}}else{const r=new Int32Array(t.planes*s<<1);for(const o of e){const e=o.planes.map((t,e)=>{const a=t.bands[0],i=t.partial,l={buf:n.subarray(o.offset+t.offset+a.offset),pos:0,k:0,s:0},f=(e<<1)*s,h=r.subarray(f,f+s),c=r.subarray(f+s,f+(s<<1)),u=t.roundedBits,g=1<<u-1,b=a.width;return p(l,c,h,i,b,u,g),{lineBuf:h,prevLineBuf:c,state:l,partial:i,rb:u,rbm:g,w:b}});w(a,t,i,o.x,o.y,0,o.planeWidth,e.map(t=>t.lineBuf.subarray(1,-1)));for(let n=1;n<o.planeHeight;++n){for(const t of e){const e=t.prevLineBuf;t.prevLineBuf=t.lineBuf,t.lineBuf=e,c(t.state,t.prevLineBuf,t.lineBuf,t.partial,t.w,t.rb,t.rbm)}w(a,t,i,o.x,o.y,n,o.planeWidth,e.map(t=>t.lineBuf.subarray(1,-1)))}}}})(t,r,new Uint8Array(e.buffer,e.byteOffset+t.headerSize,e.byteLength-t.headerSize),n,a)},v=t=>{const e={};for(let n=0;n<t.byteLength;){let a=t.getInt32(n),i=n+a,s=String.fromCharCode(t.getUint8(n+4),t.getUint8(n+5),t.getUint8(n+6),t.getUint8(n+7));1==a&&(a=t.getInt32(n+12),i=n+a,n+=8),n+=8,e[s]||(e[s]=[]),e[s].push(new DataView(t.buffer,t.byteOffset+n,i-n)),n=i}return e};return class{constructor(t,e,n){this.src=new DataView(t,e,n);const a=v(this.src),i=v(a.moov[0]);this.tracks=i.trak.map(t=>{const e={},n=[],a=v(v(v(v(t).mdia[0]).minf[0]).stbl[0]),i=a.stsz[0],s=a.co64[0],r=Math.min(i.getInt32(8),s.getInt32(4)),o=i.getInt32(4);for(let t=0;t<r;++t)n.push({size:o||i.getInt32(12+4*t),offset:s.getInt32(12+8*t)});const l=a.stsd[0],f=v(new DataView(l.buffer,l.byteOffset+8,l.byteLength-8));if(!f.CRAW)return null;const h=f.CRAW[0];e.width=h.getUint16(24),e.height=h.getUint16(26);const p=v(new DataView(h.buffer,h.byteOffset+82,h.byteLength-82));if(p.JPEG)e.type="jpeg";else if(p.CMP1){const t=p.CMP1[0];e.width=t.getInt32(8),e.height=t.getInt32(12),e.tileWidth=t.getInt32(16),e.tileHeight=t.getInt32(20);const n=t.getUint8(26);if(e.wavelets=15&n,0!=e.wavelets&&3!=e.wavelets)throw new TypeError("expected 0 or 3 wavelet levels");e.encType=n>>4;const a=t.getUint8(25);if(e.planes=a>>4,4!=e.planes)throw new TypeError("expected 4 planes");switch(15&a){case 0:e.layout="rggb";break;case 1:e.layout="grbg";break;case 2:e.layout="gbrg";break;case 3:e.layout="bggr"}e.bitDepth=t.getUint8(24),e.medianBits=e.bitDepth,e.headerSize=t.getInt32(28);if(t.getUint8(32)>>7){t.getUint8(56)>>6&1&&(e.medianBits=t.getUint8(84))}const i=p.CDI1[0],s=v(new DataView(i.buffer,i.byteOffset+4,i.byteLength-4)).IAD1[0],r=s.getUint16(10);e.type=2==r?"big":0==r?"small":"unknown",e.fullCrop={left:0,top:0,width:e.width,height:e.height},e.recommendedCrop={left:s.getUint16(16),top:s.getUint16(18)},e.recommendedCrop.width=s.getUint16(20)-e.recommendedCrop.left+1,e.recommendedCrop.height=s.getUint16(22)-e.recommendedCrop.top+1,"big"==e.type&&(e.activeArea={left:s.getUint16(40),top:s.getUint16(42)},e.activeArea.width=Math.min(s.getUint16(44)-1,e.width)-e.activeArea.left,e.activeArea.height=Math.min(s.getUint16(46)-1,e.width)-e.activeArea.top)}else e.type="unknown";return{meta:e,samples:n}}).filter(t=>t)}getTrack(t="big"){return this.tracks.find(e=>e.meta.type==t)}extractCFA(t=this.getTrack("big"),e=0,n=t.meta.fullCrop,a=new Uint16Array(n.width*n.height)){if("big"!=t.meta.type&&"small"!=t.meta.type)throw new TypeError("expected raw track");const i=t.samples[e],s=new Uint8Array(this.src.buffer,this.src.byteOffset+i.offset,i.size);return y(t.meta,s,a,n),a}}})()
	
var UPNG=function(){var a5={nextZero:function(x,T){while(x[T]!=0)T++;return T},readUshort:function(x,T){return x[T]<<8|x[T+1]},writeUshort:function(x,T,a){x[T]=a>>8&255;
x[T+1]=a&255},readUint:function(x,T){return x[T]*(256*256*256)+(x[T+1]<<16|x[T+2]<<8|x[T+3])},writeUint:function(x,T,a){x[T]=a>>24&255;
x[T+1]=a>>16&255;x[T+2]=a>>8&255;x[T+3]=a&255},readASCII:function(x,T,a){var i="";for(var v=0;v<a;v++)i+=String.fromCharCode(x[T+v]);
return i},writeASCII:function(x,T,a){for(var i=0;i<a.length;i++)x[T+i]=a.charCodeAt(i)},readBytes:function(x,T,a){var i=[];
for(var C=0;C<a;C++)i.push(x[T+C]);return i},pad:function(x){return x.length<2?"0"+x:x},readUTF8:function(x,T,a){var i="",v;
for(var O=0;O<a;O++)i+="%"+a5.pad(x[T+O].toString(16));try{v=decodeURIComponent(i)}catch(an){return a5.readASCII(x,T,a)}return v}};
function au(x){var T=x.width,z=x.height;if(x.tabs.acTL==null)return[at(x.data,T,z,x).buffer];var a=[];
if(x.frames[0].data==null)x.frames[0].data=x.data;var i=T*z*4,C=new Uint8Array(i),v=new Uint8Array(i),O=new Uint8Array(i);
for(var Y=0;Y<x.frames.length;Y++){var $=x.frames[Y],o=$.rect.x,I=$.rect.y,w=$.rect.width,p=$.rect.height,K=at($.data,w,p,x);
if(Y!=0)for(var B=0;B<i;B++)O[B]=C[B];if($.blend==0)ag(K,w,p,C,T,z,o,I,0);else if($.blend==1)ag(K,w,p,C,T,z,o,I,1);
a.push(C.buffer.slice(0));if($.dispose==0){}else if($.dispose==1)ag(v,w,p,C,T,z,o,I,0);else if($.dispose==2)for(var B=0;
B<i;B++)C[B]=O[B]}return a}function at(x,T,z,a){var i=T*z,C=ak(a),v=Math.ceil(T*C/8),O=new Uint8Array(i*4),Y=new Uint32Array(O.buffer),$=a.ctype,o=a.depth,I=a5.readUshort,w=Date.now();
if($==6){var p=i<<2;if(o==8)for(var K=0;K<p;K+=4){O[K]=x[K];O[K+1]=x[K+1];O[K+2]=x[K+2];O[K+3]=x[K+3]}if(o==16)for(var K=0;
K<p;K++){O[K]=x[K<<1]}}else if($==2){var B=a.tabs.tRNS;if(B==null){if(o==8)for(var K=0;K<i;K++){var F=K*3;
Y[K]=255<<24|x[F+2]<<16|x[F+1]<<8|x[F]}if(o==16)for(var K=0;K<i;K++){var F=K*6;Y[K]=255<<24|x[F+4]<<16|x[F+2]<<8|x[F]}}else{var d=B[0],D=B[1],W=B[2];
if(o==8)for(var K=0;K<i;K++){var V=K<<2,F=K*3;Y[K]=255<<24|x[F+2]<<16|x[F+1]<<8|x[F];if(x[F]==d&&x[F+1]==D&&x[F+2]==W)O[V+3]=0}if(o==16)for(var K=0;
K<i;K++){var V=K<<2,F=K*6;Y[K]=255<<24|x[F+4]<<16|x[F+2]<<8|x[F];if(I(x,F)==d&&I(x,F+2)==D&&I(x,F+4)==W)O[V+3]=0}}}else if($==3){var U=a.tabs.PLTE,q=a.tabs.tRNS,f=q?q.length:0;
if(o==1)for(var j=0;j<z;j++){var y=j*v,n=j*T;for(var K=0;K<T;K++){var V=n+K<<2,g=x[y+(K>>3)]>>7-((K&7)<<0)&1,b=3*g;
O[V]=U[b];O[V+1]=U[b+1];O[V+2]=U[b+2];O[V+3]=g<f?q[g]:255}}if(o==2)for(var j=0;j<z;j++){var y=j*v,n=j*T;
for(var K=0;K<T;K++){var V=n+K<<2,g=x[y+(K>>2)]>>6-((K&3)<<1)&3,b=3*g;O[V]=U[b];O[V+1]=U[b+1];O[V+2]=U[b+2];
O[V+3]=g<f?q[g]:255}}if(o==4)for(var j=0;j<z;j++){var y=j*v,n=j*T;for(var K=0;K<T;K++){var V=n+K<<2,g=x[y+(K>>1)]>>4-((K&1)<<2)&15,b=3*g;
O[V]=U[b];O[V+1]=U[b+1];O[V+2]=U[b+2];O[V+3]=g<f?q[g]:255}}if(o==8)for(var K=0;K<i;K++){var V=K<<2,g=x[K],b=3*g;
O[V]=U[b];O[V+1]=U[b+1];O[V+2]=U[b+2];O[V+3]=g<f?q[g]:255}}else if($==4){if(o==8)for(var K=0;K<i;K++){var V=K<<2,k=K<<1,R=x[k];
O[V]=R;O[V+1]=R;O[V+2]=R;O[V+3]=x[k+1]}if(o==16)for(var K=0;K<i;K++){var V=K<<2,k=K<<2,R=x[k];O[V]=R;
O[V+1]=R;O[V+2]=R;O[V+3]=x[k+2]}}else if($==0){var d=a.tabs.tRNS?a.tabs.tRNS:-1;for(var j=0;j<z;j++){var G=j*v,M=j*T;
if(o==1)for(var l=0;l<T;l++){var R=255*(x[G+(l>>>3)]>>>7-(l&7)&1),_=R==d*255?0:255;Y[M+l]=_<<24|R<<16|R<<8|R}else if(o==2)for(var l=0;
l<T;l++){var R=85*(x[G+(l>>>2)]>>>6-((l&3)<<1)&3),_=R==d*85?0:255;Y[M+l]=_<<24|R<<16|R<<8|R}else if(o==4)for(var l=0;
l<T;l++){var R=17*(x[G+(l>>>1)]>>>4-((l&1)<<2)&15),_=R==d*17?0:255;Y[M+l]=_<<24|R<<16|R<<8|R}else if(o==8)for(var l=0;
l<T;l++){var R=x[G+l],_=R==d?0:255;Y[M+l]=_<<24|R<<16|R<<8|R}else if(o==16)for(var l=0;l<T;l++){var R=x[G+(l<<1)],_=I(x,G+(l<<1))==d?0:255;
Y[M+l]=_<<24|R<<16|R<<8|R}}}return O}function ac(x){var T=new Uint8Array(x),z=8,a=a5,i=a.readUshort,C=a.readUint,v={tabs:{},frames:[]},O=new Uint8Array(T.length),Y=0,P,$=0,o=[137,80,78,71,13,10,26,10];
for(var I=0;I<8;I++)if(T[I]!=o[I])throw"The input is not a PNG file!";while(z<T.length){var w=a.readUint(T,z);
z+=4;var p=a.readASCII(T,z,4);z+=4;if(p=="IHDR"){aa(T,z,v)}else if(p=="iCCP"){var K=z,D=null;while(T[K]!=0)K++;
var B=a.readASCII(T,z,K-z),F=T[K+1],d=T.slice(K+2,z+w);try{D=N(d)}catch(an){D=a4(d)}v.tabs[p]=D}else if(p=="CgBI"){v.tabs[p]=T.slice(z,z+4)}else if(p=="IDAT"){for(var I=0;
I<w;I++)O[Y+I]=T[z+I];Y+=w}else if(p=="acTL"){v.tabs[p]={num_frames:C(T,z),num_plays:C(T,z+4)};P=new Uint8Array(T.length)}else if(p=="fcTL"){if($!=0){var W=v.frames[v.frames.length-1];
W.data=an(v,P.slice(0,$),W.rect.width,W.rect.height);$=0}var V={x:C(T,z+12),y:C(T,z+16),width:C(T,z+4),height:C(T,z+8)},U=i(T,z+22);
U=i(T,z+20)/(U==0?100:U);var q={rect:V,delay:Math.round(U*1e3),dispose:T[z+24],blend:T[z+25]};v.frames.push(q)}else if(p=="fdAT"){for(var I=0;
I<w-4;I++)P[$+I]=T[z+I+4];$+=w-4}else if(p=="pHYs"){v.tabs[p]=[a.readUint(T,z),a.readUint(T,z+4),T[z+8]]}else if(p=="cHRM"){v.tabs[p]=[];
for(var I=0;I<8;I++)v.tabs[p].push(a.readUint(T,z+I*4))}else if(p=="tEXt"||p=="zTXt"){if(v.tabs[p]==null)v.tabs[p]={};
var f=a.nextZero(T,z),j=a.readASCII(T,z,f-z),y,n=z+w-f-1;if(p=="tEXt")y=a.readASCII(T,f+1,n);else{var g=N(T.slice(f+2,f+2+n));
y=a.readUTF8(g,0,g.length)}v.tabs[p][j]=y}else if(p=="iTXt"){if(v.tabs[p]==null)v.tabs[p]={};var f=0,K=z,y;
f=a.nextZero(T,K);var j=a.readASCII(T,K,f-K);K=f+1;var b=T[K],k=T[K+1];K+=2;f=a.nextZero(T,K);var R=a.readASCII(T,K,f-K);
K=f+1;f=a.nextZero(T,K);var G=a.readUTF8(T,K,f-K);K=f+1;var n=w-(K-z);if(b==0)y=a.readUTF8(T,K,n);else{var g=N(T.slice(K,K+n));
y=a.readUTF8(g,0,g.length)}v.tabs[p][j]=y}else if(p=="PLTE"){v.tabs[p]=a.readBytes(T,z,w)}else if(p=="hIST"){var M=v.tabs.PLTE.length/3;
v.tabs[p]=[];for(var I=0;I<M;I++)v.tabs[p].push(i(T,z+I*2))}else if(p=="tRNS"){if(v.ctype==3)v.tabs[p]=a.readBytes(T,z,w);
else if(v.ctype==0)v.tabs[p]=i(T,z);else if(v.ctype==2)v.tabs[p]=[i(T,z),i(T,z+2),i(T,z+4)]}else if(p=="gAMA")v.tabs[p]=a.readUint(T,z)/1e5;
else if(p=="sRGB")v.tabs[p]=T[z];else if(p=="bKGD"){if(v.ctype==0||v.ctype==4)v.tabs[p]=[i(T,z)];else if(v.ctype==2||v.ctype==6)v.tabs[p]=[i(T,z),i(T,z+2),i(T,z+4)];
else if(v.ctype==3)v.tabs[p]=T[z]}else if(p=="IEND"){break}z+=w;var l=a.readUint(T,z);z+=4}if($!=0){var W=v.frames[v.frames.length-1];
W.data=an(v,P.slice(0,$),W.rect.width,W.rect.height)}v.data=an(v,O,v.width,v.height);delete v.compress;
delete v.interlace;delete v.filter;return v}function an(x,T,z,a){var i=Date.now(),C=ak(x),v=Math.ceil(z*C/8),O=new Uint8Array((v+1+x.interlace)*a);
if(x.tabs.CgBI)T=a4(T,O);else T=N(T,O);var i=Date.now();if(x.interlace==0)T=a2(T,x,0,z,a);else if(x.interlace==1)T=ae(T,x);
return T}function N(x,T){var z=a4(new Uint8Array(x.buffer,2,x.length-6),T);return z}var a4=function(){var x={};
x.H={};x.H.N=function(T,z){var a=Uint8Array,i=0,C=0,v=0,O=0,Y=0,P=0,$=0,o=0,I=0,w,p;if(T[0]==3&&T[1]==0)return z?z:new a(0);
var B=x.H,F=B.b,d=B.e,D=B.R,V=B.n,q=B.A,f=B.Z,n=B.m,g=z==null;if(g)z=new a(T.length>>>2<<5);while(i==0){i=F(T,I,1);
C=F(T,I+1,2);I+=3;if(C==0){if((I&7)!=0)I+=8-(I&7);var R=(I>>>3)+4,G=T[R-4]|T[R-3]<<8;if(g)z=x.H.W(z,o+G);
z.set(new a(T.buffer,T.byteOffset+R,G),o);I=R+G<<3;o+=G;continue}if(g)z=x.H.W(z,o+(1<<17));if(C==1){w=n.J;
p=n.h;P=(1<<9)-1;$=(1<<5)-1}if(C==2){v=d(T,I,5)+257;O=d(T,I+5,5)+1;Y=d(T,I+10,4)+4;I+=14;var M=I,S=1;
for(var E=0;E<38;E+=2){n.Q[E]=0;n.Q[E+1]=0}for(var E=0;E<Y;E++){var e=d(T,I+E*3,3);n.Q[(n.X[E]<<1)+1]=e;
if(e>S)S=e}I+=3*Y;V(n.Q,S);q(n.Q,S,n.u);w=n.w;p=n.d;I=D(n.u,(1<<S)-1,v+O,T,I,n.v);var u=B.V(n.v,0,v,n.C);
P=(1<<u)-1;var s=B.V(n.v,v,O,n.D);$=(1<<s)-1;V(n.C,u);q(n.C,u,w);V(n.D,s);q(n.D,s,p)}while(!0){var m=w[f(T,I)&P];
I+=m&15;var J=m>>>4;if(J>>>8==0){z[o++]=J}else if(J==256){break}else{var L=o+J-254;if(J>264){var h=n.q[J-257];
L=o+(h>>>3)+d(T,I,h&7);I+=h&7}var H=p[f(T,I)&$];I+=H&15;var X=H>>>4,Z=n.c[X],A=(Z>>>4)+F(T,I,Z&15);I+=Z&15;
while(o<L){z[o]=z[o++-A];z[o]=z[o++-A];z[o]=z[o++-A];z[o]=z[o++-A]}o=L}}}return z.length==o?z:z.slice(0,o)};
x.H.W=function(T,z){var a=T.length;if(z<=a)return T;var i=new Uint8Array(a<<1);i.set(T,0);return i};
x.H.R=function(T,z,a,i,C,v){var O=x.H.e,Y=x.H.Z,P=0;while(P<a){var $=T[Y(i,C)&z];C+=$&15;var o=$>>>4;
if(o<=15){v[P]=o;P++}else{var I=0,p=0;if(o==16){p=3+O(i,C,2);C+=2;I=v[P-1]}else if(o==17){p=3+O(i,C,3);
C+=3}else if(o==18){p=11+O(i,C,7);C+=7}var K=P+p;while(P<K){v[P]=I;P++}}}return C};x.H.V=function(T,z,a,i){var C=0,v=0,O=i.length>>>1;
while(v<a){var Y=T[v+z];i[v<<1]=0;i[(v<<1)+1]=Y;if(Y>C)C=Y;v++}while(v<O){i[v<<1]=0;i[(v<<1)+1]=0;v++}return C};
x.H.n=function(T,z){var a=x.H.m,i=T.length,C,v,O,Y,P,$=a.j;for(var Y=0;Y<=z;Y++)$[Y]=0;for(Y=1;Y<i;Y+=2)$[T[Y]]++;
var o=a.K;C=0;$[0]=0;for(v=1;v<=z;v++){C=C+$[v-1]<<1;o[v]=C}for(O=0;O<i;O+=2){P=T[O+1];if(P!=0){T[O]=o[P];
o[P]++}}};x.H.A=function(T,z,a){var i=T.length,C=x.H.m,v=C.r;for(var O=0;O<i;O+=2)if(T[O+1]!=0){var Y=O>>1,P=T[O+1],$=Y<<4|P,o=z-P,I=T[O]<<o,p=I+(1<<o);
while(I!=p){var K=v[I]>>>15-z;a[K]=$;I++}}};x.H.l=function(T,z){var a=x.H.m.r,i=15-z;for(var C=0;C<T.length;
C+=2){var v=T[C]<<z-T[C+1];T[C]=a[v]>>>i}};x.H.M=function(T,z,a){a=a<<(z&7);var i=z>>>3;T[i]|=a;T[i+1]|=a>>>8};
x.H.I=function(T,z,a){a=a<<(z&7);var i=z>>>3;T[i]|=a;T[i+1]|=a>>>8;T[i+2]|=a>>>16};x.H.e=function(T,z,a){return(T[z>>>3]|T[(z>>>3)+1]<<8)>>>(z&7)&(1<<a)-1};
x.H.b=function(T,z,a){return(T[z>>>3]|T[(z>>>3)+1]<<8|T[(z>>>3)+2]<<16)>>>(z&7)&(1<<a)-1};x.H.Z=function(T,z){return(T[z>>>3]|T[(z>>>3)+1]<<8|T[(z>>>3)+2]<<16)>>>(z&7)};
x.H.i=function(T,z){return(T[z>>>3]|T[(z>>>3)+1]<<8|T[(z>>>3)+2]<<16|T[(z>>>3)+3]<<24)>>>(z&7)};x.H.m=function(){var T=Uint16Array,z=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 z(32),J:new T(512),_:[],h:new T(32),$:[],w:new T(32768),C:[],v:[],d:new T(32768),D:[],u:new T(512),Q:[],r:new T(1<<15),s:new z(286),Y:new z(30),a:new z(19),t:new z(15e3),k:new T(1<<16),g:new T(1<<15)}}();
(function(){var T=x.H.m,z=1<<15;for(var a=0;a<z;a++){var i=a;i=(i&2863311530)>>>1|(i&1431655765)<<1;
i=(i&3435973836)>>>2|(i&858993459)<<2;i=(i&4042322160)>>>4|(i&252645135)<<4;i=(i&4278255360)>>>8|(i&16711935)<<8;
T.r[a]=(i>>>16|i<<16)>>>17}function C(v,O,Y){while(O--!=0)v.push(0,Y)}for(var a=0;a<32;a++){T.q[a]=T.S[a]<<3|T.T[a];
T.c[a]=T.p[a]<<4|T.z[a]}C(T._,144,8);C(T._,255-143,9);C(T._,279-255,7);C(T._,287-279,8);x.H.n(T._,9);
x.H.A(T._,9,T.J);x.H.l(T._,9);C(T.$,32,5);x.H.n(T.$,5);x.H.A(T.$,5,T.h);x.H.l(T.$,5);C(T.Q,19,0);C(T.C,286,0);
C(T.D,30,0);C(T.v,320,0)}());return x.H.N}();function ae(x,T){var z=T.width,a=T.height,i=ak(T),C=i>>3,v=Math.ceil(z*i/8),O=new Uint8Array(a*v),Y=0,$=[0,0,4,0,2,0,1],o=[0,4,0,2,0,1,0],I=[8,8,8,4,4,2,2],w=[8,8,4,4,2,2,1],p=0;
while(p<7){var K=I[p],B=w[p],F=0,d=0,D=$[p],U=0;while(D<a){D+=K;d++}var W=o[p];while(W<z){W+=B;F++}var V=Math.ceil(F*i/8);
a2(x,T,Y,F,d);var q=$[p];while(q<a){var f=o[p],j=Y+U*V<<3;while(f<z){if(i==1){var y=x[j>>3];y=y>>7-(j&7)&1;
O[q*v+(f>>3)]|=y<<7-((f&7)<<0)}if(i==2){var y=x[j>>3];y=y>>6-(j&7)&3;O[q*v+(f>>2)]|=y<<6-((f&3)<<1)}if(i==4){var y=x[j>>3];
y=y>>4-(j&7)&15;O[q*v+(f>>1)]|=y<<4-((f&1)<<2)}if(i>=8){var n=q*v+f*C;for(var g=0;g<C;g++)O[n+g]=x[(j>>3)+g]}j+=i;
f+=B}U++;q+=K}if(F*d!=0)Y+=d*(1+V);p=p+1}return O}function ak(x){var T=[1,null,3,1,2,null,4][x.ctype];
return T*x.depth}function a2(x,T,z,a,i){var C=ak(T),v=Math.ceil(a*C/8),O,Y,o=0;C=Math.ceil(C/8);var $=x[z];
if($>1)x[z]=[0,0,1][$-2];if($==3)for(o=C;o<v;o++)x[o+1]=x[o+1]+(x[o+1-C]>>>1)&255;for(var I=0;I<i;I++){O=z+I*v;
Y=O+I+1;$=x[Y-1];o=0;if($==0)for(;o<v;o++)x[O+o]=x[Y+o];else if($==1){for(;o<C;o++)x[O+o]=x[Y+o];for(;
o<v;o++)x[O+o]=x[Y+o]+x[O+o-C]}else if($==2){for(;o<v;o++)x[O+o]=x[Y+o]+x[O+o-v]}else if($==3){for(;
o<C;o++)x[O+o]=x[Y+o]+(x[O+o-v]>>>1);for(;o<v;o++)x[O+o]=x[Y+o]+(x[O+o-v]+x[O+o-C]>>>1)}else{for(;o<C;
o++)x[O+o]=x[Y+o]+af(0,x[O+o-v],0);for(;o<v;o++)x[O+o]=x[Y+o]+af(x[O+o-C],x[O+o-v],x[O+o-C-v])}}return x}function af(x,T,z){var a=x+T-z,i=a-x,C=a-T,v=a-z;
if(i*i<=C*C&&i*i<=v*v)return x;else if(C*C<=v*v)return T;return z}function aa(x,T,z){z.width=a5.readUint(x,T);
T+=4;z.height=a5.readUint(x,T);T+=4;z.depth=x[T];T++;z.ctype=x[T];T++;z.compress=x[T];T++;z.filter=x[T];
T++;z.interlace=x[T];T++}function ag(x,T,z,a,i,C,v,O,Y){var P=Math.min(T,i),$=Math.min(z,C),o=0,I=0;
for(var w=0;w<$;w++)for(var p=0;p<P;p++){if(v>=0&&O>=0){o=w*T+p<<2;I=(O+w)*i+v+p<<2}else{o=(-O+w)*T-v+p<<2;
I=w*i+p<<2}if(Y==0){a[I]=x[o];a[I+1]=x[o+1];a[I+2]=x[o+2];a[I+3]=x[o+3]}else if(Y==1){var K=x[o+3]*(1/255),B=x[o]*K,F=x[o+1]*K,d=x[o+2]*K,D=a[I+3]*(1/255),W=a[I]*D,V=a[I+1]*D,U=a[I+2]*D,q=1-K,f=K+D*q,j=f==0?0:1/f;
a[I+3]=255*f;a[I+0]=(B+W*q)*j;a[I+1]=(F+V*q)*j;a[I+2]=(d+U*q)*j}else if(Y==2){var K=x[o+3],B=x[o],F=x[o+1],d=x[o+2],D=a[I+3],W=a[I],V=a[I+1],U=a[I+2];
if(K==D&&B==W&&F==V&&d==U){a[I]=0;a[I+1]=0;a[I+2]=0;a[I+3]=0}else{a[I]=B;a[I+1]=F;a[I+2]=d;a[I+3]=K}}else if(Y==3){var K=x[o+3],B=x[o],F=x[o+1],d=x[o+2],D=a[I+3],W=a[I],V=a[I+1],U=a[I+2];
if(K==D&&B==W&&F==V&&d==U)continue;if(K<220&&D>20)return!1}}return!0}return{decode:ac,toRGBA8:au,_paeth:af,_copyTile:ag,_bin:a5}}();
(function(){var a5=UPNG._copyTile,au=UPNG._bin,at=UPNG._paeth,ac={table:function(){var V=new Uint32Array(256);
for(var U=0;U<256;U++){var q=U;for(var f=0;f<8;f++){if(q&1)q=3988292384^q>>>1;else q=q>>>1}V[U]=q}return V}(),update:function(V,U,q,f){for(var j=0;
j<f;j++)V=ac.table[(V^U[q+j])&255]^V>>>8;return V},crc:function(V,U,q){return ac.update(4294967295,V,U,q)^4294967295}};
function an(V,U,q,f){U[q]+=V[0]*f>>4;U[q+1]+=V[1]*f>>4;U[q+2]+=V[2]*f>>4;U[q+3]+=V[3]*f>>4}function N(V){return Math.max(0,Math.min(255,V))}function a4(V,U){var q=V[0]-U[0],f=V[1]-U[1],j=V[2]-U[2],n=V[3]-U[3];
return q*q+f*f+j*j+n*n}function ae(V,U,q,f,j,n,g){if(g==null)g=1;var b=f.length,k=[],R=[],u=4;for(var G=0;
G<b;G++){var M=f[G];k.push([M>>>0&255,M>>>8&255,M>>>16&255,M>>>24&255])}for(var G=0;G<b;G++){var l=4294967295,_=0;
for(var r=0;r<b;r++){var S=a4(k[G],k[r]);if(r!=G&&S<l){l=S;_=r}}var c=Math.sqrt(l)/2;R[G]=~~(c*c)}var E=new Uint32Array(j.buffer),e=new Int16Array(U*q*4),s=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];
for(var G=0;G<s.length;G++)s[G]=255*(-.5+(s[G]+.5)/(u*u));for(var m=0;m<q;m++){for(var J=0;J<U;J++){var G=(m*U+J)*4,L,_=0,h=16777215;
if(g!=2)L=[N(V[G]+e[G]),N(V[G+1]+e[G+1]),N(V[G+2]+e[G+2]),N(V[G+3]+e[G+3])];else{var S=s[(m&u-1)*u+(J&u-1)];
L=[N(V[G]+S),N(V[G+1]+S),N(V[G+2]+S),N(V[G+3]+S)]}for(var r=0;r<b;r++){var H=a4(L,k[r]);if(H<h){h=H;
_=r}}var X=k[_],Z=[L[0]-X[0],L[1]-X[1],L[2]-X[2],L[3]-X[3]];if(g==1){if(J!=U-1)an(Z,e,G+4,7);if(m!=q-1){if(J!=0)an(Z,e,G+4*U-4,3);
an(Z,e,G+4*U,5);if(J!=U-1)an(Z,e,G+4*U+4,1)}}n[G>>2]=_;E[G>>2]=f[_]}}}function ak(V,U,q,f,j,n,g){if(f==null)f=0;
if(g==null)g=!1;var b=ag(V,U,q,f,[!1,!1,!1,0,g,!1]);aa(b,-1);return af(b,U,q,j,n)}function a2(V,U,q,f,j,n,g,b){var k={ctype:0+(f==1?0:2)+(j==0?0:4),depth:n,frames:[]},R=Date.now(),G=(f+j)*n,M=G*U;
for(var l=0;l<V.length;l++)k.frames.push({rect:{x:0,y:0,width:U,height:q},img:new Uint8Array(V[l]),blend:0,dispose:1,bpp:Math.ceil(G/8),bpl:Math.ceil(M/8)});
aa(k,0,!0);var _=af(k,U,q,g,b);return _}function af(V,U,q,f,j){if(j==null)j={};var n=ac.crc,g=au.writeUint,b=au.writeUshort,k=au.writeASCII,R=8,G=V.frames.length>1,M=!1,l,_=8+(16+5+4)+(G?20:0),X=0;
if(j.sRGB!=null)_+=8+1+4;if(j.pHYs!=null)_+=8+9+4;if(j.iCCP!=null){l=pako.deflate(j.iCCP);_+=8+11+2+l.length+4}if(V.ctype==3){var r=V.plte.length;
for(var S=0;S<r;S++)if(V.plte[S]>>>24!=255)M=!0;_+=8+r*3+4+(M?8+r*1+4:0)}for(var c=0;c<V.frames.length;
c++){var E=V.frames[c];if(G)_+=38;_+=E.cimg.length+12;if(c!=0)_+=4}_+=12;var e=new Uint8Array(_),u=[137,80,78,71,13,10,26,10];
for(var S=0;S<8;S++)e[S]=u[S];g(e,R,13);R+=4;k(e,R,"IHDR");R+=4;g(e,R,U);R+=4;g(e,R,q);R+=4;e[R]=V.depth;
R++;e[R]=V.ctype;R++;e[R]=0;R++;e[R]=0;R++;e[R]=0;R++;g(e,R,n(e,R-17,17));R+=4;if(j.sRGB!=null){g(e,R,1);
R+=4;k(e,R,"sRGB");R+=4;e[R]=j.sRGB;R++;g(e,R,n(e,R-5,5));R+=4}if(j.iCCP!=null){var s=11+2+l.length;
g(e,R,s);R+=4;k(e,R,"iCCP");R+=4;k(e,R,"ICC profile");R+=11;R+=2;e.set(l,R);R+=l.length;g(e,R,n(e,R-(s+4),s+4));
R+=4}if(j.pHYs!=null){g(e,R,9);R+=4;k(e,R,"pHYs");R+=4;g(e,R,j.pHYs[0]);R+=4;g(e,R,j.pHYs[1]);R+=4;e[R]=j.pHYs[2];
R++;g(e,R,n(e,R-13,13));R+=4}if(G){g(e,R,8);R+=4;k(e,R,"acTL");R+=4;g(e,R,V.frames.length);R+=4;g(e,R,j.loop!=null?j.loop:0);
R+=4;g(e,R,n(e,R-12,12));R+=4}if(V.ctype==3){var r=V.plte.length;g(e,R,r*3);R+=4;k(e,R,"PLTE");R+=4;
for(var S=0;S<r;S++){var m=S*3,J=V.plte[S],L=J&255,h=J>>>8&255,H=J>>>16&255;e[R+m+0]=L;e[R+m+1]=h;e[R+m+2]=H}R+=r*3;
g(e,R,n(e,R-r*3-4,r*3+4));R+=4;if(M){g(e,R,r);R+=4;k(e,R,"tRNS");R+=4;for(var S=0;S<r;S++)e[R+S]=V.plte[S]>>>24&255;
R+=r;g(e,R,n(e,R-r-4,r+4));R+=4}}for(var c=0;c<V.frames.length;c++){var E=V.frames[c];if(G){g(e,R,26);
R+=4;k(e,R,"fcTL");R+=4;g(e,R,X++);R+=4;g(e,R,E.rect.width);R+=4;g(e,R,E.rect.height);R+=4;g(e,R,E.rect.x);
R+=4;g(e,R,E.rect.y);R+=4;b(e,R,f[c]);R+=2;b(e,R,1e3);R+=2;e[R]=E.dispose;R++;e[R]=E.blend;R++;g(e,R,n(e,R-30,30));
R+=4}var Z=E.cimg,r=Z.length;g(e,R,r+(c==0?0:4));R+=4;var A=R;k(e,R,c==0?"IDAT":"fdAT");R+=4;if(c!=0){g(e,R,X++);
R+=4}e.set(Z,R);R+=r;g(e,R,n(e,A,R-A));R+=4}g(e,R,0);R+=4;k(e,R,"IEND");R+=4;g(e,R,n(e,R-4,4));R+=4;
return e.buffer}function aa(V,U,q){for(var f=0;f<V.frames.length;f++){var j=V.frames[f],n=j.rect.width,g=j.rect.height,b=new Uint8Array(g*j.bpl+g);
j.cimg=a(j.img,g,j.bpp,j.bpl,b,U,q)}}function ag(V,U,q,f,j){var n=j[0],g=j[1],b=j[2],k=j[3],R=j[4],G=j[5],M=6,l=8,_=255;
for(var r=0;r<V.length;r++){var S=new Uint8Array(V[r]),c=S.length;for(var E=0;E<c;E+=4)_&=S[E+3]}var e=_!=255,u=x(V,U,q,n,g,b),s={},m=[],J=[];
if(f!=0){var L=[],X=0;for(var E=0;E<u.length;E++)L.push(u[E].img.buffer);var h=W(L),H=C(h,f);for(var E=0;
E<H.plte.length;E++)m.push(H.plte[E].est.rgba);for(var E=0;E<u.length;E++){var Z=u[E],A=Z.img.length,a7=new Uint8Array(H.inds.buffer,X>>2,A>>2);
J.push(a7);var a3=new Uint8Array(H.abuf,X,A);if(G)ae(Z.img,Z.rect.width,Z.rect.height,m,a3,a7);Z.img.set(a3);
X+=A}}else{for(var r=0;r<u.length;r++){var Z=u[r],a6=new Uint32Array(Z.img.buffer),t=Z.rect.width,c=a6.length,a7=new Uint8Array(c);
J.push(a7);for(var E=0;E<c;E++){var al=a6[E];if(E!=0&&al==a6[E-1])a7[E]=a7[E-1];else if(E>t&&al==a6[E-t])a7[E]=a7[E-t];
else{var aj=s[al];if(aj==null){s[al]=aj=m.length;m.push(al);if(m.length>=300)break}a7[E]=aj}}}}var ah=m.length;
if(ah<=256&&R==!1){if(ah<=2)l=1;else if(ah<=4)l=2;else if(ah<=16)l=4;else l=8;l=Math.max(l,k)}for(var r=0;
r<u.length;r++){var Z=u[r],a0=Z.rect.x,ai=Z.rect.y,t=Z.rect.width,ab=Z.rect.height,am=Z.img,ao=new Uint32Array(am.buffer),a1=4*t,a8=4;
if(ah<=256&&R==!1){a1=Math.ceil(l*t/8);var ar=new Uint8Array(a1*ab),ad=J[r];for(var as=0;as<ab;as++){var E=as*a1,a9=as*t;
if(l==8)for(var Q=0;Q<t;Q++)ar[E+Q]=ad[a9+Q];else if(l==4)for(var Q=0;Q<t;Q++)ar[E+(Q>>1)]|=ad[a9+Q]<<4-(Q&1)*4;
else if(l==2)for(var Q=0;Q<t;Q++)ar[E+(Q>>2)]|=ad[a9+Q]<<6-(Q&3)*2;else if(l==1)for(var Q=0;Q<t;Q++)ar[E+(Q>>3)]|=ad[a9+Q]<<7-(Q&7)*1}am=ar;
M=3;a8=1}else if(e==!1&&u.length==1){var ar=new Uint8Array(t*ab*3),aq=t*ab;for(var E=0;E<aq;E++){var ap=E*3,av=E*4;
ar[ap]=am[av];ar[ap+1]=am[av+1];ar[ap+2]=am[av+2]}am=ar;M=2;a8=3;a1=3*t}Z.img=am;Z.bpl=a1;Z.bpp=a8}return{ctype:M,depth:l,plte:m,frames:u}}function x(V,U,q,f,j,n){var g=[],ab=0;
for(var b=0;b<V.length;b++){var k=new Uint8Array(V[b]),R=new Uint32Array(k.buffer),G,M=0,l=0,_=U,r=q,S=f?1:0;
if(b!=0){var c=n||f||b==1||g[b-2].dispose!=0?1:2,E=0,e=1e9;for(var u=0;u<c;u++){var s=new Uint8Array(V[b-1-u]),m=new Uint32Array(V[b-1-u]),J=U,L=q,h=-1,H=-1;
for(var X=0;X<q;X++)for(var Z=0;Z<U;Z++){var A=X*U+Z;if(R[A]!=m[A]){if(Z<J)J=Z;if(Z>h)h=Z;if(X<L)L=X;
if(X>H)H=X}}if(h==-1)J=L=h=H=0;if(j){if((J&1)==1)J--;if((L&1)==1)L--}var a7=(h-J+1)*(H-L+1);if(a7<e){e=a7;
E=u;M=J;l=L;_=h-J+1;r=H-L+1}}var s=new Uint8Array(V[b-1-E]);if(E==1)g[b-1].dispose=2;G=new Uint8Array(_*r*4);
a5(s,U,q,G,_,r,-M,-l,0);S=a5(k,U,q,G,_,r,-M,-l,3)?1:0;if(S==1)z(k,U,q,G,{x:M,y:l,width:_,height:r});
else a5(k,U,q,G,_,r,-M,-l,0)}else G=k.slice(0);g.push({rect:{x:M,y:l,width:_,height:r},img:G,blend:S,dispose:0})}if(f)for(var b=0;
b<g.length;b++){var a3=g[b];if(a3.blend==1)continue;var a6=a3.rect,t=g[b-1].rect,al=Math.min(a6.x,t.x),aj=Math.min(a6.y,t.y),ah=Math.max(a6.x+a6.width,t.x+t.width),a0=Math.max(a6.y+a6.height,t.y+t.height),ai={x:al,y:aj,width:ah-al,height:a0-aj};
g[b-1].dispose=1;if(b-1!=0)T(V,U,q,g,b-1,ai,j);T(V,U,q,g,b,ai,j)}if(V.length!=1)for(var A=0;A<g.length;
A++){var a3=g[A];ab+=a3.rect.width*a3.rect.height}return g}function T(V,U,q,f,j,n,g){var b=Uint8Array,k=Uint32Array,R=new b(V[j-1]),G=new k(V[j-1]),M=j+1<V.length?new b(V[j+1]):null,l=new b(V[j]),_=new k(l.buffer),r=U,S=q,c=-1,E=-1;
for(var e=0;e<n.height;e++)for(var u=0;u<n.width;u++){var s=n.x+u,m=n.y+e,J=m*U+s,L=_[J];if(L==0||f[j-1].dispose==0&&G[J]==L&&(M==null||M[J*4+3]!=0)){}else{if(s<r)r=s;
if(s>c)c=s;if(m<S)S=m;if(m>E)E=m}}if(c==-1)r=S=c=E=0;if(g){if((r&1)==1)r--;if((S&1)==1)S--}n={x:r,y:S,width:c-r+1,height:E-S+1};
var h=f[j];h.rect=n;h.blend=1;h.img=new Uint8Array(n.width*n.height*4);if(f[j-1].dispose==0){a5(R,U,q,h.img,n.width,n.height,-n.x,-n.y,0);
z(l,U,q,h.img,n)}else a5(l,U,q,h.img,n.width,n.height,-n.x,-n.y,0)}function z(V,U,q,f,j){a5(V,U,q,f,j.width,j.height,-j.x,-j.y,2)}function a(V,U,q,f,j,n,g){var b=[],k=[0,1,2,3,4],R,r,S=1e9;
if(n!=-1)k=[n];else if(U*f>5e5||q==1)k=[0];if(g)R={level:0};var G=j.length>1e7&&window.UZIP!=null?window.UZIP:pako,M=Date.now();
for(var l=0;l<k.length;l++){for(var _=0;_<U;_++)i(j,V,_,f,q,k[l]);b.push(G.deflate(j,R))}for(var l=0;
l<b.length;l++)if(b[l].length<S){r=l;S=b[l].length}return b[r]}function i(V,U,q,f,j,n){var g=q*f,b=g+q;
V[b]=n;b++;if(n==0){if(f<500)for(var k=0;k<f;k++)V[b+k]=U[g+k];else V.set(new Uint8Array(U.buffer,g,f),b)}else if(n==1){for(var k=0;
k<j;k++)V[b+k]=U[g+k];for(var k=j;k<f;k++)V[b+k]=U[g+k]-U[g+k-j]+256&255}else if(q==0){for(var k=0;k<j;
k++)V[b+k]=U[g+k];if(n==2)for(var k=j;k<f;k++)V[b+k]=U[g+k];if(n==3)for(var k=j;k<f;k++)V[b+k]=U[g+k]-(U[g+k-j]>>1)+256&255;
if(n==4)for(var k=j;k<f;k++)V[b+k]=U[g+k]-at(U[g+k-j],0,0)+256&255}else{if(n==2){for(var k=0;k<f;k++)V[b+k]=U[g+k]+256-U[g+k-f]&255}if(n==3){for(var k=0;
k<j;k++)V[b+k]=U[g+k]+256-(U[g+k-f]>>1)&255;for(var k=j;k<f;k++)V[b+k]=U[g+k]+256-(U[g+k-f]+U[g+k-j]>>1)&255}if(n==4){for(var k=0;
k<j;k++)V[b+k]=U[g+k]+256-at(0,U[g+k-f],0)&255;for(var k=j;k<f;k++)V[b+k]=U[g+k]+256-at(U[g+k-j],U[g+k-f],U[g+k-j-f])&255}}}function C(V,U,q){var f=Date.now(),j=new Uint8Array(V),n=j.slice(0),g=new Uint32Array(n.buffer),b=$(n,U),k=b[0],R=b[1],G=R.length,M=new Uint32Array(G),l=new Uint8Array(M.buffer),c;
for(var _=0;_<G;_++)M[_]=R[_].est.rgba;var r=j.length,S=new Uint8Array(r>>2);if(G<=60){P(j,S,l);v(S,g,M)}else if(j.length<32e6)for(var _=0;
_<r;_+=4){var E=j[_]*(1/255),e=j[_+1]*(1/255),u=j[_+2]*(1/255),s=j[_+3]*(1/255);c=o(k,E,e,u,s);S[_>>2]=c.ind;
g[_>>2]=c.est.rgba}else for(var _=0;_<r;_+=4){var E=j[_]*(1/255),e=j[_+1]*(1/255),u=j[_+2]*(1/255),s=j[_+3]*(1/255);
c=k;while(c.left)c=I(c.est,E,e,u,s)<=0?c.left:c.right;S[_>>2]=c.ind;g[_>>2]=c.est.rgba}if(q||j.length*G<10*4e6){var m=1e9;
for(var _=0;_<10;_++){var J=O(j,S,l);if(J/m>.997)break;m=J}for(var _=0;_<G;_++)R[_].est.rgba=M[_];v(S,g,M)}return{abuf:n.buffer,inds:S,plte:R}}function v(V,U,q){for(var f=0;
f<V.length;f++)U[f]=q[V[f]]}function O(V,U,q){Y(V,U,q);var f=P(V,U,q);return f}function Y(V,U,q){var f=q.length>>>2,j=new Uint32Array(f*4),n=new Uint32Array(f);
for(var g=0;g<V.length;g+=4){var b=U[g>>>2],k=b*4;n[b]++;j[k]+=V[g];j[k+1]+=V[g+1];j[k+2]+=V[g+2];j[k+3]+=V[g+3]}for(var g=0;
g<q.length;g++)q[g]=Math.round(j[g]/n[g>>>2])}function P(V,U,q){var f=0,j=q.length>>>2,n=[];for(var g=0;
g<j;g++){var b=g*4,k=q[b],R=q[b+1],G=q[b+2],M=q[b+3],l=0,_=1e9;for(var r=0;r<j;r++){if(g==r)continue;
var S=r*4,c=k-q[S],E=R-q[S+1],e=G-q[S+2],u=M-q[S+3],s=c*c+E*E+e*e+u*u;if(s<_){_=s;l=r}}n[g]=Math.sqrt(_)*.5;
n[g]=n[g]*n[g]}for(var g=0;g<V.length;g+=4){var k=V[g],R=V[g+1],G=V[g+2],M=V[g+3],l=U[g>>>2],b=l*4,c=k-q[b],E=R-q[b+1],e=G-q[b+2],u=M-q[b+3],_=c*c+E*E+e*e+u*u;
if(_>n[l])for(var r=0;r<j;r++){b=r*4;c=k-q[b];E=R-q[b+1];e=G-q[b+2];u=M-q[b+3];var s=c*c+E*E+e*e+u*u;
if(s<_){_=s;l=r;if(_<n[r])break}}U[g>>>2]=l;f+=_}return f/(V.length>>>2)}function $(V,U,q){if(q==null)q=1e-4;
var f=new Uint32Array(V.buffer),j={i0:0,i1:V.length,bst:null,est:null,tdst:0,left:null,right:null};j.bst=F(V,j.i0,j.i1);
j.est=d(j.bst);var n=[j];while(n.length<U){var g=0,b=0;for(var k=0;k<n.length;k++)if(n[k].est.L>g){g=n[k].est.L;
b=k}if(g<q)break;var R=n[b],G=p(V,f,R.i0,R.i1,R.est.e,R.est.eMq255),M=R.i0>=G||R.i1<=G;if(M){R.est.L=0;
continue}var l={i0:R.i0,i1:G,bst:null,est:null,tdst:0,left:null,right:null};l.bst=F(V,l.i0,l.i1);l.est=d(l.bst);
var _={i0:G,i1:R.i1,bst:null,est:null,tdst:0,left:null,right:null};_.bst={R:[],m:[],N:R.bst.N-l.bst.N};
for(var k=0;k<16;k++)_.bst.R[k]=R.bst.R[k]-l.bst.R[k];for(var k=0;k<4;k++)_.bst.m[k]=R.bst.m[k]-l.bst.m[k];
_.est=d(_.bst);R.left=l;R.right=_;n[b]=l;n.push(_)}n.sort(function(r,S){return S.bst.N-r.bst.N});for(var k=0;
k<n.length;k++)n[k].ind=k;return[j,n]}function o(V,U,q,f,j){if(V.left==null){V.tdst=w(V.est.q,U,q,f,j);
return V}var n=I(V.est,U,q,f,j),g=V.left,b=V.right;if(n>0){g=V.right;b=V.left}var k=o(g,U,q,f,j);if(k.tdst<=n*n)return k;
var R=o(b,U,q,f,j);return R.tdst<k.tdst?R:k}function I(V,U,q,f,j){var n=V.e;return n[0]*U+n[1]*q+n[2]*f+n[3]*j-V.eMq}function w(V,U,q,f,j){var n=U-V[0],g=q-V[1],b=f-V[2],k=j-V[3];
return n*n+g*g+b*b+k*k}function p(V,U,q,f,j,n){f-=4;var g=0;while(q<f){while(K(V,q,j)<=n)q+=4;while(K(V,f,j)>n)f-=4;
if(q>=f)break;var b=U[q>>2];U[q>>2]=U[f>>2];U[f>>2]=b;q+=4;f-=4}while(K(V,q,j)>n)q-=4;return q+4}function K(V,U,q){return V[U]*q[0]+V[U+1]*q[1]+V[U+2]*q[2]+V[U+3]*q[3]}function F(V,U,q){var f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],j=[0,0,0,0],N=q-U>>2;
for(var n=U;n<q;n+=4){var g=V[n]*(1/255),b=V[n+1]*(1/255),R=V[n+2]*(1/255),G=V[n+3]*(1/255);j[0]+=g;
j[1]+=b;j[2]+=R;j[3]+=G;f[0]+=g*g;f[1]+=g*b;f[2]+=g*R;f[3]+=g*G;f[5]+=b*b;f[6]+=b*R;f[7]+=b*G;f[10]+=R*R;
f[11]+=R*G;f[15]+=G*G}f[4]=f[1];f[8]=f[2];f[9]=f[6];f[12]=f[3];f[13]=f[7];f[14]=f[11];return{R:f,m:j,N:N}}function d(F){var V=F.R,U=F.m,N=F.N,q=U[0],f=U[1],j=U[2],n=U[3],g=N==0?0:1/N,b=[V[0]-q*q*g,V[1]-q*f*g,V[2]-q*j*g,V[3]-q*n*g,V[4]-f*q*g,V[5]-f*f*g,V[6]-f*j*g,V[7]-f*n*g,V[8]-j*q*g,V[9]-j*f*g,V[10]-j*j*g,V[11]-j*n*g,V[12]-n*q*g,V[13]-n*f*g,V[14]-n*j*g,V[15]-n*n*g],R=b,G=D,M=[Math.random(),Math.random(),Math.random(),Math.random()],l=0,_=0;
if(N!=0)for(var r=0;r<16;r++){M=G.multVec(R,M);_=Math.sqrt(G.dot(M,M));M=G.sml(1/_,M);if(r!=0&&Math.abs(_-l)<1e-9)break;
l=_}var S=[q*g,f*g,j*g,n*g],c=G.dot(G.sml(255,S),M);return{Cov:b,q:S,e:M,L:l,eMq255:c,eMq:G.dot(M,S),rgba:(Math.round(255*S[3])<<24|Math.round(255*S[2])<<16|Math.round(255*S[1])<<8|Math.round(255*S[0])<<0)>>>0}}var D={multVec:function(V,U){return[V[0]*U[0]+V[1]*U[1]+V[2]*U[2]+V[3]*U[3],V[4]*U[0]+V[5]*U[1]+V[6]*U[2]+V[7]*U[3],V[8]*U[0]+V[9]*U[1]+V[10]*U[2]+V[11]*U[3],V[12]*U[0]+V[13]*U[1]+V[14]*U[2]+V[15]*U[3]]},dot:function(V,U){return V[0]*U[0]+V[1]*U[1]+V[2]*U[2]+V[3]*U[3]},sml:function(V,U){return[V*U[0],V*U[1],V*U[2],V*U[3]]}};
function W(V){var U=0,j=0;for(var q=0;q<V.length;q++)U+=V[q].byteLength;var f=new Uint8Array(U);for(var q=0;
q<V.length;q++){var n=new Uint8Array(V[q]),g=n.length;for(var b=0;b<g;b+=4){var k=n[b],R=n[b+1],G=n[b+2],M=n[b+3];
if(M==0)k=R=G=0;f[j+b]=k;f[j+b+1]=R;f[j+b+2]=G;f[j+b+3]=M}j+=g}return f.buffer}UPNG.encode=ak;UPNG.encodeLL=a2;
UPNG.encode.compress=ag;UPNG.encode.dither=ae;UPNG.quantize=C;UPNG.quantize.findNearest=P;UPNG.quantize.getKDtree=$;
UPNG.quantize.getNearest=o}());



var UTEX=function(){function r(f,p,R,Y,i){var e=new Uint8Array(4*4*4);for(var N=0;N<i;N+=4)for(var n=0;
n<Y;n+=4){l(f,p,e);o(R,Y,i,n,N,e);p+=8}return p}function a0(f,p,R,Y,i){var e=new Uint8Array(4*4*4);for(var N=0;
N<i;N+=4)for(var n=0;n<Y;n+=4){l(f,p+8,e);o(R,Y,i,n,N,e);p+=16}return p}function D(f,p,R,Y,i){var e=new Uint8Array(4*4*4);
for(var N=0;N<i;N+=4)for(var n=0;n<Y;n+=4){W(f,p,e);o(R,Y,i,n,N,e);p+=8}return p}function C(f,p,R,Y,i){var e=new Uint8Array(16*4),N=0;
for(var n=0;n<R;n+=4)for(var O=0;O<p;O+=4){V(f,p,R,O,n,e);N+=S(Y,i,e);i+=8}return i}function E(f,p,R,Y,i){var e={O:p*8},N=new Uint8Array(4*4*4);
for(var n=0;n<i;n+=4)for(var O=0;O<Y;O+=4){W(f,p+8,N,!0);for(var c=0;c<64;c+=4){var h=ad(f,e,4);N[c+3]=255*(h/15)}o(R,Y,i,O,n,N);
p+=16;e.O+=64}return p}function x(f,p){var R=[f,p];if(f>p)R.push(6/7*f+1/7*p,5/7*f+2/7*p,4/7*f+3/7*p,3/7*f+4/7*p,2/7*f+5/7*p,1/7*f+6/7*p);
else R.push(4/5*f+1/5*p,3/5*f+2/5*p,2/5*f+3/5*p,1/5*f+4/5*p,0,255);return R}function b(f,p,R,Y,i){var e=x(f[p],f[p+1]);
R.O+=16;for(var N=0;N<64;N+=4){var n=ad(f,R,3);Y[N+i]=e[n]}}function am(f,p,R,Y,i){var e={O:p*8},N=new Uint8Array(4*4*4);
N.fill(255);for(var n=0;n<i;n+=4)for(var O=0;O<Y;O+=4){b(f,p,e,N,1);p+=8;b(f,p,e,N,0);p+=8;o(R,Y,i,O,n,N)}return p}function ae(f,p,R,Y,i){var e={O:p*8},N=new Uint8Array(4*4*4);
for(var n=0;n<i;n+=4)for(var O=0;O<Y;O+=4){W(f,p+8,N,!0);b(f,p,e,N,3);e.O+=64;o(R,Y,i,O,n,N);p+=16}return p}function F(f,p,R,Y,i){var e=new Uint8Array(16*4);
for(var N=0;N<R;N+=4)for(var n=0;n<p;n+=4){V(f,p,R,n,N,e);var O=e[3],c=e[3];for(var h=7;h<64;h+=4){var Z=e[h];
if(Z<O)O=Z;else if(c<Z)c=Z}Y[i]=c;Y[i+1]=O;i+=2;var A=x(c,O),I=i+2<<3;for(var h=0;h<64;h+=32){var u=0,I=0;
for(var X=0;X<32;X+=4){var M=0,t=500,Z=e[h+X+3];for(var $=0;$<8;$++){var H=Math.abs(A[$]-Z);if(H<t){t=H;
M=$}}u=u|M<<I;I+=3}Y[i]=u;Y[i+1]=u>>8;Y[i+2]=u>>16;i+=3}S(Y,i,e,!0);i+=8}return i}var d=new Uint8Array(16);
function l(f,p,R){var Y=f[p+1]<<8|f[p],i=f[p+3]<<8|f[p+2],e=(Y&31)*(255/31),N=(Y>>>5&31)*(255/31),n=(Y>>10)*(255/31),O=(i&31)*(255/31),c=(i>>>5&63)*(255/63),h=(i>>11)*(255/31),Z=d;
Z[0]=K(n);Z[1]=K(N);Z[2]=K(e);Z[3]=255;Z[12]=K(h);Z[13]=K(c);Z[14]=K(O);Z[15]=255;var A=2/3,I=1-A;Z[4]=K(A*n+I*h);
Z[5]=K(A*N+I*c);Z[6]=K(A*e+I*O);Z[7]=255;A=1/3;I=1-A;Z[8]=K(A*n+I*h);Z[9]=K(A*N+I*c);Z[10]=K(A*e+I*O);
Z[11]=255;ak(f,R,Z,p)}function s(f,p,R){var Y=(R&63488)>>>11,i=(R&2016)>>>5,e=(R&31)>>>0;f[p+0]=Y*33>>>2;
f[p+1]=i*65>>>4;f[p+2]=e*33>>>2}function L(f,p,R){return K(f*(31/255))<<11|K(p*(63/255))<<5|K(R*(31/255))}function j(f,p,R){return f*(64-R)+p*R+32>>6}function T(f,p,R,Y){p[R]=j(f[0],f[4],Y);
p[R+1]=j(f[1],f[5],Y);p[R+2]=j(f[2],f[6],Y);p[R+3]=255}function W(f,p,R,Y){var i=f[p+1]<<8|f[p],e=f[p+3]<<8|f[p+2],N=y(i,e,Y);
ak(f,R,N,p)}function y(f,p,R){var Y=d;s(Y,0,f);Y[3]=255;s(Y,4,p);Y[7]=255;if(p<f||R){T(Y,Y,8,21);T(Y,Y,12,43)}else{T(Y,Y,8,32);
Y[12]=0;Y[13]=0;Y[14]=0;Y[15]=0}return Y}function ak(f,p,R,Y){var i=Y+4<<3;for(var e=0;e<64;e+=4){var N=f[i>>3]>>(i&7)&3;
i+=2;N=N<<2;p[e]=R[N];p[e+1]=R[N+1];p[e+2]=R[N+2];p[e+3]=R[N+3]}}function K(f){return~~(.5+f)}function q(f,p){for(var R=0;
R<3;R++)p[R]=p[R+3]=f[R];for(var R=0;R<64;R+=4){var Y=f[R],i=f[R+1],e=f[R+2];if(Y<p[0])p[0]=Y;if(i<p[1])p[1]=i;
if(e<p[2])p[2]=e;if(Y>p[3])p[3]=Y;if(i>p[4])p[4]=i;if(e>p[5])p[5]=e}}function ab(f,p,R){for(var Y=0;
Y<3;Y++){var i=K((f[Y+3]-f[Y])*R),e=f[Y]+i,N=f[Y+3]-i;p[Y]=e<0?0:e>255?255:e;p[Y+3]=N<0?0:N>255?255:N}}function S(f,p,R,Y){var i=0,e=0,N=1e9,n=[0,0,0,0,0,0],O=255;
for(var c=3;c<64;c+=4)O&=R[c];var h=Y?!1:O<128;if(!1){q(R,h);ab(h,1/11)}else{var Z=n.slice(0);q(R,Z);
var A=-1,I=-1;for(var u=-.1;u<.3;u+=.005){ab(Z,n,u);var X=L(n[0],n[1],n[2]),M=L(n[3],n[4],n[5]);if(X==A&&M==I)continue;
A=X;I=M;var t=Q(f,p,R,h,X,M);if(t<N){i=X;e=M;N=t}}v(R,n);var X=L(n[0],n[1],n[2]),M=L(n[3],n[4],n[5]);
t=Q(f,p,R,h,X,M);if(t<N){i=X;e=M;N=t}}var $=Q(f,p,R,h,i,e);return $}function Q(f,p,R,Y,i,e){if(i<e!=Y){var N=i;
i=e;e=N}f[p+0]=i&255;f[p+1]=i>>8;f[p+2]=e&255;f[p+3]=e>>8;var n=y(i,e),O=p*8+32,c=0;f[p+4]=0;f[p+5]=0;
f[p+6]=0;f[p+7]=0;var h=U;for(var Z=0;Z<64;Z+=4){var A=R[Z],I=R[Z+1],u=R[Z+2],X=R[Z+3],M=h(A,I,u,n[0],n[1],n[2]),t=h(A,I,u,n[4],n[5],n[6]),$=h(A,I,u,n[8],n[9],n[10]),H=h(A,I,u,n[12],n[13],n[14]),m=Math.min(Math.min(M,t),Math.min($,H)),g=0;
c+=m;if(Y&&X<128)g=3;else if(m==t)g=1;else if(m==$)g=2;else if(m==H)g=3;f[O>>3]|=g<<(O&7);O+=2}return c}function V(f,p,R,Y,i,e){for(var N=0;
N<4;N++){var n=(i+N)*p+Y<<2,O=N<<4;e[O+0]=f[n+0];e[O+1]=f[n+1];e[O+2]=f[n+2];e[O+3]=f[n+3];e[O+4]=f[n+4];
e[O+5]=f[n+5];e[O+6]=f[n+6];e[O+7]=f[n+7];e[O+8]=f[n+8];e[O+9]=f[n+9];e[O+10]=f[n+10];e[O+11]=f[n+11];
e[O+12]=f[n+12];e[O+13]=f[n+13];e[O+14]=f[n+14];e[O+15]=f[n+15]}}function o(f,p,R,Y,i,e){for(var N=0;
N<4;N++){var n=(i+N)*p+Y<<2,O=N<<4;f[n+0]=e[O+0];f[n+1]=e[O+1];f[n+2]=e[O+2];f[n+3]=e[O+3];f[n+4]=e[O+4];
f[n+5]=e[O+5];f[n+6]=e[O+6];f[n+7]=e[O+7];f[n+8]=e[O+8];f[n+9]=e[O+9];f[n+10]=e[O+10];f[n+11]=e[O+11];
f[n+12]=e[O+12];f[n+13]=e[O+13];f[n+14]=e[O+14];f[n+15]=e[O+15]}}function ad(f,p,R){var Y=0,i=R;while(R!=0){Y=Y|k(f,p)<<i-R;
R--}return Y}function k(f,p){var R=p.O;p.O++;return f[R>>3]>>(R&7)&1}function a7(f,p,R){var Y=p>>1,i=R>>1,e=new Uint8Array(Y*i*4);
for(var N=0;N<i;N++)for(var n=0;n<Y;n++){var O=N*Y+n<<2,c=(N<<1)*p+(n<<1)<<2,h=f[c+3],Z=f[c+7],A=f[c]*h+f[c+4]*Z,I=f[c+1]*h+f[c+5]*Z,u=f[c+2]*h+f[c+6]*Z;
c+=p<<2;var X=f[c+3],M=f[c+7];A+=f[c]*X+f[c+4]*M;I+=f[c+1]*X+f[c+5]*M;u+=f[c+2]*X+f[c+6]*M;var g=h+Z+X+M+2>>2,w=g==0?0:.25/g;
e[O]=~~(A*w+.5);e[O+1]=~~(I*w+.5);e[O+2]=~~(u*w+.5);e[O+3]=g}return e}function U(f,p,R,Y,i,e){var N=f-Y,n=p-i,O=R-e;
return N*N+n*n+O*O}function v(f,p){var R=U,Y=0,i=0,e=0;for(var N=0;N<64;N+=4){var n=f[N],O=f[N+1],c=f[N+2];
for(var h=N+4;h<64;h+=4){var Z=R(n,O,c,f[h],f[h+1],f[h+2]);if(Z>e){e=Z;Y=N;i=h}}}for(var N=0;N<3;N++){p[N]=f[Y+N];
p[N+3]=f[i+N]}}var ar=new ArrayBuffer(4),aw=new Uint8Array(ar),G=new Uint32Array(ar),a1=new Uint16Array(ar),a5={D:function(f,p){aw[0]=f[p+0];
aw[1]=f[p+1];return a1[0]},M:function(f,p){aw[0]=f[p+0];aw[1]=f[p+1];aw[2]=f[p+2];aw[3]=f[p+3];return G[0]},q:function(f,p,R){G[0]=R;
f[p+0]=aw[0];f[p+1]=aw[1];f[p+2]=aw[2];f[p+3]=aw[3]},g:function(f,p,R){var Y="";for(var i=0;i<R;i++)Y+=String.fromCharCode(f[p+i]);
return Y},u:function(f,p,R){for(var Y=0;Y<R.length;Y++)f[p+Y]=R.charCodeAt(Y)},B:ad,k:V,J:o,a7:U};return{readBC1:D,m:D,$:E,C:ae,P:am,n:r,r:a0,_:C,s:F,X:a7,K:a5}}();
(function(){var r=[["0000000000000000"],"0011001100110011 0001000100010001 0111011101110111 0001001100110111 0000000100010011 0011011101111111 0001001101111111 0000000100110111 0000000000010011 0011011111111111 0000000101111111 0000000000010111 0001011111111111 0000000011111111 0000111111111111 0000000000001111 0000100011101111 0111000100000000 0000000010001110 0111001100010000 0011000100000000 0000100011001110 0000000010001100 0111001100110001 0011000100010000 0000100010001100 0110011001100110 0011011001101100 0001011111101000 0000111111110000 0111000110001110 0011100110011100 0101010101010101 0000111100001111 0101101001011010 0011001111001100 0011110000111100 0101010110101010 0110100101101001 0101101010100101 0111001111001110 0001001111001000 0011001001001100 0011101111011100 0110100110010110 0011110011000011 0110011010011001 0000011001100000 0100111001000000 0010011100100000 0000001001110010 0000010011100100 0110110010010011 0011011011001001 0110001110011100 0011100111000110 0110110011001001 0110001100111001 0111111010000001 0001100011100111 0000111100110011 0011001111110000 0010001011101110 0100010001110111".split(" "),"0011001102212222 0001001122112221 0000200122112211 0222002200110111 0000000011221122 0011001100220022 0022002211111111 0011001122112211 0000000011112222 0000111111112222 0000111122222222 0012001200120012 0112011201120112 0122012201220122 0011011211221222 0011200122002220 0001001101121122 0111001120012200 0000112211221122 0022002200221111 0111011102220222 0001000122212221 0000001101220122 0000110022102210 0122012200110000 0012001211222222 0110122112210110 0000011012211221 0022110211020022 0110011020022222 0011012201220011 0000200022112221 0000000211221222 0222002200120011 0011001200220222 0120012001200120 0000111122220000 0120120120120120 0120201212010120 0011220011220011 0011112222000011 0101010122222222 0000000021212121 0022112200221122 0022001100220011 0220122102201221 0101222222220101 0000212121212121 0101010101012222 0222011102220111 0002111200021112 0000211221122112 0222011101110222 0002111211120002 0110011001102222 0000000021122112 0110011022222222 0022001100110022 0022112211220022 0000000000002112 0002000100020001 0222122202221222 0101222222222222 0111201122012220".split(" ")],a0=[],S,Q,V,o,ad,k,a7,U,v;
for(var D=0;D<r.length;D++){a0.push([]);for(var C=0;C<r[D].length;C++){var E=[];a0[D].push(E);var x=[];
for(var b=0;b<D+1;b++){E.push([]);x.push([])}var am=r[D][C],l=r[D][C]=new Uint8Array(16);for(var b=0;
b<16;b++){var s=l[b]=am.charCodeAt(b)-48;E[s].push(b)}}}var L=[[[0,0,0]],[[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,2,0],[0,8,0],[0,2,0],[0,2,0],[0,8,0],[0,8,0],[0,15,0],[0,2,0],[0,8,0],[0,2,0],[0,2,0],[0,8,0],[0,8,0],[0,2,0],[0,2,0],[0,15,0],[0,15,0],[0,6,0],[0,8,0],[0,2,0],[0,8,0],[0,15,0],[0,15,0],[0,2,0],[0,8,0],[0,2,0],[0,2,0],[0,2,0],[0,15,0],[0,15,0],[0,6,0],[0,6,0],[0,2,0],[0,6,0],[0,8,0],[0,15,0],[0,15,0],[0,2,0],[0,2,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,15,0],[0,2,0],[0,2,0],[0,15,0]],[[0,3,15],[0,3,8],[0,15,8],[0,15,3],[0,8,15],[0,3,15],[0,15,3],[0,15,8],[0,8,15],[0,8,15],[0,6,15],[0,6,15],[0,6,15],[0,5,15],[0,3,15],[0,3,8],[0,3,15],[0,3,8],[0,8,15],[0,15,3],[0,3,15],[0,3,8],[0,6,15],[0,10,8],[0,5,3],[0,8,15],[0,8,6],[0,6,10],[0,8,15],[0,5,15],[0,15,10],[0,15,8],[0,8,15],[0,15,3],[0,3,15],[0,5,10],[0,6,10],[0,10,8],[0,8,9],[0,15,10],[0,15,6],[0,3,15],[0,15,8],[0,5,15],[0,15,3],[0,15,6],[0,15,6],[0,15,8],[0,3,15],[0,15,3],[0,5,15],[0,5,15],[0,5,15],[0,8,15],[0,5,15],[0,10,15],[0,5,15],[0,10,15],[0,8,15],[0,13,15],[0,15,3],[0,12,15],[0,3,15],[0,3,8]]],j=[];
for(var T=0;T<3;T++){var W=j[T]=[],y=L[T];for(var D=0;D<y.length;D++){var K=y[D],q=W[D]=new Uint8Array(16);
q[K[0]]=q[K[1]]=q[K[2]]=1}}var ab=[null,null,[0,21,43,64],[0,9,18,27,37,46,55,64],[0,4,9,13,17,21,26,30,34,38,43,47,51,55,60,64]];
function ar(h){S=h;Q=[4,6,6,6,0,0,0,6][S];V=[4,6,5,7,5,7,7,5][S];o=[0,0,0,0,6,8,7,5][S];ad=[1,1,0,1,0,0,1,1][S];
k=[6,4,6,4,2,2,2,4][S];a7=k>>>1;U=[3,3,2,2,2,2,4,2][S];v=[0,0,0,0,3,2,0,0][S]}function aw(h,Z){h<<=8-Z;
h|=h>>Z;return h}function G(h,Z,A){return h*(64-A)+Z*A+32>>6}function a1(h,Z,A,I,u,X){var M=UTEX.K.B,t={O:0},$=new Uint8Array(4*4*4);
for(var H=0;H<u;H+=4)for(var m=0;m<I;m+=4){var g=0;while((h[Z]>>g&1)!=1)g++;ar(g);t.O=(Z<<3)+S+1;var w=S==4||S==5?M(h,t,2):0,P=S==4?M(h,t,1):0,ay=M(h,t,Q),_=new Uint8Array(24);
for(var D=0;D<4;D++){var J=D==3?o:V;for(var C=0;C<k;C++)_[D*k+C]=M(h,t,J)}for(var C=0;C<k;C++){if(S==1&&(C&1)==1)t.O--;
var aa=M(h,t,ad);for(var D=0;D<3;D++)f(_,D*k+C,ad,aa);if(o!=0)f(_,3*k+C,ad,aa)}V+=ad;if(o!=0)o+=ad;for(var D=0;
D<4;D++){var J=D==3?o:V;for(var C=0;C<k;C++)_[D*k+C]=aw(_[D*k+C],J)}if(o==0)for(var C=0;C<k;C++)_[3*k+C]=255;
var au=r[a7-1][ay],a=L[a7-1][ay],z=t.O,ah=z+16*U-a7;if(P==1){var ai=z;z=ah;ah=ai;ai=U;U=v;v=ai}var an=ab[U];
t.O=z;for(var D=0;D<64;D+=4){var B=au[D>>2],aj=a[B]==D>>2?1:0,ac=t.O%(16*8),a4=M(h,t,U-aj),aq=an[a4];
$[D]=G(_[0*k+2*B],_[0*k+2*B+1],aq);$[D+1]=G(_[1*k+2*B],_[1*k+2*B+1],aq);$[D+2]=G(_[2*k+2*B],_[2*k+2*B+1],aq);
$[D+3]=G(_[3*k+2*B],_[3*k+2*B+1],aq)}an=ab[v];t.O=ah;if(v!=0)for(var D=0;D<64;D+=4){var B=au[D>>2],aj=a[B]==D>>2?1:0,a4=M(h,t,v-aj),aq=an[a4];
$[D+3]=G(_[3*k+2*B],_[3*k+2*B+1],aq)}if(w!=0)p($,w);UTEX.K.J(A,I,u,m,H,$);Z+=16}return Z}function a5(h){return~~(.5+h)}function f(h,D,ad,Z){h[D]=h[D]<<ad|Z}function p(h,Z){for(var D=0;
D<64;D+=4){var A=h[D+Z-1];h[D+Z-1]=h[D+3];h[D+3]=A}}var R=[];for(var D=0;D<4;D++)R[D]=new Uint8Array(D*8);
function Y(h,a7,E){var Z=R[a7];for(var s=0;s<a7;s++){var A=E[s],I=A.length,u=A[0]<<2,X=h[u],M=h[u+1],t=h[u+2],$=h[u+3],H=X,m=M,g=t,w=$;
for(var D=1;D<I;D++){u=A[D]<<2;var P=h[u],ay=h[u+1],_=h[u+2],l=h[u+3];if(P<X)X=P;else if(P>H)H=P;if(ay<M)M=ay;
else if(ay>m)m=ay;if(_<t)t=_;else if(_>g)g=_;if(l<$)$=l;else if(l>w)w=l}var J=s<<3;Z[J]=X;Z[J+1]=M;Z[J+2]=t;
Z[J+3]=$;Z[J+4]=H;Z[J+5]=m;Z[J+6]=g;Z[J+7]=w}return Z}function i(h){var Z=h[0]+h[4]-h[8]-h[12],A=h[1]+h[5]-h[9]-h[13],I=h[2]+h[6]-h[10]-h[14],u=h[3]+h[7]-h[11]-h[15];
return Z*Z+A*A+I*I+u*u}function e(h,Z,A){A=A<<(Z&7);var I=Z>>>3;h[I]|=A;h[I+1]|=A>>>8}function N(h,Z,A,I){var u=1e9,X=0,q=new Uint8Array(16),M=new Uint8Array(24),t=255,$=0;
for(var D=0;D<64;D+=4){var H=A[D+3];if(H<t)t=H;if(H>$)$=H}var m=t<255,g=m?[4,5,6,7]:[1,3,6],w={},P=new Uint8Array(8);
for(var ay=0;ay<g.length;ay++){ar(g[ay]);var _=o!=0&&v==0&&m,J=ad==1&&S>3?1:0,aa=ad==0||S>3||S==1,au=S==1?2:ad*k,a=a7==1?[0]:w[a7+","+Q],z,ah=S+1+Q+k*(3*V+o)+au;
if(S==4||S==5){ah+=2;if(S==4)ah++}if(a==null){var ai=a0[a7-1];a=w[a7+","+Q]=[0,0,0,0,0];z=[-1,-1,-1,-1,-1];
for(var an=0;an<1<<Q;an++){var E=ai[an],B=a.length-1;z[B]=i(Y(A,a7,E));a[B]=an;while(B!=0&&z[B-1]<z[B]){var aj=z[B];
z[B]=z[B-1];z[B-1]=aj;var aj=a[B];a[B]=a[B-1];a[B-1]=aj;B--}}a.pop()}for(var ac=0;ac<a.length;ac++){var an=a[ac],a4=0,aq=0,ap=ah,af=0;
q.fill(0);var a3=r[a7-1][an],E=a0[a7-1][an],a6=L[a7-1][an],al=j[a7-1][an],as=Y(A,a7,E),at=o==0?3:4;for(var s=0;
s<k;s++){P[6]=P[7]=0;for(var D=0;D<at;D++){var ao=D==3?o:V,a2=as[(s<<2)+D]>>>7-ao;P[6+(a2&1)]++}var a8=P[s]=aa?J:P[6]>P[7]?0:1;
for(var D=0;D<at;D++){var ao=D==3?o:V,a2=as[(s<<2)+D]>>>8-ao;M[D*k+s]=aw(a2<<ad|a8,ao+ad)}}for(var s=0;
s<a7;s++){var a9=a6[s]*4,B=(_?n(A,a9,M,s):O(A,a9,M,s))&255;if(B>>>U-1==1){for(var D=0;D<at;D++){var C=D*k+s*2,aj=M[C];
M[C]=M[C+1];M[C+1]=aj;aj=P[s*2];P[s*2]=P[s*2+1];P[s*2+1]=aj}}if(v==0)continue;var B=c(A,a9,M,s)&255;
if(B>>>v-1==1){var C=3*k+s*2,aj=M[C];M[C]=M[C+1];M[C+1]=aj}}for(var D=0;D<64;D+=4){var s=a3[D>>2],ax=_?n(A,D,M,s):O(A,D,M,s),B=ax&255;
af+=ax>>>8;e(q,ap,B);ap+=U-al[D>>>2]}if(v!=0)for(var D=0;D<64;D+=4){var s=a3[D>>2],ax=c(A,D,M,s),B=ax&255;
af+=ax>>>8;e(q,ap,B);ap+=v-al[D>>>2]}if(af<u){ap=0;e(q,ap,1<<S);ap+=S+1;e(q,ap,an);ap+=Q;if(S==4||S==5){e(q,ap,a4);
ap+=2;if(S==4){e(q,ap,aq);ap+=1}}for(var D=0;D<at;D++){var ao=D==3?o:V;for(var s=0;s<k;s++){var a2=M[D*k+s]>>>8-ao;
e(q,ap,a2);ap+=ao}}for(var D=0;D<au;D++)e(q,ap+D,P[D]);ap+=au;u=af;h.set(q,Z);X=S}}}return u}function n(h,C,Z,s){var A=h[C],I=h[C+1],u=h[C+2],l=h[C+3],X=2*s,M=k+2*s,t=2*k+2*s,$=3*k+2*s,H=Z[X],m=Z[X+1],g=Z[M],w=Z[M+1],P=Z[t],ay=Z[t+1],_=Z[$],J=Z[$+1],aa=0,top=(1<<U)-1;
if(H!=m||g!=w||P!=ay||_!=J){var au=m-H,a=w-g,z=ay-P,ah=J-_,ai=(A-H)*au+(I-g)*a+(u-P)*z+(l-_)*ah,an=.999999999*ai/(au*au+a*a+z*z+ah*ah);
an=an<0?0:an>1?1:an;aa=a5(an*top)}var B=ab[U][aa];au=G(H,m,B)-A;a=G(g,w,B)-I;z=G(P,ay,B)-u;ah=G(_,J,B)-l;
var aj=au*au+a*a+z*z+ah*ah;return aj<<8|aa}function O(h,C,Z,s){var A=h[C],I=h[C+1],u=h[C+2],X=2*s,M=k+2*s,t=2*k+2*s,$=Z[X],H=Z[X+1],m=Z[M],g=Z[M+1],w=Z[t],P=Z[t+1],ay=0,top=(1<<U)-1;
if($!=H||m!=g||w!=P){var _=H-$,J=g-m,aa=P-w,au=(A-$)*_+(I-m)*J+(u-w)*aa,a=.999999999*au/(_*_+J*J+aa*aa);
a=a<0?0:a>1?1:a;ay=a5(a*top)}var z=ab[U][ay];_=G($,H,z)-A;J=G(m,g,z)-I;aa=G(w,P,z)-u;var ah=_*_+J*J+aa*aa;
return ah<<8|ay}function c(h,C,Z,s){var l=h[C+3],A=3*k+2*s,I=Z[A],u=Z[A+1],X=0,top=(1<<v)-1;if(I!=u){var M=u-I,H=(l-I)*M,m=.999999999*H/(M*M);
m=m<0?0:m>1?1:m;X=a5(m*top)}var g=ab[v][X];M=G(I,u,g)-l;var w=M*M;return w<<8|X}function ag(h,Z,A,I,u){var X=Date.now(),M=u;
for(var D=0;D<1;D++){var t=new Uint8Array(16*4+16*4),$=0;u=M;for(var H=0;H<A;H+=4)for(var m=0;m<Z;m+=4){UTEX.K.k(h,Z,A,m,H,t);
$+=N(I,u,t,m==80&&H==160);u+=16}}return u}UTEX.z=a1;UTEX.a=ag}());UTEX.DDS=function(){var r={S:1,b:2,j:4,T:8,t:4096,p:131072,W:524288,a2:8388608,G:1,Z:2,i:4,d:64,a1:512,I:131072,V:8,Y:4194304,f:4096};
function a0(F){var d=new Uint8Array(F),l=0,s=UTEX.K.g(d,l,4),L,j,T;l+=4;L=C(d,l);l+=124;j=L.A;if(j.L&r.i&&j.w=="DX10"){T=am(d,l);
l+=20}var W=L.width,y=L.height,ak=[],K=j.w,q=j.c,ab={DXT1:"BC1",DXT3:"BC2",DXT5:"BC3",DX10:"BC7",ATI2:"BC5",BC5U:"BC5"};
if(ab[K])K=ab[K];if(T){var Q=T.H;if(70<=Q&&Q<=72)K="BC1";else if(73<=Q&&Q<=75)K="BC2";else if(76<=Q&&Q<=78)K="BC3";
else if(97<=Q&&Q<=99)K="BC7";else console.log("Unknown DX10 format",Q)}var V=Math.max(1,L.N),o=(j.L&r.G)!=0;
for(var ad=0;ad<V;ad++){var k=W*y,U=k*4,v=new Uint8Array(U);if(!1){}else if(K=="BC1")l=UTEX.m(d,l,v,W,y);
else if(K=="BC2")l=UTEX.$(d,l,v,W,y);else if(K=="BC3")l=UTEX.C(d,l,v,W,y);else if(K=="BC5")l=UTEX.P(d,l,v,W,y);
else if(K=="BC7")l=UTEX.z(d,l,v,W,y);else if(K=="ATC ")l=UTEX.n(d,l,v,W,y);else if(K=="ATCA")l=UTEX.r(d,l,v,W,y);
else if(K=="ATCI")l=UTEX.r(d,l,v,W,y);else if(j.L&r.d){var ar=j.v,aw=255/ar,G=j.o,a1=255/G,a5=j.l,f=255/a5,p=j.e,R=255/p;
if(q==32){for(var Y=0;Y<U;Y+=4){var i=d[l+Y+3]<<24|d[l+Y+2]<<16|d[l+Y+1]<<8|d[l+Y];v[Y+0]=(i&ar)*aw;
v[Y+1]=(i&G)*a1;v[Y+2]=(i&a5)*f;v[Y+3]=o?(i&p)*R:255}l+=U}else if(q==16){for(var Y=0;Y<U;Y+=4){var i=d[l+(Y>>1)+1]<<8|d[l+(Y>>1)];
v[Y+0]=(i&ar)*aw;v[Y+1]=(i&G)*a1;v[Y+2]=(i&a5)*f;v[Y+3]=o?(i&p)*R:255}l+=U>>>1}else throw"unknown bit count "+q}else if(j.L&r.Z||o||j.L&r.I){if(q==8){if(j.L&r.Z){for(var Y=0;
Y<U;Y+=4)v[Y+3]=d[l+(Y>>2)]}else{v.fill(255);for(var Y=0;Y<U;Y+=4)v[Y]=v[Y+1]=v[Y+2]=d[l+(Y>>2)]}l+=U>>>2}else if(q==16){v.fill(255);
for(var Y=0;Y<U;Y+=4)v[Y]=v[Y+1]=v[Y+2]=d[l+(Y>>1)];l+=U>>>1}else throw"unknown bit count "+q}else if(j.L&r.d&&q==24){for(var Y=0;
Y<k;Y++){var e=Y*4,N=Y*3;v[e+0]=d[l+N];v[e+1]=d[l+N+1];v[e+2]=d[l+N+2];v[e+3]=255}}else{console.log("unknown texture format, head flags: ",L.L.toString(2),"pixelFormat flags: ",j.L.toString(2));
throw"e"}ak.push({width:W,height:y,image:v.buffer});W=W>>>1;y=y>>>1}return ak}function D(F,d,l,s){if(s==null)s=[0,!0];
var F=new Uint8Array(F),L=["BC1","BC3","BC7","NON"][s[0]],j=s[1],T=new Uint8Array(124+d*l*6),W=0,y=0;
UTEX.K.u(T,W,"DDS ");W+=4;E(T,d,l,j,L,W);W+=124;if(L=="BC7"){ae(T,W);W+=20}while(d*l!=0){if(L=="NON"){T.set(F,W);
W+=F.length}if(L=="BC1")W=UTEX._(F,d,l,T,W);if(L=="BC3")W=UTEX.s(F,d,l,T,W);if(L=="BC7")W=UTEX.a(F,d,l,T,W);
F=UTEX.X(F,d,l);d=d>>1;l=l>>1;y++;if(!j)break}T[28]=y;return T.buffer.slice(0,W)}function C(F,d){var l={},s=UTEX.K.M,L=s(F,d);
d+=4;if(L!=124)throw L;l.L=s(F,d);d+=4;l.height=s(F,d);d+=4;l.width=s(F,d);d+=4;l.pitch=s(F,d);d+=4;
l.depth=s(F,d);d+=4;l.N=s(F,d);d+=4;d+=11*4;l.A=x(F,d);d+=32;l.a6=s(F,d);d+=4;l.aa=s(F,d);d+=4;l.a0=s(F,d);
d+=4;l.a9=s(F,d);d+=4;if(s(F,d)!=0)console.log("not zeros",s(F,d).toString(16));d+=4;return l}function E(F,d,l,s,L,j){var T=UTEX.K.q,W=r.S|r.b|r.j|r.t,K=1;
W|=r.p|(L?r.W:r.T);var y=(s?r.Y:0)|r.f|(s?r.V:0),ak=L=="NON"?d*l*4:(d*l>>>1)*(L=="BC1"?1:2);T(F,j,124);
j+=4;T(F,j,W);j+=4;T(F,j,l);j+=4;T(F,j,d);j+=4;T(F,j,ak);j+=4;T(F,j,K);j+=4;T(F,j,10);j+=4;j+=11*4;b(F,L,j);
j+=32;T(F,j,y);j+=4;j+=4*4}function x(F,d){var l={},s=UTEX.K.M,L=s(F,d);d+=4;if(L!=32&&L!=0)throw L;
l.L=s(F,d);d+=4;l.w=UTEX.K.g(F,d,4);d+=4;l.c=s(F,d);d+=4;l.v=s(F,d);d+=4;l.o=s(F,d);d+=4;l.l=s(F,d);
d+=4;l.e=s(F,d);d+=4;return l}function b(F,d,l){var s=UTEX.K.q,L=d!="NON"?r.i:r.G|r.d;s(F,l,32);l+=4;
s(F,l,L);l+=4;UTEX.K.u(F,l,{NON:"    ",BC1:"DXT1",BC3:"DXT5",BC7:"DX10"}[d]);l+=4;if(d=="NON"){s(F,l,32);
for(var j=0;j<4;j++)s(F,l+4+j*4,255<<j*8)}l+=5*4}function am(F,d){var l={},s=UTEX.K.M;l.H=s(F,d);d+=4;
l.a3=s(F,d);d+=4;l.a4=s(F,d);d+=4;l.ac=s(F,d);d+=4;l.a5=s(F,d);d+=4;return l}function ae(F,d){var l=UTEX.K.q;
l(F,d,98);d+=4;l(F,d,3);d+=4;l(F,d,0);d+=4;l(F,d,1);d+=4;l(F,d,0);d+=4}return{encode:D,decode:a0}}();
UTEX.VTF=function(){var r={};function a0(C){var E=new Uint8Array(C),x=0,b={};x=D(E,x,b);var am=b.Q,ae=b.R;
if(am*ae!=0){var F=new Uint8Array(am*ae*4);x=UTEX.m(E,x,F,am,ae)}var d=b.F,l=b.h,s=[];for(var L=0;L<l;
L++){var j=b.width>>>l-1-L,T=b.height>>>l-1-L;for(var W=0;W<b.frames;W++){var F=new Uint8Array(j*T*4);
if(d==0||d==12){var y=x,ak=d==0?[0,1,2,3]:[2,1,0,3],K=ak[0],q=ak[1],ab=ak[2],Q=ak[3];for(var V=0;V<F.length;
V+=4){F[V+K]=E[y++];F[V+q]=E[y++];F[V+ab]=E[y++];F[V+Q]=E[y++]}x+=j*T*4}else if(d==2){for(var V=0;V<F.length;
V+=4){F[V]=E[x++];F[V+1]=E[x++];F[V+2]=E[x++];F[V+3]=255}}else if(d==13)x=UTEX.m(E,x,F,j,T);else if(d==14)x=UTEX.$(E,x,F,j,T);
else if(d==15)x=UTEX.C(E,x,F,j,T);else throw d;s.push({width:j,height:T,image:F.buffer})}}return s}function D(C,E,x){var b=UTEX.K.M,am=UTEX.K.D,ae=UTEX.K.g(C,E,4);
E+=4;var F=b(C,E);E+=4;var d=b(C,E);E+=4;var l=b(C,E);E+=4;x.width=am(C,E);E+=2;x.height=am(C,E);E+=2;
x.L=b(C,E);E+=4;x.frames=am(C,E);E+=2;x.ad=am(C,E);E+=2;E+=4;E+=12;E+=4;E+=4;x.F=b(C,E);E+=4;x.h=C[E++];
x.ab=b(C,E);E+=4;x.Q=C[E++];x.R=C[E++];if(d>=2){x.depth=am(C,E);E+=2;if(d>=3){E+=3;x.a8=b(C,E);E+=4}}return l}return{decode:a0}}();

(function(){var r={};if(typeof module=="object"){module.exports=r}else{self.UTIF=r}function aS(){if(typeof process=="undefined"||process.env.NODE_ENV=="development")console.log.apply(console,arguments)}(function(r){(function(){"use strict";
var e=function R(){function e(m){this.message="JPEG error: "+m}e.prototype=new Error;e.prototype.name="JpegError";
e.constructor=e;return e}(),h=function p(){var m=new Uint8Array([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]),$=4017,_=799,N=3406,a=2276,J=1567,W=3784,H=5793,T=2896;
function h(x){if(x==null)x={};if(x.w==null)x.w=-1;this.V=x.n;this.N=x.w}function o(x,S){var c=0,f=[],F,D,v=16,P;
while(v>0&&!x[v-1]){v--}f.push({children:[],index:0});var E=f[0];for(F=0;F<v;F++){for(D=0;D<x[F];D++){E=f.pop();
E.children[E.index]=S[c];while(E.index>0){E=f.pop()}E.index++;f.push(E);while(f.length<=F){f.push(P={children:[],index:0});
E.children[E.index]=P.children;E=P}c++}if(F+1<v){f.push(P={children:[],index:0});E.children[E.index]=P.children;
E=P}}return f[0].children}function M(x,S,c){return 64*((x.P+1)*S+c)}function L(x,S,c,f,F,D,v,P,E,l){if(l==null)l=!1;
var aF=c.m,u=c.Z,w=S,ap=0,Z=0,O=0,B=0,z,y=0,Q,G,n,X,b4,aZ,aJ=0,aL,ay,ak,aW;function bb(){if(Z>0){Z--;
return ap>>Z&1}ap=x[S++];if(ap===255){var aA=x[S++];if(aA){if(aA===220&&l){S+=2;var aa=V(x,S);S+=2;if(aa>0&&aa!==c.s){throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",aa)}}else if(aA===217){if(l){var b0=y*8;
if(b0>0&&b0<c.s/10){throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, "+"possibly caused by incorrect `scanLines` parameter",b0)}}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new e("unexpected marker")}}Z=7;
return ap>>>7}function a$(aA){var aa=aA;while(!0){aa=aa[bb()];switch(typeof aa){case"number":return aa;
case"object":continue}throw new e("invalid huffman sequence")}}function al(aA){var b4=0;while(aA>0){b4=b4<<1|bb();
aA--}return b4}function a8(aA){if(aA===1){return bb()===1?1:-1}var b4=al(aA);if(b4>=1<<aA-1){return b4}return b4+(-1<<aA)+1}function b6(Q,aA){var aa=a$(Q.J),b0=aa===0?0:a8(aa),X=1;
Q.D[aA]=Q.Q+=b0;while(X<64){var aQ=a$(Q.i),aB=aQ&15,a4=aQ>>4;if(aB===0){if(a4<15){break}X+=16;continue}X+=a4;
var an=m[X];Q.D[aA+an]=a8(aB);X++}}function b7(Q,aA){var aa=a$(Q.J),b0=aa===0?0:a8(aa)<<E;Q.D[aA]=Q.Q+=b0}function ba(Q,aA){Q.D[aA]|=bb()<<E}function j(Q,aA){if(O>0){O--;
return}var X=D,aa=v;while(X<=aa){var b0=a$(Q.i),aQ=b0&15,aB=b0>>4;if(aQ===0){if(aB<15){O=al(aB)+(1<<aB)-1;
break}X+=16;continue}X+=aB;var a4=m[X];Q.D[aA+a4]=a8(aQ)*(1<<E);X++}}function aj(Q,aA){var X=D,aa=v,b0=0,aQ,aB;
while(X<=aa){var a4=aA+m[X],an=Q.D[a4]<0?-1:1;switch(B){case 0:aB=a$(Q.i);aQ=aB&15;b0=aB>>4;if(aQ===0){if(b0<15){O=al(b0)+(1<<b0);
B=4}else{b0=16;B=1}}else{if(aQ!==1){throw new e("invalid ACn encoding")}z=a8(aQ);B=b0?2:3}continue;case 1:case 2:if(Q.D[a4]){Q.D[a4]+=an*(bb()<<E)}else{b0--;
if(b0===0){B=B===2?3:0}}break;case 3:if(Q.D[a4]){Q.D[a4]+=an*(bb()<<E)}else{Q.D[a4]=z<<E;B=0}break;case 4:if(Q.D[a4]){Q.D[a4]+=an*(bb()<<E)}break}X++}if(B===4){O--;
if(O===0){B=0}}}function ae(Q,aA,aJ,aa,b0){var aQ=aJ/aF|0,aB=aJ%aF;y=aQ*Q.A+aa;var a4=aB*Q.h+b0,an=M(Q,y,a4);
aA(Q,an)}function b9(Q,aA,aJ){y=aJ/Q.P|0;var aa=aJ%Q.P,b0=M(Q,y,aa);aA(Q,b0)}var ab=f.length;if(u){if(D===0){aZ=P===0?b7:ba}else{aZ=P===0?j:aj}}else{aZ=b6}if(ab===1){ay=f[0].P*f[0].c}else{ay=aF*c.R}while(aJ<=ay){var ai=F?Math.min(ay-aJ,F):ay;
if(ai>0){for(G=0;G<ab;G++){f[G].Q=0}O=0;if(ab===1){Q=f[0];for(b4=0;b4<ai;b4++){b9(Q,aZ,aJ);aJ++}}else{for(b4=0;
b4<ai;b4++){for(G=0;G<ab;G++){Q=f[G];ak=Q.h;aW=Q.A;for(n=0;n<aW;n++){for(X=0;X<ak;X++){ae(Q,aZ,aJ,n,X)}}}aJ++}}}Z=0;
aL=C(x,S);if(!aL){break}if(aL.u){var a0=ai>0?"unexpected":"excessive";S=aL.offset}if(aL.M>=65488&&aL.M<=65495){S+=2}else{break}}return S-w}function b(x,S,c){var f=x.$,F=x.D,D,v,P,E,l,aF,u,w,ap,Z,O,B,z,y,Q,a1,G;
if(!f){throw new e("missing required Quantization Table.")}for(var n=0;n<64;n+=8){ap=F[S+n];Z=F[S+n+1];
O=F[S+n+2];B=F[S+n+3];z=F[S+n+4];y=F[S+n+5];Q=F[S+n+6];a1=F[S+n+7];ap*=f[n];if((Z|O|B|z|y|Q|a1)===0){G=H*ap+512>>10;
c[n]=G;c[n+1]=G;c[n+2]=G;c[n+3]=G;c[n+4]=G;c[n+5]=G;c[n+6]=G;c[n+7]=G;continue}Z*=f[n+1];O*=f[n+2];B*=f[n+3];
z*=f[n+4];y*=f[n+5];Q*=f[n+6];a1*=f[n+7];D=H*ap+128>>8;v=H*z+128>>8;P=O;E=Q;l=T*(Z-a1)+128>>8;w=T*(Z+a1)+128>>8;
aF=B<<4;u=y<<4;D=D+v+1>>1;v=D-v;G=P*W+E*J+128>>8;P=P*J-E*W+128>>8;E=G;l=l+u+1>>1;u=l-u;w=w+aF+1>>1;aF=w-aF;
D=D+E+1>>1;E=D-E;v=v+P+1>>1;P=v-P;G=l*a+w*N+2048>>12;l=l*N-w*a+2048>>12;w=G;G=aF*_+u*$+2048>>12;aF=aF*$-u*_+2048>>12;
u=G;c[n]=D+w;c[n+7]=D-w;c[n+1]=v+u;c[n+6]=v-u;c[n+2]=P+aF;c[n+5]=P-aF;c[n+3]=E+l;c[n+4]=E-l}for(var X=0;
X<8;++X){ap=c[X];Z=c[X+8];O=c[X+16];B=c[X+24];z=c[X+32];y=c[X+40];Q=c[X+48];a1=c[X+56];if((Z|O|B|z|y|Q|a1)===0){G=H*ap+8192>>14;
if(G<-2040){G=0}else if(G>=2024){G=255}else{G=G+2056>>4}F[S+X]=G;F[S+X+8]=G;F[S+X+16]=G;F[S+X+24]=G;
F[S+X+32]=G;F[S+X+40]=G;F[S+X+48]=G;F[S+X+56]=G;continue}D=H*ap+2048>>12;v=H*z+2048>>12;P=O;E=Q;l=T*(Z-a1)+2048>>12;
w=T*(Z+a1)+2048>>12;aF=B;u=y;D=(D+v+1>>1)+4112;v=D-v;G=P*W+E*J+2048>>12;P=P*J-E*W+2048>>12;E=G;l=l+u+1>>1;
u=l-u;w=w+aF+1>>1;aF=w-aF;D=D+E+1>>1;E=D-E;v=v+P+1>>1;P=v-P;G=l*a+w*N+2048>>12;l=l*N-w*a+2048>>12;w=G;
G=aF*_+u*$+2048>>12;aF=aF*$-u*_+2048>>12;u=G;ap=D+w;a1=D-w;Z=v+u;Q=v-u;O=P+aF;y=P-aF;B=E+l;z=E-l;if(ap<16){ap=0}else if(ap>=4080){ap=255}else{ap>>=4}if(Z<16){Z=0}else if(Z>=4080){Z=255}else{Z>>=4}if(O<16){O=0}else if(O>=4080){O=255}else{O>>=4}if(B<16){B=0}else if(B>=4080){B=255}else{B>>=4}if(z<16){z=0}else if(z>=4080){z=255}else{z>>=4}if(y<16){y=0}else if(y>=4080){y=255}else{y>>=4}if(Q<16){Q=0}else if(Q>=4080){Q=255}else{Q>>=4}if(a1<16){a1=0}else if(a1>=4080){a1=255}else{a1>>=4}F[S+X]=ap;
F[S+X+8]=Z;F[S+X+16]=O;F[S+X+24]=B;F[S+X+32]=z;F[S+X+40]=y;F[S+X+48]=Q;F[S+X+56]=a1}}function t(x,S){var c=S.P,f=S.c,F=new Int16Array(64);
for(var D=0;D<f;D++){for(var v=0;v<c;v++){var P=M(S,D,v);b(S,P,F)}}return S.D}function C(x,S,c){if(c==null)c=S;
var f=x.length-1,F=c<S?c:S;if(S>=f){return null}var D=V(x,S);if(D>=65472&&D<=65534){return{u:null,M:D,offset:S}}var v=V(x,F);
while(!(v>=65472&&v<=65534)){if(++F>=f){return null}v=V(x,F)}return{u:D.toString(16),M:v,offset:F}}h.prototype={parse(x,S){if(S==null)S={};
var c=S.F,f=0,F=null,D=null,v,P,E=0;function l(){var a4=V(x,f);f+=2;var an=f+a4-2,Z=C(x,an,f);if(Z&&Z.u){an=Z.offset}var ag=x.subarray(f,an);
f+=ag.length;return ag}function aF(v){var a4=Math.ceil(v.o/8/v.X),an=Math.ceil(v.s/8/v.B);for(var O=0;
O<v.W.length;O++){j=v.W[O];var ag=Math.ceil(Math.ceil(v.o/8)*j.h/v.X),aK=Math.ceil(Math.ceil(v.s/8)*j.A/v.B),au=a4*j.h,a2=an*j.A,a5=64*a2*(au+1);
j.D=new Int16Array(a5);j.P=ag;j.c=aK}v.m=a4;v.R=an}var u=[],w=[],ap=[],Z=V(x,f);f+=2;if(Z!==65496){throw new e("SOI not found")}Z=V(x,f);
f+=2;markerLoop:while(Z!==65497){var O,B,z;switch(Z){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 y=l();
if(Z===65504){if(y[0]===74&&y[1]===70&&y[2]===73&&y[3]===70&&y[4]===0){F={version:{d:y[5],T:y[6]},K:y[7],j:y[8]<<8|y[9],H:y[10]<<8|y[11],S:y[12],I:y[13],C:y.subarray(14,14+3*y[12]*y[13])}}}if(Z===65518){if(y[0]===65&&y[1]===100&&y[2]===111&&y[3]===98&&y[4]===101){D={version:y[5]<<8|y[6],k:y[7]<<8|y[8],q:y[9]<<8|y[10],a:y[11]}}}break;
case 65499:var Q=V(x,f),a1;f+=2;var G=Q+f-2;while(f<G){var n=x[f++],X=new Uint16Array(64);if(n>>4===0){for(B=0;
B<64;B++){a1=m[B];X[a1]=x[f++]}}else if(n>>4===1){for(B=0;B<64;B++){a1=m[B];X[a1]=V(x,f);f+=2}}else{throw new e("DQT - invalid table spec")}u[n&15]=X}break;
case 65472:case 65473:case 65474:if(v){throw new e("Only single frame JPEGs supported")}f+=2;v={};v.G=Z===65473;
v.Z=Z===65474;v.precision=x[f++];var b4=V(x,f),aZ,aJ=0,aL=0;f+=2;v.s=c||b4;v.o=V(x,f);f+=2;v.W=[];v._={};
var ay=x[f++];for(O=0;O<ay;O++){aZ=x[f];var ak=x[f+1]>>4,aW=x[f+1]&15;if(aJ<ak){aJ=ak}if(aL<aW){aL=aW}var bb=x[f+2];
z=v.W.push({h:ak,A:aW,L:bb,$:null});v._[aZ]=z-1;f+=3}v.X=aJ;v.B=aL;aF(v);break;case 65476:var a$=V(x,f);
f+=2;for(O=2;O<a$;){var al=x[f++],a8=new Uint8Array(16),b6=0;for(B=0;B<16;B++,f++){b6+=a8[B]=x[f]}var b7=new Uint8Array(b6);
for(B=0;B<b6;B++,f++){b7[B]=x[f]}O+=17+b6;(al>>4===0?ap:w)[al&15]=o(a8,b7)}break;case 65501:f+=2;P=V(x,f);
f+=2;break;case 65498:var ba=++E===1&&!c,j;f+=2;var aj=x[f++],ae=[];for(O=0;O<aj;O++){var b9=x[f++],ab=v._[b9];
j=v.W[ab];j.index=b9;var ai=x[f++];j.J=ap[ai>>4];j.i=w[ai&15];ae.push(j)}var a0=x[f++],aA=x[f++],aa=x[f++];
try{var b0=L(x,f,v,ae,P,a0,aA,aa>>4,aa&15,ba);f+=b0}catch(ex){if(ex instanceof DNLMarkerError){return this.parse(x,{F:ex.s})}else if(ex instanceof EOIMarkerError){break markerLoop}throw ex}break;
case 65500:f+=4;break;case 65535:if(x[f]!==255){f--}break;default:var aQ=C(x,f-2,f-3);if(aQ&&aQ.u){f=aQ.offset;
break}if(f>=x.length-1){break markerLoop}throw new e("JpegImage.parse - unknown marker: "+Z.toString(16))}Z=V(x,f);
f+=2}this.width=v.o;this.height=v.s;this.g=F;this.b=D;this.W=[];for(O=0;O<v.W.length;O++){j=v.W[O];var aB=u[j.L];
if(aB){j.$=aB}this.W.push({index:j.index,e:t(v,j),l:j.h/v.X,t:j.A/v.B,P:j.P,c:j.c})}this.p=this.W.length;
return undefined},Y(x,S,c){if(c==null)c=!1;var f=this.width/x,F=this.height/S,D,v,P,E,l,aF,u,w,ap,Z,O=0,B,z=this.W.length,y=x*S*z,Q=new Uint8ClampedArray(y),a1=new Uint32Array(x),G=4294967288,n;
for(u=0;u<z;u++){D=this.W[u];v=D.l*f;P=D.t*F;O=u;B=D.e;E=D.P+1<<3;if(v!==n){for(l=0;l<x;l++){w=0|l*v;
a1[l]=(w&G)<<3|w&7}n=v}for(aF=0;aF<S;aF++){w=0|aF*P;Z=E*(w&G)|(w&7)<<3;for(l=0;l<x;l++){Q[O]=B[Z+a1[l]];
O+=z}}}var X=this.V;if(!c&&z===4&&!X){X=new Int32Array([-256,255,-256,255,-256,255,-256,255])}if(X){for(u=0;
u<y;){for(w=0,ap=0;w<z;w++,u++,ap+=2){Q[u]=(Q[u]*X[ap]>>8)+X[ap+1]}}}return Q},get f(){if(this.b){return!!this.b.a}if(this.p===3){if(this.N===0){return!1}else if(this.W[0].index===82&&this.W[1].index===71&&this.W[2].index===66){return!1}return!0}if(this.N===1){return!0}return!1},z:function U(x){var S,c,f;
for(var F=0,D=x.length;F<D;F+=3){S=x[F];c=x[F+1];f=x[F+2];x[F]=S-179.456+1.402*f;x[F+1]=S+135.459-.344*c-.714*f;
x[F+2]=S-226.816+1.772*c}return x},O:function q(x){var S,c,f,F,D=0;for(var v=0,P=x.length;v<P;v+=4){S=x[v];
c=x[v+1];f=x[v+2];F=x[v+3];x[D++]=-122.67195406894+c*(-660635669420364e-19*c+.000437130475926232*f-54080610064599e-18*S+.00048449797120281*F-.154362151871126)+f*(-.000957964378445773*f+.000817076911346625*S-.00477271405408747*F+1.53380253221734)+S*(.000961250184130688*S-.00266257332283933*F+.48357088451265)+F*(-.000336197177618394*F+.484791561490776);
x[D++]=107.268039397724+c*(219927104525741e-19*c-.000640992018297945*f+.000659397001245577*S+.000426105652938837*F-.176491792462875)+f*(-.000778269941513683*f+.00130872261408275*S+.000770482631801132*F-.151051492775562)+S*(.00126935368114843*S-.00265090189010898*F+.25802910206845)+F*(-.000318913117588328*F-.213742400323665);
x[D++]=-20.810012546947+c*(-.000570115196973677*c-263409051004589e-19*f+.0020741088115012*S-.00288260236853442*F+.814272968359295)+f*(-153496057440975e-19*f-.000132689043961446*S+.000560833691242812*F-.195152027534049)+S*(.00174418132927582*S-.00255243321439347*F+.116935020465145)+F*(-.000343531996510555*F+.24165260232407)}return x.subarray(0,D)},r:function k(x){var S,c,f;
for(var F=0,D=x.length;F<D;F+=4){S=x[F];c=x[F+1];f=x[F+2];x[F]=434.456-S-1.402*f;x[F+1]=119.541-S+.344*c+.714*f;
x[F+2]=481.816-S-1.772*c}return x},U:function i(x){var S,c,f,F,D=0;for(var v=0,P=x.length;v<P;v+=4){S=x[v];
c=x[v+1];f=x[v+2];F=x[v+3];x[D++]=255+S*(-6747147073602441e-20*S+.0008379262121013727*c+.0002894718188643294*f+.003264231057537806*F-1.1185611867203937)+c*(26374107616089404e-21*c-8626949158638572e-20*f-.0002748769067499491*F-.02155688794978967)+f*(-3878099212869363e-20*f-.0003267808279485286*F+.0686742238595345)-F*(.0003361971776183937*F+.7430659151342254);
x[D++]=255+S*(.00013596372813588848*S+.000924537132573585*c+.00010567359618683593*f+.0004791864687436512*F-.3109689587515875)+c*(-.00023545346108370344*c+.0002702845253534714*f+.0020200308977307156*F-.7488052167015494)+f*(6834815998235662e-20*f+.00015168452363460973*F-.09751927774728933)-F*(.0003189131175883281*F+.7364883807733168);
x[D++]=255+S*(13598650411385308e-21*S+.00012423956175490851*c+.0004751985097583589*f-36729317476630424e-22*F-.05562186980264034)+c*(.00016141380598724676*c+.0009692239130725186*f+.0007782692450036253*F-.44015232367526463)+f*(5.068882914068769e-7*f+.0017778369011375071*F-.7591454649749609)-F*(.0003435319965105553*F+.7063770186160144)}return x.subarray(0,D)},getData:function(x){var S=x.width,c=x.height,f=x.forceRGB,F=x.isSourcePDF;
if(this.p>4){throw new e("Unsupported color mode")}var D=this.Y(S,c,F);if(this.p===1&&f){var v=D.length,P=new Uint8ClampedArray(v*3),E=0;
for(var l=0;l<v;l++){var aF=D[l];P[E++]=aF;P[E++]=aF;P[E++]=aF}return P}else if(this.p===3&&this.f){return this.z(D)}else if(this.p===4){if(this.f){if(f){return this.O(D)}return this.r(D)}else if(f){return this.U(D)}}return D}};
return h}();function s(m,$){return m[$]<<24>>24}function V(m,$){return m[$]<<8|m[$+1]}function I(m,$){return(m[$]<<24|m[$+1]<<16|m[$+2]<<8|m[$+3])>>>0}r.JpegDecoder=h}());
r.encodeImage=function(e,h,R,p){var s={t256:[h],t257:[R],t258:[8,8,8,8],t259:[1],t262:[2],t273:[1e3],t277:[4],t278:[R],t279:[h*R*4],t282:[[72,1]],t283:[[72,1]],t284:[1],t286:[[0,1]],t287:[[0,1]],t296:[1],t305:["Photopea (UTIF.js)"],t338:[1]};
if(p)for(var I in p)s[I]=p[I];var m=new Uint8Array(r.encode([s])),$=new Uint8Array(e),_=new Uint8Array(1e3+h*R*4);
for(var I=0;I<m.length;I++)_[I]=m[I];for(var I=0;I<$.length;I++)_[1e3+I]=$[I];return _.buffer};r.encode=function(e){var h=!1,R=new Uint8Array(2e4),p=4,s=h?r._binLE:r._binBE,V=8;
R[0]=R[1]=h?73:77;s.writeUshort(R,2,42);s.writeUint(R,p,V);p+=4;for(var I=0;I<e.length;I++){var m=r._writeIFD(s,r._types.basic,R,V,e[I]);
V=m[1];if(I<e.length-1){if((V&3)!=0)V+=4-(V&3);s.writeUint(R,m[0],V)}}return R.slice(0,V).buffer};r.decode=function(e,h){if(h==null)h={parseMN:!0,debug:!1};
var R=new Uint8Array(e),p=0,s=r._binBE.readASCII(R,p,2);p+=2;var V=s=="II"?r._binLE:r._binBE,I=V.readUshort(R,p);
p+=2;var m=V.readUint(R,p);p+=4;var $=[];while(!0){var _=V.readUshort(R,m),N=V.readUshort(R,m+4);if(_!=0)if(N<1||13<N){aS("error in TIFF");
break}r._readIFD(V,R,m,$,0,h);m=V.readUint(R,m+2+_*12);if(m==0)break}return $};r.decodeImage=function(e,h,R){if(h.data)return;
var p=new Uint8Array(e),s=r._binBE.readASCII(p,0,2),W=0;if(h.t256==null)return;h.isLE=s=="II";h.width=h.t256[0];
h.height=h.t257[0];var V=h.t259?h.t259[0]:1,I=h.t266?h.t266[0]:1;if(h.t284&&h.t284[0]==2)aS("PlanarConfiguration 2 should not be used!");
if(V==7&&h.t258&&h.t258.length>3)h.t258=h.t258.slice(0,3);var m=h.t277?h.t277[0]:1,$=h.t258?h.t258[0]:1,_=$*m;
if(V==1&&h.t279!=null&&h.t278&&h.t262[0]==32803){_=Math.round(h.t279[0]*8/(h.width*h.t278[0]))}if(h.t50885&&h.t50885[0]==4)_=h.t258[0]*3;
var N=Math.ceil(h.width*_/8)*8,a=h.t273;if(a==null||h.t322)a=h.t324;var J=h.t279;if(V==1&&a.length==1)J=[h.height*(N>>>3)];
if(J==null||h.t322)J=h.t325;var K=new Uint8Array(h.height*(N>>>3));if(h.t322!=null){var H=h.t322[0],Y=h.t323[0],A=Math.floor((h.width+H-1)/H),T=Math.floor((h.height+Y-1)/Y),o=new Uint8Array(Math.ceil(H*Y*_/8)|0);
console.log("====",A,T);for(var M=0;M<T;M++)for(var L=0;L<A;L++){var t=M*A+L;o.fill(0);r.decode._decompress(h,R,p,a[t],J[t],V,o,0,I,H,Y);
if(V==6)K=o;else r._copyTile(o,Math.ceil(H*_/8)|0,Y,K,Math.ceil(h.width*_/8)|0,h.height,Math.ceil(L*H*_/8)|0,M*Y)}W=K.length*8}else{if(a==null)return;
var C=h.t278?h.t278[0]:h.height;C=Math.min(C,h.height);for(var t=0;t<a.length;t++){r.decode._decompress(h,R,p,a[t],J[t],V,K,Math.ceil(W/8)|0,I,h.width,C);
W+=N*C}W=Math.min(W,K.length*8)}h.data=new Uint8Array(K.buffer,0,Math.ceil(W/8)|0)};r.decode._decompress=function(e,h,R,p,s,V,I,m,$,_,N){if(e.t271&&e.t271[0]=="Panasonic"){if(e.t45&&e.t45[0]==6)V=34316;
else if(V==34828)V=1}if(!1){}else if(V==1)for(var a=0;a<s;a++)I[m+a]=R[p+a];else if(V==2)r.decode._decodeG2(R,p,s,I,m,_,$);
else if(V==3)r.decode._decodeG3(R,p,s,I,m,_,$,e.t292?(e.t292[0]&1)==1:!1);else if(V==4)r.decode._decodeG4(R,p,s,I,m,_,$);
else if(V==5)r.decode._decodeLZW(R,p,s,I,m,8);else if(V==6)r.decode._decodeOldJPEG(e,R,p,s,I,m);else if(V==7||V==34892)r.decode._decodeNewJPEG(e,R,p,s,I,m);
else if(V==8||V==32946){var J=new Uint8Array(R.buffer,p+2,s-6),K=r._inflateRaw(J);if(m+K.length<=I.length)I.set(K,m)}else if(V==9)r.decode._decodeVC5(R,p,s,I,m,e.t33422);
else if(V==32767)r.decode._decodeARW(e,R,p,s,I,m);else if(V==32773)r.decode._decodePackBits(R,p,s,I,m);
else if(V==32809)r.decode._decodeThunder(R,p,s,I,m);else if(V==34316)r.decode._decodePanasonic(e,R,p,s,I,m);
else if(V==34713)r.decode._decodeNikon(e,h,R,p,s,I,m);else if(V==34676)r.decode._decodeLogLuv32(e,R,p,s,I,m);
else aS("Unknown compression",V);var W=e.t258?Math.min(32,e.t258[0]):1,H=e.t277?e.t277[0]:1,Y=W*H>>>3,A=Math.ceil(W*H*_/8);
if(W==16&&!e.isLE&&e.t33422==null)for(var T=0;T<N;T++){var o=m+T*A;for(var L=1;L<A;L+=2){var t=I[o+L];
I[o+L]=I[o+L-1];I[o+L-1]=t}}if(e.t317&&e.t317[0]==2){for(var T=0;T<N;T++){var C=m+T*A;if(W==16)for(var a=Y;
a<A;a+=2){var U=(I[C+a+1]<<8|I[C+a])+(I[C+a-Y+1]<<8|I[C+a-Y]);I[C+a]=U&255;I[C+a+1]=U>>>8&255}else if(H==3)for(var a=3;
a<A;a+=3){I[C+a]=I[C+a]+I[C+a-3]&255;I[C+a+1]=I[C+a+1]+I[C+a-2]&255;I[C+a+2]=I[C+a+2]+I[C+a-1]&255}else for(var a=Y;
a<A;a++)I[C+a]=I[C+a]+I[C+a-Y]&255}}};r.decode._decodePanasonic=function(e,h,R,p,s,V){var I=h.buffer,m=e.t2[0],$=e.t3[0],_=e.t10[0],N=e.t45[0],a=0,J=0,K=0,W=0,H,Y,A=N==6?new Uint32Array(18):new Uint8Array(16),T,o,M,L=[0,0],b=[0,0],t,C=0,U,q,k,i,x=new Uint8Array(16384),S=new Uint16Array(s.buffer);
function c(aD){if(K==0){var H=new Uint8Array(I,R+J+8184,16384-8184),Y=new Uint8Array(I,R+J,8184);x.set(H);
x.set(Y,H.length);J+=16384}if(N==5){for(T=0;T<16;T++){A[T]=x[K++];K&=16383}}else{K=K-aD&131071;W=K>>3^16368;
return(x[W]|x[W+1]<<8)>>(K&7)&~(-1<<aD)}}function f(T){return x[K+15-T]}function F(){A[0]=f(0)<<6|f(1)>>2;
A[1]=((f(1)&3)<<12|f(2)<<4|f(3)>>4)&16383;A[2]=f(3)>>2&3;A[3]=(f(3)&3)<<8|f(4);A[4]=f(5)<<2|f(6)>>6;
A[5]=(f(6)&63)<<4|f(7)>>4;A[6]=f(7)>>2&3;A[7]=(f(7)&3)<<8|f(8);A[8]=f(9)<<2&1020|f(10)>>6;A[9]=(f(10)<<4|f(11)>>4)&1023;
A[10]=f(11)>>2&3;A[11]=(f(11)&3)<<8|f(12);A[12]=(f(13)<<2&1020|f(14)>>6)&1023;A[13]=(f(14)<<4|f(15)>>4)&1023;
K+=16;W=0}function D(){A[0]=f(0)<<4|f(1)>>4;A[1]=((f(1)&15)<<8|f(2))&4095;A[2]=f(3)>>6&3;A[3]=(f(3)&63)<<2|f(4)>>6;
A[4]=(f(4)&63)<<2|f(5)>>6;A[5]=(f(5)&63)<<2|f(6)>>6;A[6]=f(6)>>4&3;A[7]=(f(6)&15)<<4|f(7)>>4;A[8]=(f(7)&15)<<4|f(8)>>4;
A[9]=(f(8)&15)<<4|f(9)>>4;A[10]=f(9)>>2&3;A[11]=(f(9)&3)<<6|f(10)>>2;A[12]=(f(10)&3)<<6|f(11)>>2;A[13]=(f(11)&3)<<6|f(12)>>2;
A[14]=f(12)&3;A[15]=f(13);A[16]=f(14);A[17]=f(15);K+=16;W=0}function v(){L[0]=0;L[1]=0;b[0]=0;b[1]=0}if(N==7){throw N}else if(N==6){var P=_==12,E=P?D:F,l=P?14:11,aF=P?128:512,at=P?2048:8192,u=P?16383:65535,w=P?4095:16383,am=m/l,aY=am*16,ap=P?18:14;
for(q=0;q<$-15;q+=16){var ac=Math.min(16,$-q),Z=aY*ac;x=new Uint8Array(I,R+a,Z);K=0;a+=Z;for(i=0,k=0;
i<ac;i++,k=0){C=(q+i)*m;for(var O=0;O<am;O++){E();v();M=0;U=0;for(T=0;T<l;T++){t=T&1;if(T%3==2){var aw=W<ap?A[W++]:0;
if(aw==3)aw=4;U=aF<<aw;M=1<<aw}var B=W<ap?A[W++]:0;if(L[t]){B*=M;if(U<at&&b[t]>U)B+=b[t]-U;b[t]=B}else{L[t]=B;
if(B)b[t]=B;else B=b[t]}S[C+k++]=B-15<=u?B-15&u:B+2147483633>>31&w}}}}}else if(N==5){var z=_==12?10:9;
for(q=0;q<$;q++){for(k=0;k<m;k+=z){c(0);if(_==12){S[C++]=((A[1]&15)<<8)+A[0];S[C++]=16*A[2]+(A[1]>>4);
S[C++]=((A[4]&15)<<8)+A[3];S[C++]=16*A[5]+(A[4]>>4);S[C++]=((A[7]&15)<<8)+A[6];S[C++]=16*A[8]+(A[7]>>4);
S[C++]=((A[10]&15)<<8)+A[9];S[C++]=16*A[11]+(A[10]>>4);S[C++]=((A[13]&15)<<8)+A[12];S[C++]=16*A[14]+(A[13]>>4)}else if(_==14){S[C++]=A[0]+((A[1]&63)<<8);
S[C++]=(A[1]>>6)+4*A[2]+((A[3]&15)<<10);S[C++]=(A[3]>>4)+16*A[4]+((A[5]&3)<<12);S[C++]=((A[5]&252)>>2)+(A[6]<<6);
S[C++]=A[7]+((A[8]&63)<<8);S[C++]=(A[8]>>6)+4*A[9]+((A[10]&15)<<10);S[C++]=(A[10]>>4)+16*A[11]+((A[12]&3)<<12);
S[C++]=((A[12]&252)>>2)+(A[13]<<6);S[C++]=A[14]+((A[15]&63)<<8)}}}}else if(N==4){for(q=0;q<$;q++){for(k=0;
k<m;k++){T=k%14;t=T&1;if(T==0)v();if(T%3==2)M=4>>3-c(2);if(b[t]){o=c(8);if(o!=0){L[t]-=128<<M;if(L[t]<0||M==4)L[t]&=~(-1<<M);
L[t]+=o<<M}}else{b[t]=c(8);if(b[t]||T>11)L[t]=b[t]<<4|c(4)}S[C++]=L[k&1]}}}else throw N};r.decode._decodeVC5=function(){var e=[1,0,1,0,2,2,1,1,3,7,1,2,5,25,1,3,6,48,1,4,6,54,1,5,7,111,1,8,7,99,1,6,7,105,12,0,7,107,1,7,8,209,20,0,8,212,1,9,8,220,1,10,9,393,1,11,9,394,32,0,9,416,1,12,9,427,1,13,10,887,1,18,10,784,1,14,10,790,1,15,10,835,60,0,10,852,1,16,10,885,1,17,11,1571,1,19,11,1668,1,20,11,1669,100,0,11,1707,1,21,11,1772,1,22,12,3547,1,29,12,3164,1,24,12,3166,1,25,12,3140,1,23,12,3413,1,26,12,3537,1,27,12,3539,1,28,13,7093,1,35,13,6283,1,30,13,6331,1,31,13,6335,180,0,13,6824,1,32,13,7072,1,33,13,7077,320,0,13,7076,1,34,14,12565,1,36,14,12661,1,37,14,12669,1,38,14,13651,1,39,14,14184,1,40,15,28295,1,46,15,28371,1,47,15,25320,1,42,15,25336,1,43,15,25128,1,41,15,27300,1,44,15,28293,1,45,16,50259,1,48,16,50643,1,49,16,50675,1,50,16,56740,1,53,16,56584,1,51,16,56588,1,52,17,113483,1,61,17,113482,1,60,17,101285,1,55,17,101349,1,56,17,109205,1,57,17,109207,1,58,17,100516,1,54,17,113171,1,59,18,202568,1,62,18,202696,1,63,18,218408,1,64,18,218412,1,65,18,226340,1,66,18,226356,1,67,18,226358,1,68,19,402068,1,69,19,405138,1,70,19,405394,1,71,19,436818,1,72,19,436826,1,73,19,452714,1,75,19,452718,1,76,19,452682,1,74,20,804138,1,77,20,810279,1,78,20,810790,1,79,20,873638,1,80,20,873654,1,81,20,905366,1,82,20,905430,1,83,20,905438,1,84,21,1608278,1,85,21,1620557,1,86,21,1621582,1,87,21,1621583,1,88,21,1747310,1,89,21,1810734,1,90,21,1810735,1,91,21,1810863,1,92,21,1810879,1,93,22,3621725,1,99,22,3621757,1,100,22,3241112,1,94,22,3494556,1,95,22,3494557,1,96,22,3494622,1,97,22,3494623,1,98,23,6482227,1,102,23,6433117,1,101,23,6989117,1,103,23,6989119,1,105,23,6989118,1,104,23,7243449,1,106,23,7243512,1,107,24,13978233,1,111,24,12964453,1,109,24,12866232,1,108,24,14486897,1,113,24,13978232,1,110,24,14486896,1,112,24,14487026,1,114,24,14487027,1,115,25,25732598,1,225,25,25732597,1,189,25,25732596,1,188,25,25732595,1,203,25,25732594,1,202,25,25732593,1,197,25,25732592,1,207,25,25732591,1,169,25,25732590,1,223,25,25732589,1,159,25,25732522,1,235,25,25732579,1,152,25,25732575,1,192,25,25732489,1,179,25,25732573,1,201,25,25732472,1,172,25,25732576,1,149,25,25732488,1,178,25,25732566,1,120,25,25732571,1,219,25,25732577,1,150,25,25732487,1,127,25,25732506,1,211,25,25732548,1,125,25,25732588,1,158,25,25732486,1,247,25,25732467,1,238,25,25732508,1,163,25,25732552,1,228,25,25732603,1,183,25,25732513,1,217,25,25732587,1,168,25,25732520,1,122,25,25732484,1,128,25,25732562,1,249,25,25732505,1,187,25,25732504,1,186,25,25732483,1,136,25,25928905,1,181,25,25732560,1,255,25,25732500,1,230,25,25732482,1,135,25,25732555,1,233,25,25732568,1,222,25,25732583,1,145,25,25732481,1,134,25,25732586,1,167,25,25732521,1,248,25,25732518,1,209,25,25732480,1,243,25,25732512,1,216,25,25732509,1,164,25,25732547,1,140,25,25732479,1,157,25,25732544,1,239,25,25732574,1,191,25,25732564,1,251,25,25732478,1,156,25,25732546,1,139,25,25732498,1,242,25,25732557,1,133,25,25732477,1,162,25,25732515,1,213,25,25732584,1,165,25,25732514,1,212,25,25732476,1,227,25,25732494,1,198,25,25732531,1,236,25,25732530,1,234,25,25732529,1,117,25,25732528,1,215,25,25732527,1,124,25,25732526,1,123,25,25732525,1,254,25,25732524,1,253,25,25732523,1,148,25,25732570,1,218,25,25732580,1,146,25,25732581,1,147,25,25732569,1,224,25,25732533,1,143,25,25732540,1,184,25,25732541,1,185,25,25732585,1,166,25,25732556,1,132,25,25732485,1,129,25,25732563,1,250,25,25732578,1,151,25,25732501,1,119,25,25732502,1,193,25,25732536,1,176,25,25732496,1,245,25,25732553,1,229,25,25732516,1,206,25,25732582,1,144,25,25732517,1,208,25,25732558,1,137,25,25732543,1,241,25,25732466,1,237,25,25732507,1,190,25,25732542,1,240,25,25732551,1,131,25,25732554,1,232,25,25732565,1,252,25,25732475,1,171,25,25732493,1,205,25,25732492,1,204,25,25732491,1,118,25,25732490,1,214,25,25928904,1,180,25,25732549,1,126,25,25732602,1,182,25,25732539,1,175,25,25732545,1,141,25,25732559,1,138,25,25732537,1,177,25,25732534,1,153,25,25732503,1,194,25,25732606,1,160,25,25732567,1,121,25,25732538,1,174,25,25732497,1,246,25,25732550,1,130,25,25732572,1,200,25,25732474,1,170,25,25732511,1,221,25,25732601,1,196,25,25732532,1,142,25,25732519,1,210,25,25732495,1,199,25,25732605,1,155,25,25732535,1,154,25,25732499,1,244,25,25732510,1,220,25,25732600,1,195,25,25732607,1,161,25,25732604,1,231,25,25732473,1,173,25,25732599,1,226,26,51465122,1,116,26,51465123,0,1],h,R,p,s=[3,3,3,3,2,2,2,1,1,1],V=24576,I=16384,m=8192,_=I|m;
function N(M){var t=M[1],U=M[0][t>>>3]>>>7-(t&7)&1;M[1]++;return U}function a(M,t){if(h==null){h={};
for(var U=0;U<e.length;U+=4)h[e[U+1]]=e.slice(U,U+4)}var k=N(M),x=h[k];while(x==null){k=k<<1|N(M);x=h[k]}var S=x[3];
if(S!=0)S=N(M)==0?S:-S;t[0]=x[2];t[1]=S}function K(M,t){for(var U=0;U<t;U++){if((M&1)==1)M++;M=M>>>1}return M}function W(M,t){return M>>t}function H(M,t,U,k,x,S){t[U]=W(W(11*M[x]-4*M[x+S]+M[x+S+S]+4,3)+M[k],1);
t[U+S]=W(W(5*M[x]+4*M[x+S]-M[x+S+S]+4,3)-M[k],1)}function Y(M,t,U,k,x,S){var f=M[x-S]-M[x+S],D=M[x],P=M[k];
t[U]=W(W(f+4,3)+D+P,1);t[U+S]=W(W(-f+4,3)+D-P,1)}function A(M,t,U,k,x,S){t[U]=W(W(5*M[x]+4*M[x-S]-M[x-S-S]+4,3)+M[k],1);
t[U+S]=W(W(11*M[x]-4*M[x-S]+M[x-S-S]+4,3)-M[k],1)}function T(M){M=M<0?0:M>4095?4095:M;M=p[M]>>>2;return M}function o(M,t,U,k,x,S){k=new Uint16Array(k.buffer);
var f=Date.now(),D=r._binBE,P=t+U,E,at,u,w,am,aY,O,aw,B,aD,aC,az,y,a3,Q,aG,a1,as;t+=4;var G=S[0]==1;
while(t<P){var d=D.readShort(M,t),b2=D.readUshort(M,t+2);t+=4;if(d==12)E=b2;else if(d==20)at=b2;else if(d==21)u=b2;
else if(d==48)w=b2;else if(d==53)am=b2;else if(d==35)aY=b2;else if(d==62)O=b2;else if(d==101)aw=b2;else if(d==109)B=b2;
else if(d==84)aD=b2;else if(d==106)aC=b2;else if(d==107)az=b2;else if(d==108)y=b2;else if(d==102)a3=b2;
else if(d==104)Q=b2;else if(d==105)aG=b2;else{var X=d<0?-d:d,a_=X&65280,aq=0;if(X&_){if(X&m){aq=b2&65535;
aq+=(X&255)<<16}else{aq=b2&65535}}if((X&V)==V){if(a1==null){a1=[];for(var ad=0;ad<4;ad++)a1[ad]=new Int16Array((at>>>1)*(u>>>1));
as=new Int16Array((at>>>1)*(u>>>1));R=new Int16Array(1024);for(var ad=0;ad<1024;ad++){var ax=ad-512,aE=Math.abs(ax),E=Math.floor(768*aE*aE*aE/(255*255*255))+aE;
R[ad]=Math.sign(ax)*E}p=new Uint16Array(4096);var aZ=(1<<16)-1;for(var ad=0;ad<4096;ad++){var ah=ad,aL=aZ*(Math.pow(113,ah/4095)-1)/112;
p[ad]=Math.min(aL,aZ)}}var ak=a1[O],bb=K(at,1+s[w]),a8=K(u,1+s[w]);if(w==0){for(var b6=0;b6<a8;b6++)for(var j=0;
j<bb;j++){var ae=t+(b6*bb+j)*2;ak[b6*(at>>>1)+j]=M[ae]<<8|M[ae+1]}}else{var b9=[M,t*8],ab=[],ai=0,a0=bb*a8,aA=[0,0],aa=0,b2=0;
while(ai<a0){a(b9,aA);aa=aA[0];b2=aA[1];while(aa>0){ab[ai++]=b2;aa--}}var b0=(w-1)%3,aQ=b0!=1?bb:0,aB=b0!=0?a8:0;
for(var b6=0;b6<a8;b6++){var a4=(b6+aB)*(at>>>1)+aQ,an=b6*bb;for(var j=0;j<bb;j++)ak[a4+j]=R[ab[an+j]+512]*am}if(b0==2){var Q=at>>>1,ag=bb*2,aK=a8*2;
for(var b6=0;b6<a8;b6++){for(var j=0;j<ag;j++){var ad=b6*2*Q+j,au=b6*Q+j,a2=a8*Q+au;if(b6==0)H(ak,as,ad,a2,au,Q);
else if(b6==a8-1)A(ak,as,ad,a2,au,Q);else Y(ak,as,ad,a2,au,Q)}}var a5=ak;ak=as;as=a5;for(var b6=0;b6<aK;
b6++){for(var j=0;j<bb;j++){var ad=b6*Q+2*j,au=b6*Q+j,a2=bb+au;if(j==0)H(ak,as,ad,a2,au,1);else if(j==bb-1)A(ak,as,ad,a2,au,1);
else Y(ak,as,ad,a2,au,1)}}var a5=ak;ak=as;as=a5;var aR=[],aP=2-~~((w-1)/3);for(var aU=0;aU<3;aU++)aR[aU]=B>>14-aU*2&3;
var aV=aR[aP];if(aV!=0)for(var b6=0;b6<aK;b6++)for(var j=0;j<ag;j++){var ad=b6*Q+j;ak[ad]=ak[ad]<<aV}}}if(w==9&&O==3){var b3=a1[0],af=a1[1],bc=a1[2],aM=a1[3];
for(var b6=0;b6<u;b6+=2)for(var j=0;j<at;j+=2){var ar=b6*at+j,ae=(b6>>>1)*(at>>>1)+(j>>>1),aT=b3[ae],aO=af[ae]-2048,av=bc[ae]-2048,ao=aM[ae]-2048,b1=(aO<<1)+aT,a7=(av<<1)+aT,aX=aT+ao,a9=aT-ao;
if(G){k[ar]=T(aX);k[ar+1]=T(a7);k[ar+at]=T(b1);k[ar+at+1]=T(a9)}else{k[ar]=T(b1);k[ar+1]=T(aX);k[ar+at]=T(a9);
k[ar+at+1]=T(a7)}}}t+=aq*4}else if(X==16388){t+=aq*4}else if(a_==8192||a_==8448||a_==9216){}else throw X.toString(16)}}console.log(Date.now()-f)}return o}();
r.decode._decodeLogLuv32=function(e,h,R,p,s,V){var I=e.width,m=I*4,$=0,_=new Uint8Array(m);while($<p){var N=0;
while(N<m){var a=h[R+$];$++;if(a<128){for(var J=0;J<a;J++)_[N+J]=h[R+$+J];N+=a;$+=a}else{a=a-126;for(var J=0;
J<a;J++)_[N+J]=h[R+$];N+=a;$++}}for(var K=0;K<I;K++){s[V+0]=_[K];s[V+1]=_[K+I];s[V+2]=_[K+I*2];s[V+4]=_[K+I*3];
V+=6}}};r.decode._ljpeg_diff=function(e,h,R){var p=r.decode._getbithuff,s,V;s=p(e,h,R[0],R);V=p(e,h,s,0);
if((V&1<<s-1)==0)V-=(1<<s)-1;return V};r.decode._decodeARW=function(e,h,R,p,s,V){var I=e.t256[0],m=e.t257[0],$=e.t258[0],_=e.isLE?r._binLE:r._binBE,N=I*m==p||I*m*1.5==p,T,A,k,i,x,S,c,f,F,W,D;
if(!N){m+=8;var a=[R,0,0,0],J=new Uint16Array(32770),K=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],W,H,Y,A,T,o=0,M=r.decode._ljpeg_diff;
J[0]=15;for(Y=W=0;W<18;W++){var L=32768>>>(K[W]>>>8);for(var H=0;H<L;H++)J[++Y]=K[W]}for(A=I;A--;)for(T=0;
T<m+1;T+=2){if(T==m)T=1;o+=M(h,a,J);if(T<m){var b=o&4095;r.decode._putsF(s,(T*I+A)*$,b<<16-$)}}return}if(I*m*1.5==p){for(var W=0;
W<p;W+=3){var t=h[R+W+0],C=h[R+W+1],U=h[R+W+2];s[V+W]=C<<4|t>>>4;s[V+W+1]=t<<4|U>>>4;s[V+W+2]=U<<4|C>>>4}return}var q=new Uint16Array(16),v=new Uint8Array(I+1);
for(T=0;T<m;T++){for(var P=0;P<I;P++)v[P]=h[R++];for(D=0,A=0;A<I-30;D+=16){i=2047&(k=_.readUint(v,D));
x=2047&k>>>11;S=15&k>>>22;c=15&k>>>26;for(f=0;f<4&&128<<f<=i-x;f++);for(F=30,W=0;W<16;W++)if(W==S)q[W]=i;
else if(W==c)q[W]=x;else{q[W]=((_.readUshort(v,D+(F>>3))>>>(F&7)&127)<<f)+x;if(q[W]>2047)q[W]=2047;F+=7}for(W=0;
W<16;W++,A+=2){var b=q[W]<<1;r.decode._putsF(s,(T*I+A)*$,b<<16-$)}A-=A&1?1:31}}};r.decode._decodeNikon=function(e,h,R,p,s,V,I){var m=[[0,0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,5,4,3,6,2,7,1,0,8,9,11,10,12],[0,0,1,5,1,1,1,1,1,1,2,0,0,0,0,0,0,57,90,56,39,22,5,4,3,2,1,0,11,12,12],[0,0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0,5,4,6,3,7,2,8,1,9,0,10,11,12],[0,0,1,4,3,1,1,1,1,1,2,0,0,0,0,0,0,5,6,4,7,8,3,9,2,1,0,10,11,12,13,14],[0,0,1,5,1,1,1,1,1,1,1,2,0,0,0,0,0,8,92,75,58,41,7,6,5,4,3,2,1,0,13,14],[0,0,1,4,2,2,3,1,2,0,0,0,0,0,0,0,0,7,6,8,5,9,4,10,3,11,12,2,0,1,13,14]],$=e.t256[0],_=e.t257[0],N=e.t258[0],a=0,J=0,K=r.decode._make_decoder,W=r.decode._getbithuff,H=h[0].exifIFD.makerNote,Y=H.t150?H.t150:H.t140,A=0,T=Y[A++],o=Y[A++],U=0,b,k,i,x,S,c,f=0;
if(T==73||o==88)A+=2110;if(T==70)a=2;if(N==14)a+=3;var M=[[0,0],[0,0]],L=e.isLE?r._binLE:r._binBE;for(var b=0;
b<2;b++)for(var t=0;t<2;t++){M[b][t]=L.readShort(Y,A);A+=2}var C=1<<N&32767,q=L.readShort(Y,A);A+=2;
if(q>1)U=Math.floor(C/(q-1));if(T==68&&o==32&&U>0)J=L.readShort(Y,562);var F=[0,0],D=K(m[a]),v=[p,0,0,0];
for(f=k=0;k<_;k++){if(J&&k==J){D=K(m[a+1])}for(i=0;i<$;i++){b=W(R,v,D[0],D);x=b&15;S=b>>>4;c=(W(R,v,x-S,0)<<1)+1<<S>>>1;
if((c&1<<x-1)==0)c-=(1<<x)-(S==0?1:0);if(i<2)F[i]=M[k&1][i]+=c;else F[i&1]+=c;var P=Math.min(Math.max(F[i&1],0),(1<<N)-1),E=(k*$+i)*N;
r.decode._putsF(V,E,P<<16-N)}}};r.decode._putsF=function(e,h,R){R=R<<8-(h&7);var p=h>>>3;e[p]|=R>>>16;
e[p+1]|=R>>>8;e[p+2]|=R};r.decode._getbithuff=function(e,h,R,p){var s=0,V=r.decode._get_byte,I,m=h[0],$=h[1],_=h[2],N=h[3];
if(R==0||_<0)return 0;while(!N&&_<R&&(I=e[m++])!=-1&&!(N=s&&I==255&&e[m++])){$=($<<8)+I;_+=8}I=$<<32-_>>>32-R;
if(p){_-=p[I+1]>>>8;I=p[I+1]&255}else _-=R;if(_<0)throw"e";h[0]=m;h[1]=$;h[2]=_;h[3]=N;return I};r.decode._make_decoder=function(e){var h,R,p,s,m,$=[],_=17;
for(h=16;h!=0&&!e[h];h--);$[0]=h;for(p=R=1;R<=h;R++)for(s=0;s<e[R];s++,++_)for(m=0;m<1<<h-R;m++)if(p<=1<<h)$[p++]=R<<8|e[_];
return $};r.decode._decodeNewJPEG=function(e,h,R,p,s,V){p=Math.min(p,h.length-R);var I=e.t347,m=I?I.length:0,$=new Uint8Array(m+p);
if(I){var _=216,N=217,a=0;for(var J=0;J<m-1;J++){if(I[J]==255&&I[J+1]==N)break;$[a++]=I[J]}var K=h[R],W=h[R+1];
if(K!=255||W!=_){$[a++]=K;$[a++]=W}for(var J=2;J<p;J++)$[a++]=h[R+J]}else for(var J=0;J<p;J++)$[J]=h[R+J];
if(e.t262[0]==32803||e.t259[0]==7&&e.t262[0]==34892){var H=e.t258[0],Y=r.LosslessJpegDecode($),A=Y.length;
if(!1){}else if(H==16){if(e.isLE)for(var J=0;J<A;J++){s[V+(J<<1)]=Y[J]&255;s[V+(J<<1)+1]=Y[J]>>>8}else for(var J=0;
J<A;J++){s[V+(J<<1)]=Y[J]>>>8;s[V+(J<<1)+1]=Y[J]&255}}else if(H==14||H==12||H==10){var T=16-H;for(var J=0;
J<A;J++)r.decode._putsF(s,J*H,Y[J]<<T)}else if(H==8){for(var J=0;J<A;J++)s[V+J]=Y[J]}else throw new Error("unsupported bit depth "+H)}else{var o=new r.JpegDecoder;
o.parse($);var M=o.getData({width:o.width,height:o.height,forceRGB:!0,isSourcePDF:!1});for(var J=0;J<M.length;
J++)s[V+J]=M[J]}if(e.t262[0]==6)e.t262[0]=2};r.decode._decodeOldJPEGInit=function(e,h,R,p){var s=216,V=217,I=219,m=196,$=221,_=192,N=218,a=0,J=0,K,W,H=!1,Y,A,T,o=e.t513,M=o?o[0]:0,L=e.t514,b=L?L[0]:0,t=e.t324||e.t273||o,C=e.t530,U=0,q=0,k=e.t277?e.t277[0]:1,i=e.t515;
if(t){J=t[0];H=t.length>1}if(!H){if(h[R]==255&&h[R+1]==s)return{jpegOffset:R};if(o!=null){if(h[R+M]==255&&h[R+M+1]==s)a=R+M;
else aS("JPEGInterchangeFormat does not point to SOI");if(L==null)aS("JPEGInterchangeFormatLength field is missing");
else if(M>=J||M+b<=J)aS("JPEGInterchangeFormatLength field value is invalid");if(a!=null)return{jpegOffset:a}}}if(C!=null){U=C[0];
q=C[1]}if(o!=null)if(L!=null)if(b>=2&&M+b<=J){if(h[R+M+b-2]==255&&h[R+M+b-1]==s)K=new Uint8Array(b-2);
else K=new Uint8Array(b);for(Y=0;Y<K.length;Y++)K[Y]=h[R+M+Y];aS("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else aS("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");
if(K==null){var x=0,S=[];S[x++]=255;S[x++]=s;var c=e.t519;if(c==null)throw new Error("JPEGQTables tag is missing");
for(Y=0;Y<c.length;Y++){S[x++]=255;S[x++]=I;S[x++]=0;S[x++]=67;S[x++]=Y;for(A=0;A<64;A++)S[x++]=h[R+c[Y]+A]}for(T=0;
T<2;T++){var f=e[T==0?"t520":"t521"];if(f==null)throw new Error((T==0?"JPEGDCTables":"JPEGACTables")+" tag is missing");
for(Y=0;Y<f.length;Y++){S[x++]=255;S[x++]=m;var F=19;for(A=0;A<16;A++)F+=h[R+f[Y]+A];S[x++]=F>>>8;S[x++]=F&255;
S[x++]=Y|T<<4;for(A=0;A<16;A++)S[x++]=h[R+f[Y]+A];for(A=0;A<F;A++)S[x++]=h[R+f[Y]+16+A]}}S[x++]=255;
S[x++]=_;S[x++]=0;S[x++]=8+3*k;S[x++]=8;S[x++]=e.height>>>8&255;S[x++]=e.height&255;S[x++]=e.width>>>8&255;
S[x++]=e.width&255;S[x++]=k;if(k==1){S[x++]=1;S[x++]=17;S[x++]=0}else for(Y=0;Y<3;Y++){S[x++]=Y+1;S[x++]=Y!=0?17:(U&15)<<4|q&15;
S[x++]=Y}if(i!=null&&i[0]!=0){S[x++]=255;S[x++]=$;S[x++]=0;S[x++]=4;S[x++]=i[0]>>>8&255;S[x++]=i[0]&255}K=new Uint8Array(S)}var D=-1;
Y=0;while(Y<K.length-1){if(K[Y]==255&&K[Y+1]==_){D=Y;break}Y++}if(D==-1){var v=new Uint8Array(K.length+10+3*k);
v.set(K);var P=K.length;D=K.length;K=v;K[P++]=255;K[P++]=_;K[P++]=0;K[P++]=8+3*k;K[P++]=8;K[P++]=e.height>>>8&255;
K[P++]=e.height&255;K[P++]=e.width>>>8&255;K[P++]=e.width&255;K[P++]=k;if(k==1){K[P++]=1;K[P++]=17;K[P++]=0}else for(Y=0;
Y<3;Y++){K[P++]=Y+1;K[P++]=Y!=0?17:(U&15)<<4|q&15;K[P++]=Y}}if(h[J]==255&&h[J+1]==N){var E=h[J+2]<<8|h[J+3];
W=new Uint8Array(E+2);W[0]=h[J];W[1]=h[J+1];W[2]=h[J+2];W[3]=h[J+3];for(Y=0;Y<E-2;Y++)W[Y+4]=h[J+Y+4]}else{W=new Uint8Array(2+6+2*k);
var l=0;W[l++]=255;W[l++]=N;W[l++]=0;W[l++]=6+2*k;W[l++]=k;if(k==1){W[l++]=1;W[l++]=0}else for(Y=0;Y<3;
Y++){W[l++]=Y+1;W[l++]=Y<<4|Y}W[l++]=0;W[l++]=63;W[l++]=0}return{jpegOffset:R,tables:K,sosMarker:W,sofPosition:D}};
r.decode._decodeOldJPEG=function(e,h,R,p,s,V){var I,m,$,_,N,a=r.decode._decodeOldJPEGInit(e,h,R,p);if(a.jpegOffset!=null){m=R+p-a.jpegOffset;
_=new Uint8Array(m);for(I=0;I<m;I++)_[I]=h[a.jpegOffset+I]}else{$=a.tables.length;_=new Uint8Array($+a.sosMarker.length+p+2);
_.set(a.tables);N=$;_[a.sofPosition+5]=e.height>>>8&255;_[a.sofPosition+6]=e.height&255;_[a.sofPosition+7]=e.width>>>8&255;
_[a.sofPosition+8]=e.width&255;if(h[R]!=255||h[R+1]!=SOS){_.set(a.sosMarker,N);N+=sosMarker.length}for(I=0;
I<p;I++)_[N++]=h[R+I];_[N++]=255;_[N++]=EOI}var J=new r.JpegDecoder;J.parse(_);var K=J.getData({width:J.width,height:J.height,forceRGB:!0,isSourcePDF:!1});
for(var I=0;I<K.length;I++)s[V+I]=K[I];if(e.t262&&e.t262[0]==6)e.t262[0]=2};r.decode._decodePackBits=function(e,h,R,p,s){var V=new Int8Array(e.buffer),I=new Int8Array(p.buffer),m=h+R;
while(h<m){var $=V[h];h++;if($>=0&&$<128)for(var _=0;_<$+1;_++){I[s]=V[h];s++;h++}if($>=-127&&$<0){for(var _=0;
_<-$+1;_++){I[s]=V[h];s++}h++}}return s};r.decode._decodeThunder=function(e,h,R,p,s){var V=[0,1,0,-1],I=[0,1,2,3,0,-3,-2,-1],m=h+R,$=s*2,_=0;
while(h<m){var N=e[h],a=N>>>6,J=N&63;h++;if(a==3){_=J&15;p[$>>>1]|=_<<4*(1-$&1);$++}if(a==0)for(var K=0;
K<J;K++){p[$>>>1]|=_<<4*(1-$&1);$++}if(a==2)for(var K=0;K<2;K++){var W=J>>>3*(1-K)&7;if(W!=4){_+=I[W];
p[$>>>1]|=_<<4*(1-$&1);$++}}if(a==1)for(var K=0;K<3;K++){var W=J>>>2*(2-K)&3;if(W!=2){_+=V[W];p[$>>>1]|=_<<4*(1-$&1);
$++}}}};r.decode._dmap={"1":0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3};r.decode._lens=function(){var e=function($,_,N,a){for(var J=0;
J<_.length;J++)$[_[J]]=N+J*a},h="00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101,"+"101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010,"+"00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010,"+"00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100",R="0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000,"+"0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001,"+"000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111,"+"000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111",p="11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,"+"011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011",s="0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,"+"0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,"+"0000001011011,0000001100100,0000001100101",V="00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";
h=h.split(",");R=R.split(",");p=p.split(",");s=s.split(",");V=V.split(",");var I={},m={};e(I,h,0,1);
e(I,p,64,64);e(I,V,1792,64);e(m,R,0,1);e(m,s,64,64);e(m,V,1792,64);return[I,m]}();r.decode._decodeG4=function(e,h,R,p,s,V,I){var m=r.decode,$=h<<3,_=0,N="",a=[],J=[],W=0,H=0,Y=0,A=0,T=0,o=0,L=0,t="",C=0;
for(var K=0;K<V;K++)J.push(0);J=m._makeDiff(J);var U=Math.ceil(V/8)*8;while($>>>3<h+R){A=m._findDiff(J,W+(W==0?0:1),1-o),T=m._findDiff(J,A,o);
var q=0;if(I==1)q=e[$>>>3]>>>7-($&7)&1;if(I==2)q=e[$>>>3]>>>($&7)&1;$++;N+=q;if(t=="H"){if(m._lens[o][N]!=null){var k=m._lens[o][N];
N="";_+=k;if(k<64){m._addNtimes(a,_,o);W+=_;o=1-o;_=0;C--;if(C==0)t=""}}}else{if(N=="0001"){N="";m._addNtimes(a,T-W,o);
W=T}if(N=="001"){N="";t="H";C=2}if(m._dmap[N]!=null){H=A+m._dmap[N];m._addNtimes(a,H-W,o);W=H;N="";o=1-o}}if(a.length==V&&t==""){m._writeBits(a,p,s*8+L*U);
o=0;L++;W=0;J=m._makeDiff(a);a=[]}}};r.decode._findDiff=function(e,h,R){for(var p=0;p<e.length;p+=2)if(e[p]>=h&&e[p+1]==R)return e[p]};
r.decode._makeDiff=function(e){var h=[];if(e[0]==1)h.push(0,1);for(var R=1;R<e.length;R++)if(e[R-1]!=e[R])h.push(R,e[R]);
h.push(e.length,0,e.length,1);return h};r.decode._decodeG2=function(e,h,R,p,s,V,I){var m=r.decode,$=h<<3,_=0,N="",a=[],J=0,K=0,W=Math.ceil(V/8)*8;
while($>>>3<h+R){var H=0;if(I==1)H=e[$>>>3]>>>7-($&7)&1;if(I==2)H=e[$>>>3]>>>($&7)&1;$++;N+=H;_=m._lens[J][N];
if(_!=null){m._addNtimes(a,_,J);N="";if(_<64)J=1-J;if(a.length==V){m._writeBits(a,p,s*8+K*W);a=[];K++;
J=0;if(($&7)!=0)$+=8-($&7);if(_>=64)$+=8}}}};r.decode._decodeG3=function(e,h,R,p,s,V,I,m){var $=r.decode,_=h<<3,N=0,a="",J=[],K=[],H=0,Y=0,A=0,T=0,o=0,L=0,t="",C=0,U=!0;
for(var W=0;W<V;W++)J.push(0);var b=-1,q=Math.ceil(V/8)*8;while(_>>>3<h+R){T=$._findDiff(K,H+(H==0?0:1),1-L),o=$._findDiff(K,T,L);
var k=0;if(I==1)k=e[_>>>3]>>>7-(_&7)&1;if(I==2)k=e[_>>>3]>>>(_&7)&1;_++;a+=k;if(U){if($._lens[L][a]!=null){var i=$._lens[L][a];
a="";N+=i;if(i<64){$._addNtimes(J,N,L);L=1-L;N=0}}}else{if(t=="H"){if($._lens[L][a]!=null){var i=$._lens[L][a];
a="";N+=i;if(i<64){$._addNtimes(J,N,L);H+=N;L=1-L;N=0;C--;if(C==0)t=""}}}else{if(a=="0001"){a="";$._addNtimes(J,o-H,L);
H=o}if(a=="001"){a="";t="H";C=2}if($._dmap[a]!=null){Y=T+$._dmap[a];$._addNtimes(J,Y-H,L);H=Y;a="";L=1-L}}}if(a.endsWith("000000000001")){if(b>=0)$._writeBits(J,p,s*8+b*q);
if(m){if(I==1)U=(e[_>>>3]>>>7-(_&7)&1)==1;if(I==2)U=(e[_>>>3]>>>(_&7)&1)==1;_++}a="";L=0;b++;H=0;K=$._makeDiff(J);
J=[]}}if(J.length==V)$._writeBits(J,p,s*8+b*q)};r.decode._addNtimes=function(e,h,R){for(var p=0;p<h;
p++)e.push(R)};r.decode._writeBits=function(e,h,R){for(var p=0;p<e.length;p++)h[R+p>>>3]|=e[p]<<7-(R+p&7)};
r.decode._decodeLZW=r.decode._decodeLZW=function(){var e,h,p,s,V=0,I=0,m=0,$=0,_=function(){var A=e>>>3,o=h[A]<<16|h[A+1]<<8|h[A+2],L=o>>>24-(e&7)-I&(1<<I)-1;
e+=I;return L},N=new Uint32Array(4096*4),a=0,J=function(A){if(A==a)return;a=A;m=1<<A;$=m+1;for(var o=0;
o<$+1;o++){N[4*o]=N[4*o+3]=o;N[4*o+1]=65535;N[4*o+2]=1}},K=function(A){I=A+1;V=$+1},W=function(A){var o=A<<2,L=N[o+2],b=s+L-1;
while(o!=65535){p[b--]=N[o];o=N[o+1]}s+=L},H=function(A,o){var L=V<<2,b=A<<2;N[L]=N[(o<<2)+3];N[L+1]=b;
N[L+2]=N[b+2]+1;N[L+3]=N[b+3];V++;if(V+1==1<<I&&I!=12)I++},Y=function(A,o,L,b,t,U){e=o<<3;h=A;p=b;s=t;
var q=o+L<<3,i=0,x=0;J(U);K(U);while(e<q&&(i=_())!=$){if(i==m){K(U);i=_();if(i==$)break;W(i)}else{if(i<V){W(i);
H(x,i)}else{H(x,x);W(V-1)}}x=i}return s};return Y}();r.tags={};r._types=function(){var e=new Array(250);
e.fill(0);e=e.concat([0,0,0,0,4,3,3,3,3,3,0,0,3,0,0,0,3,0,0,2,2,2,2,4,3,0,0,3,4,4,3,3,5,5,3,2,5,5,0,0,0,0,4,4,0,0,3,3,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,2,2,3,5,5,3,0,3,3,4,4,4,3,4,0,0,0,0,0,0,0,0,0,3,3,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);
var h={33432:2,33434:5,33437:5,34665:4,34850:3,34853:4,34855:3,34864:3,34866:4,36864:7,36867:2,36868:2,37121:7,37377:10,37378:5,37380:10,37381:5,37383:3,37384:3,37385:3,37386:5,37510:7,37520:2,37521:2,37522:2,40960:7,40961:3,40962:4,40963:4,40965:4,41486:5,41487:5,41488:3,41985:3,41986:3,41987:3,41988:5,41989:3,41990:3,41993:3,41994:3,41995:7,41996:3,42032:2,42033:2,42034:5,42036:2,42037:2,59932:7};
return{basic:{main:e,rest:h},gps:{main:[1,2,5,2,5,1,5,5,0,9],rest:{18:2,29:2}}}}();r._readIFD=function(e,h,R,p,s,V){var I=e.readUshort(h,R);
R+=2;var m={};if(V.debug)aS("   ".repeat(s),p.length-1,">>>----------------");for(var $=0;$<I;$++){var _=e.readUshort(h,R);
R+=2;var N=e.readUshort(h,R);R+=2;var a=e.readUint(h,R);R+=4;var J=e.readUint(h,R);R+=4;var K=[];if(N==1||N==7){var W=a<5?R-4:J;
if(W+a>h.buffer.byteLength)a=h.buffer.byteLength-W;K=new Uint8Array(h.buffer,W,a)}if(N==2){var H=a<5?R-4:J,Y=h[H],A=Math.max(0,Math.min(a-1,h.length-H));
if(Y<128||A==0)K.push(e.readASCII(h,H,A));else K=new Uint8Array(h.buffer,H,A)}if(N==3){for(var T=0;T<a;
T++)K.push(e.readUshort(h,(a<3?R-4:J)+2*T))}if(N==4||N==13){for(var T=0;T<a;T++)K.push(e.readUint(h,(a<2?R-4:J)+4*T))}if(N==5||N==10){var o=N==5?e.readUint:e.readInt;
for(var T=0;T<a;T++)K.push([o(h,J+T*8),o(h,J+T*8+4)])}if(N==8){for(var T=0;T<a;T++)K.push(e.readShort(h,(a<3?R-4:J)+2*T))}if(N==9){for(var T=0;
T<a;T++)K.push(e.readInt(h,(a<2?R-4:J)+4*T))}if(N==11){for(var T=0;T<a;T++)K.push(e.readFloat(h,J+T*4))}if(N==12){for(var T=0;
T<a;T++)K.push(e.readDouble(h,J+T*8))}if(a!=0&&K.length==0){aS(_,"unknown TIFF tag type: ",N,"num:",a);
if($==0)return;continue}if(V.debug)aS("   ".repeat(s),_,N,r.tags[_],K);m["t"+_]=K;if(_==330&&m.t272&&m.t272[0]=="DSLR-A100"){}else if(_==330||_==34665||_==34853||_==50740&&e.readUshort(h,e.readUint(K,0))<300||_==61440){var M=_==50740?[e.readUint(K,0)]:K,L=[];
for(var T=0;T<M.length;T++)r._readIFD(e,h,M[T],L,s+1,V);if(_==330)m.subIFD=L;if(_==34665)m.exifIFD=L[0];
if(_==34853)m.gpsiIFD=L[0];if(_==50740)m.dngPrvt=L[0];if(_==61440)m.fujiIFD=L[0]}if(_==37500&&V.parseMN){var b=K;
if(e.readASCII(b,0,5)=="Nikon")m.makerNote=r.decode(b.slice(10).buffer)[0];else if(e.readASCII(b,0,5)=="OLYMP"||e.readASCII(b,0,9)=="OM SYSTEM"){var t=[8208,8224,8240,8256,8272],C=[];
r._readIFD(e,b,b[1]==77?16:b[5]==85?12:8,C,s+1,V);var U=m.makerNote=C.pop();for(var T=0;T<t.length;T++){var q="t"+t[T];
if(U[q]==null)continue;r._readIFD(e,b,U[q][0],C,s+1,V);U[q]=C.pop()}if(U.t12288){r._readIFD(e,U.t12288,0,C,s+1,V);
U.t12288=C.pop()}}else if(e.readUshort(h,J)<300&&e.readUshort(h,J+4)<=12){var C=[];r._readIFD(e,h,J,C,s+1,V);
m.makerNote=C[0]}}}p.push(m);if(V.debug)aS("   ".repeat(s),"<<<---------------");return R};r._writeIFD=function(e,h,R,p,s){var V=Object.keys(s),I=V.length;
if(s.exifIFD)I--;if(s.gpsiIFD)I--;e.writeUshort(R,p,I);p+=2;var m=p+I*12+4;for(var $=0;$<V.length;$++){var _=V[$];
if(_=="t34665"||_=="t34853")continue;if(_=="exifIFD")_="t34665";if(_=="gpsiIFD")_="t34853";var N=parseInt(_.slice(1)),a=h.main[N];
if(a==null)a=h.rest[N];if(a==null||a==0)throw new Error("unknown type of tag: "+N);var J=s[_];if(N==34665){var K=r._writeIFD(e,h,R,m,s.exifIFD);
J=[m];m=K[1]}if(N==34853){var K=r._writeIFD(e,r._types.gps,R,m,s.gpsiIFD);J=[m];m=K[1]}if(a==2)J=J[0]+"\0";
var W=J.length;e.writeUshort(R,p,N);p+=2;e.writeUshort(R,p,a);p+=2;e.writeUint(R,p,W);p+=4;var H=[-1,1,1,2,4,8,0,1,0,4,8,0,8][a]*W,Y=p;
if(H>4){e.writeUint(R,p,m);Y=m}if(a==1||a==7){for(var A=0;A<W;A++)R[Y+A]=J[A]}else if(a==2){e.writeASCII(R,Y,J)}else if(a==3){for(var A=0;
A<W;A++)e.writeUshort(R,Y+2*A,J[A])}else if(a==4){for(var A=0;A<W;A++)e.writeUint(R,Y+4*A,J[A])}else if(a==5||a==10){var T=a==5?e.writeUint:e.writeInt;
for(var A=0;A<W;A++){var o=J[A],M=o[0],L=o[1];if(M==null)throw"e";T(R,Y+8*A,M);T(R,Y+8*A+4,L)}}else if(a==9){for(var A=0;
A<W;A++)e.writeInt(R,Y+4*A,J[A])}else if(a==12){for(var A=0;A<W;A++)e.writeDouble(R,Y+8*A,J[A])}else throw a;
if(H>4){H+=H&1;m+=H}p+=4}return[p,m]};r.toRGBA8=function(e,h){function R(D){return D<.0031308?12.92*D:1.055*Math.pow(D,1/2.4)-.055}var p=e.width,s=e.height,I=p*s,m=I*4,$=e.data,_=new Uint8Array(I*4),N=e.t262?e.t262[0]:2,a=e.t258?Math.min(32,e.t258[0]):1;
if(e.t262==null&&a==1)N=0;var J=e.t277?e.t277[0]:e.t258?e.t258.length:[1,1,3,1,1,4,3][N],K=e.t339?e.t339[0]:null;
if(N==1&&a==32&&K!=3)throw"e";var W=Math.ceil(J*a*p/8);if(!1){}else if(N==0){h=1/256;for(var H=0;H<s;
H++){var Y=H*W,A=H*p;if(a==1)for(var T=0;T<p;T++){var o=A+T<<2,L=$[Y+(T>>3)]>>7-(T&7)&1;_[o]=_[o+1]=_[o+2]=(1-L)*255;
_[o+3]=255}if(a==4)for(var T=0;T<p;T++){var o=A+T<<2,L=$[Y+(T>>1)]>>4-4*(T&1)&15;_[o]=_[o+1]=_[o+2]=(15-L)*17;
_[o+3]=255}if(a==8)for(var T=0;T<p;T++){var o=A+T<<2,L=$[Y+T];_[o]=_[o+1]=_[o+2]=255-L;_[o+3]=255}if(a==16)for(var T=0;
T<p;T++){var o=A+T<<2,t=Y+2*T,L=$[t+1]<<8|$[t];_[o]=_[o+1]=_[o+2]=Math.min(255,255-~~(L*h));_[o+3]=255}}}else if(N==1){if(h==null)h=1/256;
var C=($.length&3)==0?new Float32Array($.buffer):null;for(var H=0;H<s;H++){var Y=H*W,A=H*p;if(a==1)for(var T=0;
T<p;T++){var o=A+T<<2,L=$[Y+(T>>3)]>>7-(T&7)&1;_[o]=_[o+1]=_[o+2]=L*255;_[o+3]=255}if(a==2)for(var T=0;
T<p;T++){var o=A+T<<2,L=$[Y+(T>>2)]>>6-2*(T&3)&3;_[o]=_[o+1]=_[o+2]=L*85;_[o+3]=255}if(a==8)for(var T=0;
T<p;T++){var o=A+T<<2,L=$[Y+T*J];_[o]=_[o+1]=_[o+2]=L;_[o+3]=255}if(a==16)for(var T=0;T<p;T++){var o=A+T<<2,t=Y+2*T,L=$[t+1]<<8|$[t];
_[o]=_[o+1]=_[o+2]=Math.min(255,~~(L*h));_[o+3]=255}if(a==32)for(var T=0;T<p;T++){var o=A+T<<2,t=(Y>>>2)+T,L=C[t];
_[o]=_[o+1]=_[o+2]=~~(.5+255*L);_[o+3]=255}}}else if(N==2){if(a==8){if(J==1)for(var T=0;T<I;T++){_[4*T]=_[4*T+1]=_[4*T+2]=$[T];
_[4*T+3]=255}if(J==3)for(var T=0;T<I;T++){var o=T<<2,U=T*3;_[o]=$[U];_[o+1]=$[U+1];_[o+2]=$[U+2];_[o+3]=255}if(J>=4)for(var T=0;
T<I;T++){var o=T<<2,U=T*J;_[o]=$[U];_[o+1]=$[U+1];_[o+2]=$[U+2];_[o+3]=$[U+3]}}else if(a==16){if(J==4)for(var T=0;
T<I;T++){var o=T<<2,U=T*8+1;_[o]=$[U];_[o+1]=$[U+2];_[o+2]=$[U+4];_[o+3]=$[U+6]}if(J==3)for(var T=0;
T<I;T++){var o=T<<2,U=T*6+1;_[o]=$[U];_[o+1]=$[U+2];_[o+2]=$[U+4];_[o+3]=255}}else if(a==32){var q=new Float32Array($.buffer),k=0;
for(var T=0;T<q.length;T++)k=Math.min(k,q[T]);if(k<0)for(var T=0;T<$.length;T+=4){var i=$[T];$[T]=$[T+3];
$[T+3]=i;i=$[T+1];$[T+1]=$[T+2];$[T+2]=i}var x=[];for(var T=0;T<65536;T++)x.push(R(T/65535));for(var T=0;
T<q.length;T++){var S=Math.max(0,Math.min(1,q[T]));q[T]=x[~~(.5+S*65535)]}if(J==3)for(var T=0;T<I;T++){var o=T<<2,U=T*3;
_[o]=~~(.5+q[U]*255);_[o+1]=~~(.5+q[U+1]*255);_[o+2]=~~(.5+q[U+2]*255);_[o+3]=255}else if(J==4)for(var T=0;
T<I;T++){var o=T<<2,U=T*4;_[o]=~~(.5+q[U]*255);_[o+1]=~~(.5+q[U+1]*255);_[o+2]=~~(.5+q[U+2]*255);_[o+3]=~~(.5+q[U+3]*255)}else throw J}else throw a}else if(N==3){var c=e.t320,f=1<<a,F=a==8&&J>1&&e.t338&&e.t338[0]!=0;
for(var H=0;H<s;H++)for(var D=0;D<p;D++){var T=H*p+D,o=T<<2,v=0,P=H*W;if(!1){}else if(a==1)v=$[P+(D>>>3)]>>>7-(D&7)&1;
else if(a==2)v=$[P+(D>>>2)]>>>6-2*(D&3)&3;else if(a==4)v=$[P+(D>>>1)]>>>4-4*(D&1)&15;else if(a==8)v=$[P+D*J];
else throw a;_[o]=c[v]>>8;_[o+1]=c[f+v]>>8;_[o+2]=c[f+f+v]>>8;_[o+3]=F?$[P+D*J+1]:255}}else if(N==5){var E=J>4?1:0;
for(var T=0;T<I;T++){var o=T<<2,l=T*J;if(window.UDOC){var aF=$[l],at=$[l+1],u=$[l+2],w=$[l+3],am=UDOC.C.cmykToRgb([aF*(1/255),at*(1/255),u*(1/255),w*(1/255)]);
_[o]=~~(.5+255*am[0]);_[o+1]=~~(.5+255*am[1]);_[o+2]=~~(.5+255*am[2])}else{var aF=255-$[l],at=255-$[l+1],u=255-$[l+2],w=(255-$[l+3])*(1/255);
_[o]=~~(aF*w+.5);_[o+1]=~~(at*w+.5);_[o+2]=~~(u*w+.5)}_[o+3]=255*(1-E)+$[l+4]*E}}else if(N==6&&e.t278){var aY=e.t278[0];
for(var H=0;H<s;H+=aY){var T=H*p,ap=aY*p;for(var ac=0;ac<ap;ac++){var o=4*(T+ac),l=3*T+4*(ac>>>1),u=$[l+(ac&1)],Z=$[l+2]-128,aw=$[l+3]-128,B=u+((aw>>2)+(aw>>3)+(aw>>5)),z=u-((Z>>2)+(Z>>4)+(Z>>5))-((aw>>1)+(aw>>3)+(aw>>4)+(aw>>5)),aD=u+(Z+(Z>>1)+(Z>>2)+(Z>>6));
_[o]=Math.max(0,Math.min(255,B));_[o+1]=Math.max(0,Math.min(255,z));_[o+2]=Math.max(0,Math.min(255,aD));
_[o+3]=255}}}else if(N==32845){for(var H=0;H<s;H++)for(var D=0;D<p;D++){var l=(H*p+D)*6,o=(H*p+D)*4,aC=$[l+1]<<8|$[l],aC=Math.pow(2,(aC+.5)/256-64),az=($[l+3]+.5)/410,b5=($[l+5]+.5)/410,y=9*az/(6*az-16*b5+12),a3=4*b5/(6*az-16*b5+12),Q=aC,aG=y*Q/a3,u=Q,a1=(1-y-a3)*Q/a3,B=2.69*aG-1.276*u-.414*a1,z=-1.022*aG+1.978*u+.044*a1,aD=.061*aG-.224*u+1.163*a1;
_[o]=R(Math.min(B,1))*255;_[o+1]=R(Math.min(z,1))*255;_[o+2]=R(Math.min(aD,1))*255;_[o+3]=255}}else aS("Unknown Photometric interpretation: "+N);
return _};r.replaceIMG=function(e){if(e==null)e=document.getElementsByTagName("img");var h=["tif","tiff","dng","cr2","nef"];
for(var R=0;R<e.length;R++){var p=e[R],s=p.getAttribute("src");if(s==null)continue;var V=s.split(".").pop().toLowerCase();
if(h.indexOf(V)==-1)continue;var m=new XMLHttpRequest;r._xhrs.push(m);r._imgs.push(p);m.open("GET",s);
m.responseType="arraybuffer";m.onload=r._imgLoaded;m.send()}};r._xhrs=[];r._imgs=[];r._imgLoaded=function(e){var h=r._xhrs.indexOf(e.target),p=r._imgs[h];
r._xhrs.splice(h,1);r._imgs.splice(h,1);p.setAttribute("src",r.bufferToURI(e.target.response))};r.bufferToURI=function(e){var h=r.decode(e),R=h,p=0,s=R[0];
if(h[0].subIFD)R=R.concat(h[0].subIFD);for(var V=0;V<R.length;V++){var m=R[V];if(m.t258==null||m.t258.length<3)continue;
var $=m.t256*m.t257;if($>p){p=$;s=m}}r.decodeImage(e,s,h);var _=r.toRGBA8(s),N=s.width,a=s.height,J=document.createElement("canvas");
J.width=N;J.height=a;var K=J.getContext("2d"),W=new ImageData(new Uint8ClampedArray(_.buffer),N,a);K.putImageData(W,0,0);
return J.toDataURL()};r._binBE={nextZero:function(e,h){while(e[h]!=0)h++;return h},readUshort:function(e,h){return e[h]<<8|e[h+1]},readShort:function(e,h){var R=r._binBE.ui8;
R[0]=e[h+1];R[1]=e[h+0];return r._binBE.i16[0]},readInt:function(e,h){var R=r._binBE.ui8;R[0]=e[h+3];
R[1]=e[h+2];R[2]=e[h+1];R[3]=e[h+0];return r._binBE.i32[0]},readUint:function(e,h){var R=r._binBE.ui8;
R[0]=e[h+3];R[1]=e[h+2];R[2]=e[h+1];R[3]=e[h+0];return r._binBE.ui32[0]},readASCII:function(e,h,R){var p="";
for(var s=0;s<R;s++)p+=String.fromCharCode(e[h+s]);return p},readFloat:function(e,h){var R=r._binBE.ui8;
for(var p=0;p<4;p++)R[p]=e[h+3-p];return r._binBE.fl32[0]},readDouble:function(e,h){var R=r._binBE.ui8;
for(var p=0;p<8;p++)R[p]=e[h+7-p];return r._binBE.fl64[0]},writeUshort:function(e,h,R){e[h]=R>>8&255;
e[h+1]=R&255},writeInt:function(e,h,R){var p=r._binBE.ui8;r._binBE.i32[0]=R;e[h+3]=p[0];e[h+2]=p[1];
e[h+1]=p[2];e[h+0]=p[3]},writeUint:function(e,h,R){e[h]=R>>24&255;e[h+1]=R>>16&255;e[h+2]=R>>8&255;e[h+3]=R>>0&255},writeASCII:function(e,h,R){for(var p=0;
p<R.length;p++)e[h+p]=R.charCodeAt(p)},writeDouble:function(e,h,R){r._binBE.fl64[0]=R;for(var p=0;p<8;
p++)e[h+p]=r._binBE.ui8[7-p]}};r._binBE.ui8=new Uint8Array(8);r._binBE.i16=new Int16Array(r._binBE.ui8.buffer);
r._binBE.i32=new Int32Array(r._binBE.ui8.buffer);r._binBE.ui32=new Uint32Array(r._binBE.ui8.buffer);
r._binBE.fl32=new Float32Array(r._binBE.ui8.buffer);r._binBE.fl64=new Float64Array(r._binBE.ui8.buffer);
r._binLE={nextZero:r._binBE.nextZero,readUshort:function(e,h){return e[h+1]<<8|e[h]},readShort:function(e,h){var R=r._binBE.ui8;
R[0]=e[h+0];R[1]=e[h+1];return r._binBE.i16[0]},readInt:function(e,h){var R=r._binBE.ui8;R[0]=e[h+0];
R[1]=e[h+1];R[2]=e[h+2];R[3]=e[h+3];return r._binBE.i32[0]},readUint:function(e,h){var R=r._binBE.ui8;
R[0]=e[h+0];R[1]=e[h+1];R[2]=e[h+2];R[3]=e[h+3];return r._binBE.ui32[0]},readASCII:r._binBE.readASCII,readFloat:function(e,h){var R=r._binBE.ui8;
for(var p=0;p<4;p++)R[p]=e[h+p];return r._binBE.fl32[0]},readDouble:function(e,h){var R=r._binBE.ui8;
for(var p=0;p<8;p++)R[p]=e[h+p];return r._binBE.fl64[0]},writeUshort:function(e,h,R){e[h]=R&255;e[h+1]=R>>8&255},writeInt:function(e,h,R){var p=r._binBE.ui8;
r._binBE.i32[0]=R;e[h+0]=p[0];e[h+1]=p[1];e[h+2]=p[2];e[h+3]=p[3]},writeUint:function(e,h,R){e[h]=R>>>0&255;
e[h+1]=R>>>8&255;e[h+2]=R>>>16&255;e[h+3]=R>>>24&255},writeASCII:r._binBE.writeASCII};r._copyTile=function(e,h,R,p,s,V,I,m){var $=Math.min(h,s-I),_=Math.min(R,V-m);
for(var N=0;N<_;N++){var a=(m+N)*s+I,J=N*h;for(var K=0;K<$;K++)p[a+K]=e[J+K]}};r._inflateRaw=function(){var e={};
e.H={};e.H.N=function(h,R){var p=Uint8Array,s=0,V=0,m=0,$=0,_=0,a=0,J=0,K=0,W=0,H,Y;if(h[0]==3&&h[1]==0)return R?R:new p(0);
var A=e.H,L=A.b,b=A.e,t=A.R,U=A.n,k=A.A,i=A.Z,x=A.m,S=R==null;if(S)R=new p(h.length>>>2<<5);while(s==0){s=L(h,W,1);
V=L(h,W+1,2);W+=3;if(V==0){if((W&7)!=0)W+=8-(W&7);var D=(W>>>3)+4,v=h[D-4]|h[D-3]<<8;if(S)R=e.H.W(R,K+v);
R.set(new p(h.buffer,h.byteOffset+D,v),K);W=D+v<<3;K+=v;continue}if(S)R=e.H.W(R,K+(1<<17));if(V==1){H=x.J;
Y=x.h;a=(1<<9)-1;J=(1<<5)-1}if(V==2){m=b(h,W,5)+257;$=b(h,W+5,5)+1;_=b(h,W+10,4)+4;W+=14;var l=W,aF=1;
for(var w=0;w<38;w+=2){x.Q[w]=0;x.Q[w+1]=0}for(var w=0;w<_;w++){var am=b(h,W+w*3,3);x.Q[(x.X[w]<<1)+1]=am;
if(am>aF)aF=am}W+=3*_;U(x.Q,aF);k(x.Q,aF,x.u);H=x.w;Y=x.d;W=t(x.u,(1<<aF)-1,m+$,h,W,x.v);var aY=A.V(x.v,0,m,x.C);
a=(1<<aY)-1;var O=A.V(x.v,m,$,x.D);J=(1<<O)-1;U(x.C,aY);k(x.C,aY,H);U(x.D,O);k(x.D,O,Y)}while(!0){var B=H[i(h,W)&a];
W+=B&15;var z=B>>>4;if(z>>>8==0){R[K++]=z}else if(z==256){break}else{var aD=K+z-254;if(z>264){var aC=x.q[z-257];
aD=K+(aC>>>3)+b(h,W,aC&7);W+=aC&7}var az=Y[i(h,W)&J];W+=az&15;var b5=az>>>4,y=x.c[b5],a3=(y>>>4)+L(h,W,y&15);
W+=y&15;while(K<aD){R[K]=R[K++-a3];R[K]=R[K++-a3];R[K]=R[K++-a3];R[K]=R[K++-a3]}K=aD}}}return R.length==K?R:R.slice(0,K)};
e.H.W=function(h,R){var p=h.length;if(R<=p)return h;var s=new Uint8Array(p<<1);s.set(h,0);return s};
e.H.R=function(h,R,p,s,V,I){var m=e.H.e,$=e.H.Z,N=0;while(N<p){var J=h[$(s,V)&R];V+=J&15;var K=J>>>4;
if(K<=15){I[N]=K;N++}else{var W=0,H=0;if(K==16){H=3+m(s,V,2);V+=2;W=I[N-1]}else if(K==17){H=3+m(s,V,3);
V+=3}else if(K==18){H=11+m(s,V,7);V+=7}var Y=N+H;while(N<Y){I[N]=W;N++}}}return V};e.H.V=function(h,R,p,s){var V=0,I=0,m=s.length>>>1;
while(I<p){var $=h[I+R];s[I<<1]=0;s[(I<<1)+1]=$;if($>V)V=$;I++}while(I<m){s[I<<1]=0;s[(I<<1)+1]=0;I++}return V};
e.H.n=function(h,R){var p=e.H.m,s=h.length,V,I,m,$,N,J=p.j;for(var $=0;$<=R;$++)J[$]=0;for($=1;$<s;$+=2)J[h[$]]++;
var K=p.K;V=0;J[0]=0;for(I=1;I<=R;I++){V=V+J[I-1]<<1;K[I]=V}for(m=0;m<s;m+=2){N=h[m+1];if(N!=0){h[m]=K[N];
K[N]++}}};e.H.A=function(h,R,p){var s=h.length,V=e.H.m,I=V.r;for(var m=0;m<s;m+=2)if(h[m+1]!=0){var $=m>>1,N=h[m+1],J=$<<4|N,K=R-N,W=h[m]<<K,H=W+(1<<K);
while(W!=H){var Y=I[W]>>>15-R;p[Y]=J;W++}}};e.H.l=function(h,R){var p=e.H.m.r,s=15-R;for(var V=0;V<h.length;
V+=2){var I=h[V]<<R-h[V+1];h[V]=p[I]>>>s}};e.H.M=function(h,R,p){p=p<<(R&7);var s=R>>>3;h[s]|=p;h[s+1]|=p>>>8};
e.H.I=function(h,R,p){p=p<<(R&7);var s=R>>>3;h[s]|=p;h[s+1]|=p>>>8;h[s+2]|=p>>>16};e.H.e=function(h,R,p){return(h[R>>>3]|h[(R>>>3)+1]<<8)>>>(R&7)&(1<<p)-1};
e.H.b=function(h,R,p){return(h[R>>>3]|h[(R>>>3)+1]<<8|h[(R>>>3)+2]<<16)>>>(R&7)&(1<<p)-1};e.H.Z=function(h,R){return(h[R>>>3]|h[(R>>>3)+1]<<8|h[(R>>>3)+2]<<16)>>>(R&7)};
e.H.i=function(h,R){return(h[R>>>3]|h[(R>>>3)+1]<<8|h[(R>>>3)+2]<<16|h[(R>>>3)+3]<<24)>>>(R&7)};e.H.m=function(){var h=Uint16Array,R=Uint32Array;
return{K:new h(16),j:new h(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 h(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 h(512),_:[],h:new h(32),$:[],w:new h(32768),C:[],v:[],d:new h(32768),D:[],u:new h(512),Q:[],r:new h(1<<15),s:new R(286),Y:new R(30),a:new R(19),t:new R(15e3),k:new h(1<<16),g:new h(1<<15)}}();
(function(){var h=e.H.m,R=1<<15;for(var p=0;p<R;p++){var s=p;s=(s&2863311530)>>>1|(s&1431655765)<<1;
s=(s&3435973836)>>>2|(s&858993459)<<2;s=(s&4042322160)>>>4|(s&252645135)<<4;s=(s&4278255360)>>>8|(s&16711935)<<8;
h.r[p]=(s>>>16|s<<16)>>>17}function V(I,m,$){while(m--!=0)I.push(0,$)}for(var p=0;p<32;p++){h.q[p]=h.S[p]<<3|h.T[p];
h.c[p]=h.p[p]<<4|h.z[p]}V(h._,144,8);V(h._,255-143,9);V(h._,279-255,7);V(h._,287-279,8);e.H.n(h._,9);
e.H.A(h._,9,h.J);e.H.l(h._,9);V(h.$,32,5);e.H.n(h.$,5);e.H.A(h.$,5,h.h);e.H.l(h.$,5);V(h.Q,19,0);V(h.C,286,0);
V(h.D,30,0);V(h.v,320,0)}());return e.H.N}();r.LosslessJpegDecode=function(){var e,h;function R(){return e[h++]}function p(){return e[h++]<<8|e[h++]}function s(T){var o=R(),M=[0,0,0,255],L=[],b=8;
for(var C=0;C<16;C++)L[C]=R();for(var C=0;C<16;C++){for(var U=0;U<L[C];U++){var k=V(M,0,C+1,1);M[k+3]=R()}}var i=new Uint8Array(1<<b);
T[o]=[new Uint8Array(M),i];for(var C=0;C<1<<b;C++){var x=b,F=C,D=0,v=0;while(M[D+3]==255&&x!=0){v=F>>--x&1;
D=M[D+v]}i[C]=D}}function V(T,o,M,L){if(T[o+3]!=255)return 0;if(M==0)return o;for(var b=0;b<2;b++){if(T[o+b]==0){T[o+b]=T.length;
T.push(0,0,L,255)}var C=V(T,T[o+b],M-1,L+1);if(C!=0)return C}return 0}function I(T){var o=T.b,M=T.f;
while(o<25&&T.a<T.d){var L=T.data[T.a++];if(L==255&&!T.c)T.a++;M=M<<8|L;o+=8}if(o<0)throw"e";T.b=o;T.f=M}function m(T,o){if(o.b<T)I(o);
return o.f>>(o.b-=T)&65535>>16-T}function $(T,o){var M=T[0],L=0,b=255,C=0;if(o.b<16)I(o);var U=o.f>>o.b-8&255;
L=T[1][U];b=M[L+3];o.b-=M[L+2];while(b==255){C=o.f>>--o.b&1;L=M[L+C];b=M[L+3]}return b}function a(T,o){if(T<32768>>16-o)T+=-(1<<o)+1;
return T}function J(T,o){var M=$(T,o);if(M==0)return 0;if(M==16)return-32768;var L=m(M,o);return a(L,M)}function K(T,o,M,L,b,C){var U=0;
for(var k=0;k<C;k++){var i=k*o;for(var x=0;x<o;x+=b){U++;for(var F=0;F<b;F++)T[i+x+F]=J(L[F],M)}if(M.e!=0&&U%M.e==0&&k!=0){var D=M.a,v=M.data;
while(v[D]!=255||!(208<=v[D+1]&&v[D+1]<=215))D--;M.a=D+2;M.f=0;M.b=0}}}function W(T,o){return a(m(T,o),T)}function H(T,o,M,L,b){var C=e.length-h;
for(var U=0;U<C;U+=4){var k=e[h+U];e[h+U]=e[h+U+3];e[h+U+3]=k;var k=e[h+U+1];e[h+U+1]=e[h+U+2];e[h+U+2]=k}for(var i=0;
i<b;i++){var x=32768,F=32768;for(var D=0;D<o;D+=2){var v=$(L,M),P=$(L,M);if(v!=0)x+=W(v,M);if(P!=0)F+=W(P,M);
T[i*o+D]=x&65535;T[i*o+D+1]=F&65535}}}function Y(T){e=T;h=0;if(p()!=65496)throw"e";var o=[],M=0,L=0,b=0,C=[],U=[],k=[],i=0,x=0,F=0;
while(!0){var D=p();if(D==65535){h--;continue}var v=p();if(D==65475){L=R();x=p();F=p();i=R();for(var P=0;
P<i;P++){var E=R(),at=R(),u=R();if(u!=0)throw"e";o[E]=[P,at>>4,at&15]}}else if(D==65476){var w=h+v-2;
while(h<w)s(U)}else if(D==65498){h++;for(var P=0;P<i;P++){var aY=R(),ac=o[aY];k[ac[0]]=U[R()>>>4];C[ac[0]]=ac.slice(1)}M=R();
h+=2;break}else if(D==65501){b=p()}else{h+=v-2}}var aw=L>8?Uint16Array:Uint8Array,z=new aw(x*F*i),Q={b:0,f:0,c:M==8,a:h,data:e,d:e.length,e:b};
if(Q.c)H(z,F*i,Q,k[0],x);else{var aG=[],a1=0,as=0;for(var P=0;P<i;P++){var g=C[P],G=g[0],d=g[1];if(G>a1)a1=G;
if(d>as)as=d;aG.push(G*d)}if(a1!=1||as!=1){if(i!=3||aG[1]!=1||aG[2]!=1)throw"e";if(a1!=2||as!=1&&as!=2)throw"e";
var b2=[],n=0;for(var P=0;P<i;P++){for(var X=0;X<aG[P];X++)b2.push(k[P]);n+=aG[P]}var aN=F/a1,a6=x/as,b8=aN*a6;
K(z,aN*n,Q,b2,n,a6);A(z,M,aN,a6,n-2,n,n,L);var a_=new Uint16Array(b8*aG[0]);if(a1==2&&as==2){for(var P=0;
P<b8;P++){a_[4*P]=z[6*P];a_[4*P+1]=z[6*P+1];a_[4*P+2]=z[6*P+2];a_[4*P+3]=z[6*P+3]}A(a_,M,aN*4,a6,0,1,1,L);
for(var P=0;P<b8;P++){z[6*P]=a_[4*P];z[6*P+1]=a_[4*P+1];z[6*P+2]=a_[4*P+2];z[6*P+3]=a_[4*P+3]}}if(a1==2&&as==1){for(var P=0;
P<b8;P++){a_[2*P]=z[4*P];a_[2*P+1]=z[4*P+1]}A(a_,M,aN*2,a6,0,1,1,L);for(var P=0;P<b8;P++){z[4*P]=a_[2*P];
z[4*P+1]=a_[2*P+1]}}var aq=z.slice(0);for(var d=0;d<x;d++){if(as==2)for(var G=0;G<F;G++){var aI=(d*F+G)*i,ad=((d>>>1)*aN+(G>>>1))*n,ax=(d&1)*2+(G&1);
z[aI]=aq[ad+ax];z[aI+1]=aq[ad+4];z[aI+2]=aq[ad+5]}else for(var G=0;G<F;G++){var aI=(d*F+G)*i,ad=(d*aN+(G>>>1))*n,ax=G&1;
z[aI]=aq[ad+ax];z[aI+1]=aq[ad+2];z[aI+2]=aq[ad+3]}}}else{K(z,F*i,Q,k,i,x);if(b==0)A(z,M,F,x,0,i,i,L);
else{var aE=Math.floor(b/F);for(var d=0;d<x;d+=aE){var b4=z.slice(d*F*i,(d+aE)*F*i);A(b4,M,F,aE,0,i,i,L);
z.set(b4,d*F*i)}}}}return z}function A(T,o,M,L,b,C,U,k){var x=M*U;for(var F=b;F<C;F++)T[F]+=1<<k-1;for(var D=U;
D<x;D+=U)for(var F=b;F<C;F++)T[D+F]+=T[D+F-U];for(var v=1;v<L;v++){var P=v*x;for(var F=b;F<C;F++)T[P+F]+=T[P+F-x];
for(var D=U;D<x;D+=U){for(var F=b;F<C;F++){var E=P+D+F,at=E-x,u=T[E-U],w=0;if(o==0)w=0;else if(o==1)w=u;
else if(o==2)w=T[at];else if(o==3)w=T[at-U];else if(o==4)w=u+(T[at]-T[at-U]);else if(o==5)w=u+(T[at]-T[at-U]>>>1);
else if(o==6)w=T[at]+(u-T[at-U]>>>1);else if(o==7)w=u+T[at]>>>1;else throw o;T[E]+=w}}}}return Y}();
(function(){var e=0,h=1,R=2,p=3,s=4,V=5,m=6,$=7,_=8,N=9,a=10,J=11,K=12,H=13,A=14,T=15,o=16,M=17,b=18;
function t(Z){var O=r._binBE.readUshort,g={b:O(Z,0),i:Z[2],C:Z[3],u:Z[4],q:O(Z,5),k:O(Z,7),e:O(Z,9),l:O(Z,11),s:Z[13],d:O(Z,14)};
if(g.b!=18771||g.i>1||g.q<6||g.q%6||g.e<768||g.e%24||g.l!=768||g.k<g.l||g.k%g.l||g.k-g.e>=g.l||g.s>16||g.s!=g.k/g.l||g.s!=Math.ceil(g.e/g.l)||g.d!=g.q/6||g.u!=12&&g.u!=14&&g.u!=16||g.C!=16&&g.C!=0){throw"Invalid data"}if(g.i==0){throw"Not implemented. We need this file!"}g.h=g.C==16;
g.m=(g.h?g.l*2/3:g.l>>>1)|0;g.A=g.m+2;g.f=64;g.g=(1<<g.u)-1;g.n=4*g.u;return g}function C(Z,O){var g=new Array(O.s),G=4*O.s,d=16+G;
if(G&12)d+=16-(G&12);for(var b2=0,n=16;b2<O.s;n+=4){var X=r._binBE.readUint(Z,n);g[b2]=Z.slice(d,d+X);
g[b2].j=0;g[b2].a=0;d+=X;b2++}if(d!=Z.length)throw"Invalid data";return g}function U(Z,O){for(var g=-O[4],G=0;
g<=O[4];G++,g++){Z[G]=g<=-O[3]?-4:g<=-O[2]?-3:g<=-O[1]?-2:g<-O[0]?-1:g<=O[0]?0:g<O[1]?1:g<O[2]?2:g<O[3]?3:4}}function q(Z,O,g){var G=[O,3*O+18,5*O+67,7*O+276,g];
Z.o=O;Z.w=(G[4]+2*O)/(2*O+1)+1|0;Z.v=Math.ceil(Math.log2(Z.w));Z.t=9;U(Z.c,G)}function k(Z){var O={c:new Int8Array(2<<Z.u)};
q(O,0,Z.g);return O}function c(Z){var O=[[],[],[]],g=Math.max(2,Z.w+32>>>6);for(var G=0;G<3;G++){for(var d=0;
d<41;d++){O[G][d]=[g,1]}}return O}function f(Z){for(var O=-1,g=0;!g;O++){g=Z[Z.j]>>>7-Z.a&1;Z.a++;Z.a&=7;
if(!Z.a)Z.j++}return O}function D(Z,O){var g=0,G=8-Z.a,d=Z.j,b2=Z.a;if(O){if(O>=G){do{g<<=G;O-=G;g|=Z[Z.j]&(1<<G)-1;
Z.j++;G=8}while(O>=8)}if(O){g<<=O;G-=O;g|=Z[Z.j]>>>G&(1<<O)-1}Z.a=8-G}return g}function l(Z,O){var g=0;
if(O<Z){while(g<=14&&O<<++g<Z);}return g}function aF(Z,O,g,G,d,b2,n,X){if(X==null)X=0;var aN=b2+1,a6=aN%2,b8=0,a_=0,aq=0,aI,ad,ax=G[d],aE=G[d-1],b4=G[d-2][aN],aZ=aE[aN-1],aH=aE[aN],ah=aE[aN+1],aJ=ax[aN-1],aL=ax[aN+1],ay=Math.abs,ak,aW,bb,a$;
if(a6){ak=ay(ah-aH);aW=ay(b4-aH);bb=ay(aZ-aH)}if(a6){a$=ak>bb&&aW<ak?b4+aZ:ak<bb&&aW<bb?b4+ah:ah+aZ;
a$=a$+2*aH>>>2;if(X){ax[aN]=a$;return}aI=O.t*O.c[Z.g+aH-b4]+O.c[Z.g+aZ-aH]}else{a$=aH>aZ&&aH>ah||aH<aZ&&aH<ah?aL+aJ+2*aH>>>2:aJ+aL>>>1;
aI=O.t*O.c[Z.g+aH-aZ]+O.c[Z.g+aZ-aJ]}ad=ay(aI);var al=f(g);if(al<Z.n-O.v-1){var a8=l(n[ad][0],n[ad][1]);
aq=D(g,a8)+(al<<a8)}else{aq=D(g,O.v)+1}aq=aq&1?-1-(aq>>>1):aq>>>1;n[ad][0]+=ay(aq);if(n[ad][1]==Z.f){n[ad][0]>>>=1;
n[ad][1]>>>=1}n[ad][1]++;a$=aI<0?a$-aq:a$+aq;if(Z.i){if(a$<0)a$+=O.w;else if(a$>Z.g)a$-=O.w}ax[aN]=a$>=0?Math.min(a$,Z.g):0}function at(Z,O,g){var G=Z[0].length;
for(var d=O;d<=g;d++){Z[d][0]=Z[d-1][1];Z[d][G-1]=Z[d-1][G-2]}}function u(Z){at(Z,$,K);at(Z,R,s);at(Z,T,M)}function w(Z,O,g,G,d,b2,n,X,aN,a6,b8,a_,aq){var aI=0,ad=1,ax=d<H&&d>s;
while(ad<Z.m){if(aI<Z.m){aF(Z,O,g,G,d,aI,n[aN],Z.h&&(ax&&a6||!ax&&(b8||(aI&a_)==aq)));aF(Z,O,g,G,b2,aI,n[aN],Z.h&&(!ax&&a6||ax&&(b8||(aI&a_)==aq)));
aI+=2}if(aI>8){aF(Z,O,g,G,d,ad,X[aN]);aF(Z,O,g,G,b2,ad,X[aN]);ad+=2}}u(G)}function ap(Z,O,g,G,d,b2){w(Z,O,g,G,R,$,d,b2,0,0,1,0,8);
w(Z,O,g,G,_,T,d,b2,1,0,1,0,8);w(Z,O,g,G,p,N,d,b2,2,1,0,3,0);w(Z,O,g,G,a,o,d,b2,0,0,0,3,2);w(Z,O,g,G,s,J,d,b2,1,0,0,3,2);
w(Z,O,g,G,K,M,d,b2,2,1,0,3,0)}function ac(Z,O,g,G,d,b2){var n=b2.length,X=Z.l;if(d+1==Z.s)X=Z.e-d*Z.l;
var aN=6*Z.e*G+d*Z.l;for(var a6=0;a6<6;a6++){for(var b8=0;b8<X;b8++){var a_=b2[a6%n][b8%n],aq;if(a_==0){aq=R+(a6>>>1)}else if(a_==2){aq=T+(a6>>>1)}else{aq=$+a6}var aI=Z.h?(b8*2/3&2147483646|b8%3&1)+(b8%3>>>1):b8>>>1;
O[aN+b8]=g[aq][aI+1]}aN+=Z.e}}r._decompressRAF=function(Z,O){var g=t(Z),G=C(Z,g),d=k(g),b2=new Int16Array(g.e*g.q);
if(O==null){O=g.h?[[1,1,0,1,1,2],[1,1,2,1,1,0],[2,0,1,0,2,1],[1,1,2,1,1,0],[1,1,0,1,1,2],[0,2,1,2,0,1]]:[[0,1],[3,2]]}var n=[[e,p],[h,s],[V,J],[m,K],[H,o],[A,M]],X=[];
for(var aN=0;aN<b;aN++){X[aN]=new Uint16Array(g.A)}for(var a6=0;a6<g.s;a6++){var b8=c(d),a_=c(d);for(var aN=0;
aN<b;aN++){for(var aq=0;aq<g.A;aq++){X[aN][aq]=0}}for(var aI=0;aI<g.d;aI++){ap(g,d,G[a6],X,b8,a_);for(var aN=0;
aN<6;aN++){for(var aq=0;aq<g.A;aq++){X[n[aN][0]][aq]=X[n[aN][1]][aq]}}ac(g,b2,X,aI,a6,O);for(var aN=R;
aN<b;aN++){if([V,m,H,A].indexOf(aN)==-1){for(var aq=0;aq<g.A;aq++){X[aN][aq]=0}}}u(X)}}return b2}}())}(r))}())


"use strict";function GifWriter(l,e,c,h){var s=0,h=h===undefined?{}:h,v=h.loop===undefined?null:h.loop,F=h.palette===undefined?null:h.palette,u=0,q=0,d=!1;
if(e<=0||c<=0||e>65535||c>65535)throw new Error("Width/Height invalid.");function m(C){var j=C.length;
if(j<2||j>256||j&j-1){throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.")}return j}l[s++]=71;
l[s++]=73;l[s++]=70;l[s++]=56;l[s++]=57;l[s++]=97;if(F!==null){var i=m(F);while(i>>=1)++u;i=1<<u;--u;
if(h.background!==undefined){q=h.background;if(q>=i)throw new Error("Background index out of range.");
if(q===0)throw new Error("Background index explicitly passed as 0.")}}l[s++]=e&255;l[s++]=e>>8&255;l[s++]=c&255;
l[s++]=c>>8&255;l[s++]=(F!==null?128:0)|u;l[s++]=q;l[s++]=0;if(F!==null){for(var o=0,g=F.length;o<g;
++o){var f=F[o];l[s++]=f>>16&255;l[s++]=f>>8&255;l[s++]=f&255}}if(v!==null){if(v<0||v>65535)throw new Error("Loop count invalid.");
l[s++]=33;l[s++]=255;l[s++]=11;l[s++]=78;l[s++]=69;l[s++]=84;l[s++]=83;l[s++]=67;l[s++]=65;l[s++]=80;
l[s++]=69;l[s++]=50;l[s++]=46;l[s++]=48;l[s++]=3;l[s++]=1;l[s++]=v&255;l[s++]=v>>8&255;l[s++]=0}this.addFrame=function(C,j,z,b,w,E){if(d===!0){--s;
d=!1}E=E===undefined?{}:E;if(C<0||j<0||C>65535||j>65535)throw new Error("x/y invalid.");if(z<=0||b<=0||z>65535||b>65535)throw new Error("Width/Height invalid.");
if(w.length<z*b)throw new Error("Not enough pixels for the frame size.");var r=!0,k=E.palette,t=0,A=!1,D=0;
if(k===undefined||k===null){r=!1;k=F}if(k===undefined||k===null)throw new Error("Must supply either a local or global palette.");
var B=m(k);while(B>>=1)++t;B=1<<t;var G=E.delay===undefined?0:E.delay,a=E.disposal===undefined?0:E.disposal;
if(a<0||a>3)throw new Error("Disposal out of range.");if(E.transparent!==undefined&&E.transparent!==null){A=!0;
D=E.transparent;if(D<0||D>=B)throw new Error("Transparent color index.")}if(a!==0||A||G!==0){l[s++]=33;
l[s++]=249;l[s++]=4;l[s++]=a<<2|(A===!0?1:0);l[s++]=G&255;l[s++]=G>>8&255;l[s++]=D;l[s++]=0}l[s++]=44;
l[s++]=C&255;l[s++]=C>>8&255;l[s++]=j&255;l[s++]=j>>8&255;l[s++]=z&255;l[s++]=z>>8&255;l[s++]=b&255;
l[s++]=b>>8&255;l[s++]=r===!0?128|t-1:0;if(r===!0){for(var o=0,g=k.length;o<g;++o){var f=k[o];l[s++]=f>>16&255;
l[s++]=f>>8&255;l[s++]=f&255}}s=GifWriterOutputLZWCodeStream(l,s,t<2?2:t,w);return s};this.end=function(){if(d===!1){l[s++]=59;
d=!0}return s};this.getOutputBuffer=function(){return l};this.setOutputBuffer=function(C){l=C};this.getOutputBufferPosition=function(){return s};
this.setOutputBufferPosition=function(C){s=C}}function GifWriterOutputLZWCodeStream(l,e,c,h){l[e++]=c;
var s=e++,v=1<<c,F=v-1,m=v+1,u=m+1,q=c+1,i=0,o=0;function g(n){while(i>=n){l[e++]=o&255;o>>=8;i-=8;if(e===s+256){l[s]=255;
s=e++}}}function f(n){o|=n<<i;i+=q;g(8)}var d=h[0]&F,C={};f(v);for(var j=1,z=h.length;j<z;++j){var b=h[j]&F,w=d<<8|b,E=C[w];
if(E===undefined){o|=d<<i;i+=q;while(i>=8){l[e++]=o&255;o>>=8;i-=8;if(e===s+256){l[s]=255;s=e++}}if(u===4096){f(v);
u=m+1;q=c+1;C={}}else{if(u>=1<<q)++q;C[w]=u++}d=b}else{d=E}}f(d);f(m);g(1);if(s+1===e){l[s]=0}else{l[s]=e-s-1;
l[e++]=0}return e}

var UGIF=function(){var I=function(){var m,g,w,v,c=0,C=0,M=0,f=0,d=function(){var P=m>>>3,j=g[P+2]<<16|g[P+1]<<8|g[P],h=j>>>(m&7)&(1<<C)-1;
m+=C;return h},x=new Uint32Array(4096*4),n=0,J=function(P){if(P==n)return;n=P;M=1<<P;f=M+1;for(var j=0;
j<f+1;j++){x[4*j]=x[4*j+3]=j;x[4*j+1]=65535;x[4*j+2]=1}},y=function(P){C=P+1;c=f+1},t=function(P){var j=P<<2,h=x[j+2],q=v+h-1;
while(j!=65535){w[q--]=x[j];j=x[j+1]}v+=h},E=function(P,j){var h=c<<2,q=P<<2;x[h]=x[(j<<2)+3];x[h+1]=q;
x[h+2]=x[q+2]+1;x[h+3]=x[q+3];c++;if(c==1<<C&&C!=12)C++},G=function(P,j,h,q,r,b){m=j<<3;g=P;w=q;v=r;
var e=j+h<<3,L=0,l=65535;J(b);y(b);while(m<e&&(L=d())!=f){if(L==M){y(b);L=d();if(L==f)break;t(L)}else{if(L<c){t(L);
if(l!=65535)E(l,L)}else{E(l,l);t(c-1)}}l=L}return v};return G}(),z,H,A=new Uint8Array(128),B=function(){return z[H++]},s=function(){var m=z[H+1]<<8|z[H];
H+=2;return m},o=function(){while(z[H]!=0)H+=1+z[H];H++},p=function(m){z=new Uint8Array(m);H=6;var N=s(),g=s(),w=B(),v=B(),c=B(),a=w>>>7,C=w>>>4&7,M=w>>>3&1,f=w>>>0&7,d=H,x=0,O,J=0,y=0,t=0,E=260;
if(a==1)H+=3*(1<<f+1);var n=[];while(H+1<z.length){var G=B();if(G==33){var P=B();if(P==249){var j=B(),w=B();
J=w>>>2&7;y=s();E=B();if((w&1)==0)E=260;B()}else if(P==254){o()}else if(P==255){o()}else throw P}else if(G==44){var h=s(),q=s(),r=s(),b=s(),e=B(),L=e>>>7;
t=e>>>6&1;if(L==1){var f=e>>>0&7;x=H;H+=3*(1<<f+1)}O={x:h,y:q,c:r,e:b,b:J,delay:y,a:E,f:x==0?d:x,d:t};
n.push(O);x=0}else if(G<=8){var r=O.c,b=O.e,l=r*b,D=0;if(A.length<l*1.2)A=new Uint8Array(~~(l*1.3));
while(H<z.length&&z[H]!=0){var i=B();for(var k=0;k<i;k++)A[D+k]=z[H+k];D+=i;H+=i}if(H>=z.length){alert("Some frames are damaged.");
n.pop();break}B();O.g=new Uint8Array(l);var K=I(A,0,D,O.g,0,G)}else if(G==59)break;else throw G}return{width:N,height:g,data:z,frames:n}};
function u(m,N,z,g,w,v,c,a){for(var C=0;C<c;C++){var M=w[v+C];if(M!=a){var f=N+C<<2,d=g+M*3;m[f]=z[d];
m[f+1]=z[d+1];m[f+2]=z[d+2];m[f+3]=255}}}var F=function(m){var N=m.frames,g=m.width,w=m.height,v=new Uint8Array(g*w*4),c,a=[],z=m.data;
for(var C=0;C<N.length;C++){var M=N[C],f=M.x,d=M.y,x=M.c,O=M.e,J=M.b;if(J==3){if(c==null)c=v.slice(0);
else c.set(v)}var y=[];if(M.d==1){for(var t=0;t<O;t+=8)y.push(t);for(var t=4;t<O;t+=8)y.push(t);for(var t=2;
t<O;t+=4)y.push(t);for(var t=1;t<O;t+=2)y.push(t)}var E=M.g,G=M.f,P=M.a,j=M.d;for(var t=0;t<O;t++){var h=j==0?t:y[t];
u(v,(h+d)*g+f,z,G,E,t*x,x,P)}a.push(v.slice(0).buffer);if(J<2){}else if(J==2){for(var t=0;t<O;t++){var q=((d+t)*g+f)*4;
v.fill(0,q,q+x*4)}}else if(J==3)v.set(c)}return a};return{decode:p,toRGBA8:F}}()

var linear=function(){function f(j,k){this.data=new Array(j.length);for(var i=0,a=j[0].length;i<j.length;
i++){this.data[i]=new Array(a);for(var e=0;e<a;e++){this.data[i][e]=j[i][e]}}if(k){if(typeof k[0]!=="object"){for(var i=0;
i<k.length;i++){k[i]=[k[i]]}}this.mirror=new f(k)}}f.prototype.swap=function(j,k){if(this.mirror)this.mirror.swap(j,k);
var i=this.data[j];this.data[j]=this.data[k];this.data[k]=i};f.prototype.multline=function(j,k){if(this.mirror)this.mirror.multline(j,k);
var i=this.data[j];for(var a=i.length-1;a>=0;a--){i[a]*=k}};f.prototype.addmul=function(j,k,i){if(this.mirror)this.mirror.addmul(j,k,i);
var e=this.data[j],c=this.data[k];for(var b=e.length-1;b>=0;b--){e[b]=e[b]+i*c[b]}};f.prototype.hasNullLine=function(j){for(var k=0;
k<this.data[j].length;k++){if(this.data[j][k]!==0){return!1}}return!0};f.prototype.gauss=function(){var j=0,k=this.data.length,i=this.data[0].length,o=[];
for(var a=0;a<i;a++){var e=0,m=0;for(var c=j;c<k;c++){var b=this.data[c][a];if(Math.abs(b)>Math.abs(e)){m=c;
e=b}}if(e===0){o.push(j)}else{this.multline(m,1/e);this.swap(m,j);for(var n=0;n<k;n++){if(n!==j){this.addmul(n,j,-this.data[n][a])}}}j++}for(var n=0;
n<o.length;n++){if(!this.mirror.hasNullLine(o[n])){throw new Error("singular matrix")}}return this.mirror.data};
var d={};d.solve=function l(j,k){var i=new f(j,k).gauss();if(i.length>0&&i[0].length===1){for(var o=0;
o<i.length;o++)i[o]=i[o][0]}return i};function h(j){var k=new Array(j);for(var i=0;i<j;i++){k[i]=new Array(j);
for(var a=0;a<j;a++){k[i][a]=i===a?1:0}}return k}d.invert=function g(j){return new f(j,h(j.length)).gauss()};
return d}()

var Typr=function(){var h={};h.parse=function(B){var r=function(I,n,i,Q){var l=h.B,U=h.T,Z={cmap:U.M,head:U.head,hhea:U.aW,maxp:U.ao,hmtx:U.ah,name:U.name,"OS/2":U.i,post:U.aC,loca:U.al,kern:U.C,glyf:U.I,"CFF ":U.J,CBLC:U.aZ,CBDT:U.aH,"SVG ":U.a6,COLR:U.a5,CPAL:U.af,sbix:U.at},M={_data:I,_index:n,_offset:i};
for(var X in Z){var D=h.findTable(I,X,i);if(D){var E=D[0],m=Q[E];if(m==null)m=Z[X].w(I,E,D[1],M);M[X]=Q[E]=m}}return M},l=h.B,I=new Uint8Array(B),Q={},A=l.W(I,0,4);
if(A=="ttcf"){var i=4,Y=l.p(I,i);i+=2;var j=l.p(I,i);i+=2;var g=l.O(I,i);i+=4;var b=[];for(var G=0;G<g;
G++){var T=l.O(I,i);i+=4;b.push(r(I,G,T,Q))}return b}else return[r(I,0,0,Q)]};h.findTable=function(B,r,l){var I=h.B,Q=I.p(B,l+4),A=l+12;
for(var i=0;i<Q;i++){var j=I.W(B,A,4),g=I.O(B,A+4),b=I.O(B,A+8),G=I.O(B,A+12);if(j==r)return[b,G];A+=16}return null};
h.T={};h.B={a:function(B,r){return(B[r]<<8|B[r+1])+(B[r+2]<<8|B[r+3])/(256*256+4)},g:function(B,r){var l=h.B.B(B,r);
return l/16384},s:function(B,r){var l=h.B.S.c;l[0]=B[r+3];l[1]=B[r+2];l[2]=B[r+1];l[3]=B[r];return h.B.S.a0[0]},d:function(B,r){var l=h.B.S.c;
l[0]=B[r];return h.B.S.aL[0]},B:function(B,r){var l=h.B.S.aQ;l[0]=B[r]<<8|B[r+1];return h.B.S.az[0]},p:function(B,r){return B[r]<<8|B[r+1]},b0:function(B,r,l){B[r]=l>>8&255;
B[r+1]=l&255},aI:function(B,r,l){var I=[];for(var Q=0;Q<l;Q++){var A=h.B.p(B,r+Q*2);I.push(A)}return I},O:function(B,r){var l=h.B.S.c;
l[3]=B[r];l[2]=B[r+1];l[1]=B[r+2];l[0]=B[r+3];return h.B.S.ab[0]},b6:function(B,r,l){B[r]=l>>24&255;
B[r+1]=l>>16&255;B[r+2]=l>>8&255;B[r+3]=l>>0&255},N:function(B,r){return h.B.O(B,r)*(4294967295+1)+h.B.O(B,r+4)},W:function(B,r,l){var I="";
for(var Q=0;Q<l;Q++)I+=String.fromCharCode(B[r+Q]);return I},ac:function(B,r,l){for(var I=0;I<l.length;
I++)B[r+I]=l.charCodeAt(I)},H:function(B,r,l){var I="";for(var Q=0;Q<l;Q++){var A=B[r++]<<8|B[r++];I+=String.fromCharCode(A)}return I},aN:window.TextDecoder?new window.TextDecoder:null,bc:function(B,r,l){var I=h.B.aN;
if(I&&r==0&&l==B.length)return I.decode(B);return h.B.W(B,r,l)},h:function(B,r,l){var I=[];for(var Q=0;
Q<l;Q++)I.push(B[r+Q]);return I},aX:function(B,r,l){var I=[];for(var Q=0;Q<l;Q++)I.push(String.fromCharCode(B[r+Q]));
return I},S:function(){var B=new ArrayBuffer(8);return{ap:B,aL:new Int8Array(B),c:new Uint8Array(B),az:new Int16Array(B),aQ:new Uint16Array(B),a0:new Int32Array(B),ab:new Uint32Array(B)}}()};
h.T.J={w:function(B,r,l){var I=h.B,Q=h.T.J;B=new Uint8Array(B.buffer,r,l);r=0;var A=B[r];r++;var i=B[r];
r++;var Y=B[r];r++;var j=B[r];r++;var g=[];r=Q.V(B,r,g);var b=[];for(var G=0;G<g.length-1;G++)b.push(I.W(B,r+g[G],g[G+1]-g[G]));
r+=g[g.length-1];var T=[];r=Q.V(B,r,T);var n=[];for(var G=0;G<T.length-1;G++)n.push(Q.b(B,r+T[G],r+T[G+1]));
r+=T[T.length-1];var U=n[0],Z=[];r=Q.V(B,r,Z);var M=[];for(var G=0;G<Z.length-1;G++)M.push(I.W(B,r+Z[G],Z[G+1]-Z[G]));
r+=Z[Z.length-1];Q.l(B,r,U);if(U.CharStrings)U.CharStrings=Q.h(B,U.CharStrings);if(U.ROS){r=U.FDArray;
var X=[];r=Q.V(B,r,X);U.FDArray=[];for(var G=0;G<X.length-1;G++){var q=Q.b(B,r+X[G],r+X[G+1]);Q.U(B,q,M);
U.FDArray.push(q)}r+=X[X.length-1];r=U.FDSelect;U.FDSelect=[];var D=B[r];r++;if(D==3){var E=I.p(B,r);
r+=2;for(var G=0;G<E+1;G++){U.FDSelect.push(I.p(B,r),B[r+2]);r+=3}}else throw D}if(U.charset)U.charset=Q.ae(B,U.charset,U.CharStrings.length);
Q.U(B,U,M);return U},U:function(B,r,l){var I=h.T.J,Q;if(r.Private){Q=r.Private[1];r.Private=I.b(B,Q,Q+r.Private[0]);
if(r.Private.Subrs)I.l(B,Q+r.Private.Subrs,r.Private)}for(var A in r)if("FamilyName FontName FullName Notice version Copyright".split(" ").indexOf(A)!=-1)r[A]=l[r[A]-426+35]},l:function(B,r,l){l.Subrs=h.T.J.h(B,r);
var I,Q=l.Subrs.length+1;if(!1)I=0;else if(Q<1240)I=107;else if(Q<33900)I=1131;else I=32768;l.Bias=I},h:function(B,r){var l=h.B,I=[];
r=h.T.J.V(B,r,I);var Q=[],A=I.length-1,i=B.byteOffset+r;for(var Y=0;Y<A;Y++){var j=I[Y];Q.push(new Uint8Array(B.buffer,i+j,I[Y+1]-j))}return Q},aS:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],a3:function(B,r){for(var l=0;
l<B.charset.length;l++)if(B.charset[l]==r)return l;return-1},P:function(B,r){if(r<0||r>255)return-1;
return h.T.J.a3(B,h.T.J.aS[r])},ae:function(B,r,l){var I=h.B,Q=[".notdef"],A=B[r];r++;if(A==0){for(var i=0;
i<l;i++){var j=I.p(B,r);r+=2;Q.push(j)}}else if(A==1||A==2){while(Q.length<l){var j=I.p(B,r),g=0;r+=2;
if(A==1){g=B[r];r++}else{g=I.p(B,r);r+=2}for(var i=0;i<=g;i++){Q.push(j);j++}}}else throw"error: format: "+A;
return Q},V:function(B,r,l){var I=h.B,Q=I.p(B,r)+1;r+=2;var A=B[r];r++;if(A==1)for(var i=0;i<Q;i++)l.push(B[r+i]);
else if(A==2)for(var i=0;i<Q;i++)l.push(I.p(B,r+i*2));else if(A==3)for(var i=0;i<Q;i++)l.push(I.O(B,r+i*3-1)&16777215);
else if(A==4)for(var i=0;i<Q;i++)l.push(I.O(B,r+i*4));else if(Q!=1)throw"unsupported offset size: "+A+", count: "+Q;
r+=Q*A;return r-1},aU:function(B,r,l){var I=h.B,Q=B[r],A=B[r+1],i=B[r+2],Y=B[r+3],j=B[r+4],g=1,b=null,G=null;
if(Q<=20){b=Q;g=1}if(Q==12){b=Q*100+A;g=2}if(21<=Q&&Q<=27){b=Q;g=1}if(Q==28){G=I.B(B,r+1);g=3}if(29<=Q&&Q<=31){b=Q;
g=1}if(32<=Q&&Q<=246){G=Q-139;g=1}if(247<=Q&&Q<=250){G=(Q-247)*256+A+108;g=2}if(251<=Q&&Q<=254){G=-(Q-251)*256-A-108;
g=2}if(Q==255){G=I.s(B,r+1)/65535;g=5}l.ak=G!=null?G:"o"+b;l.size=g},aV:function(B,r,l){var I=r+l,Q=h.B,A=[];
while(r<I){var i=B[r],Y=B[r+1],j=B[r+2],g=B[r+3],b=B[r+4],G=1,T=null,n=null;if(i<=20){T=i;G=1}if(i==12){T=i*100+Y;
G=2}if(i==19||i==20){T=i;G=2}if(21<=i&&i<=27){T=i;G=1}if(i==28){n=Q.B(B,r+1);G=3}if(29<=i&&i<=31){T=i;
G=1}if(32<=i&&i<=246){n=i-139;G=1}if(247<=i&&i<=250){n=(i-247)*256+Y+108;G=2}if(251<=i&&i<=254){n=-(i-251)*256-Y-108;
G=2}if(i==255){n=Q.s(B,r+1)/65535;G=5}A.push(n!=null?n:"o"+T);r+=G}return A},b:function(B,r,l){var I=h.B,Q={},A=[];
while(r<l){var i=B[r],Y=B[r+1],j=B[r+2],g=B[r+3],b=B[r+4],G=1,T=null,n=null;if(i==28){n=I.B(B,r+1);G=3}if(i==29){n=I.s(B,r+1);
G=5}if(32<=i&&i<=246){n=i-139;G=1}if(247<=i&&i<=250){n=(i-247)*256+Y+108;G=2}if(251<=i&&i<=254){n=-(i-251)*256-Y-108;
G=2}if(i==255){n=I.s(B,r+1)/65535;G=5;throw"unknown number"}if(i==30){var U=[],q="";G=1;while(!0){var Z=B[r+G];
G++;var M=Z>>4,X=Z&15;if(M!=15)U.push(M);if(X!=15)U.push(X);if(X==15)break}var D=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"];
for(var E=0;E<U.length;E++)q+=D[U[E]];n=parseFloat(q)}if(i<=21){var m="version Notice FullName FamilyName Weight FontBBox BlueValues OtherBlues FamilyBlues FamilyOtherBlues StdHW StdVW escape UniqueID XUID charset Encoding CharStrings Private Subrs defaultWidthX nominalWidthX".split(" ");
T=m[i];G=1;if(i==12){var m="Copyright isFixedPitch ItalicAngle UnderlinePosition UnderlineThickness PaintType CharstringType FontMatrix StrokeWidth BlueScale BlueShift BlueFuzz StemSnapH StemSnapV ForceBold   LanguageGroup ExpansionFactor initialRandomSeed SyntheticBase PostScript BaseFontName BaseFontBlend       ROS CIDFontVersion CIDFontRevision CIDFontType CIDCount UIDBase FDArray FDSelect FontName".split(" ");
T=m[Y];G=2}}if(T!=null){Q[T]=A.length==1?A[0]:A;A=[]}else A.push(n);r+=G}return Q}};h.T.M={w:function(B,r,l){var I={u:[],Z:{},av:r};
B=new Uint8Array(B.buffer,r,l);r=0;var Q=r,A=h.B,i=A.p,Y=h.T.M,j=i(B,r);r+=2;var g=i(B,r);r+=2;var b=[];
for(var G=0;G<g;G++){var T=i(B,r);r+=2;var n=i(B,r);r+=2;var U=A.O(B,r);r+=4;var Z="p"+T+"e"+n,M=b.indexOf(U);
if(M==-1){M=I.u.length;var X={};b.push(U);var q=X.aD=i(B,U);if(q==0)X=Y.ai(B,U,X);else if(q==4)X=Y.au(B,U,X);
else if(q==6)X=Y.aq(B,U,X);else if(q==12)X=Y.a1(B,U,X);I.u.push(X)}if(I.Z[Z]!=null)console.log("multiple tables for one platform+encoding: "+Z);
I.Z[Z]=M}return I},ai:function(B,r,l){var I=h.B;r+=2;var Q=I.p(B,r);r+=2;var A=I.p(B,r);r+=2;l.map=[];
for(var i=0;i<Q-6;i++)l.map.push(B[r+i]);return l},au:function(B,r,l){var I=h.B,Q=I.p,A=I.aI,i=r;r+=2;
var Y=Q(B,r);r+=2;var j=Q(B,r);r+=2;var g=Q(B,r);r+=2;var b=g>>>1;l.ba=Q(B,r);r+=2;l.ay=Q(B,r);r+=2;
l.am=Q(B,r);r+=2;l.aY=A(B,r,b);r+=b*2;r+=2;l.a4=A(B,r,b);r+=b*2;l.a$=[];for(var G=0;G<b;G++){l.a$.push(I.B(B,r));
r+=2}l.K=A(B,r,b);r+=b*2;l.F=A(B,r,i+Y-r>>>1);return l},aq:function(B,r,l){var I=h.B,Q=r;r+=2;var A=I.p(B,r);
r+=2;var i=I.p(B,r);r+=2;l.aP=I.p(B,r);r+=2;var Y=I.p(B,r);r+=2;l.F=[];for(var j=0;j<Y;j++){l.F.push(I.p(B,r));
r+=2}return l},a1:function(B,r,l){var I=h.B,Q=I.O,A=r;r+=4;var i=Q(B,r);r+=4;var Y=Q(B,r);r+=4;var j=Q(B,r)*3;
r+=4;var g=l.aM=new Uint32Array(j);for(var b=0;b<j;b+=3){g[b]=Q(B,r+(b<<2));g[b+1]=Q(B,r+(b<<2)+4);g[b+2]=Q(B,r+(b<<2)+8)}return l}};
h.T.aZ={w:function(B,r,l){var I=h.B,Q=r,A=I.p(B,r);r+=2;var i=I.p(B,r);r+=2;var Y=I.O(B,r);r+=4;var j=[];
for(var g=0;g<Y;g++){var b=I.O(B,r);r+=4;var G=I.O(B,r);r+=4;var T=I.O(B,r);r+=4;r+=4;r+=2*12;var n=I.p(B,r);
r+=2;var U=I.p(B,r);r+=2;r+=4;var Z=Q+b;for(var M=0;M<3;M++){var X=I.p(B,Z);Z+=2;var q=I.p(B,Z);Z+=2;
var D=I.O(B,Z);Z+=4;var E=q-X+1,m=Q+b+D,f=I.p(B,m);m+=2;if(f!=1)throw f;var J=I.p(B,m);m+=2;var v=I.O(B,m);
m+=4;var V=[];for(var w=0;w<E;w++){var H=I.O(B,m+w*4);V.push(v+H)}j.push([X,q,J,V])}}return j}};h.T.aH={w:function(B,r,l){var I=h.B,Q=r;
return new Uint8Array(B.buffer,B.byteOffset+r,l)}};h.T.I={w:function(B,r,l,I){var Q=[],A=I.maxp.numGlyphs;
for(var i=0;i<A;i++)Q.push(null);return Q},aR:function(B,r){var l=h.B,I=B._data,Q=B.loca;if(Q[r]==Q[r+1])return null;
var i=h.findTable(I,"glyf",B._offset)[0]+Q[r],Y={};Y.k=l.B(I,i);i+=2;Y.b4=l.B(I,i);i+=2;Y.ar=l.B(I,i);
i+=2;Y.b7=l.B(I,i);i+=2;Y.b1=l.B(I,i);i+=2;if(Y.b4>=Y.b7||Y.ar>=Y.b1)return null;if(Y.k>0){Y._=[];for(var j=0;
j<Y.k;j++){Y._.push(l.p(I,i));i+=2}var g=l.p(I,i),M=0,X=0;i+=2;if(I.length-i<g)return null;Y.aJ=l.h(I,i,g);
i+=g;var b=Y._[Y.k-1]+1;Y.v=[];for(var j=0;j<b;j++){var G=I[i];i++;Y.v.push(G);if((G&8)!=0){var T=I[i];
i++;for(var n=0;n<T;n++){Y.v.push(G);j++}}}Y.e=[];for(var j=0;j<b;j++){var U=(Y.v[j]&2)!=0,Z=(Y.v[j]&16)!=0;
if(U){Y.e.push(Z?I[i]:-I[i]);i++}else{if(Z)Y.e.push(0);else{Y.e.push(l.B(I,i));i+=2}}}Y.j=[];for(var j=0;
j<b;j++){var U=(Y.v[j]&4)!=0,Z=(Y.v[j]&32)!=0;if(U){Y.j.push(Z?I[i]:-I[i]);i++}else{if(Z)Y.j.push(0);
else{Y.j.push(l.B(I,i));i+=2}}}for(var j=0;j<b;j++){M+=Y.e[j];X+=Y.j[j];Y.e[j]=M;Y.j[j]=X}}else{var q=1<<0,D=1<<1,E=1<<2,m=1<<3,v=1<<4,V=1<<5,w=1<<6,H=1<<7,z=1<<8,o=1<<9,x=1<<10,y=1<<11,k=1<<12,s;
Y.T=[];do{s=l.p(I,i);i+=2;var K={r:{Y:1,aG:0,b5:0,f:1,aO:0,aA:0},a9:-1,aE:-1};Y.T.push(K);K.an=l.p(I,i);
i+=2;if(s&q){var O=l.B(I,i);i+=2;var d=l.B(I,i);i+=2}else{var O=l.d(I,i);i++;var d=l.d(I,i);i++}if(s&D){K.r.aO=O;
K.r.aA=d}else{K.a9=O;K.aE=d}if(s&m){K.r.Y=K.r.f=l.g(I,i);i+=2}else if(s&w){K.r.Y=l.g(I,i);i+=2;K.r.f=l.g(I,i);
i+=2}else if(s&H){K.r.Y=l.g(I,i);i+=2;K.r.aG=l.g(I,i);i+=2;K.r.b5=l.g(I,i);i+=2;K.r.f=l.g(I,i);i+=2}}while(s&V);
if(s&z){var a=l.p(I,i);i+=2;Y.aT=[];for(var j=0;j<a;j++){Y.aT.push(I[i]);i++}}}return Y}};h.T.head={w:function(B,r,l){var I=h.B,Q={},A=I.a(B,r);
r+=4;Q.fontRevision=I.a(B,r);r+=4;var i=I.O(B,r);r+=4;var Y=I.O(B,r);r+=4;Q.flags=I.p(B,r);r+=2;Q.unitsPerEm=I.p(B,r);
r+=2;Q.created=I.N(B,r);r+=8;Q.modified=I.N(B,r);r+=8;Q.xMin=I.B(B,r);r+=2;Q.yMin=I.B(B,r);r+=2;Q.xMax=I.B(B,r);
r+=2;Q.yMax=I.B(B,r);r+=2;Q.macStyle=I.p(B,r);r+=2;Q.lowestRecPPEM=I.p(B,r);r+=2;Q.fontDirectionHint=I.B(B,r);
r+=2;Q.indexToLocFormat=I.B(B,r);r+=2;Q.glyphDataFormat=I.B(B,r);r+=2;return Q}};h.T.aW={w:function(B,r,l){var I=h.B,Q={},A=I.a(B,r);
r+=4;var i="ascender descender lineGap advanceWidthMax minLeftSideBearing minRightSideBearing xMaxExtent caretSlopeRise caretSlopeRun caretOffset res0 res1 res2 res3 metricDataFormat numberOfHMetrics".split(" ");
for(var Y=0;Y<i.length;Y++){var j=i[Y],g=j=="advanceWidthMax"||j=="numberOfHMetrics"?I.p:I.B;Q[j]=g(B,r+Y*2)}return Q}};
h.T.ah={w:function(B,r,l,I){var Q=h.B,A=[],i=[],Y=I.maxp.numGlyphs,j=I.hhea.numberOfHMetrics,g=0,b=0,G=0;
while(G<j){g=Q.p(B,r+(G<<2));b=Q.B(B,r+(G<<2)+2);A.push(g);i.push(b);G++}while(G<Y){A.push(g);i.push(b);
G++}return{be:A,bd:i}}};h.T.C={w:function(B,r,l,I){var Q=h.B,A=h.T.C,i=Q.p(B,r);if(i==1)return A.a_(B,r,l,I);
var Y=Q.p(B,r+2);r+=4;var j={D:[],n:[]};for(var g=0;g<Y;g++){r+=2;var l=Q.p(B,r);r+=2;var b=Q.p(B,r);
r+=2;var G=b>>>8;G&=15;if(G==0)r=A.z(B,r,j)}return j},a_:function(B,r,l,I){var Q=h.B,A=h.T.C,i=Q.a(B,r),Y=Q.O(B,r+4);
r+=8;var j={D:[],n:[]};for(var g=0;g<Y;g++){var l=Q.O(B,r);r+=4;var b=Q.p(B,r);r+=2;var G=Q.p(B,r);r+=2;
var T=b&255;if(T==0)r=A.z(B,r,j)}return j},z:function(B,r,l){var I=h.B,Q=I.p,A=-1,i=Q(B,r),Y=Q(B,r+2),j=Q(B,r+4),g=Q(B,r+6);
r+=8;for(var b=0;b<i;b++){var G=Q(B,r);r+=2;var T=Q(B,r);r+=2;var n=I.B(B,r);r+=2;if(G!=A){l.D.push(G);
l.n.push({a2:[],as:[]})}var U=l.n[l.n.length-1];U.a2.push(T);U.as.push(n);A=G}return r}};h.T.al={w:function(B,r,l,I){var Q=h.B,A=[],i=I.head.indexToLocFormat,Y=I.maxp.numGlyphs+1;
if(i==0)for(var j=0;j<Y;j++)A.push(Q.p(B,r+(j<<1))<<1);if(i==1)for(var j=0;j<Y;j++)A.push(Q.O(B,r+(j<<2)));
return A}};h.T.ao={w:function(B,r,l){var I=h.B,Q=I.p,A={},i=I.O(B,r);r+=4;A.numGlyphs=Q(B,r);r+=2;return A}};
h.T.name={w:function(B,r,l){var I=h.B,Q={},A=I.p(B,r),f="fontFamily";r+=2;var i=I.p(B,r);r+=2;var Y=I.p(B,r);
r+=2;var j="copyright fontFamily fontSubfamily ID fullName version postScriptName trademark manufacturer designer description urlVendor urlDesigner licence licenceURL --- typoFamilyName typoSubfamilyName compatibleFull sampleText postScriptCID wwsFamilyName wwsSubfamilyName lightPalette darkPalette".split(" "),g=r,b=I.p;
for(var G=0;G<i;G++){var T=b(B,r),D;r+=2;var n=b(B,r);r+=2;var U=b(B,r);r+=2;var Z=b(B,r);r+=2;var M=b(B,r);
r+=2;var X=b(B,r);r+=2;var q=g+i*12+X;if(!1){}else if(T==0)D=I.H(B,q,M/2);else if(T==3&&n==0)D=I.H(B,q,M/2);
else if(T==1&&n==25)D=I.H(B,q,M/2);else if(n==0)D=I.W(B,q,M);else if(n==1)D=I.H(B,q,M/2);else if(n==3)D=I.H(B,q,M/2);
else if(n==4)D=I.H(B,q,M/2);else if(n==5)D=I.H(B,q,M/2);else if(n==10)D=I.H(B,q,M/2);else if(T==1){D=I.W(B,q,M);
console.log("reading unknown MAC encoding "+n+" as ASCII")}else{console.log("unknown encoding "+n+", platformID: "+T);
D=I.W(B,q,M)}var E="p"+T+","+U.toString(16);if(Q[E]==null)Q[E]={};Q[E][j[Z]]=D;Q[E]._lang=U}var m=h.T.name.b9(Q);
if(m[f]==null)for(var J in Q)if(Q[J][f]!=null)m[f]=Q[J][f];return m},b9:function(B){var r="postScriptName",I;
for(var l in B)if(B[l][r]!=null&&B[l]._lang==1033)return B[l];for(var l in B)if(B[l][r]!=null&&B[l]._lang==0)return B[l];
for(var l in B)if(B[l][r]!=null&&B[l]._lang==3084)return B[l];for(var l in B)if(B[l][r]!=null)return B[l];
for(var l in B){I=B[l];break}console.log("returning name table with languageID "+I.ax);if(I[r]==null&&I.ID!=null)I[r]=I.ID;
return I}};h.T.i={w:function(B,r,l){var I=h.B,Q=I.p(B,r);r+=2;var A=h.T.i,i={};if(Q==0)A.Q(B,r,i);else if(Q==1)A.a8(B,r,i);
else if(Q==2||Q==3||Q==4)A.ag(B,r,i);else if(Q==5)A.aa(B,r,i);else throw"unknown OS/2 table version: "+Q;
return i},Q:function(B,r,l){var I=h.B;l.xAvgCharWidth=I.B(B,r);r+=2;l.usWeightClass=I.p(B,r);r+=2;l.usWidthClass=I.p(B,r);
r+=2;l.fsType=I.p(B,r);r+=2;l.ySubscriptXSize=I.B(B,r);r+=2;l.ySubscriptYSize=I.B(B,r);r+=2;l.ySubscriptXOffset=I.B(B,r);
r+=2;l.ySubscriptYOffset=I.B(B,r);r+=2;l.ySuperscriptXSize=I.B(B,r);r+=2;l.ySuperscriptYSize=I.B(B,r);
r+=2;l.ySuperscriptXOffset=I.B(B,r);r+=2;l.ySuperscriptYOffset=I.B(B,r);r+=2;l.yStrikeoutSize=I.B(B,r);
r+=2;l.yStrikeoutPosition=I.B(B,r);r+=2;l.sFamilyClass=I.B(B,r);r+=2;l.panose=I.h(B,r,10);r+=10;l.ulUnicodeRange1=I.O(B,r);
r+=4;l.ulUnicodeRange2=I.O(B,r);r+=4;l.ulUnicodeRange3=I.O(B,r);r+=4;l.ulUnicodeRange4=I.O(B,r);r+=4;
l.achVendID=I.W(B,r,4);r+=4;l.fsSelection=I.p(B,r);r+=2;l.usFirstCharIndex=I.p(B,r);r+=2;l.usLastCharIndex=I.p(B,r);
r+=2;l.sTypoAscender=I.B(B,r);r+=2;l.sTypoDescender=I.B(B,r);r+=2;l.sTypoLineGap=I.B(B,r);r+=2;l.usWinAscent=I.p(B,r);
r+=2;l.usWinDescent=I.p(B,r);r+=2;return r},a8:function(B,r,l){var I=h.B;r=h.T.i.Q(B,r,l);l.ulCodePageRange1=I.O(B,r);
r+=4;l.ulCodePageRange2=I.O(B,r);r+=4;return r},ag:function(B,r,l){var I=h.B,Q=I.p;r=h.T.i.a8(B,r,l);
l.sxHeight=I.B(B,r);r+=2;l.sCapHeight=I.B(B,r);r+=2;l.usDefault=Q(B,r);r+=2;l.usBreak=Q(B,r);r+=2;l.usMaxContext=Q(B,r);
r+=2;return r},aa:function(B,r,l){var I=h.B.p;r=h.T.i.ag(B,r,l);l.usLowerOpticalPointSize=I(B,r);r+=2;
l.usUpperOpticalPointSize=I(B,r);r+=2;return r}};h.T.aC={w:function(B,r,l){var I=h.B,Q={};Q.version=I.a(B,r);
r+=4;Q.italicAngle=I.a(B,r);r+=4;Q.underlinePosition=I.B(B,r);r+=2;Q.underlineThickness=I.B(B,r);r+=2;
return Q}};h.T.a6={w:function(B,r,l){var I=h.B,Q={entries:[],X:[]},A=r,i=I.p(B,r);r+=2;var Y=I.O(B,r);
r+=4;var j=I.O(B,r);r+=4;r=Y+A;var g=I.p(B,r);r+=2;for(var b=0;b<g;b++){var G=I.p(B,r);r+=2;var T=I.p(B,r);
r+=2;var n=I.O(B,r);r+=4;var U=I.O(B,r);r+=4;var Z=new Uint8Array(B.buffer,A+n+Y,U);if(Z[0]==31&&Z[1]==139&&Z[2]==8)Z=pako.inflate(Z);
var M=I.bc(Z,0,Z.length);for(var X=G;X<=T;X++){Q.entries[X]=Q.X.length}Q.X.push(M)}return Q}};h.T.at={w:function(B,r,l,I){var Q=I.maxp.numGlyphs,A=r,i=h.B,Y=i.O(B,r+4),j=[];
for(var g=Y-1;g<Y;g++){var b=A+i.O(B,r+8+g*4);for(var G=0;G<Q;G++){var T=i.O(B,b+4+G*4),n=i.O(B,b+4+G*4+4);
if(T==n){j[G]=null;continue}var U=b+T,Z=i.W(B,U+4,4);if(Z!="png ")throw Z;j[G]=new Uint8Array(B.buffer,B.byteOffset+U+8,n-T-8)}}return j}};
h.T.a5={w:function(B,r,l){var I=h.B,Q=r;r+=2;var A=I.p(B,r);r+=2;var i=I.O(B,r);r+=4;var Y=I.O(B,r);
r+=4;var j=I.p(B,r);r+=2;var g={},b=Q+i;for(var G=0;G<A;G++){g["g"+I.p(B,b)]=[I.p(B,b+2),I.p(B,b+4)];
b+=6}var T=[];b=Q+Y;for(var G=0;G<j;G++){T.push(I.p(B,b),I.p(B,b+2));b+=4}return[g,T]}};h.T.af={w:function(B,r,l){var I=h.B,Q=r,A=I.p(B,r);
r+=2;if(A==0){var i=I.p(B,r);r+=2;var Y=I.p(B,r);r+=2;var j=I.p(B,r);r+=2;var g=I.O(B,r);r+=4;return new Uint8Array(B.buffer,Q+g,j*4)}else throw A}};
h.U={shape:function(B,r,l){var I=function(B,Q,U,l){var Z=Q[U],M=Q[U+1],X=B.kern;if(X){var q=X.D.indexOf(Z);
if(q!=-1){var D=X.n[q].a2.indexOf(M);if(D!=-1)return[0,0,X.n[q].as[D],0]}}return[0,0,0,0]},Q=[],g=0,b=0;
for(var A=0;A<r.length;A++){var i=r.codePointAt(A);if(i>65535)A++;Q.push(h.U.codeToGlyph(B,i))}var j=[];
for(var A=0;A<Q.length;A++){var G=I(B,Q,A,l),T=Q[A],n=B.hmtx.be[T]+G[2];j.push({g:T,cl:A,dx:0,dy:0,ax:n,ay:0});
g+=n}return j},shapeToPath:function(B,r,l){var I={m:[],o:[]},Q=0,A=0;for(var i=0;i<r.length;i++){var j=r[i],g=h.U.glyphToPath(B,j.g),b=g.crds;
for(var G=0;G<b.length;G+=2){I.o.push(b[G]+Q+j.dx);I.o.push(b[G+1]+A+j.dy)}if(l)I.m.push(l);for(var G=0;
G<g.cmds.length;G++)I.m.push(g.cmds[G]);var T=I.m.length;if(l)if(T!=0&&I.m[T-1]!="X")I.m.push("X");Q+=j.ax;
A+=j.ay}return{cmds:I.m,crds:I.o}},codeToGlyph:function(){function B(A,i,j){var b=0,G=~~(A.length/i);
while(b+1!=G){var T=b+(G-b>>>1);if(A[T*i]<=j)b=T;else G=T}return b*i}var r=[9,10,11,12,13,32,133,160,5760,6158,8232,8233,8239,8288,12288,65279],l={};
for(var I=0;I<r.length;I++)l[r[I]]=1;for(var I=8192;I<=8205;I++)l[I]=1;function Q(A,i){if(A._ctab==null){var j=A.cmap,g=-1,b="p3e10 p0e4 p3e1 p1e0 p0e3 p0e1 p3e0 p3e5".split(" ");
for(var I=0;I<b.length;I++)if(j.Z[b[I]]!=null){g=j.Z[b[I]];break}if(g==-1)throw"no familiar platform and encoding!";
A._ctab=j.u[g]}var G=A._ctab,T=G.aD,n=-1;if(T==0){if(i>=G.map.length)n=0;else n=G.map[i]}else if(T==4){var U=G.aY;
n=0;if(i<=U[U.length-1]){var Z=B(U,1,i);if(U[Z]<i)Z++;if(i>=G.a4[Z]){var M=0;if(G.K[Z]!=0)M=G.F[i-G.a4[Z]+(G.K[Z]>>1)-(G.K.length-Z)];
else M=i+G.a$[Z];n=M&65535}}}else if(T==6){var X=i-G.aP,q=G.F;if(X<0||X>=q.length)n=0;else n=q[X]}else if(T==12){var D=G.aM;
n=0;if(i<=D[D.length-2]){var I=B(D,3,i);if(D[I]<=i&&i<=D[I+1]){n=D[I+2]+(i-D[I])}}}else throw"unknown cmap table format "+G.aD;
var E=A["SVG "],m=A.loca;if(n!=0&&A["CFF "]==null&&(E==null||E.entries[n]==null)&&m&&m[n]==m[n+1]&&l[i]==null)n=0;
return n}return Q}(),glyphToPath:function(B,r,l){var I={m:[],o:[]},Q=B["SVG "],A=B["CFF "],i=B.COLR,Y=B.CBLC,j=B.CBDT,g=B.sbix,b=window.UPNG,G=h.U,T=null;
if(Y&&b)for(var n=0;n<Y.length;n++)if(Y[n][0]<=r&&r<=Y[n][1])T=Y[n];if(T||g&&g[r]){if(T&&T[2]!=17)throw"not a PNG";
if(B.__tmp==null)B.__tmp={};var U=B.__tmp["g"+r];if(U==null){var Z,M,q="";if(g){Z=g[r];M=Z.length}else{var X=T[3][r-T[0]]+5;
M=j[X+1]<<16|j[X+2]<<8|j[X+3];X+=4;Z=new Uint8Array(j.buffer,j.byteOffset+X,M)}for(var n=0;n<M;n++)q+=String.fromCharCode(Z[n]);
U=B.__tmp["g"+r]="data:image/png;base64,"+btoa(q)}I.m.push(U);var D=B.head.unitsPerEm*1.15,E=Math.round(D),m=Math.round(D),f=Math.round(-m*.15);
I.o.push(0,m+f,E,m+f,E,f,0,f)}else if(Q&&Q.entries[r]){var J=Q.entries[r];if(J!=null){if(typeof J=="number"){var v=Q.X[J];
if(typeof v=="string"){var V=new DOMParser,w=V.parseFromString(v,"image/svg+xml");v=Q.X[J]=w.getElementsByTagName("svg")[0]}J=G.SVG.aK(v,r);
Q.entries[r]=J}I=J}}else if(l!=!0&&i&&i[0]["g"+r]&&i[0]["g"+r][1]>1){function H(N){var R=N.toString(16);
return(R.length==1?"0":"")+R}var z=B.CPAL,o=i[0]["g"+r];for(var n=0;n<o[1];n++){var x=o[0]+n,y=i[1][2*x],k=i[1][2*x+1]*4,s=h.U.glyphToPath(B,y,y==r),K="#"+H(z[k+2])+H(z[k+1])+H(z[k+0]);
I.m.push(K);I.m=I.m.concat(s.cmds);I.o=I.o.concat(s.crds);I.m.push("X")}}else if(A){var O=A.Private,d={x:0,y:0,stack:[],R:0,$:!1,width:O?O.defaultWidthX:0,open:!1};
if(A.ROS){var a=0;while(A.FDSelect[a+2]<=r)a+=2;O=A.FDArray[A.FDSelect[a+1]].Private}G._drawCFF(A.CharStrings[r],d,A,O,I)}else if(B.glyf){G._drawGlyf(r,B,I)}return{cmds:I.m,crds:I.o}},_drawGlyf:function(B,r,l){var I=r.glyf[B];
if(I==null)I=r.glyf[B]=h.T.I.aR(r,B);if(I!=null){if(I.k>-1)h.U._simpleGlyph(I,l);else h.U._compoGlyph(I,r,l)}},_simpleGlyph:function(B,r){var l=h.U.P;
for(var I=0;I<B.k;I++){var Q=I==0?0:B._[I-1]+1,A=B._[I];for(var i=Q;i<=A;i++){var j=i==Q?A:i-1,g=i==A?Q:i+1,b=B.v[i]&1,G=B.v[j]&1,T=B.v[g]&1,n=B.e[i],Z=B.j[i];
if(i==Q){if(b){if(G)l.q(r,B.e[j],B.j[j]);else{l.q(r,n,Z);continue}}else{if(G)l.q(r,B.e[j],B.j[j]);else l.q(r,Math.floor((B.e[j]+n)*.5),Math.floor((B.j[j]+Z)*.5))}}if(b){if(G)l.A(r,n,Z)}else{if(T)l.aw(r,n,Z,B.e[g],B.j[g]);
else l.aw(r,n,Z,Math.floor((n+B.e[g])*.5),Math.floor((Z+B.j[g])*.5))}}l.G(r)}},_compoGlyph:function(B,r,l){for(var I=0;
I<B.T.length;I++){var Q={m:[],o:[]},A=B.T[I];h.U._drawGlyf(A.an,r,Q);var i=A.r;for(var Y=0;Y<Q.o.length;
Y+=2){var g=Q.o[Y],b=Q.o[Y+1];l.o.push(g*i.Y+b*i.b5+i.aO);l.o.push(g*i.aG+b*i.f+i.aA)}for(var Y=0;Y<Q.m.length;
Y++)l.m.push(Q.m[Y])}},pathToSVG:function(B,r){var l=B.cmds,I=B.crds,Y=0,g=0,b=0,G=0,T=0,n=0,U=0;if(r==null)r=5;
function Q(H){return parseFloat(H.toFixed(r))}function A(H){var z=[],o=!1,x="";for(var Z=0;Z<H.length;
Z++){var y=H[Z],k=typeof y=="number";if(!k){if(y==x&&y.length==1&&y!="m")continue;x=y}if(o&&k&&y>=0)z.push(" ");
z.push(y);o=k}return z.join("")}var i=[],j={M:2,L:2,Q:4,C:6};for(var Z=0;Z<l.length;Z++){var M=l[Z],X=j[M]?j[M]:0,q=[],D,E,m,v;
if(M=="L"){D=I[Y]-g;E=I[Y+1]-b;m=Q(D+G);v=Q(E+T);if(l[Z+1]=="Z"&&I[Y]==n&&I[Y+1]==U){m=D;v=E}else if(m==0&&v==0){}else if(m==0)q.push("v",v);
else if(v==0)q.push("h",m);else{q.push("l",m,v)}}else{q.push(M.toLowerCase());for(var V=0;V<X;V+=2){D=I[Y+V]-g;
E=I[Y+V+1]-b;m=Q(D+G);v=Q(E+T);q.push(m,v)}}if(X!=0){G+=D-m;T+=E-v}var w=q;for(var V=0;V<w.length;V++)i.push(w[V]);
if(X!=0){Y+=X;g=I[Y-2];b=I[Y-1]}if(M=="M"){n=g;U=b}if(M=="Z"){g=n;b=U}}return A(i)},SVGToPath:function(B){var r={m:[],o:[]};
h.U.SVG.aj(B,r);return{cmds:r.m,crds:r.o}},pathToContext:function(){var B,r;function l(Q,A){var i=0,Y=Q.cmds,j=Q.crds;
for(var g=0;g<Y.length;g++){var b=Y[g];if(b=="M"){A.moveTo(j[i],j[i+1]);i+=2}else if(b=="L"){A.lineTo(j[i],j[i+1]);
i+=2}else if(b=="C"){A.bezierCurveTo(j[i],j[i+1],j[i+2],j[i+3],j[i+4],j[i+5]);i+=6}else if(b=="Q"){A.quadraticCurveTo(j[i],j[i+1],j[i+2],j[i+3]);
i+=4}else if(b[0]=="d"){var G=window.UPNG,T=j[i],n=j[i+1],U=j[i+2],Z=j[i+3],M=j[i+4],X=j[i+5],q=j[i+6],D=j[i+7];
i+=8;if(G==null){A.moveTo(T,n);A.lineTo(U,Z);A.lineTo(M,X);A.lineTo(q,D);A.closePath();continue}var E=U-T,m=Z-n,f=q-T,J=D-n,v=atob(b.slice(22)),V=new Uint8Array(v.length);
for(var w=0;w<v.length;w++)V[w]=v.charCodeAt(w);var H=G.decode(V.buffer),z=H.width,o=H.height,x=new Uint8Array(G.toRGBA8(H)[0]),y=A.getTransform(),k=Math.sqrt(Math.abs(y.a*y.d-y.b*y.c))*Math.sqrt(f*f+J*J)/o;
while(k<.5){var s=I(x,z,o);x=s.ap;z=s.b3;o=s.bb;k*=2}if(B==null){B=document.createElement("canvas");
r=B.getContext("2d")}if(B.width!=z||B.height!=o){B.width=z;B.height=o}r.putImageData(new ImageData(new Uint8ClampedArray(x.buffer),z,o),0,0);
A.save();A.transform(E,m,f,J,T,n);A.scale(1/z,1/o);A.drawImage(B,0,0);A.restore()}else if(b.charAt(0)=="#"||b.charAt(0)=="r"){A.beginPath();
A.fillStyle=b}else if(b.charAt(0)=="O"&&b!="OX"){A.beginPath();var K=b.split("-");A.lineWidth=parseFloat(K[2]);
A.strokeStyle=K[1]}else if(b=="Z"){A.closePath()}else if(b=="X"){A.fill()}else if(b=="OX"){A.stroke()}}}function I(Q,A,i,Y){var j=A>>1,g=i>>1,b=Y&&Y.length==j*g*4?Y:new Uint8Array(j*g*4),G=new Uint32Array(Q.buffer),T=new Uint32Array(b.buffer);
for(var n=0;n<g;n++)for(var U=0;U<j;U++){var Z=n*j+U,M=(n<<1)*A+(U<<1),X=G[M],q=G[M+1],D=G[M+A],E=G[M+A+1],v=X>>>24,V=q>>>24,w=D>>>24,H=E>>>24,z=v+V+w+H;
if(z==1020){var o=(X>>>0&255)+(q>>>0&255)+(D>>>0&255)+(E>>>0&255)+2>>>2,x=(X>>>8&255)+(q>>>8&255)+(D>>>8&255)+(E>>>8&255)+2>>>2,y=(X>>>16&255)+(q>>>16&255)+(D>>>16&255)+(E>>>16&255)+2>>>2;
T[Z]=255<<24|y<<16|x<<8|o}else if(z==0)T[Z]=0;else{var o=(X>>>0&255)*v+(q>>>0&255)*V+(D>>>0&255)*w+(E>>>0&255)*H,x=(X>>>8&255)*v+(q>>>8&255)*V+(D>>>8&255)*w+(E>>>8&255)*H,y=(X>>>16&255)*v+(q>>>16&255)*V+(D>>>16&255)*w+(E>>>16&255)*H,k=1/z;
o=~~(o*k+.5);x=~~(x*k+.5);y=~~(y*k+.5);T[Z]=z+2>>>2<<24|y<<16|x<<8|o}}return{ap:b,b3:j,bb:g}}return l}(),P:{q:function(B,r,l){B.m.push("M");
B.o.push(r,l)},A:function(B,r,l){B.m.push("L");B.o.push(r,l)},L:function(B,r,l,I,Q,A,i){B.m.push("C");
B.o.push(r,l,I,Q,A,i)},aw:function(B,r,l,I,Q){B.m.push("Q");B.o.push(r,l,I,Q)},G:function(B){B.m.push("Z")}},_drawCFF:function(B,r,l,I,Q){var A=r.stack,i=r.R,Y=r.$,j=r.width,g=r.open,b=0,G=r.x,T=r.y,n=0,Z=0,M=0,X=0,q=0,D=0,E=0,m=0,v=0,V=0,w=h.T.J,H=h.U.P,z=I.nominalWidthX,o={ak:0,size:0};
while(b<B.length){w.aU(B,b,o);var x=o.ak;b+=o.size;if(!1){}else if(x=="o1"||x=="o18"){var y;y=A.length%2!==0;
if(y&&!Y){j=A.shift()+z}i+=A.length>>1;A.length=0;Y=!0}else if(x=="o3"||x=="o23"){var y;y=A.length%2!==0;
if(y&&!Y){j=A.shift()+z}i+=A.length>>1;A.length=0;Y=!0}else if(x=="o4"){if(A.length>1&&!Y){j=A.shift()+z;
Y=!0}if(g)H.G(Q);T+=A.pop();H.q(Q,G,T);g=!0}else if(x=="o5"){while(A.length>0){G+=A.shift();T+=A.shift();
H.A(Q,G,T)}}else if(x=="o6"||x=="o7"){var k=A.length,s=x=="o6";for(var K=0;K<k;K++){var O=A.shift();
if(s)G+=O;else T+=O;s=!s;H.A(Q,G,T)}}else if(x=="o8"||x=="o24"){var k=A.length,d=0;while(d+6<=k){n=G+A.shift();
Z=T+A.shift();M=n+A.shift();X=Z+A.shift();G=M+A.shift();T=X+A.shift();H.L(Q,n,Z,M,X,G,T);d+=6}if(x=="o24"){G+=A.shift();
T+=A.shift();H.A(Q,G,T)}}else if(x=="o11")break;else if(x=="o1234"||x=="o1235"||x=="o1236"||x=="o1237"){if(x=="o1234"){n=G+A.shift();
Z=T;M=n+A.shift();X=Z+A.shift();v=M+A.shift();V=X;q=v+A.shift();D=X;E=q+A.shift();m=T;G=E+A.shift();
H.L(Q,n,Z,M,X,v,V);H.L(Q,q,D,E,m,G,T)}if(x=="o1235"){n=G+A.shift();Z=T+A.shift();M=n+A.shift();X=Z+A.shift();
v=M+A.shift();V=X+A.shift();q=v+A.shift();D=V+A.shift();E=q+A.shift();m=D+A.shift();G=E+A.shift();T=m+A.shift();
A.shift();H.L(Q,n,Z,M,X,v,V);H.L(Q,q,D,E,m,G,T)}if(x=="o1236"){n=G+A.shift();Z=T+A.shift();M=n+A.shift();
X=Z+A.shift();v=M+A.shift();V=X;q=v+A.shift();D=X;E=q+A.shift();m=D+A.shift();G=E+A.shift();H.L(Q,n,Z,M,X,v,V);
H.L(Q,q,D,E,m,G,T)}if(x=="o1237"){n=G+A.shift();Z=T+A.shift();M=n+A.shift();X=Z+A.shift();v=M+A.shift();
V=X+A.shift();q=v+A.shift();D=V+A.shift();E=q+A.shift();m=D+A.shift();if(Math.abs(E-G)>Math.abs(m-T)){G=E+A.shift()}else{T=m+A.shift()}H.L(Q,n,Z,M,X,v,V);
H.L(Q,q,D,E,m,G,T)}}else if(x=="o14"){if(A.length>0&&A.length!=4&&!Y){j=A.shift()+l.nominalWidthX;Y=!0}if(A.length==4){var a=0,N=A.shift(),R=A.shift(),C=A.shift(),ah=A.shift(),ad=w.P(l,C),a6=w.P(l,ah);
h.U._drawCFF(l.CharStrings[ad],r,l,I,Q);r.x=N;r.y=R;h.U._drawCFF(l.CharStrings[a6],r,l,I,Q)}if(g){H.G(Q);
g=!1}}else if(x=="o19"||x=="o20"){var y;y=A.length%2!==0;if(y&&!Y){j=A.shift()+z}i+=A.length>>1;A.length=0;
Y=!0;b+=i+7>>3}else if(x=="o21"){if(A.length>2&&!Y){j=A.shift()+z;Y=!0}T+=A.pop();G+=A.pop();if(g)H.G(Q);
H.q(Q,G,T);g=!0}else if(x=="o22"){if(A.length>1&&!Y){j=A.shift()+z;Y=!0}G+=A.pop();if(g)H.G(Q);H.q(Q,G,T);
g=!0}else if(x=="o25"){while(A.length>6){G+=A.shift();T+=A.shift();H.A(Q,G,T)}n=G+A.shift();Z=T+A.shift();
M=n+A.shift();X=Z+A.shift();G=M+A.shift();T=X+A.shift();H.L(Q,n,Z,M,X,G,T)}else if(x=="o26"){if(A.length%2){G+=A.shift()}while(A.length>0){n=G;
Z=T+A.shift();M=n+A.shift();X=Z+A.shift();G=M;T=X+A.shift();H.L(Q,n,Z,M,X,G,T)}}else if(x=="o27"){if(A.length%2){T+=A.shift()}while(A.length>0){n=G+A.shift();
Z=T;M=n+A.shift();X=Z+A.shift();G=M+A.shift();T=X;H.L(Q,n,Z,M,X,G,T)}}else if(x=="o10"||x=="o29"){var e=x=="o10"?I:l;
if(A.length==0){console.log("error: empty stack")}else{var ao=A.pop(),W=e.Subrs[ao+e.Bias];r.x=G;r.y=T;
r.R=i;r.$=Y;r.width=j;r.open=g;h.U._drawCFF(W,r,l,I,Q);G=r.x;T=r.y;i=r.R;Y=r.$;j=r.width;g=r.open}}else if(x=="o30"||x=="o31"){var k,S=A.length,d=0,P=x=="o31";
k=S&~2;d+=S-k;while(d<k){if(P){n=G+A.shift();Z=T;M=n+A.shift();X=Z+A.shift();T=X+A.shift();if(k-d==5){G=M+A.shift();
d++}else G=M;P=!1}else{n=G;Z=T+A.shift();M=n+A.shift();X=Z+A.shift();G=M+A.shift();if(k-d==5){T=X+A.shift();
d++}else T=X;P=!0}H.L(Q,n,Z,M,X,G,T);d+=4}}else if((x+"").charAt(0)=="o"){console.log("Unknown operation: "+x,B);
throw x}else A.push(x)}r.x=G;r.y=T;r.R=i;r.$=Y;r.width=j;r.open=g},SVG:function(){var B={aB:function(G){return Math.sqrt(Math.abs(G[0]*G[3]-G[1]*G[2]))},translate:function(G,T,n){B.concat(G,[1,0,0,1,T,n])},rotate:function(G,T){B.concat(G,[Math.cos(T),-Math.sin(T),Math.sin(T),Math.cos(T),0,0])},scale:function(G,T,n){B.concat(G,[T,0,0,n,0,0])},concat:function(G,T){var n=G[0],U=G[1],Z=G[2],M=G[3],X=G[4],q=G[5];
G[0]=n*T[0]+U*T[2];G[1]=n*T[1]+U*T[3];G[2]=Z*T[0]+M*T[2];G[3]=Z*T[1]+M*T[3];G[4]=X*T[0]+q*T[2]+T[4];
G[5]=X*T[1]+q*T[3]+T[5]},ad:function(G){var T=G[0],n=G[1],U=G[2],Z=G[3],M=G[4],X=G[5],q=T*Z-n*U;G[0]=Z/q;
G[1]=-n/q;G[2]=-U/q;G[3]=T/q;G[4]=(U*X-Z*M)/q;G[5]=(n*M-T*X)/q},b8:function(G,T){var n=T[0],Z=T[1];return[n*G[0]+Z*G[2]+G[4],n*G[1]+Z*G[3]+G[5]]},aF:function(G,T){for(var n=0;
n<T.length;n+=2){var U=T[n],Z=T[n+1];T[n]=U*G[0]+Z*G[2]+G[4];T[n+1]=U*G[1]+Z*G[3]+G[5]}}};function r(G,T,n){var U=[],Z=0,M=0,X=0;
while(!0){var q=G.indexOf(T,M),D=G.indexOf(n,M);if(q==-1&&D==-1)break;if(D==-1||q!=-1&&q<D){if(X==0){U.push(G.slice(Z,q).trim());
Z=q+1}X++;M=q+1}else if(q==-1||D!=-1&&D<q){X--;if(X==0){U.push(G.slice(Z,D).trim());Z=D+1}M=D+1}}return U}function l(G){var T=r(G,"{","}"),n={};
for(var U=0;U<T.length;U+=2){var Z=T[U].split(",");for(var M=0;M<Z.length;M++){var X=Z[M].trim();if(n[X]==null)n[X]="";
n[X]+=T[U+1]}}return n}function I(G){var T=r(G,"(",")"),n=[1,0,0,1,0,0];for(var U=0;U<T.length;U+=2){var Z=n;
n=Q(T[U],T[U+1]);B.concat(n,Z)}return n}function Q(G,T){var n=[1,0,0,1,0,0],U=!0;for(var Z=0;Z<T.length;
Z++){var M=T.charAt(Z);if(M==","||M==" ")U=!0;else if(M=="."){if(!U){T=T.slice(0,Z)+","+T.slice(Z);Z++}U=!1}else if(M=="-"&&Z>0&&T[Z-1]!="e"){T=T.slice(0,Z)+" "+T.slice(Z);
Z++;U=!0}}T=T.split(/\s*[\s,]\s*/).map(parseFloat);if(!1){}else if(G=="translate"){if(T.length==1)B.translate(n,T[0],0);
else B.translate(n,T[0],T[1])}else if(G=="translateX"){B.translate(n,T[0],0)}else if(G=="translateY"){B.translate(n,0,T[0])}else if(G=="scale"){if(T.length==1)B.scale(n,T[0],T[0]);
else B.scale(n,T[0],T[1])}else if(G=="rotate"){var X=0,q=0;if(T.length!=1){X=T[1];q=T[2]}B.translate(n,-X,-q);
B.rotate(n,-Math.PI*T[0]/180);B.translate(n,X,q)}else if(G=="matrix")n=T;else if(G=="skewX")n=[1,Math.tan(T[0]*Math.PI/180),0,1,0,0];
else if(G=="skewY")n=[1,0,Math.tan(T[0]*Math.PI/180),1,0,0];else console.log("unknown transform: ",G);
return n}function A(G,T){var n={m:[],o:[]},U=G.getAttribute("viewBox");if(U)U=U.trim().split(" ").map(parseFloat);
else U=[0,0,1e3,1e3];var Z=G;if(T!=null){var M=G.getElementById("glyph"+T);if(M)Z=M}Y(Z.children,n,null,G);
for(var X=0;X<n.o.length;X+=2){var q=n.o[X],D=n.o[X+1];q-=U[0];D-=U[1];D=-D;n.o[X]=q;n.o[X+1]=D}return n}var i={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};
function Y(G,T,n,U){for(var Z=0;Z<G.length;Z++){var M=G[Z],X=M.tagName,q=M.getAttribute("fill");if(q==null)q=n;
if(q&&q.startsWith("url")){var D=q.slice(5,-1),E=U.getElementById(D),m=E.children[0];if(m.getAttribute("stop-opacity")!=null)continue;
q=m.getAttribute("stop-color")}if(i[q])q=i[q];if(X=="g"||X=="use"){var f={o:[],m:[]};if(X=="g")Y(M.children,f,q,U);
else{var J=M.getAttribute("xlink:href").slice(1),v=U.getElementById(J);Y([v],f,q,U)}var V=[1,0,0,1,0,0],w=M.getAttribute("x"),H=M.getAttribute("y");
w=w?parseFloat(w):0;H=H?parseFloat(H):0;B.concat(V,[1,0,0,1,w,H]);var z=M.getAttribute("transform");
if(z)B.concat(V,I(z));B.aF(V,f.o);T.o=T.o.concat(f.o);T.m=T.m.concat(f.m)}else if(X=="path"||X=="circle"||X=="ellipse"){T.m.push(q?q:"#000000");
var o;if(X=="path")o=M.getAttribute("d");if(X=="circle"||X=="ellipse"){var x=[0,0,0,0],y=["cx","cy","rx","ry","r"];
for(var k=0;k<5;k++){var s=M.getAttribute(y[k]);if(s){s=parseFloat(s);if(k<4)x[k]=s;else x[2]=x[3]=s}}var K=x[0],O=x[1],d=x[2],N=x[3];
o=["M",K-d,O,"a",d,N,0,1,0,d*2,0,"a",d,N,0,1,0,-d*2,0].join(" ")}b(o,T);T.m.push("X")}else if(X=="image"){var R=parseFloat(M.getAttribute("width")),u=parseFloat(M.getAttribute("height"));
T.m.push(M.getAttribute("xlink:href"));T.o.push(0,0,R,0,R,u,0,u)}else if(X=="defs"){}else console.log(X)}}function j(G){var T=[],n=0,U=!1,Z="",M="",X="",q=0;
while(n<G.length){var D=G.charCodeAt(n),E=G.charAt(n);n++;var m=48<=D&&D<=57||E=="."||E=="-"||E=="+"||E=="e"||E=="E";
if(U){if((E=="+"||E=="-")&&M!="e"||E=="."&&Z.indexOf(".")!=-1||m&&(X=="a"||X=="A")&&(q%7==3||q%7==4)){T.push(parseFloat(Z));
q++;Z=E}else if(m)Z+=E;else{T.push(parseFloat(Z));q++;if(E!=","&&E!=" "){T.push(E);X=E;q=0}U=!1}}else{if(m){Z=E;
U=!0}else if(E!=","&&E!=" "){T.push(E);X=E;q=0}}M=E}if(U)T.push(parseFloat(Z));return T}function g(G,T,n){var U=T;
while(U<G.length){if(typeof G[U]=="string")break;U+=n}return(U-T)/n}function b(G,T){var n=j(G),U=0,Z=0,M=0,X=0,q=0,D=T.o.length,E={M:2,L:2,H:1,V:1,T:2,S:4,A:7,Q:4,C:6},m=T.m,v=T.o;
while(U<n.length){var V=n[U];U++;var w=V.toUpperCase();if(w=="Z"){m.push("Z");Z=X;M=q}else{var H=E[w],z=g(n,U,H);
for(var o=0;o<z;o++){if(o==1&&w=="M"){V=V==w?"L":"l";w="L"}var x=0,y=0;if(V!=w){x=Z;y=M}if(!1){}else if(w=="M"){Z=x+n[U++];
M=y+n[U++];m.push("M");v.push(Z,M);X=Z;q=M}else if(w=="L"){Z=x+n[U++];M=y+n[U++];m.push("L");v.push(Z,M)}else if(w=="H"){Z=x+n[U++];
m.push("L");v.push(Z,M)}else if(w=="V"){M=y+n[U++];m.push("L");v.push(Z,M)}else if(w=="Q"){var k=x+n[U++],s=y+n[U++],K=x+n[U++],O=y+n[U++];
m.push("Q");v.push(k,s,K,O);Z=K;M=O}else if(w=="T"){var d=Math.max(v.length-(m[m.length-1]=="Q"?4:2),D),k=Z+Z-v[d],s=M+M-v[d+1],K=x+n[U++],O=y+n[U++];
m.push("Q");v.push(k,s,K,O);Z=K;M=O}else if(w=="C"){var k=x+n[U++],s=y+n[U++],K=x+n[U++],O=y+n[U++],N=x+n[U++],R=y+n[U++];
m.push("C");v.push(k,s,K,O,N,R);Z=N;M=R}else if(w=="S"){var d=Math.max(v.length-(m[m.length-1]=="C"?4:2),D),k=Z+Z-v[d],s=M+M-v[d+1],K=x+n[U++],O=y+n[U++],N=x+n[U++],R=y+n[U++];
m.push("C");v.push(k,s,K,O,N,R);Z=N;M=R}else if(w=="A"){var k=Z,s=M,u=n[U++],C=n[U++],ah=n[U++]*(Math.PI/180),ad=n[U++],a6=n[U++],K=x+n[U++],O=y+n[U++];
if(K==Z&&O==M&&u==0&&C==0)continue;var e=(k-K)/2,ao=(s-O)/2,W=Math.cos(ah),S=Math.sin(ah),P=W*e+S*ao,ak=-S*e+W*ao,aj=u*u,a0=C*C,a9=P*P,ap=ak*ak,au=(aj*a0-aj*ap-a0*a9)/(aj*ap+a0*a9),ae=(ad!=a6?1:-1)*Math.sqrt(Math.max(au,0)),an=ae*(u*ak)/C,al=-ae*(C*P)/u,a4=W*an-S*al+(k+K)/2,af=S*an+W*al+(s+O)/2,ac=function(F,c,L,_){var am=Math.sqrt(F*F+c*c),a5=Math.sqrt(L*L+_*_),a8=(F*L+c*_)/(am*a5);
return(F*_-c*L>=0?1:-1)*Math.acos(Math.max(-1,Math.min(1,a8)))},ar=(P-an)/u,ai=(ak-al)/C,as=ac(1,0,ar,ai),a1=ac(ar,ai,(-P-an)/u,(-ak-al)/C);
a1=a1%(2*Math.PI);var ab=function(av,Z,M,F,c,L,_){var am=function($,t){var a7=Math.sin(t),d=Math.cos(t),t=$[0],ag=$[1],aq=$[2],G=$[3];
$[0]=t*d+ag*a7;$[1]=-t*a7+ag*d;$[2]=aq*d+G*a7;$[3]=-aq*a7+G*d},a5=function($,t){for(var o=0;o<t.length;
o+=2){var Z=t[o],M=t[o+1];t[o]=$[0]*Z+$[2]*M+$[4];t[o+1]=$[1]*Z+$[3]*M+$[5]}},a8=function($,t){for(var o=0;
o<t.length;o++)$.push(t[o])},a2=function($,F){a8($.m,F.m);a8($.o,F.o)};if(_)while(L>c)L-=2*Math.PI;else while(L<c)L+=2*Math.PI;
var aa=(L-c)/4,a3=Math.cos(aa/2),at=-Math.sin(aa/2),k=(4-a3)/3,s=at==0?at:(1-a3)*(3-a3)/(3*at),K=k,O=-s,N=a3,R=-at,H=[k,s,K,O,N,R],T={m:["C","C","C","C"],o:H.slice(0)},p=[1,0,0,1,0,0];
am(p,-aa);for(var o=0;o<3;o++){a5(p,H);a8(T.o,H)}am(p,-c+aa/2);p[0]*=F;p[1]*=F;p[2]*=F;p[3]*=F;p[4]=Z;
p[5]=M;a5(p,T.o);a5(av.a7,T.o);a2(av.b2,T)},av={b2:T,a7:[u*W,u*S,-C*S,C*W,a4,af]};ab(av,0,0,1,as,as+a1,a6==0);
Z=K;M=O}else console.log("Unknown SVG command "+V)}}}}return{cssMap:l,readTrnf:I,aj:b,aK:A}}(),initHB:function(B,r){var l=function(I){var Q=0;
if((I&4294967295-(1<<7)+1)==0){Q=1}else if((I&4294967295-(1<<11)+1)==0){Q=2}else if((I&4294967295-(1<<16)+1)==0){Q=3}else if((I&4294967295-(1<<21)+1)==0){Q=4}return Q};
fetch(B).then(function(I){return I.arrayBuffer()}).then(function(I){return WebAssembly.instantiate(I)}).then(function(I){console.log("HB ready");
var Q=I.instance.exports,A=Q.memory,i,Y,j,g,b,G,T,n;h.U.shapeHB=function(){var U=function(M){var X=Q.hb_buffer_get_length(M),q=[],D=Q.hb_buffer_get_glyph_infos(M,0)>>>2,E=Q.hb_buffer_get_glyph_positions(M,0)>>>2;
for(var m=0;m<X;++m){var f=D+m*5,J=E+m*5;q.push({g:Y[f+0],cl:Y[f+2],ax:j[J+0],ay:j[J+1],dx:j[J+2],dy:j[J+3]})}return q},Z;
return function(M,X,q){var D=M._data,E=M.name.postScriptName,H=0,z=0;i=new Uint8Array(A.buffer);Y=new Uint32Array(A.buffer);
j=new Int32Array(A.buffer);if(g!=E){if(b!=null){Q.hb_blob_destroy(b);Q.free(G);Q.hb_face_destroy(T);
Q.hb_font_destroy(n)}G=Q.malloc(D.byteLength);i.set(D,G);b=Q.hb_blob_create(G,D.byteLength,2,0,0);T=Q.hb_face_create(b,0);
n=Q.hb_font_create(T);g=E}if(window.TextEncoder==null){alert("Your browser is too old. Please, update it.");
return}if(Z==null)Z=new window.TextEncoder("utf8");var m=Q.hb_buffer_create(),f=Z.encode(X),J=f.length,v=Q.malloc(J);
i.set(f,v);Q.hb_buffer_add_utf8(m,v,J,0,J);Q.free(v);Q.hb_buffer_set_direction(m,q?4:5);Q.hb_buffer_guess_segment_properties(m);
Q.hb_shape(n,m,0,0);var V=U(m);Q.hb_buffer_destroy(m);var w=V.slice(0);if(!q)w.reverse();for(var o=1;
o<w.length;o++){var x=w[o],y=x.cl;while(!0){var k=X.codePointAt(H),s=l(k);if(z+s<=y){z+=s;H+=k<=65535?1:2}else break}x.cl=H}return V}}();
r()})}};return h}()

var UZIP={};(function(){var g={v:function(Z,V){return Z[V]|Z[V+1]<<8},s:function(Z,V,$){Z[V]=$&255;Z[V+1]=$>>8&255},u:function(Z,V){return Z[V+3]*(256*256*256)+(Z[V+2]<<16|Z[V+1]<<8|Z[V])},Y:function(Z,V,$){Z[V]=$&255;
Z[V+1]=$>>8&255;Z[V+2]=$>>16&255;Z[V+3]=$>>24&255},w:function(Z,V,$){var p="";for(var G=0;G<$;G++)p+=String.fromCharCode(Z[V+G]);
return p},k:function(Z,V,$){for(var p=0;p<$.length;p++)Z[V+p]=$.charCodeAt(p)},I:function(Z){return Z.length<2?"0"+Z:Z},o:function(Z,V,$){var p=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,167,402,225,237,243,250,241,209,170,186,191,8976,172,189,188,161,171,187],B="";
for(var G=0;G<$;G++){var L=Z[V+G];if(L<128)L=L;else if(L<176)L=p[L-128];else L=32;B+=String.fromCharCode(L)}return B},J:function(Z,V,$){var p="",G;
for(var L=0;L<$;L++)p+="%"+g.I(Z[V+L].toString(16));try{G=decodeURIComponent(p)}catch(E){return g.w(Z,V,$)}return G},W:function(Z,V,$){var p=$.length,B=0;
for(var G=0;G<p;G++){var L=$.charCodeAt(G);if((L&4294967295-(1<<7)+1)==0){Z[V+B]=L;B++}else if((L&4294967295-(1<<11)+1)==0){Z[V+B]=192|L>>6;
Z[V+B+1]=128|L>>0&63;B+=2}else if((L&4294967295-(1<<16)+1)==0){Z[V+B]=224|L>>12;Z[V+B+1]=128|L>>6&63;
Z[V+B+2]=128|L>>0&63;B+=3}else if((L&4294967295-(1<<21)+1)==0){Z[V+B]=240|L>>18;Z[V+B+1]=128|L>>12&63;
Z[V+B+2]=128|L>>6&63;Z[V+B+3]=128|L>>0&63;B+=4}else throw"e"}return B},S:function(Z){var V=Z.length,$=0;
for(var p=0;p<V;p++){var B=Z.charCodeAt(p);if((B&4294967295-(1<<7)+1)==0){$++}else if((B&4294967295-(1<<11)+1)==0){$+=2}else if((B&4294967295-(1<<16)+1)==0){$+=3}else if((B&4294967295-(1<<21)+1)==0){$+=4}else throw"e"}return $}},b={R:function(){var Z=new Uint32Array(256);
for(var V=0;V<256;V++){var $=V;for(var p=0;p<8;p++){if($&1)$=3988292384^$>>>1;else $=$>>>1}Z[V]=$}return Z}(),update:function(Z,V,$,p){for(var B=0;
B<p;B++)Z=b.R[(Z^V[$+B])&255]^Z>>>8;return Z},P:function(Z,V,$){return b.update(4294967295,Z,V,$)^4294967295}};
function I(Z,V,$){var p=1,B=0,G=V,L=V+$;while(G<L){var F=Math.min(G+5552,L);while(G<F){p+=Z[G++];B+=p}p=p%65521;
B=B%65521}return B<<16|p}function e(Z,V){var $=g.v,p=g.u,B=0,G={},L=new Uint8Array(Z),F=L.length-4;while(p(L,F)!=101010256)F--;
var B=F;B+=4;B+=4;var H=$(L,B);B+=2;var q=$(L,B);B+=2;var x=p(L,B);B+=4;var k=p(L,B);B+=4;B=k;for(var f=0;
f<H;f++){var y=p(L,B),S=0;B+=4;B+=4;B+=4;var P=E(L,B);B+=4;var w=p(L,B);B+=4;var x=p(L,B);B+=4;var u=p(L,B);
B+=4;var t=$(L,B),N=$(L,B+2),K=$(L,B+4);B+=6;B+=8;var n=p(L,B);B+=4;B+=t;while(S<N){var R=$(L,B+S);S+=2;
var o=$(L,B+S);S+=2;if(R==1){if(u==4294967295){u=p(L,B+S);S+=8}if(x==4294967295){x=p(L,B+S);S+=8}if(n==4294967295){n=p(L,B+S);
S+=8}}else S+=o}B+=N+K;c(L,n,G,x,u,V)}return G}function E(Z,V){var $=g.v(Z,V),p=g.v(Z,V+2),B=1980+(p>>>9),G=p>>>5&15,L=p&31,F=$>>>11,H=$>>>5&63,q=2*($&31),x=new Date(B,G,L,F,H,q).getTime();
return x}function a5(Z,V,$){var p=new Date($),B=p.getFullYear()-1980<<9|p.getMonth()+1<<5|p.getDate(),G=p.getHours()<<11|p.getMinutes()<<5|p.getSeconds()>>>1;
g.s(Z,V,G);g.s(Z,V+2,B)}function c(Z,V,$,p,B,G){var L=g.v,F=g.u,H=F(Z,V);V+=4;var q=L(Z,V);V+=2;var x=L(Z,V);
V+=2;var k=L(Z,V);V+=2;var f=E(Z,V);V+=4;var y=F(Z,V);V+=4;V+=8;var P=L(Z,V);V+=2;var w=L(Z,V);V+=2;
var u=(x&2048)==0?g.o(Z,V,P):g.J(Z,V,P);V+=P;V+=w;if(G){$[u]={size:B,m:p};return}var t=new Uint8Array(Z.buffer,V);
if(x&1){$[u]=new Uint8Array(0);alert("ZIPs with a password are not supported.",3e3)}else if(k==0)$[u]=new Uint8Array(t.buffer.slice(V,V+p));
else if(k==8){var N=new Uint8Array(B);T(t,N);$[u]=N}else throw"unknown compression method: "+k}function T(Z,V){return UZIP.F.inflate(Z,V)}function a2(Z,V){var $=Z[0],p=Z[1],B=$&15,G=$>>>4;
return T(new Uint8Array(Z.buffer,Z.byteOffset+2,Z.length-6),V)}function a1(Z,V){if(V==null)V={level:6};
var $=0,p=new Uint8Array(50+Math.floor(Z.length*1.1));p[$]=120;p[$+1]=156;$+=2;$=UZIP.F.deflateRaw(Z,p,$,V.level);
var b=I(Z,0,Z.length);p[$+0]=b>>>24&255;p[$+1]=b>>>16&255;p[$+2]=b>>>8&255;p[$+3]=b>>>0&255;return new Uint8Array(p.buffer,0,$+4)}function a6(Z,V){if(V==null)V={level:6};
var $=new Uint8Array(50+Math.floor(Z.length*1.1)),p=UZIP.F.deflateRaw(Z,$,p,V.level);return new Uint8Array($.buffer,0,p)}function ac(Z,V){if(V==null)V=!1;
var $=0,p=g.Y,B=g.s,G={},k=0,P=0;for(var L in Z){var F=!aa(L)&&!V,H=Z[L],q=b.P(H,0,H.length);G[L]={T:F,F:H.length,P:q,file:F?a6(H):H}}for(var L in G)$+=G[L].file.length+30+46+2*g.S(L);
$+=22;var x=new Uint8Array($),f=[];for(var L in G){var y=G[L];f.push(k);k=a3(x,k,L,y,0)}var w=k;for(var L in G){var y=G[L];
f.push(k);k=a3(x,k,L,y,1,f[P++])}var u=k-w;p(x,k,101010256);k+=4;k+=4;B(x,k,P);k+=2;B(x,k,P);k+=2;p(x,k,u);
k+=4;p(x,k,w);k+=4;k+=2;return x.buffer}function aa(Z){var V=Z.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(V)!=-1}function a3(Z,V,$,p,B,L){var F=g.Y,H=g.s,q=p.file;
F(Z,V,B==0?67324752:33639248);V+=4;if(B==1)V+=2;H(Z,V,20);V+=2;H(Z,V,2048);V+=2;H(Z,V,p.T?8:0);V+=2;
a5(Z,V,Date.now());V+=4;F(Z,V,p.P);V+=4;F(Z,V,q.length);V+=4;F(Z,V,p.F);V+=4;H(Z,V,g.S($));V+=2;H(Z,V,0);
V+=2;if(B==1){V+=2;V+=2;V+=6;F(Z,V,L);V+=4}var x=g.W(Z,V,$);V+=x;if(B==0){Z.set(q,V);V+=q.length}return V}UZIP.crc=b;
UZIP.adler=I;UZIP.inflate=a2;UZIP.inflateRaw=T;UZIP.deflate=a1;UZIP.deflateRaw=a6;UZIP.parse=e;UZIP.encode=ac}());
(function(){var g=function(){var u=Uint16Array,t=Uint32Array;return{Q:new u(16),C:new u(16),D:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],r:[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],p:[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],h:new u(32),c:[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],d:[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],K:new t(32),X:new u(512),V:[],B:new u(32),H:[],N:new u(32768),G:[],i:[],b:new u(32768),L:[],O:new u(512),l:[],a:new u(1<<15),f:new t(286),e:new t(30),j:new t(19),A:new t(15e3),n:new u(1<<16),g:new u(1<<15)}}();
function b(u,t){var N=u.length,K,n,S,R,o,i=g.C;for(var R=0;R<=t;R++)i[R]=0;for(R=1;R<N;R+=2)i[u[R]]++;
var _=g.Q;K=0;i[0]=0;for(n=1;n<=t;n++){K=K+i[n-1]<<1;_[n]=K}for(S=0;S<N;S+=2){o=u[S+1];if(o!=0){u[S]=_[o];
_[o]++}}}function I(u,t,N){var K=u.length,n=g.a;for(var S=0;S<K;S+=2)if(u[S+1]!=0){var R=S>>1,o=u[S+1],i=R<<4|o,_=t-o,Y=u[S]<<_,v=Y+(1<<_);
while(Y!=v){var C=n[Y]>>>15-t;N[C]=i;Y++}}}function e(u,t){var N=g.a,K=15-t;for(var n=0;n<u.length;n+=2){var S=u[n]<<t-u[n+1];
u[n]=N[S]>>>K}}function E(u,t,N){N=N<<(t&7);var K=t>>>3;u[K]|=N;u[K+1]|=N>>>8}function a5(u,t,N){N=N<<(t&7);
var K=t>>>3;u[K]|=N;u[K+1]|=N>>>8;u[K+2]|=N>>>16}function c(u,t,N){return(u[t>>>3]|u[(t>>>3)+1]<<8)>>>(t&7)&(1<<N)-1}function T(u,t,N){return(u[t>>>3]|u[(t>>>3)+1]<<8|u[(t>>>3)+2]<<16)>>>(t&7)&(1<<N)-1}function a2(u,t){return(u[t>>>3]|u[(t>>>3)+1]<<8|u[(t>>>3)+2]<<16)>>>(t&7)}function a1(u,t){return(u[t>>>3]|u[(t>>>3)+1]<<8|u[(t>>>3)+2]<<16|u[(t>>>3)+3]<<24)>>>(t&7)}(function(){var u=1<<15;
for(var t=0;t<u;t++){var N=t;N=(N&2863311530)>>>1|(N&1431655765)<<1;N=(N&3435973836)>>>2|(N&858993459)<<2;
N=(N&4042322160)>>>4|(N&252645135)<<4;N=(N&4278255360)>>>8|(N&16711935)<<8;g.a[t]=(N>>>16|N<<16)>>>17}function K(n,S,R){while(S--!=0)n.push(0,R)}for(var t=0;
t<32;t++){g.h[t]=g.r[t]<<3|g.p[t];g.K[t]=g.c[t]<<4|g.d[t]}K(g.V,144,8);K(g.V,255-143,9);K(g.V,279-255,7);
K(g.V,287-279,8);b(g.V,9);I(g.V,9,g.X);e(g.V,9);K(g.H,32,5);b(g.H,5);I(g.H,5,g.B);e(g.H,5);K(g.l,19,0);
K(g.G,286,0);K(g.L,30,0);K(g.i,320,0)}());function a6(u,t,N,K){var n=[[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]],S=n[K],R=0,o=N<<3,i=0,_=u.length,a=0,j=0,h=0,A=0,l=0,O=0,d=0,r=0;
if(K==0){while(R<_){var Y=Math.min(65535,_-R);E(t,o,R+Y==_?1:0);o=V(u,R,Y,t,o+8);R+=Y}return o>>>3}var v=g.A,C=g.n,X=g.g;
if(_>2){O=a3(u,0);C[O]=0}for(R=0;R<_;R++){l=O;if(R+1<_-2){O=a3(u,R+1);var M=R+1&32767;X[M]=C[O];C[O]=M}if(i<=R){if((a>14e3||j>26697)&&_-R>100){if(i<R){v[a]=R-i;
a+=2;i=R}o=Z(R==_-1||i==_?1:0,v,a,A,u,h,R-h,t,o);a=j=A=0;h=R}var Q=0;if(R<_-2)Q=ac(u,R,X,l,Math.min(S[2],_-R),S[3]);
var Y=Q>>>16,J=Q&65535;if(Q!=0){var Y=Q>>>16,J=Q&65535,m=k(Y,g.r);g.f[257+m]++;var z=k(J,g.c);g.e[z]++;
A+=g.p[m]+g.d[z];v[a]=Y<<23|R-i;v[a+1]=J<<16|m<<8|z;a+=2;i=R+Y}else{g.f[u[R]]++}j++}}if(h!=R||u.length==0){if(i<R){v[a]=R-i;
a+=2;i=R}o=Z(1,v,a,A,u,h,R-h,t,o);a=0;j=0;a=j=A=0;h=R}while((o&7)!=0)o++;return o>>>3}function ac(u,t,N,K,n,S){var R=t&32767,o=N[R],i=R-o+(1<<15)&32767,_=0,Y=0;
if(o==R||K!=a3(u,t-i))return 0;var v=Math.min(32767,t);while(i<=v&&--S!=0&&o!=R){if(_==0||u[t+_]==u[t+_-i]){var C=aa(u,t,i);
if(C>_){_=C;Y=i;if(_>=n)break;if(i+2<C)C=i+2;var X=0;for(var a=0;a<C-2;a++){var j=t-i+a+(1<<15)&32767,h=N[j],A=j-h+(1<<15)&32767;
if(A>X){X=A;o=j}}}}R=o;o=N[R];i+=R-o+(1<<15)&32767}return _<<16|Y}function aa(u,t,N){if(u[t]!=u[t-N]||u[t+1]!=u[t+1-N]||u[t+2]!=u[t+2-N])return 0;
var K=t,n=Math.min(u.length,t+258);t+=3;while(t<n&&u[t]==u[t-N])t++;return t-K}function a3(u,t){return(u[t]<<8|u[t+1])+(u[t+2]<<4)&65535}function Z(u,t,N,K,n,S,R,o,i){var _,Y,v,C,X,j,h,A,l;
g.f[256]++;_=$();Y=_[0];v=_[1];C=_[2];X=_[3];j=_[4];h=_[5];A=_[6];l=_[7];var O=((i+3&7)==0?0:8-(i+3&7))+32+(R<<3),d=K+G(g.V,g.f)+G(g.H,g.e),r=K+G(g.G,g.f)+G(g.L,g.e);
r+=14+3*h+G(g.l,g.j)+(g.j[16]*2+g.j[17]*3+g.j[18]*7);for(var M=0;M<286;M++)g.f[M]=0;for(var M=0;M<30;
M++)g.e[M]=0;for(var M=0;M<19;M++)g.j[M]=0;var Q=O<d&&O<r?0:d<r?1:2;a5(o,i,u);a5(o,i+1,Q);i+=3;var J=i;
if(Q==0){while((i&7)!=0)i++;i=V(n,S,R,o,i)}else{var m,z;if(Q==1){m=g.V;z=g.H}if(Q==2){b(g.G,Y);e(g.G,Y);
b(g.L,v);e(g.L,v);b(g.l,C);e(g.l,C);m=g.G;z=g.L;E(o,i,X-257);i+=5;E(o,i,j-1);i+=5;E(o,i,h-4);i+=4;for(var W=0;
W<h;W++)E(o,i+W*3,g.l[(g.D[W]<<1)+1]);i+=3*h;i=L(A,g.l,o,i);i=L(l,g.l,o,i)}var ad=S;for(var s=0;s<N;
s+=2){var D=t[s],a7=D>>>23,ae=ad+(D&(1<<23)-1);while(ad<ae)i=f(n[ad++],m,o,i);if(a7!=0){var ab=t[s+1],a9=ab>>16,a0=ab>>8&255,a4=ab&255;
i=f(257+a0,m,o,i);E(o,i,a7-g.r[a0]);i+=g.p[a0];i=f(a4,z,o,i);a5(o,i,a9-g.c[a4]);i+=g.d[a4];ad+=a7}}i=f(256,m,o,i)}return i}function V(u,t,N,K,n){var S=n>>>3;
K[S]=N;K[S+1]=N>>>8;K[S+2]=255-K[S];K[S+3]=255-K[S+1];S+=4;K.set(new Uint8Array(u.buffer,t,N),S);return n+(N+4<<3)}function $(){var u=H(g.f,g.G,15),t=H(g.e,g.L,15),N=[],K=F(g.G,N),n=[],S=F(g.L,n),i=19;
for(var R=0;R<N.length;R+=2)g.j[N[R]]++;for(var R=0;R<n.length;R+=2)g.j[n[R]]++;var o=H(g.j,g.l,7);while(i>4&&g.l[(g.D[i-1]<<1)+1]==0)i--;
return[u,t,o,K,S,i,N,n]}function p(u){var t=[];for(var N=0;N<u.length;N+=2)t.push(u[N+1]);return t}function B(u){var t="";
for(var N=0;N<u.length;N+=2)if(u[N+1]!=0)t+=(N>>1)+",";return t}function G(u,t){var N=0;for(var K=0;
K<t.length;K++)N+=t[K]*u[(K<<1)+1];return N}function L(u,t,N,K){for(var n=0;n<u.length;n+=2){var S=u[n],R=u[n+1];
K=f(S,t,N,K);var o=S==16?2:S==17?3:7;if(S>15){E(N,K,R,o);K+=o}}return K}function F(u,t){var N=u.length;
while(N!=2&&u[N-1]==0)N-=2;for(var K=0;K<N;K+=2){var n=u[K+1],S=K+3<N?u[K+3]:-1,R=K+5<N?u[K+5]:-1,o=K==0?-1:u[K-1];
if(n==0&&S==n&&R==n){var i=K+5;while(i+2<N&&u[i+2]==n)i+=2;var _=Math.min(i+1-K>>>1,138);if(_<11)t.push(17,_-3);
else t.push(18,_-11);K+=_*2-2}else if(n==o&&S==n&&R==n){var i=K+5;while(i+2<N&&u[i+2]==n)i+=2;var _=Math.min(i+1-K>>>1,6);
t.push(16,_-3);K+=_*2-2}else t.push(n,0)}return N>>>1}function H(u,t,N){var K=[],n=u.length,S=t.length,R=0,C=0,X=1,a=2;
for(R=0;R<S;R+=2){t[R]=0;t[R+1]=0}for(R=0;R<n;R++)if(u[R]!=0)K.push({z:R,U:u[R]});var o=K.length,i=K.slice(0);
if(o==0)return 0;if(o==1){var _=K[0].z,i=_==0?1:0;t[(_<<1)+1]=1;t[(i<<1)+1]=1;return 1}K.sort(function(Y,v){return Y.U-v.U});
var Y=K[0],v=K[1];K[0]={z:-1,U:Y.U+v.U,q:Y,M:v,t:0};while(X!=o-1){if(C!=X&&(a==o||K[C].U<K[a].U)){Y=K[C++]}else{Y=K[a++]}if(C!=X&&(a==o||K[C].U<K[a].U)){v=K[C++]}else{v=K[a++]}K[X++]={z:-1,U:Y.U+v.U,q:Y,M:v}}var j=q(K[X-1],0);
if(j>N){x(i,N,j);j=N}for(R=0;R<o;R++)t[(i[R].z<<1)+1]=i[R].t;return j}function q(u,t){if(u.z!=-1){u.t=t;
return t}return Math.max(q(u.q,t+1),q(u.M,t+1))}function x(u,t,N){var K=0,n=1<<N-t,S=0;u.sort(function(o,i){return i.t==o.t?o.U-i.U:i.t-o.t});
for(K=0;K<u.length;K++)if(u[K].t>t){var R=u[K].t;u[K].t=t;S+=n-(1<<N-R)}else break;S=S>>>N-t;while(S>0){var R=u[K].t;
if(R<t){u[K].t++;S-=1<<t-R-1}else K++}for(;K>=0;K--)if(u[K].t==t&&S<0){u[K].t--;S++}if(S!=0)console.log("debt left")}function k(u,t){var N=0;
if(t[N|16]<=u)N|=16;if(t[N|8]<=u)N|=8;if(t[N|4]<=u)N|=4;if(t[N|2]<=u)N|=2;if(t[N|1]<=u)N|=1;return N}function f(u,t,N,K){a5(N,K,t[u<<1]);
return K+t[(u<<1)+1]}function a8(u,t){var N=Uint8Array,n=0,S=0,R=0,o=0,i=0,_=0,Y=0,v=0,C=0,X,a;if(u[0]==3&&u[1]==0)return t?t:new N(0);
var K=t==null;if(K)t=new N(u.length>>>2<<3);while(n==0){n=T(u,C,1);S=T(u,C+1,2);C+=3;if(S==0){if((C&7)!=0)C+=8-(C&7);
var j=(C>>>3)+4,h=u[j-4]|u[j-3]<<8;if(K)t=y(t,v+h);t.set(new N(u.buffer,u.byteOffset+j,h),v);C=j+h<<3;
v+=h;continue}if(K)t=y(t,v+(1<<17));if(S==1){X=g.X;a=g.B;_=(1<<9)-1;Y=(1<<5)-1}if(S==2){R=c(u,C,5)+257;
o=c(u,C+5,5)+1;i=c(u,C+10,4)+4;C+=14;var A=C,O=1;for(var l=0;l<38;l+=2){g.l[l]=0;g.l[l+1]=0}for(var l=0;
l<i;l++){var d=c(u,C+l*3,3);g.l[(g.D[l]<<1)+1]=d;if(d>O)O=d}C+=3*i;b(g.l,O);I(g.l,O,g.O);X=g.N;a=g.b;
C=P(g.O,(1<<O)-1,R+o,u,C,g.i);var r=w(g.i,0,R,g.G);_=(1<<r)-1;var M=w(g.i,R,o,g.L);Y=(1<<M)-1;b(g.G,r);
I(g.G,r,X);b(g.L,M);I(g.L,M,a)}while(!0){var Q=X[a2(u,C)&_];C+=Q&15;var J=Q>>>4;if(J>>>8==0){t[v++]=J}else if(J==256){break}else{var m=v+J-254;
if(J>264){var z=g.h[J-257];m=v+(z>>>3)+c(u,C,z&7);C+=z&7}var W=a[a2(u,C)&Y];C+=W&15;var ad=W>>>4,s=g.K[ad],D=(s>>>4)+T(u,C,s&15);
C+=s&15;if(K)t=y(t,v+(1<<17));while(v<m){t[v]=t[v++-D];t[v]=t[v++-D];t[v]=t[v++-D];t[v]=t[v++-D]}v=m}}}return t.length==v?t:t.slice(0,v)}function y(u,t){var N=u.length;
if(t<=N)return u;var K=new Uint8Array(Math.max(N<<1,t));K.set(u,0);return K}function P(u,t,N,K,n,S){var R=0;
while(R<N){var o=u[a2(K,n)&t];n+=o&15;var i=o>>>4;if(i<=15){S[R]=i;R++}else{var _=0,Y=0;if(i==16){Y=3+c(K,n,2);
n+=2;_=S[R-1]}else if(i==17){Y=3+c(K,n,3);n+=3}else if(i==18){Y=11+c(K,n,7);n+=7}var v=R+Y;while(R<v){S[R]=_;
R++}}}return n}function w(u,t,N,K){var n=0,S=0,R=K.length>>>1;while(S<N){var o=u[S+t];K[S<<1]=0;K[(S<<1)+1]=o;
if(o>n)n=o;S++}while(S<R){K[S<<1]=0;K[(S<<1)+1]=0;S++}return n}UZIP.F={inflate:a8,deflateRaw:a6}}())
	

var paper=function(t,e){var i=(t=t||require("./node/self.js")).window,n=t.document,r=new function(){function t(t,e,r,s,a){function u(n,u){"string"==typeof(u=u||(u=o(e,n))&&(u.get?u:u.value))&&"#"===u[0]&&(u=t[u.substring(1)]||u);var c,f="function"==typeof u,d=u,_=a||f&&!u.base?u&&u.get?n in t:t[n]:null;a&&_||(f&&_&&(u.base=_),f&&!1!==s&&(c=n.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(l[c[3].toLowerCase()+c[4]]=c[2]),d&&!f&&d.get&&"function"==typeof d.get&&i.isPlainObject(d)||(d={value:d,writable:!0}),(o(t,n)||{configurable:!0}).configurable&&(d.configurable=!0,d.enumerable=null!=r?r:!c),h(t,n,d))}var l={};if(e){for(var c in e)e.hasOwnProperty(c)&&!n.test(c)&&u(c);for(var c in l){var f=l[c],d=t["set"+f],_=t["get"+f]||d&&t["is"+f];!_||!0!==s&&0!==_.length||u(c,{get:_,set:d})}}return t}function i(){for(var t=0,e=arguments.length;t<e;t++){var i=arguments[t];i&&c(this,i)}return this}var n=/^(statics|enumerable|beans|preserve)$/,r=[],s=r.slice,a=Object.create,o=Object.getOwnPropertyDescriptor,h=Object.defineProperty,u=r.forEach||function(t,e){for(var i=0,n=this.length;i<n;i++)t.call(e,this[i],i,this)},l=function(t,e){for(var i in this)this.hasOwnProperty(i)&&t.call(e,this[i],i,this)},c=Object.assign||function(t){for(var e=1,i=arguments.length;e<i;e++){var n=arguments[e];for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t},f=function(t,e,i){if(t){var n=o(t,"length");(n&&"number"==typeof n.value?u:l).call(t,e,i=i||t)}return i};return t(i,{inject:function(e){if(e){var i=!0===e.statics?e:e.statics,n=e.beans,r=e.preserve;i!==e&&t(this.prototype,e,e.enumerable,n,r),t(this,i,null,n,r)}for(var s=1,a=arguments.length;s<a;s++)this.inject(arguments[s]);return this},extend:function(){for(var e,i,n,r=this,s=0,o=arguments.length;s<o&&(!e||!i);s++)n=arguments[s],e=e||n.initialize,i=i||n.prototype;return e=e||function(){r.apply(this,arguments)},i=e.prototype=i||a(this.prototype),h(i,"constructor",{value:e,writable:!0,configurable:!0}),t(e,this),arguments.length&&this.inject.apply(e,arguments),e.base=r,e}}).inject({enumerable:!1,initialize:i,set:i,inject:function(){for(var e=0,i=arguments.length;e<i;e++){var n=arguments[e];n&&t(this,n,n.enumerable,n.beans,n.preserve)}return this},extend:function(){var t=a(this);return t.inject.apply(t,arguments)},each:function(t,e){return f(this,t,e)},clone:function(){return new this.constructor(this)},statics:{set:c,each:f,create:a,define:h,describe:o,clone:function(t){return c(new t.constructor,t)},isPlainObject:function(t){var e=null!=t&&t.constructor;return e&&(e===Object||e===i||"Object"===e.name)},pick:function(t,i){return t!==e?t:i},slice:function(t,e,i){return s.call(t,e,i)}}})};"undefined"!=typeof module&&(module.exports=r),r.inject({enumerable:!1,toString:function(){return null!=this._id?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+r.each(this,function(t,e){if(!/^_/.test(e)){var i=typeof t;this.push(e+": "+("number"===i?h.instance.number(t):"string"===i?"'"+t+"'":t))}},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(t){return r.importJSON(t,this)},exportJSON:function(t){return r.exportJSON(this,t)},toJSON:function(){return r.serialize(this)},set:function(t,e){return t&&r.filter(this,t,e,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function t(){var e=t.base.apply(this,arguments),i=e.prototype._class;return i&&!r.exports[i]&&(r.exports[i]=e),e},equals:function(t,e){if(t===e)return!0;if(t&&t.equals)return t.equals(e);if(e&&e.equals)return e.equals(t);if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)&&Array.isArray(e)){if((n=t.length)!==e.length)return!1;for(;n--;)if(!r.equals(t[n],e[n]))return!1}else{var i=Object.keys(t),n=i.length;if(n!==Object.keys(e).length)return!1;for(;n--;){var s=i[n];if(!e.hasOwnProperty(s)||!r.equals(t[s],e[s]))return!1}}return!0}return!1},read:function(t,i,n,s){if(this===r){var a=this.peek(t,i);return t.__index++,a}var o=this.prototype,h=o._readIndex,u=i||h&&t.__index||0,l=t.length,c=t[u];if(s=s||l-u,c instanceof this||n&&n.readNull&&null==c&&s<=1)return h&&(t.__index=u+1),c&&n&&n.clone?c.clone():c;if(c=r.create(o),h&&(c.__read=!0),c=c.initialize.apply(c,u>0||u+s<l?r.slice(t,u,u+s):t)||c,h){t.__index=u+c.__read;var f=c.__filtered;f&&(t.__filtered=f,c.__filtered=e),c.__read=e}return c},peek:function(t,e){return t[t.__index=e||t.__index||0]},remain:function(t){return t.length-(t.__index||0)},readList:function(t,e,i,n){for(var r,s=[],a=e||0,o=n?a+n:t.length,h=a;h<o;h++)s.push(Array.isArray(r=t[h])?this.read(r,0,i):this.read(t,h,i,1));return s},readNamed:function(t,i,n,s,a){var o=this.getNamed(t,i),h=o!==e;if(h){var u=t.__filtered;u||((u=t.__filtered=r.create(t[0])).__unfiltered=t[0]),u[i]=e}var l=h?[o]:t;return this.read(l,n,s,a)},getNamed:function(t,i){var n=t[0];if(t._hasObject===e&&(t._hasObject=1===t.length&&r.isPlainObject(n)),t._hasObject)return i?n[i]:t.__filtered||n},hasNamed:function(t,e){return!!this.getNamed(t,e)},filter:function(t,i,n,r){function s(r){if(!(n&&r in n||a&&r in a)){var s=i[r];s!==e&&(t[r]=s)}}var a;if(r){for(var o,h={},u=0,l=r.length;u<l;u++)(o=r[u])in i&&(s(o),h[o]=!0);a=h}return Object.keys(i.__unfiltered||i).forEach(s),t},isPlainValue:function(t,e){return r.isPlainObject(t)||Array.isArray(t)||e&&"string"==typeof t},serialize:function(t,e,i,n){e=e||{};var s,a=!n;if(a&&(e.formatter=new h(e.precision),n={length:0,definitions:{},references:{},add:function(t,e){var i="#"+t._id,n=this.references[i];if(!n){this.length++;var r=e.call(t),s=t._class;s&&r[0]!==s&&r.unshift(s),this.definitions[i]=r,n=this.references[i]=[i]}return n}}),t&&t._serialize){s=t._serialize(e,n);var o=t._class;!o||t._compactSerialize||!a&&i||s[0]===o||s.unshift(o)}else if(Array.isArray(t)){s=[];for(var u=0,l=t.length;u<l;u++)s[u]=r.serialize(t[u],e,i,n)}else if(r.isPlainObject(t)){s={};for(var c=Object.keys(t),u=0,l=c.length;u<l;u++){var f=c[u];s[f]=r.serialize(t[f],e,i,n)}}else s="number"==typeof t?e.formatter.number(t,e.precision):t;return a&&n.length>0?[["dictionary",n.definitions],s]:s},deserialize:function(t,e,i,n,s){var a=t,o=!i,h=o&&t&&t.length&&"dictionary"===t[0][0];if(i=i||{},Array.isArray(t)){var u=t[0],l="dictionary"===u;if(1==t.length&&/^#/.test(u))return i.dictionary[u];a=[];for(var c=(u=r.exports[u])?1:0,f=t.length;c<f;c++)a.push(r.deserialize(t[c],e,i,l,h));if(u){var d=a;e?a=e(u,d,o||s):(a=r.create(u.prototype),u.apply(a,d))}}else if(r.isPlainObject(t)){a={},n&&(i.dictionary=a);for(var _ in t)a[_]=r.deserialize(t[_],e,i)}return h?a[1]:a},exportJSON:function(t,e){var i=r.serialize(t,e);return e&&0==e.asString?i:JSON.stringify(i)},importJSON:function(t,e){return r.deserialize("string"==typeof t?JSON.parse(t):t,function(t,i,n){var s=n&&e&&e.constructor===t,a=s?e:r.create(t.prototype);if(1===i.length&&a instanceof w&&(s||!(a instanceof b))){var o=i[0];r.isPlainObject(o)&&(o.insert=!1)}return(s?a.set:t).apply(a,i),s&&(e=null),a})},splice:function(t,i,n,r){var s=i&&i.length,a=n===e;(n=a?t.length:n)>t.length&&(n=t.length);for(u=0;u<s;u++)i[u]._index=n+u;if(a)return t.push.apply(t,i),[];var o=[n,r];i&&o.push.apply(o,i);for(var h=t.splice.apply(t,o),u=0,l=h.length;u<l;u++)h[u]._index=e;for(var u=n+s,l=t.length;u<l;u++)t[u]._index=u;return h},capitalize:function(t){return t.replace(/\b[a-z]/g,function(t){return t.toUpperCase()})},camelize:function(t){return t.replace(/-(.)/g,function(t,e){return e.toUpperCase()})},hyphenate:function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}});var s={on:function(t,e){if("string"!=typeof t)r.each(t,function(t,e){this.on(e,t)},this);else{var i=this._eventTypes,n=i&&i[t],s=this._callbacks=this._callbacks||{};-1===(s=s[t]=s[t]||[]).indexOf(e)&&(s.push(e),n&&n.install&&1===s.length&&n.install.call(this,t))}return this},off:function(t,e){if("string"==typeof t){var i,n=this._eventTypes,s=n&&n[t],a=this._callbacks&&this._callbacks[t];return a&&(!e||-1!==(i=a.indexOf(e))&&1===a.length?(s&&s.uninstall&&s.uninstall.call(this,t),delete this._callbacks[t]):-1!==i&&a.splice(i,1)),this}r.each(t,function(t,e){this.off(e,t)},this)},once:function(t,e){return this.on(t,function(){e.apply(this,arguments),this.off(t,e)})},emit:function(t,e){var i=this._callbacks&&this._callbacks[t];if(!i)return!1;var n=r.slice(arguments,1),s=e&&e.target&&!e.currentTarget;i=i.slice(),s&&(e.currentTarget=this);for(var a=0,o=i.length;a<o;a++)if(0==i[a].apply(this,n)){e&&e.stop&&e.stop();break}return s&&delete e.currentTarget,!0},responds:function(t){return!(!this._callbacks||!this._callbacks[t])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(t){var e=this._eventTypes,i=this._callbacks,n=t?"install":"uninstall";if(e)for(var r in i)if(i[r].length>0){var s=e[r],a=s&&s[n];a&&a.call(this,r)}},statics:{inject:function t(e){var i=e._events;if(i){var n={};r.each(i,function(t,i){var s="string"==typeof t,a=s?t:i,o=r.capitalize(a),h=a.substring(2).toLowerCase();n[h]=s?{}:t,a="_"+a,e["get"+o]=function(){return this[a]},e["set"+o]=function(t){var e=this[a];e&&this.off(h,e),t&&this.on(h,t),this[a]=t}}),e._eventTypes=n}return t.base.apply(this,arguments)}}},a=r.extend({_class:"PaperScope",initialize:function e(){paper=this,this.settings=new r({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=e._id++,e._scopes[this._id]=this;var i=e.prototype;if(!this.support){var n=Q.getContext(1,1)||{};i.support={nativeDash:"setLineDash"in n||"mozDash"in n,nativeBlendModes:tt.nativeModes},Q.release(n)}if(!this.agent){var s=t.navigator.userAgent.toLowerCase(),a=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(s)||[])[0],o="darwin"===a?"mac":a,h=i.agent=i.browser={platform:o};o&&(h[o]=!0),s.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(t,e,i,n,r){if(!h.chrome){var s="opera"===e?n:/^(node|trident)$/.test(e)?r:i;h.version=s,h.versionNumber=parseFloat(s),e="trident"===e?"msie":e,h.name=e,h[e]=!0}}),h.chrome&&delete h.webkit,h.atom&&delete h.chrome}},version:"0.11.5",getView:function(){var t=this.project;return t&&t._view},getPaper:function(){return this},execute:function(t,e){paper.PaperScript.execute(t,this,e),U.updateFocus()},install:function(t){var e=this;r.each(["project","view","tool"],function(i){r.define(t,i,{configurable:!0,get:function(){return e[i]}})});for(var i in this)!/^_/.test(i)&&this[i]&&(t[i]=this[i])},setup:function(t){return paper=this,this.project=new y(t),this},createCanvas:function(t,e){return Q.getCanvas(t,e)},activate:function(){paper=this},clear:function(){for(var t=this.projects,e=this.tools,i=t.length-1;i>=0;i--)t[i].remove();for(i=e.length-1;i>=0;i--)e[i].remove()},remove:function(){this.clear(),delete a._scopes[this._id]},statics:new function(){function t(t){return t+="Attribute",function(e,i){return e[t](i)||e[t]("data-paper-"+i)}}return{_scopes:{},_id:0,get:function(t){return this._scopes[t]||null},getAttribute:t("get"),hasAttribute:t("has")}}}),o=r.extend(s,{initialize:function(t){this._scope=paper,this._index=this._scope[this._list].push(this)-1,!t&&this._scope[this._reference]||this.activate()},activate:function(){if(!this._scope)return!1;var t=this._scope[this._reference];return t&&t!==this&&t.emit("deactivate"),this._scope[this._reference]=this,this.emit("activate",t),!0},isActive:function(){return this._scope[this._reference]===this},remove:function(){return null!=this._index&&(r.splice(this._scope[this._list],null,this._index,1),this._scope[this._reference]==this&&(this._scope[this._reference]=null),this._scope=null,!0)},getView:function(){return this._scope.getView()}}),h=r.extend({initialize:function(t){this.precision=r.pick(t,5),this.multiplier=Math.pow(10,this.precision)},number:function(t){return this.precision<16?Math.round(t*this.multiplier)/this.multiplier:t},pair:function(t,e,i){return this.number(t)+(i||",")+this.number(e)},point:function(t,e){return this.number(t.x)+(e||",")+this.number(t.y)},size:function(t,e){return this.number(t.width)+(e||",")+this.number(t.height)},rectangle:function(t,e){return this.point(t,e)+(e||",")+this.size(t,e)}});h.instance=new h;var u=new function(){function t(t,e,i){return t<e?e:t>i?i:t}function e(t,e,i){function n(t){var e=134217729*t,i=t-e+e;return[i,t-i]}var r=e*e-t*i,a=e*e+t*i;if(3*s(r)<a){var o=n(t),h=n(e),u=n(i),l=e*e,c=t*i;r=l-c+(h[0]*h[0]-l+2*h[0]*h[1]+h[1]*h[1]-(o[0]*u[0]-c+o[0]*u[1]+o[1]*u[0]+o[1]*u[1]))}return r}function i(){var t=Math.max.apply(Math,arguments);return t&&(t<1e-8||t>1e8)?o(2,-Math.round(h(t))):0}var n=[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],r=[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]],s=Math.abs,a=Math.sqrt,o=Math.pow,h=Math.log2||function(t){return Math.log(t)*Math.LOG2E};return{EPSILON:1e-12,MACHINE_EPSILON:1.12e-16,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,KAPPA:4*(a(2)-1)/3,isZero:function(t){return t>=-1e-12&&t<=1e-12},clamp:t,integrate:function(t,e,i,s){for(var a=n[s-2],o=r[s-2],h=.5*(i-e),u=h+e,l=0,c=s+1>>1,f=1&s?o[l++]*t(u):0;l<c;){var d=h*a[l];f+=o[l++]*(t(u+d)+t(u-d))}return h*f},findRoot:function(e,i,n,r,a,o,h){for(var u=0;u<o;u++){var l=e(n),c=l/i(n),f=n-c;if(s(c)<h){n=f;break}l>0?(a=n,n=f<=r?.5*(r+a):f):(r=n,n=f>=a?.5*(r+a):f)}return t(n,r,a)},solveQuadratic:function(n,r,o,h,u,l){var c,f=1/0;if(s(n)<1e-12){if(s(r)<1e-12)return s(o)<1e-12?-1:0;c=-o/r}else{var d=e(n,r*=-.5,o);if(d&&s(d)<1.12e-16){var _=i(s(n),s(r),s(o));_&&(d=e(n*=_,r*=_,o*=_))}if(d>=-1.12e-16){var g=d<0?0:a(d),v=r+(r<0?-g:g);0===v?f=-(c=o/n):(c=v/n,f=o/v)}}var p=0,m=null==u,y=u-1e-12,w=l+1e-12;return isFinite(c)&&(m||c>y&&c<w)&&(h[p++]=m?c:t(c,u,l)),f!==c&&isFinite(f)&&(m||f>y&&f<w)&&(h[p++]=m?f:t(f,u,l)),p},solveCubic:function(e,n,r,h,l,c,f){function d(t){var i=e*(_=t);p=(i+(g=i+n))*_+(v=g*_+r),m=v*_+h}var _,g,v,p,m,y=i(s(e),s(n),s(r),s(h));if(y&&(e*=y,n*=y,r*=y,h*=y),s(e)<1e-12)e=n,g=r,v=h,_=1/0;else if(s(h)<1e-12)g=n,v=r,_=0;else{d(-n/e/3);var w=m/e,x=o(s(w),1/3),b=w<0?-1:1,C=-p/e,S=C>0?1.324717957244746*Math.max(x,a(C)):x,P=_-b*S;if(P!==_){do{d(P),P=0===p?_:_-m/p/(1+1.12e-16)}while(b*P>b*_);s(e)*_*_>s(h/_)&&(g=((v=-h/_)-r)/_)}}var I=u.solveQuadratic(e,g,v,l,c,f),M=null==c;return isFinite(_)&&(0===I||I>0&&_!==l[0]&&_!==l[1])&&(M||_>c-1e-12&&_<f+1e-12)&&(l[I++]=M?_:t(_,c,f)),I}}},l={_id:1,_pools:{},get:function(t){if(t){var e=this._pools[t];return e||(e=this._pools[t]={_id:1}),e._id++}return this._id++}},c=r.extend({_class:"Point",_readIndex:!0,initialize:function(t,e){var i=typeof t,n=this.__read,r=0;if("number"===i){var s="number"==typeof e;this._set(t,s?e:t),n&&(r=s?2:1)}else if("undefined"===i||null===t)this._set(0,0),n&&(r=null===t?1:0);else{var a="string"===i?t.split(/[\s,]+/)||[]:t;r=1,Array.isArray(a)?this._set(+a[0],+(a.length>1?a[1]:a[0])):"x"in a?this._set(a.x||0,a.y||0):"width"in a?this._set(a.width||0,a.height||0):"angle"in a?(this._set(a.length||0,0),this.setAngle(a.angle||0)):(this._set(0,0),r=0)}return n&&(this.__read=r),this},set:"#initialize",_set:function(t,e){return this.x=t,this.y=e,this},equals:function(t){return this===t||t&&(this.x===t.x&&this.y===t.y||Array.isArray(t)&&this.x===t[0]&&this.y===t[1])||!1},clone:function(){return new c(this.x,this.y)},toString:function(){var t=h.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+" }"},_serialize:function(t){var e=t.formatter;return[e.number(this.x),e.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(t){if(this.isZero()){var e=this._angle||0;this._set(Math.cos(e)*t,Math.sin(e)*t)}else{var i=t/this.getLength();u.isZero(i)&&this.getAngle(),this._set(this.x*i,this.y*i)}},getAngle:function(){return 180*this.getAngleInRadians.apply(this,arguments)/Math.PI},setAngle:function(t){this.setAngleInRadians.call(this,t*Math.PI/180)},getAngleInDegrees:"#getAngle",setAngleInDegrees:"#setAngle",getAngleInRadians:function(){if(arguments.length){var t=c.read(arguments),e=this.getLength()*t.getLength();if(u.isZero(e))return NaN;var i=this.dot(t)/e;return Math.acos(i<-1?-1:i>1?1:i)}return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(t){if(this._angle=t,!this.isZero()){var e=this.getLength();this._set(Math.cos(t)*e,Math.sin(t)*e)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var t=c.read(arguments);return 180*Math.atan2(this.cross(t),this.dot(t))/Math.PI},getDistance:function(){var t=c.read(arguments),e=t.x-this.x,i=t.y-this.y,n=e*e+i*i;return r.read(arguments)?n:Math.sqrt(n)},normalize:function(t){t===e&&(t=1);var i=this.getLength(),n=0!==i?t/i:0,r=new c(this.x*n,this.y*n);return n>=0&&(r._angle=this._angle),r},rotate:function(t,e){if(0===t)return this.clone();t=t*Math.PI/180;var i=e?this.subtract(e):this,n=Math.sin(t),r=Math.cos(t);return i=new c(i.x*r-i.y*n,i.x*n+i.y*r),e?i.add(e):i},transform:function(t){return t?t._transformPoint(this):this},add:function(){var t=c.read(arguments);return new c(this.x+t.x,this.y+t.y)},subtract:function(){var t=c.read(arguments);return new c(this.x-t.x,this.y-t.y)},multiply:function(){var t=c.read(arguments);return new c(this.x*t.x,this.y*t.y)},divide:function(){var t=c.read(arguments);return new c(this.x/t.x,this.y/t.y)},modulo:function(){var t=c.read(arguments);return new c(this.x%t.x,this.y%t.y)},negate:function(){return new c(-this.x,-this.y)},isInside:function(){return g.read(arguments).contains(this)},isClose:function(){var t=c.read(arguments),e=r.read(arguments);return this.getDistance(t)<=e},isCollinear:function(){var t=c.read(arguments);return c.isCollinear(this.x,this.y,t.x,t.y)},isColinear:"#isCollinear",isOrthogonal:function(){var t=c.read(arguments);return c.isOrthogonal(this.x,this.y,t.x,t.y)},isZero:function(){var t=u.isZero;return t(this.x)&&t(this.y)},isNaN:function(){return isNaN(this.x)||isNaN(this.y)},isInQuadrant:function(t){return this.x*(t>1&&t<4?-1:1)>=0&&this.y*(t>2?-1:1)>=0},dot:function(){var t=c.read(arguments);return this.x*t.x+this.y*t.y},cross:function(){var t=c.read(arguments);return this.x*t.y-this.y*t.x},project:function(){var t=c.read(arguments),e=t.isZero()?0:this.dot(t)/t.dot(t);return new c(t.x*e,t.y*e)},statics:{min:function(){var t=c.read(arguments),e=c.read(arguments);return new c(Math.min(t.x,e.x),Math.min(t.y,e.y))},max:function(){var t=c.read(arguments),e=c.read(arguments);return new c(Math.max(t.x,e.x),Math.max(t.y,e.y))},random:function(){return new c(Math.random(),Math.random())},isCollinear:function(t,e,i,n){return Math.abs(t*n-e*i)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))},isOrthogonal:function(t,e,i,n){return Math.abs(t*i+e*n)<=1e-8*Math.sqrt((t*t+e*e)*(i*i+n*n))}}},r.each(["round","ceil","floor","abs"],function(t){var e=Math[t];this[t]=function(){return new c(e(this.x),e(this.y))}},{})),f=c.extend({initialize:function(t,e,i,n){this._x=t,this._y=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._x=t,this._y=e,i||this._owner[this._setter](this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner[this._setter](this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner[this._setter](this)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){return"setPosition"===this._setter?4:0}}),d=r.extend({_class:"Size",_readIndex:!0,initialize:function(t,e){var i=typeof t,n=this.__read,r=0;if("number"===i){var s="number"==typeof e;this._set(t,s?e:t),n&&(r=s?2:1)}else if("undefined"===i||null===t)this._set(0,0),n&&(r=null===t?1:0);else{var a="string"===i?t.split(/[\s,]+/)||[]:t;r=1,Array.isArray(a)?this._set(+a[0],+(a.length>1?a[1]:a[0])):"width"in a?this._set(a.width||0,a.height||0):"x"in a?this._set(a.x||0,a.y||0):(this._set(0,0),r=0)}return n&&(this.__read=r),this},set:"#initialize",_set:function(t,e){return this.width=t,this.height=e,this},equals:function(t){return t===this||t&&(this.width===t.width&&this.height===t.height||Array.isArray(t)&&this.width===t[0]&&this.height===t[1])||!1},clone:function(){return new d(this.width,this.height)},toString:function(){var t=h.instance;return"{ width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){var e=t.formatter;return[e.number(this.width),e.number(this.height)]},add:function(){var t=d.read(arguments);return new d(this.width+t.width,this.height+t.height)},subtract:function(){var t=d.read(arguments);return new d(this.width-t.width,this.height-t.height)},multiply:function(){var t=d.read(arguments);return new d(this.width*t.width,this.height*t.height)},divide:function(){var t=d.read(arguments);return new d(this.width/t.width,this.height/t.height)},modulo:function(){var t=d.read(arguments);return new d(this.width%t.width,this.height%t.height)},negate:function(){return new d(-this.width,-this.height)},isZero:function(){var t=u.isZero;return t(this.width)&&t(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(t,e){return new d(Math.min(t.width,e.width),Math.min(t.height,e.height))},max:function(t,e){return new d(Math.max(t.width,e.width),Math.max(t.height,e.height))},random:function(){return new d(Math.random(),Math.random())}}},r.each(["round","ceil","floor","abs"],function(t){var e=Math[t];this[t]=function(){return new d(e(this.width),e(this.height))}},{})),_=d.extend({initialize:function(t,e,i,n){this._width=t,this._height=e,this._owner=i,this._setter=n},_set:function(t,e,i){return this._width=t,this._height=e,i||this._owner[this._setter](this),this},getWidth:function(){return this._width},setWidth:function(t){this._width=t,this._owner[this._setter](this)},getHeight:function(){return this._height},setHeight:function(t){this._height=t,this._owner[this._setter](this)}}),g=r.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(t,i,n,s){var a,o=typeof t;if("number"===o?(this._set(t,i,n,s),a=4):"undefined"===o||null===t?(this._set(0,0,0,0),a=null===t?1:0):1===arguments.length&&(Array.isArray(t)?(this._set.apply(this,t),a=1):t.x!==e||t.width!==e?(this._set(t.x||0,t.y||0,t.width||0,t.height||0),a=1):t.from===e&&t.to===e&&(this._set(0,0,0,0),r.filter(this,t),a=1)),a===e){var h,u,l=c.readNamed(arguments,"from"),f=r.peek(arguments),_=l.x,g=l.y;if(f&&f.x!==e||r.hasNamed(arguments,"to")){var v=c.readNamed(arguments,"to");h=v.x-_,u=v.y-g,h<0&&(_=v.x,h=-h),u<0&&(g=v.y,u=-u)}else{var p=d.read(arguments);h=p.width,u=p.height}this._set(_,g,h,u),a=arguments.__index;var m=arguments.__filtered;m&&(this.__filtered=m)}return this.__read&&(this.__read=a),this},set:"#initialize",_set:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},clone:function(){return new g(this.x,this.y,this.width,this.height)},equals:function(t){var e=r.isPlainValue(t)?g.read(arguments):t;return e===this||e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height||!1},toString:function(){var t=h.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+", width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){var e=t.formatter;return[e.number(this.x),e.number(this.y),e.number(this.width),e.number(this.height)]},getPoint:function(t){return new(t?c:f)(this.x,this.y,this,"setPoint")},setPoint:function(){var t=c.read(arguments);this.x=t.x,this.y=t.y},getSize:function(t){return new(t?d:_)(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var t=d.read(arguments),e=this._sx,i=this._sy,n=t.width,r=t.height;e&&(this.x+=(this.width-n)*e),i&&(this.y+=(this.height-r)*i),this.width=n,this.height=r,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(t){if(!this._fw){var e=t-this.x;this.width-=.5===this._sx?2*e:e}this.x=t,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(t){if(!this._fh){var e=t-this.y;this.height-=.5===this._sy?2*e:e}this.y=t,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(t){if(!this._fw){var e=t-this.x;this.width=.5===this._sx?2*e:e}this.x=t-this.width,this._sx=1,this._fw=0},getBottom:function(){return this.y+this.height},setBottom:function(t){if(!this._fh){var e=t-this.y;this.height=.5===this._sy?2*e:e}this.y=t-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(t){this._fw||.5===this._sx?this.x=t-this.width/2:(this._sx&&(this.x+=2*(t-this.x)*this._sx),this.width=2*(t-this.x)),this._sx=.5,this._fw=0},getCenterY:function(){return this.y+this.height/2},setCenterY:function(t){this._fh||.5===this._sy?this.y=t-this.height/2:(this._sy&&(this.y+=2*(t-this.y)*this._sy),this.height=2*(t-this.y)),this._sy=.5,this._fh=0},getCenter:function(t){return new(t?c:f)(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var t=c.read(arguments);return this.setCenterX(t.x),this.setCenterY(t.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return 0===this.width||0===this.height},contains:function(t){return t&&t.width!==e||4===(Array.isArray(t)?t:arguments).length?this._containsRectangle(g.read(arguments)):this._containsPoint(c.read(arguments))},_containsPoint:function(t){var e=t.x,i=t.y;return e>=this.x&&i>=this.y&&e<=this.x+this.width&&i<=this.y+this.height},_containsRectangle:function(t){var e=t.x,i=t.y;return e>=this.x&&i>=this.y&&e+t.width<=this.x+this.width&&i+t.height<=this.y+this.height},intersects:function(){var t=g.read(arguments),e=r.read(arguments)||0;return t.x+t.width>this.x-e&&t.y+t.height>this.y-e&&t.x<this.x+this.width+e&&t.y<this.y+this.height+e},intersect:function(){var t=g.read(arguments),e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),n=Math.min(this.x+this.width,t.x+t.width),r=Math.min(this.y+this.height,t.y+t.height);return new g(e,i,n-e,r-i)},unite:function(){var t=g.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x+t.width),r=Math.max(this.y+this.height,t.y+t.height);return new g(e,i,n-e,r-i)},include:function(){var t=c.read(arguments),e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),n=Math.max(this.x+this.width,t.x),r=Math.max(this.y+this.height,t.y);return new g(e,i,n-e,r-i)},expand:function(){var t=d.read(arguments),e=t.width,i=t.height;return new g(this.x-e/2,this.y-i/2,this.width+e,this.height+i)},scale:function(t,i){return this.expand(this.width*t-this.width,this.height*(i===e?t:i)-this.height)}},r.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],function(t,e){var i=t.join(""),n=/^[RL]/.test(i);e>=4&&(t[1]+=n?"Y":"X");var r=t[n?0:1],s=t[n?1:0],a="get"+r,o="get"+s,h="set"+r,u="set"+s,l="set"+i;this["get"+i]=function(t){return new(t?c:f)(this[a](),this[o](),this,l)},this[l]=function(){var t=c.read(arguments);this[h](t.x),this[u](t.y)}},{beans:!0})),v=g.extend({initialize:function(t,e,i,n,r,s){this._set(t,e,i,n,!0),this._owner=r,this._setter=s},_set:function(t,e,i,n,r){return this._x=t,this._y=e,this._width=i,this._height=n,r||this._owner[this._setter](this),this}},new function(){var t=g.prototype;return r.each(["x","y","width","height"],function(t){var e=r.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._dontNotify||this._owner[this._setter](this)}},r.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],function(e){var i="set"+e;this[i]=function(){this._dontNotify=!0,t[i].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(t){var e=this._owner;e._changeSelection&&e._changeSelection(2,t)}}))}),p=r.extend({_class:"Matrix",initialize:function t(e,i){var n=arguments.length,r=!0;if(n>=6?this._set.apply(this,arguments):1===n||2===n?e instanceof t?this._set(e._a,e._b,e._c,e._d,e._tx,e._ty,i):Array.isArray(e)?this._set.apply(this,i?e.concat([i]):e):r=!1:n?r=!1:this.reset(),!r)throw new Error("Unsupported matrix parameters");return this},set:"#initialize",_set:function(t,e,i,n,r,s,a){return this._a=t,this._b=e,this._c=i,this._d=n,this._tx=r,this._ty=s,a||this._changed(),this},_serialize:function(t,e){return r.serialize(this.getValues(),t,!0,e)},_changed:function(){var t=this._owner;t&&(t._applyMatrix?t.transform(null,!0):t._changed(9))},clone:function(){return new p(this._a,this._b,this._c,this._d,this._tx,this._ty)},equals:function(t){return t===this||t&&this._a===t._a&&this._b===t._b&&this._c===t._c&&this._d===t._d&&this._tx===t._tx&&this._ty===t._ty},toString:function(){var t=h.instance;return"[["+[t.number(this._a),t.number(this._c),t.number(this._tx)].join(", ")+"], ["+[t.number(this._b),t.number(this._d),t.number(this._ty)].join(", ")+"]]"},reset:function(t){return this._a=this._d=1,this._b=this._c=this._tx=this._ty=0,t||this._changed(),this},apply:function(t,e){var i=this._owner;return!!i&&(i.transform(null,!0,r.pick(t,!0),e),this.isIdentity())},translate:function(){var t=c.read(arguments),e=t.x,i=t.y;return this._tx+=e*this._a+i*this._c,this._ty+=e*this._b+i*this._d,this._changed(),this},scale:function(){var t=c.read(arguments),e=c.read(arguments,0,{readNull:!0});return e&&this.translate(e),this._a*=t.x,this._b*=t.x,this._c*=t.y,this._d*=t.y,e&&this.translate(e.negate()),this._changed(),this},rotate:function(t){t*=Math.PI/180;var e=c.read(arguments,1),i=e.x,n=e.y,r=Math.cos(t),s=Math.sin(t),a=i-i*r+n*s,o=n-i*s-n*r,h=this._a,u=this._b,l=this._c,f=this._d;return this._a=r*h+s*l,this._b=r*u+s*f,this._c=-s*h+r*l,this._d=-s*u+r*f,this._tx+=a*h+o*l,this._ty+=a*u+o*f,this._changed(),this},shear:function(){var t=c.read(arguments),e=c.read(arguments,0,{readNull:!0});e&&this.translate(e);var i=this._a,n=this._b;return this._a+=t.y*this._c,this._b+=t.y*this._d,this._c+=t.x*i,this._d+=t.x*n,e&&this.translate(e.negate()),this._changed(),this},skew:function(){var t=c.read(arguments),e=c.read(arguments,0,{readNull:!0}),i=Math.PI/180,n=new c(Math.tan(t.x*i),Math.tan(t.y*i));return this.shear(n,e)},append:function(t,e){if(t){var i=this._a,n=this._b,r=this._c,s=this._d,a=t._a,o=t._c,h=t._b,u=t._d,l=t._tx,c=t._ty;this._a=a*i+h*r,this._c=o*i+u*r,this._b=a*n+h*s,this._d=o*n+u*s,this._tx+=l*i+c*r,this._ty+=l*n+c*s,e||this._changed()}return this},prepend:function(t,e){if(t){var i=this._a,n=this._b,r=this._c,s=this._d,a=this._tx,o=this._ty,h=t._a,u=t._c,l=t._b,c=t._d,f=t._tx,d=t._ty;this._a=h*i+u*n,this._c=h*r+u*s,this._b=l*i+c*n,this._d=l*r+c*s,this._tx=h*a+u*o+f,this._ty=l*a+c*o+d,e||this._changed()}return this},appended:function(t){return this.clone().append(t)},prepended:function(t){return this.clone().prepend(t)},invert:function(){var t=this._a,e=this._b,i=this._c,n=this._d,r=this._tx,s=this._ty,a=t*n-e*i,o=null;return a&&!isNaN(a)&&isFinite(r)&&isFinite(s)&&(this._a=n/a,this._b=-e/a,this._c=-i/a,this._d=t/a,this._tx=(i*s-n*r)/a,this._ty=(e*r-t*s)/a,o=this),o},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new p(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return 1===this._a&&0===this._b&&0===this._c&&1===this._d&&0===this._tx&&0===this._ty},isInvertible:function(){var t=this._a*this._d-this._c*this._b;return t&&!isNaN(t)&&isFinite(this._tx)&&isFinite(this._ty)},isSingular:function(){return!this.isInvertible()},transform:function(t,e,i){return arguments.length<3?this._transformPoint(c.read(arguments)):this._transformCoordinates(t,e,i)},_transformPoint:function(t,e,i){var n=t.x,r=t.y;return e||(e=new c),e._set(n*this._a+r*this._c+this._tx,n*this._b+r*this._d+this._ty,i)},_transformCoordinates:function(t,e,i){for(var n=0,r=2*i;n<r;n+=2){var s=t[n],a=t[n+1];e[n]=s*this._a+a*this._c+this._tx,e[n+1]=s*this._b+a*this._d+this._ty}return e},_transformCorners:function(t){var e=t.x,i=t.y,n=e+t.width,r=i+t.height,s=[e,i,n,i,n,r,e,r];return this._transformCoordinates(s,s,4)},_transformBounds:function(t,e,i){for(var n=this._transformCorners(t),r=n.slice(0,2),s=r.slice(),a=2;a<8;a++){var o=n[a],h=1&a;o<r[h]?r[h]=o:o>s[h]&&(s[h]=o)}return e||(e=new g),e._set(r[0],r[1],s[0]-r[0],s[1]-r[1],i)},inverseTransform:function(){return this._inverseTransform(c.read(arguments))},_inverseTransform:function(t,e,i){var n=this._a,r=this._b,s=this._c,a=this._d,o=this._tx,h=this._ty,u=n*a-r*s,l=null;if(u&&!isNaN(u)&&isFinite(o)&&isFinite(h)){var f=t.x-this._tx,d=t.y-this._ty;e||(e=new c),l=e._set((f*a-d*s)/u,(d*n-f*r)/u,i)}return l},decompose:function(){var t,e,i,n=this._a,r=this._b,s=this._c,a=this._d,o=n*a-r*s,h=Math.sqrt,u=Math.atan2,l=180/Math.PI;if(0!==n||0!==r){var f=h(n*n+r*r);t=Math.acos(n/f)*(r>0?1:-1),e=[f,o/f],i=[u(n*s+r*a,f*f),0]}else if(0!==s||0!==a){var d=h(s*s+a*a);t=Math.asin(s/d)*(a>0?1:-1),e=[o/d,d],i=[0,u(n*s+r*a,d*d)]}else t=0,i=e=[0,0];return{translation:this.getTranslation(),rotation:t*l,scaling:new c(e),skewing:new c(i[0]*l,i[1]*l)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new c(this._tx,this._ty)},getScaling:function(){return(this.decompose()||{}).scaling},getRotation:function(){return(this.decompose()||{}).rotation},applyToContext:function(t){this.isIdentity()||t.transform(this._a,this._b,this._c,this._d,this._tx,this._ty)}},r.each(["a","b","c","d","tx","ty"],function(t){var e=r.capitalize(t),i="_"+t;this["get"+e]=function(){return this[i]},this["set"+e]=function(t){this[i]=t,this._changed()}},{})),m=r.extend({_class:"Line",initialize:function(t,e,i,n,r){var s=!1;arguments.length>=4?(this._px=t,this._py=e,this._vx=i,this._vy=n,s=r):(this._px=t.x,this._py=t.y,this._vx=e.x,this._vy=e.y,s=i),s||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new c(this._px,this._py)},getVector:function(){return new c(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(t,e){return m.intersect(this._px,this._py,this._vx,this._vy,t._px,t._py,t._vx,t._vy,!0,e)},getSide:function(t,e){return m.getSide(this._px,this._py,this._vx,this._vy,t.x,t.y,!0,e)},getDistance:function(t){return Math.abs(this.getSignedDistance(t))},getSignedDistance:function(t){return m.getSignedDistance(this._px,this._py,this._vx,this._vy,t.x,t.y,!0)},isCollinear:function(t){return c.isCollinear(this._vx,this._vy,t._vx,t._vy)},isOrthogonal:function(t){return c.isOrthogonal(this._vx,this._vy,t._vx,t._vy)},statics:{intersect:function(t,e,i,n,r,s,a,o,h,l){h||(i-=t,n-=e,a-=r,o-=s);var f=i*o-n*a;if(!u.isZero(f)){var d=t-r,_=e-s,g=(a*_-o*d)/f,v=(i*_-n*d)/f;if(l||-1e-12<g&&g<1+1e-12&&-1e-12<v&&v<1+1e-12)return l||(g=g<=0?0:g>=1?1:g),new c(t+g*i,e+g*n)}},getSide:function(t,e,i,n,r,s,a,o){a||(i-=t,n-=e);var h=r-t,l=h*n-(s-e)*i;return!o&&u.isZero(l)&&(l=(h*i+h*i)/(i*i+n*n))>=0&&l<=1&&(l=0),l<0?-1:l>0?1:0},getSignedDistance:function(t,e,i,n,r,s,a){return a||(i-=t,n-=e),0===i?n>0?r-t:t-r:0===n?i<0?s-e:e-s:((r-t)*n-(s-e)*i)/Math.sqrt(i*i+n*n)},getDistance:function(t,e,i,n,r,s,a){return Math.abs(m.getSignedDistance(t,e,i,n,r,s,a))}}}),y=o.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(t){o.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new V(null,null,this),this._view=U.create(this,t||Q.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(t,e){return r.serialize(this._children,t,!0,e)},_changed:function(t,e){if(1&t){var i=this._view;i&&(i._needsUpdate=!0,!i._requested&&i._autoUpdate&&i.requestUpdate())}var n=this._changes;if(n&&e){var r=this._changesById,s=e._id,a=r[s];a?a.flags|=t:n.push(r[s]={item:e,flags:t})}},clear:function(){for(var t=this._children,e=t.length-1;e>=0;e--)t[e].remove()},isEmpty:function(){return!this._children.length},remove:function t(){return!!t.base.call(this)&&(this._view&&this._view.remove(),!0)},getView:function(){return this._view},getCurrentStyle:function(){return this._currentStyle},setCurrentStyle:function(t){this._currentStyle.set(t)},getIndex:function(){return this._index},getOptions:function(){return this._scope.settings},getLayers:function(){return this._children},getActiveLayer:function(){return this._activeLayer||new b({project:this,insert:!0})},getSymbolDefinitions:function(){var t=[],e={};return this.getItems({class:P,match:function(i){var n=i._definition,r=n._id;return e[r]||(e[r]=!0,t.push(n)),!1}}),t},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var t=this._selectionItems,e=[];for(var i in t){var n=t[i],r=n._selection;1&r&&n.isInserted()?e.push(n):r||this._updateSelection(n)}return e},_updateSelection:function(t){var e=t._id,i=this._selectionItems;t._selection?i[e]!==t&&(this._selectionCount++,i[e]=t):i[e]===t&&(this._selectionCount--,delete i[e])},selectAll:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)t[e].setFullySelected(!0)},deselectAll:function(){var t=this._selectionItems;for(var e in t)t[e].setFullySelected(!1)},addLayer:function(t){return this.insertLayer(e,t)},insertLayer:function(t,e){if(e instanceof b){e._remove(!1,!0),r.splice(this._children,[e],t,0),e._setProject(this,!0);var i=e._name;i&&e.setName(i),this._changes&&e._changed(5),this._activeLayer||(this._activeLayer=e)}else e=null;return e},_insertItem:function(t,i,n){return i=this.insertLayer(t,i)||(this._activeLayer||this._insertItem(e,new b(w.NO_INSERT),!0)).insertChild(t,i),n&&i.activate&&i.activate(),i},getItems:function(t){return w._getItems(this,t)},getItem:function(t){return w._getItems(this,t,null,null,!0)[0]||null},importJSON:function(t){this.activate();var e=this._activeLayer;return r.importJSON(t,e&&e.isEmpty()&&e)},removeOn:function(t){var e=this._removeSets;if(e){"mouseup"===t&&(e.mousedrag=null);var i=e[t];if(i){for(var n in i){var r=i[n];for(var s in e){var a=e[s];a&&a!=i&&delete a[r._id]}r.remove()}e[t]=null}}},draw:function(t,e,i){this._updateVersion++,t.save(),e.applyToContext(t);for(var n=this._children,s=new r({offset:new c(0,0),pixelRatio:i,viewMatrix:e.isIdentity()?null:e,matrices:[new p],updateMatrix:!0}),a=0,o=n.length;a<o;a++)n[a].draw(t,s);if(t.restore(),this._selectionCount>0){t.save(),t.strokeWidth=1;var h=this._selectionItems,u=this._scope.settings.handleSize,l=this._updateVersion;for(var f in h)h[f]._drawSelection(t,e,u,h,l);t.restore()}}}),w=r.extend(s,{statics:{extend:function t(e){return e._serializeFields&&(e._serializeFields=r.set({},this.prototype._serializeFields,e._serializeFields)),t.base.apply(this,arguments)},NO_INSERT:{insert:!1}},_class:"Item",_name:null,_applyMatrix:!0,_canApplyMatrix:!0,_canScaleStroke:!1,_pivot:null,_visible:!0,_blendMode:"normal",_opacity:1,_locked:!1,_guide:!1,_clipMask:!1,_selection:0,_selectBounds:!0,_selectChildren:!1,_serializeFields:{name:null,applyMatrix:null,matrix:new p,pivot:null,visible:!0,blendMode:"normal",opacity:1,locked:!1,guide:!1,clipMask:!1,selected:!1,data:{}},_prioritize:["applyMatrix"]},new function(){var t=["onMouseDown","onMouseUp","onMouseDrag","onClick","onDoubleClick","onMouseMove","onMouseEnter","onMouseLeave"];return r.each(t,function(t){this._events[t]={install:function(t){this.getView()._countItemEvent(t,1)},uninstall:function(t){this.getView()._countItemEvent(t,-1)}}},{_events:{onFrame:{install:function(){this.getView()._animateItem(this,!0)},uninstall:function(){this.getView()._animateItem(this,!1)}},onLoad:{},onError:{}},statics:{_itemHandlers:t}})},{initialize:function(){},_initialize:function(t,i){var n=t&&r.isPlainObject(t),s=n&&!0===t.internal,a=this._matrix=new p,o=n&&t.project||paper.project,h=paper.settings;return this._id=s?null:l.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&h.applyMatrix,i&&a.translate(i),a._owner=this,this._style=new V(o._currentStyle,this,o),s||n&&0==t.insert||!h.insertItems&&(!n||!0!==t.insert)?this._setProject(o):(n&&t.parent||o)._insertItem(e,this,!0),n&&t!==w.NO_INSERT&&this.set(t,{internal:!0,insert:!0,project:!0,parent:!0}),n},_serialize:function(t,e){function i(i){for(var a in i){var o=s[a];r.equals(o,"leading"===a?1.2*i.fontSize:i[a])||(n[a]=r.serialize(o,t,"data"!==a,e))}}var n={},s=this;return i(this._serializeFields),this instanceof x||i(this._style._defaults),[this._class,n]},_changed:function(t){var i=this._symbol,n=this._parent||i,r=this._project;8&t&&(this._bounds=this._position=this._decomposed=this._globalMatrix=e),n&&40&t&&w._clearBoundsCache(n),2&t&&w._clearBoundsCache(this),r&&r._changed(t,this),i&&i._changed(t)},getId:function(){return this._id},getName:function(){return this._name},setName:function(t){if(this._name&&this._removeNamed(),t===+t+"")throw new Error("Names consisting only of numbers are not supported.");var i=this._getOwner();if(t&&i){var n=i._children,r=i._namedChildren;(r[t]=r[t]||[]).push(this),t in n||(n[t]=this)}this._name=t||e,this._changed(128)},getStyle:function(){return this._style},setStyle:function(t){this.getStyle().set(t)}},r.each(["locked","visible","blendMode","opacity","guide"],function(t){var e=r.capitalize(t),i="_"+t,n={locked:128,visible:137};this["get"+e]=function(){return this[i]},this["set"+e]=function(e){e!=this[i]&&(this[i]=e,this._changed(n[t]||129))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(t){if(t!==this._selection){this._selection=t;var e=this._project;e&&(e._updateSelection(this),this._changed(129))}},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){if(this._selectChildren)for(var t=this._children,e=0,i=t.length;e<i;e++)if(t[e].isSelected())return!0;return!!(1&this._selection)},setSelected:function(t){if(this._selectChildren)for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setSelected(t);this._changeSelection(1,t)},isFullySelected:function(){var t=this._children,e=!!(1&this._selection);if(t&&e){for(var i=0,n=t.length;i<n;i++)if(!t[i].isFullySelected())return!1;return!0}return e},setFullySelected:function(t){var e=this._children;if(e)for(var i=0,n=e.length;i<n;i++)e[i].setFullySelected(t);this._changeSelection(1,t)},isClipMask:function(){return this._clipMask},setClipMask:function(t){this._clipMask!=(t=!!t)&&(this._clipMask=t,t&&(this.setFillColor(null),this.setStrokeColor(null)),this._changed(129),this._parent&&this._parent._changed(1024))},getData:function(){return this._data||(this._data={}),this._data},setData:function(t){this._data=t},getPosition:function(t){var e=this._position,i=t?c:f;if(!e){var n=this._pivot;e=this._position=n?this._matrix._transformPoint(n):this.getBounds().getCenter(!0)}return new i(e.x,e.y,this,"setPosition")},setPosition:function(){this.translate(c.read(arguments).subtract(this.getPosition(!0)))},getPivot:function(){var t=this._pivot;return t?new f(t.x,t.y,this,"setPivot"):null},setPivot:function(){this._pivot=c.read(arguments,0,{clone:!0,readNull:!0}),this._position=e}},r.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(t,e){this[e]=function(e){return this.getBounds(e,t)}},{beans:!0,getBounds:function(t,e){var i=e||t instanceof p,n=r.set({},i?e:t,this._boundsOptions);n.stroke&&!this.getStrokeScaling()||(n.cacheItem=this);var s=this._getCachedBounds(i&&t,n).rect;return arguments.length?s:new v(s.x,s.y,s.width,s.height,this,"setBounds")},setBounds:function(){var t=g.read(arguments),e=this.getBounds(),i=this._matrix,n=new p,r=t.getCenter();n.translate(r),t.width==e.width&&t.height==e.height||(i.isInvertible()||(i.set(i._backup||(new p).translate(i.getTranslation())),e=this.getBounds()),n.scale(0!==e.width?t.width/e.width:0,0!==e.height?t.height/e.height:0)),r=e.getCenter(),n.translate(-r.x,-r.y),this.transform(n)},_getBounds:function(t,e){var i=this._children;return i&&i.length?(w._updateBoundsCache(this,e.cacheItem),w._getBounds(i,t,e)):new g},_getBoundsCacheKey:function(t,e){return[t.stroke?1:0,t.handle?1:0,e?1:0].join("")},_getCachedBounds:function(t,e,i){t=t&&t._orNullIfIdentity();var n=e.internal&&!i,r=e.cacheItem,s=n?null:this._matrix._orNullIfIdentity(),a=r&&(!t||t.equals(s))&&this._getBoundsCacheKey(e,n),o=this._bounds;if(w._updateBoundsCache(this._parent||this._symbol,r),a&&o&&a in o)return{rect:(f=o[a]).rect.clone(),nonscaling:f.nonscaling};var h=this._getBounds(t||s,e),u=h.rect||h,l=this._style,c=h.nonscaling||l.hasStroke()&&!l.getStrokeScaling();if(a){o||(this._bounds=o={});var f=o[a]={rect:u.clone(),nonscaling:c,internal:n}}return{rect:u,nonscaling:c}},_getStrokeMatrix:function(t,e){var i=this.getStrokeScaling()?null:e&&e.internal?this:this._parent||this._symbol&&this._symbol._item,n=i?i.getViewMatrix().invert():t;return n&&n._shiftless()},statics:{_updateBoundsCache:function(t,e){if(t&&e){var i=e._id,n=t._boundsCache=t._boundsCache||{ids:{},list:[]};n.ids[i]||(n.list.push(e),n.ids[i]=e)}},_clearBoundsCache:function(t){var i=t._boundsCache;if(i){t._bounds=t._position=t._boundsCache=e;for(var n=0,r=i.list,s=r.length;n<s;n++){var a=r[n];a!==t&&(a._bounds=a._position=e,a._boundsCache&&w._clearBoundsCache(a))}}},_getBounds:function(t,e,i){var n=1/0,r=-n,s=n,a=r,o=!1;i=i||{};for(var h=0,u=t.length;h<u;h++){var l=t[h];if(l._visible&&!l.isEmpty()){var c=l._getCachedBounds(e&&e.appended(l._matrix),i,!0),f=c.rect;n=Math.min(f.x,n),s=Math.min(f.y,s),r=Math.max(f.x+f.width,r),a=Math.max(f.y+f.height,a),c.nonscaling&&(o=!0)}}return{rect:isFinite(n)?new g(n,s,r-n,a-s):new g,nonscaling:o}}}}),{beans:!0,_decompose:function(){return this._applyMatrix?null:this._decomposed||(this._decomposed=this._matrix.decompose())},getRotation:function(){var t=this._decompose();return t?t.rotation:0},setRotation:function(t){var e=this.getRotation();if(null!=e&&null!=t){var i=this._decomposed;this.rotate(t-e),i&&(i.rotation=t,this._decomposed=i)}},getScaling:function(){var t=this._decompose(),e=t&&t.scaling;return new f(e?e.x:1,e?e.y:1,this,"setScaling")},setScaling:function(){var t=this.getScaling(),e=c.read(arguments,0,{clone:!0,readNull:!0});if(t&&e&&!t.equals(e)){var i=this.getRotation(),n=this._decomposed,r=new p,s=this.getPosition(!0);r.translate(s),i&&r.rotate(i),r.scale(e.x/t.x,e.y/t.y),i&&r.rotate(-i),r.translate(s.negate()),this.transform(r),n&&(n.scaling=e,this._decomposed=n)}},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.initialize.apply(t,arguments)},getGlobalMatrix:function(t){var e=this._globalMatrix,i=this._project._updateVersion;if(e&&e._updateVersion!==i&&(e=null),!e){e=this._globalMatrix=this._matrix.clone();var n=this._parent;n&&e.prepend(n.getGlobalMatrix(!0)),e._updateVersion=i}return t?e:e.clone()},getViewMatrix:function(){return this.getGlobalMatrix().prepend(this.getView()._matrix)},getApplyMatrix:function(){return this._applyMatrix},setApplyMatrix:function(t){(this._applyMatrix=this._canApplyMatrix&&!!t)&&this.transform(null,!0)},getTransformContent:"#getApplyMatrix",setTransformContent:"#setApplyMatrix"},{getProject:function(){return this._project},_setProject:function(t,e){if(this._project!==t){this._project&&this._installEvents(!1),this._project=t;for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._setProject(t);e=!0}e&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function t(e){t.base.call(this,e);for(var i=this._children,n=0,r=i&&i.length;n<r;n++)i[n]._installEvents(e)},getLayer:function(){for(var t=this;t=t._parent;)if(t instanceof b)return t;return null},getParent:function(){return this._parent},setParent:function(t){return t.addChild(this)},_getOwner:"#getParent",getChildren:function(){return this._children},setChildren:function(t){this.removeChildren(),this.addChildren(t)},getFirstChild:function(){return this._children&&this._children[0]||null},getLastChild:function(){return this._children&&this._children[this._children.length-1]||null},getNextSibling:function(){var t=this._getOwner();return t&&t._children[this._index+1]||null},getPreviousSibling:function(){var t=this._getOwner();return t&&t._children[this._index-1]||null},getIndex:function(){return this._index},equals:function(t){return t===this||t&&this._class===t._class&&this._style.equals(t._style)&&this._matrix.equals(t._matrix)&&this._locked===t._locked&&this._visible===t._visible&&this._blendMode===t._blendMode&&this._opacity===t._opacity&&this._clipMask===t._clipMask&&this._guide===t._guide&&this._equals(t)||!1},_equals:function(t){return r.equals(this._children,t._children)},clone:function(t){var i=new this.constructor(w.NO_INSERT),n=this._children,s=r.pick(t?t.insert:e,t===e||!0===t),a=r.pick(t?t.deep:e,!0);n&&i.copyAttributes(this),n&&!a||i.copyContent(this),n||i.copyAttributes(this),s&&i.insertAbove(this);var o=this._name,h=this._parent;if(o&&h){for(var n=h._children,u=o,l=1;n[o];)o=u+" "+l++;o!==u&&i.setName(o)}return i},copyContent:function(t){for(var e=t._children,i=0,n=e&&e.length;i<n;i++)this.addChild(e[i].clone(!1),!0)},copyAttributes:function(t,e){this.setStyle(t._style);for(var i=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],n=0,s=i.length;n<s;n++){var a=i[n];t.hasOwnProperty(a)&&(this[a]=t[a])}e||this._matrix.set(t._matrix,!0),this.setApplyMatrix(t._applyMatrix),this.setPivot(t._pivot),this.setSelection(t._selection);var o=t._data,h=t._name;this._data=o?r.clone(o):null,h&&this.setName(h)},rasterize:function(t,i){var n=this.getStrokeBounds(),s=(t||this.getView().getResolution())/72,a=n.getTopLeft().floor(),o=n.getBottomRight().ceil(),h=new d(o.subtract(a)),u=new S(w.NO_INSERT);if(!h.isZero()){var l=Q.getCanvas(h.multiply(s)),c=l.getContext("2d"),f=(new p).scale(s).translate(a.negate());c.save(),f.applyToContext(c),this.draw(c,new r({matrices:[f]})),c.restore(),u.setCanvas(l)}return u.transform((new p).translate(a.add(h.divide(2))).scale(1/s)),(i===e||i)&&u.insertAbove(this),u},contains:function(){return!!this._contains(this._matrix._inverseTransform(c.read(arguments)))},_contains:function(t){var e=this._children;if(e){for(var i=e.length-1;i>=0;i--)if(e[i].contains(t))return!0;return!1}return t.isInside(this.getInternalBounds())},isInside:function(){return g.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new L.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(t,e){return t instanceof w&&this._asPathItem().getIntersections(t._asPathItem(),null,e,!0).length>0}},new function(){function t(){return this._hitTest(c.read(arguments),M.getOptions(arguments))}function e(){var t=c.read(arguments),e=M.getOptions(arguments),i=[];return this._hitTest(t,r.set({all:i},e)),i}function i(t,e,i,n){var r=this._children;if(r)for(var s=r.length-1;s>=0;s--){var a=r[s],o=a!==n&&a._hitTest(t,e,i);if(o&&!e.all)return o}return null}return y.inject({hitTest:t,hitTestAll:e,_hitTest:i}),{hitTest:t,hitTestAll:e,_hitTestChildren:i}},{_hitTest:function(t,e,i){function n(t){return t&&_&&!_(t)&&(t=null),t&&e.all&&e.all.push(t),t}function s(e,i){var n=i?l["get"+i]():g.getPosition();if(t.subtract(n).divide(u).length<=1)return new M(e,g,{name:i?r.hyphenate(i):e,point:n})}if(this._locked||!this._visible||this._guide&&!e.guides||this.isEmpty())return null;var a=this._matrix,o=i?i.appended(a):this.getGlobalMatrix().prepend(this.getView()._matrix),h=Math.max(e.tolerance,1e-12),u=e._tolerancePadding=new d(L._getStrokePadding(h,a._shiftless().invert()));if(!(t=a._inverseTransform(t))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(u.multiply(2))._containsPoint(t))return null;var l,c,f=!(e.guides&&!this._guide||e.selected&&!this.isSelected()||e.type&&e.type!==r.hyphenate(this._class)||e.class&&!(this instanceof e.class)),_=e.match,g=this,v=e.position,p=e.center,m=e.bounds;if(f&&this._parent&&(v||p||m)){if((p||m)&&(l=this.getInternalBounds()),!(c=v&&s("position")||p&&s("center","Center"))&&m)for(var y=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],w=0;w<8&&!c;w++)c=s("bounds",y[w]);c=n(c)}return c||(c=this._hitTestChildren(t,e,o)||f&&n(this._hitTestSelf(t,e,o,this.getStrokeScaling()?null:o._shiftless().invert()))||null),c&&c.point&&(c.point=a.transform(c.point)),c},_hitTestSelf:function(t,e){if(e.fill&&this.hasFill()&&this._contains(t))return new M("fill",this)},matches:function(t,e){function i(t,e){for(var n in t)if(t.hasOwnProperty(n)){var s=t[n],a=e[n];if(r.isPlainObject(s)&&r.isPlainObject(a)){if(!i(s,a))return!1}else if(!r.equals(s,a))return!1}return!0}var n=typeof t;if("object"===n){for(var s in t)if(t.hasOwnProperty(s)&&!this.matches(s,t[s]))return!1;return!0}if("function"===n)return t(this);if("match"===t)return e(this);var a=/^(empty|editable)$/.test(t)?this["is"+r.capitalize(t)]():"type"===t?r.hyphenate(this._class):this[t];if("class"===t){if("function"==typeof e)return this instanceof e;a=this._class}if("function"==typeof e)return!!e(a);if(e){if(e.test)return e.test(a);if(r.isPlainObject(e))return i(e,a)}return r.equals(a,e)},getItems:function(t){return w._getItems(this,t,this._matrix)},getItem:function(t){return w._getItems(this,t,this._matrix,null,!0)[0]||null},statics:{_getItems:function t(e,i,n,s,a){if(!s){var o="object"==typeof i&&i,h=o&&o.overlapping,u=o&&o.inside,l=(w=h||u)&&g.read([w]);s={items:[],recursive:o&&!1!==o.recursive,inside:!!u,overlapping:!!h,rect:l,path:h&&new L.Rectangle({rectangle:l,insert:!1})},o&&(i=r.filter({},i,{recursive:!0,inside:!0,overlapping:!0}))}var c=e._children,f=s.items;n=(l=s.rect)&&(n||new p);for(var d=0,_=c&&c.length;d<_;d++){var v=c[d],m=n&&n.appended(v._matrix),y=!0;if(l){var w=v.getBounds(m);if(!l.intersects(w))continue;l.contains(w)||s.overlapping&&(w.contains(l)||s.path.intersects(v,m))||(y=!1)}if(y&&v.matches(i)&&(f.push(v),a))break;if(!1!==s.recursive&&t(v,i,m,s,a),a&&f.length>0)break}return f}}},{importJSON:function(t){var e=r.importJSON(t,this);return e!==this?this.addChild(e):e},addChild:function(t){return this.insertChild(e,t)},insertChild:function(t,e){var i=e?this.insertChildren(t,[e]):null;return i&&i[0]},addChildren:function(t){return this.insertChildren(this._children.length,t)},insertChildren:function(t,e){var i=this._children;if(i&&e&&e.length>0){for(var n={},s=(e=r.slice(e)).length-1;s>=0;s--){var a=(l=e[s])&&l._id;!l||n[a]?e.splice(s,1):(l._remove(!1,!0),n[a]=!0)}r.splice(i,e,t,0);for(var o=this._project,h=o._changes,s=0,u=e.length;s<u;s++){var l=e[s],c=l._name;l._parent=this,l._setProject(o,!0),c&&l.setName(c),h&&l._changed(5)}this._changed(11)}else e=null;return e},_insertItem:"#insertChild",_insertAt:function(t,e){var i=t&&t._getOwner(),n=t!==this&&i?this:null;return n&&(n._remove(!1,!0),i._insertItem(t._index+e,n)),n},insertAbove:function(t){return this._insertAt(t,1)},insertBelow:function(t){return this._insertAt(t,0)},sendToBack:function(){var t=this._getOwner();return t?t._insertItem(0,this):null},bringToFront:function(){var t=this._getOwner();return t?t._insertItem(e,this):null},appendTop:"#addChild",appendBottom:function(t){return this.insertChild(0,t)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(t){return t._insertItem(e,this)},copyTo:function(t){return this.clone(!1).addTo(t)},reduce:function(t){var e=this._children;if(e&&1===e.length){var i=e[0].reduce(t);return this._parent?(i.insertAbove(this),this.remove()):i.remove(),i}return this},_removeNamed:function(){var t=this._getOwner();if(t){var e=t._children,i=t._namedChildren,n=this._name,r=i[n],s=r?r.indexOf(this):-1;-1!==s&&(e[n]==this&&delete e[n],r.splice(s,1),r.length?e[n]=r[0]:delete i[n])}},_remove:function(t,e){var i=this._getOwner(),n=this._project,s=this._index;return!!i&&(this._name&&this._removeNamed(),null!=s&&(n._activeLayer===this&&(n._activeLayer=this.getNextSibling()||this.getPreviousSibling()),r.splice(i._children,null,s,1)),this._installEvents(!1),t&&n._changes&&this._changed(5),e&&i._changed(11,this),this._parent=null,!0)},remove:function(){return this._remove(!0,!0)},replaceWith:function(t){var e=t&&t.insertBelow(this);return e&&this.remove(),e},removeChildren:function(t,e){if(!this._children)return null;t=t||0,e=r.pick(e,this._children.length);for(var i=r.splice(this._children,null,t,e-t),n=i.length-1;n>=0;n--)i[n]._remove(!0,!1);return i.length>0&&this._changed(11),i},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var t=0,e=this._children.length;t<e;t++)this._children[t]._index=t;this._changed(11)}},isEmpty:function(){var t=this._children;return!t||!t.length},isEditable:function(){for(var t=this;t;){if(!t._visible||t._locked)return!1;t=t._parent}return!0},hasFill:function(){return this.getStyle().hasFill()},hasStroke:function(){return this.getStyle().hasStroke()},hasShadow:function(){return this.getStyle().hasShadow()},_getOrder:function(t){function e(t){var e=[];do{e.unshift(t)}while(t=t._parent);return e}for(var i=e(this),n=e(t),r=0,s=Math.min(i.length,n.length);r<s;r++)if(i[r]!=n[r])return i[r]._index<n[r]._index?1:-1;return 0},hasChildren:function(){return this._children&&this._children.length>0},isInserted:function(){return!!this._parent&&this._parent.isInserted()},isAbove:function(t){return-1===this._getOrder(t)},isBelow:function(t){return 1===this._getOrder(t)},isParent:function(t){return this._parent===t},isChild:function(t){return t&&t._parent===this},isDescendant:function(t){for(var e=this;e=e._parent;)if(e===t)return!0;return!1},isAncestor:function(t){return!!t&&t.isDescendant(this)},isSibling:function(t){return this._parent===t._parent},isGroupedWith:function(t){for(var e=this._parent;e;){if(e._parent&&/^(Group|Layer|CompoundPath)$/.test(e._class)&&t.isDescendant(e))return!0;e=e._parent}return!1}},r.each(["rotate","scale","shear","skew"],function(t){var e="rotate"===t;this[t]=function(){var i=(e?r:c).read(arguments),n=c.read(arguments,0,{readNull:!0});return this.transform((new p)[t](i,n||this.getPosition(!0)))}},{translate:function(){var t=new p;return this.transform(t.translate.apply(t,arguments))},transform:function(t,e,i,n){var r=this._matrix,s=t&&!t.isIdentity(),a=(e||this._applyMatrix)&&(!r.isIdentity()||s||e&&i&&this._children);if(!s&&!a)return this;if(s){!t.isInvertible()&&r.isInvertible()&&(r._backup=r.getValues()),r.prepend(t,!0);var o=this._style,h=o.getFillColor(!0),u=o.getStrokeColor(!0);h&&h.transform(t),u&&u.transform(t)}if(a&&(a=this._transformContent(r,i,n))){var l=this._pivot;l&&r._transformPoint(l,l,!0),r.reset(!0),n&&this._canApplyMatrix&&(this._applyMatrix=!0)}var c=this._bounds,f=this._position;(s||a)&&this._changed(9);var d=s&&c&&t.decompose();if(d&&d.skewing.isZero()&&d.rotation%90==0){for(var _ in c){var g=c[_];if(g.nonscaling)delete c[_];else if(a||!g.internal){var v=g.rect;t._transformBounds(v,v)}}this._bounds=c;var p=c[this._getBoundsCacheKey(this._boundsOptions||{})];p&&(this._position=p.rect.getCenter(!0))}else s&&f&&this._pivot&&(this._position=t._transformPoint(f,f));return this},_transformContent:function(t,e,i){var n=this._children;if(n){for(var r=0,s=n.length;r<s;r++)n[r].transform(t,!0,e,i);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(c.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(c.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(c.read(arguments))},localToParent:function(){return this._matrix._transformPoint(c.read(arguments))},fitBounds:function(t,e){t=g.read(arguments);var i=this.getBounds(),n=i.height/i.width,r=t.height/t.width,s=(e?n>r:n<r)?t.width/i.width:t.height/i.height,a=new g(new c,new d(i.width*s,i.height*s));a.setCenter(t.getCenter()),this.setBounds(a)}}),{_setStyles:function(t,e,i){var n=this._style,r=this._matrix;if(n.hasFill()&&(t.fillStyle=n.getFillColor().toCanvasStyle(t,r)),n.hasStroke()){t.strokeStyle=n.getStrokeColor().toCanvasStyle(t,r),t.lineWidth=n.getStrokeWidth();var s=n.getStrokeJoin(),a=n.getStrokeCap(),o=n.getMiterLimit();if(s&&(t.lineJoin=s),a&&(t.lineCap=a),o&&(t.miterLimit=o),paper.support.nativeDash){var h=n.getDashArray(),u=n.getDashOffset();h&&h.length&&("setLineDash"in t?(t.setLineDash(h),t.lineDashOffset=u):(t.mozDash=h,t.mozDashOffset=u))}}if(n.hasShadow()){var l=e.pixelRatio||1,f=i._shiftless().prepend((new p).scale(l,l)),d=f.transform(new c(n.getShadowBlur(),0)),_=f.transform(this.getShadowOffset());t.shadowColor=n.getShadowColor().toCanvasStyle(t),t.shadowBlur=d.getLength(),t.shadowOffsetX=_.x,t.shadowOffsetY=_.y}},draw:function(t,e,i){var n=this._updateVersion=this._project._updateVersion;if(this._visible&&0!==this._opacity){var r=e.matrices,s=e.viewMatrix,a=this._matrix,o=r[r.length-1].appended(a);if(o.isInvertible()){s=s?s.appended(o):o,r.push(o),e.updateMatrix&&(o._updateVersion=n,this._globalMatrix=o);var h,u,l,c=this._blendMode,f=this._opacity,d="normal"===c,_=tt.nativeModes[c],g=d&&1===f||e.dontStart||e.clip||(_||d&&f<1)&&this._canComposite(),v=e.pixelRatio||1;if(!g){var p=this.getStrokeBounds(s);if(!p.width||!p.height)return;l=e.offset,u=e.offset=p.getTopLeft().floor(),h=t,t=Q.getContext(p.getSize().ceil().add(1).multiply(v)),1!==v&&t.scale(v,v)}t.save();var m=i?i.appended(a):this._canScaleStroke&&!this.getStrokeScaling(!0)&&s,y=!g&&e.clipItem,w=!m||y;if(g?(t.globalAlpha=f,_&&(t.globalCompositeOperation=c)):w&&t.translate(-u.x,-u.y),w&&(g?a:s).applyToContext(t),y&&e.clipItem.draw(t,e.extend({clip:!0})),m){t.setTransform(v,0,0,v,0,0);var x=e.offset;x&&t.translate(-x.x,-x.y)}this._draw(t,e,s,m),t.restore(),r.pop(),e.clip&&!e.dontFinish&&t.clip(),g||(tt.process(c,t,h,f,u.subtract(l).multiply(v)),Q.release(t),e.offset=l)}}},_isUpdated:function(t){var e=this._parent;if(e instanceof N)return e._isUpdated(t);var i=this._updateVersion===t;return!i&&e&&e._visible&&e._isUpdated(t)&&(this._updateVersion=t,i=!0),i},_drawSelection:function(t,e,i,n,r){var s=this._selection,a=1&s,o=2&s||a&&this._selectBounds,h=4&s;if(this._drawSelected||(a=!1),(a||o||h)&&this._isUpdated(r)){var u,l=this.getSelectedColor(!0)||(u=this.getLayer())&&u.getSelectedColor(!0),c=e.appended(this.getGlobalMatrix(!0)),f=i/2;if(t.strokeStyle=t.fillStyle=l?l.toCanvasStyle(t):"#009dec",a&&this._drawSelected(t,c,n),h){var d=this.getPosition(!0),_=d.x,g=d.y;t.beginPath(),t.arc(_,g,f,0,2*Math.PI,!0),t.stroke();for(var v=[[0,-1],[1,0],[0,1],[-1,0]],p=f,m=i+1,y=0;y<4;y++){var w=v[y],x=w[0],b=w[1];t.moveTo(_+x*p,g+b*p),t.lineTo(_+x*m,g+b*m),t.stroke()}}if(o){var C=c._transformCorners(this.getInternalBounds());t.beginPath();for(y=0;y<8;y++)t[y?"lineTo":"moveTo"](C[y],C[++y]);t.closePath(),t.stroke();for(y=0;y<8;y++)t.fillRect(C[y]-f,C[++y]-f,i,i)}}},_canComposite:function(){return!1}},r.each(["down","drag","up","move"],function(t){this["removeOn"+r.capitalize(t)]=function(){var e={};return e[t]=!0,this.removeOn(e)}},{removeOn:function(t){for(var e in t)if(t[e]){var i="mouse"+e,n=this._project,r=n._removeSets=n._removeSets||{};r[i]=r[i]||{},r[i][this._id]=this}return this}})),x=w.extend({_class:"Group",_selectBounds:!1,_selectChildren:!0,_serializeFields:{children:[]},initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||this.addChildren(Array.isArray(t)?t:arguments)},_changed:function t(i){t.base.call(this,i),1026&i&&(this._clipItem=e)},_getClipItem:function(){var t=this._clipItem;if(t===e){t=null;for(var i=this._children,n=0,r=i.length;n<r;n++)if(i[n]._clipMask){t=i[n];break}this._clipItem=t}return t},isClipped:function(){return!!this._getClipItem()},setClipped:function(t){var e=this.getFirstChild();e&&e.setClipMask(t)},_getBounds:function t(e,i){var n=this._getClipItem();return n?n._getCachedBounds(e&&e.appended(n._matrix),r.set({},i,{stroke:!1})):t.base.call(this,e,i)},_hitTestChildren:function t(e,i,n){var r=this._getClipItem();return(!r||r.contains(e))&&t.base.call(this,e,i,n,r)},_draw:function(t,e){var i=e.clip,n=!i&&this._getClipItem();e=e.extend({clipItem:n,clip:!1}),i?(t.beginPath(),e.dontStart=e.dontFinish=!0):n&&n.draw(t,e.extend({clip:!0}));for(var r=this._children,s=0,a=r.length;s<a;s++){var o=r[s];o!==n&&o.draw(t,e)}}}),b=x.extend({_class:"Layer",initialize:function(){x.apply(this,arguments)},_getOwner:function(){return this._parent||null!=this._index&&this._project},isInserted:function t(){return this._parent?t.base.call(this):null!=this._index},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),C=w.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(t,e){this._initialize(t,e)},_equals:function(t){return this._type===t._type&&this._size.equals(t._size)&&r.equals(this._radius,t._radius)},copyContent:function(t){this.setType(t._type),this.setSize(t._size),this.setRadius(t._radius)},getType:function(){return this._type},setType:function(t){this._type=t},getShape:"#getType",setShape:"#setType",getSize:function(){var t=this._size;return new _(t.width,t.height,this,"setSize")},setSize:function(){var t=d.read(arguments);if(this._size){if(!this._size.equals(t)){var e=this._type,i=t.width,n=t.height;"rectangle"===e?this._radius.set(d.min(this._radius,t.divide(2))):"circle"===e?(i=n=(i+n)/2,this._radius=i/2):"ellipse"===e&&this._radius._set(i/2,n/2),this._size._set(i,n),this._changed(9)}}else this._size=t.clone()},getRadius:function(){var t=this._radius;return"circle"===this._type?t:new _(t.width,t.height,this,"setRadius")},setRadius:function(t){var e=this._type;if("circle"===e){if(t===this._radius)return;i=2*t;this._radius=t,this._size._set(i,i)}else if(t=d.read(arguments),this._radius){if(this._radius.equals(t))return;if(this._radius.set(t),"rectangle"===e){var i=d.max(this._size,t.multiply(2));this._size.set(i)}else"ellipse"===e&&this._size._set(2*t.width,2*t.height)}else this._radius=t.clone();this._changed(9)},isEmpty:function(){return!1},toPath:function(t){var i=new(L[r.capitalize(this._type)])({center:new c,size:this._size,radius:this._radius,insert:!1});return i.copyAttributes(this),paper.settings.applyMatrix&&i.setApplyMatrix(!0),(t===e||t)&&i.insertAbove(this),i},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(t,e,i,n){var r=this._style,s=r.hasFill(),a=r.hasStroke(),o=e.dontFinish||e.clip,h=!n;if(s||a||o){var u=this._type,l=this._radius,c="circle"===u;if(e.dontStart||t.beginPath(),h&&c)t.arc(0,0,l,0,2*Math.PI,!0);else{var f=c?l:l.width,d=c?l:l.height,_=this._size,g=_.width,v=_.height;if(h&&"rectangle"===u&&0===f&&0===d)t.rect(-g/2,-v/2,g,v);else{var p=g/2,m=v/2,y=.44771525016920644,w=f*y,x=d*y,b=[-p,-m+d,-p,-m+x,-p+w,-m,-p+f,-m,p-f,-m,p-w,-m,p,-m+x,p,-m+d,p,m-d,p,m-x,p-w,m,p-f,m,-p+f,m,-p+w,m,-p,m-x,-p,m-d];n&&n.transform(b,b,32),t.moveTo(b[0],b[1]),t.bezierCurveTo(b[2],b[3],b[4],b[5],b[6],b[7]),p!==f&&t.lineTo(b[8],b[9]),t.bezierCurveTo(b[10],b[11],b[12],b[13],b[14],b[15]),m!==d&&t.lineTo(b[16],b[17]),t.bezierCurveTo(b[18],b[19],b[20],b[21],b[22],b[23]),p!==f&&t.lineTo(b[24],b[25]),t.bezierCurveTo(b[26],b[27],b[28],b[29],b[30],b[31])}}t.closePath()}o||!s&&!a||(this._setStyles(t,e,i),s&&(t.fill(r.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),a&&t.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(t,e){var i=new g(this._size).setCenter(0,0),n=this._style,r=e.stroke&&n.hasStroke()&&n.getStrokeWidth();return t&&(i=t._transformBounds(i)),r?i.expand(L._getStrokePadding(r,this._getStrokeMatrix(t,e))):i}},new function(){function t(t,e,i){var n=t._radius;if(!n.isZero())for(var r=t._size.divide(2),s=1;s<=4;s++){var a=new c(s>1&&s<4?-1:1,s>2?-1:1),o=a.multiply(r),h=o.subtract(a.multiply(n));if(new g(i?o.add(a.multiply(i)):o,h).contains(e))return{point:h,quadrant:s}}}function e(t,e,i,n){var r=t.divide(e);return(!n||r.isInQuadrant(n))&&r.subtract(r.normalize()).multiply(e).divide(i).length<=1}return{_contains:function e(i){if("rectangle"===this._type){var n=t(this,i);return n?i.subtract(n.point).divide(this._radius).getLength()<=1:e.base.call(this,i)}return i.divide(this.size).getLength()<=.5},_hitTestSelf:function i(n,r,s,a){var o=!1,h=this._style,u=r.stroke&&h.hasStroke(),l=r.fill&&h.hasFill();if(u||l){var c=this._type,f=this._radius,d=u?h.getStrokeWidth()/2:0,_=r._tolerancePadding.add(L._getStrokePadding(d,!h.getStrokeScaling()&&a));if("rectangle"===c){var v=_.multiply(2),p=t(this,n,v);if(p)o=e(n.subtract(p.point),f,_,p.quadrant);else{var m=new g(this._size).setCenter(0,0),y=m.expand(v),w=m.expand(v.negate());o=y._containsPoint(n)&&!w._containsPoint(n)}}else o=e(n,f,_)}return o?new M(u?"stroke":"fill",this):i.base.apply(this,arguments)}}},{statics:new function(){function t(t,e,i,n,s){var a=new C(r.getNamed(s),e);return a._type=t,a._size=i,a._radius=n,a}return{Circle:function(){var e=c.readNamed(arguments,"center"),i=r.readNamed(arguments,"radius");return t("circle",e,new d(2*i),i,arguments)},Rectangle:function(){var e=g.readNamed(arguments,"rectangle"),i=d.min(d.readNamed(arguments,"radius"),e.getSize(!0).divide(2));return t("rectangle",e.getCenter(!0),e.getSize(!0),i,arguments)},Ellipse:function(){var e=C._readEllipse(arguments),i=e.radius;return t("ellipse",e.center,i.multiply(2),i,arguments)},_readEllipse:function(t){var e,i;if(r.hasNamed(t,"radius"))e=c.readNamed(t,"center"),i=d.readNamed(t,"radius");else{var n=g.readNamed(t,"rectangle");e=n.getCenter(!0),i=n.getSize(!0).divide(2)}return{center:e,radius:i}}}}}),S=w.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],initialize:function(t,i){if(!this._initialize(t,i!==e&&c.read(arguments,1))){var r="string"==typeof t?n.getElementById(t):t;r?this.setImage(r):this.setSource(t)}this._size||(this._size=new d,this._loaded=!1)},_equals:function(t){return this.getSource()===t.getSource()},copyContent:function(t){var e=t._image,i=t._canvas;if(e)this._setImage(e);else if(i){var n=Q.getCanvas(t._size);n.getContext("2d").drawImage(i,0,0),this._setImage(n)}this._crossOrigin=t._crossOrigin},getSize:function(){var t=this._size;return new _(t?t.width:0,t?t.height:0,this,"setSize")},setSize:function(){var t=d.read(arguments);if(!t.equals(this._size))if(t.width>0&&t.height>0){var e=this.getElement();this._setImage(Q.getCanvas(t)),e&&this.getContext(!0).drawImage(e,0,0,t.width,t.height)}else this._canvas&&Q.release(this._canvas),this._size=t.clone()},getWidth:function(){return this._size?this._size.width:0},setWidth:function(t){this.setSize(t,this.getHeight())},getHeight:function(){return this._size?this._size.height:0},setHeight:function(t){this.setSize(this.getWidth(),t)},getLoaded:function(){return this._loaded},isEmpty:function(){var t=this._size;return!t||0===t.width&&0===t.height},getResolution:function(){var t=this._matrix,e=new c(0,0).transform(t),i=new c(1,0).transform(t).subtract(e),n=new c(0,1).transform(t).subtract(e);return new d(72/i.getLength(),72/n.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(t){function e(t){var e=i.getView(),n=t&&t.type||"load";e&&i.responds(n)&&(paper=e._scope,i.emit(n,new G(t)))}var i=this;this._setImage(t),this._loaded?setTimeout(e,0):t&&Z.add(t,{load:function(n){i._setImage(t),e(n)},error:e})},_setImage:function(t){this._canvas&&Q.release(this._canvas),t&&t.getContext?(this._image=null,this._canvas=t,this._loaded=!0):(this._image=t,this._canvas=null,this._loaded=!!(t&&t.src&&t.complete)),this._size=new d(t?t.naturalWidth||t.width:0,t?t.naturalHeight||t.height:0),this._context=null,this._changed(521)},getCanvas:function(){if(!this._canvas){var t=Q.getContext(this._size);try{this._image&&t.drawImage(this._image,0,0),this._canvas=t.canvas}catch(e){Q.release(t)}}return this._canvas},setCanvas:"#setImage",getContext:function(t){return this._context||(this._context=this.getCanvas().getContext("2d")),t&&(this._image=null,this._changed(513)),this._context},setContext:function(t){this._context=t},getSource:function(){var t=this._image;return t&&t.src||this.toDataURL()},setSource:function(e){var i=new t.Image,n=this._crossOrigin;n&&(i.crossOrigin=n),i.src=e,this.setImage(i)},getCrossOrigin:function(){var t=this._image;return t&&t.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(t){this._crossOrigin=t;var e=this._image;e&&(e.crossOrigin=t)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var t=g.read(arguments),e=Q.getContext(t.getSize());return e.drawImage(this.getCanvas(),t.x,t.y,t.width,t.height,0,0,t.width,t.height),e.canvas},getSubRaster:function(){var t=g.read(arguments),e=new S(w.NO_INSERT);return e._setImage(this.getSubCanvas(t)),e.translate(t.getCenter().subtract(this.getSize().divide(2))),e._matrix.prepend(this._matrix),e.insertAbove(this),e},toDataURL:function(){var t=this._image,e=t&&t.src;if(/^data:/.test(e))return e;var i=this.getCanvas();return i?i.toDataURL.apply(i,arguments):null},drawImage:function(t){var e=c.read(arguments,1);this.getContext(!0).drawImage(t,e.x,e.y)},getAverageColor:function(t){var e,i;if(t?t instanceof A?(i=t,e=t.getBounds()):"object"==typeof t&&("width"in t?e=new g(t):"x"in t&&(e=new g(t.x-.5,t.y-.5,1,1))):e=this.getBounds(),!e)return null;var n=Math.min(e.width,32),s=Math.min(e.height,32),a=S._sampleContext;a?a.clearRect(0,0,33,33):a=S._sampleContext=Q.getContext(new d(32)),a.save();var o=(new p).scale(n/e.width,s/e.height).translate(-e.x,-e.y);o.applyToContext(a),i&&i.draw(a,new r({clip:!0,matrices:[o]})),this._matrix.applyToContext(a);var h=this.getElement(),u=this._size;h&&a.drawImage(h,-u.width/2,-u.height/2),a.restore();for(var l=a.getImageData(.5,.5,Math.ceil(n),Math.ceil(s)).data,c=[0,0,0],f=0,_=0,v=l.length;_<v;_+=4){var m=l[_+3];f+=m,m/=255,c[0]+=l[_]*m,c[1]+=l[_+1]*m,c[2]+=l[_+2]*m}for(_=0;_<3;_++)c[_]/=f;return f?F.read(c):null},getPixel:function(){var t=c.read(arguments),e=this.getContext().getImageData(t.x,t.y,1,1).data;return new F("rgb",[e[0]/255,e[1]/255,e[2]/255],e[3]/255)},setPixel:function(){var t=c.read(arguments),e=F.read(arguments),i=e._convert("rgb"),n=e._alpha,r=this.getContext(!0),s=r.createImageData(1,1),a=s.data;a[0]=255*i[0],a[1]=255*i[1],a[2]=255*i[2],a[3]=null!=n?255*n:255,r.putImageData(s,t.x,t.y)},createImageData:function(){var t=d.read(arguments);return this.getContext().createImageData(t.width,t.height)},getImageData:function(){var t=g.read(arguments);return t.isEmpty()&&(t=new g(this._size)),this.getContext().getImageData(t.x,t.y,t.width,t.height)},setImageData:function(t){var e=c.read(arguments,1);this.getContext(!0).putImageData(t,e.x,e.y)},_getBounds:function(t,e){var i=new g(this._size).setCenter(0,0);return t?t._transformBounds(i):i},_hitTestSelf:function(t){if(this._contains(t)){var e=this;return new M("pixel",e,{offset:t.add(e._size.divide(2)).round(),color:{get:function(){return e.getPixel(this.offset)}}})}},_draw:function(t){var e=this.getElement();e&&(t.globalAlpha=this._opacity,t.drawImage(e,-this._size.width/2,-this._size.height/2))},_canComposite:function(){return!0}}),P=w.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(t,i){this._initialize(t,i!==e&&c.read(arguments,1))||this.setDefinition(t instanceof I?t:new I(t))},_equals:function(t){return this._definition===t._definition},copyContent:function(t){this.setDefinition(t._definition)},getDefinition:function(){return this._definition},setDefinition:function(t){this._definition=t,this._changed(9)},getSymbol:"#getDefinition",setSymbol:"#setDefinition",isEmpty:function(){return this._definition._item.isEmpty()},_getBounds:function(t,e){var i=this._definition._item;return i._getCachedBounds(i._matrix.prepended(t),e)},_hitTestSelf:function(t,e,i){var n=this._definition._item._hitTest(t,e,i);return n&&(n.item=this),n},_draw:function(t,e){this._definition._item.draw(t,e)}}),I=r.extend({_class:"SymbolDefinition",initialize:function(t,e){this._id=l.get(),this.project=paper.project,t&&this.setItem(t,e)},_serialize:function(t,e){return e.add(this,function(){return r.serialize([this._class,this._item],t,!1,e)})},_changed:function(t){8&t&&w._clearBoundsCache(this),1&t&&this.project._changed(t)},getItem:function(){return this._item},setItem:function(t,e){t._symbol&&(t=t.clone()),this._item&&(this._item._symbol=null),this._item=t,t.remove(),t.setSelected(!1),e||t.setPosition(new c),t._symbol=this,this._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(t){return new P(this,t)},clone:function(){return new I(this._item.clone(!1))},equals:function(t){return t===this||t&&this._item.equals(t._item)||!1}}),M=r.extend({_class:"HitResult",initialize:function(t,e,i){this.type=t,this.item=e,i&&this.inject(i)},statics:{getOptions:function(t){var e=t&&r.read(t);return r.set({type:null,tolerance:paper.settings.hitTolerance,fill:!e,stroke:!e,segments:!e,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},e)}}}),T=r.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(t,i,n,r,s,a){var o,h,u,l,c=arguments.length;c>0&&(null==t||"object"==typeof t?1===c&&t&&"point"in t?(o=t.point,h=t.handleIn,u=t.handleOut,l=t.selection):(o=t,h=i,u=n,l=r):(o=[t,i],h=n!==e?[n,r]:null,u=s!==e?[s,a]:null)),new z(o,this,"_point"),new z(h,this,"_handleIn"),new z(u,this,"_handleOut"),l&&this.setSelection(l)},_serialize:function(t,e){var i=this._point,n=this._selection,s=n||this.hasHandles()?[i,this._handleIn,this._handleOut]:i;return n&&s.push(n),r.serialize(s,t,!0,e)},_changed:function(t){var e=this._path;if(e){var i,n=e._curves,r=this._index;n&&(t&&t!==this._point&&t!==this._handleIn||!(i=r>0?n[r-1]:e._closed?n[n.length-1]:null)||i._changed(),t&&t!==this._point&&t!==this._handleOut||!(i=n[r])||i._changed()),e._changed(25)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(c.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(c.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(c.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var t=this._handleIn,e=this._handleOut;return!t.isZero()&&!e.isZero()&&t.isCollinear(e)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(t){var e=this._selection,i=this._path;this._selection=t=t||0,i&&t!==e&&(i._updateSelection(this,e,t),i._changed(129))},_changeSelection:function(t,e){var i=this._selection;this.setSelection(e?i|t:i&~t)},isSelected:function(){return!!(7&this._selection)},setSelected:function(t){this._changeSelection(7,t)},getIndex:function(){return this._index!==e?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var t=this._path,e=this._index;return t?(e>0&&!t._closed&&e===t._segments.length-1&&e--,t.getCurves()[e]||null):null},getLocation:function(){var t=this.getCurve();return t?new O(t,this===t._segment1?0:1):null},getNext:function(){var t=this._path&&this._path._segments;return t&&(t[this._index+1]||this._path._closed&&t[0])||null},smooth:function(t,i,n){var r=t||{},s=r.type,a=r.factor,o=this.getPrevious(),h=this.getNext(),u=(o||this)._point,l=this._point,f=(h||this)._point,d=u.getDistance(l),_=l.getDistance(f);if(s&&"catmull-rom"!==s){if("geometric"!==s)throw new Error("Smoothing method '"+s+"' not supported.");if(o&&h){var g=u.subtract(f),v=a===e?.4:a,p=v*d/(d+_);i||this.setHandleIn(g.multiply(p)),n||this.setHandleOut(g.multiply(p-v))}}else{var m=a===e?.5:a,y=Math.pow(d,m),w=y*y,x=Math.pow(_,m),b=x*x;if(!i&&o){var C=2*b+3*x*y+w,S=3*x*(x+y);this.setHandleIn(0!==S?new c((b*u._x+C*l._x-w*f._x)/S-l._x,(b*u._y+C*l._y-w*f._y)/S-l._y):new c)}if(!n&&h){var C=2*w+3*y*x+b,S=3*y*(y+x);this.setHandleOut(0!==S?new c((w*f._x+C*l._x-b*u._x)/S-l._x,(w*f._y+C*l._y-b*u._y)/S-l._y):new c)}}},getPrevious:function(){var t=this._path&&this._path._segments;return t&&(t[this._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._index},isLast:function(){var t=this._path;return t&&this._index===t._segments.length-1||!1},reverse:function(){var t=this._handleIn,e=this._handleOut,i=t.clone();t.set(e),e.set(i)},reversed:function(){return new T(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new T(this._point,this._handleIn,this._handleOut)},equals:function(t){return t===this||t&&this._class===t._class&&this._point.equals(t._point)&&this._handleIn.equals(t._handleIn)&&this._handleOut.equals(t._handleOut)||!1},toString:function(){var t=["point: "+this._point];return this._handleIn.isZero()||t.push("handleIn: "+this._handleIn),this._handleOut.isZero()||t.push("handleOut: "+this._handleOut),"{ "+t.join(", ")+" }"},transform:function(t){this._transformCoordinates(t,new Array(6),!0),this._changed()},interpolate:function(t,e,i){var n=1-i,r=i,s=t._point,a=e._point,o=t._handleIn,h=e._handleIn,u=e._handleOut,l=t._handleOut;this._point._set(n*s._x+r*a._x,n*s._y+r*a._y,!0),this._handleIn._set(n*o._x+r*h._x,n*o._y+r*h._y,!0),this._handleOut._set(n*l._x+r*u._x,n*l._y+r*u._y,!0),this._changed()},_transformCoordinates:function(t,e,i){var n=this._point,r=i&&this._handleIn.isZero()?null:this._handleIn,s=i&&this._handleOut.isZero()?null:this._handleOut,a=n._x,o=n._y,h=2;return e[0]=a,e[1]=o,r&&(e[h++]=r._x+a,e[h++]=r._y+o),s&&(e[h++]=s._x+a,e[h++]=s._y+o),t&&(t._transformCoordinates(e,e,h/2),a=e[0],o=e[1],i?(n._x=a,n._y=o,h=2,r&&(r._x=e[h++]-a,r._y=e[h++]-o),s&&(s._x=e[h++]-a,s._y=e[h++]-o)):(r||(e[h++]=a,e[h++]=o),s||(e[h++]=a,e[h++]=o))),e}}),z=c.extend({initialize:function(t,i,n){var r,s,a;if(t)if((r=t[0])!==e)s=t[1];else{var o=t;(r=o.x)===e&&(r=(o=c.read(arguments)).x),s=o.y,a=o.selected}else r=s=0;this._x=r,this._y=s,this._owner=i,i[n]=this,a&&this.setSelected(!0)},_set:function(t,e){return this._x=t,this._y=e,this._owner._changed(this),this},getX:function(){return this._x},setX:function(t){this._x=t,this._owner._changed(this)},getY:function(){return this._y},setY:function(t){this._y=t,this._owner._changed(this)},isZero:function(){var t=u.isZero;return t(this._x)&&t(this._y)},isSelected:function(){return!!(this._owner._selection&this._getSelection())},setSelected:function(t){this._owner._changeSelection(this._getSelection(),t)},_getSelection:function(){var t=this._owner;return this===t._point?1:this===t._handleIn?2:this===t._handleOut?4:0}}),k=r.extend({_class:"Curve",beans:!0,initialize:function(t,e,i,n,r,s,a,o){var h,u,l,c,f,d,_=arguments.length;3===_?(this._path=t,h=e,u=i):_?1===_?"segment1"in t?(h=new T(t.segment1),u=new T(t.segment2)):"point1"in t?(l=t.point1,f=t.handle1,d=t.handle2,c=t.point2):Array.isArray(t)&&(l=[t[0],t[1]],c=[t[6],t[7]],f=[t[2]-t[0],t[3]-t[1]],d=[t[4]-t[6],t[5]-t[7]]):2===_?(h=new T(t),u=new T(e)):4===_?(l=t,f=e,d=i,c=n):8===_&&(l=[t,e],c=[a,o],f=[i-t,n-e],d=[r-a,s-o]):(h=new T,u=new T),this._segment1=h||new T(l,null,f),this._segment2=u||new T(c,d,null)},_serialize:function(t,e){return r.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],t,!0,e)},_changed:function(){this._length=this._bounds=e},clone:function(){return new k(this._segment1,this._segment2)},toString:function(){var t=["point1: "+this._segment1._point];return this._segment1._handleOut.isZero()||t.push("handle1: "+this._segment1._handleOut),this._segment2._handleIn.isZero()||t.push("handle2: "+this._segment2._handleIn),t.push("point2: "+this._segment2._point),"{ "+t.join(", ")+" }"},classify:function(){return k.classify(this.getValues())},remove:function(){var t=!1;if(this._path){var e=this._segment2,i=e._handleOut;(t=e.remove())&&this._segment1._handleOut.set(i)}return t},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(c.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(c.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(c.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(c.read(arguments))},getSegment1:function(){return this._segment1},getSegment2:function(){return this._segment2},getPath:function(){return this._path},getIndex:function(){return this._segment1._index},getNext:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index+1]||this._path._closed&&t[0])||null},getPrevious:function(){var t=this._path&&this._path._curves;return t&&(t[this._segment1._index-1]||this._path._closed&&t[t.length-1])||null},isFirst:function(){return!this._segment1._index},isLast:function(){var t=this._path;return t&&this._segment1._index===t._curves.length-1||!1},isSelected:function(){return this.getPoint1().isSelected()&&this.getHandle1().isSelected()&&this.getHandle2().isSelected()&&this.getPoint2().isSelected()},setSelected:function(t){this.getPoint1().setSelected(t),this.getHandle1().setSelected(t),this.getHandle2().setSelected(t),this.getPoint2().setSelected(t)},getValues:function(t){return k.getValues(this._segment1,this._segment2,t)},getPoints:function(){for(var t=this.getValues(),e=[],i=0;i<8;i+=2)e.push(new c(t[i],t[i+1]));return e}},{getLength:function(){return null==this._length&&(this._length=k.getLength(this.getValues(),0,1)),this._length},getArea:function(){return k.getArea(this.getValues())},getLine:function(){return new m(this._segment1._point,this._segment2._point)},getPart:function(t,e){return new k(k.getPart(this.getValues(),t,e))},getPartLength:function(t,e){return k.getLength(this.getValues(),t,e)},divideAt:function(t){return this.divideAtTime(t&&t.curve===this?t.time:this.getTimeAt(t))},divideAtTime:function(t,e){var i=null;if(t>=1e-8&&t<=1-1e-8){var n=k.subdivide(this.getValues(),t),r=n[0],s=n[1],a=e||this.hasHandles(),o=this._segment1,h=this._segment2,u=this._path;a&&(o._handleOut._set(r[2]-r[0],r[3]-r[1]),h._handleIn._set(s[4]-s[6],s[5]-s[7]));var l=r[6],f=r[7],d=new T(new c(l,f),a&&new c(r[4]-l,r[5]-f),a&&new c(s[2]-l,s[3]-f));u?(u.insert(o._index+1,d),i=this.getNext()):(this._segment2=d,this._changed(),i=new k(d,h))}return i},splitAt:function(t){var e=this._path;return e?e.splitAt(t):null},splitAtTime:function(t){return this.splitAt(this.getLocationAtTime(t))},divide:function(t,i){return this.divideAtTime(t===e?.5:i?t:this.getTimeAt(t))},split:function(t,i){return this.splitAtTime(t===e?.5:i?t:this.getTimeAt(t))},reversed:function(){return new k(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(t,e,i,n){var r=t._point,s=t._handleOut,a=e._handleIn,o=e._point,h=r.x,u=r.y,l=o.x,c=o.y,f=n?[h,u,h,u,l,c,l,c]:[h,u,h+s._x,u+s._y,l+a._x,c+a._y,l,c];return i&&i._transformCoordinates(f,f,4),f},subdivide:function(t,i){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],h=t[5],u=t[6],l=t[7];i===e&&(i=.5);var c=1-i,f=c*n+i*s,d=c*r+i*a,_=c*s+i*o,g=c*a+i*h,v=c*o+i*u,p=c*h+i*l,m=c*f+i*_,y=c*d+i*g,w=c*_+i*v,x=c*g+i*p,b=c*m+i*w,C=c*y+i*x;return[[n,r,f,d,m,y,b,C],[b,C,w,x,v,p,u,l]]},getMonoCurves:function(t,e){var i=[],n=e?0:1,r=t[n+0],s=t[n+2],a=t[n+4],o=t[n+6];if(r>=s==s>=a&&s>=a==a>=o||k.isStraight(t))i.push(t);else{var h=3*(s-a)-r+o,l=2*(r+a)-4*s,c=s-r,f=[],d=u.solveQuadratic(h,l,c,f,1e-8,1-1e-8);if(d){f.sort();var _=f[0],g=k.subdivide(t,_);i.push(g[0]),d>1&&(_=(f[1]-_)/(1-_),g=k.subdivide(g[1],_),i.push(g[0])),i.push(g[1])}else i.push(t)}return i},solveCubic:function(t,e,i,n,r,s){var a=t[e],o=t[e+2],h=t[e+4],l=t[e+6],c=0;if(!(a<i&&l<i&&o<i&&h<i||a>i&&l>i&&o>i&&h>i)){var f=3*(o-a),d=3*(h-o)-f,_=l-a-f-d;c=u.solveCubic(_,d,f,a-i,n,r,s)}return c},getTimeOf:function(t,e){var i=new c(t[0],t[1]),n=new c(t[6],t[7]);if(null===(e.isClose(i,1e-12)?0:e.isClose(n,1e-12)?1:null))for(var r=[e.x,e.y],s=[],a=0;a<2;a++)for(var o=k.solveCubic(t,a,r[a],s,0,1),h=0;h<o;h++){var u=s[h];if(e.isClose(k.getPoint(t,u),1e-7))return u}return e.isClose(i,1e-7)?0:e.isClose(n,1e-7)?1:null},getNearestTime:function(t,e){function i(i){if(i>=0&&i<=1){var n=e.getDistance(k.getPoint(t,i),!0);if(n<u)return u=n,l=i,!0}}if(k.isStraight(t)){var n=t[0],r=t[1],s=t[6]-n,a=t[7]-r,o=s*s+a*a;if(0===o)return 0;var h=((e.x-n)*s+(e.y-r)*a)/o;return h<1e-12?0:h>.999999999999?1:k.getTimeOf(t,new c(n+h*s,r+h*a))}for(var u=1/0,l=0,f=0;f<=100;f++)i(f/100);for(var d=.005;d>1e-8;)i(l-d)||i(l+d)||(d/=2);return l},getPart:function(t,e,i){var n=e>i;if(n){var r=e;e=i,i=r}return e>0&&(t=k.subdivide(t,e)[1]),i<1&&(t=k.subdivide(t,(i-e)/(1-e))[0]),n?[t[6],t[7],t[4],t[5],t[2],t[3],t[0],t[1]]:t},isFlatEnough:function(t,e){var i=t[0],n=t[1],r=t[2],s=t[3],a=t[4],o=t[5],h=t[6],u=t[7],l=3*r-2*i-h,c=3*s-2*n-u,f=3*a-2*h-i,d=3*o-2*u-n;return Math.max(l*l,f*f)+Math.max(c*c,d*d)<=16*e*e},getArea:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7];return 3*((h-i)*(n+s)-(o-e)*(r+a)+r*(e-s)-n*(i-a)+h*(s+e/3)-o*(a+i/3))/20},getBounds:function(t){for(var e=t.slice(0,2),i=e.slice(),n=[0,0],r=0;r<2;r++)k._addBounds(t[r],t[r+2],t[r+4],t[r+6],r,0,e,i,n);return new g(e[0],e[1],i[0]-e[0],i[1]-e[1])},_addBounds:function(t,e,i,n,r,s,a,o,h){function l(t,e){var i=t-e,n=t+e;i<a[r]&&(a[r]=i),n>o[r]&&(o[r]=n)}s/=2;var c=a[r]-s,f=o[r]+s;if(t<c||e<c||i<c||n<c||t>f||e>f||i>f||n>f)if(e<t!=e<n&&i<t!=i<n)l(t,s),l(n,s);else{var d=3*(e-i)-t+n,_=2*(t+i)-4*e,g=e-t,v=u.solveQuadratic(d,_,g,h);l(n,0);for(var p=0;p<v;p++){var m=h[p],y=1-m;1e-8<=m&&m<=1-1e-8&&l(y*y*y*t+3*y*y*m*e+3*y*m*m*i+m*m*m*n,s)}}}}},r.each(["getBounds","getStrokeBounds","getHandleBounds"],function(t){this[t]=function(){this._bounds||(this._bounds={});var e=this._bounds[t];return e||(e=this._bounds[t]=L[t]([this._segment1,this._segment2],!1,this._path)),e.clone()}},{}),r.each({isStraight:function(t,e,i,n){if(e.isZero()&&i.isZero())return!0;var r=n.subtract(t);if(r.isZero())return!1;if(r.isCollinear(e)&&r.isCollinear(i)){var s=new m(t,n);if(s.getDistance(t.add(e))<1e-7&&s.getDistance(n.add(i))<1e-7){var a=r.dot(r),o=r.dot(e)/a,h=r.dot(i)/a;return o>=0&&o<=1&&h<=0&&h>=-1}}return!1},isLinear:function(t,e,i,n){var r=n.subtract(t).divide(3);return e.equals(r)&&i.negate().equals(r)}},function(t,e){this[e]=function(e){var i=this._segment1,n=this._segment2;return t(i._point,i._handleOut,n._handleIn,n._point,e)},this.statics[e]=function(e,i){var n=e[0],r=e[1],s=e[6],a=e[7];return t(new c(n,r),new c(e[2]-n,e[3]-r),new c(e[4]-s,e[5]-a),new c(s,a),i)}},{statics:{},hasHandles:function(){return!this._segment1._handleOut.isZero()||!this._segment2._handleIn.isZero()},hasLength:function(t){return(!this.getPoint1().equals(this.getPoint2())||this.hasHandles())&&this.getLength()>(t||0)},isCollinear:function(t){return t&&this.isStraight()&&t.isStraight()&&this.getLine().isCollinear(t.getLine())},isHorizontal:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).y)<1e-8},isVertical:function(){return this.isStraight()&&Math.abs(this.getTangentAtTime(.5).x)<1e-8}}),{beans:!1,getLocationAt:function(t,e){return this.getLocationAtTime(e?t:this.getTimeAt(t))},getLocationAtTime:function(t){return null!=t&&t>=0&&t<=1?new O(this,t):null},getTimeAt:function(t,e){return k.getTimeAt(this.getValues(),t,e)},getParameterAt:"#getTimeAt",getOffsetAtTime:function(t){return this.getPartLength(0,t)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(c.read(arguments)))},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getTimeOf:function(){return k.getTimeOf(this.getValues(),c.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var t=c.read(arguments),e=this.getValues(),i=k.getNearestTime(e,t),n=k.getPoint(e,i);return new O(this,i,n,null,t.getDistance(n))},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t?t.getPoint():t}},new function(){var t=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return r.each(t,function(t){this[t+"At"]=function(e,i){var n=this.getValues();return k[t](n,i?e:k.getTimeAt(n,e))},this[t+"AtTime"]=function(e){return k[t](this.getValues(),e)}},{statics:{_evaluateMethods:t}})},new function(){function t(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=9*(n-s)+3*(t[6]-e),h=6*(e+s)-12*n,u=3*(n-e),l=9*(r-a)+3*(t[7]-i),c=6*(i+a)-12*r,f=3*(r-i);return function(t){var e=(o*t+h)*t+u,i=(l*t+c)*t+f;return Math.sqrt(e*e+i*i)}}function i(t,e){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(e-t))))}function n(t,e,i,n){if(null==e||e<0||e>1)return null;var r=t[0],s=t[1],a=t[2],o=t[3],h=t[4],l=t[5],f=t[6],d=t[7],_=u.isZero;_(a-r)&&_(o-s)&&(a=r,o=s),_(h-f)&&_(l-d)&&(h=f,l=d);var g,v,p=3*(a-r),m=3*(h-a)-p,y=f-r-p-m,w=3*(o-s),x=3*(l-o)-w,b=d-s-w-x;if(0===i)g=0===e?r:1===e?f:((y*e+m)*e+p)*e+r,v=0===e?s:1===e?d:((b*e+x)*e+w)*e+s;else{if(e<1e-8?(g=p,v=w):e>1-1e-8?(g=3*(f-h),v=3*(d-l)):(g=(3*y*e+2*m)*e+p,v=(3*b*e+2*x)*e+w),n){0===g&&0===v&&(e<1e-8||e>1-1e-8)&&(g=h-a,v=l-o);var C=Math.sqrt(g*g+v*v);C&&(g/=C,v/=C)}if(3===i){var h=6*y*e+2*m,l=6*b*e+2*x,S=Math.pow(g*g+v*v,1.5);g=0!==S?(g*l-v*h)/S:0,v=0}}return 2===i?new c(v,-g):new c(g,v)}return{statics:{classify:function(t){function i(t,i,n){var r=i!==e,s=r&&i>0&&i<1,a=r&&n>0&&n<1;return!r||(s||a)&&("loop"!==t||s&&a)||(t="arch",s=a=!1),{type:t,roots:s||a?s&&a?i<n?[i,n]:[n,i]:[s?i:n]:null}}var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],h=t[5],l=t[6],c=t[7],f=s*(r-c)+a*(l-n)+n*c-r*l,d=3*(o*(a-r)+h*(n-s)+s*r-a*n),_=d-f,g=_-f+(n*(c-h)+r*(o-l)+l*h-c*o),v=Math.sqrt(g*g+_*_+d*d),p=0!==v?1/v:0,m=u.isZero;if(g*=p,_*=p,d*=p,m(g))return m(_)?i(m(d)?"line":"quadratic"):i("serpentine",d/(3*_));var y=3*_*_-4*g*d;if(m(y))return i("cusp",_/(2*g));var w=y>0?Math.sqrt(y/3):Math.sqrt(-y),x=2*g;return i(y>0?"serpentine":"loop",(_+w)/x,(_-w)/x)},getLength:function(n,r,s,a){if(r===e&&(r=0),s===e&&(s=1),k.isStraight(n)){var o=n;s<1&&(o=k.subdivide(o,s)[0],r/=s),r>0&&(o=k.subdivide(o,r)[1]);var h=o[6]-o[0],l=o[7]-o[1];return Math.sqrt(h*h+l*l)}return u.integrate(a||t(n),r,s,i(r,s))},getTimeAt:function(n,r,s){if(s===e&&(s=r<0?1:0),0===r)return s;var a=Math.abs,o=r>0,h=o?s:0,l=o?1:s,c=t(n),f=k.getLength(n,h,l,c),d=a(r)-f;if(a(d)<1e-12)return o?l:h;if(d>1e-12)return null;var _=r/f,g=0;return u.findRoot(function(t){return g+=u.integrate(c,s,t,i(s,t)),s=t,g-r},c,s+_,h,l,32,1e-12)},getPoint:function(t,e){return n(t,e,0,!1)},getTangent:function(t,e){return n(t,e,1,!0)},getWeightedTangent:function(t,e){return n(t,e,1,!1)},getNormal:function(t,e){return n(t,e,2,!0)},getWeightedNormal:function(t,e){return n(t,e,2,!1)},getCurvature:function(t,e){return n(t,e,3,!1).x},getPeaks:function(t){var e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=3*n-e-3*s+t[6],h=3*e-6*n+3*s,l=-3*e+3*n,c=3*r-i-3*a+t[7],f=3*i-6*r+3*a,d=-3*i+3*r,_=[];return u.solveCubic(9*(o*o+c*c),9*(o*h+f*c),2*(h*h+f*f)+3*(l*o+d*c),l*h+f*d,_,1e-8,1-1e-8),_.sort()}}}},new function(){function t(t,e,i,n,r,s,a){var o=!a&&i.getPrevious()===r,h=!a&&i!==r&&i.getNext()===r;if(null!==n&&n>=(o?1e-8:0)&&n<=(h?1-1e-8:1)&&null!==s&&s>=(h?1e-8:0)&&s<=(o?1-1e-8:1)){var u=new O(i,n,null,a),l=new O(r,s,null,a);u._intersection=l,l._intersection=u,e&&!e(u)||O.insert(t,u,!0)}}function e(r,s,a,o,h,u,l,c,f,d,_,g,v){if(++f>=4096||++c>=40)return f;var p,y,w=s[0],x=s[1],b=s[6],C=s[7],S=m.getSignedDistance,P=S(w,x,b,C,s[2],s[3]),I=S(w,x,b,C,s[4],s[5]),M=P*I>0?.75:4/9,T=M*Math.min(0,P,I),z=M*Math.max(0,P,I),O=S(w,x,b,C,r[0],r[1]),A=S(w,x,b,C,r[2],r[3]),L=S(w,x,b,C,r[4],r[5]),N=S(w,x,b,C,r[6],r[7]),B=i(O,A,L,N),D=B[0],j=B[1];if(0===P&&0===I&&0===O&&0===A&&0===L&&0===N||null==(p=n(D,j,T,z))||null==(y=n(D.reverse(),j.reverse(),T,z)))return f;var E=d+(_-d)*p,F=d+(_-d)*y;if(Math.max(v-g,F-E)<1e-9){var R=(E+F)/2,q=(g+v)/2;t(h,u,l?o:a,l?q:R,l?a:o,l?R:q)}else if(r=k.getPart(r,p,y),y-p>.8)if(F-E>v-g){R=(E+F)/2;f=e(s,(V=k.subdivide(r,.5))[0],o,a,h,u,!l,c,f,g,v,E,R),f=e(s,V[1],o,a,h,u,!l,c,f,g,v,R,F)}else{var V=k.subdivide(s,.5),q=(g+v)/2;f=e(V[0],r,o,a,h,u,!l,c,f,g,q,E,F),f=e(V[1],r,o,a,h,u,!l,c,f,q,v,E,F)}else f=v-g>=1e-9?e(s,r,o,a,h,u,!l,c,f,g,v,E,F):e(r,s,a,o,h,u,l,c,f,E,F,g,v);return f}function i(t,e,i,n){var r,s=[0,t],a=[1/3,e],o=[2/3,i],h=[1,n],u=e-(2*t+n)/3,l=i-(t+2*n)/3;if(u*l<0)r=[[s,a,h],[s,o,h]];else{var c=u/l;r=[c>=2?[s,a,h]:c<=.5?[s,o,h]:[s,a,o,h],[s,h]]}return(u||l)<0?r.reverse():r}function n(t,e,i,n){return t[0][1]<i?r(t,!0,i):e[0][1]>n?r(e,!1,n):t[0][0]}function r(t,e,i){for(var n=t[0][0],r=t[0][1],s=1,a=t.length;s<a;s++){var o=t[s][0],h=t[s][1];if(e?h>=i:h<=i)return h===i?o:n+(i-r)*(o-n)/(h-r);n=o,r=h}return null}function s(t,e,i,n,r){var s=u.isZero;if(s(n)&&s(r)){var a=k.getTimeOf(t,new c(e,i));return null===a?[]:[a]}for(var o=Math.atan2(-r,n),h=Math.sin(o),l=Math.cos(o),f=[],d=[],_=0;_<8;_+=2){var g=t[_]-e,v=t[_+1]-i;f.push(g*l-v*h,g*h+v*l)}return k.solveCubic(f,1,0,d,0,1),d}function a(e,i,n,r,a,o,h){for(var u=i[0],l=i[1],c=s(e,u,l,i[6]-u,i[7]-l),f=0,d=c.length;f<d;f++){var _=c[f],g=k.getPoint(e,_),v=k.getTimeOf(i,g);null!==v&&t(a,o,h?r:n,h?v:_,h?n:r,h?_:v)}}function o(e,i,n,r,s,a){var o=m.intersect(e[0],e[1],e[6],e[7],i[0],i[1],i[6],i[7]);o&&t(s,a,n,k.getTimeOf(e,o),r,k.getTimeOf(i,o))}function h(i,n,r,s,h,u){var l=Math.min,d=Math.max;if(d(i[0],i[2],i[4],i[6])+1e-12>l(n[0],n[2],n[4],n[6])&&l(i[0],i[2],i[4],i[6])-1e-12<d(n[0],n[2],n[4],n[6])&&d(i[1],i[3],i[5],i[7])+1e-12>l(n[1],n[3],n[5],n[7])&&l(i[1],i[3],i[5],i[7])-1e-12<d(n[1],n[3],n[5],n[7])){var _=f(i,n);if(_)for(x=0;x<2;x++){var g=_[x];t(h,u,r,g[0],s,g[1],!0)}else{var v=k.isStraight(i),p=k.isStraight(n),m=v&&p,y=v&&!p,w=h.length;if((m?o:v||p?a:e)(y?n:i,y?i:n,y?s:r,y?r:s,h,u,y,0,0,0,1,0,1),!m||h.length===w)for(var x=0;x<4;x++){var b=x>>1,C=1&x,S=6*b,P=6*C,I=new c(i[S],i[S+1]),M=new c(n[P],n[P+1]);I.isClose(M,1e-12)&&t(h,u,r,b,s,C)}}}return h}function l(e,i,n,r){var s=k.classify(e);if("loop"===s.type){var a=s.roots;t(n,r,i,a[0],i,a[1])}return n}function f(t,e){function i(t){var e=t[6]-t[0],i=t[7]-t[1];return e*e+i*i}var n=Math.abs,r=m.getDistance,s=k.isStraight(t),a=k.isStraight(e),o=s&&a,h=i(t)<i(e),u=h?e:t,l=h?t:e,f=u[0],d=u[1],_=u[6]-f,g=u[7]-d;if(r(f,d,_,g,l[0],l[1],!0)<1e-7&&r(f,d,_,g,l[6],l[7],!0)<1e-7)!o&&r(f,d,_,g,u[2],u[3],!0)<1e-7&&r(f,d,_,g,u[4],u[5],!0)<1e-7&&r(f,d,_,g,l[2],l[3],!0)<1e-7&&r(f,d,_,g,l[4],l[5],!0)<1e-7&&(s=a=o=!0);else if(o)return null;if(s^a)return null;for(var v=[t,e],p=[],y=0;y<4&&p.length<2;y++){var w=1&y,x=1^w,b=y>>1,C=k.getTimeOf(v[w],new c(v[x][b?6:0],v[x][b?7:1]));if(null!=C){var S=w?[b,C]:[C,b];(!p.length||n(S[0]-p[0][0])>1e-8&&n(S[1]-p[0][1])>1e-8)&&p.push(S)}if(y>2&&!p.length)break}if(2!==p.length)p=null;else if(!o){var P=k.getPart(t,p[0][0],p[1][0]),I=k.getPart(e,p[0][1],p[1][1]);(n(I[2]-P[2])>1e-7||n(I[3]-P[3])>1e-7||n(I[4]-P[4])>1e-7||n(I[5]-P[5])>1e-7)&&(p=null)}return p}return{getIntersections:function(t){var e=this.getValues(),i=t&&t!==this&&t.getValues();return i?h(e,i,this,t,[]):l(e,this,[])},statics:{getOverlaps:f,getIntersections:function(t,e,i,n,r,s){var a=!e;a&&(e=t);for(var o,u,c=t.length,f=e.length,d=[],_=[],g=0;g<f;g++)d[g]=e[g].getValues(r);for(g=0;g<c;g++){var v=t[g],p=a?d[g]:v.getValues(n),m=v.getPath();m!==u&&(u=m,o=[],_.push(o)),a&&l(p,v,o,i);for(var y=a?g+1:0;y<f;y++){if(s&&o.length)return o;h(p,d[y],v,e[y],o,i)}}o=[];for(var g=0,w=_.length;g<w;g++)o.push.apply(o,_[g]);return o},getCurveLineIntersections:s}}}),O=r.extend({_class:"CurveLocation",initialize:function(t,e,i,n,r){if(e>=.99999999){var s=t.getNext();s&&(e=0,t=s)}this._setCurve(t),this._time=e,this._point=i||t.getPointAtTime(e),this._overlap=n,this._distance=r,this._intersection=this._next=this._previous=null},_setCurve:function(t){var e=t._path;this._path=e,this._version=e?e._version:0,this._curve=t,this._segment=null,this._segment1=t._segment1,this._segment2=t._segment2},_setSegment:function(t){this._setCurve(t.getCurve()),this._segment=t,this._time=t===this._segment1?0:1,this._point=t._point.clone()},getSegment:function(){var t=this._segment;if(!t){var e=this.getCurve(),i=this.getTime();0===i?t=e._segment1:1===i?t=e._segment2:null!=i&&(t=e.getPartLength(0,i)<e.getPartLength(i,1)?e._segment1:e._segment2),this._segment=t}return t},getCurve:function(){function t(t){var e=t&&t.getCurve();if(e&&null!=(i._time=e.getTimeOf(i._point)))return i._setCurve(e),e}var e=this._path,i=this;return e&&e._version!==this._version&&(this._time=this._offset=this._curveOffset=this._curve=null),this._curve||t(this._segment)||t(this._segment1)||t(this._segment2.getPrevious())},getPath:function(){var t=this.getCurve();return t&&t._path},getIndex:function(){var t=this.getCurve();return t&&t.getIndex()},getTime:function(){var t=this.getCurve(),e=this._time;return t&&null==e?this._time=t.getTimeOf(this._point):e},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){var t=this._offset;if(null==t){t=0;var e=this.getPath(),i=this.getIndex();if(e&&null!=i)for(var n=e.getCurves(),r=0;r<i;r++)t+=n[r].getLength();this._offset=t+=this.getCurveOffset()}return t},getCurveOffset:function(){var t=this._curveOffset;if(null==t){var e=this.getCurve(),i=this.getTime();this._curveOffset=t=null!=i&&e&&e.getPartLength(0,i)}return t},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var t=this.getCurve(),e=t&&t.divideAtTime(this.getTime());return e&&this._setSegment(e._segment1),e},split:function(){var t=this.getCurve(),e=t._path,i=t&&t.splitAtTime(this.getTime());return i&&this._setSegment(e.getLastSegment()),i},equals:function(t,e){var i=this===t;if(!i&&t instanceof O){var n=this.getCurve(),r=t.getCurve(),s=n._path;if(s===r._path){var a=Math.abs,o=a(this.getOffset()-t.getOffset()),h=!e&&this._intersection,u=!e&&t._intersection;i=(o<1e-7||s&&a(s.getLength()-o)<1e-7)&&(!h&&!u||h&&u&&h.equals(u,!0))}}return i},toString:function(){var t=[],e=this.getPoint(),i=h.instance;e&&t.push("point: "+e);var n=this.getIndex();null!=n&&t.push("index: "+n);var r=this.getTime();return null!=r&&t.push("time: "+i.number(r)),null!=this._distance&&t.push("distance: "+i.number(this._distance)),"{ "+t.join(", ")+" }"},isTouching:function(){var t=this._intersection;if(t&&this.getTangent().isCollinear(t.getTangent())){var e=this.getCurve(),i=t.getCurve();return!(e.isStraight()&&i.isStraight()&&e.getLine().intersect(i.getLine()))}return!1},isCrossing:function(){function t(t,e){var i=t.getValues(),n=k.classify(i).roots||k.getPeaks(i),r=n.length,s=e&&r>1?n[r-1]:r>0?n[0]:.5;c.push(k.getLength(i,e?s:0,e?1:s)/2)}function e(t,e,i){return e<i?t>e&&t<i:t>e||t<i}var i=this._intersection;if(!i)return!1;var n=this.getTime(),r=i.getTime(),s=n>=1e-8&&n<=1-1e-8,a=r>=1e-8&&r<=1-1e-8;if(s&&a)return!this.isTouching();var o=this.getCurve(),h=n<1e-8?o.getPrevious():o,u=i.getCurve(),l=r<1e-8?u.getPrevious():u;if(n>1-1e-8&&(o=o.getNext()),r>1-1e-8&&(u=u.getNext()),!(h&&o&&l&&u))return!1;var c=[];s||(t(h,!0),t(o,!1)),a||(t(l,!0),t(u,!1));var f=this.getPoint(),d=Math.min.apply(Math,c),_=s?o.getTangentAtTime(n):o.getPointAt(d).subtract(f),g=s?_.negate():h.getPointAt(-d).subtract(f),v=a?u.getTangentAtTime(r):u.getPointAt(d).subtract(f),p=a?v.negate():l.getPointAt(-d).subtract(f),m=g.getAngle(),y=_.getAngle(),w=p.getAngle(),x=v.getAngle();return!!(s?e(m,w,x)^e(y,w,x)&&e(m,x,w)^e(y,x,w):e(w,m,y)^e(x,m,y)&&e(w,y,m)^e(x,y,m))},hasOverlap:function(){return!!this._overlap}},r.each(k._evaluateMethods,function(t){var e=t+"At";this[t]=function(){var t=this.getCurve(),i=this.getTime();return null!=i&&t&&t[e](i,!0)}},{preserve:!0}),new function(){function t(t,e,i){function n(i,n){for(var s=i+n;s>=-1&&s<=r;s+=n){var a=t[(s%r+r)%r];if(!e.getPoint().isClose(a.getPoint(),1e-7))break;if(e.equals(a))return a}return null}for(var r=t.length,s=0,a=r-1;s<=a;){var o,h=s+a>>>1,u=t[h];if(i&&(o=e.equals(u)?u:n(h,-1)||n(h,1)))return e._overlap&&(o._overlap=o._intersection._overlap=!0),o;var l=e.getPath(),c=u.getPath();(l!==c?l._id-c._id:e.getIndex()+e.getTime()-(u.getIndex()+u.getTime()))<0?a=h-1:s=h+1}return t.splice(s,0,e),e}return{statics:{insert:t,expand:function(e){for(var i=e.slice(),n=e.length-1;n>=0;n--)t(i,e[n]._intersection,!1);return i}}}}),A=w.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var e,i,n;if(r.isPlainObject(t)?(i=t.segments,e=t.pathData):Array.isArray(t)?i=t:"string"==typeof t&&(e=t),i){var s=i[0];n=s&&Array.isArray(s[0])}else e&&(n=(e.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(e));return new(n?N:L)(t)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){function e(t,e){var i=+n[t];return o&&(i+=h[e]),i}function i(t){return new c(e(t,"x"),e(t+1,"y"))}var n,r,s,a=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),o=!1,h=new c,u=new c;this.clear();for(var l=0,f=a&&a.length;l<f;l++){var _=a[l],g=_[0],v=g.toLowerCase(),p=(n=_.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))&&n.length;switch(o=g===v,"z"!==r||/[mz]/.test(v)||this.moveTo(h),v){case"m":case"l":for(var m="m"===v,y=0;y<p;y+=2)this[m?"moveTo":"lineTo"](h=i(y)),m&&(u=h,m=!1);s=h;break;case"h":case"v":var w="h"===v?"x":"y";h=h.clone();for(y=0;y<p;y++)h[w]=e(y,w),this.lineTo(h);s=h;break;case"c":for(y=0;y<p;y+=6)this.cubicCurveTo(i(y),s=i(y+2),h=i(y+4));break;case"s":for(y=0;y<p;y+=4)this.cubicCurveTo(/[cs]/.test(r)?h.multiply(2).subtract(s):h,s=i(y),h=i(y+2)),r=v;break;case"q":for(y=0;y<p;y+=4)this.quadraticCurveTo(s=i(y),h=i(y+2));break;case"t":for(y=0;y<p;y+=2)this.quadraticCurveTo(s=/[qt]/.test(r)?h.multiply(2).subtract(s):h,h=i(y)),r=v;break;case"a":for(y=0;y<p;y+=7)this.arcTo(h=i(y+5),new d(+n[y],+n[y+1]),+n[y+2],+n[y+4],+n[y+3]);break;case"z":this.closePath(1e-12),h=u}r=v}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(t){var e=t.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(t):{};return e.onPath||!!("evenodd"===this.getFillRule()?1&e.windingL||1&e.windingR:e.winding)},getIntersections:function(t,e,i,n){var r=this===t||!t,s=this._matrix._orNullIfIdentity(),a=r?s:(i||t._matrix)._orNullIfIdentity();return r||this.getBounds(s).intersects(t.getBounds(a),1e-12)?k.getIntersections(this.getCurves(),!r&&t.getCurves(),e,s,a,n):[]},getCrossings:function(t){return this.getIntersections(t,function(t){return t.hasOverlap()||t.isCrossing()})},getNearestLocation:function(){for(var t=c.read(arguments),e=this.getCurves(),i=1/0,n=null,r=0,s=e.length;r<s;r++){var a=e[r].getNearestLocation(t);a._distance<i&&(i=a._distance,n=a)}return n},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t?t.getPoint():t},interpolate:function(t,e,i){var n=!this._children,r=n?"_segments":"_children",s=t[r],a=e[r],o=this[r];if(!s||!a||s.length!==a.length)throw new Error("Invalid operands in interpolate() call: "+t+", "+e);var h=o.length,u=a.length;if(h<u)for(var l=n?T:L,c=h;c<u;c++)this.add(new l);else h>u&&this[n?"removeSegments":"removeChildren"](u,h);for(c=0;c<u;c++)o[c].interpolate(s[c],a[c],i);n&&(this.setClosed(t._closed),this._changed(9))},compare:function(t){var e=!1;if(t){var i=this._children||[this],n=t._children?t._children.slice():[t],r=i.length,s=n.length,a=[],o=0;e=!0;for(var h=r-1;h>=0&&e;h--){var u=i[h];e=!1;for(var l=s-1;l>=0&&!e;l--)u.compare(n[l])&&(a[l]||(a[l]=!0,o++),e=!0)}e=e&&o===s}return e}}),L=A.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(t){this._closed=!1,this._segments=[],this._version=0;var i=Array.isArray(t)?"object"==typeof t[0]?t:arguments:!t||t.size!==e||t.x===e&&t.point===e?null:arguments;i&&i.length>0?this.setSegments(i):(this._curves=e,this._segmentSelection=0,i||"string"!=typeof t||(this.setPathData(t),t=null)),this._initialize(!i&&t)},_equals:function(t){return this._closed===t._closed&&r.equals(this._segments,t._segments)},copyContent:function(t){this.setSegments(t._segments),this._closed=t._closed},_changed:function t(i){if(t.base.call(this,i),8&i){if(this._length=this._area=e,16&i)this._version++;else if(this._curves)for(var n=0,r=this._curves.length;n<r;n++)this._curves[n]._changed()}else 32&i&&(this._bounds=e)},getStyle:function(){var t=this._parent;return(t instanceof N?t:this)._style},getSegments:function(){return this._segments},setSegments:function(t){var i=this.isFullySelected(),n=t&&t.length;if(this._segments.length=0,this._segmentSelection=0,this._curves=e,n){var r=t[n-1];"boolean"==typeof r&&(this.setClosed(r),n--),this._add(T.readList(t,0,{},n))}i&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var t=this._curves,e=this._segments;if(!t){var i=this._countCurves();t=this._curves=new Array(i);for(var n=0;n<i;n++)t[n]=new k(this,e[n],e[n+1]||e[0])}return t},getFirstCurve:function(){return this.getCurves()[0]},getLastCurve:function(){var t=this.getCurves();return t[t.length-1]},isClosed:function(){return this._closed},setClosed:function(t){if(this._closed!=(t=!!t)){if(this._closed=t,this._curves){var e=this._curves.length=this._countCurves();t&&(this._curves[e-1]=new k(this,this._segments[e-1],this._segments[0]))}this._changed(25)}}},{beans:!0,getPathData:function(t,e){function i(e,i){if(e._transformCoordinates(t,g),n=g[0],r=g[1],v)p.push("M"+_.pair(n,r)),v=!1;else if(o=g[2],u=g[3],o===n&&u===r&&l===s&&c===a){if(!i){var h=n-s,f=r-a;p.push(0===h?"v"+_.number(f):0===f?"h"+_.number(h):"l"+_.pair(h,f))}}else p.push("c"+_.pair(l-s,c-a)+" "+_.pair(o-s,u-a)+" "+_.pair(n-s,r-a));s=n,a=r,l=g[4],c=g[5]}var n,r,s,a,o,u,l,c,f=this._segments,d=f.length,_=new h(e),g=new Array(6),v=!0,p=[];if(!d)return"";for(var m=0;m<d;m++)i(f[m]);return this._closed&&d>0&&(i(f[0],!0),p.push("z")),p.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(t){for(var e=this._segments,i=new Array(6),n=0,r=e.length;n<r;n++)e[n]._transformCoordinates(t,i,!0);return!0},_add:function(t,e){for(var i=this._segments,n=this._curves,r=t.length,s=null==e,e=s?i.length:e,a=0;a<r;a++){var o=t[a];o._path&&(o=t[a]=o.clone()),o._path=this,o._index=e+a,o._selection&&this._updateSelection(o,0,o._selection)}if(s)i.push.apply(i,t);else{i.splice.apply(i,[e,0].concat(t));for(var a=e+r,h=i.length;a<h;a++)i[a]._index=a}if(n){var u=this._countCurves(),l=e>0&&e+r-1===u?e-1:e,c=l,f=Math.min(l+r,u);t._curves&&(n.splice.apply(n,[l,0].concat(t._curves)),c+=t._curves.length);for(a=c;a<f;a++)n.splice(a,0,new k(this,null,null));this._adjustCurves(l,f)}return this._changed(25),t},_adjustCurves:function(t,e){for(var i,n=this._segments,r=this._curves,s=t;s<e;s++)(i=r[s])._path=this,i._segment1=n[s],i._segment2=n[s+1]||n[0],i._changed();(i=r[this._closed&&!t?n.length-1:t-1])&&(i._segment2=n[t]||n[0],i._changed()),(i=r[e])&&(i._segment1=n[e],i._changed())},_countCurves:function(){var t=this._segments.length;return!this._closed&&t>0?t-1:t},add:function(t){return arguments.length>1&&"number"!=typeof t?this._add(T.readList(arguments)):this._add([T.read(arguments)])[0]},insert:function(t,e){return arguments.length>2&&"number"!=typeof e?this._add(T.readList(arguments,1),t):this._add([T.read(arguments,1)],t)[0]},addSegment:function(){return this._add([T.read(arguments)])[0]},insertSegment:function(t){return this._add([T.read(arguments,1)],t)[0]},addSegments:function(t){return this._add(T.readList(t))},insertSegments:function(t,e){return this._add(T.readList(e),t)},removeSegment:function(t){return this.removeSegments(t,t+1)[0]||null},removeSegments:function(t,e,i){t=t||0,e=r.pick(e,this._segments.length);var n=this._segments,s=this._curves,a=n.length,o=n.splice(t,e-t),h=o.length;if(!h)return o;for(l=0;l<h;l++){var u=o[l];u._selection&&this._updateSelection(u,u._selection,0),u._index=u._path=null}for(var l=t,c=n.length;l<c;l++)n[l]._index=l;if(s){for(var f=t>0&&e===a+(this._closed?1:0)?t-1:t,l=(s=s.splice(f,h)).length-1;l>=0;l--)s[l]._path=null;i&&(o._curves=s.slice(1)),this._adjustCurves(f,f)}return this._changed(25),o},clear:"#removeSegments",hasHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)if(t[e].hasHandles())return!0;return!1},clearHandles:function(){for(var t=this._segments,e=0,i=t.length;e<i;e++)t[e].clearHandles()},getLength:function(){if(null==this._length){for(var t=this.getCurves(),e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();this._length=e}return this._length},getArea:function(){var t=this._area;if(null==t){var e=this._segments,i=this._closed;t=0;for(var n=0,r=e.length;n<r;n++){var s=n+1===r;t+=k.getArea(k.getValues(e[n],e[s?0:n+1],null,s&&!i))}this._area=t}return t},isFullySelected:function(){var t=this._segments.length;return this.isSelected()&&t>0&&this._segmentSelection===7*t},setFullySelected:function(t){t&&this._selectSegments(!0),this.setSelected(t)},setSelection:function t(e){1&e||this._selectSegments(!1),t.base.call(this,e)},_selectSegments:function(t){var e=this._segments,i=e.length,n=t?7:0;this._segmentSelection=n*i;for(var r=0;r<i;r++)e[r]._selection=n},_updateSelection:function(t,e,i){t._selection=i,(this._segmentSelection+=i-e)>0&&this.setSelected(!0)},divideAt:function(t){var e,i=this.getLocationAt(t);return i&&(e=i.getCurve().divideAt(i.getCurveOffset()))?e._segment1:null},splitAt:function(t){var e=this.getLocationAt(t),i=e&&e.index,n=e&&e.time;n>1-1e-8&&(i++,n=0);var r=this.getCurves();if(i>=0&&i<r.length){n>=1e-8&&r[i++].divideAtTime(n);var s,a=this.removeSegments(i,this._segments.length,!0);return this._closed?(this.setClosed(!1),s=this):((s=new L(w.NO_INSERT)).insertAbove(this),s.copyAttributes(this)),s._add(a,0),this.addSegment(a[0]),s}return null},split:function(t,i){var n,r=i===e?t:(n=this.getCurves()[t])&&n.getLocationAtTime(i);return null!=r?this.splitAt(r):null},join:function(t,e){var i=e||0;if(t&&t!==this){var n=t._segments,r=this.getLastSegment(),s=t.getLastSegment();if(!s)return this;r&&r._point.isClose(s._point,i)&&t.reverse();var a=t.getFirstSegment();if(r&&r._point.isClose(a._point,i))r.setHandleOut(a._handleOut),this._add(n.slice(1));else{var o=this.getFirstSegment();o&&o._point.isClose(a._point,i)&&t.reverse(),s=t.getLastSegment(),o&&o._point.isClose(s._point,i)?(o.setHandleIn(s._handleIn),this._add(n.slice(0,n.length-1),0)):this._add(n.slice())}t._closed&&this._add([n[0]]),t.remove()}var h=this.getFirstSegment(),u=this.getLastSegment();return h!==u&&h._point.isClose(u._point,i)&&(h.setHandleIn(u._handleIn),u.remove(),this.setClosed(!0)),this},reduce:function(t){for(var e=this.getCurves(),i=t&&t.simplify,n=i?1e-7:0,r=e.length-1;r>=0;r--){var s=e[r];!s.hasHandles()&&(!s.hasLength(n)||i&&s.isCollinear(s.getNext()))&&s.remove()}return this},reverse:function(){this._segments.reverse();for(var t=0,e=this._segments.length;t<e;t++){var i=this._segments[t],n=i._handleIn;i._handleIn=i._handleOut,i._handleOut=n,i._index=t}this._curves=null,this._changed(9)},flatten:function(t){for(var e=new B(this,t||.25,256,!0).parts,i=e.length,n=[],r=0;r<i;r++)n.push(new T(e[r].curve.slice(0,2)));!this._closed&&i>0&&n.push(new T(e[i-1].curve.slice(6))),this.setSegments(n)},simplify:function(t){var e=new D(this).fit(t||2.5);return e&&this.setSegments(e),!!e},smooth:function(t){function i(t,e){var i=t&&t.index;if(null!=i){var r=t.path;if(r&&r!==n)throw new Error(t._class+" "+i+" of "+r+" is not part of "+n);e&&t instanceof k&&i++}else i="number"==typeof t?t:e;return Math.min(i<0&&h?i%o:i<0?i+o:i,o-1)}var n=this,r=t||{},s=r.type||"asymmetric",a=this._segments,o=a.length,h=this._closed,u=h&&r.from===e&&r.to===e,l=i(r.from,0),c=i(r.to,o-1);if(l>c)if(h)l-=o;else{var f=l;l=c,c=f}if(/^(?:asymmetric|continuous)$/.test(s)){var d="asymmetric"===s,_=Math.min,g=c-l+1,v=g-1,p=u?_(g,4):1,m=p,y=p,w=[];if(h||(m=_(1,l),y=_(1,o-c-1)),(v+=m+y)<=1)return;for(var x=0,b=l-m;x<=v;x++,b++)w[x]=a[(b<0?b+o:b)%o]._point;for(var C=w[0]._x+2*w[1]._x,S=w[0]._y+2*w[1]._y,P=2,I=v-1,M=[C],T=[S],z=[P],O=[],A=[],x=1;x<v;x++){var L=x<I,N=L?1:d?1:2,B=L?4:d?2:7,D=L?4:d?3:8,j=L?2:d?0:1,E=N/P;P=z[x]=B-E,C=M[x]=D*w[x]._x+j*w[x+1]._x-E*C,S=T[x]=D*w[x]._y+j*w[x+1]._y-E*S}O[I]=M[I]/z[I],A[I]=T[I]/z[I];for(x=v-2;x>=0;x--)O[x]=(M[x]-O[x+1])/z[x],A[x]=(T[x]-A[x+1])/z[x];O[v]=(3*w[v]._x-O[I])/2,A[v]=(3*w[v]._y-A[I])/2;for(var x=m,F=v-y,b=l;x<=F;x++,b++){var R=a[b<0?b+o:b],q=R._point,V=O[x]-q._x,H=A[x]-q._y;(u||x<F)&&R.setHandleOut(V,H),(u||x>m)&&R.setHandleIn(-V,-H)}}else for(x=l;x<=c;x++)a[x<0?x+o:x].smooth(r,!u&&x===l,!u&&x===c)},toShape:function(t){function i(t,e){var i=l[t],n=i.getNext(),r=l[e],s=r.getNext();return i._handleOut.isZero()&&n._handleIn.isZero()&&r._handleOut.isZero()&&s._handleIn.isZero()&&n._point.subtract(i._point).isCollinear(s._point.subtract(r._point))}function n(t){var e=l[t],i=e.getNext(),n=e._handleOut,r=i._handleIn;if(n.isOrthogonal(r)){var s=e._point,a=i._point,o=new m(s,n,!0).intersect(new m(a,r,!0),!0);return o&&u.isZero(n.getLength()/o.subtract(s).getLength()-.5522847498307936)&&u.isZero(r.getLength()/o.subtract(a).getLength()-.5522847498307936)}return!1}function r(t,e){return l[t]._point.getDistance(l[e]._point)}if(!this._closed)return null;var s,a,o,h,l=this._segments;if(!this.hasHandles()&&4===l.length&&i(0,2)&&i(1,3)&&function(t){var e=l[t],i=e.getPrevious(),n=e.getNext();return i._handleOut.isZero()&&e._handleIn.isZero()&&e._handleOut.isZero()&&n._handleIn.isZero()&&e._point.subtract(i._point).isOrthogonal(n._point.subtract(e._point))}(1)?(s=C.Rectangle,a=new d(r(0,3),r(0,1)),h=l[1]._point.add(l[2]._point).divide(2)):8===l.length&&n(0)&&n(2)&&n(4)&&n(6)&&i(1,5)&&i(3,7)?(s=C.Rectangle,o=(a=new d(r(1,6),r(0,3))).subtract(new d(r(0,7),r(1,2))).divide(2),h=l[3]._point.add(l[4]._point).divide(2)):4===l.length&&n(0)&&n(1)&&n(2)&&n(3)&&(u.isZero(r(0,2)-r(1,3))?(s=C.Circle,o=r(0,2)/2):(s=C.Ellipse,o=new d(r(2,0)/2,r(3,1)/2)),h=l[1]._point),s){var c=this.getPosition(!0),f=new s({center:c,size:a,radius:o,insert:!1});return f.copyAttributes(this,!0),f._matrix.prepend(this._matrix),f.rotate(h.subtract(c).getAngle()+90),(t===e||t)&&f.insertAbove(this),f}return null},toPath:"#clone",compare:function t(e){if(!e||e instanceof N)return t.base.call(this,e);var i=this.getCurves(),n=e.getCurves(),r=i.length,s=n.length;if(!r||!s)return r==s;for(var a,o,h=i[0].getValues(),u=[],l=0,c=0,f=0;f<s;f++){g=n[f].getValues();if(u.push(g),v=k.getOverlaps(h,g)){a=!f&&v[0][0]>0?s-1:f,o=v[0][1];break}}for(var d,_=Math.abs,g=u[a];h&&g;){var v=k.getOverlaps(h,g);if(v&&_(v[0][0]-c)<1e-8){1===(c=v[1][0])&&(h=++l<r?i[l].getValues():null,c=0);var p=v[0][1];if(_(p-o)<1e-8){if(d||(d=[a,p]),1===(o=v[1][1])&&(++a>=s&&(a=0),g=u[a]||n[a].getValues(),o=0),!h)return d[0]===a&&d[1]===o;continue}}break}return!1},_hitTestSelf:function(t,e,i,n){function r(e,i){return t.subtract(e).divide(i).length<=1}function s(t,i,n){if(!e.selected||i.isSelected()){var s=t._point;if(i!==s&&(i=i.add(s)),r(i,x))return new M(n,g,{segment:t,point:i})}}function a(t,i){return(i||e.segments)&&s(t,t._point,"segment")||!i&&e.handles&&(s(t,t._handleIn,"handle-in")||s(t,t._handleOut,"handle-out"))}function o(t){f.add(t)}function h(e){var i=y||e._index>0&&e._index<m-1;if("round"===(i?u:l))return r(e._point,x);if(f=new L({internal:!0,closed:!0}),i?e.isSmooth()||L._addBevelJoin(e,u,P,c,null,n,o,!0):"square"===l&&L._addSquareCap(e,l,P,null,n,o,!0),!f.isEmpty()){var s;return f.contains(t)||(s=f.getNearestLocation(t))&&r(s.getPoint(),w)}}var u,l,c,f,d,_,g=this,v=this.getStyle(),p=this._segments,m=p.length,y=this._closed,w=e._tolerancePadding,x=w,b=e.stroke&&v.hasStroke(),C=e.fill&&v.hasFill(),S=e.curves,P=b?v.getStrokeWidth()/2:C&&e.tolerance>0||S?0:null;if(null!==P&&(P>0?(u=v.getStrokeJoin(),l=v.getStrokeCap(),c=v.getMiterLimit(),x=x.add(L._getStrokePadding(P,n))):u=l="round"),!e.ends||e.segments||y){if(e.segments||e.handles)for(T=0;T<m;T++)if(_=a(p[T]))return _}else if(_=a(p[0],!0)||a(p[m-1],!0))return _;if(null!==P){if(d=this.getNearestLocation(t)){var I=d.getTime();0===I||1===I&&m>1?h(d.getSegment())||(d=null):r(d.getPoint(),x)||(d=null)}if(!d&&"miter"===u&&m>1)for(var T=0;T<m;T++){var z=p[T];if(t.getDistance(z._point)<=c*P&&h(z)){d=z.getLocation();break}}}return!d&&C&&this._contains(t)||d&&!b&&!S?new M("fill",this):d?new M(b?"stroke":"curve",this,{location:d,point:d.getPoint()}):null}},r.each(k._evaluateMethods,function(t){this[t+"At"]=function(e){var i=this.getLocationAt(e);return i&&i[t]()}},{beans:!1,getLocationOf:function(){for(var t=c.read(arguments),e=this.getCurves(),i=0,n=e.length;i<n;i++){var r=e[i].getLocationOf(t);if(r)return r}return null},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getLocationAt:function(t){if("number"==typeof t){for(var e=this.getCurves(),i=0,n=0,r=e.length;n<r;n++){var s=i,a=e[n];if((i+=a.getLength())>t)return a.getLocationAt(t-s)}if(e.length>0&&t<=this.getLength())return new O(e[e.length-1],1)}else if(t&&t.getPath&&t.getPath()===this)return t;return null}}),new function(){function t(t,e,i,n){function r(e){var i=h[e],n=h[e+1];s==i&&a==n||(t.beginPath(),t.moveTo(s,a),t.lineTo(i,n),t.stroke(),t.beginPath(),t.arc(i,n,o,0,2*Math.PI,!0),t.fill())}for(var s,a,o=n/2,h=new Array(6),u=0,l=e.length;u<l;u++){var c=e[u],f=c._selection;if(c._transformCoordinates(i,h),s=h[0],a=h[1],2&f&&r(2),4&f&&r(4),t.fillRect(s-o,a-o,n,n),!(1&f)){var d=t.fillStyle;t.fillStyle="#ffffff",t.fillRect(s-o+1,a-o+1,n-2,n-2),t.fillStyle=d}}}function e(t,e,i){function n(e){if(i)e._transformCoordinates(i,_),r=_[0],s=_[1];else{var n=e._point;r=n._x,s=n._y}if(g)t.moveTo(r,s),g=!1;else{if(i)h=_[2],u=_[3];else{f=e._handleIn;h=r+f._x,u=s+f._y}h===r&&u===s&&l===a&&c===o?t.lineTo(r,s):t.bezierCurveTo(l,c,h,u,r,s)}if(a=r,o=s,i)l=_[4],c=_[5];else{var f=e._handleOut;l=a+f._x,c=o+f._y}}for(var r,s,a,o,h,u,l,c,f=e._segments,d=f.length,_=new Array(6),g=!0,v=0;v<d;v++)n(f[v]);e._closed&&d>0&&n(f[0])}return{_draw:function(t,i,n,r){function s(t){return c[(t%f+f)%f]}var a=i.dontStart,o=i.dontFinish||i.clip,h=this.getStyle(),u=h.hasFill(),l=h.hasStroke(),c=h.getDashArray(),f=!paper.support.nativeDash&&l&&c&&c.length;if(a||t.beginPath(),(u||l&&!f||o)&&(e(t,this,r),this._closed&&t.closePath()),!o&&(u||l)&&(this._setStyles(t,i,n),u&&(t.fill(h.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),l)){if(f){a||t.beginPath();var d,_=new B(this,.25,32,!1,r),g=_.length,v=-h.getDashOffset(),p=0;for(v%=g;v>0;)v-=s(p--)+s(p--);for(;v<g;)d=v+s(p++),(v>0||d>0)&&_.drawPart(t,Math.max(v,0),Math.max(d,0)),v=d+s(p++)}t.stroke()}},_drawSelected:function(i,n){i.beginPath(),e(i,this,n),i.stroke(),t(i,this._segments,n,paper.settings.handleSize)}}},new function(){function t(t){var e=t._segments;if(!e.length)throw new Error("Use a moveTo() command first");return e[e.length-1]}return{moveTo:function(){var t=this._segments;1===t.length&&this.removeSegment(0),t.length||this._add([new T(c.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new T(c.read(arguments))])},cubicCurveTo:function(){var e=c.read(arguments),i=c.read(arguments),n=c.read(arguments),r=t(this);r.setHandleOut(e.subtract(r._point)),this._add([new T(n,i.subtract(n))])},quadraticCurveTo:function(){var e=c.read(arguments),i=c.read(arguments),n=t(this)._point;this.cubicCurveTo(e.add(n.subtract(e).multiply(1/3)),e.add(i.subtract(e).multiply(1/3)),i)},curveTo:function(){var e=c.read(arguments),i=c.read(arguments),n=r.pick(r.read(arguments),.5),s=1-n,a=t(this)._point,o=e.subtract(a.multiply(s*s)).subtract(i.multiply(n*n)).divide(2*n*s);if(o.isNaN())throw new Error("Cannot put a curve through points with parameter = "+n);this.quadraticCurveTo(o,i)},arcTo:function(){var e,i,n,s,a=Math.abs,o=Math.sqrt,h=t(this),l=h._point,f=c.read(arguments),_=r.peek(arguments);if("boolean"==typeof(x=r.pick(_,!0)))var g=(C=l.add(f).divide(2)).add(C.subtract(l).rotate(x?-90:90));else if(r.remain(arguments)<=2)g=f,f=c.read(arguments);else{var v=d.read(arguments),y=u.isZero;if(y(v.width)||y(v.height))return this.lineTo(f);var w=r.read(arguments),x=!!r.read(arguments),b=!!r.read(arguments),C=l.add(f).divide(2),S=(W=l.subtract(C).rotate(-w)).x,P=W.y,I=a(v.width),M=a(v.height),z=I*I,k=M*M,O=S*S,A=P*P,L=o(O/z+A/k);if(L>1&&(z=(I*=L)*I,k=(M*=L)*M),L=(z*k-z*A-k*O)/(z*A+k*O),a(L)<1e-12&&(L=0),L<0)throw new Error("Cannot create an arc with the given arguments");e=new c(I*P/M,-M*S/I).multiply((b===x?-1:1)*o(L)).rotate(w).add(C),i=(n=(s=(new p).translate(e).rotate(w).scale(I,M))._inverseTransform(l)).getDirectedAngle(s._inverseTransform(f)),!x&&i>0?i-=360:x&&i<0&&(i+=360)}if(g){var N=new m(l.add(g).divide(2),g.subtract(l).rotate(90),!0),B=new m(g.add(f).divide(2),f.subtract(g).rotate(90),!0),D=new m(l,f),j=D.getSide(g);if(!(e=N.intersect(B,!0))){if(!j)return this.lineTo(f);throw new Error("Cannot create an arc with the given arguments")}i=(n=l.subtract(e)).getDirectedAngle(f.subtract(e));var E=D.getSide(e);0===E?i=j*a(i):j===E&&(i+=i<0?360:-360)}for(var F=a(i),R=F>=360?4:Math.ceil((F-1e-7)/90),q=i/R,V=q*Math.PI/360,H=4/3*Math.sin(V)/(1+Math.cos(V)),Z=[],U=0;U<=R;U++){var W=f,G=null;if(U<R&&(G=n.rotate(90).multiply(H),s?(W=s._transformPoint(n),G=s._transformPoint(n.add(G)).subtract(W)):W=e.add(n)),U){var J=n.rotate(-90).multiply(H);s&&(J=s._transformPoint(n.add(J)).subtract(W)),Z.push(new T(W,J,G))}else h.setHandleOut(G);n=n.rotate(q)}this._add(Z)},lineBy:function(){var e=c.read(arguments),i=t(this)._point;this.lineTo(i.add(e))},curveBy:function(){var e=c.read(arguments),i=c.read(arguments),n=r.read(arguments),s=t(this)._point;this.curveTo(s.add(e),s.add(i),n)},cubicCurveBy:function(){var e=c.read(arguments),i=c.read(arguments),n=c.read(arguments),r=t(this)._point;this.cubicCurveTo(r.add(e),r.add(i),r.add(n))},quadraticCurveBy:function(){var e=c.read(arguments),i=c.read(arguments),n=t(this)._point;this.quadraticCurveTo(n.add(e),n.add(i))},arcBy:function(){var e=t(this)._point,i=e.add(c.read(arguments)),n=r.pick(r.peek(arguments),!0);"boolean"==typeof n?this.arcTo(i,n):this.arcTo(i,e.add(c.read(arguments)))},closePath:function(t){this.setClosed(!0),this.join(this,t)}}},{_getBounds:function(t,e){var i=e.handle?"getHandleBounds":e.stroke?"getStrokeBounds":"getBounds";return L[i](this._segments,this._closed,this,t,e)},statics:{getBounds:function(t,e,i,n,r,s){function a(t){t._transformCoordinates(n,h);for(var e=0;e<2;e++)k._addBounds(u[e],u[e+4],h[e+2],h[e],e,s?s[e]:0,l,c,f);var i=u;u=h,h=i}var o=t[0];if(!o)return new g;for(var h=new Array(6),u=o._transformCoordinates(n,new Array(6)),l=u.slice(0,2),c=l.slice(),f=new Array(2),d=1,_=t.length;d<_;d++)a(t[d]);return e&&a(o),new g(l[0],l[1],c[0]-l[0],c[1]-l[1])},getStrokeBounds:function(t,e,i,n,r){function s(t){v=v.include(t)}function a(t){v=v.unite(x.setCenter(t._point.transform(n)))}function o(t,e){"round"===e||t.isSmooth()?a(t):L._addBevelJoin(t,e,p,w,n,f,s)}function h(t,e){"round"===e?a(t):L._addSquareCap(t,e,p,n,f,s)}var u=i.getStyle(),l=u.hasStroke(),c=u.getStrokeWidth(),f=l&&i._getStrokeMatrix(n,r),_=l&&L._getStrokePadding(c,f),v=L.getBounds(t,e,i,n,r,_);if(!l)return v;for(var p=c/2,m=u.getStrokeJoin(),y=u.getStrokeCap(),w=u.getMiterLimit(),x=new g(new d(_)),b=t.length-(e?0:1),C=1;C<b;C++)o(t[C],m);return e?o(t[0],m):b>0&&(h(t[0],y),h(t[t.length-1],y)),v},_getStrokePadding:function(t,e){if(!e)return[t,t];var i=new c(t,0).transform(e),n=new c(0,t).transform(e),r=i.getAngleInRadians(),s=i.getLength(),a=n.getLength(),o=Math.sin(r),h=Math.cos(r),u=Math.tan(r),l=Math.atan2(a*u,s),f=Math.atan2(a,u*s);return[Math.abs(s*Math.cos(l)*h+a*Math.sin(l)*o),Math.abs(a*Math.sin(f)*h+s*Math.cos(f)*o)]},_addBevelJoin:function(t,e,i,n,r,s,a,o){var h=t.getCurve(),u=h.getPrevious(),l=h.getPoint1().transform(r),f=u.getNormalAtTime(1).multiply(i).transform(s),d=h.getNormalAtTime(0).multiply(i).transform(s);if(f.getDirectedAngle(d)<0&&(f=f.negate(),d=d.negate()),o&&a(l),a(l.add(f)),"miter"===e){var _=new m(l.add(f),new c(-f.y,f.x),!0).intersect(new m(l.add(d),new c(-d.y,d.x),!0),!0);_&&l.getDistance(_)<=n*i&&a(_)}a(l.add(d))},_addSquareCap:function(t,e,i,n,r,s,a){var o=t._point.transform(n),h=t.getLocation(),u=h.getNormal().multiply(0===h.getTime()?i:-i).transform(r);"square"===e&&(a&&(s(o.subtract(u)),s(o.add(u))),o=o.add(u.rotate(-90))),s(o.add(u)),s(o.subtract(u))},getHandleBounds:function(t,e,i,n,r){var s,a,o=i.getStyle();if(r.stroke&&o.hasStroke()){var h=i._getStrokeMatrix(n,r),u=o.getStrokeWidth()/2,l=u;"miter"===o.getStrokeJoin()&&(l=u*o.getMiterLimit()),"square"===o.getStrokeCap()&&(l=Math.max(l,u*Math.SQRT2)),s=L._getStrokePadding(u,h),a=L._getStrokePadding(l,h)}for(var c=new Array(6),f=1/0,d=-f,_=f,v=d,p=0,m=t.length;p<m;p++){t[p]._transformCoordinates(n,c);for(var y=0;y<6;y+=2){var w=y?s:a,x=w?w[0]:0,b=w?w[1]:0,C=c[y],S=c[y+1],P=C-x,I=C+x,M=S-b,T=S+b;P<f&&(f=P),I>d&&(d=I),M<_&&(_=M),T>v&&(v=T)}}return new g(f,_,d-f,v-_)}}});L.inject({statics:new function(){function t(t,e,i){var n=r.getNamed(i),s=new L(n&&0==n.insert&&w.NO_INSERT);return s._add(t),s._closed=e,s.set(n,{insert:!0})}function e(e,i,r){for(var s=new Array(4),a=0;a<4;a++){var o=n[a];s[a]=new T(o._point.multiply(i).add(e),o._handleIn.multiply(i),o._handleOut.multiply(i))}return t(s,!0,r)}var i=.5522847498307936,n=[new T([-1,0],[0,i],[0,-i]),new T([0,-1],[-i,0],[i,0]),new T([1,0],[0,-i],[0,i]),new T([0,1],[i,0],[-i,0])];return{Line:function(){return t([new T(c.readNamed(arguments,"from")),new T(c.readNamed(arguments,"to"))],!1,arguments)},Circle:function(){var t=c.readNamed(arguments,"center"),i=r.readNamed(arguments,"radius");return e(t,new d(i),arguments)},Rectangle:function(){var e,n=g.readNamed(arguments,"rectangle"),r=d.readNamed(arguments,"radius",0,{readNull:!0}),s=n.getBottomLeft(!0),a=n.getTopLeft(!0),o=n.getTopRight(!0),h=n.getBottomRight(!0);if(!r||r.isZero())e=[new T(s),new T(a),new T(o),new T(h)];else{var u=(r=d.min(r,n.getSize(!0).divide(2))).width,l=r.height,c=u*i,f=l*i;e=[new T(s.add(u,0),null,[-c,0]),new T(s.subtract(0,l),[0,f]),new T(a.add(0,l),null,[0,-f]),new T(a.add(u,0),[-c,0],null),new T(o.subtract(u,0),null,[c,0]),new T(o.add(0,l),[0,-f],null),new T(h.subtract(0,l),null,[0,f]),new T(h.subtract(u,0),[c,0])]}return t(e,!0,arguments)},RoundRectangle:"#Rectangle",Ellipse:function(){var t=C._readEllipse(arguments);return e(t.center,t.radius,arguments)},Oval:"#Ellipse",Arc:function(){var t=c.readNamed(arguments,"from"),e=c.readNamed(arguments,"through"),i=c.readNamed(arguments,"to"),n=r.getNamed(arguments),s=new L(n&&0==n.insert&&w.NO_INSERT);return s.moveTo(t),s.arcTo(e,i),s.set(n)},RegularPolygon:function(){for(var e=c.readNamed(arguments,"center"),i=r.readNamed(arguments,"sides"),n=r.readNamed(arguments,"radius"),s=360/i,a=i%3==0,o=new c(0,a?-n:n),h=a?-1:.5,u=new Array(i),l=0;l<i;l++)u[l]=new T(e.add(o.rotate((l+h)*s)));return t(u,!0,arguments)},Star:function(){for(var e=c.readNamed(arguments,"center"),i=2*r.readNamed(arguments,"points"),n=r.readNamed(arguments,"radius1"),s=r.readNamed(arguments,"radius2"),a=360/i,o=new c(0,-1),h=new Array(i),u=0;u<i;u++)h[u]=new T(e.add(o.rotate(a*u).multiply(u%2?s:n)));return t(h,!0,arguments)}}}});var N=A.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||("string"==typeof t?this.setPathData(t):this.addChildren(Array.isArray(t)?t:arguments))},insertChildren:function t(e,i){var n=i,s=n[0];s&&"number"==typeof s[0]&&(n=[n]);for(var a=i.length-1;a>=0;a--){var o=n[a];n!==i||o instanceof L||(n=r.slice(n)),Array.isArray(o)?n[a]=new L({segments:o,insert:!1}):o instanceof N&&(n.splice.apply(n,[a,1].concat(o.removeChildren())),o.remove())}return t.base.call(this,e,n)},reduce:function t(e){for(var i=this._children,n=i.length-1;n>=0;n--)(r=i[n].reduce(e)).isEmpty()&&r.remove();if(!i.length){var r=new L(w.NO_INSERT);return r.copyAttributes(this),r.insertAbove(this),this.remove(),r}return t.base.call(this)},isClosed:function(){for(var t=this._children,e=0,i=t.length;e<i;e++)if(!t[e]._closed)return!1;return!0},setClosed:function(t){for(var e=this._children,i=0,n=e.length;i<n;i++)e[i].setClosed(t)},getFirstSegment:function(){var t=this.getFirstChild();return t&&t.getFirstSegment()},getLastSegment:function(){var t=this.getLastChild();return t&&t.getLastSegment()},getCurves:function(){for(var t=this._children,e=[],i=0,n=t.length;i<n;i++)e.push.apply(e,t[i].getCurves());return e},getFirstCurve:function(){var t=this.getFirstChild();return t&&t.getFirstCurve()},getLastCurve:function(){var t=this.getLastChild();return t&&t.getLastCurve()},getArea:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getArea();return e},getLength:function(){for(var t=this._children,e=0,i=0,n=t.length;i<n;i++)e+=t[i].getLength();return e},getPathData:function(t,e){for(var i=this._children,n=[],r=0,s=i.length;r<s;r++){var a=i[r],o=a._matrix;n.push(a.getPathData(t&&!o.isIdentity()?t.appended(o):t,e))}return n.join("")},_hitTestChildren:function t(e,i,n){return t.base.call(this,e,i.class===L||"path"===i.type?i:r.set({},i,{fill:!1}),n)},_draw:function(t,e,i,n){var r=this._children;if(r.length){e=e.extend({dontStart:!0,dontFinish:!0}),t.beginPath();for(var s=0,a=r.length;s<a;s++)r[s].draw(t,e,n);if(!e.clip){this._setStyles(t,e,i);var o=this._style;o.hasFill()&&(t.fill(o.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),o.hasStroke()&&t.stroke()}}},_drawSelected:function(t,e,i){for(var n=this._children,r=0,s=n.length;r<s;r++){var a=n[r],o=a._matrix;i[a._id]||a._drawSelected(t,o.isIdentity()?e:e.appended(o))}}},new function(){function t(t,e){var i=t._children;if(e&&!i.length)throw new Error("Use a moveTo() command first");return i[i.length-1]}return r.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],function(e){this[e]=function(){var i=t(this,!0);i[e].apply(i,arguments)}},{moveTo:function(){var e=t(this),i=e&&e.isEmpty()?e:new L(w.NO_INSERT);i!==e&&this.addChild(i),i.moveTo.apply(i,arguments)},moveBy:function(){var e=t(this,!0),i=e&&e.getLastSegment(),n=c.read(arguments);this.moveTo(i?n.add(i._point):n)},closePath:function(e){t(this,!0).closePath(e)}})},r.each(["reverse","flatten","simplify","smooth"],function(t){this[t]=function(e){for(var i,n=this._children,r=0,s=n.length;r<s;r++)i=n[r][t](e)||i;return i}},{}));A.inject(new function(){function t(t,e){var i=t.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);return e?i.resolveCrossings().reorient("nonzero"===i.getFillRule(),!0):i}function i(t,e,i,n,r){var s=new N(w.NO_INSERT);return s.addChildren(t,!0),s=s.reduce({simplify:e}),r&&0==r.insert||s.insertAbove(n&&i.isSibling(n)&&i.getIndex()<n.getIndex()?n:i),s.copyAttributes(i,!0),s}function n(e,n,r,a){function o(t){for(var e=0,i=t.length;e<i;e++){var n=t[e];w.push.apply(w,n._segments),x.push.apply(x,n.getCurves()),n._overlapsOnly=!0}}if(a&&(0==a.trace||a.stroke)&&/^(subtract|intersect)$/.test(r))return s(e,n,r);var u=t(e,!0),c=n&&e!==n&&t(n,!0),_=p[r];_[r]=!0,c&&(_.subtract||_.exclude)^c.isClockwise()^u.isClockwise()&&c.reverse();var g,v=l(O.expand(u.getCrossings(c))),m=u._children||[u],y=c&&(c._children||[c]),w=[],x=[];if(v.length){o(m),y&&o(y);for(var b=0,C=v.length;b<C;b++)f(v[b]._segment,u,c,x,_);for(var b=0,C=w.length;b<C;b++){var S=w[b],P=S._intersection;S._winding||f(S,u,c,x,_),P&&P._overlap||(S._path._overlapsOnly=!1)}g=d(w,_)}else g=h(y?m.concat(y):m.slice(),function(t){return!!_[t]});return i(g,!0,e,n,a)}function s(e,n,r){function s(t){if(!c[t._id]&&(l||o.contains(t.getPointAt(t.getLength()/2))^u))return f.unshift(t),c[t._id]=!0}for(var a=t(e),o=t(n),h=a.getCrossings(o),u="subtract"===r,l="divide"===r,c={},f=[],d=h.length-1;d>=0;d--){var _=h[d].split();_&&(s(_)&&_.getFirstSegment().setHandleIn(0,0),a.getLastSegment().setHandleOut(0,0))}return s(a),i(f,!1,e,n)}function a(t,e){for(var i=t;i;){if(i===e)return;i=i._previous}for(;t._next&&t._next!==e;)t=t._next;if(!t._next){for(;e._previous;)e=e._previous;t._next=e,e._previous=t}}function o(t){for(var e=t.length-1;e>=0;e--)t[e].clearHandles()}function h(t,e,i){var n=t&&t.length;if(n){var s=r.each(t,function(t,e){this[t._id]={container:null,winding:t.isClockwise()?1:-1,index:e}},{}),a=t.slice().sort(function(t,e){return v(e.getArea())-v(t.getArea())}),o=a[0];null==i&&(i=o.isClockwise());for(var h=0;h<n;h++){for(var u=a[h],l=s[u._id],c=u.getInteriorPoint(),f=0,d=h-1;d>=0;d--){var _=a[d];if(_.contains(c)){var g=s[_._id];f=g.winding,l.winding+=f,l.container=g.exclude?g.container:_;break}}if(e(l.winding)===e(f))l.exclude=!0,t[l.index]=null;else{var p=l.container;u.setClockwise(p?!p.isClockwise():i)}}}return t}function l(t,e,i){function n(t){return t._path._id+"."+t._segment1._index}for(var r,s,h,u=e&&[],l=!1,c=i||[],f=i&&{},d=(i&&i.length)-1;d>=0;d--)(y=i[d])._path&&(f[n(y)]=!0);for(d=t.length-1;d>=0;d--){var _,g=t[d],v=g._time,p=v,m=e&&!e(g),y=g._curve;if(y&&(y!==s?(l=!y.hasHandles()||f&&f[n(y)],r=[],h=null,s=y):h>=1e-8&&(v/=h)),m)r&&r.push(g);else{if(e&&u.unshift(g),h=p,v<1e-8)_=y._segment1;else if(v>1-1e-8)_=y._segment2;else{var w=y.divideAtTime(v,!0);l&&c.push(y,w),_=w._segment1;for(var x=r.length-1;x>=0;x--){var b=r[x];b._time=(b._time-v)/(1-v)}}g._setSegment(_);var C=_._intersection,S=g._intersection;if(C){a(C,S);for(var P=C;P;)a(P._intersection,C),P=P._next}else _._intersection=S}}return i||o(c),u||t}function c(t,e,i,n,r){function s(s){var a=s[l+0],h=s[l+6];if(!(p<_(a,h)||p>g(a,h))){var f=s[u+0],v=s[u+2],x=s[u+4],b=s[u+6];if(a!==h){var I=p===a?0:p===h?1:y>g(f,v,x,b)||w<_(f,v,x,b)?1:k.solveCubic(s,l,p,T,0,1)>0?T[0]:1,z=0===I?f:1===I?b:k.getPoint(s,I)[i?"y":"x"],O=a>h?1:-1,A=o[l]>o[l+6]?1:-1,L=o[u+6];return p!==a?(z<y?C+=O:z>w?S+=O:P=!0,z>d-m&&z<d+m&&(M/=2)):(O!==A?f<y?C+=O:f>w&&(S+=O):f!=L&&(L<w&&z>w?(S+=O,P=!0):L>y&&z<y&&(C+=O,P=!0)),M=0),o=s,!r&&z>y&&z<w&&0===k.getTangent(s,I)[i?"x":"y"]&&c(t,e,!i,n,!0)}(f<w&&b>y||b<w&&f>y)&&(P=!0)}}function a(t){var e=t[l+0],n=t[l+2],r=t[l+4],a=t[l+6];if(p<=g(e,n,r,a)&&p>=_(e,n,r,a))for(var o,h=t[u+0],c=t[u+2],f=t[u+4],d=t[u+6],v=y>g(h,c,f,d)||w<_(h,c,f,d)?[t]:k.getMonoCurves(t,i),m=0,x=v.length;m<x;m++)if(o=s(v[m]))return o}for(var o,h,u=i?1:0,l=1^u,f=[t.x,t.y],d=f[u],p=f[l],m=1e-6,y=d-1e-9,w=d+1e-9,x=0,b=0,C=0,S=0,P=!1,I=!1,M=1,T=[],z=0,O=e.length;z<O;z++){var A,L=e[z],N=L._path,B=L.getValues();if(!(z&&e[z-1]._path===N||(o=null,N._closed||(h=k.getValues(N.getLastCurve().getSegment2(),L.getSegment1(),null,!n))[l]!==h[l+6]&&(o=h),o))){o=B;for(var D=N.getLastCurve();D&&D!==L;){var j=D.getValues();if(j[l]!==j[l+6]){o=j;break}D=D.getPrevious()}}if(A=a(B))return A;if(z+1===O||e[z+1]._path!==N){if(h&&(A=a(h)))return A;!P||C||S||(C=S=N.isClockwise(n)^i?1:-1),x+=C,b+=S,C=S=0,P&&(I=!0,P=!1),h=null}}return x=v(x),b=v(b),{winding:g(x,b),windingL:x,windingR:b,quality:M,onPath:I}}function f(t,e,i,n,r){var s=[],a=t,o=0;do{d=(y=t.getCurve()).getLength();s.push({segment:t,curve:y,length:d}),o+=d,t=t.getNext()}while(t&&!t._intersection&&t!==a);for(var h=[.5,.25,.75],l={winding:0,quality:-1},f=0;f<h.length&&l.quality<.5;f++)for(var d=o*h[f],_=0,g=s.length;_<g;_++){var p=s[_],m=p.length;if(d<=m){var y=p.curve,w=y._path,x=w._parent,b=x instanceof N?x:w,C=u.clamp(y.getTimeAt(d),1e-8,1-1e-8),S=y.getPointAtTime(C),P=v(y.getTangentAtTime(C).y)<Math.SQRT1_2,I=r.subtract&&i&&(b===e&&i._getWinding(S,P,!0).winding||b===i&&!e._getWinding(S,P,!0).winding)?{winding:0,quality:1}:c(S,n,P,!0);I.quality>l.quality&&(l=I);break}d-=m}for(_=s.length-1;_>=0;_--)s[_].segment._winding=l}function d(t,e){function i(t){var i;return!(!t||t._visited||e&&(!e[(i=t._winding||{}).winding]||e.unite&&2===i.winding&&i.windingL&&i.windingR))}function n(t){if(t)for(var e=0,i=s.length;e<i;e++)if(t===s[e])return!0;return!1}function r(t){for(var e=t._segments,i=0,n=e.length;i<n;i++)e[i]._visited=!0}var s,a=[];t.sort(function(t,e){var i=t._intersection,n=e._intersection,r=!(!i||!i._overlap),s=!(!n||!n._overlap),a=t._path,o=e._path;return r^s?r?1:-1:!i^!n?i?1:-1:a!==o?a._id-o._id:t._index-e._index});for(var o=0,h=t.length;o<h;o++){var u,l,c,f=t[o],d=i(f),_=null,g=!1,v=!0,p=[];if(d&&f._path._overlapsOnly){var m=f._path,y=f._intersection._segment._path;m.compare(y)&&(m.getArea()&&a.push(m.clone(!1)),r(m),r(y),d=!1)}for(;d;){var x=!_,b=function(t,e){function r(r,a){for(;r&&r!==a;){var o=r._segment,u=o&&o._path;if(u){var l=o.getNext()||u.getFirstSegment(),c=l._intersection;o!==t&&(n(o)||n(l)||l&&i(o)&&(i(l)||c&&i(c._segment)))&&h.push(o),e&&s.push(o)}r=r._next}}var a=t._intersection,o=a,h=[];if(e&&(s=[t]),a){for(r(a);a&&a._prev;)a=a._prev;r(a,o)}return h}(f,x),C=b.shift(),S=!(g=!x&&(n(f)||n(C)))&&C;if(x&&(_=new L(w.NO_INSERT),u=null),g){(f.isFirst()||f.isLast())&&(v=f._path._closed),f._visited=!0;break}if(S&&u&&(p.push(u),u=null),u||(S&&b.push(f),u={start:_._segments.length,crossings:b,visited:l=[],handleIn:c}),S&&(f=C),!i(f)){_.removeSegments(u.start);for(var P=0,I=l.length;P<I;P++)l[P]._visited=!1;l.length=0;do{(f=u&&u.crossings.shift())&&f._path||(f=null,(u=p.pop())&&(l=u.visited,c=u.handleIn))}while(u&&!i(f));if(!f)break}var M=f.getNext();_.add(new T(f._point,c,M&&f._handleOut)),f._visited=!0,l.push(f),f=M||f._path.getFirstSegment(),c=M&&M._handleIn}g&&(v&&(_.getFirstSegment().setHandleIn(c),_.setClosed(v)),0!==_.getArea()&&a.push(_))}return a}var _=Math.min,g=Math.max,v=Math.abs,p={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};return{_getWinding:function(t,e,i){return c(t,this.getCurves(),e,i)},unite:function(t,e){return n(this,t,"unite",e)},intersect:function(t,e){return n(this,t,"intersect",e)},subtract:function(t,e){return n(this,t,"subtract",e)},exclude:function(t,e){return n(this,t,"exclude",e)},divide:function(t,e){return e&&(0==e.trace||e.stroke)?s(this,t,"divide"):i([this.subtract(t,e),this.intersect(t,e)],!0,this,t,e)},resolveCrossings:function(){function t(t,e){var i=t&&t._intersection;return i&&i._overlap&&i._path===e}var e=this._children,i=e||[this],n=!1,s=!1,a=this.getIntersections(null,function(t){return t.hasOverlap()&&(n=!0)||t.isCrossing()&&(s=!0)}),h=n&&s&&[];if(a=O.expand(a),n)for(var u=l(a,function(t){return t.hasOverlap()},h),c=u.length-1;c>=0;c--){var f=u[c],_=f._path,g=f._segment,v=g.getPrevious(),p=g.getNext();t(v,_)&&t(p,_)&&(g.remove(),v._handleOut._set(0,0),p._handleIn._set(0,0),v===g||v.getCurve().hasLength()||(p._handleIn.set(v._handleIn),v.remove()))}s&&(l(a,n&&function(t){var e=t.getCurve(),i=t.getSegment(),n=t._intersection,r=n._curve,s=n._segment;if(e&&r&&e._path&&r._path)return!0;i&&(i._intersection=null),s&&(s._intersection=null)},h),h&&o(h),i=d(r.each(i,function(t){this.push.apply(this,t._segments)},[])));var m,y=i.length;return y>1&&e?(i!==e&&this.setChildren(i),m=this):1!==y||e||(i[0]!==this&&this.setSegments(i[0].removeSegments()),m=this),m||((m=new N(w.NO_INSERT)).addChildren(i),(m=m.reduce()).copyAttributes(this),this.replaceWith(m)),m},reorient:function(t,i){var n=this._children;return n&&n.length?this.setChildren(h(this.removeChildren(),function(e){return!!(t?e:1&e)},i)):i!==e&&this.setClockwise(i),this},getInteriorPoint:function(){var t=this.getBounds().getCenter(!0);if(!this.contains(t)){for(var e=this.getCurves(),i=t.y,n=[],r=[],s=0,a=e.length;s<a;s++){var o=e[s].getValues(),h=o[1],u=o[3],l=o[5],c=o[7];if(i>=_(h,u,l,c)&&i<=g(h,u,l,c))for(var f=k.getMonoCurves(o),d=0,v=f.length;d<v;d++){var p=f[d],m=p[1],y=p[7];if(m!==y&&(i>=m&&i<=y||i>=y&&i<=m)){var w=i===m?p[0]:i===y?p[6]:1===k.solveCubic(p,1,i,r,0,1)?k.getPoint(p,r[0]).x:(p[0]+p[6])/2;n.push(w)}}}n.length>1&&(n.sort(function(t,e){return t-e}),t.x=(n[0]+n[1])/2)}return t}}});var B=r.extend({_class:"PathFlattener",initialize:function(t,e,i,n,r){function s(t,e){var i=k.getValues(t,e,r);h.push(i),a(i,t._index,0,1)}function a(t,i,r,s){if(!(s-r>c)||n&&k.isStraight(t)||k.isFlatEnough(t,e||.25)){var o=t[6]-t[0],h=t[7]-t[1],f=Math.sqrt(o*o+h*h);f>0&&(l+=f,u.push({offset:l,curve:t,index:i,time:s}))}else{var d=k.subdivide(t,.5),_=(r+s)/2;a(d[0],i,r,_),a(d[1],i,_,s)}}for(var o,h=[],u=[],l=0,c=1/(i||32),f=t._segments,d=f[0],_=1,g=f.length;_<g;_++)s(d,o=f[_]),d=o;t._closed&&s(o,f[0]),this.curves=h,this.parts=u,this.length=l,this.index=0},_get:function(t){for(var e,i=this.parts,n=i.length,r=this.index;e=r,r&&!(i[--r].offset<t););for(;e<n;e++){var s=i[e];if(s.offset>=t){this.index=e;var a=i[e-1],o=a&&a.index===s.index?a.time:0,h=a?a.offset:0;return{index:s.index,time:o+(s.time-o)*(t-h)/(s.offset-h)}}}return{index:i[n-1].index,time:1}},drawPart:function(t,e,i){for(var n=this._get(e),r=this._get(i),s=n.index,a=r.index;s<=a;s++){var o=k.getPart(this.curves[s],s===n.index?n.time:0,s===r.index?r.time:1);s===n.index&&t.moveTo(o[0],o[1]),t.bezierCurveTo.apply(t,o.slice(2))}}},r.each(k._evaluateMethods,function(t){this[t+"At"]=function(e){var i=this._get(e);return k[t](this.curves[i.index],i.time)}},{})),D=r.extend({initialize:function(t){for(var e,i=this.points=[],n=t._segments,r=t._closed,s=0,a=n.length;s<a;s++){var o=n[s].point;e&&e.equals(o)||i.push(e=o.clone())}r&&(i.unshift(i[i.length-1]),i.push(i[1])),this.closed=r},fit:function(t){var e=this.points,i=e.length,n=null;return i>0&&(n=[new T(e[0])],i>1&&(this.fitCubic(n,t,0,i-1,e[1].subtract(e[0]),e[i-2].subtract(e[i-1])),this.closed&&(n.shift(),n.pop()))),n},fitCubic:function(t,e,i,n,r,s){var a=this.points;if(n-i!=1){for(var o,h=this.chordLengthParameterize(i,n),u=Math.max(e,e*e),l=!0,c=0;c<=4;c++){var f=this.generateBezier(i,n,h,r,s),d=this.findMaxError(i,n,f,h);if(d.error<e&&l)return void this.addCurve(t,f);if(o=d.index,d.error>=u)break;l=this.reparameterize(i,n,h,f),u=d.error}var _=a[o-1].subtract(a[o+1]);this.fitCubic(t,e,i,o,r,_),this.fitCubic(t,e,o,n,_.negate(),s)}else{var g=a[i],v=a[n],p=g.getDistance(v)/3;this.addCurve(t,[g,g.add(r.normalize(p)),v.add(s.normalize(p)),v])}},addCurve:function(t,e){t[t.length-1].setHandleOut(e[1].subtract(e[0])),t.push(new T(e[3],e[2].subtract(e[3])))},generateBezier:function(t,e,i,n,r){for(var s=Math.abs,a=this.points,o=a[t],h=a[e],u=[[0,0],[0,0]],l=[0,0],c=0,f=e-t+1;c<f;c++){var d=i[c],_=1-d,g=3*d*_,v=_*_*_,p=g*_,m=g*d,y=d*d*d,w=n.normalize(p),x=r.normalize(m),b=a[t+c].subtract(o.multiply(v+p)).subtract(h.multiply(m+y));u[0][0]+=w.dot(w),u[0][1]+=w.dot(x),u[1][0]=u[0][1],u[1][1]+=x.dot(x),l[0]+=w.dot(b),l[1]+=x.dot(b)}var C,S,P=u[0][0]*u[1][1]-u[1][0]*u[0][1];if(s(P)>1e-12){var I=u[0][0]*l[1]-u[1][0]*l[0];C=(l[0]*u[1][1]-l[1]*u[0][1])/P,S=I/P}else{var M=u[0][0]+u[0][1],T=u[1][0]+u[1][1];C=S=s(M)>1e-12?l[0]/M:s(T)>1e-12?l[1]/T:0}var z,k,O=h.getDistance(o),A=1e-12*O;if(C<A||S<A)C=S=O/3;else{var L=h.subtract(o);z=n.normalize(C),k=r.normalize(S),z.dot(L)-k.dot(L)>O*O&&(C=S=O/3,z=k=null)}return[o,o.add(z||n.normalize(C)),h.add(k||r.normalize(S)),h]},reparameterize:function(t,e,i,n){for(r=t;r<=e;r++)i[r-t]=this.findRoot(n,this.points[r],i[r-t]);for(var r=1,s=i.length;r<s;r++)if(i[r]<=i[r-1])return!1;return!0},findRoot:function(t,e,i){for(var n=[],r=[],s=0;s<=2;s++)n[s]=t[s+1].subtract(t[s]).multiply(3);for(s=0;s<=1;s++)r[s]=n[s+1].subtract(n[s]).multiply(2);var a=this.evaluate(3,t,i),o=this.evaluate(2,n,i),h=this.evaluate(1,r,i),l=a.subtract(e),c=o.dot(o)+l.dot(h);return u.isZero(c)?i:i-l.dot(o)/c},evaluate:function(t,e,i){for(var n=e.slice(),r=1;r<=t;r++)for(var s=0;s<=t-r;s++)n[s]=n[s].multiply(1-i).add(n[s+1].multiply(i));return n[0]},chordLengthParameterize:function(t,e){for(var i=[0],n=t+1;n<=e;n++)i[n-t]=i[n-t-1]+this.points[n].getDistance(this.points[n-1]);for(var n=1,r=e-t;n<=r;n++)i[n]/=i[r];return i},findMaxError:function(t,e,i,n){for(var r=Math.floor((e-t+1)/2),s=0,a=t+1;a<e;a++){var o=this.evaluate(3,i,n[a-t]).subtract(this.points[a]),h=o.x*o.x+o.y*o.y;h>=s&&(s=h,r=a)}return{error:s,index:r}}}),j=w.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(t){this._content="",this._lines=[];var i=t&&r.isPlainObject(t)&&t.x===e&&t.y===e;this._initialize(i&&t,!i&&c.read(arguments))},_equals:function(t){return this._content===t._content},copyContent:function(t){this.setContent(t._content)},getContent:function(){return this._content},setContent:function(t){this._content=""+t,this._lines=this._content.split(/\r\n|\n|\r/gm),this._changed(265)},isEmpty:function(){return!this._content},getCharacterStyle:"#getStyle",setCharacterStyle:"#setStyle",getParagraphStyle:"#getStyle",setParagraphStyle:"#setStyle"}),E=j.extend({_class:"PointText",initialize:function(){j.apply(this,arguments)},getPoint:function(){var t=this._matrix.getTranslation();return new f(t.x,t.y,this,"setPoint")},setPoint:function(){var t=c.read(arguments);this.translate(t.subtract(this._matrix.getTranslation()))},_draw:function(t,e,i){if(this._content){this._setStyles(t,e,i);var n=this._lines,r=this._style,s=r.hasFill(),a=r.hasStroke(),o=r.getLeading(),h=t.shadowColor;t.font=r.getFontStyle(),t.textAlign=r.getJustification();for(var u=0,l=n.length;u<l;u++){t.shadowColor=h;var c=n[u];s&&(t.fillText(c,0,0),t.shadowColor="rgba(0,0,0,0)"),a&&t.strokeText(c,0,0),t.translate(0,o)}}},_getBounds:function(t,e){var i=this._style,n=this._lines,r=n.length,s=i.getJustification(),a=i.getLeading(),o=this.getView().getTextWidth(i.getFontStyle(),n),h=0;"left"!==s&&(h-=o/("center"===s?2:1));var u=new g(h,r?-.75*a:0,o,r*a);return t?t._transformBounds(u,u):u}}),F=r.extend(new function(){function t(t){var n,r=t.match(/^#(\w{1,2})(\w{1,2})(\w{1,2})$/);if(r){n=[0,0,0];for(s=0;s<3;s++){h=r[s+1];n[s]=parseInt(1==h.length?h+h:h,16)/255}}else if(r=t.match(/^rgba?\((.*)\)$/))for(var s=0,o=(n=r[1].split(",")).length;s<o;s++){var h=+n[s];n[s]=s<3?h/255:h}else if(i){var u=a[t];if(!u){e||((e=Q.getContext(1,1)).globalCompositeOperation="copy"),e.fillStyle="rgba(0,0,0,0)",e.fillStyle=t,e.fillRect(0,0,1,1);var l=e.getImageData(0,0,1,1).data;u=a[t]=[l[0]/255,l[1]/255,l[2]/255]}n=u.slice()}else n=[0,0,0];return n}var e,n={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},s={},a={},o=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],u={"rgb-hsb":function(t,e,i){var n=Math.max(t,e,i),r=n-Math.min(t,e,i);return[0===r?0:60*(n==t?(e-i)/r+(e<i?6:0):n==e?(i-t)/r+2:(t-e)/r+4),0===n?0:r/n,n]},"hsb-rgb":function(t,e,i){t=(t/60%6+6)%6;var n=Math.floor(t),r=t-n,s=[i,i*(1-e),i*(1-e*r),i*(1-e*(1-r))];return[s[(n=o[n])[0]],s[n[1]],s[n[2]]]},"rgb-hsl":function(t,e,i){var n=Math.max(t,e,i),r=Math.min(t,e,i),s=n-r,a=0===s,o=(n+r)/2;return[a?0:60*(n==t?(e-i)/s+(e<i?6:0):n==e?(i-t)/s+2:(t-e)/s+4),a?0:o<.5?s/(n+r):s/(2-n-r),o]},"hsl-rgb":function(t,e,i){if(t=(t/360%1+1)%1,0===e)return[i,i,i];for(var n=[t+1/3,t,t-1/3],r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[],o=0;o<3;o++){var h=n[o];h<0&&(h+=1),h>1&&(h-=1),a[o]=6*h<1?s+6*(r-s)*h:2*h<1?r:3*h<2?s+(r-s)*(2/3-h)*6:s}return a},"rgb-gray":function(t,e,i){return[.2989*t+.587*e+.114*i]},"gray-rgb":function(t){return[t,t,t]},"gray-hsb":function(t){return[0,0,t]},"gray-hsl":function(t){return[0,0,t]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return r.each(n,function(t,e){s[e]=[],r.each(t,function(t,i){var a=r.capitalize(t),o=/^(hue|saturation)$/.test(t),h=s[e][i]="gradient"===t?function(t){var e=this._components[0];return t=R.read(Array.isArray(t)?t:arguments,0,{readNull:!0}),e!==t&&(e&&e._removeOwner(this),t&&t._addOwner(this)),t}:"gradient"===e?function(){return c.read(arguments,0,{readNull:"highlight"===t,clone:!0})}:function(t){return null==t||isNaN(t)?0:t};this["get"+a]=function(){return this._type===e||o&&/^hs[bl]$/.test(this._type)?this._components[i]:this._convert(e)[i]},this["set"+a]=function(t){this._type===e||o&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(e),this._properties=n[e],this._type=e),this._components[i]=h.call(this,t),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function e(i){var a,o,h,u,l=arguments,c=this.__read,f=0;Array.isArray(i)&&(i=(l=i)[0]);var d=null!=i&&typeof i;if("string"===d&&i in n&&(a=i,i=l[1],Array.isArray(i)?(o=i,h=l[2]):(c&&(f=1),l=r.slice(l,1),d=typeof i)),!o){if(u="number"===d?l:"object"===d&&null!=i.length?i:null){a||(a=u.length>=3?"rgb":"gray");var _=n[a].length;h=u[_],c&&(f+=u===arguments?_+(null!=h?1:0):1),u.length>_&&(u=r.slice(u,0,_))}else if("string"===d)a="rgb",4===(o=t(i)).length&&(h=o[3],o.length--);else if("object"===d)if(i.constructor===e){if(a=i._type,o=i._components.slice(),h=i._alpha,"gradient"===a)for(var g=1,v=o.length;g<v;g++){var p=o[g];p&&(o[g]=p.clone())}}else if(i.constructor===R)a="gradient",u=l;else{var m=n[a="hue"in i?"lightness"in i?"hsl":"hsb":"gradient"in i||"stops"in i||"radial"in i?"gradient":"gray"in i?"gray":"rgb"],y=s[a];this._components=o=[];for(var g=0,v=m.length;g<v;g++)null==(w=i[m[g]])&&!g&&"gradient"===a&&"stops"in i&&(w={stops:i.stops,radial:i.radial}),null!=(w=y[g].call(this,w))&&(o[g]=w);h=i.alpha}c&&a&&(f=1)}if(this._type=a||"rgb",!o){this._components=o=[];for(var g=0,v=(y=s[this._type]).length;g<v;g++){var w=y[g].call(this,u&&u[g]);null!=w&&(o[g]=w)}}return this._components=o,this._properties=n[this._type],this._alpha=h,c&&(this.__read=f),this},set:"#initialize",_serialize:function(t,e){var i=this.getComponents();return r.serialize(/^(gray|rgb)$/.test(this._type)?i:[this._type].concat(i),t,!0,e)},_changed:function(){this._canvasStyle=null,this._owner&&this._owner._changed(65)},_convert:function(t){var e;return this._type===t?this._components.slice():(e=u[this._type+"-"+t])?e.apply(this,this._components):u["rgb-"+t].apply(this,u[this._type+"-rgb"].apply(this,this._components))},convert:function(t){return new F(t,this._convert(t),this._alpha)},getType:function(){return this._type},setType:function(t){this._components=this._convert(t),this._properties=n[t],this._type=t},getComponents:function(){var t=this._components.slice();return null!=this._alpha&&t.push(this._alpha),t},getAlpha:function(){return null!=this._alpha?this._alpha:1},setAlpha:function(t){this._alpha=null==t?null:Math.min(Math.max(t,0),1),this._changed()},hasAlpha:function(){return null!=this._alpha},equals:function(t){var e=r.isPlainValue(t,!0)?F.read(arguments):t;return e===this||e&&this._class===e._class&&this._type===e._type&&this.getAlpha()===e.getAlpha()&&r.equals(this._components,e._components)||!1},toString:function(){for(var t=this._properties,e=[],i="gradient"===this._type,n=h.instance,r=0,s=t.length;r<s;r++){var a=this._components[r];null!=a&&e.push(t[r]+": "+(i?a:n.number(a)))}return null!=this._alpha&&e.push("alpha: "+n.number(this._alpha)),"{ "+e.join(", ")+" }"},toCSS:function(t){function e(t){return Math.round(255*(t<0?0:t>1?1:t))}var i=this._convert("rgb"),n=t||null==this._alpha?1:this._alpha;return i=[e(i[0]),e(i[1]),e(i[2])],n<1&&i.push(n<0?0:n),t?"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).slice(1):(4==i.length?"rgba(":"rgb(")+i.join(",")+")"},toCanvasStyle:function(t,e){if(this._canvasStyle)return this._canvasStyle;if("gradient"!==this._type)return this._canvasStyle=this.toCSS();var i,n=this._components,r=n[0],s=r._stops,a=n[1],o=n[2],h=n[3],u=e&&e.inverted();if(u&&(a=u._transformPoint(a),o=u._transformPoint(o),h&&(h=u._transformPoint(h))),r._radial){var l=o.getDistance(a);if(h){var c=h.subtract(a);c.getLength()>l&&(h=a.add(c.normalize(l-.1)))}var f=h||a;i=t.createRadialGradient(f.x,f.y,0,a.x,a.y,l)}else i=t.createLinearGradient(a.x,a.y,o.x,o.y);for(var d=0,_=s.length;d<_;d++){var g=s[d],v=g._offset;i.addColorStop(null==v?d/(_-1):v,g._color.toCanvasStyle())}return this._canvasStyle=i},transform:function(t){if("gradient"===this._type){for(var e=this._components,i=1,n=e.length;i<n;i++){var r=e[i];t._transformPoint(r,r,!0)}this._changed()}},statics:{_types:n,random:function(){var t=Math.random;return new F(t(),t(),t())}}})},new function(){var t={add:function(t,e){return t+e},subtract:function(t,e){return t-e},multiply:function(t,e){return t*e},divide:function(t,e){return t/e}};return r.each(t,function(t,e){this[e]=function(e){e=F.read(arguments);for(var i=this._type,n=this._components,r=e._convert(i),s=0,a=n.length;s<a;s++)r[s]=t(n[s],r[s]);return new F(i,r,null!=this._alpha?t(this._alpha,e.getAlpha()):null)}},{})}),R=r.extend({_class:"Gradient",initialize:function(t,e){this._id=l.get(),t&&r.isPlainObject(t)&&(this.set(t),t=e=null),null==this._stops&&this.setStops(t||["white","black"]),null==this._radial&&this.setRadial("string"==typeof e&&"radial"===e||e||!1)},_serialize:function(t,e){return e.add(this,function(){return r.serialize([this._stops,this._radial],t,!0,e)})},_changed:function(){for(var t=0,e=this._owners&&this._owners.length;t<e;t++)this._owners[t]._changed()},_addOwner:function(t){this._owners||(this._owners=[]),this._owners.push(t)},_removeOwner:function(t){var i=this._owners?this._owners.indexOf(t):-1;-1!=i&&(this._owners.splice(i,1),this._owners.length||(this._owners=e))},clone:function(){for(var t=[],e=0,i=this._stops.length;e<i;e++)t[e]=this._stops[e].clone();return new R(t,this._radial)},getStops:function(){return this._stops},setStops:function(t){if(t.length<2)throw new Error("Gradient stop list needs to contain at least two stops.");var i=this._stops;if(i)for(var n=0,r=i.length;n<r;n++)i[n]._owner=e;for(var n=0,r=(i=this._stops=q.readList(t,0,{clone:!0})).length;n<r;n++)i[n]._owner=this;this._changed()},getRadial:function(){return this._radial},setRadial:function(t){this._radial=t,this._changed()},equals:function(t){if(t===this)return!0;if(t&&this._class===t._class){var e=this._stops,i=t._stops,n=e.length;if(n===i.length){for(var r=0;r<n;r++)if(!e[r].equals(i[r]))return!1;return!0}}return!1}}),q=r.extend({_class:"GradientStop",initialize:function(t,i){var n=t,r=i;"object"==typeof t&&i===e&&(Array.isArray(t)&&"number"!=typeof t[0]?(n=t[0],r=t[1]):("color"in t||"offset"in t||"rampPoint"in t)&&(n=t.color,r=t.offset||t.rampPoint||0)),this.setColor(n),this.setOffset(r)},clone:function(){return new q(this._color.clone(),this._offset)},_serialize:function(t,e){var i=this._color,n=this._offset;return r.serialize(null==n?[i]:[i,n],t,!0,e)},_changed:function(){this._owner&&this._owner._changed(65)},getOffset:function(){return this._offset},setOffset:function(t){this._offset=t,this._changed()},getRampPoint:"#getOffset",setRampPoint:"#setOffset",getColor:function(){return this._color},setColor:function(){var t=F.read(arguments,0,{clone:!0});t&&(t._owner=this),this._color=t,this._changed()},equals:function(t){return t===this||t&&this._class===t._class&&this._color.equals(t._color)&&this._offset==t._offset||!1}}),V=r.extend(new function(){var t={fillColor:null,fillRule:"nonzero",strokeColor:null,strokeWidth:1,strokeCap:"butt",strokeJoin:"miter",strokeScaling:!0,miterLimit:10,dashOffset:0,dashArray:[],shadowColor:null,shadowBlur:0,shadowOffset:new c,selectedColor:null},i=r.set({},t,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),n=r.set({},i,{fillColor:new F}),s={strokeWidth:97,strokeCap:97,strokeJoin:97,strokeScaling:105,miterLimit:97,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},a={beans:!0},o={_class:"Style",beans:!0,initialize:function(e,r,s){this._values={},this._owner=r,this._project=r&&r._project||s||paper.project,this._defaults=!r||r instanceof x?i:r instanceof j?n:t,e&&this.set(e)}};return r.each(i,function(t,i){var n=/Color$/.test(i),h="shadowOffset"===i,u=r.capitalize(i),l=s[i],f="set"+u,d="get"+u;o[f]=function(t){var r=this._owner,s=r&&r._children;if(s&&s.length>0&&!(r instanceof N))for(var a=0,o=s.length;a<o;a++)s[a]._style[f](t);else if(i in this._defaults){var h=this._values[i];h!==t&&(n&&(h&&h._owner!==e&&(h._owner=e),t&&t.constructor===F&&(t._owner&&(t=t.clone()),t._owner=r)),this._values[i]=t,r&&r._changed(l||65))}},o[d]=function(t){var s,a=this._owner,o=a&&a._children;if(i in this._defaults&&(!o||!o.length||t||a instanceof N))if((s=this._values[i])===e)(s=this._defaults[i])&&s.clone&&(s=s.clone());else{var u=n?F:h?c:null;!u||s&&s.constructor===u||(this._values[i]=s=u.read([s],0,{readNull:!0,clone:!0}),s&&n&&(s._owner=a))}else if(o)for(var l=0,f=o.length;l<f;l++){var _=o[l]._style[d]();if(l){if(!r.equals(s,_))return e}else s=_}return s},a[d]=function(t){return this._style[d](t)},a[f]=function(t){this._style[f](t)}}),r.each({Font:"FontFamily",WindingRule:"FillRule"},function(t,e){var i="get"+e,n="set"+e;o[i]=a[i]="#get"+t,o[n]=a[n]="#set"+t}),w.inject(a),o},{set:function(t){var e=t instanceof V,i=e?t._values:t;if(i)for(var n in i)if(n in this._defaults){var r=i[n];this[n]=r&&e&&r.clone?r.clone():r}},equals:function(t){function i(t,i,n){var s=t._values,a=i._values,o=i._defaults;for(var h in s){var u=s[h],l=a[h];if(!(n&&h in a||r.equals(u,l===e?o[h]:l)))return!1}return!0}return t===this||t&&this._class===t._class&&i(this,t)&&i(t,this,!0)||!1},hasFill:function(){var t=this.getFillColor();return!!t&&t.alpha>0},hasStroke:function(){var t=this.getStrokeColor();return!!t&&t.alpha>0&&this.getStrokeWidth()>0},hasShadow:function(){var t=this.getShadowColor();return!!t&&t.alpha>0&&(this.getShadowBlur()>0||!this.getShadowOffset().isZero())},getView:function(){return this._project._view},getFontStyle:function(){var t=this.getFontSize();return this.getFontWeight()+" "+t+(/[a-z]/i.test(t+"")?" ":"px ")+this.getFontFamily()},getFont:"#getFontFamily",setFont:"#setFontFamily",getLeading:function t(){var e=t.base.call(this),i=this.getFontSize();return/pt|em|%|px/.test(i)&&(i=this.getView().getPixelSize(i)),null!=e?e:1.2*i}}),H=new function(){function t(t,e,i,n){for(var r=["","webkit","moz","Moz","ms","o"],s=e[0].toUpperCase()+e.substring(1),a=0;a<6;a++){var o=r[a],h=o?o+s:e;if(h in t){if(!i)return t[h];t[h]=n;break}}}return{getStyles:function(t){var e=t&&9!==t.nodeType?t.ownerDocument:t,i=e&&e.defaultView;return i&&i.getComputedStyle(t,"")},getBounds:function(t,e){var i,n=t.ownerDocument,r=n.body,s=n.documentElement;try{i=t.getBoundingClientRect()}catch(t){i={left:0,top:0,width:0,height:0}}var a=i.left-(s.clientLeft||r.clientLeft||0),o=i.top-(s.clientTop||r.clientTop||0);if(!e){var h=n.defaultView;a+=h.pageXOffset||s.scrollLeft||r.scrollLeft,o+=h.pageYOffset||s.scrollTop||r.scrollTop}return new g(a,o,i.width,i.height)},getViewportBounds:function(t){var e=t.ownerDocument,i=e.defaultView,n=e.documentElement;return new g(0,0,i.innerWidth||n.clientWidth,i.innerHeight||n.clientHeight)},getOffset:function(t,e){return H.getBounds(t,e).getPoint()},getSize:function(t){return H.getBounds(t,!0).getSize()},isInvisible:function(t){return H.getSize(t).equals(new d(0,0))},isInView:function(t){return!H.isInvisible(t)&&H.getViewportBounds(t).intersects(H.getBounds(t,!0))},isInserted:function(t){return n.body.contains(t)},getPrefixed:function(e,i){return e&&t(e,i)},setPrefixed:function(e,i,n){if("object"==typeof i)for(var r in i)t(e,r,!0,i[r]);else t(e,i,!0,n)}}},Z={add:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++)t.addEventListener(r[s],n,!1)},remove:function(t,e){if(t)for(var i in e)for(var n=e[i],r=i.split(/[\s,]+/g),s=0,a=r.length;s<a;s++)t.removeEventListener(r[s],n,!1)},getPoint:function(t){var e=t.targetTouches?t.targetTouches.length?t.targetTouches[0]:t.changedTouches[0]:t;return new c(e.pageX||e.clientX+n.documentElement.scrollLeft,e.pageY||e.clientY+n.documentElement.scrollTop)},getTarget:function(t){return t.target||t.srcElement},getRelatedTarget:function(t){return t.relatedTarget||t.toElement},getOffset:function(t,e){return Z.getPoint(t).subtract(H.getOffset(e||Z.getTarget(t)))}};Z.requestAnimationFrame=new function(){function t(){var e=s;s=[];for(var i=0,a=e.length;i<a;i++)e[i]();(r=n&&s.length)&&n(t)}var e,n=H.getPrefixed(i,"requestAnimationFrame"),r=!1,s=[];return function(i){s.push(i),n?r||(n(t),r=!0):e||(e=setInterval(t,1e3/60))}};var U=r.extend(s,{_class:"View",initialize:function t(e,r){function s(t){return r[t]||parseInt(r.getAttribute(t),10)}function o(){var t=H.getSize(r);return t.isNaN()||t.isZero()?new d(s("width"),s("height")):t}var h;if(i&&r){this._id=r.getAttribute("id"),null==this._id&&r.setAttribute("id",this._id="view-"+t._id++),Z.add(r,this._viewEvents);if(H.setPrefixed(r.style,{userDrag:"none",userSelect:"none",touchCallout:"none",contentZooming:"none",tapHighlightColor:"rgba(0,0,0,0)"}),a.hasAttribute(r,"resize")){var u=this;Z.add(i,this._windowEvents={resize:function(){u.setViewSize(o())}})}if(h=o(),a.hasAttribute(r,"stats")&&"undefined"!=typeof Stats){this._stats=new Stats;var l=this._stats.domElement,c=l.style,f=H.getOffset(r);c.position="absolute",c.left=f.x+"px",c.top=f.y+"px",n.body.appendChild(l)}}else h=new d(r),r=null;this._project=e,this._scope=e._scope,this._element=r,this._pixelRatio||(this._pixelRatio=i&&i.devicePixelRatio||1),this._setElementSize(h.width,h.height),this._viewSize=h,t._views.push(this),t._viewsById[this._id]=this,(this._matrix=new p)._owner=this,t._focused||(t._focused=this),this._frameItems={},this._frameItemCount=0,this._itemEvents={native:{},virtual:{}},this._autoUpdate=!paper.agent.node,this._needsUpdate=!1},remove:function(){if(!this._project)return!1;U._focused===this&&(U._focused=null),U._views.splice(U._views.indexOf(this),1),delete U._viewsById[this._id];var t=this._project;return t._view===this&&(t._view=null),Z.remove(this._element,this._viewEvents),Z.remove(i,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:r.each(w._itemHandlers.concat(["onResize","onKeyDown","onKeyUp"]),function(t){this[t]={}},{onFrame:{install:function(){this.play()},uninstall:function(){this.pause()}}}),_animate:!1,_time:0,_count:0,getAutoUpdate:function(){return this._autoUpdate},setAutoUpdate:function(t){this._autoUpdate=t,t&&this.requestUpdate()},update:function(){},draw:function(){this.update()},requestUpdate:function(){if(!this._requested){var t=this;Z.requestAnimationFrame(function(){if(t._requested=!1,t._animate){t.requestUpdate();var e=t._element;H.getPrefixed(n,"hidden")&&"true"!==a.getAttribute(e,"keepalive")||!H.isInView(e)||t._handleFrame()}t._autoUpdate&&t.update()}),this._requested=!0}},play:function(){this._animate=!0,this.requestUpdate()},pause:function(){this._animate=!1},_handleFrame:function(){paper=this._scope;var t=Date.now()/1e3,e=this._last?t-this._last:0;this._last=t,this.emit("frame",new r({delta:e,time:this._time+=e,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(t,e){var i=this._frameItems;e?(i[t._id]={item:t,time:0,count:0},1==++this._frameItemCount&&this.on("frame",this._handleFrameItems)):(delete i[t._id],0==--this._frameItemCount&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(t){for(var e in this._frameItems){var i=this._frameItems[e];i.item.emit("frame",new r(t,{time:i.time+=t.delta,count:i.count++}))}},_changed:function(){this._project._changed(2049),this._bounds=this._decomposed=e},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return 72*this._pixelRatio},getViewSize:function(){var t=this._viewSize;return new _(t.width,t.height,this,"setViewSize")},setViewSize:function(){var t=d.read(arguments),e=t.subtract(this._viewSize);e.isZero()||(this._setElementSize(t.width,t.height),this._viewSize.set(t),this._changed(),this.emit("resize",{size:t,delta:e}),this._autoUpdate&&this.update())},_setElementSize:function(t,e){var i=this._element;i&&(i.width!==t&&(i.width=t),i.height!==e&&(i.height=e))},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new g(new c,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return H.isInView(this._element)},isInserted:function(){return H.isInserted(this._element)},getPixelSize:function(t){var e,i=this._element;if(i){var r=i.parentNode,s=n.createElement("div");s.style.fontSize=t,r.appendChild(s),e=parseFloat(H.getStyles(s).fontSize),r.removeChild(s)}else e=parseFloat(e);return e},getTextWidth:function(t,e){return 0}},r.each(["rotate","scale","shear","skew"],function(t){var e="rotate"===t;this[t]=function(){var i=(e?r:c).read(arguments),n=c.read(arguments,0,{readNull:!0});return this.transform((new p)[t](i,n||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var t=new p;return this.transform(t.translate.apply(t,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var t=c.read(arguments);this.translate(this.getCenter().subtract(t))},getZoom:function(){var t=this._decompose(),e=t&&t.scaling;return e?(e.x+e.y)/2:0},setZoom:function(t){this.transform((new p).scale(t/this.getZoom(),this.getCenter()))},getRotation:function(){var t=this._decompose();return t&&t.rotation},setRotation:function(t){var e=this.getRotation();null!=e&&null!=t&&this.rotate(t-e)},getScaling:function(){var t=this._decompose(),i=t&&t.scaling;return i?new f(i.x,i.y,this,"setScaling"):e},setScaling:function(){var t=this.getScaling(),e=c.read(arguments,0,{clone:!0,readNull:!0});t&&e&&this.scale(e.x/t.x,e.y/t.y)},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.initialize.apply(t,arguments)},transform:function(t){this._matrix.append(t)},scrollBy:function(){this.translate(c.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(c.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(c.read(arguments))},getEventPoint:function(t){return this.viewToProject(Z.getOffset(t,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(t,e){return n&&"string"==typeof e&&(e=n.getElementById(e)),new(i?W:U)(t,e)}}},new function(){function t(t){var e=Z.getTarget(t);return e.getAttribute&&U._viewsById[e.getAttribute("id")]}function e(){var t=U._focused;if(!t||!t.isVisible())for(var e=0,i=U._views.length;e<i;e++)if((t=U._views[e]).isVisible()){U._focused=h=t;break}}function r(t,e,i){t._handleMouseEvent("mousemove",e,i)}function s(t,e,i,n,r,s,a){function o(t,i){if(t.responds(i)){if(h||(h=new X(i,n,r,e||t,s?r.subtract(s):null)),t.emit(i,h)&&(I=!0,h.prevented&&(M=!0),h.stopped))return u=!0}else{var a=T[i];if(a)return o(t,a)}}for(var h,u=!1;t&&t!==a&&!o(t,i);)t=t._parent;return u}function a(t,e,i,n,r,a){return t._project.removeOn(i),M=I=!1,b&&s(b,null,i,n,r,a)||e&&e!==b&&!e.isDescendant(b)&&s(e,null,i,n,r,a,b)||s(t,b||e||t,i,n,r,a)}if(i){var o,h,u,l,c,f=!1,d=!1,_=i.navigator;_.pointerEnabled||_.msPointerEnabled?(u="pointerdown MSPointerDown",l="pointermove MSPointerMove",c="pointerup pointercancel MSPointerUp MSPointerCancel"):(u="touchstart",l="touchmove",c="touchend touchcancel","ontouchstart"in i&&_.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(u+=" mousedown",l+=" mousemove",c+=" mouseup"));var g={},v={mouseout:function(t){var e=U._focused,i=Z.getRelatedTarget(t);if(e&&(!i||"HTML"===i.nodeName)){var n=Z.getOffset(t,e._element),s=n.x,a=Math.abs,o=a(s),h=o-(1<<25);n.x=a(h)<o?h*(s<0?-1:1):s,r(e,t,e.viewToProject(n))}},scroll:e};g[u]=function(e){var i=U._focused=t(e);f||(f=!0,i._handleMouseEvent("mousedown",e))},v[l]=function(i){var n=U._focused;if(!d){var s=t(i);s?n!==s&&(n&&r(n,i),o||(o=n),n=U._focused=h=s):h&&h===n&&(o&&!o.isInserted()&&(o=null),n=U._focused=o,o=null,e())}n&&r(n,i)},v[u]=function(){d=!0},v[c]=function(t){var e=U._focused;e&&f&&e._handleMouseEvent("mouseup",t),d=f=!1},Z.add(n,v),Z.add(i,{load:e});var p,m,y,w,x,b,C,S,P,I=!1,M=!1,T={doubleclick:"click",mousedrag:"mousemove"},z=!1,k={mousedown:{mousedown:1,mousedrag:1,click:1,doubleclick:1},mouseup:{mouseup:1,mousedrag:1,click:1,doubleclick:1},mousemove:{mousedrag:1,mousemove:1,mouseenter:1,mouseleave:1}};return{_viewEvents:g,_handleMouseEvent:function(t,e,i){function n(t){return r.virtual[t]||l.responds(t)||u&&u.responds(t)}var r=this._itemEvents,o=r.native[t],h="mousemove"===t,u=this._scope.tool,l=this;h&&f&&n("mousedrag")&&(t="mousedrag"),i||(i=this.getEventPoint(e));var c=this.getBounds().contains(i),d=o&&c&&l._project.hitTest(i,{tolerance:0,fill:!0,stroke:!0}),_=d&&d.item||null,g=!1,v={};if(v[t.substr(5)]=!0,o&&_!==x&&(x&&s(x,null,"mouseleave",e,i),_&&s(_,null,"mouseenter",e,i),x=_),z^c&&(s(this,null,c?"mouseenter":"mouseleave",e,i),p=c?this:null,g=!0),!c&&!v.drag||i.equals(y)||(a(this,_,h?t:"mousemove",e,i,y),g=!0),z=c,v.down&&c||v.up&&m){if(a(this,_,t,e,i,m),v.down){if(P=_===C&&Date.now()-S<300,w=C=_,!M&&_){for(var T=_;T&&!T.responds("mousedrag");)T=T._parent;T&&(b=_)}m=i}else v.up&&(M||_!==w||(S=Date.now(),a(this,_,P?"doubleclick":"click",e,i,m),P=!1),w=b=null);z=!1,g=!0}y=i,g&&u&&(I=u._handleMouseEvent(t,e,i,v)||I),(I&&!v.move||v.down&&n("mouseup"))&&e.preventDefault()},_handleKeyEvent:function(t,e,i,n){function r(r){r.responds(t)&&(paper=a,r.emit(t,s=s||new J(t,e,i,n)))}var s,a=this._scope,o=a.tool;this.isVisible()&&(r(this),o&&o.responds(t)&&r(o))},_countItemEvent:function(t,e){var i=this._itemEvents,n=i.native,r=i.virtual;for(var s in k)n[s]=(n[s]||0)+(k[s][t]||0)*e;r[t]=(r[t]||0)+e},statics:{updateFocus:e}}}}),W=U.extend({_class:"CanvasView",initialize:function(t,e){if(!(e instanceof i.HTMLCanvasElement)){var n=d.read(arguments,1);if(n.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+r.slice(arguments,1));e=Q.getCanvas(n)}var s=this._context=e.getContext("2d");if(s.save(),this._pixelRatio=1,!/^off|false$/.test(a.getAttribute(e,"hidpi"))){var o=i.devicePixelRatio||1,h=H.getPrefixed(s,"backingStorePixelRatio")||1;this._pixelRatio=o/h}U.call(this,t,e),this._needsUpdate=!0},remove:function t(){return this._context.restore(),t.base.call(this)},_setElementSize:function t(e,i){var n=this._pixelRatio;if(t.base.call(this,e*n,i*n),1!==n){var r=this._element,s=this._context;if(!a.hasAttribute(r,"resize")){var o=r.style;o.width=e+"px",o.height=i+"px"}s.restore(),s.save(),s.scale(n,n)}},getPixelSize:function t(e){var i,n=paper.agent;if(n&&n.firefox)i=t.base.call(this,e);else{var r=this._context,s=r.font;r.font=e+" serif",i=parseFloat(r.font),r.font=s}return i},getTextWidth:function(t,e){var i=this._context,n=i.font,r=0;i.font=t;for(var s=0,a=e.length;s<a;s++)r=Math.max(r,i.measureText(e[s]).width);return i.font=n,r},update:function(){if(!this._needsUpdate)return!1;var t=this._project,e=this._context,i=this._viewSize;return e.clearRect(0,0,i.width+1,i.height+1),t&&t.draw(e,this._matrix,this._pixelRatio),this._needsUpdate=!1,!0}}),G=r.extend({_class:"Event",initialize:function(t){this.event=t,this.type=t&&t.type},prevented:!1,stopped:!1,preventDefault:function(){this.prevented=!0,this.event.preventDefault()},stopPropagation:function(){this.stopped=!0,this.event.stopPropagation()},stop:function(){this.stopPropagation(),this.preventDefault()},getTimeStamp:function(){return this.event.timeStamp},getModifiers:function(){return $.modifiers}}),J=G.extend({_class:"KeyEvent",initialize:function(t,e,i,n){this.type=t,this.event=e,this.key=i,this.character=n},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),$=new function(){function t(t){var i=t.key||t.keyIdentifier;return i=/^U\+/.test(i)?String.fromCharCode(parseInt(i.substr(2),16)):/^Arrow[A-Z]/.test(i)?i.substr(5):"Unidentified"===i||i===e?String.fromCharCode(t.keyCode):i,h[i]||(i.length>1?r.hyphenate(i):i.toLowerCase())}function s(t,e,i,n){var o,h=U._focused;if(l[e]=t,t?c[e]=i:delete c[e],e.length>1&&(o=r.camelize(e))in f){f[o]=t;var u=paper&&paper.agent;if("meta"===o&&u&&u.mac)if(t)a={};else{for(var d in a)d in c&&s(!1,d,a[d],n);a=null}}else t&&a&&(a[e]=i);h&&h._handleKeyEvent(t?"keydown":"keyup",n,e,i)}var a,o,h={"\t":"tab"," ":"space","\b":"backspace","":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},u={tab:"\t",space:" ",enter:"\r"},l={},c={},f=new r({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var t=paper&&paper.agent;return t&&t.mac?this.meta:this.control}}});return Z.add(n,{keydown:function(e){var i=t(e),n=paper&&paper.agent;i.length>1||n&&n.chrome&&(e.altKey||n.mac&&e.metaKey||!n.mac&&e.ctrlKey)?s(!0,i,u[i]||(i.length>1?"":i),e):o=i},keypress:function(e){if(o){var i=t(e),n=e.charCode,r=n>=32?String.fromCharCode(n):i.length>1?"":i;i!==o&&(i=r.toLowerCase()),s(!0,i,r,e),o=null}},keyup:function(e){var i=t(e);i in c&&s(!1,i,c[i],e)}}),Z.add(i,{blur:function(t){for(var e in c)s(!1,e,c[e],t)}}),{modifiers:f,isDown:function(t){return!!l[t]}}},X=G.extend({_class:"MouseEvent",initialize:function(t,e,i,n,r){this.type=t,this.event=e,this.point=i,this.target=n,this.delta=r},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),Y=G.extend({_class:"ToolEvent",_item:null,initialize:function(t,e,i){this.tool=t,this.type=e,this.event=i},_choosePoint:function(t,e){return t||(e?e.clone():null)},getPoint:function(){return this._choosePoint(this._point,this.tool._point)},setPoint:function(t){this._point=t},getLastPoint:function(){return this._choosePoint(this._lastPoint,this.tool._lastPoint)},setLastPoint:function(t){this._lastPoint=t},getDownPoint:function(){return this._choosePoint(this._downPoint,this.tool._downPoint)},setDownPoint:function(t){this._downPoint=t},getMiddlePoint:function(){return!this._middlePoint&&this.tool._lastPoint?this.tool._point.add(this.tool._lastPoint).divide(2):this._middlePoint},setMiddlePoint:function(t){this._middlePoint=t},getDelta:function(){return!this._delta&&this.tool._lastPoint?this.tool._point.subtract(this.tool._lastPoint):this._delta},setDelta:function(t){this._delta=t},getCount:function(){return this.tool[/^mouse(down|up)$/.test(this.type)?"_downCount":"_moveCount"]},setCount:function(t){this.tool[/^mouse(down|up)$/.test(this.type)?"downCount":"count"]=t},getItem:function(){if(!this._item){var t=this.tool._scope.project.hitTest(this.getPoint());if(t){for(var e=t.item,i=e._parent;/^(Group|CompoundPath)$/.test(i._class);)e=i,i=i._parent;this._item=e}}return this._item},setItem:function(t){this._item=t},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),K=(o.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(t){o.call(this),this._moveCount=-1,this._downCount=-1,this.set(t)},getMinDistance:function(){return this._minDistance},setMinDistance:function(t){this._minDistance=t,null!=t&&null!=this._maxDistance&&t>this._maxDistance&&(this._maxDistance=t)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(t){this._maxDistance=t,null!=this._minDistance&&null!=t&&t<this._minDistance&&(this._minDistance=t)},getFixedDistance:function(){return this._minDistance==this._maxDistance?this._minDistance:null},setFixedDistance:function(t){this._minDistance=this._maxDistance=t},_handleMouseEvent:function(t,e,i,n){function r(t,e){var r=i,s=a?c._point:c._downPoint||r;if(a){if(c._moveCount&&r.equals(s))return!1;if(s&&(null!=t||null!=e)){var o=r.subtract(s),h=o.getLength();if(h<(t||0))return!1;e&&(r=s.add(o.normalize(Math.min(h,e))))}c._moveCount++}return c._point=r,c._lastPoint=s||r,n.down&&(c._moveCount=-1,c._downPoint=r,c._downCount++),!0}function s(){o&&(l=c.emit(t,new Y(c,t,e))||l)}paper=this._scope,n.drag&&!this.responds(t)&&(t="mousemove");var a=n.move||n.drag,o=this.responds(t),h=this.minDistance,u=this.maxDistance,l=!1,c=this;if(n.down)r(),s();else if(n.up)r(null,u),s();else if(o)for(;r(h,u);)s();return l}}),{request:function(e){var i=new t.XMLHttpRequest;return i.open((e.method||"get").toUpperCase(),e.url,r.pick(e.async,!0)),e.mimeType&&i.overrideMimeType(e.mimeType),i.onload=function(){var t=i.status;0===t||200===t?e.onLoad&&e.onLoad.call(i,i.responseText):i.onerror()},i.onerror=function(){var t=i.status,n='Could not load "'+e.url+'" (Status: '+t+")";if(!e.onError)throw new Error(n);e.onError(n,t)},i.send(null)}}),Q={canvases:[],getCanvas:function(t,e){if(!i)return null;var r,s=!0;"object"==typeof t&&(e=t.height,t=t.width),this.canvases.length?r=this.canvases.pop():(r=n.createElement("canvas"),s=!1);var a=r.getContext("2d",{"willReadFrequently":true});if(!a)throw new Error("Canvas "+r+" is unable to provide a 2D context.");return r.width===t&&r.height===e?s&&a.clearRect(0,0,t+1,e+1):(r.width=t,r.height=e),a.save(),r},getContext:function(t,e){var i=this.getCanvas(t,e);return i?i.getContext("2d"):null},release:function(t){var e=t&&t.canvas?t.canvas:t;e&&e.getContext&&(e.getContext("2d").restore(),this.canvases.push(e))}},tt=new function(){function t(t,e,i){return.2989*t+.587*e+.114*i}function e(e,i,n,r){var s=r-t(e,i,n),r=t(d=e+s,_=i+s,g=n+s),a=v(d,_,g),o=p(d,_,g);if(a<0){var h=r-a;d=r+(d-r)*r/h,_=r+(_-r)*r/h,g=r+(g-r)*r/h}if(o>255){var u=255-r,l=o-r;d=r+(d-r)*u/l,_=r+(_-r)*u/l,g=r+(g-r)*u/l}}function i(t,e,i){return p(t,e,i)-v(t,e,i)}function n(t,e,i,n){var r,s=[t,e,i],a=p(t,e,i),o=v(t,e,i);r=0===v(o=o===t?0:o===e?1:2,a=a===t?0:a===e?1:2)?1===p(o,a)?2:1:0,s[a]>s[o]?(s[r]=(s[r]-s[o])*n/(s[a]-s[o]),s[a]=n):s[r]=s[a]=0,s[o]=0,d=s[0],_=s[1],g=s[2]}var s,a,o,h,u,l,c,f,d,_,g,v=Math.min,p=Math.max,m=Math.abs,y={multiply:function(){d=u*s/255,_=l*a/255,g=c*o/255},screen:function(){d=u+s-u*s/255,_=l+a-l*a/255,g=c+o-c*o/255},overlay:function(){d=u<128?2*u*s/255:255-2*(255-u)*(255-s)/255,_=l<128?2*l*a/255:255-2*(255-l)*(255-a)/255,g=c<128?2*c*o/255:255-2*(255-c)*(255-o)/255},"soft-light":function(){var t=s*u/255;d=t+u*(255-(255-u)*(255-s)/255-t)/255,_=(t=a*l/255)+l*(255-(255-l)*(255-a)/255-t)/255,g=(t=o*c/255)+c*(255-(255-c)*(255-o)/255-t)/255},"hard-light":function(){d=s<128?2*s*u/255:255-2*(255-s)*(255-u)/255,_=a<128?2*a*l/255:255-2*(255-a)*(255-l)/255,g=o<128?2*o*c/255:255-2*(255-o)*(255-c)/255},"color-dodge":function(){d=0===u?0:255===s?255:v(255,255*u/(255-s)),_=0===l?0:255===a?255:v(255,255*l/(255-a)),g=0===c?0:255===o?255:v(255,255*c/(255-o))},"color-burn":function(){d=255===u?255:0===s?0:p(0,255-255*(255-u)/s),_=255===l?255:0===a?0:p(0,255-255*(255-l)/a),g=255===c?255:0===o?0:p(0,255-255*(255-c)/o)},darken:function(){d=u<s?u:s,_=l<a?l:a,g=c<o?c:o},lighten:function(){d=u>s?u:s,_=l>a?l:a,g=c>o?c:o},difference:function(){(d=u-s)<0&&(d=-d),(_=l-a)<0&&(_=-_),(g=c-o)<0&&(g=-g)},exclusion:function(){d=u+s*(255-u-u)/255,_=l+a*(255-l-l)/255,g=c+o*(255-c-c)/255},hue:function(){n(s,a,o,i(u,l,c)),e(d,_,g,t(u,l,c))},saturation:function(){n(u,l,c,i(s,a,o)),e(d,_,g,t(u,l,c))},luminosity:function(){e(u,l,c,t(s,a,o))},color:function(){e(s,a,o,t(u,l,c))},add:function(){d=v(u+s,255),_=v(l+a,255),g=v(c+o,255)},subtract:function(){d=p(u-s,0),_=p(l-a,0),g=p(c-o,0)},average:function(){d=(u+s)/2,_=(l+a)/2,g=(c+o)/2},negation:function(){d=255-m(255-s-u),_=255-m(255-a-l),g=255-m(255-o-c)}},w=this.nativeModes=r.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(t){this[t]=!0},{}),x=Q.getContext(1,1);x&&(r.each(y,function(t,e){var i="darken"===e,n=!1;x.save();try{x.fillStyle=i?"#300":"#a00",x.fillRect(0,0,1,1),x.globalCompositeOperation=e,x.globalCompositeOperation===e&&(x.fillStyle=i?"#a00":"#300",x.fillRect(0,0,1,1),n=x.getImageData(0,0,1,1).data[0]!==i?170:51)}catch(t){}x.restore(),w[e]=n}),Q.release(x)),this.process=function(t,e,i,n,r){var v=e.canvas,p="normal"===t;if(p||w[t])i.save(),i.setTransform(1,0,0,1,0,0),i.globalAlpha=n,p||(i.globalCompositeOperation=t),i.drawImage(v,r.x,r.y),i.restore();else{var m=y[t];if(!m)return;for(var x=i.getImageData(r.x,r.y,v.width,v.height),b=x.data,C=e.getImageData(0,0,v.width,v.height).data,S=0,P=b.length;S<P;S+=4){s=C[S],u=b[S],a=C[S+1],l=b[S+1],o=C[S+2],c=b[S+2],h=C[S+3],f=b[S+3],m();var I=h*n/255,M=1-I;b[S]=I*d+M*u,b[S+1]=I*_+M*l,b[S+2]=I*g+M*c,b[S+3]=h*n+M*f}i.putImageData(x,r.x,r.y)}}},et=new function(){function t(t,e,i){for(var n in e){var r=e[n],a=s[n];"number"==typeof r&&i&&(r=i.number(r)),a?t.setAttributeNS(a,n,r):t.setAttribute(n,r)}return t}var e="http://www.w3.org/2000/svg",i="http://www.w3.org/2000/xmlns",r="http://www.w3.org/1999/xlink",s={href:r,xlink:i,xmlns:i+"/","xmlns:xlink":i+"/"};return{svg:e,xmlns:i,xlink:r,create:function(i,r,s){return t(n.createElementNS(e,i),r,s)},get:function(t,e){var i=s[e],n=i?t.getAttributeNS(i,e):t.getAttribute(e);return"null"===n?null:n},set:t}},it=r.each({fillColor:["fill","color"],fillRule:["fill-rule","string"],strokeColor:["stroke","color"],strokeWidth:["stroke-width","number"],strokeCap:["stroke-linecap","string"],strokeJoin:["stroke-linejoin","string"],strokeScaling:["vector-effect","lookup",{true:"none",false:"non-scaling-stroke"},function(t,e){return!e&&(t instanceof A||t instanceof C||t instanceof j)}],miterLimit:["stroke-miterlimit","number"],dashArray:["stroke-dasharray","array"],dashOffset:["stroke-dashoffset","number"],fontFamily:["font-family","string"],fontWeight:["font-weight","string"],fontSize:["font-size","number"],justification:["text-anchor","lookup",{left:"start",center:"middle",right:"end"}],opacity:["opacity","number"],blendMode:["mix-blend-mode","style"]},function(t,e){var i=r.capitalize(e),n=t[2];this[e]={type:t[1],property:e,attribute:t[0],toSVG:n,fromSVG:n&&r.each(n,function(t,e){this[t]=e},{}),exportFilter:t[3],get:"get"+i,set:"set"+i}},{});return new function(){function e(t,e,i){var n=new r,s=t.getTranslation();if(e){var a=(t=t._shiftless())._inverseTransform(s);n[i?"cx":"x"]=a.x,n[i?"cy":"y"]=a.y,s=null}if(!t.isIdentity()){var o=t.decompose();if(o){var h=[],l=o.rotation,c=o.scaling,f=o.skewing;s&&!s.isZero()&&h.push("translate("+v.point(s)+")"),l&&h.push("rotate("+v.number(l)+")"),u.isZero(c.x-1)&&u.isZero(c.y-1)||h.push("scale("+v.point(c)+")"),f.x&&h.push("skewX("+v.number(f.x)+")"),f.y&&h.push("skewY("+v.number(f.y)+")"),n.transform=h.join(" ")}else n.transform="matrix("+t.getValues().join(",")+")"}return n}function i(t,i){for(var n=e(t._matrix),r=t._children,s=et.create("g",n,v),a=0,o=r.length;a<o;a++){var h=r[a],u=d(h,i);if(u)if(h.isClipMask()){var l=et.create("clipPath");l.appendChild(u),c(h,l,"clip"),et.set(s,{"clip-path":"url(#"+l.id+")"})}else s.appendChild(u)}return s}function n(t){var i=t._type,n=t._radius,r=e(t._matrix,!0,"rectangle"!==i);if("rectangle"===i){i="rect";var s=t._size,a=s.width,o=s.height;r.x-=a/2,r.y-=o/2,r.width=a,r.height=o,n.isZero()&&(n=null)}return n&&("circle"===i?r.r=n:(r.rx=n.width,r.ry=n.height)),et.create(i,r,v)}function s(t){var e=o(t,"color");if(!e){var i,n=t.getGradient(),r=n._radial,s=t.getOrigin(),a=t.getDestination();if(r){i={cx:s.x,cy:s.y,r:s.getDistance(a)};var h=t.getHighlight();h&&(i.fx=h.x,i.fy=h.y)}else i={x1:s.x,y1:s.y,x2:a.x,y2:a.y};i.gradientUnits="userSpaceOnUse",e=et.create((r?"radial":"linear")+"Gradient",i,v);for(var u=n._stops,l=0,f=u.length;l<f;l++){var d=u[l],_=d._color,g=_.getAlpha(),p=d._offset;i={offset:null==p?l/(f-1):p},_&&(i["stop-color"]=_.toCSS(!0)),g<1&&(i["stop-opacity"]=g),e.appendChild(et.create("stop",i,v))}c(t,e,"color")}return"url(#"+e.id+")"}function a(t,e,i){var n={},a=!i&&t.getParent(),o=[];return null!=t._name&&(n.id=t._name),r.each(it,function(e){var i=e.get,h=e.type,u=t[i]();if(e.exportFilter?e.exportFilter(t,u):!a||!r.equals(a[i](),u)){if("color"===h&&null!=u){var l=u.getAlpha();l<1&&(n[e.attribute+"-opacity"]=l)}"style"===h?o.push(e.attribute+": "+u):n[e.attribute]=null==u?"none":"color"===h?u.gradient?s(u,t):u.toCSS(!0):"array"===h?u.join(","):"lookup"===h?e.toSVG[u]:u}}),o.length&&(n.style=o.join(";")),1===n.opacity&&delete n.opacity,t._visible||(n.visibility="hidden"),et.set(e,n,v)}function o(t,e){return m||(m={ids:{},svgs:{}}),t&&m.svgs[e+"-"+(t._id||t.__id||(t.__id=l.get("svg")))]}function c(t,e,i){m||o();var n=m.ids[i]=(m.ids[i]||0)+1;e.id=i+"-"+n,m.svgs[i+"-"+(t._id||t.__id)]=e}function f(e,i){var n=e,r=null;if(m){n="svg"===e.nodeName.toLowerCase()&&e;for(var s in m.svgs)r||(n||(n=et.create("svg")).appendChild(e),r=n.insertBefore(et.create("defs"),n.firstChild)),r.appendChild(m.svgs[s]);m=null}return i.asString?(new t.XMLSerializer).serializeToString(n):n}function d(t,e,i){var n=x[t._class],r=n&&n(t,e);if(r){var s=e.onExport;s&&(r=s(t,r,e)||r);var o=JSON.stringify(t._data);o&&"{}"!==o&&"null"!==o&&r.setAttribute("data-paper-data",o)}return r&&a(t,r,i)}function _(t){return t||(t={}),v=new h(t.precision),t}var v,m,x={Group:i,Layer:i,Raster:function(t,i){var n=e(t._matrix,!0),r=t.getSize(),s=t.getImage();return n.x-=r.width/2,n.y-=r.height/2,n.width=r.width,n.height=r.height,n.href=0==i.embedImages&&s&&s.src||t.toDataURL(),et.create("image",n,v)},Path:function(t,i){var r=i.matchShapes;if(r){var s=t.toShape(!1);if(s)return n(s)}var a,o=t._segments,h=o.length,u=e(t._matrix);if(r&&h>=2&&!t.hasHandles())if(h>2){a=t._closed?"polygon":"polyline";for(var l=[],c=0;c<h;c++)l.push(v.point(o[c]._point));u.points=l.join(" ")}else{a="line";var f=o[0]._point,d=o[1]._point;u.set({x1:f.x,y1:f.y,x2:d.x,y2:d.y})}else a="path",u.d=t.getPathData(null,i.precision);return et.create(a,u,v)},Shape:n,CompoundPath:function(t,i){var n=e(t._matrix),r=t.getPathData(null,i.precision);return r&&(n.d=r),et.create("path",n,v)},SymbolItem:function(t,i){var n=e(t._matrix,!0),r=t._definition,s=o(r,"symbol"),a=r._item,h=a.getBounds();return s||((s=et.create("symbol",{viewBox:v.rectangle(h)})).appendChild(d(a,i)),c(r,s,"symbol")),n.href="#"+s.id,n.x+=h.x,n.y+=h.y,n.width=h.width,n.height=h.height,n.overflow="visible",et.create("use",n,v)},PointText:function(t){var i=et.create("text",e(t._matrix,!0),v);return i.textContent=t._content,i}};w.inject({exportSVG:function(t){return t=_(t),f(d(this,t,!0),t)}}),y.inject({exportSVG:function(t){t=_(t);var i=this._children,n=this.getView(),s=r.pick(t.bounds,"view"),a=t.matrix||"view"===s&&n._matrix,o=a&&p.read([a]),h="view"===s?new g([0,0],n.getViewSize()):"content"===s?w._getBounds(i,o,{stroke:!0}).rect:g.read([s],0,{readNull:!0}),u={version:"1.1",xmlns:et.svg,"xmlns:xlink":et.xlink};h&&(u.width=h.width,u.height=h.height,(h.x||h.y)&&(u.viewBox=v.rectangle(h)));var l=et.create("svg",u,v),c=l;o&&!o.isIdentity()&&(c=l.appendChild(et.create("g",e(o),v)));for(var m=0,y=i.length;m<y;m++)c.appendChild(d(i[m],t,!0));return f(l,t)}})},new function(){function s(t,e,i,n,r){var s=et.get(t,e),a=null==s?n?null:i?"":0:i?s:parseFloat(s);return/%\s*$/.test(s)?a/100*(r?1:z[/x|^width/.test(e)?"width":"height"]):a}function a(t,e,i,n,r){return e=s(t,e||"x",!1,n,r),i=s(t,i||"y",!1,n,r),!n||null!=e&&null!=i?new c(e,i):null}function o(t,e,i,n,r){return e=s(t,e||"width",!1,n,r),i=s(t,i||"height",!1,n,r),!n||null!=e&&null!=i?new d(e,i):null}function h(t,e,i){return"none"===t?null:"number"===e?parseFloat(t):"array"===e?t?t.split(/[\s,]+/g).map(parseFloat):[]:"color"===e?P(t)||t:"lookup"===e?i[t]:t}function u(t,e,i,n){var r=t.childNodes,s="clippath"===e,a="defs"===e,o=new x,h=o._project,u=h._currentStyle,l=[];if(s||a||(o=b(o,t,n),h._currentStyle=o._style.clone()),n)for(var c=t.querySelectorAll("defs"),f=0,d=c.length;f<d;f++)M(c[f],i,!1);for(var f=0,d=r.length;f<d;f++){var _,g=r[f];1!==g.nodeType||/^defs$/i.test(g.nodeName)||!(_=M(g,i,!1))||_ instanceof I||l.push(_)}return o.addChildren(l),s&&(o=b(o.reduce(),t,n)),h._currentStyle=u,(s||a)&&(o.remove(),o=null),o}function l(t,e){for(var i=t.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),n=[],r=0,s=i.length;r<s;r+=2)n.push(new c(parseFloat(i[r]),parseFloat(i[r+1])));var a=new L(n);return"polygon"===e&&a.closePath(),a}function f(t,e){var i,n=(s(t,"href",!0)||"").substring(1),r="radialgradient"===e;if(n)(i=k[n].getGradient())._radial^r&&((i=i.clone())._radial=r);else{for(var o=t.childNodes,h=[],u=0,l=o.length;u<l;u++){var c=o[u];1===c.nodeType&&h.push(b(new q,c))}i=new R(h,r)}var f,d,_,g="userSpaceOnUse"!==s(t,"gradientUnits",!0);return r?(d=(f=a(t,"cx","cy",!1,g)).add(s(t,"r",!1,!1,g),0),_=a(t,"fx","fy",!0,g)):(f=a(t,"x1","y1",!1,g),d=a(t,"x2","y2",!1,g)),b(new F(i,f,d,_),t)._scaleToBounds=g,null}function _(t,e,i,n){if(t.transform){for(var r=(n.getAttribute(i)||"").split(/\)\s*/g),s=new p,a=0,o=r.length;a<o;a++){var h=r[a];if(!h)break;for(var u=h.split(/\(\s*/),l=u[0],c=u[1].split(/[\s,]+/g),f=0,d=c.length;f<d;f++)c[f]=parseFloat(c[f]);switch(l){case"matrix":s.append(new p(c[0],c[1],c[2],c[3],c[4],c[5]));break;case"rotate":s.rotate(c[0],c[1],c[2]);break;case"translate":s.translate(c[0],c[1]);break;case"scale":s.scale(c);break;case"skewX":s.skew(c[0],0);break;case"skewY":s.skew(0,c[0])}}t.transform(s)}}function v(t,e,i){var n="fill-opacity"===i?"getFillColor":"getStrokeColor",r=t[n]&&t[n]();r&&r.setAlpha(parseFloat(e))}function m(t,i,n){var s=t.attributes[i],a=s&&s.value;if(!a){var o=r.camelize(i);(a=t.style[o])||n.node[o]===n.parent[o]||(a=n.node[o])}return a?"none"===a?null:a:e}function b(t,i,n){if(i.style){var s=i.parentNode,a={node:H.getStyles(i)||{},parent:!n&&!/^defs$/i.test(s.tagName)&&H.getStyles(s)||{}};r.each(N,function(n,r){var s=m(i,r,a);t=s!==e&&n(t,s,r,i,a)||t})}return t}function P(t){var e=t&&t.match(/\((?:["'#]*)([^"')]+)/),n=e&&e[1],r=n&&k[i?n.replace(i.location.href.split("#")[0]+"#",""):n];return r&&r._scaleToBounds&&((r=r.clone())._scaleToBounds=!0),r}function M(t,e,i){var s,a,h,u=t.nodeName.toLowerCase(),l="#document"!==u,c=n.body;i&&l&&(z=paper.getView().getSize(),z=o(t,null,null,!0)||z,s=et.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),a=t.parentNode,h=t.nextSibling,s.appendChild(t),c.appendChild(s));var f=paper.settings,d=f.applyMatrix,_=f.insertItems;f.applyMatrix=!1,f.insertItems=!1;var g=O[u],v=g&&g(t,u,e,i)||null;if(f.insertItems=_,f.applyMatrix=d,v){!l||v instanceof x||(v=b(v,t,i));var p=e.onImport,m=l&&t.getAttribute("data-paper-data");p&&(v=p(t,v,e)||v),e.expandShapes&&v instanceof C&&(v.remove(),v=v.toPath()),m&&(v._data=JSON.parse(m))}return s&&(c.removeChild(s),a&&(h?a.insertBefore(t,h):a.appendChild(t))),i&&(k={},v&&r.pick(e.applyMatrix,d)&&v.matrix.apply(!0,!0)),v}function T(i,r,s){function a(n){try{var a="object"==typeof n?n:(new t.DOMParser).parseFromString(n,"image/svg+xml");if(!a.nodeName)throw a=null,new Error("Unsupported SVG source: "+i);paper=h,u=M(a,r,!0),r&&!1===r.insert||s._insertItem(e,u);var l=r.onLoad;l&&l(u,n)}catch(t){o(t)}}function o(t,e){var i=r.onError;if(!i)throw new Error(t);i(t,e)}if(!i)return null;r="function"==typeof r?{onLoad:r}:r||{};var h=paper,u=null;if("string"!=typeof i||/^.*</.test(i)){if("undefined"!=typeof File&&i instanceof File){var l=new FileReader;return l.onload=function(){a(l.result)},l.onerror=function(){o(l.error)},l.readAsText(i)}a(i)}else{var c=n.getElementById(i);c?a(c):K.request({url:i,async:!0,onLoad:a,onError:o})}return u}var z,k={},O={"#document":function(t,e,i,n){for(var r=t.childNodes,s=0,a=r.length;s<a;s++){var o=r[s];if(1===o.nodeType)return M(o,i,n)}},g:u,svg:u,clippath:u,polygon:l,polyline:l,path:function(t){return A.create(t.getAttribute("d"))},lineargradient:f,radialgradient:f,image:function(t){var e=new S(s(t,"href",!0));return e.on("load",function(){var e=o(t);this.setSize(e);var i=this._matrix._transformPoint(a(t).add(e.divide(2)));this.translate(i)}),e},symbol:function(t,e,i,n){return new I(u(t,e,i,n),!0)},defs:u,use:function(t){var e=(s(t,"href",!0)||"").substring(1),i=k[e],n=a(t);return i?i instanceof I?i.place(n):i.clone().translate(n):null},circle:function(t){return new C.Circle(a(t,"cx","cy"),s(t,"r"))},ellipse:function(t){return new C.Ellipse({center:a(t,"cx","cy"),radius:o(t,"rx","ry")})},rect:function(t){return new C.Rectangle(new g(a(t),o(t)),o(t,"rx","ry"))},line:function(t){return new L.Line(a(t,"x1","y1"),a(t,"x2","y2"))},text:function(t){var e=new E(a(t).add(a(t,"dx","dy")));return e.setContent(t.textContent.trim()||""),e}},N=r.set(r.each(it,function(t){this[t.attribute]=function(e,i){if(e[t.set]&&(e[t.set](h(i,t.type,t.fromSVG)),"color"===t.type)){var n=e[t.get]();if(n&&n._scaleToBounds){var r=e.getBounds();n.transform((new p).translate(r.getPoint()).scale(r.getSize()))}}}},{}),{id:function(t,e){k[e]=t,t.setName&&t.setName(e)},"clip-path":function(t,e){var i=P(e);if(i){if((i=i.clone()).setClipMask(!0),!(t instanceof x))return new x(i,t);t.insertChild(0,i)}},gradientTransform:_,transform:_,"fill-opacity":v,"stroke-opacity":v,visibility:function(t,e){t.setVisible&&t.setVisible("visible"===e)},display:function(t,e){t.setVisible&&t.setVisible(null!==e)},"stop-color":function(t,e){t.setColor&&t.setColor(e)},"stop-opacity":function(t,e){t._color&&t._color.setAlpha(parseFloat(e))},offset:function(t,e){if(t.setOffset){var i=e.match(/(.*)%$/);t.setOffset(i?i[1]/100:parseFloat(e))}},viewBox:function(t,e,i,n,r){var s,a=new g(h(e,"array")),u=o(n,null,null,!0);if(t instanceof x){var l=u?u.divide(a.getSize()):1,c=(new p).scale(l).translate(a.getPoint().negate());s=t}else t instanceof I&&(u&&a.setSize(u),s=t._item);if(s){if("visible"!==m(n,"overflow",r)){var f=new C.Rectangle(a);f.setClipMask(!0),s.addChild(f)}c&&s.transform(c)}}});w.inject({importSVG:function(t,e){return T(t,e,this)}}),y.inject({importSVG:function(t,e){return this.activate(),T(t,e,this)}})},(paper=new(a.inject(r.exports,{Base:r,Numerical:u,Key:$,DomEvent:Z,DomElement:H,document:n,window:i,Symbol:I,PlacedSymbol:P}))).agent.node&&require("./node/extend.js")(paper),"function"==typeof define&&define.amd?define("paper",paper):"object"==typeof module&&module&&(module.exports=paper),paper}.call(this,"object"==typeof self?self:null);
if (typeof NETXUS === 'undefined')
	var NETXUS = function() {};		
	
NETXUS.RectanglePacker = function ( width, height ) {
	
	this.root = {};

	// initialize
	this.reset( width, height );	
}

NETXUS.RectanglePacker.prototype.reset = function ( width, height ) {
	this.root.x = 0;
	this.root.y = 0;
	this.root.w = width;
	this.root.h = height;
	delete this.root.lft;
	delete this.root.rgt;
	
	this.usedWidth = 0;
	this.usedHeight = 0;	
}
	
NETXUS.RectanglePacker.prototype.getDimensions = function () {
	return { w: this.usedWidth, h: this.usedHeight };	
}
	
	
NETXUS.RectanglePacker.prototype.findCoords = function ( w, h ) {
	function recursiveFindCoords ( node, w, h ) {

		function cloneNode ( node ) {
			return {
				x: node.x,
				y: node.y,
				w: node.w,
				h: node.h	
			};
		}		
		
		if ( node.lft ) {
			var coords = recursiveFindCoords( node.lft, w, h );
			return coords ? coords : recursiveFindCoords( node.rgt, w, h );	
		}
		else
		{
			if ( node.used || w > node.w || h > node.h )
				return null;
				
			if ( w == node.w && h == node.h ) {
				node.used = true;
				return { x: node.x, y: node.y };
			}
			
			node.lft = cloneNode( node );
			node.rgt = cloneNode( node );
			
			if ( node.w - w > node.h - h ) {
				node.lft.w = w;
				node.rgt.x = node.x + w;
				node.rgt.w = node.w - w;	
			} else {
				node.lft.h = h;
				node.rgt.y = node.y + h;
				node.rgt.h = node.h - h;							
			}
			
			return recursiveFindCoords( node.lft, w, h );		
		}
	}
		
	var coords = recursiveFindCoords( this.root, w, h );
	if (coords) {
		if ( this.usedWidth < coords.x + w )
			this.usedWidth = coords.x + w;
		if ( this.usedHeight < coords.y + h )
			this.usedHeight = coords.y + h;
	}
	return coords;
}

function UnionFind(count) {
	this.roots = new Array(count);
	this.ranks = new Array(count);
	
	for(var i=0; i<count; ++i) {
		this.roots[i] = i;
		this.ranks[i] = 0;
	}
}
// Two calls find(x) always return the same result, if link(..) has not been called in between (unique representatives)
UnionFind.prototype.find = function(x) {
	var x0 = x;
	var roots = this.roots;
	while(roots[x] != x)  x = roots[x];
  
	while(roots[x0] != x) {
		var y = roots[x0];
		roots[x0] = x;
		x0 = y;
	} 
	return x;
}

UnionFind.prototype.link = function(x, y) {
	var xr = this.find(x), yr = this.find(y);
	if(xr == yr)  return;

	var ranks = this.ranks, roots = this.roots, xd = ranks[xr], yd = ranks[yr];
 
	if     (xd < yd) {  roots[xr] = yr;  }
	else if(yd < xd) {  roots[yr] = xr;  }
	else {  roots[yr] = xr;  ++ranks[xr];  }
}

var ICC=function(){var G=new Int16Array(1),s=new Uint8Array(G.buffer);function T(f,r){return f[r]<<8|f[r+1]}function B(f,r){s[0]=f[r+1];
s[1]=f[r];return G[0]}function p(f,r){return f[r]<<24|f[r+1]<<16|f[r+2]<<8|f[r+3]}function I(f,r,L){var a="";
for(var H=0;H<L;H++)a+=String.fromCharCode(f[r+H]);return a}function U(f,r,L){var a=[];for(var H=0;H<L;
H++)a.push(String.fromCharCode(f[r+H]));return a}function j(f,r,L){var a="";for(var H=0;H<L;H++){var D=f[r++]<<8|f[r++];
a+=String.fromCharCode(D)}return a}function O(f){var r=new Uint8Array(f),L=V(r,128);if(L==null)return null;
return{header:w(r,0),tags:L}}function w(f,r){var L=I,a=p,H={cmmType:L(f,4,4),version:f[8]+"."+(f[9]>>>4)+"."+(f[9]&15),profileClass:L(f,12,4),spaceIn:L(f,16,4),spaceOut:L(f,20,4),date:T(f,24),platform:L(f,40,4),flags:a(f,44),deviceManufac:L(f,48,4),deviceModel:a(f,52),deviceAttribs:[a(f,56),a(f,60)],rendIntent:a(f,64),illuminant:M(f,68),creator:L(f,80,4)};
for(var D=0;D<5;D++)H.date+="."+T(f,26+2*D);return H}function V(f,r){var L=p,a={},H=L(f,r);r+=4;if(H>100)return null;
for(var D=0;D<H;D++){var b=I(f,r,4);r+=4;var q=L(f,r);r+=4;var S=L(f,r);r+=4;a[b]=i(f,q,S)}return a}function i(f,r,L){var a=I(f,r,4),H={p:a,G:L};
r+=4;r+=4;if(a=="mluc"){var D=[];for(var b=0;b<L;b++)D.push(f[r-8+b])}if(a=="mluc")c(H,f,r,L);else if(a=="text")K(H,f,r,L);
else if(a=="desc")m(H,f,r,L);else if(a=="mAB ")o(H,f,r,L);else if(a=="mft1")Q(H,f,r,L);else if(a=="mft2")u(H,f,r,L);
else if(a=="XYZ ")P(H,f,r,L);else if(a=="para")y(H,f,r,L);else if(a=="curv")l(H,f,r,L);else if(a=="sf32")v(H,f,r,L);
if((H.G&3)!=0)H.G+=4-(H.G&3);return H}function c(f,r,L,a){var H=L-8,D=p(r,L);L+=4;var b=p(r,L);L+=4;
f.w=[];for(var q=0;q<D;q++){var S={};f.w.push(S);S.code=I(r,L,4);var A=p(r,L+4),k=p(r,L+8);L+=12;S.text=j(r,H+k,A>>>1)}}function m(f,r,L,a){var H=p(r,L);
L+=4;f.j=I(r,L,H-1);L+=H;var D=p(r,L);L+=4;var b=p(r,L);L+=4;f.d=j(r,L,b);L+=b;var q=T(r,L);L+=2;var S=r[L];
L++;f.H=I(r,L,S)}function o(f,r,L,a){var H=L-8;f.K=r[L];L++;f.J=r[L];L++;L+=2;var D=p(r,L);L+=4;var b=p(r,L);
L+=4;var q=p(r,L);L+=4;var S=p(r,L);L+=4;var A=p(r,L);L+=4;if(D!=0){f.b=[];L=H+D;for(var k=0;k<f.J;k++){var J=i(r,L,0);
L+=J.G;f.b.push(J)}}if(b!=0){f.v=[];for(var k=0;k<12;k++)f.v.push(t(r,H+b+k*4))}if(q!=0){f.a=[];L=H+q;
for(var k=0;k<f.J;k++){var J=i(r,L,0);L+=J.G;f.a.push(J)}}if(S!=0){f.t=[];L=H+S;f.k=[];for(var k=0;k<f.K;
k++)f.k.push(r[L+k]);L+=16;var E=r[L];L+=4;var x=f.J;for(var k=0;k<f.K;k++)x*=f.k[k];if(E==1)for(var k=0;
k<x;k++)f.t.push(r[L+k]*(1/255));if(E==2)for(var k=0;k<x;k++)f.t.push(T(r,L+2*k)*(1/65535))}if(A!=0){f.r=[];
L=H+A;for(var k=0;k<f.K;k++){var J=i(r,L,0);L+=J.G;f.r.push(J)}}}function Q(f,r,L,a){C(f,r,L);L+=40;
f.m=d(r,L,f.K,256);L+=f.K*256;f.t=[];var H=Math.round(Math.pow(f.l,f.K))*f.J;for(var D=0;D<H;D++)f.t.push(r[L+D]*(1/255));
L+=H;f.q=d(r,L,f.J,256);L+=f.J*256}function u(f,r,L,a){C(f,r,L);L+=40;var H=T(r,L);L+=2;var D=T(r,L);
L+=2;f.m=W(r,L,f.K,H);L+=2*f.K*H;f.t=[];var b=Math.round(Math.pow(f.l,f.K))*f.J;for(var q=0;q<b;q++)f.t.push(T(r,L+q*2)*(1/65535));
L+=b*2;f.q=W(r,L,f.J,D);L+=2*f.J*D}function C(f,r,L){f.K=r[L];L++;f.J=r[L];L++;f.l=r[L];L++;L++;f.v=[];
for(var a=0;a<9;a++){f.v.push(t(r,L));L+=4}}function d(f,r,L,a){var H=[];for(var D=0;D<L;D++){var b=[];
H.push(b);for(var q=0;q<a;q++){b.push(f[r]*(1/255));r++}}return H}function W(f,r,L,a){var H=[];for(var D=0;
D<L;D++){var b=[];H.push(b);for(var q=0;q<a;q++){b.push(T(f,r)*(1/65535));r+=2}}return H}function y(f,r,L,a){f.c=T(r,L);
L+=2;L+=2;var H=[1,3,4,5,7];f.w=[];for(var D=0;D<H[f.c];D++)f.w.push(t(r,L+D*4))}function l(f,r,L,a){var H=p(r,L);
L+=4;f.w=[];if(H==1)f.w.push(R(r,L));else for(var D=0;D<H;D++)f.w.push(T(r,L+D*2)*(1/65535));f.G=12+2*H}function P(f,r,L){f.value=M(r,L)}function K(f,r,L,a){f.value=I(r,L,a-9)}function R(f,r){return f[r]+f[r+1]/256}function t(f,r){return B(f,r)+T(f,r+2)*(1/65536)}function M(f,r){var L=[];
for(var a=0;a<3;a++)L.push(t(f,r+a*4));return L}function v(f,r,L,a){var H=a/4-2;f.value=[];for(var D=0;
D<H;D++)f.value.push(t(r,L+D*4))}return{R:O}}();ICC.U=function(){var G=[.9642,1,.8249],s={I:[3.1338561,-1.6168667,-.4906146,-.9787684,1.9161415,.033454,.0719453,-.2289914,1.4052427],C:[.4360747,.3850649,.14308038,.2225045,.7168786,.0606169,.0139322,.0971045,.7141733],f:function(R){return R<.0031308?12.92*R:1.055*Math.pow(R,1/2.4)-.055},h:function(R){return R<.04045?R/12.92:Math.pow((R+.055)/1.055,2.4)},z:function(R,t,M){var v=s.s[0],r=s.s[1];
R=v[~~(.5+R*4e3)];t=v[~~(.5+t*4e3)];M=v[~~(.5+M*4e3)];var L=s.C,a=L[0]*R+L[1]*t+L[2]*M,H=L[3]*R+L[4]*t+L[5]*M,D=L[6]*R+L[7]*t+L[8]*M;
return s.e(a,H,D)},e:function(R,t,M,v){if(v==null)v=G;R=R*(1/v[0]);t=t*(1/v[1]);M=M<0?0:M*(1/v[2]);var r=s.s[1],L=r[~~(.5+R*4e3)],a=r[~~(.5+t*4e3)],H=r[~~(.5+M*4e3)];
return{n:116*a-16,u:500*(L-a),D:200*(a-H)}},F:function(R,t,M,v){if(v==null)v=G;var r=903.3,L=.008856,a=(R+16)/116,H=a*a*a,D=a-M/200,b=D*D*D,q=t/500+a,S=q*q*q,k=b>L?b:(116*D-16)/r,J=H>L?H:(116*a-16)/r,E=S>L?S:(116*q-16)/r,x=E*v[0],n=J*v[1],M=k*v[2],h=s.I,g=[h[0]*x+h[1]*n+h[2]*M,h[3]*x+h[4]*n+h[5]*M,h[6]*x+h[7]*n+h[8]*M];
for(var N=0;N<3;N++)g[N]=Math.max(0,Math.min(1,s.f(g[N])));return{g:g[0],l:g[1],D:g[2]}}};s.s=function(){var R=[],t=[];
for(var M=0;M<8e3;M++){var v=M/4e3;R[M]=s.h(v);t[M]=v>.008856?Math.pow(v,1/3):(903.3*v+16)*(1/116)}return[R,t]}();
function T(R,t,M){var v=1/(R-1),r=[],L=[];for(var a=0;a<R;a++)for(var H=0;H<R;H++)for(var D=0;D<R;D++){if(t==3){r.push([a*v,H*v,D*v,0]);
L.push(0,0,0);if(M==4)L.push(0)}else for(var b=0;b<R;b++){r.push([a*v,H*v,D*v,b*v]);L.push(0,0,0);if(M==4)L.push(0)}}return[r,L]}function B(R,t,M){var v=R.tags,r=R.header,L=r.spaceIn.toLowerCase(),a=r.spaceOut.toLowerCase();
if(M){var H=L;L=a;a=H}console.log(M,L,a);var D=L=="cmyk"?4:3,b=a=="cmyk"?4:3,q=T(t,D,b),S=q[0],A=q[1],k=v.wtpt?v.wtpt.value:null;
if(L=="cmyk")k=null;var E=M?"B2A0":"A2B0";for(var x=0;x<S.length;x++){var n=S[x];if(L=="rgb "){}else if(L=="cmyk"){}else if(L=="lab ")p(n,0,s.z(n[0],n[1],n[2]));
else throw L;if(v.rTRC){var h=v.rTRC,g=v.gTRC,N=v.bTRC;V(n,h,g,N)}if(v.rXYZ){var h=v.rXYZ.value,g=v.gXYZ.value,N=v.bXYZ.value;
O(n,h,g,N)}if(v[E]){var e=v[E],z=e.p;if(z=="mAB ")U(n,e);else if(z=="mft1"||z=="mft2")I(n,e);else throw z}if(a=="rgb "){}else if(a=="xyz "||a=="lab "){if(a=="xyz ")p(n,0,s.e(n[0],n[1],n[2],k));
var F=s.F(n[0]*100,-127.5+255*n[1],-127.5+255*n[2],k);n[0]=F.g;n[1]=F.l;n[2]=F.D}else if(a=="cmyk"){}else throw a;
A[x*b]=n[0];A[x*b+1]=n[1];A[x*b+2]=n[2];if(b==4)A[x*b+3]=n[3]}return A}function p(R,t,M){R[t]=M.n/100;
R[t+1]=(127.5+M.u)/255;R[t+2]=(127.5+M.D)/255}function I(R,t){for(var M=0;M<t.K;M++)R[M]=c(R[M],t.m[M]);
if(t.K==3){if(t.J==3)W(t.t,t.l,R,R);if(t.J==4)d(t.t,t.l,R,R)}if(t.K==4)l(t.t,t.l,R,R);if(t.q)for(var M=0;
M<t.J;M++)R[M]=c(R[M],t.q[M])}function U(R,t){if(t.t)W(t.t,t.k[0],R,R);if(t.a)V(R,t.a[0],t.a[1],t.a[2]);
if(t.v)j(R,t.v)}function j(R,t){var M=R[0],v=R[1],r=R[2];R[0]=Math.max(0,Math.min(1,t[0]*M+t[1]*v+t[2]*r+t[9]));
R[1]=Math.max(0,Math.min(1,t[3]*M+t[4]*v+t[5]*r+t[10]));R[2]=Math.max(0,Math.min(1,t[6]*M+t[7]*v+t[8]*r+t[11]))}function O(R,t,M,v){var r=R[0],L=R[1],a=R[2];
R[0]=r*t[0]+L*M[0]+a*v[0];R[1]=r*t[1]+L*M[1]+a*v[1];R[2]=r*t[2]+L*M[2]+a*v[2]}function w(R,t,M){var v=R[t],r=R[t+1],L=R[t+2];
R[t]=v*M[0]+r*M[1]+L*M[2];R[t+1]=v*M[3]+r*M[4]+L*M[5];R[t+2]=v*M[6]+r*M[7]+L*M[8]}function V(R,t,M,v){R[0]=i(R[0],t);
R[1]=i(R[1],M);R[2]=i(R[2],v)}function i(R,t){var M=t.p,v=t.w;if(M=="curv")return c(R,v);else if(M=="para")return m(R,v);
else throw M}function c(R,t){var M=t.length;if(M==0)return R;if(M==1)return Math.pow(R,t[0]);var v=R*(M-1)*.9999999,r=~~v,L=v-r;
return(1-L)*t[r]+L*t[r+1]}function m(R,t){var M=t.length,v=R,r=t[0],L=t[1],a=t[2],H=t[3],D=t[4],b=t[5],q=t[6];
if(M==1)v=Math.pow(R,r);else if(M==3)v=R>=-a/L?Math.pow(L*R+a,r):0;else if(M==4)v=R>=-a/L?Math.pow(L*R+a,r)+H:H;
else if(M==5)v=R>=D?Math.pow(L*R+a,r):H*R;else if(M==7)v=R>=D?Math.pow(L*R+a,r)+b:H*R+q;return v}function o(R,t,M,v,r,L,a){var H=~~R,D=~~t,b=~~M,q=v*v,S=b+v*D+v*v*H,A=b+v*(D+1)+v*v*H;
if(a==3){Q(S,S+1,r,M-b,0,L);Q(A,A+1,r,M-b,1,L);Q(S+q,S+1+q,r,M-b,2,L);Q(A+q,A+1+q,r,M-b,3,L);Q(0,1,L,t-D,0,L);
Q(2,3,L,t-D,2,L);Q(0,2,L,R-H,0,L)}else{u(S,S+1,r,M-b,0,L);u(A,A+1,r,M-b,1,L);u(S+q,S+1+q,r,M-b,2,L);
u(A+q,A+1+q,r,M-b,3,L);u(0,1,L,t-D,0,L);u(2,3,L,t-D,2,L);u(0,2,L,R-H,0,L)}}function Q(R,t,M,v,r,L){var a=1-v;
R*=3;t*=3;r*=3;L[r+0]=a*M[R]+v*M[t];L[r+1]=a*M[R+1]+v*M[t+1];L[r+2]=a*M[R+2]+v*M[t+2]}function u(R,t,M,v,r,L){var a=1-v;
R*=4;t*=4;r*=4;L[r+0]=a*M[R]+v*M[t];L[r+1]=a*M[R+1]+v*M[t+1];L[r+2]=a*M[R+2]+v*M[t+2];L[r+3]=a*M[R+3]+v*M[t+3]}function C(R,t){function M(D){return D<0?0:D>1?1:D}var v=t*t*t,r=new Uint8Array(v*4);
for(var L=0;L<v;L++){var a=L*3,H=a+L;r[H]=~~(.5+M(R[a])*255);r[H+1]=~~(.5+M(R[a+1])*255);r[H+2]=~~(.5+M(R[a+2])*255);
r[H+3]=255}return r}function d(R,t,M,v){var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],L=t-1.000001;o(L*M[0],L*M[1],L*M[2],t,R,r,4);
v[0]=r[0];v[1]=r[1];v[2]=r[2];v[3]=r[3]}function W(R,t,M,v){var r=[0,0,0,0,0,0,0,0,0,0,0,0],L=t-1.000001,a=M.length;
for(var H=0;H<a;H+=3){o(L*M[H],L*M[H+1],L*M[H+2],t,R,r,3);v[H]=r[0];v[H+1]=r[1];v[H+2]=r[2]}}function y(R,t,M,v){var r=[0,0,0,0,0,0,0,0,0,0,0,0],L=(t-1.000001)/255,a=M.length;
for(var H=0;H<a;H+=4){o(L*M[H],L*M[H+1],L*M[H+2],t,R,r,3);v[H]=~~(.5+r[0]*255);v[H+1]=~~(.5+r[1]*255);
v[H+2]=~~(.5+r[2]*255)}}function l(R,t,M,v,r){var L=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=t-1.000001,H=0,D=M.length,b=t*t*t;
if(r)a/=255;for(var q=H;q<D;q+=4){var S=a*M[q],A=a*M[q+1],k=a*M[q+2],E=a*M[q+3],x=~~S;o(A,k,E+x*b,t,R,L,3);
L[12]=L[0];L[13]=L[1];L[14]=L[2];o(A,k,E+(x+1)*b,t,R,L,3);Q(4,0,L,S-x,0,L);if(r){v[q]=~~(.5+L[0]*255);
v[q+1]=~~(.5+L[1]*255);v[q+2]=~~(.5+L[2]*255)}else{var n=(q>>>2)*3;v[n]=L[0];v[n+1]=L[1];v[n+2]=L[2]}}}function P(R,t,M,v){l(R,t,M,v,!0)}function K(R){var t=R.tags.desc;
if(t.j)return t.j;return t.w[0].text}return{lutToRGBA8:C,sampleLUT:B,applyLUT:y,applyLUT4:P,applyLUTFloat:W,applyLUT4Float:l,applyLUT3to4Float:d,profileName:K}}()/*
 * [js-sha1]{@link https://github.com/emn178/js-sha1}
 *
 * @version 0.6.0
 * @author Chen, Yi-Cyuan [emn178@gmail.com]
 * @copyright Chen, Yi-Cyuan 2014-2017
 * @license MIT
 */
!function(){"use strict";function t(t){t?(f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var h="object"==typeof window?window:{},s=!h.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;s&&(h=global);var i=!h.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports,e="function"==typeof define&&define.amd,r="0123456789abcdef".split(""),o=[-2147483648,8388608,32768,128],n=[24,16,8,0],a=["hex","array","digest","arrayBuffer"],f=[],u=function(h){return function(s){return new t(!0).update(s)[h]()}},c=function(){var h=u("hex");s&&(h=p(h)),h.create=function(){return new t},h.update=function(t){return h.create().update(t)};for(var i=0;i<a.length;++i){var e=a[i];h[e]=u(e)}return h},p=function(t){var h=eval("require('crypto')"),s=eval("require('buffer').Buffer"),i=function(i){if("string"==typeof i)return h.createHash("sha1").update(i,"utf8").digest("hex");if(i.constructor===ArrayBuffer)i=new Uint8Array(i);else if(void 0===i.length)return t(i);return h.createHash("sha1").update(new s(i)).digest("hex")};return i};t.prototype.update=function(t){if(!this.finalized){var s="string"!=typeof t;s&&t.constructor===h.ArrayBuffer&&(t=new Uint8Array(t));for(var i,e,r=0,o=t.length||0,a=this.blocks;r<o;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),s)for(e=this.start;r<o&&e<64;++r)a[e>>2]|=t[r]<<n[3&e++];else for(e=this.start;r<o&&e<64;++r)(i=t.charCodeAt(r))<128?a[e>>2]|=i<<n[3&e++]:i<2048?(a[e>>2]|=(192|i>>6)<<n[3&e++],a[e>>2]|=(128|63&i)<<n[3&e++]):i<55296||i>=57344?(a[e>>2]|=(224|i>>12)<<n[3&e++],a[e>>2]|=(128|i>>6&63)<<n[3&e++],a[e>>2]|=(128|63&i)<<n[3&e++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++r)),a[e>>2]|=(240|i>>18)<<n[3&e++],a[e>>2]|=(128|i>>12&63)<<n[3&e++],a[e>>2]|=(128|i>>6&63)<<n[3&e++],a[e>>2]|=(128|63&i)<<n[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=64?(this.block=a[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},t.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,h=this.lastByteIndex;t[16]=this.block,t[h>>2]|=o[3&h],this.block=t[16],h>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},t.prototype.hash=function(){var t,h,s=this.h0,i=this.h1,e=this.h2,r=this.h3,o=this.h4,n=this.blocks;for(t=16;t<80;++t)h=n[t-3]^n[t-8]^n[t-14]^n[t-16],n[t]=h<<1|h>>>31;for(t=0;t<20;t+=5)s=(h=(i=(h=(e=(h=(r=(h=(o=(h=s<<5|s>>>27)+(i&e|~i&r)+o+1518500249+n[t]<<0)<<5|o>>>27)+(s&(i=i<<30|i>>>2)|~s&e)+r+1518500249+n[t+1]<<0)<<5|r>>>27)+(o&(s=s<<30|s>>>2)|~o&i)+e+1518500249+n[t+2]<<0)<<5|e>>>27)+(r&(o=o<<30|o>>>2)|~r&s)+i+1518500249+n[t+3]<<0)<<5|i>>>27)+(e&(r=r<<30|r>>>2)|~e&o)+s+1518500249+n[t+4]<<0,e=e<<30|e>>>2;for(;t<40;t+=5)s=(h=(i=(h=(e=(h=(r=(h=(o=(h=s<<5|s>>>27)+(i^e^r)+o+1859775393+n[t]<<0)<<5|o>>>27)+(s^(i=i<<30|i>>>2)^e)+r+1859775393+n[t+1]<<0)<<5|r>>>27)+(o^(s=s<<30|s>>>2)^i)+e+1859775393+n[t+2]<<0)<<5|e>>>27)+(r^(o=o<<30|o>>>2)^s)+i+1859775393+n[t+3]<<0)<<5|i>>>27)+(e^(r=r<<30|r>>>2)^o)+s+1859775393+n[t+4]<<0,e=e<<30|e>>>2;for(;t<60;t+=5)s=(h=(i=(h=(e=(h=(r=(h=(o=(h=s<<5|s>>>27)+(i&e|i&r|e&r)+o-1894007588+n[t]<<0)<<5|o>>>27)+(s&(i=i<<30|i>>>2)|s&e|i&e)+r-1894007588+n[t+1]<<0)<<5|r>>>27)+(o&(s=s<<30|s>>>2)|o&i|s&i)+e-1894007588+n[t+2]<<0)<<5|e>>>27)+(r&(o=o<<30|o>>>2)|r&s|o&s)+i-1894007588+n[t+3]<<0)<<5|i>>>27)+(e&(r=r<<30|r>>>2)|e&o|r&o)+s-1894007588+n[t+4]<<0,e=e<<30|e>>>2;for(;t<80;t+=5)s=(h=(i=(h=(e=(h=(r=(h=(o=(h=s<<5|s>>>27)+(i^e^r)+o-899497514+n[t]<<0)<<5|o>>>27)+(s^(i=i<<30|i>>>2)^e)+r-899497514+n[t+1]<<0)<<5|r>>>27)+(o^(s=s<<30|s>>>2)^i)+e-899497514+n[t+2]<<0)<<5|e>>>27)+(r^(o=o<<30|o>>>2)^s)+i-899497514+n[t+3]<<0)<<5|i>>>27)+(e^(r=r<<30|r>>>2)^o)+s-899497514+n[t+4]<<0,e=e<<30|e>>>2;this.h0=this.h0+s<<0,this.h1=this.h1+i<<0,this.h2=this.h2+e<<0,this.h3=this.h3+r<<0,this.h4=this.h4+o<<0},t.prototype.hex=function(){this.finalize();var t=this.h0,h=this.h1,s=this.h2,i=this.h3,e=this.h4;return r[t>>28&15]+r[t>>24&15]+r[t>>20&15]+r[t>>16&15]+r[t>>12&15]+r[t>>8&15]+r[t>>4&15]+r[15&t]+r[h>>28&15]+r[h>>24&15]+r[h>>20&15]+r[h>>16&15]+r[h>>12&15]+r[h>>8&15]+r[h>>4&15]+r[15&h]+r[s>>28&15]+r[s>>24&15]+r[s>>20&15]+r[s>>16&15]+r[s>>12&15]+r[s>>8&15]+r[s>>4&15]+r[15&s]+r[i>>28&15]+r[i>>24&15]+r[i>>20&15]+r[i>>16&15]+r[i>>12&15]+r[i>>8&15]+r[i>>4&15]+r[15&i]+r[e>>28&15]+r[e>>24&15]+r[e>>20&15]+r[e>>16&15]+r[e>>12&15]+r[e>>8&15]+r[e>>4&15]+r[15&e]},t.prototype.toString=t.prototype.hex,t.prototype.digest=function(){this.finalize();var t=this.h0,h=this.h1,s=this.h2,i=this.h3,e=this.h4;return[t>>24&255,t>>16&255,t>>8&255,255&t,h>>24&255,h>>16&255,h>>8&255,255&h,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,e>>24&255,e>>16&255,e>>8&255,255&e]},t.prototype.array=t.prototype.digest,t.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(20),h=new DataView(t);return h.setUint32(0,this.h0),h.setUint32(4,this.h1),h.setUint32(8,this.h2),h.setUint32(12,this.h3),h.setUint32(16,this.h4),t};var y=c();i?module.exports=y:(h.sha1=y,e&&define(function(){return y}))}();var EXRLoader={parse:function(e){var r={FloatType:1,UnsignedByteType:2,HalfFloatType:3,RGBEFormat:4};this.type=r.FloatType;var a=65536,n=a>>3,t=14,i=65537,o=1<<t,f=o-1,l=32768,u=65535,s=59,v=63,c=2+v-s,h=8,w=4,p=4,y=2,d=1,g=0,A=1,S=0,U=1,b=2,m=Math.pow(2.7182818,2.2),M=new DataView(new ArrayBuffer(8));function C(e){if(0===e)return[e,0];M.setFloat64(0,e);var r=M.getUint32(0)>>>20&2047;0===r&&(M.setFloat64(0,e*Math.pow(2,64)),r=(M.getUint32(0)>>>20&2047)-64);var a=r-1022;return[function(e,r){for(var a=Math.min(3,Math.ceil(Math.abs(r)/1023)),n=e,t=0;t<a;t++)n*=Math.pow(2,Math.floor((r+t)/a));return n}(e,-a),a]}var O={l:0,c:0,lc:0};function I(e,r,a,n,t){for(;a<e;)r=r<<8|te(n,t),a+=8;a-=e,O.l=r>>a&(1<<e)-1,O.c=r,O.lc=a}var E=new Array(59);function R(e,r,a,n,t,o,f){for(var l=a,u=0,h=0;t<=o;t++){if(l.value-a.value>n)return!1;I(6,u,h,e,l);var w=O.l;if(u=O.c,h=O.lc,f[t]=w,w==v){if(l.value-a.value>n)throw"Something wrong with hufUnpackEncTable";I(8,u,h,e,l);var p=O.l+c;if(u=O.c,h=O.lc,t+p>o+1)throw"Something wrong with hufUnpackEncTable";for(;p--;)f[t++]=0;t--}else if(w>=s){if(t+(p=w-s+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;p--;)f[t++]=0;t--}}!function(e){for(var r=0;r<=58;++r)E[r]=0;for(r=0;r<i;++r)E[e[r]]+=1;var a=0;for(r=58;r>0;--r){var n=a+E[r]>>1;E[r]=a,a=n}for(r=0;r<i;++r){var t=e[r];t>0&&(e[r]=t|E[t]++<<6)}}(f)}function x(e){return 63&e}function P(e){return e>>6}var z={c:0,lc:0};function N(e,r,a,n){e=e<<8|te(a,n),r+=8,z.c=e,z.lc=r}var T={c:0,lc:0};function k(e,r,a,n,t,i,o,f,l,u){if(e==r){n<8&&(N(a,n,t,o),a=z.c,n=z.lc);var s=a>>(n-=8);s=new Uint8Array([s])[0];if(l.value+s>u)return!1;for(var v=f[l.value-1];s-- >0;)f[l.value++]=v}else{if(!(l.value<u))return!1;f[l.value++]=e}T.c=a,T.lc=n}function _(e){return 65535&e}function D(e){var r=_(e);return r>32767?r-65536:r}var F={a:0,b:0};function B(e,r){var a=D(e),n=D(r),t=a+(1&n)+(n>>1),i=t,o=t-n;F.a=i,F.b=o}function L(e,r){var a=_(e),n=_(r),t=a-(n>>1)&u,i=n+t-l&u;F.a=i,F.b=t}function X(e,r,a,n,t,i,o){for(var f,l=o<16384,u=a>t?t:a,s=1;s<=u;)s<<=1;for(f=s>>=1,s>>=1;s>=1;){for(var v,c,h,w,p=0,y=p+i*(t-f),d=i*s,g=i*f,A=n*s,S=n*f;p<=y;p+=g){for(var U=p,b=p+n*(a-f);U<=b;U+=S){var m=U+A,M=(C=U+d)+A;l?(B(e[U+r],e[C+r]),v=F.a,h=F.b,B(e[m+r],e[M+r]),c=F.a,w=F.b,B(v,c),e[U+r]=F.a,e[m+r]=F.b,B(h,w),e[C+r]=F.a,e[M+r]=F.b):(L(e[U+r],e[C+r]),v=F.a,h=F.b,L(e[m+r],e[M+r]),c=F.a,w=F.b,L(v,c),e[U+r]=F.a,e[m+r]=F.b,L(h,w),e[C+r]=F.a,e[M+r]=F.b)}if(a&s){var C=U+d;l?B(e[U+r],e[C+r]):L(e[U+r],e[C+r]),v=F.a,e[C+r]=F.b,e[U+r]=v}}if(t&s)for(U=p,b=p+n*(a-f);U<=b;U+=S){m=U+A;l?B(e[U+r],e[m+r]):L(e[U+r],e[m+r]),v=F.a,e[m+r]=F.b,e[U+r]=v}f=s,s>>=1}return p}function V(e,r,a,n,l,u){var s=a.value,v=ne(r,a),c=ne(r,a);a.value+=4;var h=ne(r,a);if(a.value+=4,v<0||v>=i||c<0||c>=i)throw"Something wrong with HUF_ENCSIZE";var w=new Array(i),p=new Array(o);if(function(e){for(var r=0;r<o;r++)e[r]={},e[r].len=0,e[r].lit=0,e[r].p=null}(p),R(e,0,a,n-(a.value-s),v,c,w),h>8*(n-(a.value-s)))throw"Something wrong with hufUncompress";!function(e,r,a,n){for(;r<=a;r++){var i=P(e[r]),o=x(e[r]);if(i>>o)throw"Invalid table entry";if(o>t){if((s=n[i>>o-t]).len)throw"Invalid table entry";if(s.lit++,s.p){var f=s.p;s.p=new Array(s.lit);for(var l=0;l<s.lit-1;++l)s.p[l]=f[l]}else s.p=new Array(1);s.p[s.lit-1]=r}else if(o){var u=0;for(l=1<<t-o;l>0;l--){var s;if((s=n[(i<<t-o)+u]).len||s.p)throw"Invalid table entry";s.len=o,s.lit=r,u++}}}}(w,v,c,p),function(e,r,a,n,i,o,l,u,s,v){for(var c=0,h=0,w=u,p=Math.trunc(i.value+(o+7)/8);i.value<p;)for(N(c,h,a,i),c=z.c,h=z.lc;h>=t;)if((A=r[c>>h-t&f]).len)h-=A.len,k(A.lit,l,c,h,a,0,i,s,v,w),c=T.c,h=T.lc;else{if(!A.p)throw"hufDecode issues";var y;for(y=0;y<A.lit;y++){for(var d=x(e[A.p[y]]);h<d&&i.value<p;)N(c,h,a,i),c=z.c,h=z.lc;if(h>=d&&P(e[A.p[y]])==(c>>h-d&(1<<d)-1)){h-=d,k(A.p[y],l,c,h,a,0,i,s,v,w),c=T.c,h=T.lc;break}}if(y==A.lit)throw"hufDecode issues"}var g=8-o&7;for(c>>=g,h-=g;h>0;){var A;if(!(A=r[c<<t-h&f]).len)throw"hufDecode issues";h-=A.len,k(A.lit,l,c,h,a,0,i,s,v,w),c=T.c,h=T.lc}}(w,p,e,0,a,h,c,u,l,{value:0})}function Z(e){for(var r=1;r<e.length;r++){var a=e[r-1]+e[r]-128;e[r]=a}}function H(e,r){for(var a=0,n=Math.floor((e.length+1)/2),t=0,i=e.length-1;!(t>i||(r[t++]=e[a++],t>i));)r[t++]=e[n++]}function W(e){for(var r=e.byteLength,a=new Array,n=0,t=new DataView(e);r>0;){var i=t.getInt8(n++);if(i<0){r-=(f=-i)+1;for(var o=0;o<f;o++)a.push(t.getUint8(n++))}else{var f=i;r-=2;var l=t.getUint8(n++);for(o=0;o<f+1;o++)a.push(l)}}return a}function G(e,r,a){for(var n,t=1;t<64;)65280==(n=r[e.value])?t=64:n>>8==255?t+=255&n:(a[t]=n,t++),e.value++}function Y(e,r){r[0]=le(e[0]),r[1]=le(e[1]),r[2]=le(e[5]),r[3]=le(e[6]),r[4]=le(e[14]),r[5]=le(e[15]),r[6]=le(e[27]),r[7]=le(e[28]),r[8]=le(e[2]),r[9]=le(e[4]),r[10]=le(e[7]),r[11]=le(e[13]),r[12]=le(e[16]),r[13]=le(e[26]),r[14]=le(e[29]),r[15]=le(e[42]),r[16]=le(e[3]),r[17]=le(e[8]),r[18]=le(e[12]),r[19]=le(e[17]),r[20]=le(e[25]),r[21]=le(e[30]),r[22]=le(e[41]),r[23]=le(e[43]),r[24]=le(e[9]),r[25]=le(e[11]),r[26]=le(e[18]),r[27]=le(e[24]),r[28]=le(e[31]),r[29]=le(e[40]),r[30]=le(e[44]),r[31]=le(e[53]),r[32]=le(e[10]),r[33]=le(e[19]),r[34]=le(e[23]),r[35]=le(e[32]),r[36]=le(e[39]),r[37]=le(e[45]),r[38]=le(e[52]),r[39]=le(e[54]),r[40]=le(e[20]),r[41]=le(e[22]),r[42]=le(e[33]),r[43]=le(e[38]),r[44]=le(e[46]),r[45]=le(e[51]),r[46]=le(e[55]),r[47]=le(e[60]),r[48]=le(e[21]),r[49]=le(e[34]),r[50]=le(e[37]),r[51]=le(e[47]),r[52]=le(e[50]),r[53]=le(e[56]),r[54]=le(e[59]),r[55]=le(e[61]),r[56]=le(e[35]),r[57]=le(e[36]),r[58]=le(e[48]),r[59]=le(e[49]),r[60]=le(e[57]),r[61]=le(e[58]),r[62]=le(e[62]),r[63]=le(e[63])}function j(e){for(var r=.5*Math.cos(.7853975),a=.5*Math.cos(.196349375),n=.5*Math.cos(.39269875),t=.5*Math.cos(3*3.14159/16),i=.5*Math.cos(.981746875),o=.5*Math.cos(3*3.14159/8),f=.5*Math.cos(1.374445625),l=new Array(4),u=new Array(4),s=new Array(4),v=new Array(4),c=0;c<8;++c){var h=8*c;l[0]=n*e[h+2],l[1]=o*e[h+2],l[2]=n*e[h+6],l[3]=o*e[h+6],u[0]=a*e[h+1]+t*e[h+3]+i*e[h+5]+f*e[h+7],u[1]=t*e[h+1]-f*e[h+3]-a*e[h+5]-i*e[h+7],u[2]=i*e[h+1]-a*e[h+3]+f*e[h+5]+t*e[h+7],u[3]=f*e[h+1]-i*e[h+3]+t*e[h+5]-a*e[h+7],s[0]=r*(e[h+0]+e[h+4]),s[3]=r*(e[h+0]-e[h+4]),s[1]=l[0]+l[3],s[2]=l[1]-l[2],v[0]=s[0]+s[1],v[1]=s[3]+s[2],v[2]=s[3]-s[2],v[3]=s[0]-s[1],e[h+0]=v[0]+u[0],e[h+1]=v[1]+u[1],e[h+2]=v[2]+u[2],e[h+3]=v[3]+u[3],e[h+4]=v[3]-u[3],e[h+5]=v[2]-u[2],e[h+6]=v[1]-u[1],e[h+7]=v[0]-u[0]}for(var w=0;w<8;++w)l[0]=n*e[16+w],l[1]=o*e[16+w],l[2]=n*e[48+w],l[3]=o*e[48+w],u[0]=a*e[8+w]+t*e[24+w]+i*e[40+w]+f*e[56+w],u[1]=t*e[8+w]-f*e[24+w]-a*e[40+w]-i*e[56+w],u[2]=i*e[8+w]-a*e[24+w]+f*e[40+w]+t*e[56+w],u[3]=f*e[8+w]-i*e[24+w]+t*e[40+w]-a*e[56+w],s[0]=r*(e[w]+e[32+w]),s[3]=r*(e[w]-e[32+w]),s[1]=l[0]+l[3],s[2]=l[1]-l[2],v[0]=s[0]+s[1],v[1]=s[3]+s[2],v[2]=s[3]-s[2],v[3]=s[0]-s[1],e[0+w]=v[0]+u[0],e[8+w]=v[1]+u[1],e[16+w]=v[2]+u[2],e[24+w]=v[3]+u[3],e[32+w]=v[3]-u[3],e[40+w]=v[2]-u[2],e[48+w]=v[1]-u[1],e[56+w]=v[0]-u[0]}function q(e){for(var r=0;r<64;++r){var a=e[0][r],n=e[1][r],t=e[2][r];e[0][r]=a+1.5747*t,e[1][r]=a-.1873*n-.4682*t,e[2][r]=a+1.8556*n}}function J(e,r,a){for(var n=0;n<64;++n)r[a+n]=ue(K(e[n]))}function K(e){return e<=1?Math.sign(e)*Math.pow(Math.abs(e),2.2):Math.sign(e)*Math.pow(m,Math.abs(e)-1)}function Q(e){var r=e.array.slice(e.offset.value,e.offset.value+e.size),a=new Uint8Array(pako.inflate(r).buffer),n=new Uint8Array(a.length);return Z(a),H(a,n),new DataView(n.buffer)}function $(e){var r=e.viewer,a={value:e.offset.value},n=new Uint8Array(e.width*e.lines*(we.channels.length*e.type*y)),t={version:oe(r,a),unknownUncompressedSize:oe(r,a),unknownCompressedSize:oe(r,a),acCompressedSize:oe(r,a),dcCompressedSize:oe(r,a),rleCompressedSize:oe(r,a),rleUncompressedSize:oe(r,a),rleRawSize:oe(r,a),totalAcUncompressedCount:oe(r,a),totalDcUncompressedCount:oe(r,a),acCompression:oe(r,a)};if(t.version<2)throw"EXRLoader.parse: "+we.compression+" version "+t.version+" is unsupported";for(var i=new Array,o=se(r,a)-y;o>0;){var f=ee(r.buffer,a),l=ie(r,a),u=l>>2&3,s=new Int8Array([(l>>4)-1])[0],v=ie(r,a);i.push({name:f,index:s,type:v,compression:u}),o-=f.length+3}for(var c=we.channels,h=new Array(e.channels),w=0;w<e.channels;++w){var p=h[w]={},d=c[w];p.name=d.name,p.compression=S,p.decoded=!1,p.type=d.pixelType,p.pLinear=d.pLinear,p.width=e.width,p.height=e.lines}for(var m={idx:new Array(3)},M=0;M<e.channels;++M)for(p=h[M],w=0;w<i.length;++w){var C=i[w];p.name==C.name&&(p.compression=C.compression,C.index>=0&&(m.idx[C.index]=M),p.offset=M)}if(t.acCompressedSize>0)switch(t.acCompression){case g:var O=new Uint16Array(t.totalAcUncompressedCount);V(e.array,r,a,t.acCompressedSize,O,t.totalAcUncompressedCount);break;case A:var I=e.array.slice(a.value,a.value+t.totalAcUncompressedCount);O=new Uint16Array(pako.inflate(I).buffer);a.value+=t.totalAcUncompressedCount}if(t.dcCompressedSize>0){var E={array:e.array,offset:a,size:t.dcCompressedSize},R=new Uint16Array(Q(E).buffer);a.value+=t.dcCompressedSize}if(t.rleRawSize>0){I=e.array.slice(a.value,a.value+t.rleCompressedSize);var x=W(pako.inflate(I).buffer);a.value+=t.rleCompressedSize}var P=0,z=new Array(h.length);for(w=0;w<z.length;++w)z[w]=new Array;for(var N=0;N<e.lines;++N)for(var T=0;T<h.length;++T)z[T].push(P),P+=h[T].width*e.type*y;!function(e,r,a,n,t,i){for(var o=new DataView(i.buffer),f=a[e.idx[0]].width,l=a[e.idx[0]].height,u=Math.floor(f/8),s=Math.ceil(f/8),v=Math.ceil(l/8),c=f-8*(s-1),h=l-8*(v-1),w={value:0},p=new Array(3),d=new Array(3),g=new Array(3),A=new Array(3),S=new Array(3),U=0;U<3;++U)S[U]=r[e.idx[U]],p[U]=U<1?0:p[U-1]+s*v,d[U]=new Float32Array(64),g[U]=new Uint16Array(64),A[U]=new Uint16Array(64*s);for(var b=0;b<v;++b){var m=8;b==v-1&&(m=h);for(var M=8,C=0;C<s;++C){for(C==s-1&&(M=c),U=0;U<3;++U)g[U].fill(0),g[U][0]=t[p[U]++],G(w,n,g[U]),Y(g[U],d[U]),j(d[U]);for(q(d),U=0;U<3;++U)J(d[U],A[U],64*C)}var O=0;for(U=0;U<3;++U){for(var I=a[e.idx[U]].type,E=8*b;E<8*b+m;++E)for(O=S[U][E],C=0;C<u;++C){var R=64*C+8*(7&E);o.setUint16(O+0*y*I,A[U][R+0],!0),o.setUint16(O+1*y*I,A[U][R+1],!0),o.setUint16(O+2*y*I,A[U][R+2],!0),o.setUint16(O+3*y*I,A[U][R+3],!0),o.setUint16(O+4*y*I,A[U][R+4],!0),o.setUint16(O+5*y*I,A[U][R+5],!0),o.setUint16(O+6*y*I,A[U][R+6],!0),o.setUint16(O+7*y*I,A[U][R+7],!0),O+=8*y*I}if(u!=s)for(E=8*b;E<8*b+m;++E){O=S[U][E]+8*u*y*I,R=64*u+8*(7&E);for(var x=0;x<M;++x)o.setUint16(O+x*y*I,A[U][R+x],!0)}}}var P=new Uint16Array(f);for(o=new DataView(i.buffer),U=0;U<3;++U)if(a[e.idx[U]].decoded=!0,I=a[e.idx[U]].type,2==a[U].type)for(E=0;E<l;++E){for(O=S[U][E],x=0;x<f;++x)P[x]=o.getUint16(O+x*y*I,!0);for(x=0;x<f;++x)o.setFloat32(O+x*y*I,le(P[x]),!0)}}(m,z,h,O,R,n);for(w=0;w<h.length;++w){if(!(p=h[w]).decoded)switch(p.compression){case b:var k=0,_=0;for(N=0;N<e.lines;++N){for(var D=z[w][k],F=0;F<p.width;++F){for(var B=0;B<y*p.type;++B)n[D++]=x[_+B*p.width*p.height];_++}k++}break;case U:default:throw"EXRLoader.parse: unsupported channel compression"}}return new DataView(n.buffer)}function ee(e,r){for(var a=new Uint8Array(e),n=0;0!=a[r.value+n];)n+=1;var t=(new TextDecoder).decode(a.slice(r.value,r.value+n));return r.value=r.value+n+1,t}function re(e,r){var a=e.getUint32(0,!0);return r.value=r.value+h,a}function ae(e,r){var a=e.getInt32(r.value,!0);return r.value=r.value+p,a}function ne(e,r){var a=e.getUint32(r.value,!0);return r.value=r.value+p,a}function te(e,r){var a=e[r.value];return r.value=r.value+d,a}function ie(e,r){var a=e.getUint8(r.value);return r.value=r.value+d,a}function oe(e,r){var a=Number(e.getBigInt64(r.value,!0));return r.value+=h,a}function fe(e,r){var a=e.getFloat32(r.value,!0);return r.value+=w,a}function le(e){var r=(31744&e)>>10,a=1023&e;return(e>>15?-1:1)*(r?31===r?a?NaN:1/0:Math.pow(2,r-15)*(1+a/1024):a/1024*6103515625e-14)}function ue(e){M.setFloat32(0,e);var r=M.getInt32(0),a=r>>16&32768,n=r>>12&2047,t=r>>23&255;return t<103?a:t>142?(a|=31744,a|=(255==t?0:1)&&8388607&r):t<113?a|=((n|=2048)>>114-t)+(n>>113-t&1):(a|=t-112<<10|n>>1,a+=1&n)}function se(e,r){var a=e.getUint16(r.value,!0);return r.value+=y,a}function ve(e,r,a,n,t){return"string"===n||"stringvector"===n||"iccProfile"===n?function(e,r,a){var n=(new TextDecoder).decode(new Uint8Array(e).slice(r.value,r.value+a));return r.value=r.value+a,n}(r,a,t):"chlist"===n?function(e,r,a,n){for(var t=a.value,i=[];a.value<t+n-1;){var o=ee(r,a),f=ae(e,a),l=ie(e,a);a.value+=3;var u=ae(e,a),s=ae(e,a);i.push({name:o,pixelType:f,pLinear:l,xSampling:u,ySampling:s})}return a.value+=1,i}(e,r,a,t):"chromaticities"===n?function(e,r){return{redX:fe(e,r),redY:fe(e,r),greenX:fe(e,r),greenY:fe(e,r),blueX:fe(e,r),blueY:fe(e,r),whiteX:fe(e,r),whiteY:fe(e,r)}}(e,a):"compression"===n?function(e,r){return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][ie(e,r)]}(e,a):"box2i"===n?function(e,r){return{xMin:ne(e,r),yMin:ne(e,r),xMax:ne(e,r),yMax:ne(e,r)}}(e,a):"lineOrder"===n?function(e,r){return["INCREASING_Y"][ie(e,r)]}(e,a):"float"===n?fe(e,a):"v2f"===n?function(e,r){return[fe(e,r),fe(e,r)]}(e,a):"v3f"===n?function(e,r){return[fe(e,r),fe(e,r),fe(e,r)]}(e,a):"int"===n?ae(e,a):"rational"===n?function(e,r){return[ae(e,r),ne(e,r)]}(e,a):"timecode"===n?function(e,r){return[ne(e,r),ne(e,r)]}(e,a):(a.value+=t,void console.log("Cannot parse value for unsupported type: "+n))}var ce=new DataView(e),he=new Uint8Array(e),we={};ce.getUint32(0,!0),ce.getUint8(4,!0),ce.getUint8(5,!0);for(var pe={value:8},ye=!0;ye;){var de=ee(e,pe);if(0==de)ye=!1;else{var ge=ve(ce,e,pe,ee(e,pe),ne(ce,pe));we[de]=ge}}var Ae,Se,Ue,be,me=we.dataWindow.yMax+1;switch(we.compression){case"NO_COMPRESSION":Se=1,Ae=function(e){return new DataView(e.array.buffer,e.offset.value,e.size)};break;case"RLE_COMPRESSION":Se=1,Ae=function(e){var r=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),a=new Uint8Array(W(r)),n=new Uint8Array(a.length);return Z(a),H(a,n),new DataView(n.buffer)};break;case"ZIPS_COMPRESSION":Se=1,Ae=Q;break;case"ZIP_COMPRESSION":Se=16,Ae=Q;break;case"PXR24_COMPRESSION":Se=16,Ae=function(e){for(var r=e.array.slice(e.offset.value,e.offset.value+e.size),a=new Uint8Array(pako.inflate(r).buffer),n=new Uint8Array(a.length),t=n,i=Ee,o=0;o<t.length;o+=2*i){for(var f=0;f<i;f++)t[o+2*f]=a[o+f+i],t[o+2*f+1]=a[o+f];var l=new Uint16Array(t.buffer,o,i);for(f=1;f<i;f++)l[f]=l[f-1]+l[f]&65535}return new DataView(n.buffer)};break;case"PIZ_COMPRESSION":Se=32,Ae=function(e){for(var r=e.viewer,t={value:e.offset.value},i=e.width*Se*(we.channels.length*e.type),o=new Uint16Array(i),f=new Uint8Array(n),l=0,u=new Array(e.channels),s=0;s<e.channels;s++)u[s]={},u[s].start=l,u[s].end=u[s].start,u[s].nx=e.width,u[s].ny=e.lines,u[s].size=e.type,l+=u[s].nx*u[s].ny*u[s].size;var v=se(r,t),c=se(r,t);if(c>=n)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(v<=c)for(s=0;s<c-v+1;s++)f[s+v]=ie(r,t);var h=new Uint16Array(a),w=function(e,r){for(var n=0,t=0;t<a;++t)(0==t||e[t>>3]&1<<(7&t))&&(r[n++]=t);for(var i=n-1;n<a;)r[n++]=0;return i}(f,h),p=ne(r,t);for(V(e.array,r,t,p,o,l),s=0;s<e.channels;++s)for(var d=u[s],g=0;g<u[s].size;++g)X(o,d.start+g,d.nx,d.size,d.ny,d.nx*d.size,w);!function(e,r,a){for(var n=0;n<a;++n)r[n]=e[r[n]]}(h,o,l);for(var A=0,S=new Uint8Array(o.buffer.byteLength),U=0;U<e.lines;U++)for(var b=0;b<e.channels;b++){var m=(d=u[b]).nx*d.size,M=new Uint8Array(o.buffer,d.end*y,m*y);S.set(M,A),A+=m*y,d.end+=m}return new DataView(S.buffer)};break;case"DWAA_COMPRESSION":Se=32,Ae=$;break;case"DWAB_COMPRESSION":Se=256,Ae=$;break;default:throw"EXRLoader.parse: "+we.compression+" is unsupported"}var Me=we.channels[0].pixelType;if(1===Me)switch(this.type){case r.UnsignedByteType:case r.FloatType:be=function(e,r){return le(se(e,r))},Ue=y;break;case r.HalfFloatType:be=se,Ue=y}else{if(2!==Me)throw"EXRLoader.parse: unsupported pixelType "+Me+" for "+we.compression+".";switch(this.type){case r.UnsignedByteType:case r.FloatType:be=fe,Ue=w;break;case r.HalfFloatType:be=function(e,r){return ue(fe(e,r))},Ue=w}}for(var Ce=me/Se,Oe=0;Oe<Ce;Oe++)re(ce,pe);var Ie=we.dataWindow,Ee=Ie.xMax-Ie.xMin+1,Re=Ie.yMax-Ie.yMin+1,xe=Ee*Re*4;switch(this.type){case r.UnsignedByteType:case r.FloatType:var Pe=new Float32Array(xe);we.channels.length<4&&Pe.fill(1,0,xe);break;case r.HalfFloatType:Pe=new Uint16Array(xe);we.channels.length<4&&Pe.fill(15360,0,xe);break;default:console.error("THREE.EXRLoader: unsupported type: ",this.type)}for(var ze,Ne,Te={R:0,G:1,B:2,A:3},ke={size:0,width:Ee,lines:Se,offset:pe,array:he,viewer:ce,type:Me,channels:we.channels.length},_e={value:0},De=0;De<Re/Se;De++){ze=ne(ce,pe),xe=ne(ce,pe),ke.lines=ze+Se>Re?Re-ze:Se,ke.offset=pe,ke.size=xe,Ne=Ae(ke),pe.value+=xe;for(var Fe=0;Fe<Se;Fe++){var Be=Fe+De*Se;if(Be>=Re)break;for(var Le=0;Le<we.channels.length;Le++)for(var Xe=Te[we.channels[Le].name],Ve=0;Ve<Ee;Ve++){var Ze=Fe*(we.channels.length*Ee)+Le*Ee+Ve;_e.value=Ze*Ue;var He=be(Ne,_e);Pe[4*Ee*(Re-1-Be)+4*Ve+Xe]=He}}}if(this.type===r.UnsignedByteType){xe=Pe.length;for(var We,Ge=new Uint8Array(xe),Ye=0;Ye<Re;++Ye)for(var je=0;je<Ee;++je){var qe=Pe[Oe=Ye*Ee*4+4*je],Je=Pe[Oe+1],Ke=Pe[Oe+2];if((We=Ke>(We=qe>Je?qe:Je)?Ke:We)<1e-32)Ge[Oe]=Ge[Oe+1]=Ge[Oe+2]=Ge[Oe+3]=0;else{var Qe=C(We);We=256*Qe[0]/We,Ge[Oe]=qe*We,Ge[Oe+1]=Je*We,Ge[Oe+2]=Ke*We,Ge[Oe+3]=Qe[1]+128}}Pe=Ge}var $e=this.type===r.UnsignedByteType?r.RGBEFormat:r.RGBAFormat;return{header:we,width:Ee,height:Re,data:Pe,format:$e,type:this.type}}};