56 lines
708 KiB
JavaScript
56 lines
708 KiB
JavaScript
var UDOC={};UDOC.G={concat:function(e,r){for(var s=0;s<r.cmds.length;s++)e.cmds.push(r.cmds[s]);for(var s=0;s<r.crds.length;s++)e.crds.push(r.crds[s])},getBB:function(e){for(var r=1e99,s=1e99,o=-r,a=-s,u=0;u<e.length;u+=2){var l=e[u],v=e[u+1];l<r&&(r=l),l>o&&(o=l),v<s&&(s=v),v>a&&(a=v)}return[r,s,o,a]},rectToPath:function(e){return{cmds:["M","L","L","L","Z"],crds:[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]]}},insideBox:function(e,r){return r[0]<=e[0]&&r[1]<=e[1]&&e[2]<=r[2]&&e[3]<=r[3]},isBox:function(e,r){var s=function(y,w){for(var M=0;M<8;M+=2){for(var T=!0,B=0;B<8;B++)if(Math.abs(w[B]-y[B+M&7])>=2){T=!1;break}if(T)return!0}return!1};if(e.cmds.length>10)return!1;var o=e.cmds.join(""),a=e.crds,u=!1;if(o=="MLLLZ"&&a.length==8||o=="MLLLLZ"&&a.length==10){if(a.length==10&&(a=a.slice(0,8)),r==null){r=[a[0],a[1],a[0],a[1]];for(var l=0;l<a.length;l+=2){var v=a[l],p=a[l+1];v<r[0]&&(r[0]=v),p<r[1]&&(r[1]=p),r[2]<v&&(r[2]=v),r[3]<p&&(r[3]=p)}}var c=r[0],_=r[1],f=r[2],g=r[3];u||(u=s(a,[c,_,f,_,f,g,c,g])),u||(u=s(a,[c,g,f,g,f,_,c,_]))}return u},boxArea:function(e){var r=e[2]-e[0],s=e[3]-e[1];return r*s},newPath:function(e){e.pth={cmds:[],crds:[]}},moveTo:function(e,r,s){var o=UDOC.M.multPoint(e.ctm,[r,s]),a=e.pth,u=a.cmds.length;u!=0&&a.cmds[u-1]=="M"&&(a.cmds.pop(),a.crds.pop(),a.crds.pop()),e.pth.cmds.push("M"),e.pth.crds.push(o[0],o[1]),e.cpos=o},lineTo:function(e,r,s){var o=UDOC.M.multPoint(e.ctm,[r,s]);e.cpos[0]==o[0]&&e.cpos[1]==o[1]||(e.pth.cmds.push("L"),e.pth.crds.push(o[0],o[1]),e.cpos=o)},curveTo:function(e,r,s,o,a,u,l){var v;e.pth.cmds.length==0&&UDOC.G.moveTo(e,0,0),v=UDOC.M.multPoint(e.ctm,[r,s]),r=v[0],s=v[1],v=UDOC.M.multPoint(e.ctm,[o,a]),o=v[0],a=v[1],v=UDOC.M.multPoint(e.ctm,[u,l]),u=v[0],l=v[1],e.cpos=v,e.pth.cmds.push("C"),e.pth.crds.push(r,s,o,a,u,l)},closePath:function(e){e.pth.cmds.push("Z")},arc:function(e,r,s,o,a,u,l){if(l)for(;u>a;)u-=2*Math.PI;else for(;u<a;)u+=2*Math.PI;for(var v=(u-a)/4,p=Math.cos(v/2),c=-Math.sin(v/2),_=(4-p)/3,f=c==0?c:(1-p)*(3-p)/(3*c),g=_,y=-f,w=p,M=-c,T=[p,c],B=[_,f],H=[g,y],J=[w,M],Q={cmds:[e.pth.cmds.length==0?"M":"L"],crds:[p,c]},q=[1,0,0,1,0,0],O=0;O<4;O++)B=UDOC.M.multPoint(q,B),H=UDOC.M.multPoint(q,H),J=UDOC.M.multPoint(q,J),Q.crds.push(B[0],B[1],H[0],H[1],J[0],J[1]),Q.cmds.push("C"),O==0&&UDOC.M.rotate(q,-v);var K=[o,0,0,o,r,s];UDOC.M.rotate(q,-a+v/2),UDOC.M.concat(q,K),UDOC.M.multArray(q,Q.crds),UDOC.M.multArray(e.ctm,Q.crds),UDOC.G.concat(e.pth,Q);var s=Q.crds.pop();r=Q.crds.pop(),e.cpos=[r,s]},drawRect:function(e,r,s,o,a){UDOC.G.moveTo(e,r,s),UDOC.G.lineTo(e,r+o,s),UDOC.G.lineTo(e,r+o,s+a),UDOC.G.lineTo(e,r,s+a),UDOC.G.closePath(e)},toPoly:function(e){if(e.cmds[0]!="M"||e.cmds[e.cmds.length-1]!="Z")return null;for(var r=1;r<e.cmds.length-1;r++)if(e.cmds[r]!="L")return null;var s=[],o=e.crds.length;e.crds[0]==e.crds[o-2]&&e.crds[1]==e.crds[o-1]&&(o-=2);for(var r=0;r<o;r+=2)s.push([e.crds[r],e.crds[r+1]]);return UDOC.G.polyArea(e.crds)<0&&s.reverse(),s},fromPoly:function(e){for(var r={cmds:[],crds:[]},s=0;s<e.length;s++)r.crds.push(e[s][0],e[s][1]),r.cmds.push(s==0?"M":"L");return r.cmds.push("Z"),r},polyArea:function(e){if(e.length<6)return 0;for(var r=e.length-2,s=(e[0]-e[r])*(e[r+1]+e[1]),o=0;o<r;o+=2)s+=(e[o+2]-e[o])*(e[o+1]+e[o+3]);return-s*.5},polyClip:function(e,r){var s,o,a,u,l=function(_){return(o[0]-s[0])*(_[1]-s[1])>(o[1]-s[1])*(_[0]-s[0])},v=function(){var _=[s[0]-o[0],s[1]-o[1]],f=[a[0]-u[0],a[1]-u[1]],g=s[0]*o[1]-s[1]*o[0],y=a[0]*u[1]-a[1]*u[0],w=1/(_[0]*f[1]-_[1]*f[0]);return[(g*f[0]-y*_[0])*w,(g*f[1]-y*_[1])*w]},p=e;s=r[r.length-1];for(j in r){var o=r[j],c=p;p=[],a=c[c.length-1];for(i in c){var u=c[i];l(u)?(l(a)||p.push(v()),p.push(u)):l(a)&&p.push(v()),a=u}s=o}return p}},UDOC.M={getScale:function(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))},translate:function(e,r,s){UDOC.M.concat(e,[1,0,0,1,r,s])},rotate:function(e,r){UDOC.M.concat(e,[Math.cos(r),-Math.sin(r),Math.sin(r),Math.cos(r),0,0])},scale:function(e,r,s){UDOC.M.concat(e,[r,0,0,s,0,0])},concat:function(e,r){var s=e[0],o=e[1],a=e[2],u=e[3],l=e[4],v=e[5];e[0]=s*r[0]+o*r[2],e[1]=s*r[1]+o*r[3],e[2]=a*r[0]+u*r[2],e[3]=a*r[1]+u*r[3],e[4]=l*r[0]+v*r[2]+r[4],e[5]=l*r[1]+v*r[3]+r[5]},invert:function(e){var r=e[0],s=e[1],o=e[2],a=e[3],u=e[4],l=e[5],v=r*a-s*o;e[0]=a/v,e[1]=-s/v,e[2]=-o/v,e[3]=r/v,e[4]=(o*l-a*u)/v,e[5]=(s*u-r*l)/v},multPoint:function(e,r){var s=r[0],o=r[1];return[s*e[0]+o*e[2]+e[4],s*e[1]+o*e[3]+e[5]]},multArray:function(e,r){for(var s=0;s<r.length;s+=2){var o=r[s],a=r[s+1];r[s]=o*e[0]+a*e[2]+e[4],r[s+1]=o*e[1]+a*e[3]+e[5]}}},UDOC.C={srgbGamma:function(e){return e<.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055},cmykToRgb:function(e){var r=e[0],s=e[1],o=e[2],a=e[3],u=255+r*(-4.387332384609988*r+54.48615194189176*s+18.82290502165302*o+212.25662451639585*a+-285.2331026137004)+s*(1.7149763477362134*s-5.6096736904047315*o+-17.873870861415444*a-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*a+17.5119270841813)+a*(-21.86122147463605*a-189.48180835922747),l=255+r*(8.841041422036149*r+60.118027045597366*s+6.871425592049007*o+31.159100130055922*a+-79.2970844816548)+s*(-15.310361306967817*s+17.575251261109482*o+131.35250912493976*a-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*a-24.86741582555878)+a*(-20.737325471181034*a-187.80453709719578),v=255+r*(.8842522430003296*r+8.078677503112928*s+30.89978309703729*o-.23883238689178934*a+-14.183576799673286)+s*(10.49593273432072*s+63.02378494754052*o+50.606957656360734*a-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*a+-193.58209356861505)+a*(-22.33816807309886*a-180.12613974708367);return[Math.max(0,Math.min(1,u/255)),Math.max(0,Math.min(1,l/255)),Math.max(0,Math.min(1,v/255))]},labToRgb:function(e){for(var r=903.3,s=.008856,o=e[0],a=e[1],u=e[2],l=(o+16)/116,v=l*l*l,p=l-u/200,c=p*p*p,_=a/500+l,f=_*_*_,g=c>s?c:(116*p-16)/r,y=v>s?v:(116*l-16)/r,w=f>s?f:(116*_-16)/r,M=w*96.72,T=y*100,B=g*81.427,H=[M/100,T/100,B/100],J=[3.1338561,-1.6168667,-.4906146,-.9787684,1.9161415,.033454,.0719453,-.2289914,1.4052427],Q=[J[0]*H[0]+J[1]*H[1]+J[2]*H[2],J[3]*H[0]+J[4]*H[1]+J[5]*H[2],J[6]*H[0]+J[7]*H[1]+J[8]*H[2]],q=0;q<3;q++)Q[q]=Math.max(0,Math.min(1,UDOC.C.srgbGamma(Q[q])));return Q}},UDOC.getState=function(e){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:e?UDOC.G.rectToPath(e):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(e,r){e=new Uint8Array(e);for(var s=0;!(e[s]==37&&e[s+1]==33);)s++;for(var o=FromPS.B.readASCII(e,s,e.length-s),a=o.split(/[\n\r]+/),u=null,l=null,v=0;v<a.length;v++){var p=a[v].trim();if(p.charAt(0)=="%"){for(p=p.slice(1);p.charAt(0)=="%";)p=p.slice(1);var c=p.split(":");c[0]=="BoundingBox"&&(u=c[1].trim().split(/[ ]+/).map(parseFloat)),p.indexOf("!PS-Adobe-3.0 EPSF-3.0")!=-1&&(l=p),p.indexOf("!PS-Adobe-2.0 EPSF-1.2")!=-1&&(l=p)}}(l==null||u==null)&&(u=[0,0,595,842]);for(var _=[],f=FromPS._getDictStack([],{}),g=[{typ:"file",val:{buff:e,off:s}}],y=[],w=FromPS._getEnv(u),M=Date.now(),T=!0;T;)T=FromPS.step(_,f,g,y,w,r);w.pgOpen&&r.ShowPage(),r.Done(),console.log(Date.now()-M)},FromPS._getDictStack=function(e,r){for(var s=["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","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","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"].concat(e),o=["image","colorimage","repeat","for","forall","loop"],a=0;a<o.length;a++)s.push(o[a]+"---");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 u in FromPS._myOps)s.push(u);prcs=r;var l={},v={},p={},c={};l.systemdict={typ:"dict",val:l},l.globaldict={typ:"dict",val:v},l.userdict={typ:"dict",val:p},l.statusdict={typ:"dict",val:c},l.GlobalFontDirectory=l.SharedFontDirectory={typ:"dict",val:{}},l.FontDirectory={typ:"dict",val:{}},l.$error={typ:"dict",val:{}},l.errordict={typ:"dict",val:FromPS.makeProcs({handleerror:""})},l.null={typ:"null",val:null},l.true={typ:"boolean",val:!0},l.false={typ:"boolean",val:!1},l.product={typ:"string",val:FromPS.makeStr("Photopea")},l.version={typ:"string",val:[51]},l.languagelevel={typ:"integer",val:3};for(var a=0;a<s.length;a++)l[s[a]]={typ:"operator",val:s[a]};for(var _ in prcs)l[_]=prcs[_];return[l,v,p]},FromPS._getEnv=function(e){var r={bb:e,gst:UDOC.getState(e),packing:!1,overprint:!1,global:!1,systemparams:{MaxPatternCache:{type:"integer",val:5e3}},userparams:{},pagedevice:{PageSize:{typ:"array",val:[{typ:"real",val:e[2]},{typ:"real",val:e[3]}]}},cmnum:0,fnt:null,res:{},pgOpen:!1,funs:FromPS.makeProcs({blackgeneration:"",undercolorremoval:"pop 0"})},s;s=["Font","CIDFont","CMap","FontSet","Form","Pattern","ProcSet","Halftone","ColorRendering","IdiomSet","InkParams","TrapParams","OutputDevice","ControlLanguage","Localization","PDL","HWOptions"];for(var o=0;o<s.length;o++)r.res[s[o]]={typ:"dict",val:{},maxl:1e3};s=["Encoding","ColorSpace"];for(var o=0;o<s.length;o++)r.res[s[o]]={typ:"array",val:[]};r.res.Category={typ:"dict",val:r.res},r.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 o=0;o<s.length;o++)r.res[s[o]]={typ:"dict",val:{},maxl:1e3};return r},FromPS.makeProcs=function(e){var r={};for(var s in e){var o=e[s].replace(/ +/g," ").split(" ");r[s]={typ:"procedure",val:[]};for(var a=0;a<o.length;a++)r[s].val.push({typ:"name",val:o[a]})}return r},FromPS.addProc=function(e,r){if(e.val.length!=0){if(e.typ!="procedure")throw console.log(e),e.typ;r.push({typ:"procedure",val:e.val,off:0})}},FromPS.stepC=0,FromPS._f32=new Float32Array(1),FromPS.step=function(e,r,s,o,a,u,l,v){var p=Date.now(),c=FromPS._f32,_=FromPS.getToken,f=a.gst,g=_(s,r);if(g==null)return!1;v&&g.typ=="string"&&FromPS.readStr(g.val)=="def"&&(g={typ:"operator",val:"def"});var y=g.typ,w=g.val;if(isNaN(f.cpos[0]))throw"e";var M=!1;if(M&&console.log(g,e.slice(0)),["integer","real","dict","boolean","string","array","procedure","null","file"].indexOf(y)!=-1)return e.push(g),!0;if(y!="name"&&y!="operator")throw"e";if(w.charAt(0)=="/")e.push(g);else{if(w.startsWith("II*"))return!1;if(w=="{"){for(var T=[],B={typ:"procedure",val:[]},H=_(s,r);;){if(H.val=="{"){var J={typ:"procedure",val:[]};B.val.push(J),T.push(B),B=J}else if(H.val=="}"){if(T.length==0)break;B=T.pop()}else B.val.push(H);H=_(s,r)}e.push(B)}else if(w=="["||w=="<<")e.push({typ:"mark"});else if(w=="]"||w==">>"){for(var Q=[];e.length!=0;){var q=e.pop();if(q.typ=="mark")break;Q.push(q)}if(Q.reverse(),w=="]")e.push({typ:"array",val:Q});else{for(var O={},K=0;K<Q.length;K+=2)O[Q[K].val.slice(1)]=Q[K+1];e.push({typ:"dict",val:O,maxl:1e3})}}else{var pe=FromPS.getFromStacks(w,r);if(M&&console.log("---",pe),pe==null){if(v)return!1;throw console.log("unknown operator",w,e,r),"e"}else if(pe.typ=="procedure")FromPS.addProc(pe,s);else if(["array","string","dict","null","integer","real","boolean","state","name","file"].indexOf(pe.typ)!=-1)e.push(pe);else if(pe.typ=="operator"){var R=pe.val,Te=["known","if","ifelse","currentpacking","setpacking","dict","dup","begin","end","put","bind","def","undef","where","pop","get","exec","ge","stop","stopped","cvr","string","not","and"];if(FromPS._myOps[R])FromPS.addProc(FromPS._myOps[R],s);else if(!(R=="flattenpath"||R=="limitcheck")){if(R=="def"){var re=e.pop(),oe=e.pop();if(oe==null&&v)return!1;oe=FromPS.getDKey(oe),r[r.length-1][oe]=re}else if(R=="undef"||R=="known"){var me=FromPS.getDKey(e.pop()),ue=e.pop(),$=ue.val;R=="undef"?delete $[me]:e.push({typ:"boolean",val:ue.typ!="null"&&$[me]!=null})}else if(R=="internaldict"){var ee=e.pop().val;e.push({typ:"dict",val:{},maxl:1e3})}else if(R=="dict"){var ee=e.pop().val;e.push({typ:"dict",val:{},maxl:ee})}else if(R=="string"){var ee=e.pop().val;e.push({typ:"string",val:new Array(ee)})}else if(R=="readstring"||R=="readhexstring"){var ne=e.pop(),ee=ne.val.length,_e=e.pop(),ae=FromPS.GetFile(_e).val;if(R=="readstring"){for(var K=0;K<ee;K++)ne.val[K]=ae.buff[ae.off+K];ae.off+=ee}else FromPS.readHex(ae,ee,ne.val);e.push(ne,{typ:"boolean",val:!0})}else if(R=="readline"){var ne=e.pop(),ae=FromPS.GetFile(e.pop()).val,K=0;for(FromPS.isEOL(ae.buff[ae.off])&&ae.off++;K<ne.val.length;){var Me=ae.buff[ae.off];if(ae.off++,Me==null)throw"e";if(FromPS.isEOL(Me)){ae.buff[ae.off]==10&&ae.off++;break}ne.val[K]=Me,K++}e.push({typ:"string",val:ne.val.slice(0,K)}),e.push({typ:"boolean",val:!0})}else if(R=="getinterval"){var Ne=e.pop().val,Ae=e.pop().val,Fe=e.pop(),De=[];if(Fe.typ=="string"||Fe.typ=="array")for(var K=0;K<Ne;K++)De.push(Fe.val[Ae+K]);else throw"e";e.push({typ:Fe.typ,val:De})}else if(R=="putinterval"){var Fe=e.pop(),Ae=e.pop().val,ze=e.pop();if(!(Ae+Fe.val.length>=ze.val.length))if(Fe.typ=="string")for(var K=0;K<Fe.val.length;K++)ze.val[Ae+K]=Fe.val[K];else throw"e"}else if(R=="token"){var Fe=e.pop();if(Fe.typ!="string")throw"e";for(var Q=[],K=0;K<Fe.val.length;K++){var ye=Fe.val[K];if(ye==null)break;Q.push(ye)}for(var he={buff:new Uint8Array(Q),off:0},g=_([{typ:"file",val:he}],r),ke=[],K=he.off;K<Q.length;K++)ke.push(Q[K]);e.push({typ:"string",val:ke},g,{typ:"boolean",val:!0})}else if(R=="array"){var ee=e.pop().val;e.push({typ:"array",val:new Array(ee)})}else if(R=="aload"){for(var q=e.pop(),Q=q.val,K=0;K<Q.length;K++)e.push(Q[K]);e.push(q)}else if(R=="astore"){for(var q=e.pop(),Q=q.val,K=0;K<Q.length;K++)Q[Q.length-1-K]=e.pop();e.push(q)}else if(R=="length"){var q=e.pop(),y=q.typ,ee=0;if(y=="array")ee=q.val.length;else if(y=="procedure")ee=q.val.length;else if(y=="dict")ee=Object.keys(q.val).length;else if(y=="string")ee=q.val.length;else throw console.log(q),"e";e.push({typ:"integer",val:ee})}else if(R=="maxlength"){var le=e.pop();e.push({typ:"integer",val:le.maxl})}else if(R=="matrix")e.push({typ:"array",val:FromPS.makeArr([1,0,0,1,0,0],"real")});else if(R=="count")e.push({typ:"integer",val:e.length});else if(R=="mark")e.push({typ:"mark"});else if(R=="counttomark"||R=="cleartomark"){for(var Ce=0;Ce<e.length&&e[e.length-1-Ce].typ!="mark";)Ce++;if(R=="cleartomark")for(var K=0;K<Ce+1;K++)e.pop();else e.push({typ:"integer",val:Ce})}else if(R=="dictstack"){for(var Q=e.pop(),K=0;K<r.length;K++)Q.val[K]={typ:"dict",val:r[K],maxl:1e3};e.push(Q)}else if(R=="countdictstack"){for(var Be=0,K=0;K<e.length;K++)e[K].typ=="dict"&&Be++;e.push({typ:"integer",val:Be})}else if(R=="begin"){var q=e.pop(),$=q.val;if($==null||q.typ!="dict")throw console.log(q,r),"e";r.push($)}else if(R=="end")r.pop();else if(R=="currentfile"){for(var we,K=s.length-1;K>=0;K--)if(s[K].typ=="file"){we=s[K];break}e.push({typ:"file",val:we.val})}else if(R=="currentdict"){var $=r[r.length-1];e.push({typ:"dict",val:$,maxl:1e3})}else if(["currentpacking","currentoverprint","currentglobal","currentsystemparams","currentuserparams","currentpagedevice"].indexOf(R)!=-1){var re=a[R.slice(7)];e.push({typ:typeof re=="boolean"?"boolean":"dict",val:re})}else if(R=="gcheck"){var xe=e.pop();e.push({typ:"boolean",val:!1})}else if(["setpacking","setoverprint","setglobal","setsystemparams","setuserparams","setpagedevice"].indexOf(R)!=-1)a[R.slice(3)]=e.pop().val;else if(R=="currentflat")e.push({typ:"real",val:1});else if(R=="currentlinewidth")e.push({typ:"real",val:f.lwidth});else if(R=="currentdash")e.push({typ:"array",val:FromPS.makeArr(f.dash,"integer")},{typ:"real",val:f.doff});else if(R=="currentpoint"){var Ie=f.ctm.slice(0);UDOC.M.invert(Ie);var Re=UDOC.M.multPoint(Ie,f.cpos);e.push({typ:"real",val:Re[0]},{typ:"real",val:Re[1]})}else if(R=="currentscreen")e.push({typ:"int",val:60},{typ:"real",val:0},{typ:"real",val:0});else if(R=="setscreen")e.pop(),e.pop(),e.pop();else if(R=="currenthalftone")e.push({typ:"dict",val:{},maxl:1e3});else if(R=="currentblackgeneration"||R=="currentundercolorremoval")e.push(a.funs[R.slice(7)]);else if(R=="currentcolortransfer")for(var K=0;K<4;K++)e.push(a.funs.blackgeneration);else if(R=="findresource"){var Le=e.pop().val.slice(1),Oe=e.pop(),me=Oe.val.slice(1);Le=="Font"&&(a.res[Le].val[me]={typ:"dict",val:{FontType:{typ:"integer",val:1},FontMatrix:{typ:"array",val:FromPS.makeArr([1,0,0,1,0,0],"real")},FontName:Oe,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}}});var Ve;if(Le=="Category"&&me=="Generic"?Ve={typ:"dict",val:{},maxl:1e3}:Le=="ProcSet"&&me=="CIDInit"?Ve={typ:"dict",val:{},maxl:1e3}:Ve=a.res[Le].val[me],Ve==null)throw"e";e.push(Ve)}else if(R=="resourcestatus"){var Le=e.pop().val.slice(1),me=e.pop().val.slice(1),Ve=a.res[Le].val[me];Ve&&(e.push({typ:"integer",val:1}),e.push({typ:"integer",val:Object.keys(Ve.val).length})),e.push({typ:"boolean",val:Ve!=null})}else if(R=="defineresource"){var Le=e.pop().val.slice(1),Xe=e.pop(),me=e.pop().val.slice(1);a.res[Le].val[me]=Xe,e.push(Xe)}else if(R=="undefineresource"){var Le=e.pop().val.slice(1),me=e.pop().val.slice(1);delete a.res[Le].val[me]}else if(R=="resourceforall"){var Le=e.pop().val.slice(1),We=e.pop().val,t=e.pop(),h=e.pop().val;if(h.length!=1||h[0]!=42)throw"e";var d=a.res[Le].val;for(var me in d){for(var ne=We.slice(0),K=0;K<me.length;K++)ne[K]=me[K];FromPS.addProc(t,s),FromPS.addProc({typ:"procedure",val:[{typ:"string",val:ne}]},s)}}else if(R=="image"||R=="colorimage"){var x,E,C,b,U=1,D=!1,k=[],Z=e.pop();if(e.push(Z),R=="image"&&Z.typ=="dict"){var Y=e.pop().val;x=Y.Width.val,E=Y.Height.val,C=Y.BitsPerComponent.val,b=FromPS.readArr(Y.ImageMatrix.val),U=Y.NComponents?Y.NComponents.val:1,D=Y.MultipleDataSources?Y.MultipleDataSources.val:!1,k=Y.DataSource.val,Y.DataSource.typ=="file"&&(k=[Y.DataSource])}else{R=="colorimage"&&(U=e.pop().val,D=e.pop().val),D?(k[2]=e.pop(),k[1]=e.pop(),k[0]=e.pop()):k=[e.pop()];var b=FromPS.readArr(e.pop().val),C=e.pop().val,E=e.pop().val,x=e.pop().val}if(U!=1&&U!=3&&U!=4)throw"unsupported number of channels "+U;if(C!=8)throw"unsupported bits per channel: "+C;for(var W=new Uint8Array(x*E*4),K=0;K<W.length;K++)W[K]=255;if(s.push({typ:"name",val:R+"---",ctx:[x,E,C,b,U,D,W,0,k]}),k[0].typ=="procedure")for(var K=0;K<k.length;K++)FromPS.addProc(k[K],s)}else if(R=="image---"||R=="colorimage---"){var F=g.ctx,x=F[0],E=F[1],C=F[2],b=F[3],U=F[4],D=F[5],W=F[6],z=F[7],k=F[8],G=0;if(D)for(K=0;K<U;K++){var X=k[K];if(X.typ=="procedure"?X=e.pop().val:X=X.val,G=X.length,U==4)for(var A=0;A<G;A++)W[(z+A)*4+3-K]=X[A];if(U==3)for(var A=0;A<G;A++)W[(z+A)*4+2-K]=X[A]}else{var X;k[0].typ=="file"?X=FromPS.GetFile(k[0]).val.buff:X=e.pop().val,G=Math.floor(X.length/3);for(var A=0;A<G;A++){var N=A*3,I=(z+A)*4;W[I+0]=X[N+0],W[I+1]=X[N+1],W[I+2]=X[N+2]}}if(z+=G,FromPS.checkPageStarted(a,u),z==x*E){var te=1/255;if(f.space=="/DeviceCMYK")for(var K=0;K<W.length;K+=4){var fe=[W[K]*te,W[K+1]*te,W[K+2]*te,W[K+3]*te],S=UDOC.C.cmykToRgb(fe);W[K]=S[0]*255,W[K+1]=S[1]*255,W[K+2]=S[2]*255,W[K+3]=255}var de=f.ctm.slice(),se=b.slice(0);UDOC.M.invert(se);var ie=[x,0,0,-E,0,E];UDOC.M.concat(ie,se),UDOC.M.concat(f.ctm,ie),u.PutImage(f,W,x,E),f.ctm=de}else if(F[7]=z,s.push(g),k[0].typ=="procedure")for(var K=0;K<k.length;K++)FromPS.addProc(k[K],s)}else if(R=="makepattern"){var ge=e.pop().val,le=e.pop().val;e.push({typ:"array",val:[le,JSON.parse(JSON.stringify(ge))]})}else if(R=="makefont"||R=="scalefont"){var Pe=R=="makefont",F=e.pop().val;Pe&&(F=FromPS.readArr(F));var Ye=JSON.parse(JSON.stringify(e.pop())),Ge=FromPS.readArr(Ye.val.FontMatrix.val);Pe?UDOC.M.concat(Ge,F):UDOC.M.scale(Ge,F,F),Ye.val.FontMatrix.val=FromPS.makeArr(Ge),e.push(Ye)}else if(R=="stringwidth"||R=="charpath"){R=="charpath"&&e.pop();var Ze=e.pop().val,ne=FromPS.readStr(Ze),Je=UDOC.M.getScale(f.font.Tm)/UDOC.M.getScale(f.ctm),tt=.55*Je*ne.length;R=="stringwidth"?e.push({typ:"real",val:tt},{typ:"real",val:0}):UDOC.G.drawRect(f,0,0,tt,Je)}else if(R=="setfont"){var Ye=e.pop().val;f.font.Tf=Ye.FontName.val.slice(1),f.font.Tm=FromPS.readArr(Ye.FontMatrix.val)}else if(R=="setlinewidth")f.lwidth=e.pop().val;else if(R=="setstrokeadjust")f.SA=e.pop().val;else if(R=="setlinecap")f.lcap=e.pop().val;else if(R=="setlinejoin")f.ljoin=e.pop().val;else if(R=="setmiterlimit")f.mlimit=e.pop().val;else if(R=="setflat")f.dd.flat=e.pop();else if(R=="setdash")f.doff=e.pop().val,f.dash=FromPS.readArr(e.pop().val);else if(R=="show"||R=="ashow"||R=="xshow"||R=="yshow"||R=="xyshow"||R=="widthshow"||R=="awidthshow"){(R=="xshow"||R=="xyshow"||R=="yshow")&&e.pop();var Ze=e.pop().val,ne=FromPS.readStr(Ze);R=="awidthshow"&&(e.pop(),e.pop(),e.pop(),e.pop()),R=="widthshow"&&(e.pop(),e.pop(),e.pop()),R=="ashow"&&(e.pop(),e.pop());var nt=f.ctm;f.ctm=nt.slice(0),f.ctm[4]=f.cpos[0],f.ctm[5]=f.cpos[1],FromPS.checkPageStarted(a,u),u.PutText(f,ne,ne.length*.55),f.cpos[0]+=ne.length*UDOC.M.getScale(nt)*UDOC.M.getScale(f.font.Tm)*.55,f.ctm=nt}else if(R=="cshow")e.pop(),e.pop();else if(R=="currentcolorspace")e.push({typ:"array",val:[{typ:"name",val:f.space}]});else if(R=="setcolorspace"){var at=e.pop();if(f.space=at.val,at.typ=="array")f.space=at.val[0].val;else if(at.typ=="name")f.space=at.val;else throw console.log(at),"e"}else if(R=="setcolor"||R=="_setHSB_"){var ut;if(f.space=="/Pattern"){var fe=e.pop();if(fe.typ!="array")throw"e";var Re=fe.val,ge=FromPS.readArr(Re[1]);UDOC.M.concat(ge,f.ctm),ut=FromPS.getPSShadingFill(Re[0].Shading,ge)}else if(f.space=="/DeviceGray"){var st=FromPS.nrm(e.pop().val);ut=[st,st,st]}else if(R=="_setHSB_"){var xe=e.pop().val,gt=e.pop().val,E=e.pop().val,ft,st,ct,K,_t,Re,Et,mt;switch(K=Math.floor(E*6),_t=E*6-K,Re=xe*(1-gt),Et=xe*(1-_t*gt),mt=xe*(1-(1-_t)*gt),K%6){case 0:ft=xe,st=mt,ct=Re;break;case 1:ft=Et,st=xe,ct=Re;break;case 2:ft=Re,st=xe,ct=mt;break;case 3:ft=Re,st=Et,ct=xe;break;case 4:ft=mt,st=Re,ct=xe;break;case 5:ft=xe,st=Re,ct=Et;break}ut=[FromPS.nrm(ft),FromPS.nrm(st),FromPS.nrm(ct)]}else if(f.space=="/DeviceRGB"){var ct=e.pop().val,st=e.pop().val,ft=e.pop().val;ut=[FromPS.nrm(ft),FromPS.nrm(st),FromPS.nrm(ct)]}else if(f.space=="/DeviceCMYK"){var vt=e.pop().val,lt=e.pop().val,ge=e.pop().val,St=e.pop().val;ut=UDOC.C.cmykToRgb([St,ge,lt,vt])}else throw f.space;ut&&(f.colr=f.COLR=ut)}else if(R=="currentrgbcolor")for(var K=0;K<3;K++)e.push({typ:"real",val:f.colr[K]});else if(R=="currentgray")e.push({typ:"real",val:(f.colr[0]+f.colr[1]+f.colr[2])/3});else if(R=="clip"||R=="eoclip"){var Rt=UDOC.G.getBB(f.pth.crds),Bt=UDOC.G.getBB(f.cpth.crds);if(!(UDOC.G.isBox(f.pth,Rt)&&UDOC.G.insideBox(Bt,Rt)))if(UDOC.G.isBox(f.cpth,Bt)&&UDOC.G.insideBox(Rt,Bt))f.cpth=JSON.parse(JSON.stringify(f.pth));else{var yt=UDOC.G.toPoly(f.pth),Ut=UDOC.G.toPoly(f.cpth);if(yt&&Ut){var Re=UDOC.G.polyClip(yt,Ut);Re.length!=0?f.cpth=UDOC.G.fromPoly(Re):console.log("strange intersection of polygons")}else f.cpth=JSON.parse(JSON.stringify(f.pth))}}else if(R=="clippath")f.pth=JSON.parse(JSON.stringify(f.cpth));else if(R=="pathbbox"){var Dt=f.pth.crds,Ct=UDOC.G.getBB(Dt);Dt=[Ct[0],Ct[1],Ct[2],Ct[1],Ct[0],Ct[3],Ct[2],Ct[3]];var Ie=f.ctm.slice(0);UDOC.M.invert(Ie),UDOC.M.multArray(Ie,Dt),Ct=UDOC.G.getBB(Dt),c[0]=Ct[0],Ct[0]=c[0],c[0]=Ct[1],Ct[1]=c[0],c[0]=Ct[2],Ct[2]=c[0],c[0]=Ct[3],Ct[3]=c[0],Ct=FromPS.makeArr(Ct,"real"),e.push(Ct[0],Ct[1],Ct[2],Ct[3])}else if(R=="newpath")UDOC.G.newPath(f);else if(R=="stroke")FromPS.checkPageStarted(a,u),u.Stroke(f),UDOC.G.newPath(f);else if(R=="shfill"){var Wt=f.colr,Kt=f.pth,Re=e.pop().val,ge=f.ctm.slice(0);f.colr=FromPS.getPSShadingFill({typ:"dict",val:Re,maxl:1e3},ge),FromPS.checkPageStarted(a,u),f.pth=f.cpth,f.cpth=UDOC.G.rectToPath(a.bb),u.Fill(f),f.colr=Wt,f.pth=Kt}else if(R=="fill"||R=="eofill")FromPS.checkPageStarted(a,u),u.Fill(f,R=="eofill"),UDOC.G.newPath(f);else if(R=="showpage"){FromPS.checkPageStarted(a,u),u.ShowPage();var $t=f.font;f=a.gst=UDOC.getState(a.bb),f.font=$t,a.pgOpen=!1}else if(R=="print"){var Ze=e.pop().val,ne=FromPS.readStr(Ze);u.Print(ne)}else if(R=="_drawRect_"){var E=e.pop();if(E.typ!="real"&&E.typ!="integer")throw"e";E=E.val;var x=e.pop().val,lt=e.pop().val,Ft=e.pop().val;UDOC.G.drawRect(f,Ft,lt,x,E)}else if(R=="closepath")UDOC.G.closePath(f);else if(R=="moveto"||R=="lineto"){var lt=e.pop().val,Ft=e.pop().val;R=="moveto"?UDOC.G.moveTo(f,Ft,lt):UDOC.G.lineTo(f,Ft,lt)}else if(R=="rmoveto"||R=="rlineto"){var lt=e.pop().val,Ft=e.pop().val,Ie=f.ctm.slice(0);UDOC.M.invert(Ie);var Re=UDOC.M.multPoint(Ie,f.cpos);lt+=Re[1],Ft+=Re[0],R=="rmoveto"?UDOC.G.moveTo(f,Ft,lt):UDOC.G.lineTo(f,Ft,lt)}else if(R=="curveto"){var Gt=e.pop().val,Nt=e.pop().val,hr=e.pop().val,rr=e.pop().val,zr=e.pop().val,Hi=e.length==0?0:e.pop().val;UDOC.G.curveTo(f,Hi,zr,rr,hr,Nt,Gt)}else if(R=="arc"||R=="arcn"){var Vi=e.pop().val,Wi=e.pop().val,ft=e.pop().val,lt=e.pop().val,Ft=e.pop().val;UDOC.G.arc(f,Ft,lt,ft,Wi*Math.PI/180,Vi*Math.PI/180,R=="arcn")}else if(R=="concat"){var ge=FromPS.readArr(e.pop().val);UDOC.M.concat(ge,f.ctm),f.ctm=ge}else if(["translate","scale","rotate"].indexOf(R)!=-1){var xe=e.pop(),ge,Ft,lt;xe.typ=="array"?(ge=FromPS.readArr(xe.val),lt=e.pop().val):(ge=[1,0,0,1,0,0],lt=xe.val),R!="rotate"&&(Ft=e.pop().val),R=="translate"&&UDOC.M.translate(ge,Ft,lt),R=="scale"&&UDOC.M.scale(ge,Ft,lt),R=="rotate"&&UDOC.M.rotate(ge,-lt*Math.PI/180),xe.typ=="array"?e.push({typ:"array",val:FromPS.makeArr(ge,"real")}):(UDOC.M.concat(ge,f.ctm),f.ctm=ge)}else if(R=="concatmatrix"){var fr=FromPS.readArr,ni=fr(e.pop().val),si=fr(e.pop().val),Gr=fr(e.pop().val),ge=Gr.slice(0);UDOC.M.concat(ge,si),ge=FromPS.makeArr(ge,"real"),e.push({typ:"array",val:ge})}else if(R=="invertmatrix"){var fr=FromPS.readArr,si=fr(e.pop().val),Gr=fr(e.pop().val),ge=Gr.slice(0);UDOC.M.invert(ge),ge=FromPS.makeArr(ge,"real"),e.push({typ:"array",val:ge})}else if(R=="currentmatrix"||R=="defaultmatrix"){for(var ge=e.pop(),Xi=FromPS.makeArr(R=="currentmatrix"?f.ctm:[1,0,0,1,0,0],"real"),K=0;K<6;K++)ge.val[K]=Xi[K];e.push(ge)}else if(R=="setmatrix")f.ctm=FromPS.readArr(e.pop().val);else if(R=="cvi"){var q=e.pop(),xe=q.val,De=0;if(q.typ=="real")De=Math.round(xe);else if(q.typ=="integer")De=xe;else throw"unknown type "+q.typ;e.push({typ:"integer",val:De})}else if(R=="cvr"){var q=e.pop(),xe=q.val,De=0;if(q.typ=="real")De=xe;else if(q.typ=="integer")De=xe;else if(q.typ=="string")De=parseFloat(FromPS.readStr(xe));else throw"unknown type "+q.typ;e.push({typ:"real",val:De})}else if(R=="cvs"){var ne=e.pop(),ir=e.pop(),re="";if(ne.val=[],e.push(ne),ir.typ=="real"||ir.typ=="integer")Math.abs(Math.round(ir.val)-ir.val)<1e-6?re=Math.round(ir.val)+".0":re=(Math.round(ir.val*1e6)/1e6).toString();else if(ir.typ=="name")re=ir.val;else throw"unknown var type: "+ir.typ;for(var K=0;K<re.length;K++)ne.val[K]=re.charCodeAt(K)}else if(R=="cvx"){var q=e.pop(),Cr;if(q.typ=="array")Cr={typ:"procedure",val:q.val};else if(q.typ=="name")Cr={typ:"name",val:q.val.slice(1)};else if(q.typ=="string")Cr={typ:"file",val:{off:0,buff:new Uint8Array(q.val)}};else throw console.log(q),q.typ;e.push(Cr)}else if(R=="cvlit"){var pe=e.pop();pe.typ=="procedure"?e.push({typ:"array",val:pe.val}):e.push(pe)}else if(R=="cvn")e.push({typ:"name",val:FromPS.readStr(e.pop().val)});else if(["add","sub","mul","div","idiv","bitshift","mod","exp","atan"].indexOf(R)!=-1){var Xt=e.pop(),Ht=e.pop(),Mt=Ht.val,At=Xt.val,De=0,Lt="";R=="add"||R=="sub"||R=="mul"?Lt=Ht.typ=="real"||Xt.typ=="real"?"real":"integer":R=="div"||R=="atan"||R=="exp"?Lt="real":(R=="mod"||R=="idiv"||R=="bitshift")&&(Lt="integer"),Ht.typ=="real"&&(c[0]=Mt,Mt=c[0]),Xt.typ=="real"&&(c[0]=At,At=c[0]),R=="add"&&(De=Mt+At),R=="sub"&&(De=Mt-At),R=="mul"&&(De=Mt*At),R=="div"&&(De=Mt/At),R=="idiv"&&(De=~~(Mt/At)),R=="bitshift"&&(De=At>0?Mt<<At:Mt>>>-At),R=="mod"&&(De=Mt%At),R=="exp"&&(De=Math.pow(Mt,At)),R=="atan"&&(De=Math.atan2(Mt,At)*180/Math.PI),Lt=="real"&&(c[0]=De,De=c[0]),e.push({typ:Lt,val:De})}else if(["neg","abs","floor","ceiling","round","truncate","sqrt","ln","sin","cos"].indexOf(R)!=-1){var Ht=e.pop(),Mt=Ht.val,De=0,Lt="";if(R=="neg"||R=="abs"||R=="truncate"||R=="floor"||R=="ceiling"||R=="round"?Lt=Ht.typ:(R=="sqrt"||R=="sin"||R=="cos"||R=="ln")&&(Lt="real"),Ht.typ=="real"&&(c[0]=Mt,Mt=c[0]),R=="neg"&&(De=-Mt),R=="abs"&&(De=Math.abs(Mt)),R=="floor"&&(De=Math.floor(Mt)),R=="ceiling"&&(De=Math.ceil(Mt)),R=="round"&&(De=Math.round(Mt)),R=="truncate"&&(De=Math.trunc(Mt)),R=="sqrt"&&(De=Math.sqrt(Mt)),R=="ln"&&(De=Math.log(Mt)),R=="sin"&&(De=Math.sin(Mt*Math.PI/180)),R=="cos"&&(De=Math.cos(Mt*Math.PI/180)),R=="ln"&&Mt<=0)throw"e";Lt=="real"&&(c[0]=De,De=c[0]),e.push({typ:Lt,val:De})}else if(["eq","ge","gt","le","lt","ne"].indexOf(R)!=-1){var Xt=e.pop(),Ht=e.pop(),Pt=Ht.typ,ai=Xt.typ,Mt=Ht.val,At=Xt.val,De=!1;if(R=="eq"||R=="ne"){var Zr=Ht.typ==Xt.typ;if(Zr&&["integer","real","name","null","dict"].indexOf(Pt)!=-1)De=Mt==At;else if(Pt=="real"&&ai=="integer"||ai=="real"&&Pt=="integer")De=Mt==At;else if(!Zr&&(Ht.typ=="null"||Xt.typ=="null"))De=!1;else if(Zr&&Ht.typ=="string")if(Mt.length!=At.length)De=!1;else{De=!0;for(var K=0;K<Mt.length;K++)Mt[K]!=At[K]&&(De=!1)}else throw console.log(R,Ht,Xt,Ht.val==Xt.val),"e";R=="ne"&&(De=!De)}else R=="ge"?De=Mt>=At:R=="gt"?De=Mt>At:R=="le"?De=Mt<=At:R=="lt"&&(De=Mt<At);e.push({typ:"boolean",val:De})}else if(["and","or"].indexOf(R)!=-1){var Yi=e.pop(),oi=e.pop(),At=oi.val,Mr=Yi.val,cr=oi.typ=="integer",De;R=="and"&&(De=cr?At&Mr:At&&Mr),R=="or"&&(De=cr?At|Mr:At||Mr),e.push({typ:cr?"integer":"boolean",val:De})}else if(R=="not"){var ct=e.pop(),xe=ct.val,cr=ct.typ=="integer",De=cr?~xe:!xe;e.push({typ:cr?"integer":"boolean",val:De})}else if(R=="if"){var t=e.pop(),Hr=e.pop().val;Hr&&FromPS.addProc(t,s)}else if(R=="ifelse"){var Ji=e.pop(),qi=e.pop(),Hr=e.pop().val;FromPS.addProc(Hr?qi:Ji,s)}else if(R=="exec"||R=="stopped"){var pe=e.pop();if(R=="stopped"&&FromPS.addProc({typ:"procedure",val:[{typ:"boolean",val:!1}]},s),pe.typ=="procedure")FromPS.addProc(pe,s);else if(pe.typ=="name"||pe.typ=="operator"||pe.typ=="integer"||pe.typ=="real"||pe.typ=="array")FromPS.addProc({typ:"procedure",val:[pe]},s);else throw console.log(pe),"unknown executable type: "+pe.typ}else if(R=="stop"){var hi=s[s.length-1];hi.typ=="procedure"&&hi.off!=0&&s.pop()}else if(R=="dup"){var xe=e.pop();e.push(xe,xe)}else if(R=="exch")e.push(e.pop(),e.pop());else if(R=="copy"){var Be=e.pop();if(Be.typ=="integer"){for(var nr=[],K=0;K<Be.val;K++)nr[Be.val-1-K]=e.pop();for(var K=0;K<Be.val;K++)e.push(nr[K]);for(var K=0;K<Be.val;K++)e.push(nr[K])}else if(Be.typ=="array"){for(var ge=e.pop().val,K=0;K<ge.length;K++)if(Be.val[K]=ge[K],ge[K].val==null)throw console.log(r),"e";e.push(Be)}else if(Be.typ=="dict"){var ge=e.pop().val;for(var xr in ge)Be.val[xr]=ge[xr];e.push(Be)}else throw"e"}else if(R=="roll"){for(var A=e.pop().val,Be=e.pop().val,nr=[],K=0;K<Be;K++)nr.push(e.pop());nr.reverse(),A=(Be+A)%Be;for(var K=0;K<A;K++)nr.unshift(nr.pop());for(var K=0;K<Be;K++)e.push(nr[K])}else if(R=="index"){var Be=e.pop().val;e.push(e[e.length-1-Be])}else if(R=="anchorsearch"){var li=e.pop(),ui=e.pop(),Fr=li.val,ne=ui.val,br=!0;if(Fr.length<=ne.length)for(var K=0;K<Fr.length;K++)Fr[K]!=ne[K]&&(br=!1);else br=!1;br?e.push({typ:"string",val:ne.slice(Fr.length)},li):e.push(ui),e.push({typ:"boolean",val:br})}else if(R=="transform"||R=="itransform"||R=="dtransform"||R=="idtransform"){var ge=e.pop(),lt=0,Ft=0;ge.typ=="array"?(ge=FromPS.readArr(ge.val),lt=e.pop().val):(lt=ge.val,ge=f.ctm.slice(0)),(R=="itransform"||R=="idtransform")&&UDOC.M.invert(ge),Ft=e.pop().val,R.endsWith("dtransform")&&(ge[4]=0,ge[5]=0);var yr=UDOC.M.multPoint(ge,[Ft,lt]);e.push({typ:"real",val:yr[0]},{typ:"real",val:yr[1]})}else if(R=="pop"||R=="srand"||R=="==")e.pop();else if(R=="rand")e.push({typ:"integer",val:Math.floor(Math.random()*2147483647)});else if(R=="put"){var w=e.pop(),q=e.pop(),pe=e.pop(),Lt=pe.typ;if(Lt=="array"){if(q.typ!="integer")throw"e";pe.val[q.val]=w}else if(Lt=="dict"){var oe=FromPS.getDKey(q);pe.val[oe]=w}else if(Lt=="string")pe.val[q.val]=w.val;else throw Lt+" e"}else if(R=="get"){var q=e.pop(),pe=e.pop(),Lt=pe.typ;if(Lt=="string")e.push({typ:"integer",val:pe.val[q.val]});else if(Lt=="array"){var re=pe.val[q.val];if(re==null)throw"e";e.push(re)}else if(Lt=="dict"){var vt=FromPS.getDKey(q),xe=pe.val[vt];if(xe==null)throw"e";e.push(xe)}else throw"getting from unknown type "+pe.typ}else if(R=="load"){var me=e.pop().val.slice(1),w=FromPS.getFromStacks(me,r);if(w==null)throw console.log(me,r),"e";e.push(w)}else if(R=="where"){var me=e.pop().val.slice(1),$=FromPS.where(me,r);$!=null&&e.push({typ:"dict",val:$,maxl:1e3}),e.push({typ:"boolean",val:$!=null})}else if(R=="store"){var w=e.pop(),me=e.pop().val.slice(1),$=FromPS.where(me,r);$==null&&($=r[r.length-1]),$[me]=w}else if(R=="repeat"){var t=e.pop(),fi=e.pop().val;s.push({typ:"name",val:R+"---",ctx:{proc:t,cur:0,cnt:fi}})}else if(R=="repeat---"){var Tt=g.ctx;Tt.cur<Tt.cnt&&(s.push(g),FromPS.addProc(Tt.proc,s),Tt.cur++)}else if(R=="for"){var t=e.pop(),ci=e.pop(),Vr=e.pop(),Wr=e.pop();s.push({typ:"name",val:R+"---",ctx:{proc:t,isInt:Wr.typ=="integer"&&Vr.typ=="integer",init:Wr.val,inc:Vr.val,limit:ci.val}})}else if(R=="for---"){var Tt=g.ctx;if(Tt.isInt)(Tt.inc>0&&Tt.init<=Tt.limit||Tt.inc<0&&Tt.init>=Tt.limit)&&(s.push(g),FromPS.addProc(Tt.proc,s),e.push({typ:"integer",val:Tt.init}),Tt.init+=Tt.inc);else{var jt=new Float32Array(1);jt[0]=Tt.limit,Tt.limit=jt[0],jt[0]=Tt.inc,Tt.inc=jt[0],jt[0]=Tt.init,(Tt.inc>0&&jt[0]<=Tt.limit||Tt.inc<0&&jt[0]>=Tt.limit)&&(s.push(g),FromPS.addProc(Tt.proc,s),e.push({typ:"real",val:jt[0]}),jt[0]+=Tt.inc,Tt.init=jt[0])}}else if(R=="loop"){var t=e.pop();s.push({typ:"name",val:R+"---",ctx:{proc:t}})}else if(R=="loop---"){var Tt=g.ctx;s.push(g),FromPS.addProc(Tt.proc,s)}else if(R=="pathforall")var vi=e.pop(),wr=e.pop(),Er=e.pop(),bn=e.pop();else if(R=="forall"){var t=e.pop(),pe=e.pop(),Tt=[t,pe,0];s.push({typ:"name",val:R+"---",ctx:Tt})}else if(R=="forall---"){var Tt=g.ctx,t=Tt[0],pe=Tt[1],K=Tt[2];if(pe.typ=="dict"){var Xr=Object.keys(pe.val);if(K<Xr.length){s.push(g),FromPS.addProc(t,s),e.push({typ:"name",val:"/"+Xr[K]});var re=pe.val[Xr[K]];if(re==null)throw"e";e.push(re==null?{typ:"null",val:null}:re),Tt[2]++}}else if(pe.typ=="procedure"||pe.typ=="array"){if(K<pe.val.length){s.push(g),FromPS.addProc(t,s);var di=pe.val[K];e.push(di==null?{typ:"null",val:null}:di),Tt[2]++}}else throw console.log(t,pe),"forall: unknown type: "+pe.typ}else if(R=="exit"){for(var K=s.length-1;K!=0&&(s[K].typ!="name"||!s[K].val.endsWith("---"));)K--;if(K!=0)for(;s.length>K;)s.pop()}else if(R!="bind"){if(R=="xcheck"){var pe=e.pop(),y=pe.typ;e.push({typ:"boolean",val:y=="procedure"})}else if(R=="status"){var ne=e.pop();e.push({typ:"boolean",val:!1})}else if(R=="cachestatus")for(var K=0;K<7;K++)e.push({typ:"integer",val:5e3});else if(R=="setcachelimit")e.pop();else if(R=="type"){var q=e.pop(),pi={name:"nametype",dict:"dicttype",boolean:"booleantype",procedure:"operatortype",string:"stringtype",null:"nulltype",integer:"integertype",array:"arraytype",operator:"operatortype",real:"realtype"};if(pi[q.typ]==null)throw console.log(q),q.typ;e.push({typ:"name",val:"/"+pi[q.typ]})}else if(R=="save")e.push({typ:"state",val:JSON.parse(JSON.stringify(f))});else if(R=="restore")f=a.gst=e.pop().val;else if(R=="clipsave")f.cpstack.push(JSON.parse(JSON.stringify(f.cpth)));else if(R=="cliprestore")f.cpath=f.cpstack.pop();else if(R=="gsave")o.push(JSON.parse(JSON.stringify(f)));else if(R=="grestore")o.length!=0?f=a.gst=o.pop():f=UDOC.getState();else if(R=="grestoreall")for(;o.length!=0;)f=a.gst=o.pop();else if(R=="usertime"||R=="realtime")e.push({typ:"integer",val:R=="usertime"?Date.now()-p:Date.now()});else if(!(R=="flush"||R=="readonly"||R=="executeonly")){if(R=="flushfile")FromPS.GetFile(e.pop());else if(R=="filter"){var Yr=e.pop().val,Jr;if(Yr=="/SubFileDecode"){var ne=e.pop();if(ne.typ!="string")throw"e";var Ne=e.pop().val;ne=ne.val,Jr=[Yr,ne,Ne]}else Jr=[Yr];var Ki=e.pop();e.push({typ:"file",val:{buff:new Uint8Array,off:0},_flt:Jr,_src:Ki})}else if(!(R=="begincmap"||R=="endcmap"))if(R=="begincodespacerange"||R=="beginbfrange"||R=="beginbfchar")a.cmnum=e.pop().val;else if(R=="endcodespacerange"||R=="endbfrange"||R=="endbfchar"){var vi=R=="endbfrange"?3:2,kr=R.slice(3),$=r[r.length-1],C=0;$[kr]==null&&($[kr]=[]);for(var K=0;K<a.cmnum;K++){for(var gi=[],A=vi-1;A>=0;A--){var qr=e.pop(),Ar=qr.val,re;if(qr.typ=="string")re=FromPS.strToInt(Ar),A==0&&(C=Ar.length);else{re=[];for(var vt=0;vt<Ar.length;vt++)re.push(FromPS.strToInt(Ar[vt].val))}gi[A]=re}$[kr]=$[kr].concat(gi)}R!="endcodespacerange"&&($.bpc=C)}else if(l)l(R,e,r,s,o,a,u);else throw console.log(w,R),console.log(r,e),"e"}}}}else throw pe.typ}}return!0},FromPS.strToInt=function(e){for(var r=0,s=0;s<e.length;s++)r=r<<8|e[s];return r},FromPS.getDKey=function(e){return e.typ=="name"?e.val.slice(1):e.typ=="string"?FromPS.readStr(e.val):e.val},FromPS.GetFile=function(e){if(e._flt==null||e.val.off<e.val.buff.length)return e;FromPS.GetFile(e._src);var r=e._src.val,s=e._flt,o=s[0],a;if(o=="/ASCII85Decode")a=FromPS.F.ASCII85Decode(r);else if(o=="/RunLengthDecode")a=FromPS.F.RunLengthDecode(r);else if(o=="/FlateDecode")a=FromPS.F.FlateDecode(r);else if(o=="/LZWDecode")a=FromPS.F.LZWDecode(r);else if(o=="/SubFileDecode"){for(var u=s[1],l=s[2],v=r.off,p=0;v<r.buff.length;){for(var c=0;c<u.length&&r.buff[v+c]==u[c];)c++;if(c==u.length){if(p==l)break;p++}v++}a=r.buff.slice(r.off,v),r.off=v}else throw o;return e.val={buff:a,off:0},e},FromPS.checkPageStarted=function(e,r){e.pgOpen||(r.StartPage(e.bb[0],e.bb[1],e.bb[2],e.bb[3]),e.pgOpen=!0)},FromPS.getPSShadingFill=function(e,r){function s(a){var u,l=a.typ,v=a.val;if(l=="dict"){u={};for(var p in v)u["/"+p]=s(v[p])}else if(l=="array"){u=[];for(var c=0;c<v.length;c++)u.push(s(v[c]))}else if(l=="string"){u="";for(var c=0;c<v.length;c++)u+=String.fromCharCode(v[c])}else if(["boolean","integer","real","name"].indexOf(l)!=-1)u=v;else if(l=="procedure"){for(var _="",c=0;c<v.length;c++)_+=v[c].val+" ";_="{ "+_+"}";for(var f=new Uint8Array(_.length),c=0;c<_.length;c++)f[c]=_.charCodeAt(c);u={"/FunctionType":4,"/Domain":[0,1],"/Range":[0,1,0,1,0,1,0,1],"/Length":_.length,stream:f}}else throw console.log(a),"e";return u}var o=s(e);return FromPS.getShadingFill(o,r)},FromPS.F={HexDecode:function(e){var r=[];return FromPS.readHex(e,1e9,r),new Uint8Array(r)},ASCII85Decode:function(e){for(var r=[85*85*85*85,85*85*85,85*85,85,1],s=[],o=0,a=0,u=e.off;;){if(u>=e.buff.length)throw"e";var l=e.buff[u];if(u++,!FromPS.isWhite(l)){if(l==126){if(o!=0){o==3&&s.push(a>>>24&255),o==4&&s.push(a>>>24&255,a>>>16&255);var v=5-o<<3,p=a>>>v&255;a=a&(1<<v)-1,a!=0&&p++,s.push(p)}return e.off=u+1,new Uint8Array(s)}if(l==122){s.push(0,0,0,0);continue}if(l<33||84+33<l)throw console.log(l,String.fromCharCode(l),u-e.off),"e";a+=(l-33)*r[o],o++,o==5&&(s.push(a>>>24&255),s.push(a>>>16&255),s.push(a>>>8&255),s.push(a>>>0&255),o=0,a=0)}}},RunLengthDecode:function(e){for(var r=[],s=e.off;;){if(s>=e.buff.length)throw console.log(r),"e";var o=e.buff[s];if(s++,o==128)return e.off=s,new Uint8Array(r);if(o<128){for(var a=0;a<o+1;a++)r.push(e.buff[s+a]);s+=o+1}else{for(var a=0;a<257-o;a++)r.push(e.buff[s]);s++}}},FlateDecode:function(e){var r=e.buff,s=new Uint8Array(r.buffer,e.off+2,r.length-2),o=pako.inflateRaw(s);return o},LZWDecode:function(e){var r=new Uint8Array((e.buff.length-e.off)*20),s=UTIF.decode._decodeLZW(e.buff,e.off,r,0);return r.slice(0,s)},_myLZW:function(){var e={},r=function(o,a,u,l,v){for(var p=0;p<v;p+=4)u[l+p]=o[a+p],u[l+p+1]=o[a+p+1],u[l+p+2]=o[a+p+2],u[l+p+3]=o[a+p+3]},s=function(o,a,u,l){if(!e.c){for(var v=new Uint32Array(65535),p=new Uint16Array(65535),g=new Uint8Array(2e6),c=0;c<256;c++)g[c<<2]=c,v[c]=c<<2,p[c]=1;e.c=[v,p,g]}for(var _=e.c[0],f=e.c[1],g=e.c[2],y=258,w=258<<2,M=9,T=a<<3,B=256,H=257,J=0,Q=0,q=0;J=o[T>>>3]<<16|o[T+8>>>3]<<8|o[T+16>>>3],Q=J>>24-(T&7)-M&(1<<M)-1,T+=M,Q!=H;){if(Q==B){if(M=9,y=258,w=258<<2,J=o[T>>>3]<<16|o[T+8>>>3]<<8|o[T+16>>>3],Q=J>>24-(T&7)-M&(1<<M)-1,T+=M,Q==H)break;u[l]=Q,l++}else if(Q<y){var O=_[Q],K=f[Q];if(r(g,O,u,l,K),l+=K,q>=y)_[y]=w,g[_[y]]=O[0],f[y]=1,w=w+1+3&~3,y++;else{_[y]=w;var pe=_[q],R=f[q];r(g,pe,g,w,R),g[w+R]=g[O],R++,f[y]=R,y++,w=w+R+3&~3}y+1==1<<M&&M++}else{if(q>=y)_[y]=w,f[y]=0,y++;else{_[y]=w;var pe=_[q],R=f[q];r(g,pe,g,w,R),g[w+R]=g[w],R++,f[y]=R,y++,r(g,w,u,l,R),l+=R,w=w+R+3&~3}y+1==1<<M&&M++}q=Q}return l};return s}()},FromPS.B={readUshort:function(e,r){return e[r]<<8|e[r+1]},readUint:function(e,r){return e[r]*(256*256*256)+(e[r+1]<<16|e[r+2]<<8|e[r+3])},readASCII:function(e,r,s){for(var o="",a=0;a<s;a++)o+=String.fromCharCode(e[r+a]);return o}},FromPS.nrm=function(e){return Math.max(0,Math.min(1,e))},FromPS.makeArr=function(e,r){for(var s=[],o=0;o<e.length;o++)s.push({typ:r,val:e[o]});return s},FromPS.readArr=function(e){for(var r=[],s=0;s<e.length;s++)r.push(e[s].val);return r},FromPS.makeStr=function(e){for(var r=[],s=0;s<e.length;s++)r.push(e.charCodeAt(s));return r},FromPS.readStr=function(e){for(var r="",s=0;s<e.length;s++)r+=String.fromCharCode(e[s]);return r},FromPS.getFromStacks=function(e,r){for(var s=r.length-1;s>=0;){if(r[s][e]!=null)return r[s][e];s--}return null},FromPS.where=function(e,r){for(var s=r.length-1;s>=0;){if(r[s][e]!=null)return r[s];s--}return null},FromPS.skipWhite=function(e){for(var r=e.off,s=e.buff,o=FromPS.isWhite;o(s[r])||s[r]==37;){for(;o(s[r]);)r++;if(s[r]==37){for(;r<s.length&&!FromPS.isEOL(s[r]);)r++;r++}}e.off=r},FromPS.getToken=function(e,r){if(e.length==0)return null;var s=e[e.length-1];if(s.typ=="procedure"){var o=s.val[s.off];return s.off++,s.off==s.val.length&&e.pop(),o}if(s.typ=="name")return e.pop(),s;for(var a=FromPS.getFToken(s.val,r);a==null&&e.length>1;)e.pop(),e.length!=0&&(a=FromPS.getFToken(e[e.length-1].val,r));return a},FromPS.getFToken=function(e,r){FromPS.skipWhite(e);var s=FromPS.isWhite,o=FromPS.isSpecl,a=e.off,u=e.buff,l=null;if(a>=u.length)return null;var v=u[a],p=String.fromCharCode(v);if(a++,p=="("){for(var c=0,_=a;!(u[_]==41&&c==0);)u[_]==40&&c++,u[_]==41&&c--,u[_]==92&&_++,_++;for(var f=[],g=0;g<_-a;g++)f.push(u[a+g]);a=_+1,f=FromPS.getString(f),l={typ:"string",val:f}}else if(p=="{"||p=="}"||p=="["||p=="]")l={typ:"name",val:p};else if(p=="<"&&u[a]==60||p==">"&&u[a]==62)l={typ:"name",val:p=="<"?"<<":">>"},a++;else if(p=="<"){var f;if(u[a]=="~".charCodeAt(0)){e.off=a+1;var y=FromPS.F.ASCII85Decode(e);f=[];for(var g=0;g<y.length;g++)f.push(y[g]);a=e.off}else{for(var _=a;u[_]!=62;)_++;var f=[];FromPS.readHex({buff:u,off:a},1e9,f),a=_+1}l={typ:"string",val:f}}else{for(var _=a;_<u.length&&!s(u[_])&&(!o(u[_])||u[_]==47&&u[_-1]==47&&_==a&&r);)_++;var w=FromPS.B.readASCII(u,a-1,_-a+1);a=_;var M=parseFloat(w);if(w=="true"||w=="false")l={typ:"boolean",val:w=="true"};else if(isNaN(M))if(w.slice(0,2)=="//"&&r){var B=w.slice(2),H=FromPS.getFromStacks(B,r);H!=null?l=H:l={typ:"name",val:w}}else l={typ:"name",val:w};else{var T=new Float32Array(1);T[0]=M,M=T[0],l={typ:w.indexOf(".")==-1?"integer":"real",val:M}}}return e.off=a,l},FromPS.isSpecl=function(e){return[40,41,60,62,91,93,123,125,37,47].indexOf(e)!=-1},FromPS.isWhite=function(e){return e==0||e==9||e==10||e==12||e==13||e==32},FromPS.isEOL=function(e){return e==10||e==13},FromPS.getString=function(e){for(var r=[],s=["n","r","t","b","f","\\","(",")"," ","/"],o=[`
|
|
`,"\r"," ","\b","\f","\\","(",")"," ","/"],a=0;a<e.length;a++){var u=e[a],l=String.fromCharCode(u);if(l=="\\"){var v=String.fromCharCode(e[a+1]);if(a++,v=="\r"||v==`
|
|
`)continue;var p=s.indexOf(v);if(p!=-1)r.push(o[p].charCodeAt(0));else{var c=v+String.fromCharCode(e[a+1])+String.fromCharCode(e[a+2]);a+=2,r.push(parseInt(c,8))}}else r.push(u)}return r},FromPS.makeString=function(e){for(var r=["n","r","t","b","f","\\","(",")"],s=[`
|
|
`,"\r"," ","\b","\f","\\","(",")"],o=[],a=0;a<e.length;a++){var u=e[a],l=s.indexOf(String.fromCharCode(u));l==-1?o.push(u):o.push(92,r[l].charCodeAt(0))}return o},FromPS.readHex=function(e,r,s){for(var o=0,a=-1,u=e.off;o!=r;){var l=e.buff[u];u++;var v=0;if(47<l&&l<58)v=l-48;else if(96<l&&l<103)v=10+l-97;else if(64<l&&l<71)v=10+l-65;else{if(l==62)break;if(FromPS.isWhite(l))continue;throw"e"}a==-1?a=v:(s[o]=a<<4|v,a=-1,o++)}e.off=u},FromPS.getShadingFill=function(e,r){var s=e["/ShadingType"],o=e["/ColorSpace"],a=e["/Extend"],u=e["/Coords"]?e["/Coords"].slice(0):null;a==null&&(a=[!1,!1]);var l="";if(s==2)l="lin";else if(s==3)l="rad";else{console.log("Unknown shading type",s);return}var v=e["/Function"],p;if(v instanceof Array){for(var c=v.length,_,f=0;f<c;f++){var g=FromPS.getGrad(v[f],"/DeviceGray");if(f==0)_=g;else for(var y=_.length,w=0;w<y;w++)_[w][1][f]=g[w][1][0]}if(o=="/DeviceCMYK")for(var f=0;f<_.length;f++)_[f][1]=UDOC.C.cmykToRgb(_[f][1]);p=_}else p=FromPS.getGrad(v,o);if(l=="rad"&&u[2]>u[5]){u=u.slice(3).concat(u.slice(0,3)),a.reverse(),p.reverse();for(var f=0;f<p.length;f++)p[f][0]=1-p[f][0]}if(!a[0]&&l!="rad"){var M=p[0];M[0]+=.002,p.unshift([.001,M[1].slice(),0])}if(!a[1]){var M=p[p.length-1];M[0]-=.002,p.push([0,999,M[1].slice(),0])}var T={typ:l,mat:r,grad:p,crds:u};return T},FromPS.getGrad=function(e,r){var s=FromPS._normColor,o=e["/Functions"],a=e["/FunctionType"],u=e["/Bounds"],l=e["/Encode"],v;if(a==0){v=[],n=Math.min(4,e["/Size"][0]);for(var p=0;p<=n;p++)v.push([p/n,s(e,[p/n],r)])}else if(a==2)v=[[0,s(e,[0],r)],[1,s(e,[1],r)]];else if(a==3){var c=0;v=[],(u.length==0||u[0]>0)&&v.push([0,s(o[0],[c],r)]);for(var p=0;p<u.length;p++)v.push([u[p],s(o[p],[1-c],r)]);(u.length==0||u[u.length-1]<1)&&v.push([1,s(o[o.length-1],[1-c],r)])}else if(a==4){v=[];for(var p=0;p<5;p++)v.push([p/5,s(e,[p/5],r)])}return v},FromPS._normColor=function(e,r,s){var o="/DeviceCMYK",a="/DeviceRGB",u,l=FromPS.Func(e,r);if(s[3]&&s[3]["/Length"])if(l=FromPS.Func(s[3],l),s[2]==o||l.length==4)u=o;else if(s[2]==a)u=a;else if(s[2]&&s[2][1]&&s[2][1]["/Alternate"]&&s[2][1]["/Alternate"][0]=="/Lab")u="/Lab";else throw console.log(l,s),"unknown color profile";else if(s[0]=="/ICCBased"&&s[1]){var v=s[1]["/N"];if(v==4)u=o;else if(v==3)u=a;else throw v}else s[0]=="/Separation"?(l=FromPS._readSeparation(s,l[0]),u=a):s.length==1?u=s[0]:s[2]==o?u=o:u=s;if(u==a)l=l;else if(u==o)l=UDOC.C.cmykToRgb(l);else if(u=="/DeviceGray")l=[l[0],l[0],l[0]];else if(u=="/Lab")l=UDOC.C.labToRgb(l);else throw"Unknown color space "+u;return l},FromPS._readSeparation=function(e,r){var s=FromPS.Func(e[3],[r]),o;return e&&e[2]=="/DeviceCMYK"?o=UDOC.C.cmykToRgb(s):e&&e[2]=="/DeviceGray"?o=[s[0],s[0],s[0]]:o=UDOC.C.labToRgb(s),o},FromPS.Func=function(e,r){for(var s=FromPS.intp,o=e["/Domain"],a=e["/Range"],u=e["/FunctionType"],l=[],v=0;v<r.length;v++)r[v]=Math.max(o[2*v],Math.min(o[2*v+1],r[v]));if(u==0){var p=e["/Encode"],c=e["/Size"],_=e["/Decode"],f=a.length/2;p==null&&(p=[0,c[0]-1]),_==null&&(_=a);for(var v=0;v<r.length;v++){var g=s(r[v],o[2*v],o[2*v+1],p[2*v],p[2*v+1]);r[v]=Math.max(0,Math.min(c[v]-1,g))}for(var y=e["/DataSource"],w=0;w<f;w++){var M=Math.round(r[0]),T;y?T=y.charCodeAt(f*M+w):T=FromPS.GS(e)[f*M+w],T=s(T,0,255,_[2*w],_[2*w+1]),l.push(T)}}else if(u==2)for(var B=e["/C0"],H=e["/C1"],J=e["/N"],M=r[0],v=0;v<B.length;v++)l[v]=B[v]+Math.pow(M,J)*(H[v]-B[v]);else if(u==4){var Q=FromPS._getEnv([0,0,0,0]);Q.pgOpen=!0;var q=[],O=[],y=FromPS._getDictStack([],{}),K=[];K.push({typ:"file",val:{buff:FromPS.GS(e),off:0}});for(var pe=!0;pe;)pe=FromPS.step(O,y,K,q,Q,{},FromPS.operator);var R=O.pop();R.off=0,K.push(R);for(var v=0;v<r.length;v++)O.push({typ:"real",val:r[v]});for(pe=!0;pe;)pe=FromPS.step(O,y,K,q,Q,{},FromPS.operator);for(var v=0;v<O.length;v++)l.push(O[v].val)}if(a)for(var v=0;v<l.length;v++)l[v]=Math.max(a[2*v],Math.min(a[2*v+1],l[v]));return l},FromPS.intp=function(e,r,s,o,a){return o+(e-r)*(a-o)/(s-r)},FromPS.GS=function(e){if(e.stream==null){var r=e.buff;delete e.buff;var s=e["/Filter"],o=e["/DecodeParms"];if(s!=null){for(var a=typeof s=="string"?[s]:s,u=!1,l=0;l<a.length;l++){var v=a[l],p={buff:r,off:0};if(v=="/FlateDecode")r=FromPS.F.FlateDecode(p);else if(v=="/RunLengthDecode")r=FromPS.F.RunLengthDecode(p);else if(v=="/LZWDecode")r=FromPS.F.LZWDecode(p);else if(v=="/ASCIIHexDecode")r=FromPS.F.HexDecode(p);else if(v=="/ASCII85Decode"||v=="/A85")r=FromPS.F.ASCII85Decode(p);else if(v=="/DCTDecode"||v=="/CCITTFaxDecode"||v=="/JPXDecode"||v=="/JBIG2Decode")u=!0;else throw console.log(v,r),"e"}u||delete e["/Filter"]}if(o!=null&&(o instanceof Array&&(o=o[0]),o["/Predictor"]!=null&&o["/Predictor"]!=1)){var c=o["/Columns"],_=o["/Colors"]?o["/Colors"]:1,f=_*c,g=r.length/(f+1);FromPS._filterZero(r,0,c,g,_),r=r.slice(0,g*f)}e.stream=r}return e.stream},FromPS._filterZero=function(e,r,s,o,a){for(var u=a*s,l=FromPS._paeth,v=0;v<o;v++){var p=r+v*u,c=p+v+1,_=e[c-1];if(_==0)for(var f=0;f<u;f++)e[p+f]=e[c+f];else if(_==1){for(var f=0;f<a;f++)e[p+f]=e[c+f];for(var f=a;f<u;f++)e[p+f]=e[c+f]+e[p+f-a]&255}else if(v==0){for(var f=0;f<a;f++)e[p+f]=e[c+f];if(_==2)for(var f=a;f<u;f++)e[p+f]=e[c+f]&255;if(_==3)for(var f=a;f<u;f++)e[p+f]=e[c+f]+(e[p+f-a]>>1)&255;if(_==4)for(var f=a;f<u;f++)e[p+f]=e[c+f]+l(e[p+f-a],0,0)&255}else{if(_==2)for(var f=0;f<u;f++)e[p+f]=e[c+f]+e[p+f-u]&255;if(_==3){for(var f=0;f<a;f++)e[p+f]=e[c+f]+(e[p+f-u]>>1)&255;for(var f=a;f<u;f++)e[p+f]=e[c+f]+(e[p+f-u]+e[p+f-a]>>1)&255}if(_==4){for(var f=0;f<a;f++)e[p+f]=e[c+f]+l(0,e[p+f-u],0)&255;for(var f=a;f<u;f++)e[p+f]=e[c+f]+l(e[p+f-a],e[p+f-u],e[p+f-a-u])&255}}}return e},FromPS._paeth=function(e,r,s){var o=e+r-s,a=Math.abs(o-e),u=Math.abs(o-r),l=Math.abs(o-s);return a<=u&&a<=l?e:u<=l?r:s};function FromPDF(){}FromPDF.Parse=function(e,r){e=new Uint8Array(e);for(var s=0;e[s]==32;)s++;s!=0&&(e=new Uint8Array(e.buffer,s,e.length-s));for(var o=e.length-3;FromPS.B.readASCII(e,o,3)!="%%E";)o--;for(;e[o-1]==37;)o--;var a=o;for(o--;FromPS.isEOL(e[o]);)o--;for(;!FromPS.isEOL(e[o]);)o--;var u=parseInt(FromPS.B.readASCII(e,o+1,a-o-1));if(isNaN(u))throw"no xref";for(var l=[],v=FromPDF.readXrefTrail(e,u,l),p=-1,c=0;c<l.length;c++)l[c]==null&&(p=c);if(v==null||p!=-1){for(console.log("PDF is broken, trying to rebuild");l.length!=0;)l.pop();v=FromPDF.brokenXrefTrail(e,l)}if(v["/Encrypt"]){alert("Encrypted PDFs are not supported yet.");return}var _={buff:e,off:0},f=v["/Root"];f.typ=="ref"&&(v["/Root"]=FromPDF.getIndirect(f.ind,f.gen,_,l));var g=v["/Root"]["/Pages"];g.typ=="ref"&&(v["/Root"]["/Pages"]=FromPDF.getIndirect(g.ind,g.gen,_,l));for(var y=[v["/Root"]["/Pages"]];y.length!=0;){var w=y.pop();if(w["/Type"]=="/Pages")for(var M=w["/Kids"],c=0;c<M.length;c++)M[c].typ=="ref"&&(M[c]=FromPDF.getIndirect(M[c].ind,M[c].gen,_,l)),FromPDF.solveIndirects(M[c]["/Resources"],_,l),y.push(M[c])}var T=Date.now();FromPDF.render(v["/Root"],r,v),r.Done()},FromPDF.solveIndirects=function(e,r,s){if(typeof e=="object")for(var o in e)o.startsWith("/")&&(e[o]&&e[o].typ=="ref"&&s[e[o].ind]&&(e[o]=FromPDF.getIndirect(e[o].ind,e[o].gen,r,s)),FromPDF.solveIndirects(e[o],r,s))},FromPDF.render=function(e,r,s){var o=["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"],a={J:"setlinecap",j:"setlinejoin",w:"setlinewidth",d:"setdash",M:"setmiterlimit",i:"setflat",q:"gsave",Q:"grestore",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"};a=FromPS.makeProcs(a);for(var u=[e["/Pages"]],l=-1,v=[-1e9,1e9];u.length!=0;){var p=u.pop();if(p["/Type"]=="/Pages"){for(var c=p["/Kids"],_=c.length-1;_>=0;_--)u.push(c[_]);continue}if(l++,!(l<v[0])){p["/Resources"]==null&&(p["/Resources"]=e["/Pages"]["/Resources"]);var f=p["/Contents"];if(f!=null){f.length==null&&(f=[f]);var g=p["/Rotate"]!=null&&(p["/Rotate"]+36e3)%360==90,y=p["/MediaBox"];y==null&&(y=e["/Pages"]["/MediaBox"]),g&&(y=[y[0],y[1],y[3],y[2]]);var w=FromPS._getEnv(y);w.pgOpen=!0;var M=[],T=[],B=FromPS._getDictStack(o,a),H=[];if(g&&(UDOC.M.rotate(w.gst.ctm,Math.PI/2),UDOC.M.translate(w.gst.ctm,0,y[3])),r.StartPage(y[0],y[1],y[2],y[3]),s["/Encrypt"])u.length==0&&alert("Encrypted PDF is not supported yet.");else for(var J=0;J<f.length;J++)if(f[J].buff!=null){for(var Q=FromPS.GS(f[J]),q=Q.length-1;Q[q]==0;)q--;Q=new Uint8Array(Q.buffer,0,q+1),H.push({typ:"file",val:{buff:Q,off:0,extra:p,clgrp:!1}});for(var O=!0;O;)O=FromPS.step(T,B,H,M,w,r,FromPDF.operator)}if(r.ShowPage(),l>=v[1])break}}}},FromPDF.addCmd=function(e,r,s){for(var o=e.length,a=new Uint8Array(o),u=0;u<o;u++)a[u]=e.charCodeAt(u);r.push({typ:"file",val:{buff:a,off:0,extra:s}})},FromPDF._pushForm=function(e,r,s,o){var a=r["/Matrix"];if(o&&FromPDF.addCmd("Q",e,r),a){var u=a.slice(0);UDOC.M.invert(u),FromPDF.addCmd(u.join(" ")+" cm",e,r)}e.push({typ:"file",val:{buff:FromPS.GS(r),off:0,extra:r,clgrp:s}}),a&&FromPDF.addCmd(a.join(" ")+" cm",e,r),o&&FromPDF.addCmd("q",e,r)},FromPDF.operator=function(e,r,s,o,a,u,l){for(var v=u.gst,p=o.length-1;o[p].typ!="file";)p--;var c=o[p].val,_=c.extra["/Resources"];if(e=="Do"){var f=r.pop().val,g=_["/XObject"][f],y=g["/Subtype"];if(y=="/Form"){var w=g["/Group"],M=!1;w!=null&&(M=!0),g["/Resources"]==null&&(g["/Resources"]=_),FromPDF._pushForm(o,g,M)}else if(y=="/Image"){var T=g["/Width"],B=g["/Height"],H=g["/ColorSpace"],J=g["/SMask"],Q=FromPDF.getImage(g),q=FromPDF.getJBIG2Glob(g),O,K;if(J){var pe=J["/Width"],R=J["/Height"];if(pe!=T||R!=B){var Te=new Uint32Array(pe*R),re=new Uint32Array(Q.buffer.slice(0,4));Te.fill(re[0]),T=pe,B=R,Q=new Uint8Array(Te.buffer)}O=FromPDF.getImage(g["/SMask"]),K=FromPDF.getJBIG2Glob(g["/SMask"])}if(g["/ImageMask"]==!0){O=Q,K=q,Q=new Uint8Array(T*B*4),q=null;for(var oe=v.colr[0]*255,me=v.colr[1]*255,ue=v.colr[2]*255,$=0;$<T*B*4;$+=4)Q[$]=oe,Q[$+1]=me,Q[$+2]=ue,Q[$+3]=255}l.PutImage(v,Q,T,B,O,q,K)}else console.log("Unknown XObject",y)}else if(e=="gs"){var ee=r.pop().val,ne=_["/ExtGState"][ee];for(var _e in ne){var ae=ne[_e];_e!="/Type"&&(_e=="/CA"?v.CA=c.clgrp?v.CA*ae:ae:_e=="/ca"?v.ca=c.clgrp?v.ca*ae:ae:_e=="/BM"?(!c.clgrp||v.bmode=="/Normal")&&(v.bmode=ae):_e=="/LC"?v.lcap=ae:_e=="/LJ"?v.ljoin=ae:_e=="/LW"?v.lwidth=ae:_e=="/ML"?v.mlimit=ae:_e=="/SA"?v.SA=ae:_e=="/OPM"?v.OPM=ae:_e=="/AIS"?v.AIS=ae:_e=="/OP"?v.OP=ae:_e=="/op"?v.op=ae:_e=="/SMask"?v.SMask="":_e=="/SM"?v.SM=ae:_e=="/HT"||_e=="/TR"||console.log("Unknown gstate property: ",_e,ae))}}else if(e=="ID"){for(var Me={};;){var ae=r.pop().val;if(ae=="/BI")break;Me[r.pop().val]=ae}c.off++;for(var T=Me["/W"],B=Me["/H"],Ne=T*B,Q=new Uint8Array(Ne*4),H=Me["/CS"],Ae=Me["/BPC"],Fe=c.off;!FromPS.isWhite(c.buff[Fe])||c.buff[Fe+1]!=69||c.buff[Fe+2]!=73;)Fe++;var De=c.buff.slice(c.off,Fe);if(c.off+=De.length,Me["/F"]=="/Fl"){var ze={buff:De,"/Filter":"/FlateDecode"};if(Me["/DP"])for(var ye=ze["/DecodeParms"]={},he=["Predictor","Columns","Colors"],$=0;$<3;$++)Me["/DP"][he[$]]&&(ye["/"+he[$]]=Me["/DP"][he[$]].val);De=FromPS.GS(ze),delete Me["/F"],delete Me["/DP"]}if(H=="/G"&&Me["/F"]==null)FromPDF.plteImage(De,0,Q,null,T,B,Ae);else if(H=="/RGB"&&Me["/F"]==null&&De.length==T*B*3)for(var $=0;$<Ne;$++){var ke=$*3,le=$*4;Q[le]=De[ke],Q[le+1]=De[ke+1],Q[le+2]=De[ke+2],Q[le+3]=255}else H&&H[0].typ!=null?FromPDF.plteImage(De,0,Q,H[3].val,T,B,Ae):Q=De;l.PutImage(v,Q,T,B)}else if(!(e=="n"||e=="BT"||e=="EI")){if(e=="ET")v.font.Tm=[1,0,0,1,0,0],v.font.Tlm=v.font.Tm.slice(0);else if(e=="y"||e=="v"){var Ce=v.ctm.slice(0);UDOC.M.invert(Ce);var _e=UDOC.M.multPoint(Ce,v.cpos),Be=r.pop().val,we=r.pop().val,xe=r.pop().val,Ie=r.pop().val;e=="y"?UDOC.G.curveTo(v,Ie,xe,we,Be,we,Be):UDOC.G.curveTo(v,_e[0],_e[1],Ie,xe,we,Be)}else if(e=="B"||e=="B*")l.Fill(v,e=="B*"),l.Stroke(v),UDOC.G.newPath(v);else if(e=="cm"||e=="Tm"){for(var Re=[],$=0;$<6;$++)Re.push(r.pop().val);Re.reverse(),e=="cm"?(UDOC.M.concat(Re,v.ctm),v.ctm=Re):(v.font.Tm=Re,v.font.Tlm=Re.slice(0))}else if(e=="Td"||e=="T*"){var Le=0,Oe=0;e=="T*"?(Le=0,Oe=-v.font.Tl):(Oe=r.pop().val,Le=r.pop().val);var Ve=[1,0,0,1,Le,Oe];UDOC.M.concat(Ve,v.font.Tlm),v.font.Tm=Ve,v.font.Tlm=Ve.slice(0)}else if(e=="Tf"){var Xe=r.pop().val,We=r.pop().val;v.font.Tf=We,v.font.Tfs=Xe}else if(e=="Tj"||e=="TJ"){var t=r.pop();t.typ=="string"?t=[t]:t=t.val;for(var h=v.font.Tf,We=_["/Font"][h],d=v.font.Tfs/1e3,x=function(fe,S){var de=[1,0,0,1,S,0];UDOC.M.concat(de,fe.Tm),fe.Tm=de},$=0;$<t.length;$++){if(t[$].typ!="string"){$==0&&x(v.font,-d*t[$].val);continue}var E=FromPDF.getString(t[$].val,We);if(t[$+1]&&t[$+1].typ!="string"){var C=t[$+1].val;E[1]+=-C,-900<C&&C<-100&&(E[0]+=" ")}v.font.Tf=E[2],l.PutText(v,E[0],E[1]/1e3),v.font.Tf=h,x(v.font,d*E[1])}}else if(e=="Tc")v.font.Tc=r.pop().val;else if(e=="Tw")v.font.Tw=r.pop().val;else if(e=="Tz")v.font.Th=r.pop().val;else if(e=="TL")v.font.Tl=r.pop().val;else if(e=="Tr")v.font.Tmode=r.pop().val;else if(e=="Ts")v.font.Trise=r.pop().val;else if(e=="CS"||e=="cs"){var H=r.pop().val;e=="CS"?v.sspace=H:v.space=H}else if(e=="SCN"||e=="scn"||e=="SC"||e=="sc"){var b=e=="SCN"||e=="SC",U=b?v.sspace:v.space,H,D=null,k=_?_["/ColorSpace"]:null;if(k!=null&&k[U]!=null?k[U][1]&&k[U][1]["/Alternate"]?H=k[U][1]["/Alternate"]:H=typeof k[U]=="string"?k[U]:k[U][0]:H=U,H=="/DeviceN"){for(var Z=k[U],Y=Z[1].length,$=0;$<Y;$++)r.pop();D=[1,0,0]}else if(H=="/Lab"||H=="/DeviceRGB"||H=="/CalRGB"||H=="/ICCBased"&&k[U][1]["/N"]==3)D=[r.pop().val,r.pop().val,r.pop().val],D.reverse();else if(H=="/DeviceCMYK"||H=="/ICCBased"&&k[U][1]["/N"]==4){var W=[r.pop().val,r.pop().val,r.pop().val,r.pop().val];W.reverse(),D=UDOC.C.cmykToRgb(W)}else if(H=="/DeviceGray"||H=="/CalGray"||H=="/ICCBased"&&k[U][1]["/N"]==1){var F=FromPS.nrm(r.pop().val);D=[F,F,F]}else if(H=="/Separation")D=FromPS._readSeparation(k[U],r.pop().val);else if(H=="/Pattern"){var z=_["/Pattern"][r.pop().val],G=z["/PatternType"];if(G==1){console.log("tile pattern"),FromPDF._pushForm(o,z,M,!0);return}var X=z["/Matrix"];X==null&&(X=[1,0,0,1,0,0]),D=FromPS.getShadingFill(z["/Shading"],X),D==null&&(D=[0,0,0])}else throw console.log(U,H,k,_),"e";b?v.COLR=D:v.colr=D}else if(e=="sh"){var A=_["/Shading"][r.pop().val],N=v.colr,I=v.pth;v.pth=v.cpth,v.cpth=UDOC.G.rectToPath(u.bb),v.colr=FromPS.getShadingFill(A,v.ctm.slice(0)),v.colr==null&&(v.colr=[0,0,0]),l.Fill(v),v.colr=N,v.pth=I}else if(e=="MP"||e=="BMC"||e=="ri")r.pop();else if(e=="DP"||e=="BDC")r.pop(),r.pop();else if(!(e=="EMC"||e=="BX"||e=="EX"))throw e}},FromPDF.getJBIG2Glob=function(e){var r=e;return r=r["/DecodeParms"],r==null||(r=r["/JBIG2Globals"],r==null)?null:FromPS.GS(r)},FromPDF.getImage=function(e){var r=e["/Width"],s=e["/Height"],o=r*s,a=FromPS.GS(e),u=e["/Filter"],l=e["/ColorSpace"],v=e["/BitsPerComponent"],p=e["/Matte"],c=e.image;if(c==null){var _=e["/Mask"];if(l&&l[0]=="/Indexed"){var f;if(l[3].length!=null){var g=l[3];f=new Uint8Array(256*3);for(var y=0;y<g.length;y++)f[y]=g.charCodeAt(y)}else f=FromPS.GS(l[3]);if(l[1]=="/DeviceCMYK"||l[1]&&l[1][1]&&l[1][1]["/N"]==4)for(var w=f,f=new Uint8Array(256*3),y=0;y<256;y++){var M=y<<2,T=M-y,B=UDOC.C.cmykToRgb([w[M]/255,w[M+1]/255,w[M+2]/255,w[M+3]/255]);f[T]=B[0]*255,f[T+1]=B[1]*255,f[T+2]=B[2]*255}var H=new Uint8Array(o*4);FromPDF.plteImage(a,0,H,f,r,s,v,_),c=H}else if(u==null&&l&&l=="/DeviceGray"){var f=[0,0,0,255,255,255],H=new Uint8Array(o*4);e["/Decode"]&&e["/Decode"][0]==1&&f.reverse(),e["/ImageMask"]==!0&&f.reverse(),FromPDF.plteImage(a,0,H,v==1?f:null,r,s,v,_),c=H}else if(u==null&&l&&(l=="/DeviceCMYK"||l[0]=="/ICCBased"&&l[1]&&l[1]["/N"]==4)){for(var H=new Uint8Array(o*4),J=[0,0,0,0],y=0;y<o;y++){var M=y*4;J[0]=a[M]*(1/255),J[1]=a[M+1]*(1/255),J[2]=a[M+2]*(1/255),J[3]=a[M+3]*(1/255);var B=UDOC.C.cmykToRgb(J);H[M]=~~(B[0]*255+.5),H[M+1]=~~(B[1]*255+.5),H[M+2]=~~(B[2]*255+.5),H[M+3]=255}c=H}else if(r*s*3<=a.length){for(var Q=Math.round(255/((1<<v)-1)),q=Math.ceil(r*3*v/8),H=new Uint8Array(o*4),O=0;O<s;O++)for(var K=q*O,pe=0;pe<r;pe++){var M=(O*r+pe)*4,R=3*pe;H[M]=FromPDF.getBitNum(a,K,R,v),H[M+1]=FromPDF.getBitNum(a,K,R+1,v),H[M+2]=FromPDF.getBitNum(a,K,R+2,v),H[M+3]=255}c=H}else c=a;if(p&&p.join("")!="000")for(var Te=Math.round(p[0]*255),re=Math.round(p[1]*255),oe=Math.round(p[2]*255),y=0;y<c.length;y+=4)c[y]=Math.max(c[y],Te),c[y+1]=Math.max(c[y+1],re),c[y+2]=Math.max(c[y+2],oe);e.image=c}return c},FromPDF.plteImage=function(e,r,s,o,a,u,l,v){for(var p=Math.round(255/((1<<l)-1)),c=Math.ceil(a*l/8),_=0;_<u;_++)for(var f=r+c*_,g=0;g<a;g++){var y=FromPDF.getBitNum(e,f,g,l),w=_*a+g<<2;if(o){var M=y*3;s[w]=o[M],s[w+1]=o[M+1],s[w+2]=o[M+2]}else{var T=y*p;s[w]=T,s[w+1]=T,s[w+2]=T}s[w+3]=255,v&&v[0]<=y&&y<=v[1]&&(s[w+3]=0)}},FromPDF.getBitNum=function(e,r,s,o){var a=0;return o==8?a=e[r+s]:o==4?a=e[r+(s>>1)]>>(1-(s&1)<<2)&15:o==2?a=e[r+(s>>2)]>>(3-(s&3)<<1)&3:o==1&&(a=e[r+(s>>3)]>>(7-(s&7)<<0)&1),a},FromPDF.getString=function(e,r){var s=r["/Subtype"],o="",a=0,u=null,l=r["/ToUnicode"],v=r["/Encoding"],p=r;if(l!=null&&typeof l!="object"&&(l=null),s=="/Type0"&&(p=r["/DescendantFonts"][0]),l!=null)o=FromPDF.toUnicode(e,l);else if(v=="/WinAnsiEncoding")o=FromPDF.encFromMap(e,FromPDF._win1252);else if(v=="/MacRomanEncoding")o=FromPDF.encFromMap(e,FromPDF._macRoman);else if(s=="/Type0"){var c=0,_=p["/CIDSystemInfo"]["/Ordering"];_=="Identity"?c=0:_=="Japan1"||_=="GB1"||_=="CNS1"||_=="Korea1"?c=31:(console.log("unknown ordering",_),c=0);for(var f=0;f<e.length;f+=2){var g=e[f]<<8|e[f+1];o+=String.fromCharCode(g+c)}}else if(v!=null&&v["/Type"]=="/Encoding"){var y=v["/Differences"],w=v["/BaseEncoding"],M=null;if(w=="/WinAnsiEncoding"&&(M=FromPDF._win1252),w=="/MacRomanEncoding"&&(M=FromPDF._macRoman),y)for(var o="",T=0;T<e.length;T++){for(var B=e[T],H=-5,J=!1,f=0;f<y.length;f++)if(typeof y[f]=="string"){if(B==H){o+=FromPDF.fromCName(y[f].slice(1)),J=!0;break}H++}else H=y[f];if(!J&&M!=null){var Q=M.indexOf(B);Q!=-1&&(B=String.fromCharCode(M[Q+1])),o+=String.fromCharCode(B)}else J||(o+=String.fromCharCode(B))}}else o=FromPS.readStr(e);if(s=="/Type0"){var q=p["/W"];if(q&&q.length==0&&(q=null),q==null)a=o.length*1e3*.4,console.log("approximating word widths");else for(var T=0;T<e.length;T+=2){for(var O=e[T]<<8|e[T+1],K=!1,f=0;f<q.length;f+=2){var pe=q[f],R=q[f+1];R.length?0<=O-pe&&O-pe<R.length&&(a+=R[O-pe],K=!0):(pe<=O&&O<=R&&(a+=q[f+2],K=!0),f++)}K||(a+=q[1][0])}}else if(s=="/Type1"||s=="/Type3"||s=="/TrueType"){var Te=r["/FirstChar"],q=r["/Widths"];if(q)for(var T=0;T<e.length;T++)a+=q[e[T]-Te];else a=o.length*1e3*.4,console.log("approximating word width")}else throw"unknown font type";for(var re=p["/FontDescriptor"],oe,me=["","2","3"],T=0;T<3;T++)re&&re["/FontFile"+me[T]]&&(oe="/FontFile"+me[T]);if(re){if(re.psName)u=re.psName;else if(oe){var ue=FromPS.GS(re[oe]);oe!=null&&ue&&FromPS.B.readUint(ue,0)==65536&&(u=re.psName=FromPDF._psName(ue))}}return u==null&&r["/BaseFont"]&&(u=r["/BaseFont"].slice(1)),(u==null||u=="")&&(u="AlibabaPuHuiTi-Regular"),[o,a,u]},FromPDF._psName=function(e){for(var r=FromPS.B.readUshort,s=r(e,4),o=0,a=0;a<s;a++){var u=FromPS.B.readASCII(e,12+a*16,4),l=FromPS.B.readUint(e,12+a*16+8);if(u=="name"){o=l;break}}if(o==0)return null;for(var v=r(e,o+2),p=o+6,c=o+6,a=0;a<v;a++){var _=r(e,c),f=r(e,c+2),g=r(e,c+4),y=r(e,c+6),w=r(e,c+8),M=r(e,c+10);c+=12;var T,B=p+v*12+M;if(f==1||f==10||f==3){T="";for(var H=1;H<w;H+=2)T+=String.fromCharCode(e[B+H])}if((f==0||f==2)&&(T=FromPS.B.readASCII(e,B,w)),y==6&&T!=null&&T.slice(0,3)!="OTS")return T.replace(/\s/g,"")}return null},FromPDF.encFromMap=function(e,r){for(var s="",o=0;o<e.length;o++){var a=e[o],u=r.indexOf(a);u!=-1&&(a=r[u+1]),s+=String.fromCharCode(a)}return s},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(e){if(e=="f_f_i")return"ffi";if(e.length==1)return e;if(e.slice(0,3)=="uni")return String.fromCharCode(parseInt(e.slice(3),16));var r={space:32,exclam:33,quotedbl:34,numbersign:35,dollar:36,percent:37,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,degree:176,plusminus:177,Eacute:201,Adieresis:196,adieresis:228,Udieresis:220,germandbls:223,udieresis:252,Odieresis:214,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},s=r[e];return s==null?(e.charAt(0)!="g"&&console.log("unknown character "+e),e):String.fromCharCode(s)},FromPDF.toUnicode=function(e,r){var s=r.cmap,o="",a;if(s==null){var u={buff:FromPS.GS(r),off:0},l=[],v=FromPS._getDictStack({}),p=[{typ:"file",val:u}],c=[],_=FromPS._getEnv([0,0,1,1]);_.pgOpen=!0;for(var f=!0;f;)f=FromPS.step(l,v,p,c,_,null,FromPS.operator,!0);s=_.res.CMap.val,r.cmap=s}for(var g in s){s=s[g].val;break}for(var y=s.bfrange,w=s.bfchar,M=s.bpc,T=0;T<e.length;T+=M){var B=e[T];M==2&&(B=B<<8|e[T+1]);var H=!1;if(!H&&y)for(var J=0;J<y.length;J+=3){var Q=y[J],q=y[J+1],O=y[J+2];if(Q<=B&&B<=q){O.length==null?B+=O-Q:B=O[B-Q],H=!0;break}}if(!H&&w){for(var J=0;J<w.length;J+=2)if(w[J]==B){B=w[J+1],H=!0;break}}o+=String.fromCharCode(B)}return o},FromPDF.brokenXrefTrail=function(e,r){function s(g,y){for(var w=y;48<=g[y]&&g[y]<=57;)y++;return FromPS.B.readASCII(g,w,y-w)}for(var o,a=e.length,u=0;u<a;u++)if(FromPS.isEOL(e[u])){for(var l=u;FromPS.isWhite(e[l]);)l++;var v=s(e,l);if(v!=""){for(l+=v.length;FromPS.isWhite(e[l]);)l++;var p=s(e,l);if(p!=""){for(l+=p.length;FromPS.isWhite(e[l]);)l++;if(FromPS.B.readASCII(e,l,3)=="obj"){var c=parseInt(v),_=parseInt(p);r[c]={off:u+1,gen:_,chr:"n"},u=l}}}else if(e[l]==116&&e[l+1]==114&&FromPS.B.readASCII(e,l,7)=="trailer")o==null&&(o=FromPDF._readTrailer(e,l+8,r));else if(e[l]==115&&e[l+1]==116&&FromPS.B.readASCII(e,l,9)=="startxref"){for(l+=10;FromPS.isWhite(e[l]);)l++;var f=parseInt(s(e,l));f!=0&&o==null&&(o=FromPDF.readXrefTrail(e,f,r))}}return o},FromPDF._readTrailer=function(e,r,s){var o={buff:e,off:r},a=FromPDF.readObject(o,o,s);return a["/Prev"]&&FromPDF.readXrefTrail(e,a["/Prev"],s),a},FromPDF.readXrefTrail=function(e,r,s){var o=FromPS.B.readASCII(e,r,4);if(o=="xref"){var a=r+4;for(e[a]==13&&a++,e[a]==10&&a++;;){if(FromPS.B.readASCII(e,a,7)=="trailer"){a+=7,e[a]==13&&a++,e[a]==10&&a++;break}for(var u=a;!FromPS.isEOL(e[a]);)a++;var l=FromPS.B.readASCII(e,u,a-u);l=l.split(" ");var v=parseInt(l[0]),p=parseInt(l[1]);e[a]==13&&a++,e[a]==10&&a++;for(var c=0;c<p;c++){var _=v+c;if(s[_]==null&&(s[_]={off:parseInt(FromPS.B.readASCII(e,a,10)),gen:parseInt(FromPS.B.readASCII(e,a+11,5)),chr:FromPS.B.readASCII(e,a+17,1),val:null,opn:!1}),e[a+16]!=32)return null;a+=20}}return FromPDF._readTrailer(e,a,s)}else{for(var a=r;!FromPS.isEOL(e[a]);)a++;for(;FromPS.isWhite(e[a]);)a++;if(FromPS.B.readASCII(e,a,2)=="<<"){var f={buff:e,off:a},g=FromPDF.readObject(f,f,null),y=0,w=FromPS.GS(g),M=g["/W"],T=g["/Index"],B=[];if(T)for(var c=0;c<T.length;c+=2)for(var H=0;H<T[c+1];H++)B.push(T[c]+H);for(var c=0;y<w.length;){var J=FromPDF.getInt(w,y,M[0]);y+=M[0];var Q=FromPDF.getInt(w,y,M[1]);y+=M[1];var q=FromPDF.getInt(w,y,M[2]);y+=M[2];var a=0,O=0,K="n";J==0&&(a=Q,O=q,K="f"),J==1&&(a=Q,O=q,K="n"),J==2&&(a=Q,O=q,K="s"),s[T?B[c]:c]={off:a,gen:O,chr:K,val:null,opn:!1},c++}if(g["/Prev"]&&FromPDF.readXrefTrail(e,g["/Prev"],s),g["/Encrypt"])return g;for(var pe={buff:e,off:0},R=["/Root","/Info"],c=0;c<R.length;c++){var Te=R[c],re=g[Te];re&&re.typ=="ref"&&(g[Te]=FromPDF.getIndirect(re.ind,re.gen,pe,s))}return g}else return null}},FromPDF.getInt=function(e,r,s){if(s==0)return 0;if(s==1)return e[r];if(s==2)return e[r]<<8|e[r+1];if(s==3)return e[r]<<16|e[r+1]<<8|e[r+2];if(s==4)return e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3];for(;s>4;)s--,r++;return e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]},FromPDF.getIndirect=function(e,r,s,o){var a=o[e];if(a.chr=="f")return null;if(a.val!=null)return a.val;if(a.opn)return{typ:"ref",ind:e,gen:r};a.opn=!0;var u=s.off,l;if(a.chr=="s"){for(var v=FromPDF.getIndirect(a.off,a.gen,s,o),p={buff:FromPS.GS(v),off:0},c=0,_=0;c!=e;)c=FromPS.getFToken(p).val,_=FromPS.getFToken(p).val;p.off=_+v["/First"],l=FromPDF.readObject(p,s,o)}else{s.off=a.off;var f=FromPS.getFToken(s);if(f.val!="<<")var g=FromPS.getFToken(s),y=FromPS.getFToken(s);else s.off-=2;l=FromPDF.readObject(s,s,o)}return a.val=l,s.off=u,a.opn=!1,l},FromPDF.readObject=function(e,r,s){var o=FromPS.getFToken(e);if(o.typ=="integer"){var a=e.off,u=FromPS.getFToken(e);if(u&&u.typ=="integer"&&(FromPS.skipWhite(e),e.buff[e.off]==82))return e.off++,s&&s[o.val]?FromPDF.getIndirect(o.val,u.val,r,s):{typ:"ref",ind:o.val,gen:u.val};e.off=a}if(o.val=="<<")return FromPDF.readDict(e,r,s);if(o.val=="[")return FromPDF.readArra(e,r,s);if(o.typ=="string"){for(var l="",v=0;v<o.val.length;v++)l+=String.fromCharCode(o.val[v]);return l}if(o.typ=="name"&&o.val==">>")throw"e";return o.val},FromPDF.readDict=function(e,r,s){for(var o={};;){var a=e.off,u=FromPS.getFToken(e);if(u.typ=="name"&&u.val==">>")break;e.off=a;var l=FromPDF.readObject(e,r,s),v=FromPDF.readObject(e,r,s);o[l]=v}if(o["/Length"]!=null&&o["/CFM"]==null){var p=o["/Length"],c=FromPS.getFToken(e);e.buff[e.off]==32&&e.off++,e.buff[e.off]==13&&e.off++,e.buff[e.off]==10&&e.off++,e.off+p>e.buff.length&&console.log("too big /Length of a stream",p,e.buff.length-e.off,e.off),o.buff=e.buff.slice(e.off,e.off+p),e.off+=p,FromPS.getFToken(e)}return o},FromPDF.readArra=function(e,r,s){for(var o=[];;){var a=e.off,u=FromPS.getFToken(e);if(u.typ=="name"&&u.val=="]")return o;e.off=a;var l=FromPDF.readObject(e,r,s);o.push(l)}};function FromWMF(){}FromWMF.Parse=function(e,r){e=new Uint8Array(e);var s=0,o={fill:!1,strk:!1,bb:[0,0,1,1],lbb:[0,0,1,1],scl:1,fnt:{nam:"Arial",hgh:25,und:!1,orn:0,chrst:0},tclr:[0,0,0],talg:0},a=FromWMF.B.readShort,u=FromWMF.B.readUshort,l=FromWMF.B.readUint,v=l(e,0);if(v==2596720087){s=6;var p=a(e,s+8);o.scl=120/p;for(var c=0;c<4;c++)o.bb[c]=Math.round(a(e,s)*o.scl),s+=2;s+=2,s+=6}r.StartPage(o.bb[0],o.bb[1],o.bb[2],o.bb[3]);var _=UDOC.getState(o.bb),f=u(e,s);s+=2;var g=u(e,s);s+=2;var y=u(e,s);s+=2;var w=l(e,s);s+=4;var M=u(e,s);s+=2;var T=l(e,s);s+=4;var M=u(e,s);s+=2;for(var B=[],H=0;;){var J=l(e,s)<<1;s+=4;var Q=u(e,s);s+=2;var q=FromWMF.K[Q],O=s,K=null;if(q=="EOF")break;if(q=="ESCAPE"){var pe=u(e,s);O+=2;var R=FromWMF.K2[pe];console.log(q,R)}else if(!(q=="SETMAPMODE"||q=="SETPOLYFILLMODE"||q=="SETBKMODE"))if(q=="SELECTOBJECT"){var Te=u(e,O);O+=2;var re=B[Te];if(re.t=="br"){if(o.fill=re.stl!=1,re.stl!=0){if(re.stl!=1)throw re.stl+" e"}_.colr=re.clr}else if(re.t=="pn"){var oe=re.stl&7;if(o.strk=oe!=5,oe==0||oe==6)_.lwidth=re.px;else if(oe!=5)throw oe+" e";(re.stl&4096)!=0?_.ljoin=2:(re.stl&8192)!=0?_.ljoin=0:_.ljoin=1,_.COLR=re.clr}else if(re.t=="fn")o.fnt=re,_.font.Tf=re.nam,_.font.Tfs=Math.abs(re.hgh),_.font.Tun=re.und;else throw"e"}else if(q=="DELETEOBJECT"){var Te=u(e,O);O+=2,B[Te]=null}else if(q=="SETWINDOWORG"||q=="SETWINDOWEXT"){var me=q=="SETWINDOWORG"?0:2;o.lbb[me+1]=a(e,O),O+=2,o.lbb[me]=a(e,O),O+=2,FromWMF._updateCtm(o,_)}else if(q=="CREATEBRUSHINDIRECT")K={t:"br"},K.stl=u(e,O),O+=2,K.clr=[e[O]/255,e[O+1]/255,e[O+2]/255],O+=4,K.htc=u(e,O),O+=2;else if(q=="CREATEPENINDIRECT")K={t:"pn"},K.stl=u(e,O),O+=2,K.px=a(e,O),O+=2,K.py=a(e,O),O+=2,K.clr=[e[O]/255,e[O+1]/255,e[O+2]/255],O+=4;else if(q=="CREATEFONTINDIRECT"){K={t:"fn",nam:""},K.hgh=a(e,O),O+=2,O+=2*2,K.orn=a(e,O)/10,O+=2;var ue=a(e,O);for(O+=2,K.und=e[O+1],O+=2,K.stk=e[O],K.chrst=e[s+1],O+=2,O+=4;e[O]!=0;)K.nam+=String.fromCharCode(e[O]),O++;ue>500&&(K.nam+="-Bold")}else if(q=="CREATEPALETTE")K={t:"pl"};else if(q=="SETTEXTCOLOR")o.tclr=[e[O]/255,e[O+1]/255,e[O+2]/255];else if(q=="SETTEXTALIGN")o.talg=u(e,O);else if(q=="MOVETO")UDOC.G.moveTo(_,a(e,O+2),a(e,O));else if(q=="LINETO"){if(_.pth.cmds.length==0){var $=_.ctm.slice(0);UDOC.M.invert($);var ee=UDOC.M.multPoint($,_.cpos);UDOC.G.moveTo(_,ee[0],ee[1])}UDOC.G.lineTo(_,a(e,O+2),a(e,O));var ne=o.fill;o.fill=!1,FromWMF._draw(r,_,o),o.fill=ne}else if(q=="POLYPOLYGON"){var _e=u(e,O);O+=2;var ae=O;O+=_e*2;for(var c=0;c<_e;c++){var Me=u(e,ae+c*2);O=FromWMF._drawPoly(e,O,Me,_,!0)}FromWMF._draw(r,_,o)}else if(q=="POLYGON"||q=="POLYLINE"){var Me=u(e,O);O+=2,O=FromWMF._drawPoly(e,O,Me,_,q=="POLYGON");var ne=o.fill;o.fill=ne&&q=="POLYGON",FromWMF._draw(r,_,o),o.fill=ne}else if(q=="RECTANGLE"||q=="ELLIPSE"){var Ne=a(e,O);O+=2;var Ae=a(e,O);O+=2;var Fe=a(e,O);O+=2;var De=a(e,O);if(O+=2,q=="RECTANGLE")UDOC.G.moveTo(_,De,Fe),UDOC.G.lineTo(_,Ae,Fe),UDOC.G.lineTo(_,Ae,Ne),UDOC.G.lineTo(_,De,Ne);else{var ze=(De+Ae)/2,ye=(Fe+Ne)/2;UDOC.G.arc(_,ze,ye,(Ne-Fe)/2,0,2*Math.PI,!1)}UDOC.G.closePath(_);var ne=o.fill;o.fill=!0,FromWMF._draw(r,_,o),o.fill=ne}else if(q=="STRETCHDIB"){var he=l(e,O);O+=4;var ke=u(e,O);O+=2;var le=a(e,O);O+=2;var Ce=a(e,O);O+=2;var Be=a(e,O);O+=2;var we=a(e,O);O+=2;var xe=a(e,O);O+=2;var Ie=a(e,O);O+=2;var Re=a(e,O);O+=2;var Le=a(e,O);O+=2;var Oe=FromWMF._loadDIB(e,O),Ve=_.ctm.slice(0);_.ctm=[1,0,0,1,0,0],UDOC.M.scale(_.ctm,Ie,-xe),UDOC.M.translate(_.ctm,Le,Re+xe),UDOC.M.concat(_.ctm,Ve),r.PutImage(_,Oe,Ce,le),_.ctm=Ve}else if(q=="EXTTEXTOUT"){var Xe=a(e,O);O+=2;var We=a(e,O);O+=2,_.font.Tm=[1,0,0,-1,0,0],UDOC.M.rotate(_.font.Tm,o.fnt.orn*Math.PI/180),UDOC.M.translate(_.font.Tm,We,Xe);var t=o.talg;if((t&6)==6)_.font.Tal=2;else if((t&7)==0)_.font.Tal=0;else throw t+" e";if((t&24)!=24)if((t&24)==0)UDOC.M.translate(_.font.Tm,0,_.font.Tfs);else throw"e";var h=u(e,O);O+=2;var d=u(e,O);O+=2,d&4&&(O+=8);for(var x="",c=0;c<h;c++){var E=e[O+c];E>127&&(c++,E=E<<8|e[O+c]),x+=String.fromCharCode(E)}var C=_.colr;_.colr=o.tclr,r.PutText(_,x,x.length*_.font.Tfs*.5),_.colr=C}else console.log(q,J);if(K!=null){for(var b=0;B[b]!=null;)b++;B[b]=K}s+=J-6}r.ShowPage(),r.Done()},FromWMF._loadDIB=function(e,r){var s=FromWMF.B.readShort,o=FromWMF.B.readUshort,a=FromWMF.B.readUint,u=a(e,r);r+=4;var l,v,p;if(u==12)throw"e";l=a(e,r),r+=4,v=a(e,r),r+=4;var c=o(e,r);if(r+=2,c!=1)throw"e";var _=o(e,r);if(r+=2,_!=1&&_!=24&&_!=32)throw _+" e";var f=a(e,r);if(r+=4,f!=0)throw"e";var g=a(e,r);r+=4;var y=a(e,r);r+=4;var w=a(e,r);r+=4,p=a(e,r),r+=4;var M=a(e,r);r+=4;var T=l*v,B=new Uint8Array(T*4),H=Math.floor((l*c*_+31&~31)/8);if(_==1)for(var J=0;J<v;J++)for(var Q=r+p*4+(v-1-J)*H,q=0;q<l;q++){var O=J*l+q<<2,K=e[Q+(q>>>3)]>>>7-(q&7)&1;B[O]=e[r+K*4+2],B[O+1]=e[r+K*4+1],B[O+2]=e[r+K*4+0],B[O+3]=255}if(_==24)for(var J=0;J<v;J++)for(var q=0;q<l;q++){var O=J*l+q<<2,pe=r+(v-1-J)*H+q*3;B[O]=e[pe+2],B[O+1]=e[pe+1],B[O+2]=e[pe+0],B[O+3]=255}if(_==32)for(var J=0;J<v;J++)for(var q=0;q<l;q++){var O=J*l+q<<2,pe=r+(v-1-J)*H+q*4;B[O]=e[pe+2],B[O+1]=e[pe+1],B[O+2]=e[pe+0],B[O+3]=e[pe+3]}return B},FromWMF._updateCtm=function(e,r){var s=[1,0,0,1,0,0],o=e.lbb,a=e.bb;UDOC.M.translate(s,-o[0],-o[1]),UDOC.M.scale(s,1/o[2],1/o[3]),UDOC.M.scale(s,a[2]-a[0],a[3]-a[1]),UDOC.M.translate(s,a[0],a[1]),r.ctm=s},FromWMF._draw=function(e,r,s){s.fill&&e.Fill(r,!1),s.strk&&r.lwidth!=0&&e.Stroke(r,!1),UDOC.G.newPath(r)},FromWMF._drawPoly=function(e,r,s,o,a){for(var u=FromWMF.B.readShort,l=0;l<s;l++){var v=u(e,r);r+=2;var p=u(e,r);r+=2,l==0?UDOC.G.moveTo(o,v,p):UDOC.G.lineTo(o,v,p)}return a&&UDOC.G.closePath(o),r},FromWMF.B={uint8:new Uint8Array(4),readShort:function(e,r){var s=FromWMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],FromWMF.B.int16[0]},readUshort:function(e,r){var s=FromWMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],FromWMF.B.uint16[0]},readUint:function(e,r){var s=FromWMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],s[2]=e[r+2],s[3]=e[r+3],FromWMF.B.uint32[0]},readASCII:function(e,r,s){for(var o="",a=0;a<s;a++)o+=String.fromCharCode(e[r+a]);return o}},FromWMF.B.int16=new Int16Array(FromWMF.B.uint8.buffer),FromWMF.B.uint16=new Uint16Array(FromWMF.B.uint8.buffer),FromWMF.B.uint32=new Uint32Array(FromWMF.B.uint8.buffer),FromWMF.C={META_EOF:0,META_REALIZEPALETTE:53,META_SETPALENTRIES:55,META_SETBKMODE:258,META_SETMAPMODE:259,META_SETROP2:260,META_SETRELABS:261,META_SETPOLYFILLMODE:262,META_SETSTRETCHBLTMODE:263,META_SETTEXTCHAREXTRA:264,META_RESTOREDC:295,META_RESIZEPALETTE:313,META_DIBCREATEPATTERNBRUSH:322,META_SETLAYOUT:329,META_SETBKCOLOR:513,META_SETTEXTCOLOR:521,META_OFFSETVIEWPORTORG:529,META_LINETO:531,META_MOVETO:532,META_OFFSETCLIPRGN:544,META_FILLREGION:552,META_SETMAPPERFLAGS:561,META_SELECTPALETTE:564,META_POLYGON:804,META_POLYLINE:805,META_SETTEXTJUSTIFICATION:522,META_SETWINDOWORG:523,META_SETWINDOWEXT:524,META_SETVIEWPORTORG:525,META_SETVIEWPORTEXT:526,META_OFFSETWINDOWORG:527,META_SCALEWINDOWEXT:1040,META_SCALEVIEWPORTEXT:1042,META_EXCLUDECLIPRECT:1045,META_INTERSECTCLIPRECT:1046,META_ELLIPSE:1048,META_FLOODFILL:1049,META_FRAMEREGION:1065,META_ANIMATEPALETTE:1078,META_TEXTOUT:1313,META_POLYPOLYGON:1336,META_EXTFLOODFILL:1352,META_RECTANGLE:1051,META_SETPIXEL:1055,META_ROUNDRECT:1564,META_PATBLT:1565,META_SAVEDC:30,META_PIE:2074,META_STRETCHBLT:2851,META_ESCAPE:1574,META_INVERTREGION:298,META_PAINTREGION:299,META_SELECTCLIPREGION:300,META_SELECTOBJECT:301,META_SETTEXTALIGN:302,META_ARC:2071,META_CHORD:2096,META_BITBLT:2338,META_EXTTEXTOUT:2610,META_SETDIBTODEV:3379,META_DIBBITBLT:2368,META_DIBSTRETCHBLT:2881,META_STRETCHDIB:3907,META_DELETEOBJECT:496,META_CREATEPALETTE:247,META_CREATEPATTERNBRUSH:505,META_CREATEPENINDIRECT:762,META_CREATEFONTINDIRECT:763,META_CREATEBRUSHINDIRECT:764,META_CREATEREGION:1791},FromWMF.C2={NEWFRAME:1,ABORTDOC:2,NEXTBAND:3,SETCOLORTABLE:4,GETCOLORTABLE:5,FLUSHOUT:6,DRAFTMODE:7,QUERYESCSUPPORT:8,SETABORTPROC:9,STARTDOC:10,ENDDOC:11,GETPHYSPAGESIZE:12,GETPRINTINGOFFSET:13,GETSCALINGFACTOR:14,META_ESCAPE_ENHANCED_METAFILE:15,SETPENWIDTH:16,SETCOPYCOUNT:17,SETPAPERSOURCE:18,PASSTHROUGH:19,GETTECHNOLOGY:20,SETLINECAP:21,SETLINEJOIN:22,SETMITERLIMIT:23,BANDINFO:24,DRAWPATTERNRECT:25,GETVECTORPENSIZE:26,GETVECTORBRUSHSIZE:27,ENABLEDUPLEX:28,GETSETPAPERBINS:29,GETSETPRINTORIENT:30,ENUMPAPERBINS:31,SETDIBSCALING:32,EPSPRINTING:33,ENUMPAPERMETRICS:34,GETSETPAPERMETRICS:35,POSTSCRIPT_DATA:37,POSTSCRIPT_IGNORE:38,GETDEVICEUNITS:42,GETEXTENDEDTEXTMETRICS:256,GETPAIRKERNTABLE:258,EXTTEXTOUT:512,GETFACENAME:513,DOWNLOADFACE:514,METAFILE_DRIVER:2049,QUERYDIBSUPPORT:3073,BEGIN_PATH:4096,CLIP_TO_PATH:4097,END_PATH:4098,OPEN_CHANNEL:4110,DOWNLOADHEADER:4111,CLOSE_CHANNEL:4112,POSTSCRIPT_PASSTHROUGH:4115,ENCAPSULATED_POSTSCRIPT:4116,POSTSCRIPT_IDENTIFY:4117,POSTSCRIPT_INJECTION:4118,CHECKJPEGFORMAT:4119,CHECKPNGFORMAT:4120,GET_PS_FEATURESETTING:4121,MXDC_ESCAPE:4122,SPCLPASSTHROUGH2:4568},FromWMF.K=[],FromWMF.K2=[],function(){var e,r,s;e=FromWMF.C,r=FromWMF.K,s=5;for(var o in e)r[e[o]]=o.slice(s);e=FromWMF.C2,r=FromWMF.K2,s=0;for(var o in e)r[e[o]]=o.slice(s)}();function FromEMF(){}FromEMF.Parse=function(e,r){e=new Uint8Array(e);for(var s=0,o={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},a,u=[],l=[],v=FromEMF.B.readShort,p=FromEMF.B.readUshort,c=FromEMF.B.readInt,_=FromEMF.B.readUint,f=FromEMF.B.readFloat,g=0;;){var y=_(e,s);s+=4;var w=FromEMF.K[y],M=_(e,s);s+=4;var T=s,B=null,H=0;if(w=="EOF")break;if(w=="HEADER")o.bb=FromEMF._readBox(e,T),T+=16,r.StartPage(o.bb[0],o.bb[1],o.bb[2],o.bb[3]),a=UDOC.getState(o.bb);else if(w=="SAVEDC")l.push(JSON.stringify(a),JSON.stringify(o));else if(w=="RESTOREDC"){var J=c(e,T);for(T+=4;J<-1;)l.pop(),l.pop();o=JSON.parse(l.pop()),a=JSON.parse(l.pop())}else if(w=="SELECTCLIPPATH")a.cpth=JSON.parse(JSON.stringify(a.pth));else if(["SETMAPMODE","SETPOLYFILLMODE","SETBKMODE","SETICMMODE","SETROP2","EXTSELECTCLIPRGN"].indexOf(w)==-1){if(w=="SETMITERLIMIT")a.mlimit=_(e,T);else if(w=="SETTEXTCOLOR")o.tclr=[e[T]/255,e[T+1]/255,e[T+2]/255];else if(w=="SETTEXTALIGN")o.talg=_(e,T);else if(w=="SETVIEWPORTEXTEX"||w=="SETVIEWPORTORGEX"){o.vbb==null&&(o.vbb=[]);var Q=w=="SETVIEWPORTORGEX"?0:2;o.vbb[Q]=c(e,T),T+=4,o.vbb[Q+1]=c(e,T),T+=4,w=="SETVIEWPORTEXTEX"&&FromEMF._updateCtm(o,a)}else if(w=="SETWINDOWEXTEX"||w=="SETWINDOWORGEX"){var Q=w=="SETWINDOWORGEX"?0:2;o.wbb[Q]=c(e,T),T+=4,o.wbb[Q+1]=c(e,T),T+=4,w=="SETWINDOWEXTEX"&&FromEMF._updateCtm(o,a)}else if(w=="COMMENT"){var q=_(e,T);T+=4}else if(w=="SELECTOBJECT"){var O=_(e,T);if(T+=4,O==2147483648)o.fill=!0,a.colr=[1,1,1];else if(O==2147483653)o.fill=!1;else if(O==2147483655)o.strk=!0,o.lwidth=1,a.COLR=[0,0,0];else if(O==2147483656)o.strk=!1;else if(O!=2147483661){if(O!=2147483662){var K=u[O];if(K.t=="b"){if(o.fill=K.stl!=1,K.stl!=0){if(K.stl!=1)throw K.stl+" e"}a.colr=K.clr}else if(K.t=="p")o.strk=K.stl!=5,a.lwidth=K.wid,a.COLR=K.clr;else if(K.t=="f")o.fnt=K,a.font.Tf=K.nam,a.font.Tfs=Math.abs(K.hgh),a.font.Tun=K.und;else throw"e"}}}else if(w=="DELETEOBJECT"){var O=_(e,T);if(T+=4,u[O]!=null)u[O]=null;else throw"e"}else if(w=="CREATEBRUSHINDIRECT")H=_(e,T),T+=4,B={t:"b"},B.stl=_(e,T),T+=4,B.clr=[e[T]/255,e[T+1]/255,e[T+2]/255],T+=4,B.htc=_(e,T),T+=4;else if(w=="CREATEPEN"||w=="EXTCREATEPEN")H=_(e,T),T+=4,B={t:"p"},w=="EXTCREATEPEN"?(T+=16,B.stl=_(e,T),T+=4,B.wid=_(e,T),T+=4,T+=4):(B.stl=_(e,T),T+=4,B.wid=_(e,T),T+=4,T+=4),B.clr=[e[T]/255,e[T+1]/255,e[T+2]/255],T+=4;else if(w=="EXTCREATEFONTINDIRECTW"){H=_(e,T),T+=4,B={t:"f",nam:""},B.hgh=c(e,T),T+=4,T+=4*2,B.orn=c(e,T)/10,T+=4;var pe=_(e,T);for(T+=4,B.und=e[T+1],B.stk=e[T+2],T+=4*2;p(e,T)!=0;)B.nam+=String.fromCharCode(p(e,T)),T+=2;pe>500&&(B.nam+="-Bold")}else if(w=="EXTTEXTOUTW"){T+=16;var R=_(e,T);T+=4;var Te=f(e,T);T+=4;var re=f(e,T);T+=4;var oe=c(e,T);T+=4;var me=c(e,T);T+=4,a.font.Tm=[1,0,0,-1,0,0],UDOC.M.rotate(a.font.Tm,o.fnt.orn*Math.PI/180),UDOC.M.translate(a.font.Tm,oe,me);var ue=o.talg;if((ue&6)==6)a.font.Tal=2;else if((ue&7)==0)a.font.Tal=0;else throw ue+" e";if((ue&24)!=24)if((ue&24)==0)UDOC.M.translate(a.font.Tm,0,a.font.Tfs);else throw"e";var $=_(e,T);T+=4;var ee=_(e,T);T+=4;var ne=_(e,T);T+=4,T+=16;var _e=_(e,T);T+=4,ee+=s-8;for(var ae="",Me=0;Me<$;Me++){var Ne=p(e,ee+Me*2);ae+=String.fromCharCode(Ne)}var Ae=a.colr;a.colr=o.tclr,r.PutText(a,ae,ae.length*a.font.Tfs*.5),a.colr=Ae}else if(w=="BEGINPATH")UDOC.G.newPath(a);else if(w!="ENDPATH")if(w=="CLOSEFIGURE")UDOC.G.closePath(a);else if(w=="MOVETOEX")UDOC.G.moveTo(a,c(e,T),c(e,T+4));else if(w=="LINETO"){if(a.pth.cmds.length==0){var Fe=a.ctm.slice(0);UDOC.M.invert(Fe);var De=UDOC.M.multPoint(Fe,a.cpos);UDOC.G.moveTo(a,De[0],De[1])}UDOC.G.lineTo(a,c(e,T),c(e,T+4))}else if(w=="POLYGON"||w=="POLYGON16"||w=="POLYLINE"||w=="POLYLINE16"||w=="POLYLINETO"||w=="POLYLINETO16"){T+=16;var ze=w.startsWith("POLYGON"),ye=w.indexOf("TO")!=-1,he=_(e,T);T+=4,ye||UDOC.G.newPath(a),T=FromEMF._drawPoly(e,T,he,a,w.endsWith("16")?2:4,ze,ye),ye||FromEMF._draw(r,a,o,ze)}else if(w=="POLYPOLYGON16"){T+=16;var ze=w.startsWith("POLYPOLYGON"),ye=w.indexOf("TO")!=-1,ke=_(e,T);T+=4,T+=4;var le=T;T+=ke*4,ye||UDOC.G.newPath(a);for(var Me=0;Me<ke;Me++){var Ce=p(e,le+Me*4);T=FromEMF._drawPoly(e,T,Ce,a,w.endsWith("16")?2:4,ze,ye)}ye||FromEMF._draw(r,a,o,ze)}else if(w=="POLYBEZIER"||w=="POLYBEZIER16"||w=="POLYBEZIERTO"||w=="POLYBEZIERTO16"){T+=16;var Be=w.endsWith("16"),we=Be?v:c,xe=Be?2:4,he=_(e,T);for(T+=4,w.indexOf("TO")==-1&&(UDOC.G.moveTo(a,we(e,T),we(e,T+xe)),T+=2*xe,he--);he>0;)UDOC.G.curveTo(a,we(e,T),we(e,T+xe),we(e,T+2*xe),we(e,T+3*xe),we(e,T+4*xe),we(e,T+5*xe)),T+=6*xe,he-=3}else if(w=="RECTANGLE"||w=="ELLIPSE"){UDOC.G.newPath(a);var Ie=FromEMF._readBox(e,T);if(w=="RECTANGLE")UDOC.G.moveTo(a,Ie[0],Ie[1]),UDOC.G.lineTo(a,Ie[2],Ie[1]),UDOC.G.lineTo(a,Ie[2],Ie[3]),UDOC.G.lineTo(a,Ie[0],Ie[3]);else{var Re=(Ie[0]+Ie[2])/2,Le=(Ie[1]+Ie[3])/2;UDOC.G.arc(a,Re,Le,(Ie[2]-Ie[0])/2,0,2*Math.PI,!1)}UDOC.G.closePath(a),FromEMF._draw(r,a,o,!0)}else if(w=="FILLPATH")r.Fill(a,!1);else if(w=="STROKEPATH")r.Stroke(a);else if(w=="STROKEANDFILLPATH")r.Fill(a,!1),r.Stroke(a);else if(w=="SETWORLDTRANSFORM"||w=="MODIFYWORLDTRANSFORM"){for(var Oe=[],Me=0;Me<6;Me++)Oe.push(f(e,T+Me*4));if(T+=24,w=="SETWORLDTRANSFORM")a.ctm=Oe;else{var R=_(e,T);if(T+=4,R==2){var Ve=a.ctm;a.ctm=Oe,UDOC.M.concat(a.ctm,Ve)}else throw"e"}}else if(w=="SETSTRETCHBLTMODE"){var Xe=_(e,T);T+=4}else if(w=="STRETCHDIBITS"){var Ie=FromEMF._readBox(e,T);T+=16;var We=c(e,T);T+=4;var t=c(e,T);T+=4;var h=c(e,T);T+=4;var d=c(e,T);T+=4;var x=c(e,T);T+=4;var E=c(e,T);T+=4;var C=_(e,T)+s-8;T+=4;var b=_(e,T);T+=4;var U=_(e,T)+s-8;T+=4;var D=_(e,T);T+=4;var k=_(e,T);if(T+=4,k!=0)throw"e";var Z=_(e,T);T+=4;var Y=c(e,T);T+=4;var W=c(e,T);T+=4;var F=_(e,C);C+=4;var z=_(e,C);C+=4;var G=_(e,C);if(C+=4,z!=x||G!=E)throw"e";var X=p(e,C);C+=2;var A=p(e,C);if(C+=2,A!=1&&A!=4&&A!=8&&A!=24&&A!=32)throw A+" e";var N=_(e,C);if(C+=4,N!=0)throw N+" e";var I=_(e,C);C+=4;var te=_(e,C);C+=4;var fe=_(e,C);C+=4;var S=_(e,C);C+=4;var de=_(e,C);C+=4;var se=Math.floor((z*X*A+31&~31)/8),ie=new Uint8Array(z*G*4);if(A==8)for(var Le=0;Le<G;Le++)for(var Re=0;Re<z;Re++){var ge=Le*z+Re<<2,O=e[U+(G-1-Le)*se+Re]<<2;ie[ge]=e[C+O+2],ie[ge+1]=e[C+O+1],ie[ge+2]=e[C+O+0],ie[ge+3]=255}else if(A==24)for(var Le=0;Le<G;Le++)for(var Re=0;Re<z;Re++){var ge=Le*z+Re<<2,Pe=U+(G-1-Le)*se+Re*3;ie[ge]=e[Pe+2],ie[ge+1]=e[Pe+1],ie[ge+2]=e[Pe+0],ie[ge+3]=255}else if(A==32)for(var Le=0;Le<G;Le++)for(var Re=0;Re<z;Re++){var ge=Le*z+Re<<2,Pe=U+(G-1-Le)*se+Re*4;ie[ge]=e[Pe+2],ie[ge+1]=e[Pe+1],ie[ge+2]=e[Pe+0],ie[ge+3]=e[Pe+3]}else console.log("unsupported bit depth",A,z,G);var Ye=a.ctm.slice(0);a.ctm=[1,0,0,1,0,0],UDOC.M.scale(a.ctm,Y,-W),UDOC.M.translate(a.ctm,We,t+W),UDOC.M.concat(a.ctm,Ye),r.PutImage(a,ie,z,G),a.ctm=Ye}else console.log(w,M)}B!=null&&(u[H]=B),s+=M-8}r.ShowPage(),r.Done()},FromEMF._readBox=function(e,r){for(var s=[],o=0;o<4;o++)s[o]=FromEMF.B.readInt(e,r+o*4);return s},FromEMF._updateCtm=function(e,r){var s=[1,0,0,1,0,0],o=e.wbb,a=e.bb,u=e.vbb&&e.vbb.length==4?e.vbb:e.bb;UDOC.M.translate(s,-o[0],-o[1]),UDOC.M.scale(s,1/o[2],1/o[3]),UDOC.M.scale(s,u[2],u[3]),r.ctm=s},FromEMF._draw=function(e,r,s,o){s.fill&&o&&e.Fill(r,!1),s.strk&&r.lwidth!=0&&e.Stroke(r)},FromEMF._drawPoly=function(e,r,s,o,a,u,l){for(var v=a==2?FromEMF.B.readShort:FromEMF.B.readInt,p=0;p<s;p++){var c=v(e,r);r+=a;var _=v(e,r);r+=a,p==0&&!l?UDOC.G.moveTo(o,c,_):UDOC.G.lineTo(o,c,_)}return u&&UDOC.G.closePath(o),r},FromEMF.B={uint8:new Uint8Array(4),readShort:function(e,r){var s=FromEMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],FromEMF.B.int16[0]},readUshort:function(e,r){var s=FromEMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],FromEMF.B.uint16[0]},readInt:function(e,r){var s=FromEMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],s[2]=e[r+2],s[3]=e[r+3],FromEMF.B.int32[0]},readUint:function(e,r){var s=FromEMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],s[2]=e[r+2],s[3]=e[r+3],FromEMF.B.uint32[0]},readFloat:function(e,r){var s=FromEMF.B.uint8;return s[0]=e[r],s[1]=e[r+1],s[2]=e[r+2],s[3]=e[r+3],FromEMF.B.flot32[0]},readASCII:function(e,r,s){for(var o="",a=0;a<s;a++)o+=String.fromCharCode(e[r+a]);return o}},FromEMF.B.int16=new Int16Array(FromEMF.B.uint8.buffer),FromEMF.B.uint16=new Uint16Array(FromEMF.B.uint8.buffer),FromEMF.B.int32=new Int32Array(FromEMF.B.uint8.buffer),FromEMF.B.uint32=new Uint32Array(FromEMF.B.uint8.buffer),FromEMF.B.flot32=new Float32Array(FromEMF.B.uint8.buffer),FromEMF.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},FromEMF.K=[],function(){var e,r,s;e=FromEMF.C,r=FromEMF.K,s=4;for(var o in e)r[e[o]]=o.slice(s)}();function ToPDF(){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._gst=ToPDF.defState()}ToPDF.defState=function(){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"}},ToPDF.prototype.StartPage=function(e,r,s,o){this._bnds=[e,r,s,o]},ToPDF.prototype.Stroke=function(e){e.CA!=0&&(this.setGState(e,!0),this._cont+=` S
|
|
`)},ToPDF.prototype.Fill=function(e,r){e.ca!=0&&(this.setGState(e,!0),this._cont+=` f
|
|
`)},ToPDF._flt=function(e){return""+parseFloat(e.toFixed(2))},ToPDF._fltc=function(e){return""+parseFloat(e.toFixed(3))},ToPDF._scale=function(e){return Math.sqrt(Math.abs(e[0]*e[3]-e[1]*e[2]))},ToPDF._mat=function(e){var r=e.map(ToPDF._flt).join(" ");return r=="1 0 0 1 0 0"?"":r+" cm "},ToPDF._eq=function(e,r){if(e.length!=r.length)return!1;for(var s=0;s<e.length;s++)if(e[s]!=r[s])return!1;return!0},ToPDF._format=function(e){for(var r=[[255,216,255],[0,0,0,12,106,80,32,32],[0,0,0,0,48,0,1,0]],s=["/DCTDecode","/JPXDecode","/JBIG2Decode"],o=0;o<r.length;o++){for(var a=r[o],u=!0,l=0;l<a.length;l++)u=u&&e[l]==a[l];if(u)return s[o]}},ToPDF.prototype.setGState=function(e,r){var s=this._gst,o={};for(var a in e)o[a]=typeof e[a]=="string"?e[a]:JSON.stringify(e[a]);for(var u=ToPDF._scale(e.ctm),l=e.dash.slice(0),v=0;v<l.length;v++)l[v]=ToPDF._flt(l[v]*u);var p=this._cont;if(s.lcap!=o.lcap&&(p+=e.lcap+" J "),s.ljoin!=o.ljoin&&(p+=e.ljoin+" j "),s.lwidth!=o.lwidth&&(p+=ToPDF._flt(e.lwidth*u)+" w "),s.mlimit!=o.mlimit&&(p+=ToPDF._flt(e.mlimit)+" M "),(s.dash!=o.dash||s.doff!=o.doff)&&(p+="["+l.join(" ")+"] "+e.doff+" d "),s.COLR!=o.COLR&&(p+=e.COLR.map(ToPDF._fltc).join(" ")+" RG "),s.colr!=o.colr)if(e.colr.length!=null)p+=e.colr.map(ToPDF._fltc).join(" ")+` rg
|
|
`;else{var c=this._res["/Pattern"],_=e.colr,f="/P"+(ToPDF.maxI(c)+1),g={"/ShadingType":_.typ=="lin"?2:3,"/ColorSpace":"/DeviceRGB","/Extend":[!0,!0],"/Function":ToPDF._makeGrad(_.grad),"/Coords":_.crds};c[f]={"/Type":"/Pattern","/PatternType":2,"/Matrix":_.mat,"/Shading":g},p+="/Pattern cs "+f+" scn "}var y=this._res["/ExtGState"];if(s.bmode!=o.bmode){var w=o.bmode;y[w]==null&&(y[w]={"/Type":"/ExtGState","/BM":e.bmode}),p+=w+" gs "}if(s.CA!=o.CA){var w="/Alpha"+Math.round(255*o.CA);y[w]==null&&(y[w]={"/Type":"/ExtGState","/CA":e.CA}),p+=w+" gs "}if(s.ca!=o.ca){var w="/alpha"+Math.round(255*o.ca);y[w]==null&&(y[w]={"/Type":"/ExtGState","/ca":e.ca}),p+=w+" gs "}r&&(p+=ToPDF.drawPath(e.pth)),this._cont=p,this._gst=o},ToPDF.drawPath=function(e){for(var r=0,s="",o=ToPDF._flt,a=0;a<e.cmds.length;a++){var u=e.cmds[a];if(u=="M"){for(var l=0;l<2;l++)s+=o(e.crds[r++])+" ";s+="m "}else if(u=="L"){for(var l=0;l<2;l++)s+=o(e.crds[r++])+" ";s+="l "}else if(u=="C"){for(var l=0;l<6;l++)s+=o(e.crds[r++])+" ";s+="c "}else if(u=="Z")s+="h ";else throw u}return s},ToPDF._makeGrad=function(e){var r=[],s=[],o=[0,1],a=ToPDF._stopFun;if(e.length==2)return a(e[0][1],e[1][1]);s.push(a(e[0][1],e[1][1]));for(var u=1;u<e.length-1;u++)r.push(e[u][0]),s.push(a(e[u][1],e[u+1][1])),o.push(0,1);return{"/FunctionType":3,"/Encode":o,"/Domain":[0,1],"/Bounds":r,"/Functions":s}},ToPDF._stopFun=function(e,r){return{"/FunctionType":2,"/C0":e,"/C1":r,"/Domain":[0,1],"/N":1}},ToPDF.prototype.PutText=function(e,r,s,o){this.setGState(e,!1);var a=this.addFont(e.font.Tf,o);this._cont+="q ",this._cont+=ToPDF._mat(e.ctm),this._cont+=ToPDF._mat(e.font.Tm),this._cont+="BT "+a+" "+ToPDF._flt(e.font.Tfs)+" Tf 0 0 Td (";var u=[];if(o==null)for(var l=[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],v=0;v<r.length;v++){var p=r.charCodeAt(v);if(p>255){var c=l.indexOf(p);u.push(c==-1?32:l[c-1])}else u.push(p)}else for(var v=0;v<r.length;v++){var p=r.charCodeAt(v);u.push(p&255)}u=FromPS.makeString(u);for(var v=0;v<u.length;v++)this._cont+=String.fromCharCode(u[v]);this._cont+=") Tj ET ",this._cont+=` Q
|
|
`},ToPDF.prototype.PutImage=function(e,r,s,o,a){if(r.length==s*o*4&&a==null){for(var u=s*o,l=new Uint8Array(u),v=255,p=0;p<u;p++)l[p]=r[(p<<2)+3],v&=r[(p<<2)+3];v!=255&&(a=l)}var c=this.addImage(r,s,o,a);this.setGState(e,!1),this._cont+="q "+ToPDF._mat(e.ctm),this._cont+=c+` Do Q
|
|
`},ToPDF.prototype.ShowPage=function(){ToPDF.addPage(this._xr,this._cont,this._bnds),this._cont="",this._gst=ToPDF.defState()},ToPDF.prototype.Print=function(e){},ToPDF.prototype.Done=function(){var e=this._res;for(var r in e)Object.keys(e[r])==0&&delete e[r];this.buffer=ToPDF.xrToPDF(this._xr)},ToPDF.prototype.addImage=function(e,r,s,o){var a;if(o){var u=o;if(o.length==r*s*4){u=new Uint8Array(r*s);for(var l=0;l<u.length;l++)u[l]=o[(l<<2)+1]}a=this.addImage(u,r,s,null)}var v=ToPDF._format(e),p=e;if(e.length==r*s*4){p=new Uint8Array(r*s*3);for(var l=0;l<e.length;l+=4){var c=3*(l>>2);p[c]=e[l+0],p[c+1]=e[l+1],p[c+2]=e[l+2]}}var _=this._res["/XObject"];for(var f in _)if(ToPDF._eq(this._xr[_[f].ind].stream,p))return f;var f="/I"+(ToPDF.maxI(_)+1);_[f]={typ:"ref",ind:this._xr.length};var g={"/Type":"/XObject","/Subtype":"/Image","/BitsPerComponent":8,"/ColorSpace":e.length==r*s||v=="/DCTDecode"&&ToPDF.jpgProp(e)&&ToPDF.jpgProp(e).comps==1?"/DeviceGray":"/DeviceRGB","/Height":s,"/Width":r,stream:p};return v!=null&&(g["/Filter"]=ToPDF._format(e)),o&&(g["/SMask"]={typ:"ref",ind:this._xr.length-1},delete _[a]),this._xr.push(g),f},ToPDF.jpgProp=function(e){for(var r=0;r<e.length;){for(;e[r]==255;)r++;var s=e[r];if(r++,s!=216){if(s==217)break;if(!(208<=s&&s<=215)&&s!=1){var o=(e[r]<<8|e[r+1])-2;if(r+=2,s==192)return{bpp:e[r],w:e[r+1]<<8|e[r+2],h:e[r+3]<<8|e[r+4],comps:e[r+5]};r+=o}}}},ToPDF.readUshort=function(e,r){return e[r]<<8|e[r+1]},ToPDF.maxI=function(e){var r;for(var s in e)r=s;return r==null?0:parseInt(r.slice(2))},ToPDF._basicFont=function(e){var r=e.toLowerCase(),s=["Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique","Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic"],o=0;r.indexOf("sans")!=-1?o=0:r.indexOf("serif")!=-1&&(o=4);var a=r.indexOf("bold")!=-1,u=r.indexOf("italic")!=-1||r.indexOf("oblique")!=-1||r.endsWith("-it");return a&&u?o+=3:u?o+=2:a&&(o+=1),s[o]},ToPDF.prototype.addFont=function(e,r){e=ToPDF._basicFont(e),e="/"+e;var s=this._res["/Font"];for(var o in s)if(s[o]["/BaseFont"]==e)return o;var o="/F"+(ToPDF.maxI(s)+1),a={"/Type":"/Font","/Subtype":"/Type1","/BaseFont":e,"/Encoding":"/WinAnsiEncoding"};if(r!=null){for(var u="/CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def /CMapName /Adobe-Identity-UCS def /CMapType 2 def 1 begincodespacerange <0000> <FFFF> endcodespacerange 1 beginbfchar <0001> <200B> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end",l=new Uint8Array(u.length),v=0;v<u.length;v++)l[v]=u.charCodeAt(v);a["/Subtype"]="/TrueType",delete a["/Encoding"],a["/FirstChar"]=0,a["/Widths"]=[];for(var v=0;v<256;v++)a["/Widths"].push(500);a["/LastChar"]=a["/Widths"].length-1,a["/FontDescriptor"]={"/Ascent":905,"/CapHeight":1010,"/Descent":211,"/Flags":4,"/FontBBox":[-627,-376,2e3,1011],"/FontName":e,"/ItalicAngle":0,"/StemV":80,"/Type":"/FontDescriptor","/FontFile2":{stream:new Uint8Array(r)}}}return s[o]=a,o},ToPDF.addPage=function(e,r,s){var o=e.length;e[2]["/Kids"].push({typ:"ref",ind:o}),e[2]["/Count"]++,e.push({"/Type":"/Page","/Parent":{typ:"ref",ind:2},"/Resources":{typ:"ref",ind:3},"/MediaBox":s,"/Contents":{typ:"ref",ind:o+1}}),e.push({stream:r})},ToPDF.xrToPDF=function(e){var r={file:new ToPDF.MFile,off:0},s=ToPDF.write,o=[];s(r,`%PDF-1.1
|
|
`);for(var a=1;a<e.length;a++)o.push(r.off),s(r,a+` 0 obj
|
|
`),ToPDF.writeDict(r,e[a],0),s(r,`
|
|
endobj
|
|
`);var u=r.off;s(r,`xref
|
|
`),s(r,"0 "+e.length+`
|
|
`),s(r,`0000000000 65535 f
|
|
`);for(var a=0;a<o.length;a++){for(var l=o[a]+"";l.length<10;)l="0"+l;s(r,l+` 00000 n
|
|
`)}return s(r,`trailer
|
|
`),ToPDF.writeDict(r,{"/Root":{typ:"ref",ind:1},"/Size":e.length},0),s(r,`
|
|
startxref
|
|
`+u+`
|
|
%%EOF
|
|
`),r.file.data.buffer.slice(0,r.off)},ToPDF.write=function(e,r){e.file.req(e.off,r.length);for(var s=0;s<r.length;s++)e.file.data[e.off+s]=r.charCodeAt(s);e.off+=r.length},ToPDF._tab=" ",ToPDF.spc=function(e){for(var r="",s=0;s<e;s++)r+=ToPDF._tab;return r},ToPDF.writeValue=function(e,r,s){var o=ToPDF.write;if(typeof r=="string")o(e,r);else if(typeof r=="number")o(e,""+r);else if(typeof r=="boolean")o(e,""+r);else if(r.typ!=null)o(e,r.ind+" 0 R");else if(r instanceof Array)ToPDF.writeArray(e,r,s+1);else if(r instanceof Object)ToPDF.writeDict(e,r,s+1);else throw console.log(r),"e"},ToPDF.writeDict=function(e,r,s){var o=ToPDF.write,a=ToPDF.spc,u=r.stream;if(u){if(typeof u=="string"){for(var l=new Uint8Array(u.length),v=0;v<u.length;v++)l[v]=u.charCodeAt(v);u=l}r["/Filter"]==null&&(r["/Filter"]="/FlateDecode",u=pako.deflate(u))}o(e,`<<
|
|
`);for(var p in r)p.charAt(0)=="/"&&(o(e,a(s+1)+p+" "),ToPDF.writeValue(e,r[p],s),o(e,`
|
|
`));if(u&&o(e,a(s+1)+"/Length "+u.length+`
|
|
`),o(e,a(s)+">>"),u){o(e,a(s)+`
|
|
stream
|
|
`),e.file.req(e.off,u.length);for(var v=0;v<u.length;v++)e.file.data[e.off+v]=u[v];e.off+=u.length,o(e,a(s)+`
|
|
endstream`)}},ToPDF.writeArray=function(e,r,s){var o=ToPDF.write;o(e,"[ ");for(var a=0;a<r.length;a++)ToPDF.writeValue(e,r[a],s+1),a!=r.length-1&&o(e," ");o(e," ]")},ToPDF.MFile=function(){this.size=16,this.data=new Uint8Array(16)},ToPDF.MFile.prototype.req=function(e,r){if(!(e+r<=this.size)){for(var s=this.size;e+r>this.size;)this.size*=2;for(var o=new Uint8Array(this.size),a=0;a<s;a++)o[a]=this.data[a];this.data=o}};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.StartPage=function(e,r,s,o){this._check();var a=this._file,u=ToEMF.B.writeUint,l=ToEMF.B.writeInt;this._curh=Math.max(this._curh,o*10),this._inited?(this._curx+=this._lstw,ToEMF._writeHeadBox(a,[0,0,this._curx+s,Math.round(this._curh/10)])):(this._inited=!0,this._addRec("HEADER",88),ToEMF._writeHeadBox(a,[e,r,s,o]),a.off+=32,ToEMF.B.writeASCII(a.file,a.off," EMF"),a.off+=4,u(a.file,a.off,65536),a.off+=4,this._lenp=a.off,a.off+=4+4+4,a.off+=4+4+4,l(a.file,a.off,1440),a.off+=4,l(a.file,a.off,900),a.off+=4,l(a.file,a.off,508),a.off+=4,l(a.file,a.off,318),a.off+=4,this._trsf([.1,0,0,.1,0,0]),this._addRec("SETBKMODE",12),u(a.file,a.off,1),a.off+=4,this._addRec("SETTEXTALIGN",12),u(a.file,a.off,24),a.off+=4),this._lstw=s},ToEMF.prototype.Stroke=function(e){this._draw(e,1)},ToEMF.prototype.Fill=function(e,r){this._draw(e,2)},ToEMF.prototype.PutImage=function(e,r,s,o,a){var u=r.length;(u&3)!=0&&(u+=4-(u&3));var l=[1,0,0,-1,0,1];UDOC.M.concat(l,e.ctm),UDOC.M.scale(l,10,10),UDOC.M.scale(l,1,-1),UDOC.M.translate(l,this._curx,this._curh),this._trsf(l);var v=this._file,p=ToEMF.B.writeUint,c=ToEMF.B.writeInt,_=ToEMF.B.writeUshort,f=8+16+14*4;if(this._addRec("STRETCHDIBITS",f+40+u),v.off+=16,c(v.file,v.off,Math.round(0)),v.off+=4,c(v.file,v.off,Math.round(0)),v.off+=4,v.off+=8,c(v.file,v.off,s),v.off+=4,c(v.file,v.off,o),v.off+=4,p(v.file,v.off,f),v.off+=4,p(v.file,v.off,40),v.off+=4,p(v.file,v.off,f+40),v.off+=4,p(v.file,v.off,r.length),v.off+=4,v.off+=4,p(v.file,v.off,13369376),v.off+=4,c(v.file,v.off,Math.round(1)),v.off+=4,c(v.file,v.off,Math.round(1)),v.off+=4,c(v.file,v.off,40),v.off+=4,c(v.file,v.off,s),v.off+=4,c(v.file,v.off,o),v.off+=4,_(v.file,v.off,1),v.off+=2,_(v.file,v.off,32),v.off+=2,c(v.file,v.off,0),v.off+=4,c(v.file,v.off,r.length),v.off+=4,c(v.file,v.off,3800),v.off+=4,c(v.file,v.off,3800),v.off+=4,v.off+=8,v.file.req(v.off,r.length),r.length==s*o*4)for(var g=0;g<o;g++)for(var y=0;y<s;y++){var w=g*s+y<<2,M=v.off+((o-1-g)*s+y<<2);v.file.data[M]=r[w+2],v.file.data[M+1]=r[w+1],v.file.data[M+2]=r[w],v.file.data[M+3]=r[w+3]}else for(var T=0;T<r.length;T++)v.file.data[v.off+T]=r[T];v.off+=u,UDOC.M.invert(l),this._trsf(l)},ToEMF.prototype.PutText=function(e,r,s){var o=r.length;(o&1)==1&&o++,this._check();var a=this._file,u=ToEMF.B.writeUint,l=ToEMF.B.writeInt,v=ToEMF.B.writeUshort,p=ToEMF.B.writeFloat,c=ToEMF._color(e.colr);c!=this._tclr&&(this._addRec("SETTEXTCOLOR",12),u(a.file,a.off,c),a.off+=4,this._tclr=c),this._setTool("f",[e.font.Tf,Math.round(e.font.Tfs*10)]);var _=10*(e.ctm[4]+this._curx),f=this._curh-10*e.ctm[5],g=Math.abs(e.ctm[1])>.05,y;g&&(y=e.ctm.slice(0),y[1]*=-1,y[2]*=-1,y[4]=_,y[5]=f,_=f=0,this._trsf(y));var w=8+16+12+4*6+16;this._addRec("EXTTEXTOUTW",w+o*2),a.off+=16,u(a.file,a.off,2),a.off+=4,p(a.file,a.off,31.25),a.off+=4,p(a.file,a.off,31.25),a.off+=4,l(a.file,a.off,Math.round(_)),a.off+=4,l(a.file,a.off,Math.round(f)),a.off+=4,u(a.file,a.off,r.length),a.off+=4,u(a.file,a.off,w),a.off+=4,u(a.file,a.off,0),a.off+=4,a.off+=16,u(a.file,a.off,0),a.off+=4;for(var M=0;M<r.length;M++)v(a.file,a.off+M*2,r.charCodeAt(M));a.off+=2*o,g&&(UDOC.M.invert(y),this._trsf(y))},ToEMF.prototype.ShowPage=function(){this._check()},ToEMF.prototype.Done=function(){this._check();var e=this._file,r=ToEMF.B.writeUint;this._addRec("EOF",20),r(e.file,e.off,0),e.off+=4,r(e.file,e.off,16),e.off+=4,r(e.file,e.off,20),e.off+=4,r(e.file,this._lenp,e.off),r(e.file,this._lenp+4,this._recs),r(e.file,this._lenp+8,this._tabl),this.buffer=e.file.data.buffer.slice(0,e.off)},ToEMF.prototype._check=function(){var e=this._file,r=this._stkf;r!=0&&(r==1&&this._addRec("STROKEPATH",24),r==2&&this._addRec("FILLPATH",24),r==3&&this._addRec("STROKEANDFILLPATH",24),e.off+=16,this._stkf=0)},ToEMF.prototype._addRec=function(e,r){var s=this._file,o=ToEMF.B.writeUint;this._recs++,o(s.file,s.off,ToEMF.C["EMR_"+e]),s.off+=4,o(s.file,s.off,r),s.off+=4},ToEMF.prototype._trsf=function(e){var r=this._file,s=ToEMF.B.writeInt;this._addRec("MODIFYWORLDTRANSFORM",36);for(var o=0;o<e.length;o++)ToEMF.B.writeFloat(r.file,r.off,e[o]),r.off+=4;s(r.file,r.off,2),r.off+=4},ToEMF._writeHeadBox=function(e,r){var s=e.off;e.off=8,ToEMF._writeBox(e,r);var o=1/72*25.4*100;ToEMF._writeBox(e,[0,0,Math.round((r[2]-r[0])*o),Math.round((r[3]-r[1])*o)]),e.off=s},ToEMF._writeBox=function(e,r){for(var s=0;s<4;s++)ToEMF.B.writeInt(e.file,e.off,r[s]),e.off+=4},ToEMF.prototype._draw=function(e,r){var s=this._file,o=ToEMF.B.writeUint,a=ToEMF.B.writeInt,u=e.pth,l=JSON.stringify(u);if(this._cpth!=l&&this._check(),r==1?this._setTool("p",[e.COLR,e.lwidth,e.ljoin]):this._setTool("b",[e.colr]),this._cpth==l)this._stkf+=r;else{var v={M:["MOVETOEX",1],L:["LINETO",1],C:["POLYBEZIERTO",3],Z:["CLOSEFIGURE",0]},p=0,c=u.cmds.length;this._addRec("BEGINPATH",8);for(var _=0;_<c;_++){var f=u.cmds[_],g=v[f];if(g==null)throw f+" e";for(var y=g[1]*2,w=g[0],M=8+4*y,T=1;_+T<c&&u.cmds[_+T]==f;)T++;var B=f=="C"||f=="L"&&T>1;B&&(y*=T,f=="L"&&(w="POLYLINETO"),M=8+20+4*y),this._addRec(w,M),B&&(s.off+=16,o(s.file,s.off,T*g[1]),s.off+=4,_+=T-1);for(var H=0;H<y;H+=2)a(s.file,s.off,Math.round(10*(u.crds[p]+this._curx))),s.off+=4,p++,a(s.file,s.off,Math.round(this._curh-10*u.crds[p])),s.off+=4,p++}this._addRec("ENDPATH",8),this._cpth=l,this._stkf=r}},ToEMF.prototype._setTool=function(e,r){var s=this._file,o=ToEMF.B.writeUint,a=ToEMF.B.writeInt,u=e+JSON.stringify(r),l=this._objs[u];if(l==null){if(l=this._objs[u]=this._tabl,this._tabl++,e=="b"&&this._addRec("CREATEBRUSHINDIRECT",24),e=="p"&&this._addRec("CREATEPEN",28),e=="f"&&this._addRec("EXTCREATEFONTINDIRECTW",104),o(s.file,s.off,l),s.off+=4,e=="b"||e=="p"){if(e=="p"){o(s.file,s.off,0),s.off+=4;var v=Math.round(r[1]*10);o(s.file,s.off,v),s.off+=4,o(s.file,s.off,v),s.off+=4}else o(s.file,s.off,0),s.off+=4;o(s.file,s.off,ToEMF._color(r[0])),s.off+=4,e=="b"&&(o(s.file,s.off,0),s.off+=4)}if(e=="f"){var p=r[0],c=p.toLowerCase().indexOf("bold")!=-1;p.endsWith("-Bold")&&(p=p.slice(0,p.length-5)),a(s.file,s.off,-r[1]),s.off+=4,s.off+=12,o(s.file,s.off,c?700:400),s.off+=4,o(s.file,s.off,0),s.off+=4,o(s.file,s.off,262151),s.off+=4;for(var _=0;_<p.length;_++)ToEMF.B.writeUshort(s.file,s.off+_*2,p.charCodeAt(_));s.off+=64}}this._curt[e]!=l&&(this._addRec("SELECTOBJECT",12),o(s.file,s.off,l),s.off+=4,this._curt[e]=l)},ToEMF._color=function(e){var r=Math.round(e[0]*255),s=Math.round(e[1]*255),o=Math.round(e[2]*255);return o<<16|s<<8|r<<0},ToEMF.B={uint8:new Uint8Array(4),writeShort:function(e,r,s){ToEMF.B.int16[0]=s,e.req(r,2);var o=ToEMF.B.uint8,a=e.data;a[r]=o[0],a[r+1]=o[1]},writeUshort:function(e,r,s){ToEMF.B.uint16[0]=s,e.req(r,2);var o=ToEMF.B.uint8,a=e.data;a[r]=o[0],a[r+1]=o[1]},writeInt:function(e,r,s){ToEMF.B.int32[0]=s,e.req(r,4);var o=ToEMF.B.uint8,a=e.data;a[r]=o[0],a[r+1]=o[1],a[r+2]=o[2],a[r+3]=o[3]},writeUint:function(e,r,s){ToEMF.B.uint32[0]=s,e.req(r,4);var o=ToEMF.B.uint8,a=e.data;a[r]=o[0],a[r+1]=o[1],a[r+2]=o[2],a[r+3]=o[3]},writeFloat:function(e,r,s){ToEMF.B.flot32[0]=s,e.req(r,4);var o=ToEMF.B.uint8,a=e.data;a[r]=o[0],a[r+1]=o[1],a[r+2]=o[2],a[r+3]=o[3]},writeASCII:function(e,r,s){e.req(r,s.length);for(var o=0;o<s.length;o++)e.data[r+o]=s.charCodeAt(o)}},ToEMF.B.int16=new Int16Array(ToEMF.B.uint8.buffer),ToEMF.B.uint16=new Uint16Array(ToEMF.B.uint8.buffer),ToEMF.B.int32=new Int32Array(ToEMF.B.uint8.buffer),ToEMF.B.uint32=new Uint32Array(ToEMF.B.uint8.buffer),ToEMF.B.flot32=new Float32Array(ToEMF.B.uint8.buffer),ToEMF.MFile=function(){this.size=16,this.data=new Uint8Array(16)},ToEMF.MFile.prototype.req=function(e,r){if(!(e+r<=this.size)){for(var s=this.size;e+r>this.size;)this.size*=2;for(var o=new Uint8Array(this.size),a=0;a<s;a++)o[a]=this.data[a];this.data=o}},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 e,r,s;e=ToEMF.C,r=ToEMF.K,s=4;for(var o in e)r[e[o]]=o.slice(s)}(),function(e){if(typeof exports=="object"&&typeof module!="undefined")module.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r;r=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this,r.pako=e()}}(function(){return function e(r,s,o){function a(v,p){if(!s[v]){if(!r[v]){var c=typeof require=="function"&&require;if(!p&&c)return c(v,!0);if(u)return u(v,!0);var _=new Error("Cannot find module '"+v+"'");throw _.code="MODULE_NOT_FOUND",_}var f=s[v]={exports:{}};r[v][0].call(f.exports,function(g){var y=r[v][1][g];return a(y||g)},f,f.exports,e,r,s,o)}return s[v].exports}for(var u=typeof require=="function"&&require,l=0;l<o.length;l++)a(o[l]);return a}({1:[function(e,r,s){"use strict";function o(q){if(!(this instanceof o))return new o(q);this.options=p.assign({level:H,method:Q,chunkSize:16384,windowBits:15,memLevel:8,strategy:J,to:""},q||{});var O=this.options;O.raw&&O.windowBits>0?O.windowBits=-O.windowBits:O.gzip&&O.windowBits>0&&O.windowBits<16&&(O.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var K=v.deflateInit2(this.strm,O.level,O.method,O.windowBits,O.memLevel,O.strategy);if(K!==M)throw new Error(_[K]);if(O.header&&v.deflateSetHeader(this.strm,O.header),O.dictionary){var pe;if(pe=typeof O.dictionary=="string"?c.string2buf(O.dictionary):g.call(O.dictionary)==="[object ArrayBuffer]"?new Uint8Array(O.dictionary):O.dictionary,K=v.deflateSetDictionary(this.strm,pe),K!==M)throw new Error(_[K]);this._dict_set=!0}}function a(q,O){var K=new o(O);if(K.push(q,!0),K.err)throw K.msg||_[K.err];return K.result}function u(q,O){return O=O||{},O.raw=!0,a(q,O)}function l(q,O){return O=O||{},O.gzip=!0,a(q,O)}var v=e("./zlib/deflate"),p=e("./utils/common"),c=e("./utils/strings"),_=e("./zlib/messages"),f=e("./zlib/zstream"),g=Object.prototype.toString,y=0,w=4,M=0,T=1,B=2,H=-1,J=0,Q=8;o.prototype.push=function(q,O){var K,pe,R=this.strm,Te=this.options.chunkSize;if(this.ended)return!1;pe=O===~~O?O:O===!0?w:y,typeof q=="string"?R.input=c.string2buf(q):g.call(q)==="[object ArrayBuffer]"?R.input=new Uint8Array(q):R.input=q,R.next_in=0,R.avail_in=R.input.length;do{if(R.avail_out===0&&(R.output=new p.Buf8(Te),R.next_out=0,R.avail_out=Te),K=v.deflate(R,pe),K!==T&&K!==M)return this.onEnd(K),this.ended=!0,!1;R.avail_out!==0&&(R.avail_in!==0||pe!==w&&pe!==B)||(this.options.to==="string"?this.onData(c.buf2binstring(p.shrinkBuf(R.output,R.next_out))):this.onData(p.shrinkBuf(R.output,R.next_out)))}while((R.avail_in>0||R.avail_out===0)&&K!==T);return pe===w?(K=v.deflateEnd(this.strm),this.onEnd(K),this.ended=!0,K===M):pe!==B||(this.onEnd(M),R.avail_out=0,!0)},o.prototype.onData=function(q){this.chunks.push(q)},o.prototype.onEnd=function(q){q===M&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=p.flattenChunks(this.chunks)),this.chunks=[],this.err=q,this.msg=this.strm.msg},s.Deflate=o,s.deflate=a,s.deflateRaw=u,s.gzip=l},{"./utils/common":3,"./utils/strings":4,"./zlib/deflate":8,"./zlib/messages":13,"./zlib/zstream":15}],2:[function(e,r,s){"use strict";function o(w){if(!(this instanceof o))return new o(w);this.options=v.assign({chunkSize:16384,windowBits:0,to:""},w||{});var M=this.options;M.raw&&M.windowBits>=0&&M.windowBits<16&&(M.windowBits=-M.windowBits,M.windowBits===0&&(M.windowBits=-15)),!(M.windowBits>=0&&M.windowBits<16)||w&&w.windowBits||(M.windowBits+=32),M.windowBits>15&&M.windowBits<48&&(15&M.windowBits)==0&&(M.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var T=l.inflateInit2(this.strm,M.windowBits);if(T!==c.Z_OK)throw new Error(_[T]);this.header=new g,l.inflateGetHeader(this.strm,this.header)}function a(w,M){var T=new o(M);if(T.push(w,!0),T.err)throw T.msg||_[T.err];return T.result}function u(w,M){return M=M||{},M.raw=!0,a(w,M)}var l=e("./zlib/inflate"),v=e("./utils/common"),p=e("./utils/strings"),c=e("./zlib/constants"),_=e("./zlib/messages"),f=e("./zlib/zstream"),g=e("./zlib/gzheader"),y=Object.prototype.toString;o.prototype.push=function(w,M){var T,B,H,J,Q,q,O=this.strm,K=this.options.chunkSize,pe=this.options.dictionary,R=!1;if(this.ended)return!1;B=M===~~M?M:M===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof w=="string"?O.input=p.binstring2buf(w):y.call(w)==="[object ArrayBuffer]"?O.input=new Uint8Array(w):O.input=w,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new v.Buf8(K),O.next_out=0,O.avail_out=K),T=l.inflate(O,c.Z_NO_FLUSH),T===c.Z_NEED_DICT&&pe&&(q=typeof pe=="string"?p.string2buf(pe):y.call(pe)==="[object ArrayBuffer]"?new Uint8Array(pe):pe,T=l.inflateSetDictionary(this.strm,q)),T===c.Z_BUF_ERROR&&R===!0&&(T=c.Z_OK,R=!1),T!==c.Z_STREAM_END&&T!==c.Z_OK)return this.onEnd(T),this.ended=!0,!1;O.next_out&&(O.avail_out!==0&&T!==c.Z_STREAM_END&&(O.avail_in!==0||B!==c.Z_FINISH&&B!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(H=p.utf8border(O.output,O.next_out),J=O.next_out-H,Q=p.buf2string(O.output,H),O.next_out=J,O.avail_out=K-J,J&&v.arraySet(O.output,O.output,H,J,0),this.onData(Q)):this.onData(v.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(R=!0)}while((O.avail_in>0||O.avail_out===0)&&T!==c.Z_STREAM_END);return T===c.Z_STREAM_END&&(B=c.Z_FINISH),B===c.Z_FINISH?(T=l.inflateEnd(this.strm),this.onEnd(T),this.ended=!0,T===c.Z_OK):B!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),O.avail_out=0,!0)},o.prototype.onData=function(w){this.chunks.push(w)},o.prototype.onEnd=function(w){w===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=v.flattenChunks(this.chunks)),this.chunks=[],this.err=w,this.msg=this.strm.msg},s.Inflate=o,s.inflate=a,s.inflateRaw=u,s.ungzip=a},{"./utils/common":3,"./utils/strings":4,"./zlib/constants":6,"./zlib/gzheader":9,"./zlib/inflate":11,"./zlib/messages":13,"./zlib/zstream":15}],3:[function(e,r,s){"use strict";var o=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";s.assign=function(l){for(var v=Array.prototype.slice.call(arguments,1);v.length;){var p=v.shift();if(p){if(typeof p!="object")throw new TypeError(p+"must be non-object");for(var c in p)p.hasOwnProperty(c)&&(l[c]=p[c])}}return l},s.shrinkBuf=function(l,v){return l.length===v?l:l.subarray?l.subarray(0,v):(l.length=v,l)};var a={arraySet:function(l,v,p,c,_){if(v.subarray&&l.subarray)return void l.set(v.subarray(p,p+c),_);for(var f=0;f<c;f++)l[_+f]=v[p+f]},flattenChunks:function(l){var v,p,c,_,f,g;for(c=0,v=0,p=l.length;v<p;v++)c+=l[v].length;for(g=new Uint8Array(c),_=0,v=0,p=l.length;v<p;v++)f=l[v],g.set(f,_),_+=f.length;return g}},u={arraySet:function(l,v,p,c,_){for(var f=0;f<c;f++)l[_+f]=v[p+f]},flattenChunks:function(l){return[].concat.apply([],l)}};s.setTyped=function(l){l?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,a)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,u))},s.setTyped(o)},{}],4:[function(e,r,s){"use strict";function o(c,_){if(_<65537&&(c.subarray&&l||!c.subarray&&u))return String.fromCharCode.apply(null,a.shrinkBuf(c,_));for(var f="",g=0;g<_;g++)f+=String.fromCharCode(c[g]);return f}var a=e("./common"),u=!0,l=!0;try{String.fromCharCode.apply(null,[0])}catch(c){u=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(c){l=!1}for(var v=new a.Buf8(256),p=0;p<256;p++)v[p]=p>=252?6:p>=248?5:p>=240?4:p>=224?3:p>=192?2:1;v[254]=v[254]=1,s.string2buf=function(c){var _,f,g,y,w,M=c.length,T=0;for(y=0;y<M;y++)f=c.charCodeAt(y),(64512&f)==55296&&y+1<M&&(g=c.charCodeAt(y+1),(64512&g)==56320&&(f=65536+(f-55296<<10)+(g-56320),y++)),T+=f<128?1:f<2048?2:f<65536?3:4;for(_=new a.Buf8(T),w=0,y=0;w<T;y++)f=c.charCodeAt(y),(64512&f)==55296&&y+1<M&&(g=c.charCodeAt(y+1),(64512&g)==56320&&(f=65536+(f-55296<<10)+(g-56320),y++)),f<128?_[w++]=f:f<2048?(_[w++]=192|f>>>6,_[w++]=128|63&f):f<65536?(_[w++]=224|f>>>12,_[w++]=128|f>>>6&63,_[w++]=128|63&f):(_[w++]=240|f>>>18,_[w++]=128|f>>>12&63,_[w++]=128|f>>>6&63,_[w++]=128|63&f);return _},s.buf2binstring=function(c){return o(c,c.length)},s.binstring2buf=function(c){for(var _=new a.Buf8(c.length),f=0,g=_.length;f<g;f++)_[f]=c.charCodeAt(f);return _},s.buf2string=function(c,_){var f,g,y,w,M=_||c.length,T=new Array(2*M);for(g=0,f=0;f<M;)if(y=c[f++],y<128)T[g++]=y;else if(w=v[y],w>4)T[g++]=65533,f+=w-1;else{for(y&=w===2?31:w===3?15:7;w>1&&f<M;)y=y<<6|63&c[f++],w--;w>1?T[g++]=65533:y<65536?T[g++]=y:(y-=65536,T[g++]=55296|y>>10&1023,T[g++]=56320|1023&y)}return o(T,g)},s.utf8border=function(c,_){var f;for(_=_||c.length,_>c.length&&(_=c.length),f=_-1;f>=0&&(192&c[f])==128;)f--;return f<0||f===0?_:f+v[c[f]]>_?f:_}},{"./common":3}],5:[function(e,r,s){"use strict";function o(a,u,l,v){for(var p=65535&a|0,c=a>>>16&65535|0,_=0;l!==0;){_=l>2e3?2e3:l,l-=_;do p=p+u[v++]|0,c=c+p|0;while(--_);p%=65521,c%=65521}return p|c<<16|0}r.exports=o},{}],6:[function(e,r,s){"use strict";r.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(e,r,s){"use strict";function o(){for(var l,v=[],p=0;p<256;p++){l=p;for(var c=0;c<8;c++)l=1&l?3988292384^l>>>1:l>>>1;v[p]=l}return v}function a(l,v,p,c){var _=u,f=c+p;l^=-1;for(var g=c;g<f;g++)l=l>>>8^_[255&(l^v[g])];return l^-1}var u=o();r.exports=a},{}],8:[function(e,r,s){"use strict";function o(S,de){return S.msg=_e[de],de}function a(S){return(S<<1)-(S>4?9:0)}function u(S){for(var de=S.length;--de>=0;)S[de]=0}function l(S){var de=S.state,se=de.pending;se>S.avail_out&&(se=S.avail_out),se!==0&&(ue.arraySet(S.output,de.pending_buf,de.pending_out,se,S.next_out),S.next_out+=se,de.pending_out+=se,S.total_out+=se,S.avail_out-=se,de.pending-=se,de.pending===0&&(de.pending_out=0))}function v(S,de){$._tr_flush_block(S,S.block_start>=0?S.block_start:-1,S.strstart-S.block_start,de),S.block_start=S.strstart,l(S.strm)}function p(S,de){S.pending_buf[S.pending++]=de}function c(S,de){S.pending_buf[S.pending++]=de>>>8&255,S.pending_buf[S.pending++]=255&de}function _(S,de,se,ie){var ge=S.avail_in;return ge>ie&&(ge=ie),ge===0?0:(S.avail_in-=ge,ue.arraySet(de,S.input,S.next_in,ge,se),S.state.wrap===1?S.adler=ee(S.adler,de,ge,se):S.state.wrap===2&&(S.adler=ne(S.adler,de,ge,se)),S.next_in+=ge,S.total_in+=ge,ge)}function f(S,de){var se,ie,ge=S.max_chain_length,Pe=S.strstart,Ye=S.prev_length,Ge=S.nice_match,Ze=S.strstart>S.w_size-D?S.strstart-(S.w_size-D):0,Je=S.window,tt=S.w_mask,nt=S.prev,at=S.strstart+U,ut=Je[Pe+Ye-1],st=Je[Pe+Ye];S.prev_length>=S.good_match&&(ge>>=2),Ge>S.lookahead&&(Ge=S.lookahead);do if(se=de,Je[se+Ye]===st&&Je[se+Ye-1]===ut&&Je[se]===Je[Pe]&&Je[++se]===Je[Pe+1]){Pe+=2,se++;do;while(Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Je[++Pe]===Je[++se]&&Pe<at);if(ie=U-(at-Pe),Pe=at-U,ie>Ye){if(S.match_start=de,Ye=ie,ie>=Ge)break;ut=Je[Pe+Ye-1],st=Je[Pe+Ye]}}while((de=nt[de&tt])>Ze&&--ge!=0);return Ye<=S.lookahead?Ye:S.lookahead}function g(S){var de,se,ie,ge,Pe,Ye=S.w_size;do{if(ge=S.window_size-S.lookahead-S.strstart,S.strstart>=Ye+(Ye-D)){ue.arraySet(S.window,S.window,Ye,Ye,0),S.match_start-=Ye,S.strstart-=Ye,S.block_start-=Ye,se=S.hash_size,de=se;do ie=S.head[--de],S.head[de]=ie>=Ye?ie-Ye:0;while(--se);se=Ye,de=se;do ie=S.prev[--de],S.prev[de]=ie>=Ye?ie-Ye:0;while(--se);ge+=Ye}if(S.strm.avail_in===0)break;if(se=_(S.strm,S.window,S.strstart+S.lookahead,ge),S.lookahead+=se,S.lookahead+S.insert>=b)for(Pe=S.strstart-S.insert,S.ins_h=S.window[Pe],S.ins_h=(S.ins_h<<S.hash_shift^S.window[Pe+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[Pe+b-1])&S.hash_mask,S.prev[Pe&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=Pe,Pe++,S.insert--,!(S.lookahead+S.insert<b)););}while(S.lookahead<D&&S.strm.avail_in!==0)}function y(S,de){var se=65535;for(se>S.pending_buf_size-5&&(se=S.pending_buf_size-5);;){if(S.lookahead<=1){if(g(S),S.lookahead===0&&de===ae)return A;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var ie=S.block_start+se;if((S.strstart===0||S.strstart>=ie)&&(S.lookahead=S.strstart-ie,S.strstart=ie,v(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-D&&(v(S,!1),S.strm.avail_out===0))return A}return S.insert=0,de===Ae?(v(S,!0),S.strm.avail_out===0?I:te):(S.strstart>S.block_start&&(v(S,!1),S.strm.avail_out===0),A)}function w(S,de){for(var se,ie;;){if(S.lookahead<D){if(g(S),S.lookahead<D&&de===ae)return A;if(S.lookahead===0)break}if(se=0,S.lookahead>=b&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+b-1])&S.hash_mask,se=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),se!==0&&S.strstart-se<=S.w_size-D&&(S.match_length=f(S,se)),S.match_length>=b)if(ie=$._tr_tally(S,S.strstart-S.match_start,S.match_length-b),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=b){S.match_length--;do S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+b-1])&S.hash_mask,se=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart;while(--S.match_length!=0);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else ie=$._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(ie&&(v(S,!1),S.strm.avail_out===0))return A}return S.insert=S.strstart<b-1?S.strstart:b-1,de===Ae?(v(S,!0),S.strm.avail_out===0?I:te):S.last_lit&&(v(S,!1),S.strm.avail_out===0)?A:N}function M(S,de){for(var se,ie,ge;;){if(S.lookahead<D){if(g(S),S.lookahead<D&&de===ae)return A;if(S.lookahead===0)break}if(se=0,S.lookahead>=b&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+b-1])&S.hash_mask,se=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=b-1,se!==0&&S.prev_length<S.max_lazy_match&&S.strstart-se<=S.w_size-D&&(S.match_length=f(S,se),S.match_length<=5&&(S.strategy===Ce||S.match_length===b&&S.strstart-S.match_start>4096)&&(S.match_length=b-1)),S.prev_length>=b&&S.match_length<=S.prev_length){ge=S.strstart+S.lookahead-b,ie=$._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-b),S.lookahead-=S.prev_length-1,S.prev_length-=2;do++S.strstart<=ge&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+b-1])&S.hash_mask,se=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart);while(--S.prev_length!=0);if(S.match_available=0,S.match_length=b-1,S.strstart++,ie&&(v(S,!1),S.strm.avail_out===0))return A}else if(S.match_available){if(ie=$._tr_tally(S,0,S.window[S.strstart-1]),ie&&v(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return A}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(ie=$._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<b-1?S.strstart:b-1,de===Ae?(v(S,!0),S.strm.avail_out===0?I:te):S.last_lit&&(v(S,!1),S.strm.avail_out===0)?A:N}function T(S,de){for(var se,ie,ge,Pe,Ye=S.window;;){if(S.lookahead<=U){if(g(S),S.lookahead<=U&&de===ae)return A;if(S.lookahead===0)break}if(S.match_length=0,S.lookahead>=b&&S.strstart>0&&(ge=S.strstart-1,ie=Ye[ge],ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge])){Pe=S.strstart+U;do;while(ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge]&&ie===Ye[++ge]&&ge<Pe);S.match_length=U-(Pe-ge),S.match_length>S.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=b?(se=$._tr_tally(S,1,S.match_length-b),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(se=$._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),se&&(v(S,!1),S.strm.avail_out===0))return A}return S.insert=0,de===Ae?(v(S,!0),S.strm.avail_out===0?I:te):S.last_lit&&(v(S,!1),S.strm.avail_out===0)?A:N}function B(S,de){for(var se;;){if(S.lookahead===0&&(g(S),S.lookahead===0)){if(de===ae)return A;break}if(S.match_length=0,se=$._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,se&&(v(S,!1),S.strm.avail_out===0))return A}return S.insert=0,de===Ae?(v(S,!0),S.strm.avail_out===0?I:te):S.last_lit&&(v(S,!1),S.strm.avail_out===0)?A:N}function H(S,de,se,ie,ge){this.good_length=S,this.max_lazy=de,this.nice_length=se,this.max_chain=ie,this.func=ge}function J(S){S.window_size=2*S.w_size,u(S.head),S.max_lazy_match=me[S.level].max_lazy,S.good_match=me[S.level].good_length,S.nice_match=me[S.level].nice_length,S.max_chain_length=me[S.level].max_chain,S.strstart=0,S.block_start=0,S.lookahead=0,S.insert=0,S.match_length=S.prev_length=b-1,S.match_available=0,S.ins_h=0}function Q(){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=Le,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 ue.Buf16(2*E),this.dyn_dtree=new ue.Buf16(2*(2*d+1)),this.bl_tree=new ue.Buf16(2*(2*x+1)),u(this.dyn_ltree),u(this.dyn_dtree),u(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ue.Buf16(C+1),this.heap=new ue.Buf16(2*h+1),u(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ue.Buf16(2*h+1),u(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 q(S){var de;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=Re,de=S.state,de.pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?Z:G,S.adler=de.wrap===2?0:1,de.last_flush=ae,$._tr_init(de),De):o(S,ye)}function O(S){var de=q(S);return de===De&&J(S.state),de}function K(S,de){return S&&S.state?S.state.wrap!==2?ye:(S.state.gzhead=de,De):ye}function pe(S,de,se,ie,ge,Pe){if(!S)return ye;var Ye=1;if(de===le&&(de=6),ie<0?(Ye=0,ie=-ie):ie>15&&(Ye=2,ie-=16),ge<1||ge>Oe||se!==Le||ie<8||ie>15||de<0||de>9||Pe<0||Pe>xe)return o(S,ye);ie===8&&(ie=9);var Ge=new Q;return S.state=Ge,Ge.strm=S,Ge.wrap=Ye,Ge.gzhead=null,Ge.w_bits=ie,Ge.w_size=1<<Ge.w_bits,Ge.w_mask=Ge.w_size-1,Ge.hash_bits=ge+7,Ge.hash_size=1<<Ge.hash_bits,Ge.hash_mask=Ge.hash_size-1,Ge.hash_shift=~~((Ge.hash_bits+b-1)/b),Ge.window=new ue.Buf8(2*Ge.w_size),Ge.head=new ue.Buf16(Ge.hash_size),Ge.prev=new ue.Buf16(Ge.w_size),Ge.lit_bufsize=1<<ge+6,Ge.pending_buf_size=4*Ge.lit_bufsize,Ge.pending_buf=new ue.Buf8(Ge.pending_buf_size),Ge.d_buf=1*Ge.lit_bufsize,Ge.l_buf=3*Ge.lit_bufsize,Ge.level=de,Ge.strategy=Pe,Ge.method=se,O(S)}function R(S,de){return pe(S,de,Le,Ve,Xe,Ie)}function Te(S,de){var se,ie,ge,Pe;if(!S||!S.state||de>Fe||de<0)return S?o(S,ye):ye;if(ie=S.state,!S.output||!S.input&&S.avail_in!==0||ie.status===X&&de!==Ae)return o(S,S.avail_out===0?ke:ye);if(ie.strm=S,se=ie.last_flush,ie.last_flush=de,ie.status===Z)if(ie.wrap===2)S.adler=0,p(ie,31),p(ie,139),p(ie,8),ie.gzhead?(p(ie,(ie.gzhead.text?1:0)+(ie.gzhead.hcrc?2:0)+(ie.gzhead.extra?4:0)+(ie.gzhead.name?8:0)+(ie.gzhead.comment?16:0)),p(ie,255&ie.gzhead.time),p(ie,ie.gzhead.time>>8&255),p(ie,ie.gzhead.time>>16&255),p(ie,ie.gzhead.time>>24&255),p(ie,ie.level===9?2:ie.strategy>=Be||ie.level<2?4:0),p(ie,255&ie.gzhead.os),ie.gzhead.extra&&ie.gzhead.extra.length&&(p(ie,255&ie.gzhead.extra.length),p(ie,ie.gzhead.extra.length>>8&255)),ie.gzhead.hcrc&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending,0)),ie.gzindex=0,ie.status=Y):(p(ie,0),p(ie,0),p(ie,0),p(ie,0),p(ie,0),p(ie,ie.level===9?2:ie.strategy>=Be||ie.level<2?4:0),p(ie,fe),ie.status=G);else{var Ye=Le+(ie.w_bits-8<<4)<<8,Ge=-1;Ge=ie.strategy>=Be||ie.level<2?0:ie.level<6?1:ie.level===6?2:3,Ye|=Ge<<6,ie.strstart!==0&&(Ye|=k),Ye+=31-Ye%31,ie.status=G,c(ie,Ye),ie.strstart!==0&&(c(ie,S.adler>>>16),c(ie,65535&S.adler)),S.adler=1}if(ie.status===Y)if(ie.gzhead.extra){for(ge=ie.pending;ie.gzindex<(65535&ie.gzhead.extra.length)&&(ie.pending!==ie.pending_buf_size||(ie.gzhead.hcrc&&ie.pending>ge&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending-ge,ge)),l(S),ge=ie.pending,ie.pending!==ie.pending_buf_size));)p(ie,255&ie.gzhead.extra[ie.gzindex]),ie.gzindex++;ie.gzhead.hcrc&&ie.pending>ge&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending-ge,ge)),ie.gzindex===ie.gzhead.extra.length&&(ie.gzindex=0,ie.status=W)}else ie.status=W;if(ie.status===W)if(ie.gzhead.name){ge=ie.pending;do{if(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>ge&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending-ge,ge)),l(S),ge=ie.pending,ie.pending===ie.pending_buf_size)){Pe=1;break}Pe=ie.gzindex<ie.gzhead.name.length?255&ie.gzhead.name.charCodeAt(ie.gzindex++):0,p(ie,Pe)}while(Pe!==0);ie.gzhead.hcrc&&ie.pending>ge&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending-ge,ge)),Pe===0&&(ie.gzindex=0,ie.status=F)}else ie.status=F;if(ie.status===F)if(ie.gzhead.comment){ge=ie.pending;do{if(ie.pending===ie.pending_buf_size&&(ie.gzhead.hcrc&&ie.pending>ge&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending-ge,ge)),l(S),ge=ie.pending,ie.pending===ie.pending_buf_size)){Pe=1;break}Pe=ie.gzindex<ie.gzhead.comment.length?255&ie.gzhead.comment.charCodeAt(ie.gzindex++):0,p(ie,Pe)}while(Pe!==0);ie.gzhead.hcrc&&ie.pending>ge&&(S.adler=ne(S.adler,ie.pending_buf,ie.pending-ge,ge)),Pe===0&&(ie.status=z)}else ie.status=z;if(ie.status===z&&(ie.gzhead.hcrc?(ie.pending+2>ie.pending_buf_size&&l(S),ie.pending+2<=ie.pending_buf_size&&(p(ie,255&S.adler),p(ie,S.adler>>8&255),S.adler=0,ie.status=G)):ie.status=G),ie.pending!==0){if(l(S),S.avail_out===0)return ie.last_flush=-1,De}else if(S.avail_in===0&&a(de)<=a(se)&&de!==Ae)return o(S,ke);if(ie.status===X&&S.avail_in!==0)return o(S,ke);if(S.avail_in!==0||ie.lookahead!==0||de!==ae&&ie.status!==X){var Ze=ie.strategy===Be?B(ie,de):ie.strategy===we?T(ie,de):me[ie.level].func(ie,de);if(Ze!==I&&Ze!==te||(ie.status=X),Ze===A||Ze===I)return S.avail_out===0&&(ie.last_flush=-1),De;if(Ze===N&&(de===Me?$._tr_align(ie):de!==Fe&&($._tr_stored_block(ie,0,0,!1),de===Ne&&(u(ie.head),ie.lookahead===0&&(ie.strstart=0,ie.block_start=0,ie.insert=0))),l(S),S.avail_out===0))return ie.last_flush=-1,De}return de!==Ae?De:ie.wrap<=0?ze:(ie.wrap===2?(p(ie,255&S.adler),p(ie,S.adler>>8&255),p(ie,S.adler>>16&255),p(ie,S.adler>>24&255),p(ie,255&S.total_in),p(ie,S.total_in>>8&255),p(ie,S.total_in>>16&255),p(ie,S.total_in>>24&255)):(c(ie,S.adler>>>16),c(ie,65535&S.adler)),l(S),ie.wrap>0&&(ie.wrap=-ie.wrap),ie.pending!==0?De:ze)}function re(S){var de;return S&&S.state?(de=S.state.status,de!==Z&&de!==Y&&de!==W&&de!==F&&de!==z&&de!==G&&de!==X?o(S,ye):(S.state=null,de===G?o(S,he):De)):ye}function oe(S,de){var se,ie,ge,Pe,Ye,Ge,Ze,Je,tt=de.length;if(!S||!S.state||(se=S.state,Pe=se.wrap,Pe===2||Pe===1&&se.status!==Z||se.lookahead))return ye;for(Pe===1&&(S.adler=ee(S.adler,de,tt,0)),se.wrap=0,tt>=se.w_size&&(Pe===0&&(u(se.head),se.strstart=0,se.block_start=0,se.insert=0),Je=new ue.Buf8(se.w_size),ue.arraySet(Je,de,tt-se.w_size,se.w_size,0),de=Je,tt=se.w_size),Ye=S.avail_in,Ge=S.next_in,Ze=S.input,S.avail_in=tt,S.next_in=0,S.input=de,g(se);se.lookahead>=b;){ie=se.strstart,ge=se.lookahead-(b-1);do se.ins_h=(se.ins_h<<se.hash_shift^se.window[ie+b-1])&se.hash_mask,se.prev[ie&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=ie,ie++;while(--ge);se.strstart=ie,se.lookahead=b-1,g(se)}return se.strstart+=se.lookahead,se.block_start=se.strstart,se.insert=se.lookahead,se.lookahead=0,se.match_length=se.prev_length=b-1,se.match_available=0,S.next_in=Ge,S.input=Ze,S.avail_in=Ye,se.wrap=Pe,De}var me,ue=e("../utils/common"),$=e("./trees"),ee=e("./adler32"),ne=e("./crc32"),_e=e("./messages"),ae=0,Me=1,Ne=3,Ae=4,Fe=5,De=0,ze=1,ye=-2,he=-3,ke=-5,le=-1,Ce=1,Be=2,we=3,xe=4,Ie=0,Re=2,Le=8,Oe=9,Ve=15,Xe=8,We=29,t=256,h=t+1+We,d=30,x=19,E=2*h+1,C=15,b=3,U=258,D=U+b+1,k=32,Z=42,Y=69,W=73,F=91,z=103,G=113,X=666,A=1,N=2,I=3,te=4,fe=3;me=[new H(0,0,0,0,y),new H(4,4,8,4,w),new H(4,5,16,8,w),new H(4,6,32,32,w),new H(4,4,16,16,M),new H(8,16,32,32,M),new H(8,16,128,128,M),new H(8,32,128,256,M),new H(32,128,258,1024,M),new H(32,258,258,4096,M)],s.deflateInit=R,s.deflateInit2=pe,s.deflateReset=O,s.deflateResetKeep=q,s.deflateSetHeader=K,s.deflate=Te,s.deflateEnd=re,s.deflateSetDictionary=oe,s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./messages":13,"./trees":14}],9:[function(e,r,s){"use strict";function o(){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}r.exports=o},{}],10:[function(e,r,s){"use strict";var o=30,a=12;r.exports=function(u,l){var v,p,c,_,f,g,y,w,M,T,B,H,J,Q,q,O,K,pe,R,Te,re,oe,me,ue,$;v=u.state,p=u.next_in,ue=u.input,c=p+(u.avail_in-5),_=u.next_out,$=u.output,f=_-(l-u.avail_out),g=_+(u.avail_out-257),y=v.dmax,w=v.wsize,M=v.whave,T=v.wnext,B=v.window,H=v.hold,J=v.bits,Q=v.lencode,q=v.distcode,O=(1<<v.lenbits)-1,K=(1<<v.distbits)-1;e:do{J<15&&(H+=ue[p++]<<J,J+=8,H+=ue[p++]<<J,J+=8),pe=Q[H&O];r:for(;;){if(R=pe>>>24,H>>>=R,J-=R,R=pe>>>16&255,R===0)$[_++]=65535&pe;else{if(!(16&R)){if((64&R)==0){pe=Q[(65535&pe)+(H&(1<<R)-1)];continue r}if(32&R){v.mode=a;break e}u.msg="invalid literal/length code",v.mode=o;break e}Te=65535&pe,R&=15,R&&(J<R&&(H+=ue[p++]<<J,J+=8),Te+=H&(1<<R)-1,H>>>=R,J-=R),J<15&&(H+=ue[p++]<<J,J+=8,H+=ue[p++]<<J,J+=8),pe=q[H&K];t:for(;;){if(R=pe>>>24,H>>>=R,J-=R,R=pe>>>16&255,!(16&R)){if((64&R)==0){pe=q[(65535&pe)+(H&(1<<R)-1)];continue t}u.msg="invalid distance code",v.mode=o;break e}if(re=65535&pe,R&=15,J<R&&(H+=ue[p++]<<J,J+=8,J<R&&(H+=ue[p++]<<J,J+=8)),re+=H&(1<<R)-1,re>y){u.msg="invalid distance too far back",v.mode=o;break e}if(H>>>=R,J-=R,R=_-f,re>R){if(R=re-R,R>M&&v.sane){u.msg="invalid distance too far back",v.mode=o;break e}if(oe=0,me=B,T===0){if(oe+=w-R,R<Te){Te-=R;do $[_++]=B[oe++];while(--R);oe=_-re,me=$}}else if(T<R){if(oe+=w+T-R,R-=T,R<Te){Te-=R;do $[_++]=B[oe++];while(--R);if(oe=0,T<Te){R=T,Te-=R;do $[_++]=B[oe++];while(--R);oe=_-re,me=$}}}else if(oe+=T-R,R<Te){Te-=R;do $[_++]=B[oe++];while(--R);oe=_-re,me=$}for(;Te>2;)$[_++]=me[oe++],$[_++]=me[oe++],$[_++]=me[oe++],Te-=3;Te&&($[_++]=me[oe++],Te>1&&($[_++]=me[oe++]))}else{oe=_-re;do $[_++]=$[oe++],$[_++]=$[oe++],$[_++]=$[oe++],Te-=3;while(Te>2);Te&&($[_++]=$[oe++],Te>1&&($[_++]=$[oe++]))}break}}break}}while(p<c&&_<g);Te=J>>3,p-=Te,J-=Te<<3,H&=(1<<J)-1,u.next_in=p,u.next_out=_,u.avail_in=p<c?5+(c-p):5-(p-c),u.avail_out=_<g?257+(g-_):257-(_-g),v.hold=H,v.bits=J}},{}],11:[function(e,r,s){"use strict";function o(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)}function a(){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 H.Buf16(320),this.work=new H.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(A){var N;return A&&A.state?(N=A.state,A.total_in=A.total_out=N.total=0,A.msg="",N.wrap&&(A.adler=1&N.wrap),N.mode=Ne,N.last=0,N.havedict=0,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new H.Buf32(W),N.distcode=N.distdyn=new H.Buf32(F),N.sane=1,N.back=-1,me):ee}function l(A){var N;return A&&A.state?(N=A.state,N.wsize=0,N.whave=0,N.wnext=0,u(A)):ee}function v(A,N){var I,te;return A&&A.state?(te=A.state,N<0?(I=0,N=-N):(I=(N>>4)+1,N<48&&(N&=15)),N&&(N<8||N>15)?ee:(te.window!==null&&te.wbits!==N&&(te.window=null),te.wrap=I,te.wbits=N,l(A))):ee}function p(A,N){var I,te;return A?(te=new a,A.state=te,te.window=null,I=v(A,N),I!==me&&(A.state=null),I):ee}function c(A){return p(A,G)}function _(A){if(X){var N;for(T=new H.Buf32(512),B=new H.Buf32(32),N=0;N<144;)A.lens[N++]=8;for(;N<256;)A.lens[N++]=9;for(;N<280;)A.lens[N++]=7;for(;N<288;)A.lens[N++]=8;for(O(pe,A.lens,0,288,T,0,A.work,{bits:9}),N=0;N<32;)A.lens[N++]=5;O(R,A.lens,0,32,B,0,A.work,{bits:5}),X=!1}A.lencode=T,A.lenbits=9,A.distcode=B,A.distbits=5}function f(A,N,I,te){var fe,S=A.state;return S.window===null&&(S.wsize=1<<S.wbits,S.wnext=0,S.whave=0,S.window=new H.Buf8(S.wsize)),te>=S.wsize?(H.arraySet(S.window,N,I-S.wsize,S.wsize,0),S.wnext=0,S.whave=S.wsize):(fe=S.wsize-S.wnext,fe>te&&(fe=te),H.arraySet(S.window,N,I-te,fe,S.wnext),te-=fe,te?(H.arraySet(S.window,N,I-te,te,0),S.wnext=te,S.whave=S.wsize):(S.wnext+=fe,S.wnext===S.wsize&&(S.wnext=0),S.whave<S.wsize&&(S.whave+=fe))),0}function g(A,N){var I,te,fe,S,de,se,ie,ge,Pe,Ye,Ge,Ze,Je,tt,nt,at,ut,st,gt,ft,ct,_t,Et,mt,vt=0,lt=new H.Buf8(4),St=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!A||!A.state||!A.output||!A.input&&A.avail_in!==0)return ee;I=A.state,I.mode===we&&(I.mode=xe),de=A.next_out,fe=A.output,ie=A.avail_out,S=A.next_in,te=A.input,se=A.avail_in,ge=I.hold,Pe=I.bits,Ye=se,Ge=ie,_t=me;e:for(;;)switch(I.mode){case Ne:if(I.wrap===0){I.mode=xe;break}for(;Pe<16;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(2&I.wrap&&ge===35615){I.check=0,lt[0]=255&ge,lt[1]=ge>>>8&255,I.check=Q(I.check,lt,2,0),ge=0,Pe=0,I.mode=Ae;break}if(I.flags=0,I.head&&(I.head.done=!1),!(1&I.wrap)||(((255&ge)<<8)+(ge>>8))%31){A.msg="incorrect header check",I.mode=k;break}if((15&ge)!==Me){A.msg="unknown compression method",I.mode=k;break}if(ge>>>=4,Pe-=4,ct=(15&ge)+8,I.wbits===0)I.wbits=ct;else if(ct>I.wbits){A.msg="invalid window size",I.mode=k;break}I.dmax=1<<ct,A.adler=I.check=1,I.mode=512&ge?Ce:we,ge=0,Pe=0;break;case Ae:for(;Pe<16;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(I.flags=ge,(255&I.flags)!==Me){A.msg="unknown compression method",I.mode=k;break}if(57344&I.flags){A.msg="unknown header flags set",I.mode=k;break}I.head&&(I.head.text=ge>>8&1),512&I.flags&&(lt[0]=255&ge,lt[1]=ge>>>8&255,I.check=Q(I.check,lt,2,0)),ge=0,Pe=0,I.mode=Fe;case Fe:for(;Pe<32;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}I.head&&(I.head.time=ge),512&I.flags&&(lt[0]=255&ge,lt[1]=ge>>>8&255,lt[2]=ge>>>16&255,lt[3]=ge>>>24&255,I.check=Q(I.check,lt,4,0)),ge=0,Pe=0,I.mode=De;case De:for(;Pe<16;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}I.head&&(I.head.xflags=255&ge,I.head.os=ge>>8),512&I.flags&&(lt[0]=255&ge,lt[1]=ge>>>8&255,I.check=Q(I.check,lt,2,0)),ge=0,Pe=0,I.mode=ze;case ze:if(1024&I.flags){for(;Pe<16;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}I.length=ge,I.head&&(I.head.extra_len=ge),512&I.flags&&(lt[0]=255&ge,lt[1]=ge>>>8&255,I.check=Q(I.check,lt,2,0)),ge=0,Pe=0}else I.head&&(I.head.extra=null);I.mode=ye;case ye:if(1024&I.flags&&(Ze=I.length,Ze>se&&(Ze=se),Ze&&(I.head&&(ct=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Array(I.head.extra_len)),H.arraySet(I.head.extra,te,S,Ze,ct)),512&I.flags&&(I.check=Q(I.check,te,Ze,S)),se-=Ze,S+=Ze,I.length-=Ze),I.length))break e;I.length=0,I.mode=he;case he:if(2048&I.flags){if(se===0)break e;Ze=0;do ct=te[S+Ze++],I.head&&ct&&I.length<65536&&(I.head.name+=String.fromCharCode(ct));while(ct&&Ze<se);if(512&I.flags&&(I.check=Q(I.check,te,Ze,S)),se-=Ze,S+=Ze,ct)break e}else I.head&&(I.head.name=null);I.length=0,I.mode=ke;case ke:if(4096&I.flags){if(se===0)break e;Ze=0;do ct=te[S+Ze++],I.head&&ct&&I.length<65536&&(I.head.comment+=String.fromCharCode(ct));while(ct&&Ze<se);if(512&I.flags&&(I.check=Q(I.check,te,Ze,S)),se-=Ze,S+=Ze,ct)break e}else I.head&&(I.head.comment=null);I.mode=le;case le:if(512&I.flags){for(;Pe<16;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(ge!==(65535&I.check)){A.msg="header crc mismatch",I.mode=k;break}ge=0,Pe=0}I.head&&(I.head.hcrc=I.flags>>9&1,I.head.done=!0),A.adler=I.check=0,I.mode=we;break;case Ce:for(;Pe<32;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}A.adler=I.check=o(ge),ge=0,Pe=0,I.mode=Be;case Be:if(I.havedict===0)return A.next_out=de,A.avail_out=ie,A.next_in=S,A.avail_in=se,I.hold=ge,I.bits=Pe,$;A.adler=I.check=1,I.mode=we;case we:if(N===re||N===oe)break e;case xe:if(I.last){ge>>>=7&Pe,Pe-=7&Pe,I.mode=b;break}for(;Pe<3;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}switch(I.last=1&ge,ge>>>=1,Pe-=1,3&ge){case 0:I.mode=Ie;break;case 1:if(_(I),I.mode=We,N===oe){ge>>>=2,Pe-=2;break e}break;case 2:I.mode=Oe;break;case 3:A.msg="invalid block type",I.mode=k}ge>>>=2,Pe-=2;break;case Ie:for(ge>>>=7&Pe,Pe-=7&Pe;Pe<32;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if((65535&ge)!=(ge>>>16^65535)){A.msg="invalid stored block lengths",I.mode=k;break}if(I.length=65535&ge,ge=0,Pe=0,I.mode=Re,N===oe)break e;case Re:I.mode=Le;case Le:if(Ze=I.length){if(Ze>se&&(Ze=se),Ze>ie&&(Ze=ie),Ze===0)break e;H.arraySet(fe,te,S,Ze,de),se-=Ze,S+=Ze,ie-=Ze,de+=Ze,I.length-=Ze;break}I.mode=we;break;case Oe:for(;Pe<14;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(I.nlen=(31&ge)+257,ge>>>=5,Pe-=5,I.ndist=(31&ge)+1,ge>>>=5,Pe-=5,I.ncode=(15&ge)+4,ge>>>=4,Pe-=4,I.nlen>286||I.ndist>30){A.msg="too many length or distance symbols",I.mode=k;break}I.have=0,I.mode=Ve;case Ve:for(;I.have<I.ncode;){for(;Pe<3;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}I.lens[St[I.have++]]=7&ge,ge>>>=3,Pe-=3}for(;I.have<19;)I.lens[St[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,Et={bits:I.lenbits},_t=O(K,I.lens,0,19,I.lencode,0,I.work,Et),I.lenbits=Et.bits,_t){A.msg="invalid code lengths set",I.mode=k;break}I.have=0,I.mode=Xe;case Xe:for(;I.have<I.nlen+I.ndist;){for(;vt=I.lencode[ge&(1<<I.lenbits)-1],nt=vt>>>24,at=vt>>>16&255,ut=65535&vt,!(nt<=Pe);){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(ut<16)ge>>>=nt,Pe-=nt,I.lens[I.have++]=ut;else{if(ut===16){for(mt=nt+2;Pe<mt;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(ge>>>=nt,Pe-=nt,I.have===0){A.msg="invalid bit length repeat",I.mode=k;break}ct=I.lens[I.have-1],Ze=3+(3&ge),ge>>>=2,Pe-=2}else if(ut===17){for(mt=nt+3;Pe<mt;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}ge>>>=nt,Pe-=nt,ct=0,Ze=3+(7&ge),ge>>>=3,Pe-=3}else{for(mt=nt+7;Pe<mt;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}ge>>>=nt,Pe-=nt,ct=0,Ze=11+(127&ge),ge>>>=7,Pe-=7}if(I.have+Ze>I.nlen+I.ndist){A.msg="invalid bit length repeat",I.mode=k;break}for(;Ze--;)I.lens[I.have++]=ct}}if(I.mode===k)break;if(I.lens[256]===0){A.msg="invalid code -- missing end-of-block",I.mode=k;break}if(I.lenbits=9,Et={bits:I.lenbits},_t=O(pe,I.lens,0,I.nlen,I.lencode,0,I.work,Et),I.lenbits=Et.bits,_t){A.msg="invalid literal/lengths set",I.mode=k;break}if(I.distbits=6,I.distcode=I.distdyn,Et={bits:I.distbits},_t=O(R,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,Et),I.distbits=Et.bits,_t){A.msg="invalid distances set",I.mode=k;break}if(I.mode=We,N===oe)break e;case We:I.mode=t;case t:if(se>=6&&ie>=258){A.next_out=de,A.avail_out=ie,A.next_in=S,A.avail_in=se,I.hold=ge,I.bits=Pe,q(A,Ge),de=A.next_out,fe=A.output,ie=A.avail_out,S=A.next_in,te=A.input,se=A.avail_in,ge=I.hold,Pe=I.bits,I.mode===we&&(I.back=-1);break}for(I.back=0;vt=I.lencode[ge&(1<<I.lenbits)-1],nt=vt>>>24,at=vt>>>16&255,ut=65535&vt,!(nt<=Pe);){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(at&&(240&at)==0){for(st=nt,gt=at,ft=ut;vt=I.lencode[ft+((ge&(1<<st+gt)-1)>>st)],nt=vt>>>24,at=vt>>>16&255,ut=65535&vt,!(st+nt<=Pe);){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}ge>>>=st,Pe-=st,I.back+=st}if(ge>>>=nt,Pe-=nt,I.back+=nt,I.length=ut,at===0){I.mode=C;break}if(32&at){I.back=-1,I.mode=we;break}if(64&at){A.msg="invalid literal/length code",I.mode=k;break}I.extra=15&at,I.mode=h;case h:if(I.extra){for(mt=I.extra;Pe<mt;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}I.length+=ge&(1<<I.extra)-1,ge>>>=I.extra,Pe-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=d;case d:for(;vt=I.distcode[ge&(1<<I.distbits)-1],nt=vt>>>24,at=vt>>>16&255,ut=65535&vt,!(nt<=Pe);){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if((240&at)==0){for(st=nt,gt=at,ft=ut;vt=I.distcode[ft+((ge&(1<<st+gt)-1)>>st)],nt=vt>>>24,at=vt>>>16&255,ut=65535&vt,!(st+nt<=Pe);){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}ge>>>=st,Pe-=st,I.back+=st}if(ge>>>=nt,Pe-=nt,I.back+=nt,64&at){A.msg="invalid distance code",I.mode=k;break}I.offset=ut,I.extra=15&at,I.mode=x;case x:if(I.extra){for(mt=I.extra;Pe<mt;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}I.offset+=ge&(1<<I.extra)-1,ge>>>=I.extra,Pe-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){A.msg="invalid distance too far back",I.mode=k;break}I.mode=E;case E:if(ie===0)break e;if(Ze=Ge-ie,I.offset>Ze){if(Ze=I.offset-Ze,Ze>I.whave&&I.sane){A.msg="invalid distance too far back",I.mode=k;break}Ze>I.wnext?(Ze-=I.wnext,Je=I.wsize-Ze):Je=I.wnext-Ze,Ze>I.length&&(Ze=I.length),tt=I.window}else tt=fe,Je=de-I.offset,Ze=I.length;Ze>ie&&(Ze=ie),ie-=Ze,I.length-=Ze;do fe[de++]=tt[Je++];while(--Ze);I.length===0&&(I.mode=t);break;case C:if(ie===0)break e;fe[de++]=I.length,ie--,I.mode=t;break;case b:if(I.wrap){for(;Pe<32;){if(se===0)break e;se--,ge|=te[S++]<<Pe,Pe+=8}if(Ge-=ie,A.total_out+=Ge,I.total+=Ge,Ge&&(A.adler=I.check=I.flags?Q(I.check,fe,Ge,de-Ge):J(I.check,fe,Ge,de-Ge)),Ge=ie,(I.flags?ge:o(ge))!==I.check){A.msg="incorrect data check",I.mode=k;break}ge=0,Pe=0}I.mode=U;case U:if(I.wrap&&I.flags){for(;Pe<32;){if(se===0)break e;se--,ge+=te[S++]<<Pe,Pe+=8}if(ge!==(4294967295&I.total)){A.msg="incorrect length check",I.mode=k;break}ge=0,Pe=0}I.mode=D;case D:_t=ue;break e;case k:_t=ne;break e;case Z:return _e;case Y:default:return ee}return A.next_out=de,A.avail_out=ie,A.next_in=S,A.avail_in=se,I.hold=ge,I.bits=Pe,(I.wsize||Ge!==A.avail_out&&I.mode<k&&(I.mode<b||N!==Te))&&f(A,A.output,A.next_out,Ge-A.avail_out)?(I.mode=Z,_e):(Ye-=A.avail_in,Ge-=A.avail_out,A.total_in+=Ye,A.total_out+=Ge,I.total+=Ge,I.wrap&&Ge&&(A.adler=I.check=I.flags?Q(I.check,fe,Ge,A.next_out-Ge):J(I.check,fe,Ge,A.next_out-Ge)),A.data_type=I.bits+(I.last?64:0)+(I.mode===we?128:0)+(I.mode===We||I.mode===Re?256:0),(Ye===0&&Ge===0||N===Te)&&_t===me&&(_t=ae),_t)}function y(A){if(!A||!A.state)return ee;var N=A.state;return N.window&&(N.window=null),A.state=null,me}function w(A,N){var I;return A&&A.state?(I=A.state,(2&I.wrap)==0?ee:(I.head=N,N.done=!1,me)):ee}function M(A,N){var I,te,fe,S=N.length;return A&&A.state?(I=A.state,I.wrap!==0&&I.mode!==Be?ee:I.mode===Be&&(te=1,te=J(te,N,S,0),te!==I.check)?ne:(fe=f(A,N,S,S))?(I.mode=Z,_e):(I.havedict=1,me)):ee}var T,B,H=e("../utils/common"),J=e("./adler32"),Q=e("./crc32"),q=e("./inffast"),O=e("./inftrees"),K=0,pe=1,R=2,Te=4,re=5,oe=6,me=0,ue=1,$=2,ee=-2,ne=-3,_e=-4,ae=-5,Me=8,Ne=1,Ae=2,Fe=3,De=4,ze=5,ye=6,he=7,ke=8,le=9,Ce=10,Be=11,we=12,xe=13,Ie=14,Re=15,Le=16,Oe=17,Ve=18,Xe=19,We=20,t=21,h=22,d=23,x=24,E=25,C=26,b=27,U=28,D=29,k=30,Z=31,Y=32,W=852,F=592,z=15,G=z,X=!0;s.inflateReset=l,s.inflateReset2=v,s.inflateResetKeep=u,s.inflateInit=c,s.inflateInit2=p,s.inflate=g,s.inflateEnd=y,s.inflateGetHeader=w,s.inflateSetDictionary=M,s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":3,"./adler32":5,"./crc32":7,"./inffast":10,"./inftrees":12}],12:[function(e,r,s){"use strict";var o=e("../utils/common"),a=15,u=852,l=592,v=0,p=1,c=2,_=[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],g=[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],y=[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];r.exports=function(w,M,T,B,H,J,Q,q){var O,K,pe,R,Te,re,oe,me,ue,$=q.bits,ee=0,ne=0,_e=0,ae=0,Me=0,Ne=0,Ae=0,Fe=0,De=0,ze=0,ye=null,he=0,ke=new o.Buf16(a+1),le=new o.Buf16(a+1),Ce=null,Be=0;for(ee=0;ee<=a;ee++)ke[ee]=0;for(ne=0;ne<B;ne++)ke[M[T+ne]]++;for(Me=$,ae=a;ae>=1&&ke[ae]===0;ae--);if(Me>ae&&(Me=ae),ae===0)return H[J++]=20971520,H[J++]=20971520,q.bits=1,0;for(_e=1;_e<ae&&ke[_e]===0;_e++);for(Me<_e&&(Me=_e),Fe=1,ee=1;ee<=a;ee++)if(Fe<<=1,Fe-=ke[ee],Fe<0)return-1;if(Fe>0&&(w===v||ae!==1))return-1;for(le[1]=0,ee=1;ee<a;ee++)le[ee+1]=le[ee]+ke[ee];for(ne=0;ne<B;ne++)M[T+ne]!==0&&(Q[le[M[T+ne]]++]=ne);if(w===v?(ye=Ce=Q,re=19):w===p?(ye=_,he-=257,Ce=f,Be-=257,re=256):(ye=g,Ce=y,re=-1),ze=0,ne=0,ee=_e,Te=J,Ne=Me,Ae=0,pe=-1,De=1<<Me,R=De-1,w===p&&De>u||w===c&&De>l)return 1;for(;;){oe=ee-Ae,Q[ne]<re?(me=0,ue=Q[ne]):Q[ne]>re?(me=Ce[Be+Q[ne]],ue=ye[he+Q[ne]]):(me=96,ue=0),O=1<<ee-Ae,K=1<<Ne,_e=K;do K-=O,H[Te+(ze>>Ae)+K]=oe<<24|me<<16|ue|0;while(K!==0);for(O=1<<ee-1;ze&O;)O>>=1;if(O!==0?(ze&=O-1,ze+=O):ze=0,ne++,--ke[ee]==0){if(ee===ae)break;ee=M[T+Q[ne]]}if(ee>Me&&(ze&R)!==pe){for(Ae===0&&(Ae=Me),Te+=_e,Ne=ee-Ae,Fe=1<<Ne;Ne+Ae<ae&&(Fe-=ke[Ne+Ae],!(Fe<=0));)Ne++,Fe<<=1;if(De+=1<<Ne,w===p&&De>u||w===c&&De>l)return 1;pe=ze&R,H[pe]=Me<<24|Ne<<16|Te-J|0}}return ze!==0&&(H[Te+ze]=ee-Ae<<24|64<<16|0),q.bits=Me,0}},{"../utils/common":3}],13:[function(e,r,s){"use strict";r.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(e,r,s){"use strict";function o(F){for(var z=F.length;--z>=0;)F[z]=0}function a(F,z,G,X,A){this.static_tree=F,this.extra_bits=z,this.extra_base=G,this.elems=X,this.max_length=A,this.has_stree=F&&F.length}function u(F,z){this.dyn_tree=F,this.max_code=0,this.stat_desc=z}function l(F){return F<256?C[F]:C[256+(F>>>7)]}function v(F,z){F.pending_buf[F.pending++]=255&z,F.pending_buf[F.pending++]=z>>>8&255}function p(F,z,G){F.bi_valid>xe-G?(F.bi_buf|=z<<F.bi_valid&65535,v(F,F.bi_buf),F.bi_buf=z>>xe-F.bi_valid,F.bi_valid+=G-xe):(F.bi_buf|=z<<F.bi_valid&65535,F.bi_valid+=G)}function c(F,z,G){p(F,G[2*z],G[2*z+1])}function _(F,z){var G=0;do G|=1&F,F>>>=1,G<<=1;while(--z>0);return G>>>1}function f(F){F.bi_valid===16?(v(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):F.bi_valid>=8&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)}function g(F,z){var G,X,A,N,I,te,fe=z.dyn_tree,S=z.max_code,de=z.stat_desc.static_tree,se=z.stat_desc.has_stree,ie=z.stat_desc.extra_bits,ge=z.stat_desc.extra_base,Pe=z.stat_desc.max_length,Ye=0;for(N=0;N<=we;N++)F.bl_count[N]=0;for(fe[2*F.heap[F.heap_max]+1]=0,G=F.heap_max+1;G<Be;G++)X=F.heap[G],N=fe[2*fe[2*X+1]+1]+1,N>Pe&&(N=Pe,Ye++),fe[2*X+1]=N,X>S||(F.bl_count[N]++,I=0,X>=ge&&(I=ie[X-ge]),te=fe[2*X],F.opt_len+=te*(N+I),se&&(F.static_len+=te*(de[2*X+1]+I)));if(Ye!==0){do{for(N=Pe-1;F.bl_count[N]===0;)N--;F.bl_count[N]--,F.bl_count[N+1]+=2,F.bl_count[Pe]--,Ye-=2}while(Ye>0);for(N=Pe;N!==0;N--)for(X=F.bl_count[N];X!==0;)A=F.heap[--G],A>S||(fe[2*A+1]!==N&&(F.opt_len+=(N-fe[2*A+1])*fe[2*A],fe[2*A+1]=N),X--)}}function y(F,z,G){var X,A,N=new Array(we+1),I=0;for(X=1;X<=we;X++)N[X]=I=I+G[X-1]<<1;for(A=0;A<=z;A++){var te=F[2*A+1];te!==0&&(F[2*A]=_(N[te]++,te))}}function w(){var F,z,G,X,A,N=new Array(we+1);for(G=0,X=0;X<ye-1;X++)for(U[X]=G,F=0;F<1<<Xe[X];F++)b[G++]=X;for(b[G-1]=X,A=0,X=0;X<16;X++)for(D[X]=A,F=0;F<1<<We[X];F++)C[A++]=X;for(A>>=7;X<le;X++)for(D[X]=A<<7,F=0;F<1<<We[X]-7;F++)C[256+A++]=X;for(z=0;z<=we;z++)N[z]=0;for(F=0;F<=143;)x[2*F+1]=8,F++,N[8]++;for(;F<=255;)x[2*F+1]=9,F++,N[9]++;for(;F<=279;)x[2*F+1]=7,F++,N[7]++;for(;F<=287;)x[2*F+1]=8,F++,N[8]++;for(y(x,ke+1,N),F=0;F<le;F++)E[2*F+1]=5,E[2*F]=_(F,5);k=new a(x,Xe,he+1,ke,we),Z=new a(E,We,0,le,we),Y=new a(new Array(0),t,0,Ce,Ie)}function M(F){var z;for(z=0;z<ke;z++)F.dyn_ltree[2*z]=0;for(z=0;z<le;z++)F.dyn_dtree[2*z]=0;for(z=0;z<Ce;z++)F.bl_tree[2*z]=0;F.dyn_ltree[2*Re]=1,F.opt_len=F.static_len=0,F.last_lit=F.matches=0}function T(F){F.bi_valid>8?v(F,F.bi_buf):F.bi_valid>0&&(F.pending_buf[F.pending++]=F.bi_buf),F.bi_buf=0,F.bi_valid=0}function B(F,z,G,X){T(F),X&&(v(F,G),v(F,~G)),ee.arraySet(F.pending_buf,F.window,z,G,F.pending),F.pending+=G}function H(F,z,G,X){var A=2*z,N=2*G;return F[A]<F[N]||F[A]===F[N]&&X[z]<=X[G]}function J(F,z,G){for(var X=F.heap[G],A=G<<1;A<=F.heap_len&&(A<F.heap_len&&H(z,F.heap[A+1],F.heap[A],F.depth)&&A++,!H(z,X,F.heap[A],F.depth));)F.heap[G]=F.heap[A],G=A,A<<=1;F.heap[G]=X}function Q(F,z,G){var X,A,N,I,te=0;if(F.last_lit!==0)do X=F.pending_buf[F.d_buf+2*te]<<8|F.pending_buf[F.d_buf+2*te+1],A=F.pending_buf[F.l_buf+te],te++,X===0?c(F,A,z):(N=b[A],c(F,N+he+1,z),I=Xe[N],I!==0&&(A-=U[N],p(F,A,I)),X--,N=l(X),c(F,N,G),I=We[N],I!==0&&(X-=D[N],p(F,X,I)));while(te<F.last_lit);c(F,Re,z)}function q(F,z){var G,X,A,N=z.dyn_tree,I=z.stat_desc.static_tree,te=z.stat_desc.has_stree,fe=z.stat_desc.elems,S=-1;for(F.heap_len=0,F.heap_max=Be,G=0;G<fe;G++)N[2*G]!==0?(F.heap[++F.heap_len]=S=G,F.depth[G]=0):N[2*G+1]=0;for(;F.heap_len<2;)A=F.heap[++F.heap_len]=S<2?++S:0,N[2*A]=1,F.depth[A]=0,F.opt_len--,te&&(F.static_len-=I[2*A+1]);for(z.max_code=S,G=F.heap_len>>1;G>=1;G--)J(F,N,G);A=fe;do G=F.heap[1],F.heap[1]=F.heap[F.heap_len--],J(F,N,1),X=F.heap[1],F.heap[--F.heap_max]=G,F.heap[--F.heap_max]=X,N[2*A]=N[2*G]+N[2*X],F.depth[A]=(F.depth[G]>=F.depth[X]?F.depth[G]:F.depth[X])+1,N[2*G+1]=N[2*X+1]=A,F.heap[1]=A++,J(F,N,1);while(F.heap_len>=2);F.heap[--F.heap_max]=F.heap[1],g(F,z),y(N,S,F.bl_count)}function O(F,z,G){var X,A,N=-1,I=z[1],te=0,fe=7,S=4;for(I===0&&(fe=138,S=3),z[2*(G+1)+1]=65535,X=0;X<=G;X++)A=I,I=z[2*(X+1)+1],++te<fe&&A===I||(te<S?F.bl_tree[2*A]+=te:A!==0?(A!==N&&F.bl_tree[2*A]++,F.bl_tree[2*Le]++):te<=10?F.bl_tree[2*Oe]++:F.bl_tree[2*Ve]++,te=0,N=A,I===0?(fe=138,S=3):A===I?(fe=6,S=3):(fe=7,S=4))}function K(F,z,G){var X,A,N=-1,I=z[1],te=0,fe=7,S=4;for(I===0&&(fe=138,S=3),X=0;X<=G;X++)if(A=I,I=z[2*(X+1)+1],!(++te<fe&&A===I)){if(te<S)do c(F,A,F.bl_tree);while(--te!=0);else A!==0?(A!==N&&(c(F,A,F.bl_tree),te--),c(F,Le,F.bl_tree),p(F,te-3,2)):te<=10?(c(F,Oe,F.bl_tree),p(F,te-3,3)):(c(F,Ve,F.bl_tree),p(F,te-11,7));te=0,N=A,I===0?(fe=138,S=3):A===I?(fe=6,S=3):(fe=7,S=4)}}function pe(F){var z;for(O(F,F.dyn_ltree,F.l_desc.max_code),O(F,F.dyn_dtree,F.d_desc.max_code),q(F,F.bl_desc),z=Ce-1;z>=3&&F.bl_tree[2*h[z]+1]===0;z--);return F.opt_len+=3*(z+1)+5+5+4,z}function R(F,z,G,X){var A;for(p(F,z-257,5),p(F,G-1,5),p(F,X-4,4),A=0;A<X;A++)p(F,F.bl_tree[2*h[A]+1],3);K(F,F.dyn_ltree,z-1),K(F,F.dyn_dtree,G-1)}function Te(F){var z,G=4093624447;for(z=0;z<=31;z++,G>>>=1)if(1&G&&F.dyn_ltree[2*z]!==0)return _e;if(F.dyn_ltree[18]!==0||F.dyn_ltree[20]!==0||F.dyn_ltree[26]!==0)return ae;for(z=32;z<he;z++)if(F.dyn_ltree[2*z]!==0)return ae;return _e}function re(F){W||(w(),W=!0),F.l_desc=new u(F.dyn_ltree,k),F.d_desc=new u(F.dyn_dtree,Z),F.bl_desc=new u(F.bl_tree,Y),F.bi_buf=0,F.bi_valid=0,M(F)}function oe(F,z,G,X){p(F,(Ne<<1)+(X?1:0),3),B(F,z,G,!0)}function me(F){p(F,Ae<<1,3),c(F,Re,x),f(F)}function ue(F,z,G,X){var A,N,I=0;F.level>0?(F.strm.data_type===Me&&(F.strm.data_type=Te(F)),q(F,F.l_desc),q(F,F.d_desc),I=pe(F),A=F.opt_len+3+7>>>3,N=F.static_len+3+7>>>3,N<=A&&(A=N)):A=N=G+5,G+4<=A&&z!==-1?oe(F,z,G,X):F.strategy===ne||N===A?(p(F,(Ae<<1)+(X?1:0),3),Q(F,x,E)):(p(F,(Fe<<1)+(X?1:0),3),R(F,F.l_desc.max_code+1,F.d_desc.max_code+1,I+1),Q(F,F.dyn_ltree,F.dyn_dtree)),M(F),X&&T(F)}function $(F,z,G){return F.pending_buf[F.d_buf+2*F.last_lit]=z>>>8&255,F.pending_buf[F.d_buf+2*F.last_lit+1]=255&z,F.pending_buf[F.l_buf+F.last_lit]=255&G,F.last_lit++,z===0?F.dyn_ltree[2*G]++:(F.matches++,z--,F.dyn_ltree[2*(b[G]+he+1)]++,F.dyn_dtree[2*l(z)]++),F.last_lit===F.lit_bufsize-1}var ee=e("../utils/common"),ne=4,_e=0,ae=1,Me=2,Ne=0,Ae=1,Fe=2,De=3,ze=258,ye=29,he=256,ke=he+1+ye,le=30,Ce=19,Be=2*ke+1,we=15,xe=16,Ie=7,Re=256,Le=16,Oe=17,Ve=18,Xe=[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],We=[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],t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=512,x=new Array(2*(ke+2));o(x);var E=new Array(2*le);o(E);var C=new Array(d);o(C);var b=new Array(ze-De+1);o(b);var U=new Array(ye);o(U);var D=new Array(le);o(D);var k,Z,Y,W=!1;s._tr_init=re,s._tr_stored_block=oe,s._tr_flush_block=ue,s._tr_tally=$,s._tr_align=me},{"../utils/common":3}],15:[function(e,r,s){"use strict";function o(){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}r.exports=o},{}],"/":[function(e,r,s){"use strict";var o=e("./lib/utils/common").assign,a=e("./lib/deflate"),u=e("./lib/inflate"),l=e("./lib/zlib/constants"),v={};o(v,a,u,l),r.exports=v},{"./lib/deflate":1,"./lib/inflate":2,"./lib/utils/common":3,"./lib/zlib/constants":6}]},{},[])("/")});/**
|
|
* @license
|
|
* Copyright 2015 Mozilla Foundation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var PDFJS;(function(e){"use strict";var r=function(){function M(T){this.message="JPEG error: "+T}return M.prototype=new Error,M.prototype.name="JpegError",M.constructor=M,M}(),s=function(){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]),T=4017,B=799,H=3406,J=2276,Q=1567,q=3784,O=5793,K=2896;function pe({decodeTransform:$=null,colorTransform:ee=-1}={}){this._decodeTransform=$,this._colorTransform=ee}function R($,ee){for(var ne=0,_e=[],ae,Me,Ne=16;Ne>0&&!$[Ne-1];)Ne--;_e.push({children:[],index:0});var Ae=_e[0],Fe;for(ae=0;ae<Ne;ae++){for(Me=0;Me<$[ae];Me++){for(Ae=_e.pop(),Ae.children[Ae.index]=ee[ne];Ae.index>0;)Ae=_e.pop();for(Ae.index++,_e.push(Ae);_e.length<=ae;)_e.push(Fe={children:[],index:0}),Ae.children[Ae.index]=Fe.children,Ae=Fe;ne++}ae+1<Ne&&(_e.push(Fe={children:[],index:0}),Ae.children[Ae.index]=Fe.children,Ae=Fe)}return _e[0].children}function Te($,ee,ne){return 64*(($.blocksPerLine+1)*ee+ne)}function re($,ee,ne,_e,ae,Me,Ne,Ae,Fe,De=!1){var ze=ne.mcusPerLine,ye=ne.progressive;const he=ee;let ke=0,le=0;function Ce(){if(le>0)return le--,ke>>le&1;if(ke=$[ee++],ke===255){var A=$[ee++];if(A){if(A===220&&De){ee+=2;const N=p($,ee);if(ee+=2,N>0&&N!==ne.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",N)}else if(A===217){if(De){const N=h*8;if(N>0&&N<ne.scanLines/10)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",N)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new r(`unexpected marker ${(ke<<8|A).toString(16)}`)}}return le=7,ke>>>7}function Be(A){for(var N=A;;){switch(N=N[Ce()],typeof N){case"number":return N;case"object":continue}throw new r("invalid huffman sequence")}}function we(A){for(var N=0;A>0;)N=N<<1|Ce(),A--;return N}function xe(A){if(A===1)return Ce()===1?1:-1;var N=we(A);return N>=1<<A-1?N:N+(-1<<A)+1}function Ie(A,N){var I=Be(A.huffmanTableDC),te=I===0?0:xe(I);A.blockData[N]=A.pred+=te;for(var fe=1;fe<64;){var S=Be(A.huffmanTableAC),de=S&15,se=S>>4;if(de===0){if(se<15)break;fe+=16;continue}fe+=se;var ie=M[fe];A.blockData[N+ie]=xe(de),fe++}}function Re(A,N){var I=Be(A.huffmanTableDC),te=I===0?0:xe(I)<<Fe;A.blockData[N]=A.pred+=te}function Le(A,N){A.blockData[N]|=Ce()<<Fe}var Oe=0;function Ve(A,N){if(Oe>0){Oe--;return}for(var I=Me,te=Ne;I<=te;){var fe=Be(A.huffmanTableAC),S=fe&15,de=fe>>4;if(S===0){if(de<15){Oe=we(de)+(1<<de)-1;break}I+=16;continue}I+=de;var se=M[I];A.blockData[N+se]=xe(S)*(1<<Fe),I++}}var Xe=0,We;function t(A,N){for(var I=Me,te=Ne,fe=0,S,de;I<=te;){const se=N+M[I],ie=A.blockData[se]<0?-1:1;switch(Xe){case 0:if(de=Be(A.huffmanTableAC),S=de&15,fe=de>>4,S===0)fe<15?(Oe=we(fe)+(1<<fe),Xe=4):(fe=16,Xe=1);else{if(S!==1)throw new r("invalid ACn encoding");We=xe(S),Xe=fe?2:3}continue;case 1:case 2:A.blockData[se]?A.blockData[se]+=ie*(Ce()<<Fe):(fe--,fe===0&&(Xe=Xe===2?3:0));break;case 3:A.blockData[se]?A.blockData[se]+=ie*(Ce()<<Fe):(A.blockData[se]=We<<Fe,Xe=0);break;case 4:A.blockData[se]&&(A.blockData[se]+=ie*(Ce()<<Fe));break}I++}Xe===4&&(Oe--,Oe===0&&(Xe=0))}let h=0;function d(A,N,I,te,fe){var S=I/ze|0,de=I%ze;h=S*A.v+te;var se=de*A.h+fe;const ie=Te(A,h,se);N(A,ie)}function x(A,N,I){h=I/A.blocksPerLine|0;var te=I%A.blocksPerLine;const fe=Te(A,h,te);N(A,fe)}var E=_e.length,C,b,U,D,k,Z;ye?Me===0?Z=Ae===0?Re:Le:Z=Ae===0?Ve:t:Z=Ie;var Y=0,W,F;E===1?F=_e[0].blocksPerLine*_e[0].blocksPerColumn:F=ze*ne.mcusPerColumn;for(var z,G;Y<=F;){var X=ae?Math.min(F-Y,ae):F;if(X>0){for(b=0;b<E;b++)_e[b].pred=0;if(Oe=0,E===1)for(C=_e[0],k=0;k<X;k++)x(C,Z,Y),Y++;else for(k=0;k<X;k++){for(b=0;b<E;b++)for(C=_e[b],z=C.h,G=C.v,U=0;U<G;U++)for(D=0;D<z;D++)d(C,Z,Y,U,D);Y++}}if(le=0,W=ue($,ee),!W)break;if(W.invalid){const A=X>0?"unexpected":"excessive";g(`decodeScan - ${A} MCU data, current marker is: ${W.invalid}`),ee=W.offset}if(W.marker>=65488&&W.marker<=65495)ee+=2;else break}return ee-he}function oe($,ee,ne){var _e=$.quantizationTable,ae=$.blockData,Me,Ne,Ae,Fe,De,ze,ye,he,ke,le,Ce,Be,we,xe,Ie,Re,Le;if(!_e)throw new r("missing required Quantization Table.");for(var Oe=0;Oe<64;Oe+=8){if(ke=ae[ee+Oe],le=ae[ee+Oe+1],Ce=ae[ee+Oe+2],Be=ae[ee+Oe+3],we=ae[ee+Oe+4],xe=ae[ee+Oe+5],Ie=ae[ee+Oe+6],Re=ae[ee+Oe+7],ke*=_e[Oe],(le|Ce|Be|we|xe|Ie|Re)==0){Le=O*ke+512>>10,ne[Oe]=Le,ne[Oe+1]=Le,ne[Oe+2]=Le,ne[Oe+3]=Le,ne[Oe+4]=Le,ne[Oe+5]=Le,ne[Oe+6]=Le,ne[Oe+7]=Le;continue}le*=_e[Oe+1],Ce*=_e[Oe+2],Be*=_e[Oe+3],we*=_e[Oe+4],xe*=_e[Oe+5],Ie*=_e[Oe+6],Re*=_e[Oe+7],Me=O*ke+128>>8,Ne=O*we+128>>8,Ae=Ce,Fe=Ie,De=K*(le-Re)+128>>8,he=K*(le+Re)+128>>8,ze=Be<<4,ye=xe<<4,Me=Me+Ne+1>>1,Ne=Me-Ne,Le=Ae*q+Fe*Q+128>>8,Ae=Ae*Q-Fe*q+128>>8,Fe=Le,De=De+ye+1>>1,ye=De-ye,he=he+ze+1>>1,ze=he-ze,Me=Me+Fe+1>>1,Fe=Me-Fe,Ne=Ne+Ae+1>>1,Ae=Ne-Ae,Le=De*J+he*H+2048>>12,De=De*H-he*J+2048>>12,he=Le,Le=ze*B+ye*T+2048>>12,ze=ze*T-ye*B+2048>>12,ye=Le,ne[Oe]=Me+he,ne[Oe+7]=Me-he,ne[Oe+1]=Ne+ye,ne[Oe+6]=Ne-ye,ne[Oe+2]=Ae+ze,ne[Oe+5]=Ae-ze,ne[Oe+3]=Fe+De,ne[Oe+4]=Fe-De}for(var Ve=0;Ve<8;++Ve){if(ke=ne[Ve],le=ne[Ve+8],Ce=ne[Ve+16],Be=ne[Ve+24],we=ne[Ve+32],xe=ne[Ve+40],Ie=ne[Ve+48],Re=ne[Ve+56],(le|Ce|Be|we|xe|Ie|Re)==0){Le=O*ke+8192>>14,Le<-2040?Le=0:Le>=2024?Le=255:Le=Le+2056>>4,ae[ee+Ve]=Le,ae[ee+Ve+8]=Le,ae[ee+Ve+16]=Le,ae[ee+Ve+24]=Le,ae[ee+Ve+32]=Le,ae[ee+Ve+40]=Le,ae[ee+Ve+48]=Le,ae[ee+Ve+56]=Le;continue}Me=O*ke+2048>>12,Ne=O*we+2048>>12,Ae=Ce,Fe=Ie,De=K*(le-Re)+2048>>12,he=K*(le+Re)+2048>>12,ze=Be,ye=xe,Me=(Me+Ne+1>>1)+4112,Ne=Me-Ne,Le=Ae*q+Fe*Q+2048>>12,Ae=Ae*Q-Fe*q+2048>>12,Fe=Le,De=De+ye+1>>1,ye=De-ye,he=he+ze+1>>1,ze=he-ze,Me=Me+Fe+1>>1,Fe=Me-Fe,Ne=Ne+Ae+1>>1,Ae=Ne-Ae,Le=De*J+he*H+2048>>12,De=De*H-he*J+2048>>12,he=Le,Le=ze*B+ye*T+2048>>12,ze=ze*T-ye*B+2048>>12,ye=Le,ke=Me+he,Re=Me-he,le=Ne+ye,Ie=Ne-ye,Ce=Ae+ze,xe=Ae-ze,Be=Fe+De,we=Fe-De,ke<16?ke=0:ke>=4080?ke=255:ke>>=4,le<16?le=0:le>=4080?le=255:le>>=4,Ce<16?Ce=0:Ce>=4080?Ce=255:Ce>>=4,Be<16?Be=0:Be>=4080?Be=255:Be>>=4,we<16?we=0:we>=4080?we=255:we>>=4,xe<16?xe=0:xe>=4080?xe=255:xe>>=4,Ie<16?Ie=0:Ie>=4080?Ie=255:Ie>>=4,Re<16?Re=0:Re>=4080?Re=255:Re>>=4,ae[ee+Ve]=ke,ae[ee+Ve+8]=le,ae[ee+Ve+16]=Ce,ae[ee+Ve+24]=Be,ae[ee+Ve+32]=we,ae[ee+Ve+40]=xe,ae[ee+Ve+48]=Ie,ae[ee+Ve+56]=Re}}function me($,ee){for(var ne=ee.blocksPerLine,_e=ee.blocksPerColumn,ae=new Int16Array(64),Me=0;Me<_e;Me++)for(var Ne=0;Ne<ne;Ne++){var Ae=Te(ee,Me,Ne);oe(ee,Ae,ae)}return ee.blockData}function ue($,ee,ne=ee){const _e=$.length-1;var ae=ne<ee?ne:ee;if(ee>=_e)return null;var Me=p($,ee);if(Me>=65472&&Me<=65534)return{invalid:null,marker:Me,offset:ee};for(var Ne=p($,ae);!(Ne>=65472&&Ne<=65534);){if(++ae>=_e)return null;Ne=p($,ae)}return{invalid:Me.toString(16),marker:Ne,offset:ae}}return pe.prototype={parse($,{dnlScanLines:ee=null}={}){function ne(){const A=p($,ae);ae+=2;let N=ae+A-2;var I=ue($,N,ae);I&&I.invalid&&(g("readDataBlock - incorrect length, current marker is: "+I.invalid),N=I.offset);var te=$.subarray(ae,N);return ae+=te.length,te}function _e(A){for(var N=Math.ceil(A.samplesPerLine/8/A.maxH),I=Math.ceil(A.scanLines/8/A.maxV),te=0;te<A.components.length;te++){k=A.components[te];var fe=Math.ceil(Math.ceil(A.samplesPerLine/8)*k.h/A.maxH),S=Math.ceil(Math.ceil(A.scanLines/8)*k.v/A.maxV),de=N*k.h,se=I*k.v,ie=64*se*(de+1);k.blockData=new Int16Array(ie),k.blocksPerLine=fe,k.blocksPerColumn=S}A.mcusPerLine=N,A.mcusPerColumn=I}var ae=0,Me=null,Ne=null,Ae,Fe;let De=0;var ze=[],ye=[],he=[];let ke=p($,ae);if(ae+=2,ke!==65496)throw new r("SOI not found");ke=p($,ae),ae+=2;e:for(;ke!==65497;){var le,Ce,Be;switch(ke){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 we=ne();ke===65504&&we[0]===74&&we[1]===70&&we[2]===73&&we[3]===70&&we[4]===0&&(Me={version:{major:we[5],minor:we[6]},densityUnits:we[7],xDensity:we[8]<<8|we[9],yDensity:we[10]<<8|we[11],thumbWidth:we[12],thumbHeight:we[13],thumbData:we.subarray(14,14+3*we[12]*we[13])}),ke===65518&&we[0]===65&&we[1]===100&&we[2]===111&&we[3]===98&&we[4]===101&&(Ne={version:we[5]<<8|we[6],flags0:we[7]<<8|we[8],flags1:we[9]<<8|we[10],transformCode:we[11]});break;case 65499:const A=p($,ae);ae+=2;for(var xe=A+ae-2,Ie;ae<xe;){var Re=$[ae++],Le=new Uint16Array(64);if(Re>>4==0)for(Ce=0;Ce<64;Ce++)Ie=M[Ce],Le[Ie]=$[ae++];else if(Re>>4==1)for(Ce=0;Ce<64;Ce++)Ie=M[Ce],Le[Ie]=p($,ae),ae+=2;else throw new r("DQT - invalid table spec");ze[Re&15]=Le}break;case 65472:case 65473:case 65474:if(Ae)throw new r("Only single frame JPEGs supported");ae+=2,Ae={},Ae.extended=ke===65473,Ae.progressive=ke===65474,Ae.precision=$[ae++];const N=p($,ae);ae+=2,Ae.scanLines=ee||N,Ae.samplesPerLine=p($,ae),ae+=2,Ae.components=[],Ae.componentIds={};var Oe=$[ae++],Ve,Xe=0,We=0;for(le=0;le<Oe;le++){Ve=$[ae];var t=$[ae+1]>>4,h=$[ae+1]&15;Xe<t&&(Xe=t),We<h&&(We=h);var d=$[ae+2];Be=Ae.components.push({h:t,v:h,quantizationId:d,quantizationTable:null}),Ae.componentIds[Ve]=Be-1,ae+=3}Ae.maxH=Xe,Ae.maxV=We,_e(Ae);break;case 65476:const I=p($,ae);for(ae+=2,le=2;le<I;){var x=$[ae++],E=new Uint8Array(16),C=0;for(Ce=0;Ce<16;Ce++,ae++)C+=E[Ce]=$[ae];var b=new Uint8Array(C);for(Ce=0;Ce<C;Ce++,ae++)b[Ce]=$[ae];le+=17+C,(x>>4==0?he:ye)[x&15]=R(E,b)}break;case 65501:ae+=2,Fe=p($,ae),ae+=2;break;case 65498:const te=++De==1&&!ee;ae+=2;var U=$[ae++],D=[],k;for(le=0;le<U;le++){const S=$[ae++];var Z=Ae.componentIds[S];k=Ae.components[Z],k.index=S;var Y=$[ae++];k.huffmanTableDC=he[Y>>4],k.huffmanTableAC=ye[Y&15],D.push(k)}var W=$[ae++],F=$[ae++],z=$[ae++];try{var G=re($,ae,Ae,D,Fe,W,F,z>>4,z&15,te);ae+=G}catch(S){if(S instanceof DNLMarkerError)return g(`${S.message} -- attempting to re-parse the JPEG image.`),this.parse($,{dnlScanLines:S.scanLines});if(S instanceof EOIMarkerError){g(`${S.message} -- ignoring the rest of the image data.`);break e}throw S}break;case 65500:ae+=4;break;case 65535:$[ae]!==255&&ae--;break;default:const fe=ue($,ae-2,ae-3);if(fe&&fe.invalid){g("JpegImage.parse - unexpected data, current marker is: "+fe.invalid),ae=fe.offset;break}if(ae>=$.length-1){g("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new r("JpegImage.parse - unknown marker: "+ke.toString(16))}ke=p($,ae),ae+=2}for(this.width=Ae.samplesPerLine,this.height=Ae.scanLines,this.jfif=Me,this.adobe=Ne,this.components=[],le=0;le<Ae.components.length;le++){k=Ae.components[le];var X=ze[k.quantizationId];X&&(k.quantizationTable=X),this.components.push({index:k.index,output:me(Ae,k),scaleX:k.h/Ae.maxH,scaleY:k.v/Ae.maxV,blocksPerLine:k.blocksPerLine,blocksPerColumn:k.blocksPerColumn})}this.numComponents=this.components.length},_getLinearizedBlockData($,ee,ne=!1){var _e=this.width/$,ae=this.height/ee,Me,Ne,Ae,Fe,De,ze,ye,he,ke,le,Ce=0,Be,we=this.components.length,xe=$*ee*we,Ie=new Uint8ClampedArray(xe),Re=new Uint32Array($),Le=4294967288;let Oe;for(ye=0;ye<we;ye++){if(Me=this.components[ye],Ne=Me.scaleX*_e,Ae=Me.scaleY*ae,Ce=ye,Be=Me.output,Fe=Me.blocksPerLine+1<<3,Ne!==Oe){for(De=0;De<$;De++)he=0|De*Ne,Re[De]=(he&Le)<<3|he&7;Oe=Ne}for(ze=0;ze<ee;ze++)for(he=0|ze*Ae,le=Fe*(he&Le)|(he&7)<<3,De=0;De<$;De++)Ie[Ce]=Be[le+Re[De]],Ce+=we}let Ve=this._decodeTransform;if(!ne&&we===4&&!Ve&&(Ve=new Int32Array([-256,255,-256,255,-256,255,-256,255])),Ve)for(ye=0;ye<xe;)for(he=0,ke=0;he<we;he++,ye++,ke+=2)Ie[ye]=(Ie[ye]*Ve[ke]>>8)+Ve[ke+1];return Ie},get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this._colorTransform===0?!1:!(this.components[0].index===82&&this.components[1].index===71&&this.components[2].index===66):this._colorTransform===1},_convertYccToRgb:function(ee){for(var ne,_e,ae,Me=0,Ne=ee.length;Me<Ne;Me+=3)ne=ee[Me],_e=ee[Me+1],ae=ee[Me+2],ee[Me]=ne-179.456+1.402*ae,ee[Me+1]=ne+135.459-.344*_e-.714*ae,ee[Me+2]=ne-226.816+1.772*_e;return ee},_convertYcckToRgb:function(ee){for(var ne,_e,ae,Me,Ne=0,Ae=0,Fe=ee.length;Ae<Fe;Ae+=4)ne=ee[Ae],_e=ee[Ae+1],ae=ee[Ae+2],Me=ee[Ae+3],ee[Ne++]=-122.67195406894+_e*(-660635669420364e-19*_e+.000437130475926232*ae-54080610064599e-18*ne+.00048449797120281*Me-.154362151871126)+ae*(-.000957964378445773*ae+.000817076911346625*ne-.00477271405408747*Me+1.53380253221734)+ne*(.000961250184130688*ne-.00266257332283933*Me+.48357088451265)+Me*(-.000336197177618394*Me+.484791561490776),ee[Ne++]=107.268039397724+_e*(219927104525741e-19*_e-.000640992018297945*ae+.000659397001245577*ne+.000426105652938837*Me-.176491792462875)+ae*(-.000778269941513683*ae+.00130872261408275*ne+.000770482631801132*Me-.151051492775562)+ne*(.00126935368114843*ne-.00265090189010898*Me+.25802910206845)+Me*(-.000318913117588328*Me-.213742400323665),ee[Ne++]=-20.810012546947+_e*(-.000570115196973677*_e-263409051004589e-19*ae+.0020741088115012*ne-.00288260236853442*Me+.814272968359295)+ae*(-153496057440975e-19*ae-.000132689043961446*ne+.000560833691242812*Me-.195152027534049)+ne*(.00174418132927582*ne-.00255243321439347*Me+.116935020465145)+Me*(-.000343531996510555*Me+.24165260232407);return ee.subarray(0,Ne)},_convertYcckToCmyk:function(ee){for(var ne,_e,ae,Me=0,Ne=ee.length;Me<Ne;Me+=4)ne=ee[Me],_e=ee[Me+1],ae=ee[Me+2],ee[Me]=434.456-ne-1.402*ae,ee[Me+1]=119.541-ne+.344*_e+.714*ae,ee[Me+2]=481.816-ne-1.772*_e;return ee},_convertCmykToRgb:function(ee){for(var ne,_e,ae,Me,Ne=0,Ae=0,Fe=ee.length;Ae<Fe;Ae+=4)ne=ee[Ae],_e=ee[Ae+1],ae=ee[Ae+2],Me=ee[Ae+3],ee[Ne++]=255+ne*(-6747147073602441e-20*ne+.0008379262121013727*_e+.0002894718188643294*ae+.003264231057537806*Me-1.1185611867203937)+_e*(26374107616089405e-21*_e-8626949158638572e-20*ae-.0002748769067499491*Me-.02155688794978967)+ae*(-3878099212869363e-20*ae-.0003267808279485286*Me+.0686742238595345)-Me*(.0003361971776183937*Me+.7430659151342254),ee[Ne++]=255+ne*(.00013596372813588848*ne+.000924537132573585*_e+.00010567359618683593*ae+.0004791864687436512*Me-.3109689587515875)+_e*(-.00023545346108370344*_e+.0002702845253534714*ae+.0020200308977307156*Me-.7488052167015494)+ae*(6834815998235662e-20*ae+.00015168452363460973*Me-.09751927774728933)-Me*(.0003189131175883281*Me+.7364883807733168),ee[Ne++]=255+ne*(13598650411385307e-21*ne+.00012423956175490851*_e+.0004751985097583589*ae-36729317476630422e-22*Me-.05562186980264034)+_e*(.00016141380598724676*_e+.0009692239130725186*ae+.0007782692450036253*Me-.44015232367526463)+ae*(5068882914068769e-22*ae+.0017778369011375071*Me-.7591454649749609)-Me*(.0003435319965105553*Me+.7063770186160144);return ee.subarray(0,Ne)},getData({width:$,height:ee,forceRGB:ne=!1,isSourcePDF:_e=!1}){if(this.numComponents>4)throw new r("Unsupported color mode");var ae=this._getLinearizedBlockData($,ee,_e);if(this.numComponents===1&&ne){for(var Me=ae.length,Ne=new Uint8ClampedArray(Me*3),Ae=0,Fe=0;Fe<Me;Fe++){var De=ae[Fe];Ne[Ae++]=De,Ne[Ae++]=De,Ne[Ae++]=De}return Ne}else{if(this.numComponents===3&&this._isColorConversionNeeded)return this._convertYccToRgb(ae);if(this.numComponents===4){if(this._isColorConversionNeeded)return ne?this._convertYcckToRgb(ae):this._convertYcckToCmyk(ae);if(ne)return this._convertCmykToRgb(ae)}}return ae}},pe}(),o=function(){var M=[{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(B,H,J){this.data=B,this.bp=H,this.dataEnd=J,this.chigh=B[H],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 H=this.data,J=this.bp;if(H[J]===255){var Q=H[J+1];Q>143?(this.clow+=65280,this.ct=8):(J++,this.clow+=H[J]<<9,this.ct=7,this.bp=J)}else J++,this.clow+=J<this.dataEnd?H[J]<<8:65280,this.ct=8,this.bp=J;this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(H,J){var Q=H[J]>>1,q=H[J]&1,O=M[Q],K=O.qe,pe,R=this.a-K;if(this.chigh<K)R<K?(R=K,pe=q,Q=O.nmps):(R=K,pe=1^q,O.switchFlag===1&&(q=pe),Q=O.nlps);else{if(this.chigh-=K,(R&32768)!=0)return this.a=R,q;R<K?(pe=1^q,O.switchFlag===1&&(q=pe),Q=O.nlps):(pe=q,Q=O.nmps)}do this.ct===0&&this.byteIn(),R<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while((R&32768)==0);return this.a=R,H[J]=Q<<1|q,pe}},T}(),a=function(){var M={LL:0,LH:1,HL:1,HH:2};function T(){this.failOnCorruptedImage=!1}T.prototype={parse:function(he){var ke=p(he,0);if(ke===65359){this.parseCodestream(he,0,he.length);return}for(var le=0,Ce=he.length;le<Ce;){var Be=8,we=c(he,le),xe=c(he,le+4);le+=Be,we===1&&(we=c(he,le)*4294967296+c(he,le+4),le+=8,Be+=8),we===0&&(we=Ce-le+Be),we<Be&&f("JPX Error: Invalid box field size");var Ie=we-Be,Re=!0;switch(xe){case 1785737832:Re=!1;break;case 1668246642:var Le=he[le];if(Le===1){var Oe=c(he,le+3);switch(Oe){case 16:case 17:case 18:break;default:g("Unknown colorspace "+Oe);break}}else Le===2&&y("ICC profile not supported");break;case 1785737827:this.parseCodestream(he,le,le+Ie);break;case 1783636e3:c(he,le)!==218793738&&g("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var Ve=String.fromCharCode(xe>>24&255,xe>>16&255,xe>>8&255,xe&255);g("Unsupported header type "+xe+" ("+Ve+")");break}Re&&(le+=Ie)}},parseImageProperties:function(he){for(var ke=he.getByte();ke>=0;){var le=ke;ke=he.getByte();var Ce=le<<8|ke;if(Ce===65361){he.skip(4);var Be=he.getInt32()>>>0,we=he.getInt32()>>>0,xe=he.getInt32()>>>0,Ie=he.getInt32()>>>0;he.skip(16);var Re=he.getUint16();this.width=Be-xe,this.height=we-Ie,this.componentsCount=Re,this.bitsPerComponent=8;return}}f("JPX Error: No size marker found in JPX stream")},parseCodestream:function(he,ke,le){var Ce={},Be=!1;try{for(var we=ke;we+1<le;){var xe=p(he,we);we+=2;var Ie=0,Re,Le,Oe,Ve,Xe,We;switch(xe){case 65359:Ce.mainHeader=!0;break;case 65497:break;case 65361:Ie=p(he,we);var t={};t.Xsiz=c(he,we+4),t.Ysiz=c(he,we+8),t.XOsiz=c(he,we+12),t.YOsiz=c(he,we+16),t.XTsiz=c(he,we+20),t.YTsiz=c(he,we+24),t.XTOsiz=c(he,we+28),t.YTOsiz=c(he,we+32);var h=p(he,we+36);t.Csiz=h;var d=[];Re=we+38;for(var x=0;x<h;x++){var E={precision:(he[Re]&127)+1,isSigned:!!(he[Re]&128),XRsiz:he[Re+1],YRsiz:he[Re+1]};B(E,t),d.push(E)}Ce.SIZ=t,Ce.components=d,H(Ce,d),Ce.QCC=[],Ce.COC=[];break;case 65372:Ie=p(he,we);var C={};switch(Re=we+2,Le=he[Re++],Le&31){case 0:Ve=8,Xe=!0;break;case 1:Ve=16,Xe=!1;break;case 2:Ve=16,Xe=!0;break;default:throw new Error("Invalid SQcd value "+Le)}for(C.noQuantization=Ve===8,C.scalarExpounded=Xe,C.guardBits=Le>>5,Oe=[];Re<Ie+we;){var b={};Ve===8?(b.epsilon=he[Re++]>>3,b.mu=0):(b.epsilon=he[Re]>>3,b.mu=(he[Re]&7)<<8|he[Re+1],Re+=2),Oe.push(b)}C.SPqcds=Oe,Ce.mainHeader?Ce.QCD=C:(Ce.currentTile.QCD=C,Ce.currentTile.QCC=[]);break;case 65373:Ie=p(he,we);var U={};Re=we+2;var D;switch(Ce.SIZ.Csiz<257?D=he[Re++]:(D=p(he,Re),Re+=2),Le=he[Re++],Le&31){case 0:Ve=8,Xe=!0;break;case 1:Ve=16,Xe=!1;break;case 2:Ve=16,Xe=!0;break;default:throw new Error("Invalid SQcd value "+Le)}for(U.noQuantization=Ve===8,U.scalarExpounded=Xe,U.guardBits=Le>>5,Oe=[];Re<Ie+we;)b={},Ve===8?(b.epsilon=he[Re++]>>3,b.mu=0):(b.epsilon=he[Re]>>3,b.mu=(he[Re]&7)<<8|he[Re+1],Re+=2),Oe.push(b);U.SPqcds=Oe,Ce.mainHeader?Ce.QCC[D]=U:Ce.currentTile.QCC[D]=U;break;case 65362:Ie=p(he,we);var k={};Re=we+2;var Z=he[Re++];k.entropyCoderWithCustomPrecincts=!!(Z&1),k.sopMarkerUsed=!!(Z&2),k.ephMarkerUsed=!!(Z&4),k.progressionOrder=he[Re++],k.layersCount=p(he,Re),Re+=2,k.multipleComponentTransform=he[Re++],k.decompositionLevelsCount=he[Re++],k.xcb=(he[Re++]&15)+2,k.ycb=(he[Re++]&15)+2;var Y=he[Re++];if(k.selectiveArithmeticCodingBypass=!!(Y&1),k.resetContextProbabilities=!!(Y&2),k.terminationOnEachCodingPass=!!(Y&4),k.verticalyStripe=!!(Y&8),k.predictableTermination=!!(Y&16),k.segmentationSymbolUsed=!!(Y&32),k.reversibleTransformation=he[Re++],k.entropyCoderWithCustomPrecincts){for(var W=[];Re<Ie+we;){var F=he[Re++];W.push({PPx:F&15,PPy:F>>4})}k.precinctsSizes=W}var z=[];if(k.selectiveArithmeticCodingBypass&&z.push("selectiveArithmeticCodingBypass"),k.resetContextProbabilities&&z.push("resetContextProbabilities"),k.terminationOnEachCodingPass&&z.push("terminationOnEachCodingPass"),k.verticalyStripe&&z.push("verticalyStripe"),k.predictableTermination&&z.push("predictableTermination"),z.length>0)throw Be=!0,new Error("Unsupported COD options ("+z.join(", ")+")");Ce.mainHeader?Ce.COD=k:(Ce.currentTile.COD=k,Ce.currentTile.COC=[]);break;case 65424:Ie=p(he,we),We={},We.index=p(he,we+2),We.length=c(he,we+4),We.dataEnd=We.length+we-2,We.partIndex=he[we+8],We.partsCount=he[we+9],Ce.mainHeader=!1,We.partIndex===0&&(We.COD=Ce.COD,We.COC=Ce.COC.slice(0),We.QCD=Ce.QCD,We.QCC=Ce.QCC.slice(0)),Ce.currentTile=We;break;case 65427:We=Ce.currentTile,We.partIndex===0&&(ae(Ce,We.index),ue(Ce)),Ie=We.dataEnd-we,$(Ce,he,we,Ie);break;case 65365:case 65367:case 65368:case 65380:Ie=p(he,we);break;case 65363:throw new Error("Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("Unknown codestream code: "+xe.toString(16))}we+=Ie}}catch(G){Be||this.failOnCorruptedImage?f("JPX Error: "+G.message):g("JPX: Trying to recover from: "+G.message)}this.tiles=_e(Ce),this.width=Ce.SIZ.Xsiz-Ce.SIZ.XOsiz,this.height=Ce.SIZ.Ysiz-Ce.SIZ.YOsiz,this.componentsCount=Ce.SIZ.Csiz}};function B(ye,he){ye.x0=Math.ceil(he.XOsiz/ye.XRsiz),ye.x1=Math.ceil(he.Xsiz/ye.XRsiz),ye.y0=Math.ceil(he.YOsiz/ye.YRsiz),ye.y1=Math.ceil(he.Ysiz/ye.YRsiz),ye.width=ye.x1-ye.x0,ye.height=ye.y1-ye.y0}function H(ye,he){for(var ke=ye.SIZ,le,Ce=[],Be=Math.ceil((ke.Xsiz-ke.XTOsiz)/ke.XTsiz),we=Math.ceil((ke.Ysiz-ke.YTOsiz)/ke.YTsiz),xe=0;xe<we;xe++)for(var Ie=0;Ie<Be;Ie++)le={},le.tx0=Math.max(ke.XTOsiz+Ie*ke.XTsiz,ke.XOsiz),le.ty0=Math.max(ke.YTOsiz+xe*ke.YTsiz,ke.YOsiz),le.tx1=Math.min(ke.XTOsiz+(Ie+1)*ke.XTsiz,ke.Xsiz),le.ty1=Math.min(ke.YTOsiz+(xe+1)*ke.YTsiz,ke.Ysiz),le.width=le.tx1-le.tx0,le.height=le.ty1-le.ty0,le.components=[],Ce.push(le);ye.tiles=Ce;for(var Re=ke.Csiz,Le=0,Oe=Re;Le<Oe;Le++)for(var Ve=he[Le],Xe=0,We=Ce.length;Xe<We;Xe++){var t={};le=Ce[Xe],t.tcx0=Math.ceil(le.tx0/Ve.XRsiz),t.tcy0=Math.ceil(le.ty0/Ve.YRsiz),t.tcx1=Math.ceil(le.tx1/Ve.XRsiz),t.tcy1=Math.ceil(le.ty1/Ve.YRsiz),t.width=t.tcx1-t.tcx0,t.height=t.tcy1-t.tcy0,le.components[Le]=t}}function J(ye,he,ke){var le=he.codingStyleParameters,Ce={};return le.entropyCoderWithCustomPrecincts?(Ce.PPx=le.precinctsSizes[ke].PPx,Ce.PPy=le.precinctsSizes[ke].PPy):(Ce.PPx=15,Ce.PPy=15),Ce.xcb_=ke>0?Math.min(le.xcb,Ce.PPx-1):Math.min(le.xcb,Ce.PPx),Ce.ycb_=ke>0?Math.min(le.ycb,Ce.PPy-1):Math.min(le.ycb,Ce.PPy),Ce}function Q(ye,he,ke){var le=1<<ke.PPx,Ce=1<<ke.PPy,Be=he.resLevel===0,we=1<<ke.PPx+(Be?0:-1),xe=1<<ke.PPy+(Be?0:-1),Ie=he.trx1>he.trx0?Math.ceil(he.trx1/le)-Math.floor(he.trx0/le):0,Re=he.try1>he.try0?Math.ceil(he.try1/Ce)-Math.floor(he.try0/Ce):0,Le=Ie*Re;he.precinctParameters={precinctWidth:le,precinctHeight:Ce,numprecinctswide:Ie,numprecinctshigh:Re,numprecincts:Le,precinctWidthInSubband:we,precinctHeightInSubband:xe}}function q(ye,he,ke){var le=ke.xcb_,Ce=ke.ycb_,Be=1<<le,we=1<<Ce,xe=he.tbx0>>le,Ie=he.tby0>>Ce,Re=he.tbx1+Be-1>>le,Le=he.tby1+we-1>>Ce,Oe=he.resolution.precinctParameters,Ve=[],Xe=[],We,t,h,d;for(t=Ie;t<Le;t++)for(We=xe;We<Re;We++){h={cbx:We,cby:t,tbx0:Be*We,tby0:we*t,tbx1:Be*(We+1),tby1:we*(t+1)},h.tbx0_=Math.max(he.tbx0,h.tbx0),h.tby0_=Math.max(he.tby0,h.tby0),h.tbx1_=Math.min(he.tbx1,h.tbx1),h.tby1_=Math.min(he.tby1,h.tby1);var x=Math.floor((h.tbx0_-he.tbx0)/Oe.precinctWidthInSubband),E=Math.floor((h.tby0_-he.tby0)/Oe.precinctHeightInSubband);if(d=x+E*Oe.numprecinctswide,h.precinctNumber=d,h.subbandType=he.type,h.Lblock=3,!(h.tbx1_<=h.tbx0_||h.tby1_<=h.tby0_)){Ve.push(h);var C=Xe[d];C!==void 0?(We<C.cbxMin?C.cbxMin=We:We>C.cbxMax&&(C.cbxMax=We),t<C.cbyMin?C.cbxMin=t:t>C.cbyMax&&(C.cbyMax=t)):Xe[d]=C={cbxMin:We,cbyMin:t,cbxMax:We,cbyMax:t},h.precinct=C}}he.codeblockParameters={codeblockWidth:le,codeblockHeight:Ce,numcodeblockwide:Re-xe+1,numcodeblockhigh:Le-Ie+1},he.codeblocks=Ve,he.precincts=Xe}function O(ye,he,ke){for(var le=[],Ce=ye.subbands,Be=0,we=Ce.length;Be<we;Be++)for(var xe=Ce[Be],Ie=xe.codeblocks,Re=0,Le=Ie.length;Re<Le;Re++){var Oe=Ie[Re];Oe.precinctNumber===he&&le.push(Oe)}return{layerNumber:ke,codeblocks:le}}function K(ye){for(var he=ye.SIZ,ke=ye.currentTile.index,le=ye.tiles[ke],Ce=le.codingStyleDefaultParameters.layersCount,Be=he.Csiz,we=0,xe=0;xe<Be;xe++)we=Math.max(we,le.components[xe].codingStyleParameters.decompositionLevelsCount);var Ie=0,Re=0,Le=0,Oe=0;this.nextPacket=function(){for(;Ie<Ce;Ie++){for(;Re<=we;Re++){for(;Le<Be;Le++){var Xe=le.components[Le];if(!(Re>Xe.codingStyleParameters.decompositionLevelsCount)){for(var We=Xe.resolutions[Re],t=We.precinctParameters.numprecincts;Oe<t;){var h=O(We,Oe,Ie);return Oe++,h}Oe=0}}Le=0}Re=0}f("JPX Error: Out of packets")}}function pe(ye){for(var he=ye.SIZ,ke=ye.currentTile.index,le=ye.tiles[ke],Ce=le.codingStyleDefaultParameters.layersCount,Be=he.Csiz,we=0,xe=0;xe<Be;xe++)we=Math.max(we,le.components[xe].codingStyleParameters.decompositionLevelsCount);var Ie=0,Re=0,Le=0,Oe=0;this.nextPacket=function(){for(;Ie<=we;Ie++){for(;Re<Ce;Re++){for(;Le<Be;Le++){var Xe=le.components[Le];if(!(Ie>Xe.codingStyleParameters.decompositionLevelsCount)){for(var We=Xe.resolutions[Ie],t=We.precinctParameters.numprecincts;Oe<t;){var h=O(We,Oe,Re);return Oe++,h}Oe=0}}Le=0}Re=0}f("JPX Error: Out of packets")}}function R(ye){var he=ye.SIZ,ke=ye.currentTile.index,le=ye.tiles[ke],Ce=le.codingStyleDefaultParameters.layersCount,Be=he.Csiz,we,xe,Ie,Re,Le=0;for(Ie=0;Ie<Be;Ie++){var Oe=le.components[Ie];Le=Math.max(Le,Oe.codingStyleParameters.decompositionLevelsCount)}var Ve=new Int32Array(Le+1);for(xe=0;xe<=Le;++xe){var Xe=0;for(Ie=0;Ie<Be;++Ie){var We=le.components[Ie].resolutions;xe<We.length&&(Xe=Math.max(Xe,We[xe].precinctParameters.numprecincts))}Ve[xe]=Xe}we=0,xe=0,Ie=0,Re=0,this.nextPacket=function(){for(;xe<=Le;xe++){for(;Re<Ve[xe];Re++){for(;Ie<Be;Ie++){var h=le.components[Ie];if(!(xe>h.codingStyleParameters.decompositionLevelsCount)){var d=h.resolutions[xe],x=d.precinctParameters.numprecincts;if(!(Re>=x)){for(;we<Ce;){var E=O(d,Re,we);return we++,E}we=0}}}Ie=0}Re=0}f("JPX Error: Out of packets")}}function Te(ye){var he=ye.SIZ,ke=ye.currentTile.index,le=ye.tiles[ke],Ce=le.codingStyleDefaultParameters.layersCount,Be=he.Csiz,we=me(le),xe=we,Ie=0,Re=0,Le=0,Oe=0,Ve=0;this.nextPacket=function(){for(;Ve<xe.maxNumHigh;Ve++){for(;Oe<xe.maxNumWide;Oe++){for(;Le<Be;Le++){for(var We=le.components[Le],t=We.codingStyleParameters.decompositionLevelsCount;Re<=t;Re++){var h=We.resolutions[Re],d=we.components[Le].resolutions[Re],x=oe(Oe,Ve,d,xe,h);if(x!==null){for(;Ie<Ce;){var E=O(h,x,Ie);return Ie++,E}Ie=0}}Re=0}Le=0}Oe=0}f("JPX Error: Out of packets")}}function re(ye){var he=ye.SIZ,ke=ye.currentTile.index,le=ye.tiles[ke],Ce=le.codingStyleDefaultParameters.layersCount,Be=he.Csiz,we=me(le),xe=0,Ie=0,Re=0,Le=0,Oe=0;this.nextPacket=function(){for(;Re<Be;++Re){for(var Xe=le.components[Re],We=we.components[Re],t=Xe.codingStyleParameters.decompositionLevelsCount;Oe<We.maxNumHigh;Oe++){for(;Le<We.maxNumWide;Le++){for(;Ie<=t;Ie++){var h=Xe.resolutions[Ie],d=We.resolutions[Ie],x=oe(Le,Oe,d,We,h);if(x!==null){for(;xe<Ce;){var E=O(h,x,xe);return xe++,E}xe=0}}Ie=0}Le=0}Oe=0}f("JPX Error: Out of packets")}}function oe(ye,he,ke,le,Ce){var Be=ye*le.minWidth,we=he*le.minHeight;if(Be%ke.width!=0||we%ke.height!=0)return null;var xe=we/ke.width*Ce.precinctParameters.numprecinctswide;return Be/ke.height+xe}function me(ye){for(var he=ye.components.length,ke=Number.MAX_VALUE,le=Number.MAX_VALUE,Ce=0,Be=0,we=new Array(he),xe=0;xe<he;xe++){for(var Ie=ye.components[xe],Re=Ie.codingStyleParameters.decompositionLevelsCount,Le=new Array(Re+1),Oe=Number.MAX_VALUE,Ve=Number.MAX_VALUE,Xe=0,We=0,t=1,h=Re;h>=0;--h){var d=Ie.resolutions[h],x=t*d.precinctParameters.precinctWidth,E=t*d.precinctParameters.precinctHeight;Oe=Math.min(Oe,x),Ve=Math.min(Ve,E),Xe=Math.max(Xe,d.precinctParameters.numprecinctswide),We=Math.max(We,d.precinctParameters.numprecinctshigh),Le[h]={width:x,height:E},t<<=1}ke=Math.min(ke,Oe),le=Math.min(le,Ve),Ce=Math.max(Ce,Xe),Be=Math.max(Be,We),we[xe]={resolutions:Le,minWidth:Oe,minHeight:Ve,maxNumWide:Xe,maxNumHigh:We}}return{components:we,minWidth:ke,minHeight:le,maxNumWide:Ce,maxNumHigh:Be}}function ue(ye){for(var he=ye.SIZ,ke=ye.currentTile.index,le=ye.tiles[ke],Ce=he.Csiz,Be=0;Be<Ce;Be++){for(var we=le.components[Be],xe=we.codingStyleParameters.decompositionLevelsCount,Ie=[],Re=[],Le=0;Le<=xe;Le++){var Oe=J(ye,we,Le),Ve={},Xe=1<<xe-Le;Ve.trx0=Math.ceil(we.tcx0/Xe),Ve.try0=Math.ceil(we.tcy0/Xe),Ve.trx1=Math.ceil(we.tcx1/Xe),Ve.try1=Math.ceil(we.tcy1/Xe),Ve.resLevel=Le,Q(ye,Ve,Oe),Ie.push(Ve);var We;if(Le===0)We={},We.type="LL",We.tbx0=Math.ceil(we.tcx0/Xe),We.tby0=Math.ceil(we.tcy0/Xe),We.tbx1=Math.ceil(we.tcx1/Xe),We.tby1=Math.ceil(we.tcy1/Xe),We.resolution=Ve,q(ye,We,Oe),Re.push(We),Ve.subbands=[We];else{var t=1<<xe-Le+1,h=[];We={},We.type="HL",We.tbx0=Math.ceil(we.tcx0/t-.5),We.tby0=Math.ceil(we.tcy0/t),We.tbx1=Math.ceil(we.tcx1/t-.5),We.tby1=Math.ceil(we.tcy1/t),We.resolution=Ve,q(ye,We,Oe),Re.push(We),h.push(We),We={},We.type="LH",We.tbx0=Math.ceil(we.tcx0/t),We.tby0=Math.ceil(we.tcy0/t-.5),We.tbx1=Math.ceil(we.tcx1/t),We.tby1=Math.ceil(we.tcy1/t-.5),We.resolution=Ve,q(ye,We,Oe),Re.push(We),h.push(We),We={},We.type="HH",We.tbx0=Math.ceil(we.tcx0/t-.5),We.tby0=Math.ceil(we.tcy0/t-.5),We.tbx1=Math.ceil(we.tcx1/t-.5),We.tby1=Math.ceil(we.tcy1/t-.5),We.resolution=Ve,q(ye,We,Oe),Re.push(We),h.push(We),Ve.subbands=h}}we.resolutions=Ie,we.subbands=Re}var d=le.codingStyleDefaultParameters.progressionOrder;switch(d){case 0:le.packetsIterator=new K(ye);break;case 1:le.packetsIterator=new pe(ye);break;case 2:le.packetsIterator=new R(ye);break;case 3:le.packetsIterator=new Te(ye);break;case 4:le.packetsIterator=new re(ye);break;default:f("JPX Error: Unsupported progression order "+d)}}function $(ye,he,ke,le){var Ce=0,Be,we=0,xe=!1;function Ie(se){for(;we<se;){var ie=he[ke+Ce];Ce++,xe?(Be=Be<<7|ie,we+=7,xe=!1):(Be=Be<<8|ie,we+=8),ie===255&&(xe=!0)}return we-=se,Be>>>we&(1<<se)-1}function Re(se){return he[ke+Ce-1]===255&&he[ke+Ce]===se?(Le(1),!0):he[ke+Ce]===255&&he[ke+Ce+1]===se?(Le(2),!0):!1}function Le(se){Ce+=se}function Oe(){we=0,xe&&(Ce++,xe=!1)}function Ve(){if(Ie(1)===0)return 1;if(Ie(1)===0)return 2;var se=Ie(2);return se<3?se+3:(se=Ie(5),se<31?se+6:(se=Ie(7),se+37))}for(var Xe=ye.currentTile.index,We=ye.tiles[Xe],t=ye.COD.sopMarkerUsed,h=ye.COD.ephMarkerUsed,d=We.packetsIterator;Ce<le;){Oe(),t&&Re(145)&&Le(4);var x=d.nextPacket();if(!!Ie(1)){for(var E=x.layerNumber,C=[],b,U=0,D=x.codeblocks.length;U<D;U++){b=x.codeblocks[U];var k=b.precinct,Z=b.cbx-k.cbxMin,Y=b.cby-k.cbyMin,W=!1,F=!1,z;if(b.included!==void 0)W=!!Ie(1);else{k=b.precinct;var G,X;if(k.inclusionTree!==void 0)G=k.inclusionTree;else{var A=k.cbxMax-k.cbxMin+1,N=k.cbyMax-k.cbyMin+1;G=new Ne(A,N,E),X=new Me(A,N),k.inclusionTree=G,k.zeroBitPlanesTree=X}if(G.reset(Z,Y,E))for(;;)if(Ie(1)){if(z=!G.nextLevel(),z){b.included=!0,W=F=!0;break}}else{G.incrementValue(E);break}}if(!!W){if(F){for(X=k.zeroBitPlanesTree,X.reset(Z,Y);;)if(Ie(1)){if(z=!X.nextLevel(),z)break}else X.incrementValue();b.zeroBitPlanes=X.value}for(var I=Ve();Ie(1);)b.Lblock++;var te=l(I),fe=(I<1<<te?te-1:te)+b.Lblock,S=Ie(fe);C.push({codeblock:b,codingpasses:I,dataLength:S})}}for(Oe(),h&&Re(146);C.length>0;){var de=C.shift();b=de.codeblock,b.data===void 0&&(b.data=[]),b.data.push({data:he,start:ke+Ce,end:ke+Ce+de.dataLength,codingpasses:de.codingpasses}),Ce+=de.dataLength}}}return Ce}function ee(ye,he,ke,le,Ce,Be,we,xe){for(var Ie=le.tbx0,Re=le.tby0,Le=le.tbx1-le.tbx0,Oe=le.codeblocks,Ve=le.type.charAt(0)==="H"?1:0,Xe=le.type.charAt(1)==="H"?he:0,We=0,t=Oe.length;We<t;++We){var h=Oe[We],d=h.tbx1_-h.tbx0_,x=h.tby1_-h.tby0_;if(!(d===0||x===0)&&h.data!==void 0){var E,C;E=new Ae(d,x,h.subbandType,h.zeroBitPlanes,Be),C=2;var b=h.data,U=0,D=0,k,Z,Y;for(k=0,Z=b.length;k<Z;k++)Y=b[k],U+=Y.end-Y.start,D+=Y.codingpasses;var W=new Uint8Array(U),F=0;for(k=0,Z=b.length;k<Z;k++){Y=b[k];var z=Y.data.subarray(Y.start,Y.end);W.set(z,F),F+=z.length}var G=new o(W,0,U);for(E.setDecoder(G),k=0;k<D;k++){switch(C){case 0:E.runSignificancePropagationPass();break;case 1:E.runMagnitudeRefinementPass();break;case 2:E.runCleanupPass(),xe&&E.checkSegmentationSymbol();break}C=(C+1)%3}var X=h.tbx0_-Ie+(h.tby0_-Re)*Le,A=E.coefficentsSign,N=E.coefficentsMagnitude,I=E.bitsDecoded,te=we?0:.5,fe,S,de;F=0;var se=le.type!=="LL";for(k=0;k<x;k++){var ie=X/Le|0,ge=2*ie*(he-Le)+Ve+Xe;for(fe=0;fe<d;fe++){if(S=N[F],S!==0){S=(S+te)*Ce,A[F]!==0&&(S=-S),de=I[F];var Pe=se?ge+(X<<1):X;we&&de>=Be?ye[Pe]=S:ye[Pe]=S*(1<<Be-de)}X++,F++}X+=Le-d}}}}function ne(ye,he,ke){for(var le=he.components[ke],Ce=le.codingStyleParameters,Be=le.quantizationParameters,we=Ce.decompositionLevelsCount,xe=Be.SPqcds,Ie=Be.scalarExpounded,Re=Be.guardBits,Le=Ce.segmentationSymbolUsed,Oe=ye.components[ke].precision,Ve=Ce.reversibleTransformation,Xe=Ve?new ze:new De,We=[],t=0,h=0;h<=we;h++){for(var d=le.resolutions[h],x=d.trx1-d.trx0,E=d.try1-d.try0,C=new Float32Array(x*E),b=0,U=d.subbands.length;b<U;b++){var D,k;Ie?(D=xe[t].mu,k=xe[t].epsilon,t++):(D=xe[0].mu,k=xe[0].epsilon+(h>0?1-h:0));var Z=d.subbands[b],Y=M[Z.type],W=Ve?1:Math.pow(2,Oe+Y-k)*(1+D/2048),F=Re+k-1;ee(C,x,E,Z,W,F,Ve,Le)}We.push({width:x,height:E,items:C})}var z=Xe.calculate(We,le.tcx0,le.tcy0);return{left:le.tcx0,top:le.tcy0,width:z.width,height:z.height,items:z.items}}function _e(ye){for(var he=ye.SIZ,ke=ye.components,le=he.Csiz,Ce=[],Be=0,we=ye.tiles.length;Be<we;Be++){var xe=ye.tiles[Be],Ie=[],Re;for(Re=0;Re<le;Re++)Ie[Re]=ne(ye,xe,Re);var Le=Ie[0],Oe=new Uint8Array(Le.items.length*le),Ve={left:Le.left,top:Le.top,width:Le.width,height:Le.height,items:Oe},Xe,We,t,h,d,x=0,E,C,b,U,D,k,Z,Y,W,F;if(xe.codingStyleDefaultParameters.multipleComponentTransform){var z=le===4,G=Ie[0].items,X=Ie[1].items,A=Ie[2].items,N=z?Ie[3].items:null;Xe=ke[0].precision-8,We=(128<<Xe)+.5,t=255*(1<<Xe),d=t*.5,h=-d;var I=xe.components[0],te=le-3;if(C=G.length,I.codingStyleParameters.reversibleTransformation)for(E=0;E<C;E++,x+=te)b=G[E]+We,U=X[E],D=A[E],Z=b-(D+U>>2),k=Z+D,Y=Z+U,Oe[x++]=k<=0?0:k>=t?255:k>>Xe,Oe[x++]=Z<=0?0:Z>=t?255:Z>>Xe,Oe[x++]=Y<=0?0:Y>=t?255:Y>>Xe;else for(E=0;E<C;E++,x+=te)b=G[E]+We,U=X[E],D=A[E],k=b+1.402*D,Z=b-.34413*U-.71414*D,Y=b+1.772*U,Oe[x++]=k<=0?0:k>=t?255:k>>Xe,Oe[x++]=Z<=0?0:Z>=t?255:Z>>Xe,Oe[x++]=Y<=0?0:Y>=t?255:Y>>Xe;if(z)for(E=0,x=3;E<C;E++,x+=4)W=N[E],Oe[x]=W<=h?0:W>=d?255:W+We>>Xe}else for(Re=0;Re<le;Re++){var fe=Ie[Re].items;for(Xe=ke[Re].precision-8,We=(128<<Xe)+.5,t=127.5*(1<<Xe),h=-t,x=Re,E=0,C=fe.length;E<C;E++)F=fe[E],Oe[x]=F<=h?0:F>=t?255:F+We>>Xe,x+=le}Ce.push(Ve)}return Ce}function ae(ye,he){for(var ke=ye.SIZ,le=ke.Csiz,Ce=ye.tiles[he],Be=0;Be<le;Be++){var we=Ce.components[Be],xe=ye.currentTile.QCC[Be]!==void 0?ye.currentTile.QCC[Be]:ye.currentTile.QCD;we.quantizationParameters=xe;var Ie=ye.currentTile.COC[Be]!==void 0?ye.currentTile.COC[Be]:ye.currentTile.COD;we.codingStyleParameters=Ie}Ce.codingStyleDefaultParameters=ye.currentTile.COD}var Me=function(){function he(ke,le){var Ce=l(Math.max(ke,le))+1;this.levels=[];for(var Be=0;Be<Ce;Be++){var we={width:ke,height:le,items:[]};this.levels.push(we),ke=Math.ceil(ke/2),le=Math.ceil(le/2)}}return he.prototype={reset:function(le,Ce){for(var Be=0,we=0,xe;Be<this.levels.length;){xe=this.levels[Be];var Ie=le+Ce*xe.width;if(xe.items[Ie]!==void 0){we=xe.items[Ie];break}xe.index=Ie,le>>=1,Ce>>=1,Be++}Be--,xe=this.levels[Be],xe.items[xe.index]=we,this.currentLevel=Be,delete this.value},incrementValue:function(){var le=this.levels[this.currentLevel];le.items[le.index]++},nextLevel:function(){var le=this.currentLevel,Ce=this.levels[le],Be=Ce.items[Ce.index];return le--,le<0?(this.value=Be,!1):(this.currentLevel=le,Ce=this.levels[le],Ce.items[Ce.index]=Be,!0)}},he}(),Ne=function(){function he(ke,le,Ce){var Be=l(Math.max(ke,le))+1;this.levels=[];for(var we=0;we<Be;we++){for(var xe=new Uint8Array(ke*le),Ie=0,Re=xe.length;Ie<Re;Ie++)xe[Ie]=Ce;var Le={width:ke,height:le,items:xe};this.levels.push(Le),ke=Math.ceil(ke/2),le=Math.ceil(le/2)}}return he.prototype={reset:function(le,Ce,Be){for(var we=0;we<this.levels.length;){var xe=this.levels[we],Ie=le+Ce*xe.width;xe.index=Ie;var Re=xe.items[Ie];if(Re===255)break;if(Re>Be)return this.currentLevel=we,this.propagateValues(),!1;le>>=1,Ce>>=1,we++}return this.currentLevel=we-1,!0},incrementValue:function(le){var Ce=this.levels[this.currentLevel];Ce.items[Ce.index]=le+1,this.propagateValues()},propagateValues:function(){for(var le=this.currentLevel,Ce=this.levels[le],Be=Ce.items[Ce.index];--le>=0;)Ce=this.levels[le],Ce.items[Ce.index]=Be},nextLevel:function(){var le=this.currentLevel,Ce=this.levels[le],Be=Ce.items[Ce.index];return Ce.items[Ce.index]=255,le--,le<0?!1:(this.currentLevel=le,Ce=this.levels[le],Ce.items[Ce.index]=Be,!0)}},he}(),Ae=function(){var he=17,ke=18,le=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]),Ce=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]),Be=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 we(xe,Ie,Re,Le,Oe){this.width=xe,this.height=Ie,this.contextLabelTable=Re==="HH"?Be:Re==="HL"?Ce:le;var Ve=xe*Ie;this.neighborsSignificance=new Uint8Array(Ve),this.coefficentsSign=new Uint8Array(Ve),this.coefficentsMagnitude=Oe>14?new Uint32Array(Ve):Oe>6?new Uint16Array(Ve):new Uint8Array(Ve),this.processingFlags=new Uint8Array(Ve);var Xe=new Uint8Array(Ve);if(Le!==0)for(var We=0;We<Ve;We++)Xe[We]=Le;this.bitsDecoded=Xe,this.reset()}return we.prototype={setDecoder:function(Ie){this.decoder=Ie},reset:function(){this.contexts=new Int8Array(19),this.contexts[0]=4<<1|0,this.contexts[he]=46<<1|0,this.contexts[ke]=3<<1|0},setNeighborsSignificance:function(Ie,Re,Le){var Oe=this.neighborsSignificance,Ve=this.width,Xe=this.height,We=Re>0,t=Re+1<Ve,h;Ie>0&&(h=Le-Ve,We&&(Oe[h-1]+=16),t&&(Oe[h+1]+=16),Oe[h]+=4),Ie+1<Xe&&(h=Le+Ve,We&&(Oe[h-1]+=16),t&&(Oe[h+1]+=16),Oe[h]+=4),We&&(Oe[Le-1]+=1),t&&(Oe[Le+1]+=1),Oe[Le]|=128},runSignificancePropagationPass:function(){for(var Ie=this.decoder,Re=this.width,Le=this.height,Oe=this.coefficentsMagnitude,Ve=this.coefficentsSign,Xe=this.neighborsSignificance,We=this.processingFlags,t=this.contexts,h=this.contextLabelTable,d=this.bitsDecoded,x=~1,E=1,C=2,b=0;b<Le;b+=4)for(var U=0;U<Re;U++)for(var D=b*Re+U,k=0;k<4;k++,D+=Re){var Z=b+k;if(Z>=Le)break;if(We[D]&=x,!(Oe[D]||!Xe[D])){var Y=h[Xe[D]],W=Ie.readBit(t,Y);if(W){var F=this.decodeSignBit(Z,U,D);Ve[D]=F,Oe[D]=1,this.setNeighborsSignificance(Z,U,D),We[D]|=C}d[D]++,We[D]|=E}}},decodeSignBit:function(Ie,Re,Le){var Oe=this.width,Ve=this.height,Xe=this.coefficentsMagnitude,We=this.coefficentsSign,t,h,d,x,E,C;x=Re>0&&Xe[Le-1]!==0,Re+1<Oe&&Xe[Le+1]!==0?(d=We[Le+1],x?(h=We[Le-1],t=1-d-h):t=1-d-d):x?(h=We[Le-1],t=1-h-h):t=0;var b=3*t;return x=Ie>0&&Xe[Le-Oe]!==0,Ie+1<Ve&&Xe[Le+Oe]!==0?(d=We[Le+Oe],x?(h=We[Le-Oe],t=1-d-h+b):t=1-d-d+b):x?(h=We[Le-Oe],t=1-h-h+b):t=b,t>=0?(E=9+t,C=this.decoder.readBit(this.contexts,E)):(E=9-t,C=this.decoder.readBit(this.contexts,E)^1),C},runMagnitudeRefinementPass:function(){for(var Ie=this.decoder,Re=this.width,Le=this.height,Oe=this.coefficentsMagnitude,Ve=this.neighborsSignificance,Xe=this.contexts,We=this.bitsDecoded,t=this.processingFlags,h=1,d=2,x=Re*Le,E=Re*4,C=0,b;C<x;C=b){b=Math.min(x,C+E);for(var U=0;U<Re;U++)for(var D=C+U;D<b;D+=Re)if(!(!Oe[D]||(t[D]&h)!=0)){var k=16;if((t[D]&d)!=0){t[D]^=d;var Z=Ve[D]&127;k=Z===0?15:14}var Y=Ie.readBit(Xe,k);Oe[D]=Oe[D]<<1|Y,We[D]++,t[D]|=h}}},runCleanupPass:function(){for(var Ie=this.decoder,Re=this.width,Le=this.height,Oe=this.neighborsSignificance,Ve=this.coefficentsMagnitude,Xe=this.coefficentsSign,We=this.contexts,t=this.contextLabelTable,h=this.bitsDecoded,d=this.processingFlags,x=1,E=2,C=Re,b=Re*2,U=Re*3,D,k=0;k<Le;k=D){D=Math.min(k+4,Le);for(var Z=k*Re,Y=k+3<Le,W=0;W<Re;W++){var F=Z+W,z=Y&&d[F]===0&&d[F+C]===0&&d[F+b]===0&&d[F+U]===0&&Oe[F]===0&&Oe[F+C]===0&&Oe[F+b]===0&&Oe[F+U]===0,G=0,X=F,A=k,N;if(z){var I=Ie.readBit(We,ke);if(!I){h[F]++,h[F+C]++,h[F+b]++,h[F+U]++;continue}G=Ie.readBit(We,he)<<1|Ie.readBit(We,he),G!==0&&(A=k+G,X+=G*Re),N=this.decodeSignBit(A,W,X),Xe[X]=N,Ve[X]=1,this.setNeighborsSignificance(A,W,X),d[X]|=E,X=F;for(var te=k;te<=A;te++,X+=Re)h[X]++;G++}for(A=k+G;A<D;A++,X+=Re)if(!(Ve[X]||(d[X]&x)!=0)){var fe=t[Oe[X]],S=Ie.readBit(We,fe);S===1&&(N=this.decodeSignBit(A,W,X),Xe[X]=N,Ve[X]=1,this.setNeighborsSignificance(A,W,X),d[X]|=E),h[X]++}}}},checkSegmentationSymbol:function(){var Ie=this.decoder,Re=this.contexts,Le=Ie.readBit(Re,he)<<3|Ie.readBit(Re,he)<<2|Ie.readBit(Re,he)<<1|Ie.readBit(Re,he);Le!==10&&f("JPX Error: Invalid segmentation symbol")}},we}(),Fe=function(){function he(){}return he.prototype.calculate=function(le,Ce,Be){for(var we=le[0],xe=1,Ie=le.length;xe<Ie;xe++)we=this.iterate(we,le[xe],Ce,Be);return we},he.prototype.extend=function(le,Ce,Be){var we=Ce-1,xe=Ce+1,Ie=Ce+Be-2,Re=Ce+Be;le[we--]=le[xe++],le[Re++]=le[Ie--],le[we--]=le[xe++],le[Re++]=le[Ie--],le[we--]=le[xe++],le[Re++]=le[Ie--],le[we]=le[xe],le[Re]=le[Ie]},he.prototype.iterate=function(le,Ce,Be,we){var xe=le.width,Ie=le.height,Re=le.items,Le=Ce.width,Oe=Ce.height,Ve=Ce.items,Xe,We,t,h,d,x;for(t=0,Xe=0;Xe<Ie;Xe++)for(h=Xe*2*Le,We=0;We<xe;We++,t++,h+=2)Ve[h]=Re[t];Re=le.items=null;var E=4,C=new Float32Array(Le+2*E);if(Le===1){if((Be&1)!=0)for(x=0,t=0;x<Oe;x++,t+=Le)Ve[t]*=.5}else for(x=0,t=0;x<Oe;x++,t+=Le)C.set(Ve.subarray(t,t+Le),E),this.extend(C,E,Le),this.filter(C,E,Le),Ve.set(C.subarray(E,E+Le),t);var b=16,U=[];for(Xe=0;Xe<b;Xe++)U.push(new Float32Array(Oe+2*E));var D,k=0;if(le=E+Oe,Oe===1){if((we&1)!=0)for(d=0;d<Le;d++)Ve[d]*=.5}else for(d=0;d<Le;d++){if(k===0){for(b=Math.min(Le-d,b),t=d,h=E;h<le;t+=Le,h++)for(D=0;D<b;D++)U[D][h]=Ve[t+D];k=b}k--;var Z=U[k];if(this.extend(Z,E,Oe),this.filter(Z,E,Oe),k===0)for(t=d-b+1,h=E;h<le;t+=Le,h++)for(D=0;D<b;D++)Ve[t+D]=U[D][h]}return{width:Le,height:Oe,items:Ve}},he}(),De=function(){function he(){Fe.call(this)}return he.prototype=Object.create(Fe.prototype),he.prototype.filter=function(le,Ce,Be){var we=Be>>1;Ce=Ce|0;var xe,Ie,Re,Le,Oe=-1.586134342059924,Ve=-.052980118572961,Xe=.882911075530934,We=.443506852043971,t=1.230174104914001,h=1/t;for(xe=Ce-3,Ie=we+4;Ie--;xe+=2)le[xe]*=h;for(xe=Ce-2,Re=We*le[xe-1],Ie=we+3;Ie--&&(Le=We*le[xe+1],le[xe]=t*le[xe]-Re-Le,Ie--);xe+=2)xe+=2,Re=We*le[xe+1],le[xe]=t*le[xe]-Re-Le;for(xe=Ce-1,Re=Xe*le[xe-1],Ie=we+2;Ie--&&(Le=Xe*le[xe+1],le[xe]-=Re+Le,Ie--);xe+=2)xe+=2,Re=Xe*le[xe+1],le[xe]-=Re+Le;for(xe=Ce,Re=Ve*le[xe-1],Ie=we+1;Ie--&&(Le=Ve*le[xe+1],le[xe]-=Re+Le,Ie--);xe+=2)xe+=2,Re=Ve*le[xe+1],le[xe]-=Re+Le;if(we!==0)for(xe=Ce+1,Re=Oe*le[xe-1],Ie=we;Ie--&&(Le=Oe*le[xe+1],le[xe]-=Re+Le,Ie--);xe+=2)xe+=2,Re=Oe*le[xe+1],le[xe]-=Re+Le},he}(),ze=function(){function he(){Fe.call(this)}return he.prototype=Object.create(Fe.prototype),he.prototype.filter=function(le,Ce,Be){var we=Be>>1;Ce=Ce|0;var xe,Ie;for(xe=Ce,Ie=we+1;Ie--;xe+=2)le[xe]-=le[xe-1]+le[xe+1]+2>>2;for(xe=Ce+1,Ie=we;Ie--;xe+=2)le[xe]+=le[xe-1]+le[xe+1]>>1},he}();return T}(),u=function(){function M(){}M.prototype={getContexts:function(Fe){return Fe in this?this[Fe]:this[Fe]=new Int8Array(1<<16)}};function T(Fe,De,ze){this.data=Fe,this.start=De,this.end=ze}T.prototype={get decoder(){var Fe=new o(this.data,this.start,this.end);return _(this,"decoder",Fe)},get contextCache(){var Fe=new M;return _(this,"contextCache",Fe)}};function B(Fe,De,ze){var ye=Fe.getContexts(De),he=1;function ke(Be){for(var we=0,xe=0;xe<Be;xe++){var Ie=ze.readBit(ye,he);he=he<256?he<<1|Ie:(he<<1|Ie)&511|256,we=we<<1|Ie}return we>>>0}var le=ke(1),Ce=ke(1)?ke(1)?ke(1)?ke(1)?ke(1)?ke(32)+4436:ke(12)+340:ke(8)+84:ke(6)+20:ke(4)+4:ke(2);return le===0?Ce:Ce>0?-Ce:null}function H(Fe,De,ze){for(var ye=Fe.getContexts("IAID"),he=1,ke=0;ke<ze;ke++){var le=De.readBit(ye,he);he=he<<1|le}return ze<31?he&(1<<ze)-1:he&2147483647}var J=["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"],Q=[[{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}]],q=[{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}]}],O=[39717,1941,229,405],K=[32,8];function pe(Fe,De,ze){var ye=ze.decoder,he=ze.contextCache.getContexts("GB"),ke,le,Ce,Be,we,xe,Ie,Re=[],Le=31735;for(le=0;le<De;le++)for(we=Re[le]=new Uint8Array(Fe),xe=le<1?we:Re[le-1],Ie=le<2?we:Re[le-2],ke=Ie[0]<<13|Ie[1]<<12|Ie[2]<<11|xe[0]<<7|xe[1]<<6|xe[2]<<5|xe[3]<<4,Ce=0;Ce<Fe;Ce++)we[Ce]=Be=ye.readBit(he,ke),ke=(ke&Le)<<1|(Ce+3<Fe?Ie[Ce+3]<<11:0)|(Ce+4<Fe?xe[Ce+4]<<4:0)|Be;return Re}function R(Fe,De,ze,ye,he,ke,le,Ce){if(Fe&&f("JBIG2 error: MMR encoding is not supported"),ye===0&&!ke&&!he&&le.length===4&&le[0].x===3&&le[0].y===-1&&le[1].x===-3&&le[1].y===-1&&le[2].x===2&&le[2].y===-2&&le[3].x===-2&&le[3].y===-2)return pe(De,ze,Ce);var Be=!!ke,we=Q[ye].concat(le);we.sort(function(se,ie){return se.y-ie.y||se.x-ie.x});var xe=we.length,Ie=new Int8Array(xe),Re=new Int8Array(xe),Le=[],Oe=0,Ve=0,Xe=0,We=0,t,h;for(h=0;h<xe;h++)Ie[h]=we[h].x,Re[h]=we[h].y,Ve=Math.min(Ve,we[h].x),Xe=Math.max(Xe,we[h].x),We=Math.min(We,we[h].y),h<xe-1&&we[h].y===we[h+1].y&&we[h].x===we[h+1].x-1?Oe|=1<<xe-1-h:Le.push(h);var d=Le.length,x=new Int8Array(d),E=new Int8Array(d),C=new Uint16Array(d);for(t=0;t<d;t++)h=Le[t],x[t]=we[h].x,E[t]=we[h].y,C[t]=1<<xe-1-h;for(var b=-Ve,U=-We,D=De-Xe,k=O[ye],Z=new Uint8Array(De),Y=[],W=Ce.decoder,F=Ce.contextCache.getContexts("GB"),z=0,G,X,A,N=0,I,te,fe=0;fe<ze;fe++){if(he){var S=W.readBit(F,k);if(z^=S,z){Y.push(Z);continue}}for(Z=new Uint8Array(Z),Y.push(Z),G=0;G<De;G++){if(Be&&ke[fe][G]){Z[G]=0;continue}if(G>=b&&G<D&&fe>=U)for(N=N<<1&Oe,h=0;h<d;h++)X=fe+E[h],A=G+x[h],I=Y[X][A],I&&(I=C[h],N|=I);else for(N=0,te=xe-1,h=0;h<xe;h++,te--)A=G+Ie[h],A>=0&&A<De&&(X=fe+Re[h],X>=0&&(I=Y[X][A],I&&(N|=I<<te)));var de=W.readBit(F,N);Z[G]=de}}return Y}function Te(Fe,De,ze,ye,he,ke,le,Ce,Be){var we=q[ze].coding;ze===0&&(we=we.concat([Ce[0]]));var xe=we.length,Ie=new Int32Array(xe),Re=new Int32Array(xe),Le;for(Le=0;Le<xe;Le++)Ie[Le]=we[Le].x,Re[Le]=we[Le].y;var Oe=q[ze].reference;ze===0&&(Oe=Oe.concat([Ce[1]]));var Ve=Oe.length,Xe=new Int32Array(Ve),We=new Int32Array(Ve);for(Le=0;Le<Ve;Le++)Xe[Le]=Oe[Le].x,We[Le]=Oe[Le].y;for(var t=ye[0].length,h=ye.length,d=K[ze],x=[],E=Be.decoder,C=Be.contextCache.getContexts("GR"),b=0,U=0;U<De;U++){if(le){var D=E.readBit(C,d);b^=D,b&&f("JBIG2 error: prediction is not supported")}var k=new Uint8Array(Fe);x.push(k);for(var Z=0;Z<Fe;Z++){var Y,W,F=0;for(Le=0;Le<xe;Le++)Y=U+Re[Le],W=Z+Ie[Le],Y<0||W<0||W>=Fe?F<<=1:F=F<<1|x[Y][W];for(Le=0;Le<Ve;Le++)Y=U+We[Le]+ke,W=Z+Xe[Le]+he,Y<0||Y>=h||W<0||W>=t?F<<=1:F=F<<1|ye[Y][W];var z=E.readBit(C,F);k[Z]=z}}return x}function re(Fe,De,ze,ye,he,ke,le,Ce,Be,we,xe){Fe&&f("JBIG2 error: huffman is not supported");for(var Ie=[],Re=0,Le=l(ze.length+ye),Oe=xe.decoder,Ve=xe.contextCache;Ie.length<ye;){var Xe=B(Ve,"IADH",Oe);Re+=Xe;for(var We=0;;){var t=B(Ve,"IADW",Oe);if(t===null)break;We+=t;var h;if(De){var d=B(Ve,"IAAI",Oe);if(d>1)h=oe(Fe,De,We,Re,0,d,1,ze.concat(Ie),Le,0,0,1,0,ke,Be,we,xe);else{var x=H(Ve,Oe,Le),E=B(Ve,"IARDX",Oe),C=B(Ve,"IARDY",Oe),b=x<ze.length?ze[x]:Ie[x-ze.length];h=Te(We,Re,Be,b,E,C,!1,we,xe)}}else h=R(!1,We,Re,le,!1,null,Ce,xe);Ie.push(h)}}for(var U=[],D=[],k=!1,Z=ze.length+ye;D.length<Z;){for(var Y=B(Ve,"IAEX",Oe);Y--;)D.push(k);k=!k}for(var W=0,F=ze.length;W<F;W++)D[W]&&U.push(ze[W]);for(var z=0;z<ye;W++,z++)D[W]&&U.push(Ie[z]);return U}function oe(Fe,De,ze,ye,he,ke,le,Ce,Be,we,xe,Ie,Re,Le,Oe,Ve,Xe){Fe&&f("JBIG2 error: huffman is not supported");var We=[],t,h;for(t=0;t<ye;t++){if(h=new Uint8Array(ze),he)for(var d=0;d<ze;d++)h[d]=he;We.push(h)}var x=Xe.decoder,E=Xe.contextCache,C=-B(E,"IADT",x),b=0;for(t=0;t<ke;){var U=B(E,"IADT",x);C+=U;var D=B(E,"IAFS",x);b+=D;var k=b;do{var Z=le===1?0:B(E,"IAIT",x),Y=le*C+Z,W=H(E,x,Be),F=De&&B(E,"IARI",x),z=Ce[W],G=z[0].length,X=z.length;if(F){var A=B(E,"IARDW",x),N=B(E,"IARDH",x),I=B(E,"IARDX",x),te=B(E,"IARDY",x);G+=A,X+=N,z=Te(G,X,Oe,z,(A>>1)+I,(N>>1)+te,!1,Ve,Xe)}var fe=Y-(Ie&1?0:X),S=k-(Ie&2?G:0),de,se,ie;if(we){for(de=0;de<X;de++)if(h=We[S+de],!!h){ie=z[de];var ge=Math.min(ze-fe,G);switch(Re){case 0:for(se=0;se<ge;se++)h[fe+se]|=ie[se];break;case 2:for(se=0;se<ge;se++)h[fe+se]^=ie[se];break;default:f("JBIG2 error: operator "+Re+" is not supported")}}k+=X-1}else{for(se=0;se<X;se++)if(h=We[fe+se],!!h)switch(ie=z[se],Re){case 0:for(de=0;de<G;de++)h[S+de]|=ie[de];break;case 2:for(de=0;de<G;de++)h[S+de]^=ie[de];break;default:f("JBIG2 error: operator "+Re+" is not supported")}k+=G-1}t++;var Pe=B(E,"IADS",x);if(Pe===null)break;k+=Pe+xe}while(!0)}return We}function me(Fe,De){var ze={};ze.number=c(Fe,De);var ye=Fe[De+4],he=ye&63;J[he]||f("JBIG2 error: invalid segment type: "+he),ze.type=he,ze.typeName=J[he],ze.deferredNonRetain=!!(ye&128);var ke=!!(ye&64),le=Fe[De+5],Ce=le>>5&7,Be=[le&31],we=De+6;if(le===7){Ce=c(Fe,we-1)&536870911,we+=3;var xe=Ce+7>>3;for(Be[0]=Fe[we++];--xe>0;)Be.push(Fe[we++])}else(le===5||le===6)&&f("JBIG2 error: invalid referred-to flags");ze.retainBits=Be;var Ie=ze.number<=256?1:ze.number<=65536?2:4,Re=[],Le,Oe;for(Le=0;Le<Ce;Le++){var Ve=Ie===1?Fe[we]:Ie===2?p(Fe,we):c(Fe,we);Re.push(Ve),we+=Ie}if(ze.referredTo=Re,ke?(ze.pageAssociation=c(Fe,we),we+=4):ze.pageAssociation=Fe[we++],ze.length=c(Fe,we),we+=4,ze.length===4294967295)if(he===38){var Xe=$(Fe,we),We=Fe[we+ee],t=!!(We&1),h=6,d=new Uint8Array(h);for(t||(d[0]=255,d[1]=172),d[2]=Xe.height>>>24&255,d[3]=Xe.height>>16&255,d[4]=Xe.height>>8&255,d[5]=Xe.height&255,Le=we,Oe=Fe.length;Le<Oe;Le++){for(var x=0;x<h&&d[x]===Fe[Le+x];)x++;if(x===h){ze.length=Le+h;break}}ze.length===4294967295&&f("JBIG2 error: segment end was not found")}else f("JBIG2 error: invalid unknown segment length");return ze.headerEnd=we,ze}function ue(Fe,De,ze,ye){for(var he=[],ke=ze;ke<ye;){var le=me(De,ke);ke=le.headerEnd;var Ce={header:le,data:De};if(Fe.randomAccess||(Ce.start=ke,ke+=le.length,Ce.end=ke),he.push(Ce),le.type===51)break}if(Fe.randomAccess)for(var Be=0,we=he.length;Be<we;Be++)he[Be].start=ke,ke+=he[Be].header.length,he[Be].end=ke;return he}function $(Fe,De){return{width:c(Fe,De),height:c(Fe,De+4),x:c(Fe,De+8),y:c(Fe,De+12),combinationOperator:Fe[De+16]&7}}var ee=17;function ne(Fe,De){var ze=Fe.header,ye=Fe.data,he=Fe.start,ke=Fe.end,le,Ce,Be,we;switch(ze.type){case 0:var xe={},Ie=p(ye,he);if(xe.huffman=!!(Ie&1),xe.refinement=!!(Ie&2),xe.huffmanDHSelector=Ie>>2&3,xe.huffmanDWSelector=Ie>>4&3,xe.bitmapSizeSelector=Ie>>6&1,xe.aggregationInstancesSelector=Ie>>7&1,xe.bitmapCodingContextUsed=!!(Ie&256),xe.bitmapCodingContextRetained=!!(Ie&512),xe.template=Ie>>10&3,xe.refinementTemplate=Ie>>12&1,he+=2,!xe.huffman){for(we=xe.template===0?4:1,Ce=[],Be=0;Be<we;Be++)Ce.push({x:v(ye,he),y:v(ye,he+1)}),he+=2;xe.at=Ce}if(xe.refinement&&!xe.refinementTemplate){for(Ce=[],Be=0;Be<2;Be++)Ce.push({x:v(ye,he),y:v(ye,he+1)}),he+=2;xe.refinementAt=Ce}xe.numberOfExportedSymbols=c(ye,he),he+=4,xe.numberOfNewSymbols=c(ye,he),he+=4,le=[xe,ze.number,ze.referredTo,ye,he,ke];break;case 6:case 7:var Re={};Re.info=$(ye,he),he+=ee;var Le=p(ye,he);if(he+=2,Re.huffman=!!(Le&1),Re.refinement=!!(Le&2),Re.stripSize=1<<(Le>>2&3),Re.referenceCorner=Le>>4&3,Re.transposed=!!(Le&64),Re.combinationOperator=Le>>7&3,Re.defaultPixelValue=Le>>9&1,Re.dsOffset=Le<<17>>27,Re.refinementTemplate=Le>>15&1,Re.huffman){var Oe=p(ye,he);he+=2,Re.huffmanFS=Oe&3,Re.huffmanDS=Oe>>2&3,Re.huffmanDT=Oe>>4&3,Re.huffmanRefinementDW=Oe>>6&3,Re.huffmanRefinementDH=Oe>>8&3,Re.huffmanRefinementDX=Oe>>10&3,Re.huffmanRefinementDY=Oe>>12&3,Re.huffmanRefinementSizeSelector=!!(Oe&14)}if(Re.refinement&&!Re.refinementTemplate){for(Ce=[],Be=0;Be<2;Be++)Ce.push({x:v(ye,he),y:v(ye,he+1)}),he+=2;Re.refinementAt=Ce}Re.numberOfSymbolInstances=c(ye,he),he+=4,Re.huffman&&f("JBIG2 error: huffman is not supported"),le=[Re,ze.referredTo,ye,he,ke];break;case 38:case 39:var Ve={};Ve.info=$(ye,he),he+=ee;var Xe=ye[he++];if(Ve.mmr=!!(Xe&1),Ve.template=Xe>>1&3,Ve.prediction=!!(Xe&8),!Ve.mmr){for(we=Ve.template===0?4:1,Ce=[],Be=0;Be<we;Be++)Ce.push({x:v(ye,he),y:v(ye,he+1)}),he+=2;Ve.at=Ce}le=[Ve,ye,he,ke];break;case 48:var We={width:c(ye,he),height:c(ye,he+4),resolutionX:c(ye,he+8),resolutionY:c(ye,he+12)};We.height===4294967295&&delete We.height;var t=ye[he+16];p(ye,he+17),We.lossless=!!(t&1),We.refinement=!!(t&2),We.defaultPixelValue=t>>2&1,We.combinationOperator=t>>3&3,We.requiresBuffer=!!(t&32),We.combinationOperatorOverride=!!(t&64),le=[We];break;case 49:break;case 50:break;case 51:break;case 62:break;default:f("JBIG2 error: segment type "+ze.typeName+"("+ze.type+") is not implemented")}var h="on"+ze.typeName;h in De&&De[h].apply(De,le)}function _e(Fe,De){for(var ze=0,ye=Fe.length;ze<ye;ze++)ne(Fe[ze],De)}function ae(Fe,De,ze){var ye=De;(Fe[ye]!==151||Fe[ye+1]!==74||Fe[ye+2]!==66||Fe[ye+3]!==50||Fe[ye+4]!==13||Fe[ye+5]!==10||Fe[ye+6]!==26||Fe[ye+7]!==10)&&f("JBIG2 error: invalid header");var he={};ye+=8;var ke=Fe[ye++];he.randomAccess=!(ke&1),ke&2||(he.numberOfPages=c(Fe,ye),ye+=4),ue(he,Fe,ye,ze),f("Not implemented")}function Me(Fe){for(var De=new Ne,ze=0,ye=Fe.length;ze<ye;ze++){var he=Fe[ze],ke=ue({},he.data,he.start,he.end);_e(ke,De)}return De.buffer}function Ne(){}Ne.prototype={onPageInformation:function(De){this.currentPageInfo=De;var ze=De.width+7>>3,ye=new Uint8Array(ze*De.height);if(De.defaultPixelValue)for(var he=0,ke=ye.length;he<ke;he++)ye[he]=255;this.buffer=ye},drawBitmap:function(De,ze){var ye=this.currentPageInfo,he=De.width,ke=De.height,le=ye.width+7>>3,Ce=ye.combinationOperatorOverride?De.combinationOperator:ye.combinationOperator,Be=this.buffer,we=128>>(De.x&7),xe=De.y*le+(De.x>>3),Ie,Re,Le,Oe;switch(Ce){case 0:for(Ie=0;Ie<ke;Ie++){for(Le=we,Oe=xe,Re=0;Re<he;Re++)ze[Ie][Re]&&(Be[Oe]|=Le),Le>>=1,Le||(Le=128,Oe++);xe+=le}break;case 2:for(Ie=0;Ie<ke;Ie++){for(Le=we,Oe=xe,Re=0;Re<he;Re++)ze[Ie][Re]&&(Be[Oe]^=Le),Le>>=1,Le||(Le=128,Oe++);xe+=le}break;default:f("JBIG2 error: operator "+Ce+" is not supported")}},onImmediateGenericRegion:function(De,ze,ye,he){var ke=De.info,le=new T(ze,ye,he),Ce=R(De.mmr,ke.width,ke.height,De.template,De.prediction,null,De.at,le);this.drawBitmap(ke,Ce)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(De,ze,ye,he,ke,le){var Ce;De.huffman&&f("JBIG2 error: huffman is not supported");var Be=this.symbols;Be||(this.symbols=Be={});for(var we=[],xe=0,Ie=ye.length;xe<Ie;xe++)we=we.concat(Be[ye[xe]]);var Re=new T(he,ke,le);Be[ze]=re(De.huffman,De.refinement,we,De.numberOfNewSymbols,De.numberOfExportedSymbols,Ce,De.template,De.at,De.refinementTemplate,De.refinementAt,Re)},onImmediateTextRegion:function(De,ze,ye,he,ke){for(var le=De.info,Ce,Be=this.symbols,we=[],xe=0,Ie=ze.length;xe<Ie;xe++)we=we.concat(Be[ze[xe]]);var Re=l(we.length),Le=new T(ye,he,ke),Oe=oe(De.huffman,De.refinement,le.width,le.height,De.defaultPixelValue,De.numberOfSymbolInstances,De.stripSize,we,Re,De.transposed,De.dsOffset,De.referenceCorner,De.combinationOperator,Ce,De.refinementTemplate,De.refinementAt,Le);this.drawBitmap(le,Oe)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)}};function Ae(){}return Ae.prototype={parseChunks:function(De){return Me(De)}},Ae}();function l(w){for(var M=1,T=0;w>M;)M<<=1,T++;return T}function v(w,M){return w[M]<<24>>24}function p(w,M){return w[M]<<8|w[M+1]}function c(w,M){return(w[M]<<24|w[M+1]<<16|w[M+2]<<8|w[M+3])>>>0}function _(w,M,T){return Object.defineProperty(w,M,{value:T,enumerable:!0,configurable:!0,writable:!1}),T}var f=function(){throw console.error.apply(console,arguments),new Error("PDFJS error: "+arguments[0])},g=function(){console.warn.apply(console,arguments)},y=function(){console.info.apply(console,arguments)};u.prototype.parse=function(M){var T=0,B=M.length;(M[T]!==151||M[T+1]!==74||M[T+2]!==66||M[T+3]!==50||M[T+4]!==13||M[T+5]!==10||M[T+6]!==26||M[T+7]!==10)&&f("JBIG2 error: invalid header");var H={};T+=8;var J=M[T++];H.randomAccess=!(J&1),J&2||(H.numberOfPages=c(M,T),T+=4);for(var Q=this.parseChunks([{data:M,start:T,end:B}]),q=Q.currentPageInfo.width,O=Q.currentPageInfo.height,K=Q.buffer,M=new Uint8Array(q*O),pe=0,R=0,Te=0;Te<O;Te++)for(var re=0,oe,me=0;me<q;me++)re||(re=128,oe=K[R++]),M[pe++]=oe&re?0:255,re>>=1;this.width=q,this.height=O,this.data=M},e.JpegImage=s,e.JpxImage=a,e.Jbig2Image=u})(PDFJS||(PDFJS={})),function(){var e,r=0,s=null,o=null;e=window.FFT={};var a={o:function(u){if(u!==0&&(u&u-1)==0)r=u,a.B(),a.q(),a.i();else throw new Error("init: radix-2 required")},X:function(u,l){a.G(u,l,1)},e:function(u,l){var v=1/r;a.G(u,l,-1);for(var p=0;p<r;p++)u[p]*=v,l[p]*=v},n:function(u,l){for(var v=[],p=[],c=0,_=0;_<r;_++){c=_*r;for(var f=0;f<r;f++)v[f]=u[f+c],p[f]=l[f+c];a.X(v,p);for(var g=0;g<r;g++)u[g+c]=v[g],l[g+c]=p[g]}for(var y=0;y<r;y++){for(var w=0;w<r;w++)c=y+w*r,v[w]=u[c],p[w]=l[c];a.X(v,p);for(var M=0;M<r;M++)c=y+M*r,u[c]=v[M],l[c]=p[M]}},f:function(u,l){for(var v=[],p=[],c=0,_=0;_<r;_++){c=_*r;for(var f=0;f<r;f++)v[f]=u[f+c],p[f]=l[f+c];a.e(v,p);for(var g=0;g<r;g++)u[g+c]=v[g],l[g+c]=p[g]}for(var y=0;y<r;y++){for(var w=0;w<r;w++)c=y+w*r,v[w]=u[c],p[w]=l[c];a.e(v,p);for(var M=0;M<r;M++)c=y+M*r,u[c]=v[M],l[c]=p[M]}},G:function(u,l,v){for(var p,c,_,f,g,y,w,M,T,B=r>>2,H=0;H<r;H++)f=s[H],H<f&&(g=u[H],u[H]=u[f],u[f]=g,g=l[H],l[H]=l[f],l[f]=g);for(var J=1;J<r;J<<=1){c=0,p=r/(J<<1);for(var Q=0;Q<J;Q++){y=o[c+B],w=v*o[c];for(var q=Q;q<r;q+=J<<1)_=q+J,M=y*u[_]+w*l[_],T=y*l[_]-w*u[_],u[_]=u[q]-M,u[q]+=M,l[_]=l[q]-T,l[q]+=T;c+=p}}},B:function(){var u=Uint32Array;r<=256?u=Uint8Array:r<=65536&&(u=Uint16Array),s=new u(r),o=new Float64Array(r*1.25)},j:function(){},q:function(){var u=0,l=0,v=0;for(s[0]=0;++u<r;){for(v=r>>1;v<=l;)l-=v,v>>=1;l+=v,s[u]=l}},i:function(){var u=r>>1,l=r>>2,v=r>>3,p=u+l,c=Math.sin(Math.PI/r),_=2*c*c,f=Math.sqrt(_*(2-_)),g=o[l]=1,y=o[0]=0;c=2*_;for(var w=1;w<v;w++)g-=_,_+=c*g,y+=f,f-=c*y,o[w]=y,o[l-w]=g;v!==0&&(o[v]=Math.sqrt(.5));for(var M=0;M<l;M++)o[u-M]=o[M];for(var T=0;T<p;T++)o[T+u]=-o[T]}};e.init=a.o,e.fft2d=a.n,e.ifft2d=a.f}.call(this),function(e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e():typeof define=="function"&&define.amd?define([],e):(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this).acorn=e()}(function(){return function e(r,s,o){function a(v,p){if(!s[v]){if(!r[v]){var c=typeof require=="function"&&require;if(!p&&c)return c(v,!0);if(u)return u(v,!0);throw c=Error("Cannot find module '"+v+"'"),c.code="MODULE_NOT_FOUND",c}c=s[v]={exports:{}},r[v][0].call(c.exports,function(_){var f=r[v][1][_];return a(f||_)},c,c.exports,e,r,s,o)}return s[v].exports}for(var u=typeof require=="function"&&require,l=0;l<o.length;l++)a(o[l]);return a}({1:[function(e,r,s){var o=e("./tokentype");e=e("./state").Parser.prototype,e.checkPropClash=function(u,l){if(!(6<=this.options.ecmaVersion&&(u.computed||u.method||u.shorthand))){var v=u.key;switch(v.type){case"Identifier":var p=v.name;break;case"Literal":p=String(v.value);break;default:return}var c=u.kind;if(6<=this.options.ecmaVersion)p==="__proto__"&&c==="init"&&(l.proto&&this.raiseRecoverable(v.start,"Redefinition of __proto__ property"),l.proto=!0);else{p="$"+p;var _=l[p];_?(p=c!=="init",(!this.strict&&!p||!_[c])&&p^_.init||this.raiseRecoverable(v.start,"Redefinition of property")):_=l[p]={init:!1,get:!1,set:!1},_[c]=!0}}},e.parseExpression=function(u,l){var v=this.start,p=this.startLoc,c=this.parseMaybeAssign(u,l);if(this.type===o.types.comma){for(v=this.startNodeAt(v,p),v.expressions=[c];this.eat(o.types.comma);)v.expressions.push(this.parseMaybeAssign(u,l));return this.finishNode(v,"SequenceExpression")}return c},e.parseMaybeAssign=function(u,l,v){if(this.inGenerator&&this.isContextual("yield"))return this.parseYield();var p=!1;l||(l={shorthandAssign:0,trailingComma:0},p=!0);var c=this.start,_=this.startLoc;(this.type==o.types.parenL||this.type==o.types.name)&&(this.potentialArrowAt=this.start);var f=this.parseMaybeConditional(u,l);return v&&(f=v.call(this,f,c,_)),this.type.isAssign?(p&&this.checkPatternErrors(l,!0),v=this.startNodeAt(c,_),v.operator=this.value,v.left=this.type===o.types.eq?this.toAssignable(f):f,l.shorthandAssign=0,this.checkLVal(f),this.next(),v.right=this.parseMaybeAssign(u),this.finishNode(v,"AssignmentExpression")):(p&&this.checkExpressionErrors(l,!0),f)},e.parseMaybeConditional=function(u,l){var v=this.start,p=this.startLoc,c=this.parseExprOps(u,l);return this.checkExpressionErrors(l)?c:this.eat(o.types.question)?(v=this.startNodeAt(v,p),v.test=c,v.consequent=this.parseMaybeAssign(),this.expect(o.types.colon),v.alternate=this.parseMaybeAssign(u),this.finishNode(v,"ConditionalExpression")):c},e.parseExprOps=function(u,l){var v=this.start,p=this.startLoc,c=this.parseMaybeUnary(l,!1);return this.checkExpressionErrors(l)?c:this.parseExprOp(c,v,p,-1,u)},e.parseExprOp=function(u,l,v,p,c){var _=this.type.binop;if(_!=null&&(!c||this.type!==o.types._in)&&_>p){var f=this.type===o.types.logicalOR||this.type===o.types.logicalAND,g=this.value;this.next();var y=this.start,w=this.startLoc,_=this.parseExprOp(this.parseMaybeUnary(null,!1),y,w,_,c);return u=this.buildBinary(l,v,u,_,g,f),this.parseExprOp(u,l,v,p,c)}return u},e.buildBinary=function(u,l,v,p,c,_){return u=this.startNodeAt(u,l),u.left=v,u.operator=c,u.right=p,this.finishNode(u,_?"LogicalExpression":"BinaryExpression")},e.parseMaybeUnary=function(u,l){var v=this.start,p=this.startLoc;if(this.type.prefix){var c=this.startNode(),_=this.type===o.types.incDec;c.operator=this.value,c.prefix=!0,this.next(),c.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(u,!0),_?this.checkLVal(c.argument):this.strict&&c.operator==="delete"&&c.argument.type==="Identifier"?this.raiseRecoverable(c.start,"Deleting local variable in strict mode"):l=!0,_=this.finishNode(c,_?"UpdateExpression":"UnaryExpression")}else{if(_=this.parseExprSubscripts(u),this.checkExpressionErrors(u))return _;for(;this.type.postfix&&!this.canInsertSemicolon();)c=this.startNodeAt(v,p),c.operator=this.value,c.prefix=!1,c.argument=_,this.checkLVal(_),this.next(),_=this.finishNode(c,"UpdateExpression")}return!l&&this.eat(o.types.starstar)?this.buildBinary(v,p,_,this.parseMaybeUnary(null,!1),"**",!1):_},e.parseExprSubscripts=function(u){var l=this.start,v=this.startLoc,p=this.parseExprAtom(u),c=p.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")";return this.checkExpressionErrors(u)||c?p:this.parseSubscripts(p,l,v)},e.parseSubscripts=function(u,l,v,p){for(var c;;)if(this.eat(o.types.dot))c=this.startNodeAt(l,v),c.object=u,c.property=this.parseIdent(!0),c.computed=!1,u=this.finishNode(c,"MemberExpression");else if(this.eat(o.types.bracketL))c=this.startNodeAt(l,v),c.object=u,c.property=this.parseExpression(),c.computed=!0,this.expect(o.types.bracketR),u=this.finishNode(c,"MemberExpression");else if(!p&&this.eat(o.types.parenL))c=this.startNodeAt(l,v),c.callee=u,c.arguments=this.parseExprList(o.types.parenR,!1),u=this.finishNode(c,"CallExpression");else if(this.type===o.types.backQuote)c=this.startNodeAt(l,v),c.tag=u,c.quasi=this.parseTemplate(),u=this.finishNode(c,"TaggedTemplateExpression");else return u},e.parseExprAtom=function(u){var l=this.potentialArrowAt==this.start;switch(this.type){case o.types._super:this.inFunction||this.raise(this.start,"'super' outside of function or class");case o.types._this:return u=this.type===o.types._this?"ThisExpression":"Super",l=this.startNode(),this.next(),this.finishNode(l,u);case o.types.name:u=this.start;var v=this.startLoc,p=this.parseIdent(this.type!==o.types.name);return l&&!this.canInsertSemicolon()&&this.eat(o.types.arrow)?this.parseArrowExpression(this.startNodeAt(u,v),[p]):p;case o.types.regexp:return u=this.value,l=this.parseLiteral(u.value),l.regex={pattern:u.pattern,flags:u.flags},l;case o.types.num:case o.types.string:return this.parseLiteral(this.value);case o.types._null:case o.types._true:case o.types._false:return l=this.startNode(),l.value=this.type===o.types._null?null:this.type===o.types._true,l.raw=this.type.keyword,this.next(),this.finishNode(l,"Literal");case o.types.parenL:return this.parseParenAndDistinguishExpression(l);case o.types.bracketL:return l=this.startNode(),this.next(),l.elements=this.parseExprList(o.types.bracketR,!0,!0,u),this.finishNode(l,"ArrayExpression");case o.types.braceL:return this.parseObj(!1,u);case o.types._function:return l=this.startNode(),this.next(),this.parseFunction(l,!1);case o.types._class:return this.parseClass(this.startNode(),!1);case o.types._new:return this.parseNew();case o.types.backQuote:return this.parseTemplate();default:this.unexpected()}},e.parseLiteral=function(u){var l=this.startNode();return l.value=u,l.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(l,"Literal")},e.parseParenExpression=function(){this.expect(o.types.parenL);var u=this.parseExpression();return this.expect(o.types.parenR),u},e.parseParenAndDistinguishExpression=function(u){var l=this.start,v=this.startLoc;if(6<=this.options.ecmaVersion){this.next();for(var p=this.start,c=this.startLoc,_=[],w=!0,f={shorthandAssign:0,trailingComma:0},g=void 0,y=void 0;this.type!==o.types.parenR;)if(w?w=!1:this.expect(o.types.comma),this.type===o.types.ellipsis){g=this.start,_.push(this.parseParenItem(this.parseRest()));break}else this.type!==o.types.parenL||y||(y=this.start),_.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var w=this.start,M=this.startLoc;if(this.expect(o.types.parenR),u&&!this.canInsertSemicolon()&&this.eat(o.types.arrow))return this.checkPatternErrors(f,!0),y&&this.unexpected(y),this.parseParenArrowList(l,v,_);_.length||this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(f,!0),1<_.length?(u=this.startNodeAt(p,c),u.expressions=_,this.finishNodeAt(u,"SequenceExpression",w,M)):u=_[0]}else u=this.parseParenExpression();return this.options.preserveParens?(l=this.startNodeAt(l,v),l.expression=u,this.finishNode(l,"ParenthesizedExpression")):u},e.parseParenItem=function(u){return u},e.parseParenArrowList=function(u,l,v){return this.parseArrowExpression(this.startNodeAt(u,l),v)};var a=[];e.parseNew=function(){var u=this.startNode(),l=this.parseIdent(!0);if(6<=this.options.ecmaVersion&&this.eat(o.types.dot))return u.meta=l,u.property=this.parseIdent(!0),u.property.name!=="target"&&this.raiseRecoverable(u.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(u.start,"new.target can only be used in functions"),this.finishNode(u,"MetaProperty");var l=this.start,v=this.startLoc;return u.callee=this.parseSubscripts(this.parseExprAtom(),l,v,!0),this.eat(o.types.parenL)?u.arguments=this.parseExprList(o.types.parenR,!1):u.arguments=a,this.finishNode(u,"NewExpression")},e.parseTemplateElement=function(){var u=this.startNode();return u.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
`),cooked:this.value},this.next(),u.tail=this.type===o.types.backQuote,this.finishNode(u,"TemplateElement")},e.parseTemplate=function(){var u=this.startNode();this.next(),u.expressions=[];var l=this.parseTemplateElement();for(u.quasis=[l];!l.tail;)this.expect(o.types.dollarBraceL),u.expressions.push(this.parseExpression()),this.expect(o.types.braceR),u.quasis.push(l=this.parseTemplateElement());return this.next(),this.finishNode(u,"TemplateLiteral")},e.parseObj=function(u,l){var v=this.startNode(),p=!0,c={};for(v.properties=[],this.next();!this.eat(o.types.braceR);){if(p)p=!1;else if(this.expect(o.types.comma),this.afterTrailingComma(o.types.braceR))break;var _=this.startNode(),f=void 0,g=void 0,y=void 0;6<=this.options.ecmaVersion&&(_.method=!1,_.shorthand=!1,(u||l)&&(g=this.start,y=this.startLoc),u||(f=this.eat(o.types.star))),this.parsePropertyName(_),this.parsePropertyValue(_,u,f,g,y,l),this.checkPropClash(_,c),v.properties.push(this.finishNode(_,"Property"))}return this.finishNode(v,u?"ObjectPattern":"ObjectExpression")},e.parsePropertyValue=function(u,l,v,p,c,_){this.eat(o.types.colon)?(u.value=l?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,_),u.kind="init"):6<=this.options.ecmaVersion&&this.type===o.types.parenL?(l&&this.unexpected(),u.kind="init",u.method=!0,u.value=this.parseMethod(v)):5<=this.options.ecmaVersion&&!u.computed&&u.key.type==="Identifier"&&(u.key.name==="get"||u.key.name==="set")&&this.type!=o.types.comma&&this.type!=o.types.braceR?((v||l)&&this.unexpected(),u.kind=u.key.name,this.parsePropertyName(u),u.value=this.parseMethod(!1),u.value.params.length!==(u.kind==="get"?0:1)&&(l=u.value.start,u.kind==="get"?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")),u.kind==="set"&&u.value.params[0].type==="RestElement"&&this.raiseRecoverable(u.value.params[0].start,"Setter cannot use rest params")):6<=this.options.ecmaVersion&&!u.computed&&u.key.type==="Identifier"?(u.kind="init",l?((this.keywords.test(u.key.name)||(this.strict?this.reservedWordsStrictBind:this.reservedWords).test(u.key.name)||this.inGenerator&&u.key.name=="yield")&&this.raiseRecoverable(u.key.start,"Binding "+u.key.name),u.value=this.parseMaybeDefault(p,c,u.key)):this.type===o.types.eq&&_?(_.shorthandAssign||(_.shorthandAssign=this.start),u.value=this.parseMaybeDefault(p,c,u.key)):u.value=u.key,u.shorthand=!0):this.unexpected()},e.parsePropertyName=function(u){if(6<=this.options.ecmaVersion){if(this.eat(o.types.bracketL))return u.computed=!0,u.key=this.parseMaybeAssign(),this.expect(o.types.bracketR),u.key;u.computed=!1}return u.key=this.type===o.types.num||this.type===o.types.string?this.parseExprAtom():this.parseIdent(!0)},e.initFunction=function(u){u.id=null,6<=this.options.ecmaVersion&&(u.generator=!1,u.expression=!1)},e.parseMethod=function(u){var l=this.startNode(),v=this.inGenerator;return this.inGenerator=u,this.initFunction(l),this.expect(o.types.parenL),l.params=this.parseBindingList(o.types.parenR,!1,!1),6<=this.options.ecmaVersion&&(l.generator=u),this.parseFunctionBody(l,!1),this.inGenerator=v,this.finishNode(l,"FunctionExpression")},e.parseArrowExpression=function(u,l){var v=this.inGenerator;return this.inGenerator=!1,this.initFunction(u),u.params=this.toAssignableList(l,!0),this.parseFunctionBody(u,!0),this.inGenerator=v,this.finishNode(u,"ArrowFunctionExpression")},e.parseFunctionBody=function(u,l){var v=l&&this.type!==o.types.braceL;if(v)u.body=this.parseMaybeAssign(),u.expression=!0;else{var p=this.inFunction,c=this.labels;this.inFunction=!0,this.labels=[],u.body=this.parseBlock(!0),u.expression=!1,this.inFunction=p,this.labels=c}this.strict||!v&&u.body.body.length&&this.isUseStrict(u.body.body[0])?(v=this.strict,this.strict=!0,u.id&&this.checkLVal(u.id,!0),this.checkParams(u),this.strict=v):l&&this.checkParams(u)},e.checkParams=function(u){for(var l={},v=0;v<u.params.length;v++)this.checkLVal(u.params[v],!0,l)},e.parseExprList=function(u,l,v,p){for(var c=[],_=!0;!this.eat(u);){if(_)_=!1;else if(this.expect(o.types.comma),l&&this.afterTrailingComma(u))break;if(v&&this.type===o.types.comma)var f=null;else this.type===o.types.ellipsis?(f=this.parseSpread(p),this.type===o.types.comma&&p&&!p.trailingComma&&(p.trailingComma=this.lastTokStart)):f=this.parseMaybeAssign(!1,p);c.push(f)}return c},e.parseIdent=function(u){var l=this.startNode();return u&&this.options.allowReserved=="never"&&(u=!1),this.type===o.types.name?(!u&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(this.value)&&(6<=this.options.ecmaVersion||this.input.slice(this.start,this.end).indexOf("\\")==-1)&&this.raiseRecoverable(this.start,"The keyword '"+this.value+"' is reserved"),!u&&this.inGenerator&&this.value==="yield"&&this.raiseRecoverable(this.start,"Can not use 'yield' as identifier inside a generator"),l.name=this.value):u&&this.type.keyword?l.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(l,"Identifier")},e.parseYield=function(){var u=this.startNode();return this.next(),this.type==o.types.semi||this.canInsertSemicolon()||this.type!=o.types.star&&!this.type.startsExpr?(u.delegate=!1,u.argument=null):(u.delegate=this.eat(o.types.star),u.argument=this.parseMaybeAssign()),this.finishNode(u,"YieldExpression")}},{"./state":10,"./tokentype":14}],2:[function(e,r,s){function o(p,c){for(var _=65536,f=0;f<c.length;f+=2){if(_+=c[f],_>p)return!1;if(_+=c[f+1],_>=p)return!0}}s.__esModule=!0,s.isIdentifierStart=function(p,c){return 65>p?p===36:91>p?!0:97>p?p===95:123>p?!0:65535>=p?170<=p&&a.test(String.fromCharCode(p)):c===!1?!1:o(p,l)},s.isIdentifierChar=function(p,c){return 48>p?p===36:58>p?!0:65>p?!1:91>p?!0:97>p?p===95:123>p?!0:65535>=p?170<=p&&u.test(String.fromCharCode(p)):c===!1?!1:o(p,l)||o(p,v)},s.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"},s.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"},e="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\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 a=new RegExp("["+e+"]"),u=new RegExp("["+e+"\u200C\u200D\xB7\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]");e=null;var l=[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],v=[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(e,r,s){s.__esModule=!0,s.parse=function(a,u){return new o.Parser(u,a).parse()},s.parseExpressionAt=function(a,u,l){return a=new o.Parser(l,a,u),a.nextToken(),a.parseExpression()},s.tokenizer=function(a,u){return new o.Parser(u,a)};var o=e("./state");e("./parseutil"),e("./statement"),e("./lval"),e("./expression"),e("./location"),s.Parser=o.Parser,s.plugins=o.plugins,r=e("./options"),s.defaultOptions=r.defaultOptions,r=e("./locutil"),s.Position=r.Position,s.SourceLocation=r.SourceLocation,s.getLineInfo=r.getLineInfo,r=e("./node"),s.Node=r.Node,r=e("./tokentype"),s.TokenType=r.TokenType,s.tokTypes=r.types,r=e("./tokencontext"),s.TokContext=r.TokContext,s.tokContexts=r.types,r=e("./identifier"),s.isIdentifierChar=r.isIdentifierChar,s.isIdentifierStart=r.isIdentifierStart,r=e("./tokenize"),s.Token=r.Token,e=e("./whitespace"),s.isNewLine=e.isNewLine,s.lineBreak=e.lineBreak,s.lineBreakG=e.lineBreakG,s.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(e,r,s){r=e("./state");var o=e("./locutil");e=r.Parser.prototype,e.raise=function(a,u){var l=o.getLineInfo(this.input,a);u+=" ("+l.line+":"+l.column+")";var v=new SyntaxError(u);throw v.pos=a,v.loc=l,v.raisedAt=this.pos,v},e.raiseRecoverable=e.raise,e.curPosition=function(){if(this.options.locations)return new o.Position(this.curLine,this.pos-this.lineStart)}},{"./locutil":5,"./state":10}],5:[function(e,r,s){function o(l,v){if(!(l instanceof v))throw new TypeError("Cannot call a class as a function")}s.__esModule=!0,s.getLineInfo=function(l,v){for(var p=1,c=0;;){a.lineBreakG.lastIndex=c;var _=a.lineBreakG.exec(l);if(_&&_.index<v)++p,c=_.index+_[0].length;else return new u(p,v-c)}};var a=e("./whitespace"),u=function(){function l(v,p){o(this,l),this.line=v,this.column=p}return l.prototype.offset=function(v){return new l(this.line,this.column+v)},l}();s.Position=u,s.SourceLocation=function l(v,p,c){o(this,l),this.start=p,this.end=c,v.sourceFile!==null&&(this.source=v.sourceFile)}},{"./whitespace":16}],6:[function(e,r,s){var o=e("./tokentype");r=e("./state");var a=e("./util");e=r.Parser.prototype,e.toAssignable=function(u,l){if(6<=this.options.ecmaVersion&&u)switch(u.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":u.type="ObjectPattern";for(var v=0;v<u.properties.length;v++){var p=u.properties[v];p.kind!=="init"&&this.raise(p.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(p.value,l)}break;case"ArrayExpression":u.type="ArrayPattern",this.toAssignableList(u.elements,l);break;case"AssignmentExpression":if(u.operator==="=")u.type="AssignmentPattern",delete u.operator;else{this.raise(u.left.end,"Only '=' operator can be used for specifying default value.");break}case"AssignmentPattern":u.right.type==="YieldExpression"&&this.raise(u.right.start,"Yield expression cannot be a default value");break;case"ParenthesizedExpression":u.expression=this.toAssignable(u.expression,l);break;case"MemberExpression":if(!l)break;default:this.raise(u.start,"Assigning to rvalue")}return u},e.toAssignableList=function(u,l){var v=u.length;if(v){var p=u[v-1];if(p&&p.type=="RestElement")--v;else if(p&&p.type=="SpreadElement"){p.type="RestElement";var c=p.argument;this.toAssignable(c,l),c.type!=="Identifier"&&c.type!=="MemberExpression"&&c.type!=="ArrayPattern"&&this.unexpected(c.start),--v}l&&p.type==="RestElement"&&p.argument.type!=="Identifier"&&this.unexpected(p.argument.start)}for(p=0;p<v;p++)(c=u[p])&&this.toAssignable(c,l);return u},e.parseSpread=function(u){var l=this.startNode();return this.next(),l.argument=this.parseMaybeAssign(u),this.finishNode(l,"SpreadElement")},e.parseRest=function(u){var l=this.startNode();return this.next(),l.argument=u?this.type===o.types.name?this.parseIdent():this.unexpected():this.type===o.types.name||this.type===o.types.bracketL?this.parseBindingAtom():this.unexpected(),this.finishNode(l,"RestElement")},e.parseBindingAtom=function(){if(6>this.options.ecmaVersion)return this.parseIdent();switch(this.type){case o.types.name:return this.parseIdent();case o.types.bracketL:var u=this.startNode();return this.next(),u.elements=this.parseBindingList(o.types.bracketR,!0,!0),this.finishNode(u,"ArrayPattern");case o.types.braceL:return this.parseObj(!0);default:this.unexpected()}},e.parseBindingList=function(u,l,v,p){for(var c=[],_=!0;!this.eat(u);)if(_?_=!1:this.expect(o.types.comma),l&&this.type===o.types.comma)c.push(null);else{if(v&&this.afterTrailingComma(u))break;if(this.type===o.types.ellipsis){l=this.parseRest(p),this.parseBindingListItem(l),c.push(l),this.type===o.types.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(u);break}else{var f=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(f),c.push(f)}}return c},e.parseBindingListItem=function(u){return u},e.parseMaybeDefault=function(u,l,v){return v=v||this.parseBindingAtom(),6>this.options.ecmaVersion||!this.eat(o.types.eq)?v:(u=this.startNodeAt(u,l),u.left=v,u.right=this.parseMaybeAssign(),this.finishNode(u,"AssignmentPattern"))},e.checkLVal=function(u,l,v){switch(u.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(u.name)&&this.raiseRecoverable(u.start,(l?"Binding ":"Assigning to ")+u.name+" in strict mode"),v&&(a.has(v,u.name)&&this.raiseRecoverable(u.start,"Argument name clash"),v[u.name]=!0);break;case"MemberExpression":l&&this.raiseRecoverable(u.start,(l?"Binding":"Assigning to")+" member expression");break;case"ObjectPattern":for(var p=0;p<u.properties.length;p++)this.checkLVal(u.properties[p].value,l,v);break;case"ArrayPattern":for(p=0;p<u.elements.length;p++){var c=u.elements[p];c&&this.checkLVal(c,l,v)}break;case"AssignmentPattern":this.checkLVal(u.left,l,v);break;case"RestElement":this.checkLVal(u.argument,l,v);break;case"ParenthesizedExpression":this.checkLVal(u.expression,l,v);break;default:this.raise(u.start,(l?"Binding":"Assigning to")+" rvalue")}}},{"./state":10,"./tokentype":14,"./util":15}],7:[function(e,r,s){function o(l,v,p,c){return l.type=v,l.end=p,this.options.locations&&(l.loc.end=c),this.options.ranges&&(l.range[1]=p),l}s.__esModule=!0,r=e("./state");var a=e("./locutil"),u=function l(v,p,c){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");this.type="",this.start=p,this.end=0,v.options.locations&&(this.loc=new a.SourceLocation(v,c)),v.options.directSourceFile&&(this.sourceFile=v.options.directSourceFile),v.options.ranges&&(this.range=[p,0])};s.Node=u,e=r.Parser.prototype,e.startNode=function(){return new u(this,this.start,this.startLoc)},e.startNodeAt=function(l,v){return new u(this,l,v)},e.finishNode=function(l,v){return o.call(this,l,v,this.lastTokEnd,this.lastTokEndLoc)},e.finishNodeAt=function(l,v,p,c){return o.call(this,l,v,p,c)}},{"./locutil":5,"./state":10}],8:[function(e,r,s){function o(v,p){return function(c,_,f,g,y,w){c={type:c?"Block":"Line",value:_,start:f,end:g},v.locations&&(c.loc=new u.SourceLocation(this,y,w)),v.ranges&&(c.range=[f,g]),p.push(c)}}s.__esModule=!0,s.getOptions=function(v){var p={},c;for(c in l)p[c]=v&&a.has(v,c)?v[c]:l[c];return p.allowReserved==null&&(p.allowReserved=5>p.ecmaVersion),a.isArray(p.onToken)&&function(){var _=p.onToken;p.onToken=function(f){return _.push(f)}}(),a.isArray(p.onComment)&&(p.onComment=o(p,p.onComment)),p};var a=e("./util"),u=e("./locutil"),l={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:{}};s.defaultOptions=l},{"./locutil":5,"./util":15}],9:[function(e,r,s){var o=e("./tokentype");r=e("./state");var a=e("./whitespace");e=r.Parser.prototype,e.isUseStrict=function(u){return 5<=this.options.ecmaVersion&&u.type==="ExpressionStatement"&&u.expression.type==="Literal"&&u.expression.raw.slice(1,-1)==="use strict"},e.eat=function(u){return this.type===u?(this.next(),!0):!1},e.isContextual=function(u){return this.type===o.types.name&&this.value===u},e.eatContextual=function(u){return this.value===u&&this.eat(o.types.name)},e.expectContextual=function(u){this.eatContextual(u)||this.unexpected()},e.canInsertSemicolon=function(){return this.type===o.types.eof||this.type===o.types.braceR||a.lineBreak.test(this.input.slice(this.lastTokEnd,this.start))},e.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},e.semicolon=function(){this.eat(o.types.semi)||this.insertSemicolon()||this.unexpected()},e.afterTrailingComma=function(u){if(this.type==u)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),this.next(),!0},e.expect=function(u){this.eat(u)||this.unexpected()},e.unexpected=function(u){this.raise(u!=null?u:this.start,"Unexpected token")},e.checkPatternErrors=function(u,l){var v=u&&u.trailingComma;if(!l)return!!v;v&&this.raise(v,"Comma is not permitted after the rest element")},e.checkExpressionErrors=function(u,l){var v=u&&u.shorthandAssign;if(!l)return!!v;v&&this.raise(v,"Shorthand property assignments are valid only in destructuring patterns")}},{"./state":10,"./tokentype":14,"./whitespace":16}],10:[function(e,r,s){function o(c){return new RegExp("^("+c.replace(/ /g,"|")+")$")}s.__esModule=!0;var a=e("./identifier"),u=e("./tokentype"),l=e("./whitespace"),v=e("./options"),p={};s.plugins=p,e=function(){function c(_,f,g){if(!(this instanceof c))throw new TypeError("Cannot call a class as a function");this.options=_=v.getOptions(_),this.sourceFile=_.sourceFile,this.keywords=o(a.keywords[6<=_.ecmaVersion?6:5]);var y=_.allowReserved?"":a.reservedWords[_.ecmaVersion]+(_.sourceType=="module"?" await":"");this.reservedWords=o(y),y=(y?y+" ":"")+a.reservedWords.strict,this.reservedWordsStrict=o(y),this.reservedWordsStrictBind=o(y+" "+a.reservedWords.strictBind),this.input=String(f),this.containsEsc=!1,this.loadPlugins(_.plugins),g?(this.pos=g,this.lineStart=Math.max(0,this.input.lastIndexOf(`
|
|
`,g)),this.curLine=this.input.slice(0,this.lineStart).split(l.lineBreak).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.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=_.sourceType==="module",this.potentialArrowAt=-1,this.inFunction=this.inGenerator=!1,this.labels=[],this.pos===0&&_.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2)}return c.prototype.isKeyword=function(_){return this.keywords.test(_)},c.prototype.isReservedWord=function(_){return this.reservedWords.test(_)},c.prototype.extend=function(_,f){this[_]=f(this[_])},c.prototype.loadPlugins=function(_){for(var f in _){var g=p[f];if(!g)throw Error("Plugin '"+f+"' not found");g(this,_[f])}},c.prototype.parse=function(){var _=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(_)},c}(),s.Parser=e},{"./identifier":2,"./options":8,"./tokentype":14,"./whitespace":16}],11:[function(e,r,s){var o=e("./tokentype");r=e("./state");var a=e("./whitespace"),u=e("./identifier");e=r.Parser.prototype,e.parseTopLevel=function(c){var _=!0;for(c.body||(c.body=[]);this.type!==o.types.eof;){var f=this.parseStatement(!0,!0);c.body.push(f),_&&(this.isUseStrict(f)&&this.setStrict(!0),_=!1)}return this.next(),6<=this.options.ecmaVersion&&(c.sourceType=this.options.sourceType),this.finishNode(c,"Program")};var l={kind:"loop"},v={kind:"switch"};e.isLet=function(){if(this.type!==o.types.name||6>this.options.ecmaVersion||this.value!="let")return!1;a.skipWhiteSpace.lastIndex=this.pos;var c=a.skipWhiteSpace.exec(this.input),c=this.pos+c[0].length,_=this.input.charCodeAt(c);if(_===91||_==123)return!0;if(u.isIdentifierStart(_,!0)){for(_=c+1;u.isIdentifierChar(this.input.charCodeAt(_,!0));++_);if(c=this.input.slice(c,_),!this.isKeyword(c))return!0}return!1},e.parseStatement=function(c,_){var f=this.type,g=this.startNode(),y=void 0;switch(this.isLet()&&(f=o.types._var,y="let"),f){case o.types._break:case o.types._continue:return this.parseBreakContinueStatement(g,f.keyword);case o.types._debugger:return this.parseDebuggerStatement(g);case o.types._do:return this.parseDoStatement(g);case o.types._for:return this.parseForStatement(g);case o.types._function:return!c&&6<=this.options.ecmaVersion&&this.unexpected(),this.parseFunctionStatement(g);case o.types._class:return c||this.unexpected(),this.parseClass(g,!0);case o.types._if:return this.parseIfStatement(g);case o.types._return:return this.parseReturnStatement(g);case o.types._switch:return this.parseSwitchStatement(g);case o.types._throw:return this.parseThrowStatement(g);case o.types._try:return this.parseTryStatement(g);case o.types._const:case o.types._var:return y=y||this.value,c||y=="var"||this.unexpected(),this.parseVarStatement(g,y);case o.types._while:return this.parseWhileStatement(g);case o.types._with:return this.parseWithStatement(g);case o.types.braceL:return this.parseBlock();case o.types.semi:return this.parseEmptyStatement(g);case o.types._export:case o.types._import:return this.options.allowImportExportEverywhere||(_||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'")),f===o.types._import?this.parseImport(g):this.parseExport(g);default:var y=this.value,w=this.parseExpression();return f===o.types.name&&w.type==="Identifier"&&this.eat(o.types.colon)?this.parseLabeledStatement(g,y,w):this.parseExpressionStatement(g,w)}},e.parseBreakContinueStatement=function(c,_){var f=_=="break";this.next(),this.eat(o.types.semi)||this.insertSemicolon()?c.label=null:this.type!==o.types.name?this.unexpected():(c.label=this.parseIdent(),this.semicolon());for(var g=0;g<this.labels.length;++g){var y=this.labels[g];if((c.label==null||y.name===c.label.name)&&(y.kind!=null&&(f||y.kind==="loop")||c.label&&f))break}return g===this.labels.length&&this.raise(c.start,"Unsyntactic "+_),this.finishNode(c,f?"BreakStatement":"ContinueStatement")},e.parseDebuggerStatement=function(c){return this.next(),this.semicolon(),this.finishNode(c,"DebuggerStatement")},e.parseDoStatement=function(c){return this.next(),this.labels.push(l),c.body=this.parseStatement(!1),this.labels.pop(),this.expect(o.types._while),c.test=this.parseParenExpression(),6<=this.options.ecmaVersion?this.eat(o.types.semi):this.semicolon(),this.finishNode(c,"DoWhileStatement")},e.parseForStatement=function(c){if(this.next(),this.labels.push(l),this.expect(o.types.parenL),this.type===o.types.semi)return this.parseFor(c,null);var _=this.isLet();if(this.type===o.types._var||this.type===o.types._const||_){var f=this.startNode(),_=_?"let":this.value;return this.next(),this.parseVar(f,!0,_),this.finishNode(f,"VariableDeclaration"),!(this.type===o.types._in||6<=this.options.ecmaVersion&&this.isContextual("of"))||f.declarations.length!==1||_!=="var"&&f.declarations[0].init?this.parseFor(c,f):this.parseForIn(c,f)}return f={shorthandAssign:0,trailingComma:0},_=this.parseExpression(!0,f),this.type===o.types._in||6<=this.options.ecmaVersion&&this.isContextual("of")?(this.checkPatternErrors(f,!0),this.toAssignable(_),this.checkLVal(_),this.parseForIn(c,_)):(this.checkExpressionErrors(f,!0),this.parseFor(c,_))},e.parseFunctionStatement=function(c){return this.next(),this.parseFunction(c,!0)},e.parseIfStatement=function(c){return this.next(),c.test=this.parseParenExpression(),c.consequent=this.parseStatement(!1),c.alternate=this.eat(o.types._else)?this.parseStatement(!1):null,this.finishNode(c,"IfStatement")},e.parseReturnStatement=function(c){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.types.semi)||this.insertSemicolon()?c.argument=null:(c.argument=this.parseExpression(),this.semicolon()),this.finishNode(c,"ReturnStatement")},e.parseSwitchStatement=function(c){this.next(),c.discriminant=this.parseParenExpression(),c.cases=[],this.expect(o.types.braceL),this.labels.push(v);for(var _,f=!1;this.type!=o.types.braceR;)if(this.type===o.types._case||this.type===o.types._default){var g=this.type===o.types._case;_&&this.finishNode(_,"SwitchCase"),c.cases.push(_=this.startNode()),_.consequent=[],this.next(),g?_.test=this.parseExpression():(f&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),f=!0,_.test=null),this.expect(o.types.colon)}else _||this.unexpected(),_.consequent.push(this.parseStatement(!0));return _&&this.finishNode(_,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(c,"SwitchStatement")},e.parseThrowStatement=function(c){return this.next(),a.lineBreak.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),c.argument=this.parseExpression(),this.semicolon(),this.finishNode(c,"ThrowStatement")};var p=[];e.parseTryStatement=function(c){if(this.next(),c.block=this.parseBlock(),c.handler=null,this.type===o.types._catch){var _=this.startNode();this.next(),this.expect(o.types.parenL),_.param=this.parseBindingAtom(),this.checkLVal(_.param,!0),this.expect(o.types.parenR),_.body=this.parseBlock(),c.handler=this.finishNode(_,"CatchClause")}return c.finalizer=this.eat(o.types._finally)?this.parseBlock():null,c.handler||c.finalizer||this.raise(c.start,"Missing catch or finally clause"),this.finishNode(c,"TryStatement")},e.parseVarStatement=function(c,_){return this.next(),this.parseVar(c,!1,_),this.semicolon(),this.finishNode(c,"VariableDeclaration")},e.parseWhileStatement=function(c){return this.next(),c.test=this.parseParenExpression(),this.labels.push(l),c.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(c,"WhileStatement")},e.parseWithStatement=function(c){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),c.object=this.parseParenExpression(),c.body=this.parseStatement(!1),this.finishNode(c,"WithStatement")},e.parseEmptyStatement=function(c){return this.next(),this.finishNode(c,"EmptyStatement")},e.parseLabeledStatement=function(c,_,f){for(var g=0;g<this.labels.length;++g)this.labels[g].name===_&&this.raise(f.start,"Label '"+_+"' is already declared");for(var y=this.type.isLoop?"loop":this.type===o.types._switch?"switch":null,g=this.labels.length-1;0<=g;g--){var w=this.labels[g];if(w.statementStart==c.start)w.statementStart=this.start,w.kind=y;else break}return this.labels.push({name:_,kind:y,statementStart:this.start}),c.body=this.parseStatement(!0),this.labels.pop(),c.label=f,this.finishNode(c,"LabeledStatement")},e.parseExpressionStatement=function(c,_){return c.expression=_,this.semicolon(),this.finishNode(c,"ExpressionStatement")},e.parseBlock=function(c){var _=this.startNode(),f=!0,g=void 0;for(_.body=[],this.expect(o.types.braceL);!this.eat(o.types.braceR);){var y=this.parseStatement(!0);_.body.push(y),f&&c&&this.isUseStrict(y)&&(g=this.strict,this.setStrict(this.strict=!0)),f=!1}return g===!1&&this.setStrict(!1),this.finishNode(_,"BlockStatement")},e.parseFor=function(c,_){return c.init=_,this.expect(o.types.semi),c.test=this.type===o.types.semi?null:this.parseExpression(),this.expect(o.types.semi),c.update=this.type===o.types.parenR?null:this.parseExpression(),this.expect(o.types.parenR),c.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(c,"ForStatement")},e.parseForIn=function(c,_){var f=this.type===o.types._in?"ForInStatement":"ForOfStatement";return this.next(),c.left=_,c.right=this.parseExpression(),this.expect(o.types.parenR),c.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(c,f)},e.parseVar=function(c,_,f){for(c.declarations=[],c.kind=f;;){var g=this.startNode();if(this.parseVarId(g),this.eat(o.types.eq)?g.init=this.parseMaybeAssign(_):f!=="const"||this.type===o.types._in||6<=this.options.ecmaVersion&&this.isContextual("of")?g.id.type=="Identifier"||_&&(this.type===o.types._in||this.isContextual("of"))?g.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),c.declarations.push(this.finishNode(g,"VariableDeclarator")),!this.eat(o.types.comma))break}return c},e.parseVarId=function(c){c.id=this.parseBindingAtom(),this.checkLVal(c.id,!0)},e.parseFunction=function(c,_,f){this.initFunction(c),6<=this.options.ecmaVersion&&(c.generator=this.eat(o.types.star));var g=this.inGenerator;return this.inGenerator=c.generator,(_||this.type===o.types.name)&&(c.id=this.parseIdent()),this.parseFunctionParams(c),this.parseFunctionBody(c,f),this.inGenerator=g,this.finishNode(c,_?"FunctionDeclaration":"FunctionExpression")},e.parseFunctionParams=function(c){this.expect(o.types.parenL),c.params=this.parseBindingList(o.types.parenR,!1,!1,!0)},e.parseClass=function(c,_){this.next(),this.parseClassId(c,_),this.parseClassSuper(c);var f=this.startNode(),g=!1;for(f.body=[],this.expect(o.types.braceL);!this.eat(o.types.braceR);)if(!this.eat(o.types.semi)){var y=this.startNode(),w=this.eat(o.types.star),M=this.type===o.types.name&&this.value==="static";if(this.parsePropertyName(y),y.static=M&&this.type!==o.types.parenL,y.static&&(w&&this.unexpected(),w=this.eat(o.types.star),this.parsePropertyName(y)),y.kind="method",M=!1,!y.computed){var T=y.key;w||T.type!=="Identifier"||this.type===o.types.parenL||T.name!=="get"&&T.name!=="set"||(M=!0,y.kind=T.name,T=this.parsePropertyName(y)),!y.static&&(T.type==="Identifier"&&T.name==="constructor"||T.type==="Literal"&&T.value==="constructor")&&(g&&this.raise(T.start,"Duplicate constructor in the same class"),M&&this.raise(T.start,"Constructor can't have get/set modifier"),w&&this.raise(T.start,"Constructor can't be a generator"),y.kind="constructor",g=!0)}this.parseClassMethod(f,y,w),M&&(y.value.params.length!==(y.kind==="get"?0:1)&&(w=y.value.start,y.kind==="get"?this.raiseRecoverable(w,"getter should have no params"):this.raiseRecoverable(w,"setter should have exactly one param")),y.kind==="set"&&y.value.params[0].type==="RestElement"&&this.raise(y.value.params[0].start,"Setter cannot use rest params"))}return c.body=this.finishNode(f,"ClassBody"),this.finishNode(c,_?"ClassDeclaration":"ClassExpression")},e.parseClassMethod=function(c,_,f){_.value=this.parseMethod(f),c.body.push(this.finishNode(_,"MethodDefinition"))},e.parseClassId=function(c,_){c.id=this.type===o.types.name?this.parseIdent():_?this.unexpected():null},e.parseClassSuper=function(c){c.superClass=this.eat(o.types._extends)?this.parseExprSubscripts():null},e.parseExport=function(c){if(this.next(),this.eat(o.types.star))return this.expectContextual("from"),c.source=this.type===o.types.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(c,"ExportAllDeclaration");if(this.eat(o.types._default)){var _=this.type==o.types.parenL,f=this.parseMaybeAssign(),g=!0;return _||f.type!="FunctionExpression"&&f.type!="ClassExpression"||(g=!1,f.id&&(f.type=f.type=="FunctionExpression"?"FunctionDeclaration":"ClassDeclaration")),c.declaration=f,g&&this.semicolon(),this.finishNode(c,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())c.declaration=this.parseStatement(!0),c.specifiers=[],c.source=null;else{if(c.declaration=null,c.specifiers=this.parseExportSpecifiers(),this.eatContextual("from"))c.source=this.type===o.types.string?this.parseExprAtom():this.unexpected();else{for(_=0;_<c.specifiers.length;_++)(this.keywords.test(c.specifiers[_].local.name)||this.reservedWords.test(c.specifiers[_].local.name))&&this.unexpected(c.specifiers[_].local.start);c.source=null}this.semicolon()}return this.finishNode(c,"ExportNamedDeclaration")},e.shouldParseExportStatement=function(){return this.type.keyword||this.isLet()},e.parseExportSpecifiers=function(){var c=[],_=!0;for(this.expect(o.types.braceL);!this.eat(o.types.braceR);){if(_)_=!1;else if(this.expect(o.types.comma),this.afterTrailingComma(o.types.braceR))break;var f=this.startNode();f.local=this.parseIdent(this.type===o.types._default),f.exported=this.eatContextual("as")?this.parseIdent(!0):f.local,c.push(this.finishNode(f,"ExportSpecifier"))}return c},e.parseImport=function(c){return this.next(),this.type===o.types.string?(c.specifiers=p,c.source=this.parseExprAtom()):(c.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),c.source=this.type===o.types.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(c,"ImportDeclaration")},e.parseImportSpecifiers=function(){var c=[],_=!0;if(this.type===o.types.name){var f=this.startNode();if(f.local=this.parseIdent(),this.checkLVal(f.local,!0),c.push(this.finishNode(f,"ImportDefaultSpecifier")),!this.eat(o.types.comma))return c}if(this.type===o.types.star)return f=this.startNode(),this.next(),this.expectContextual("as"),f.local=this.parseIdent(),this.checkLVal(f.local,!0),c.push(this.finishNode(f,"ImportNamespaceSpecifier")),c;for(this.expect(o.types.braceL);!this.eat(o.types.braceR);){if(_)_=!1;else if(this.expect(o.types.comma),this.afterTrailingComma(o.types.braceR))break;f=this.startNode(),f.imported=this.parseIdent(!0),this.eatContextual("as")?f.local=this.parseIdent():(f.local=f.imported,this.isKeyword(f.local.name)&&this.unexpected(f.local.start),this.reservedWordsStrict.test(f.local.name)&&this.raise(f.local.start,"The keyword '"+f.local.name+"' is reserved")),this.checkLVal(f.local,!0),c.push(this.finishNode(f,"ImportSpecifier"))}return c}},{"./identifier":2,"./state":10,"./tokentype":14,"./whitespace":16}],12:[function(e,r,s){s.__esModule=!0,r=e("./state");var o=e("./tokentype"),a=e("./whitespace");e=function l(v,p,c,_){if(!(this instanceof l))throw new TypeError("Cannot call a class as a function");this.token=v,this.isExpr=!!p,this.preserveSpace=!!c,this.override=_},s.TokContext=e;var u={b_stat:new e("{",!1),b_expr:new e("{",!0),b_tmpl:new e("${",!0),p_stat:new e("(",!1),p_expr:new e("(",!0),q_tmpl:new e("`",!0,!0,function(l){return l.readTmplToken()}),f_expr:new e("function",!0)};s.types=u,s=r.Parser.prototype,s.initialContext=function(){return[u.b_stat]},s.braceIsBlock=function(l){if(l===o.types.colon){var v=this.curContext();if(v===u.b_stat||v===u.b_expr)return!v.isExpr}return l===o.types._return?a.lineBreak.test(this.input.slice(this.lastTokEnd,this.start)):l===o.types._else||l===o.types.semi||l===o.types.eof||l===o.types.parenR?!0:l==o.types.braceL?this.curContext()===u.b_stat:!this.exprAllowed},s.updateContext=function(l){var v,p=this.type;p.keyword&&l==o.types.dot?this.exprAllowed=!1:(v=p.updateContext)?v.call(this,l):this.exprAllowed=p.beforeExpr},o.types.parenR.updateContext=o.types.braceR.updateContext=function(){if(this.context.length==1)this.exprAllowed=!0;else{var l=this.context.pop();l===u.b_stat&&this.curContext()===u.f_expr?(this.context.pop(),this.exprAllowed=!1):this.exprAllowed=l===u.b_tmpl?!0:!l.isExpr}},o.types.braceL.updateContext=function(l){this.context.push(this.braceIsBlock(l)?u.b_stat:u.b_expr),this.exprAllowed=!0},o.types.dollarBraceL.updateContext=function(){this.context.push(u.b_tmpl),this.exprAllowed=!0},o.types.parenL.updateContext=function(l){this.context.push(l===o.types._if||l===o.types._for||l===o.types._with||l===o.types._while?u.p_stat:u.p_expr),this.exprAllowed=!0},o.types.incDec.updateContext=function(){},o.types._function.updateContext=function(l){!l.beforeExpr||l===o.types.semi||l===o.types._else||l===o.types.colon&&this.curContext()===u.b_stat||this.context.push(u.f_expr),this.exprAllowed=!1},o.types.backQuote.updateContext=function(){this.curContext()===u.q_tmpl?this.context.pop():this.context.push(u.q_tmpl),this.exprAllowed=!1}},{"./state":10,"./tokentype":14,"./whitespace":16}],13:[function(e,r,s){function o(g,y,w,M){try{return new RegExp(g,y)}catch(T){if(w!==void 0)throw T instanceof SyntaxError&&M.raise(w,"Error parsing regular expression: "+T.message),T}}function a(g){return 65535>=g?String.fromCharCode(g):(g-=65536,String.fromCharCode((g>>10)+55296,(g&1023)+56320))}s.__esModule=!0;var u=e("./identifier"),l=e("./tokentype");r=e("./state");var v=e("./locutil"),p=e("./whitespace"),c=function g(y){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function");this.type=y.type,this.value=y.value,this.start=y.start,this.end=y.end,y.options.locations&&(this.loc=new v.SourceLocation(y,y.startLoc,y.endLoc)),y.options.ranges&&(this.range=[y.start,y.end])};s.Token=c,e=r.Parser.prototype;var _=typeof Packages=="object"&&Object.prototype.toString.call(Packages)=="[object JavaPackage]";e.next=function(){this.options.onToken&&this.options.onToken(new c(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},e.getToken=function(){return this.next(),new c(this)},typeof Symbol!="undefined"&&(e[Symbol.iterator]=function(){var g=this;return{next:function(){var y=g.getToken();return{done:y.type===l.types.eof,value:y}}}}),e.setStrict=function(g){if(this.strict=g,this.type===l.types.num||this.type===l.types.string){if(this.pos=this.start,this.options.locations)for(;this.pos<this.lineStart;)this.lineStart=this.input.lastIndexOf(`
|
|
`,this.lineStart-2)+1,--this.curLine;this.nextToken()}},e.curContext=function(){return this.context[this.context.length-1]},e.nextToken=function(){var g=this.curContext();if(g&&g.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(l.types.eof);if(g.override)return g.override(this);this.readToken(this.fullCharCodeAtPos())},e.readToken=function(g){return u.isIdentifierStart(g,6<=this.options.ecmaVersion)||g===92?this.readWord():this.getTokenFromCode(g)},e.fullCharCodeAtPos=function(){var g=this.input.charCodeAt(this.pos);if(55295>=g||57344<=g)return g;var y=this.input.charCodeAt(this.pos+1);return(g<<10)+y-56613888},e.skipBlockComment=function(){var g=this.options.onComment&&this.curPosition(),y=this.pos,w=this.input.indexOf("*/",this.pos+=2);if(w===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=w+2,this.options.locations){p.lineBreakG.lastIndex=y;for(var M=void 0;(M=p.lineBreakG.exec(this.input))&&M.index<this.pos;)++this.curLine,this.lineStart=M.index+M[0].length}this.options.onComment&&this.options.onComment(!0,this.input.slice(y+2,w),y,this.pos,g,this.curPosition())},e.skipLineComment=function(g){for(var y=this.pos,w=this.options.onComment&&this.curPosition(),M=this.input.charCodeAt(this.pos+=g);this.pos<this.input.length&&M!==10&&M!==13&&M!==8232&&M!==8233;)++this.pos,M=this.input.charCodeAt(this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(y+g,this.pos),y,this.pos,w,this.curPosition())},e.skipSpace=function(){e:for(;this.pos<this.input.length;){var g=this.input.charCodeAt(this.pos);switch(g){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++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 e}break;default:if(8<g&&14>g||5760<=g&&p.nonASCIIwhitespace.test(String.fromCharCode(g)))++this.pos;else break e}}},e.finishToken=function(g,y){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var w=this.type;this.type=g,this.value=y,this.updateContext(w)},e.readToken_dot=function(){var g=this.input.charCodeAt(this.pos+1);if(48<=g&&57>=g)return this.readNumber(!0);var y=this.input.charCodeAt(this.pos+2);return 6<=this.options.ecmaVersion&&g===46&&y===46?(this.pos+=3,this.finishToken(l.types.ellipsis)):(++this.pos,this.finishToken(l.types.dot))},e.readToken_slash=function(){var g=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):g===61?this.finishOp(l.types.assign,2):this.finishOp(l.types.slash,1)},e.readToken_mult_modulo_exp=function(g){var y=this.input.charCodeAt(this.pos+1),w=1;return g=g===42?l.types.star:l.types.modulo,7<=this.options.ecmaVersion&&y===42&&(++w,g=l.types.starstar,y=this.input.charCodeAt(this.pos+2)),y===61?this.finishOp(l.types.assign,w+1):this.finishOp(g,w)},e.readToken_pipe_amp=function(g){var y=this.input.charCodeAt(this.pos+1);return y===g?this.finishOp(g===124?l.types.logicalOR:l.types.logicalAND,2):y===61?this.finishOp(l.types.assign,2):this.finishOp(g===124?l.types.bitwiseOR:l.types.bitwiseAND,1)},e.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(l.types.assign,2):this.finishOp(l.types.bitwiseXOR,1)},e.readToken_plus_min=function(g){var y=this.input.charCodeAt(this.pos+1);return y===g?y==45&&this.input.charCodeAt(this.pos+2)==62&&p.lineBreak.test(this.input.slice(this.lastTokEnd,this.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(l.types.incDec,2):y===61?this.finishOp(l.types.assign,2):this.finishOp(l.types.plusMin,1)},e.readToken_lt_gt=function(g){var y=this.input.charCodeAt(this.pos+1),w=1;return y===g?(w=g===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+w)===61?this.finishOp(l.types.assign,w+1):this.finishOp(l.types.bitShift,w)):y==33&&g==60&&this.input.charCodeAt(this.pos+2)==45&&this.input.charCodeAt(this.pos+3)==45?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(y===61&&(w=2),this.finishOp(l.types.relational,w))},e.readToken_eq_excl=function(g){var y=this.input.charCodeAt(this.pos+1);return y===61?this.finishOp(l.types.equality,this.input.charCodeAt(this.pos+2)===61?3:2):g===61&&y===62&&6<=this.options.ecmaVersion?(this.pos+=2,this.finishToken(l.types.arrow)):this.finishOp(g===61?l.types.eq:l.types.prefix,1)},e.getTokenFromCode=function(g){switch(g){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(l.types.parenL);case 41:return++this.pos,this.finishToken(l.types.parenR);case 59:return++this.pos,this.finishToken(l.types.semi);case 44:return++this.pos,this.finishToken(l.types.comma);case 91:return++this.pos,this.finishToken(l.types.bracketL);case 93:return++this.pos,this.finishToken(l.types.bracketR);case 123:return++this.pos,this.finishToken(l.types.braceL);case 125:return++this.pos,this.finishToken(l.types.braceR);case 58:return++this.pos,this.finishToken(l.types.colon);case 63:return++this.pos,this.finishToken(l.types.question);case 96:if(6>this.options.ecmaVersion)break;return++this.pos,this.finishToken(l.types.backQuote);case 48:if(g=this.input.charCodeAt(this.pos+1),g===120||g===88)return this.readRadixNumber(16);if(6<=this.options.ecmaVersion){if(g===111||g===79)return this.readRadixNumber(8);if(g===98||g===66)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(g);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(g);case 124:case 38:return this.readToken_pipe_amp(g);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(g);case 60:case 62:return this.readToken_lt_gt(g);case 61:case 33:return this.readToken_eq_excl(g);case 126:return this.finishOp(l.types.prefix,1)}this.raise(this.pos,"Unexpected character '"+a(g)+"'")},e.finishOp=function(g,y){var w=this.input.slice(this.pos,this.pos+y);return this.pos+=y,this.finishToken(g,w)};var f=!!o("\uFFFF","u");e.readRegexp=function(){for(var g=this,y=void 0,w=void 0,M=this.pos;;){this.pos>=this.input.length&&this.raise(M,"Unterminated regular expression");var T=this.input.charAt(this.pos);if(p.lineBreak.test(T)&&this.raise(M,"Unterminated regular expression"),y)y=!1;else{if(T==="[")w=!0;else if(T==="]"&&w)w=!1;else if(T==="/"&&!w)break;y=T==="\\"}++this.pos}if(y=this.input.slice(M,this.pos),++this.pos,w=this.readWord1(),T=y,w){var B=/^[gim]*$/;6<=this.options.ecmaVersion&&(B=/^[gimuy]*$/),B.test(w)||this.raise(M,"Invalid regular expression flag"),0<=w.indexOf("u")&&!f&&(T=T.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(H,J,Q){return J=Number("0x"+J),1114111<J&&g.raise(M+Q+3,"Code point out of bounds"),"x"}),T=T.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"))}return B=null,_||(o(T,void 0,M,this),B=o(y,w)),this.finishToken(l.types.regexp,{pattern:y,flags:w,value:B})},e.readInt=function(g,y){for(var w=this.pos,M=0,T=0,B=y==null?Infinity:y;T<B;++T){var H=this.input.charCodeAt(this.pos),H=97<=H?H-97+10:65<=H?H-65+10:48<=H&&57>=H?H-48:Infinity;if(H>=g)break;++this.pos,M=M*g+H}return this.pos===w||y!=null&&this.pos-w!==y?null:M},e.readRadixNumber=function(g){this.pos+=2;var y=this.readInt(g);return y==null&&this.raise(this.start+2,"Expected number in radix "+g),u.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(l.types.num,y)},e.readNumber=function(g){var y=this.pos,w=!1,M=this.input.charCodeAt(this.pos)===48;g||this.readInt(10)!==null||this.raise(y,"Invalid number"),g=this.input.charCodeAt(this.pos),g===46&&(++this.pos,this.readInt(10),w=!0,g=this.input.charCodeAt(this.pos)),(g===69||g===101)&&(g=this.input.charCodeAt(++this.pos),g!==43&&g!==45||++this.pos,this.readInt(10)===null&&this.raise(y,"Invalid number"),w=!0),u.isIdentifierStart(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),g=this.input.slice(y,this.pos);var T=void 0;return w?T=parseFloat(g):M&&g.length!==1?/[89]/.test(g)||this.strict?this.raise(y,"Invalid number"):T=parseInt(g,8):T=parseInt(g,10),this.finishToken(l.types.num,T)},e.readCodePoint=function(){if(this.input.charCodeAt(this.pos)===123){6>this.options.ecmaVersion&&this.unexpected();var g=++this.pos,y=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos);++this.pos,1114111<y&&this.raise(g,"Code point out of bounds")}else y=this.readHexChar(4);return y},e.readString=function(g){for(var y="",w=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var M=this.input.charCodeAt(this.pos);if(M===g)break;M===92?(y+=this.input.slice(w,this.pos),y+=this.readEscapedChar(!1),w=this.pos):(p.isNewLine(M)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return y+=this.input.slice(w,this.pos++),this.finishToken(l.types.string,y)},e.readTmplToken=function(){for(var g="",y=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var w=this.input.charCodeAt(this.pos);if(w===96||w===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&this.type===l.types.template?w===36?(this.pos+=2,this.finishToken(l.types.dollarBraceL)):(++this.pos,this.finishToken(l.types.backQuote)):(g+=this.input.slice(y,this.pos),this.finishToken(l.types.template,g));if(w===92)g+=this.input.slice(y,this.pos),g+=this.readEscapedChar(!0),y=this.pos;else if(p.isNewLine(w)){switch(g+=this.input.slice(y,this.pos),++this.pos,w){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:g+=`
|
|
`;break;default:g+=String.fromCharCode(w)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),y=this.pos}else++this.pos}},e.readEscapedChar=function(g){var y=this.input.charCodeAt(++this.pos);switch(++this.pos,y){case 110:return`
|
|
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return a(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(48<=y&&55>=y){var y=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],w=parseInt(y,8);return 255<w&&(y=y.slice(0,-1),w=parseInt(y,8)),y!=="0"&&(this.strict||g)&&this.raise(this.pos-2,"Octal literal in strict mode"),this.pos+=y.length-1,String.fromCharCode(w)}return String.fromCharCode(y)}},e.readHexChar=function(g){var y=this.pos;return g=this.readInt(16,g),g===null&&this.raise(y,"Bad character escape sequence"),g},e.readWord1=function(){this.containsEsc=!1;for(var g="",y=!0,w=this.pos,M=6<=this.options.ecmaVersion;this.pos<this.input.length;){var T=this.fullCharCodeAtPos();if(u.isIdentifierChar(T,M))this.pos+=65535>=T?1:2;else if(T===92)this.containsEsc=!0,g+=this.input.slice(w,this.pos),w=this.pos,this.input.charCodeAt(++this.pos)!=117&&this.raise(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos,T=this.readCodePoint(),(y?u.isIdentifierStart:u.isIdentifierChar)(T,M)||this.raise(w,"Invalid Unicode escape"),g+=a(T),w=this.pos;else break;y=!1}return g+this.input.slice(w,this.pos)},e.readWord=function(){var g=this.readWord1(),y=l.types.name;return(6<=this.options.ecmaVersion||!this.containsEsc)&&this.keywords.test(g)&&(y=l.keywords[g]),this.finishToken(y,g)}},{"./identifier":2,"./locutil":5,"./state":10,"./tokentype":14,"./whitespace":16}],14:[function(e,r,s){function o(p,c){return new u(p,{beforeExpr:!0,binop:c})}function a(p){var c=1>=arguments.length||arguments[1]===void 0?{}:arguments[1];c.keyword=p,v[p]=l["_"+p]=new u(p,c)}s.__esModule=!0;var u=function p(c){var _=1>=arguments.length||arguments[1]===void 0?{}:arguments[1];if(!(this instanceof p))throw new TypeError("Cannot call a class as a function");this.label=c,this.keyword=_.keyword,this.beforeExpr=!!_.beforeExpr,this.startsExpr=!!_.startsExpr,this.isLoop=!!_.isLoop,this.isAssign=!!_.isAssign,this.prefix=!!_.prefix,this.postfix=!!_.postfix,this.binop=_.binop||null,this.updateContext=null};s.TokenType=u,e={beforeExpr:!0},r={startsExpr:!0};var l={num:new u("num",r),regexp:new u("regexp",r),string:new u("string",r),name:new u("name",r),eof:new u("eof"),bracketL:new u("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new u("]"),braceL:new u("{",{beforeExpr:!0,startsExpr:!0}),braceR:new u("}"),parenL:new u("(",{beforeExpr:!0,startsExpr:!0}),parenR:new u(")"),comma:new u(",",e),semi:new u(";",e),colon:new u(":",e),dot:new u("."),question:new u("?",e),arrow:new u("=>",e),template:new u("template"),ellipsis:new u("...",e),backQuote:new u("`",r),dollarBraceL:new u("${",{beforeExpr:!0,startsExpr:!0}),eq:new u("=",{beforeExpr:!0,isAssign:!0}),assign:new u("_=",{beforeExpr:!0,isAssign:!0}),incDec:new u("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new u("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:o("||",1),logicalAND:o("&&",2),bitwiseOR:o("|",3),bitwiseXOR:o("^",4),bitwiseAND:o("&",5),equality:o("==/!=",6),relational:o("</>",7),bitShift:o("<</>>",8),plusMin:new u("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:o("%",10),star:o("*",10),slash:o("/",10),starstar:new u("**",{beforeExpr:!0})};s.types=l;var v={};s.keywords=v,a("break"),a("case",e),a("catch"),a("continue"),a("debugger"),a("default",e),a("do",{isLoop:!0,beforeExpr:!0}),a("else",e),a("finally"),a("for",{isLoop:!0}),a("function",r),a("if"),a("return",e),a("switch"),a("throw",e),a("try"),a("var"),a("const"),a("while",{isLoop:!0}),a("with"),a("new",{beforeExpr:!0,startsExpr:!0}),a("this",r),a("super",r),a("class"),a("extends",e),a("export"),a("import"),a("null",r),a("true",r),a("false",r),a("in",{beforeExpr:!0,binop:7}),a("instanceof",{beforeExpr:!0,binop:7}),a("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),a("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),a("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},{}],15:[function(e,r,s){s.__esModule=!0,s.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"},s.has=function(o,a){return Object.prototype.hasOwnProperty.call(o,a)}},{}],16:[function(e,r,s){s.__esModule=!0,s.isNewLine=function(o){return o===10||o===13||o===8232||o==8233},e=/\r\n?|\n|\u2028|\u2029/,s.lineBreak=e,s.lineBreakG=new RegExp(e.source,"g"),s.nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,s.skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g},{}]},{},[3])(3)});var UPNG={};UPNG.toRGBA8=function(e){var r=e.width,s=e.height;if(e.tabs.acTL==null)return[UPNG.toRGBA8.decodeImage(e.data,r,s,e).buffer];var o=[];e.frames[0].data==null&&(e.frames[0].data=e.data);for(var a=r*s*4,u=new Uint8Array(a),l=new Uint8Array(a),v=new Uint8Array(a),p=0;p<e.frames.length;p++){var c=e.frames[p],_=c.rect.x,f=c.rect.y,g=c.rect.width,y=c.rect.height,w=UPNG.toRGBA8.decodeImage(c.data,g,y,e);if(p!=0)for(var M=0;M<a;M++)v[M]=u[M];if(c.blend==0?UPNG._copyTile(w,g,y,u,r,s,_,f,0):c.blend==1&&UPNG._copyTile(w,g,y,u,r,s,_,f,1),o.push(u.buffer.slice(0)),c.dispose!=0){if(c.dispose==1)UPNG._copyTile(l,g,y,u,r,s,_,f,0);else if(c.dispose==2)for(var M=0;M<a;M++)u[M]=v[M]}}return o},UPNG.toRGBA8.decodeImage=function(e,r,s,o){var a=r*s,u=UPNG.decode._getBPP(o),l=Math.ceil(r*u/8),v=new Uint8Array(a*4),p=new Uint32Array(v.buffer),c=o.ctype,_=o.depth,f=UPNG._bin.readUshort,g=Date.now();if(c==6){var y=a<<2;if(_==8)for(var w=0;w<y;w+=4)v[w]=e[w],v[w+1]=e[w+1],v[w+2]=e[w+2],v[w+3]=e[w+3];if(_==16)for(var w=0;w<y;w++)v[w]=e[w<<1]}else if(c==2){var M=o.tabs.tRNS;if(M==null){if(_==8)for(var w=0;w<a;w++){var T=w*3;p[w]=255<<24|e[T+2]<<16|e[T+1]<<8|e[T]}if(_==16)for(var w=0;w<a;w++){var T=w*6;p[w]=255<<24|e[T+4]<<16|e[T+2]<<8|e[T]}}else{var B=M[0],H=M[1],J=M[2];if(_==8)for(var w=0;w<a;w++){var Q=w<<2,T=w*3;p[w]=255<<24|e[T+2]<<16|e[T+1]<<8|e[T],e[T]==B&&e[T+1]==H&&e[T+2]==J&&(v[Q+3]=0)}if(_==16)for(var w=0;w<a;w++){var Q=w<<2,T=w*6;p[w]=255<<24|e[T+4]<<16|e[T+2]<<8|e[T],f(e,T)==B&&f(e,T+2)==H&&f(e,T+4)==J&&(v[Q+3]=0)}}}else if(c==3){var q=o.tabs.PLTE,O=o.tabs.tRNS,K=O?O.length:0;if(_==1)for(var pe=0;pe<s;pe++)for(var R=pe*l,Te=pe*r,w=0;w<r;w++){var Q=Te+w<<2,re=e[R+(w>>3)]>>7-((w&7)<<0)&1,oe=3*re;v[Q]=q[oe],v[Q+1]=q[oe+1],v[Q+2]=q[oe+2],v[Q+3]=re<K?O[re]:255}if(_==2)for(var pe=0;pe<s;pe++)for(var R=pe*l,Te=pe*r,w=0;w<r;w++){var Q=Te+w<<2,re=e[R+(w>>2)]>>6-((w&3)<<1)&3,oe=3*re;v[Q]=q[oe],v[Q+1]=q[oe+1],v[Q+2]=q[oe+2],v[Q+3]=re<K?O[re]:255}if(_==4)for(var pe=0;pe<s;pe++)for(var R=pe*l,Te=pe*r,w=0;w<r;w++){var Q=Te+w<<2,re=e[R+(w>>1)]>>4-((w&1)<<2)&15,oe=3*re;v[Q]=q[oe],v[Q+1]=q[oe+1],v[Q+2]=q[oe+2],v[Q+3]=re<K?O[re]:255}if(_==8)for(var w=0;w<a;w++){var Q=w<<2,re=e[w],oe=3*re;v[Q]=q[oe],v[Q+1]=q[oe+1],v[Q+2]=q[oe+2],v[Q+3]=re<K?O[re]:255}}else if(c==4){if(_==8)for(var w=0;w<a;w++){var Q=w<<2,me=w<<1,ue=e[me];v[Q]=ue,v[Q+1]=ue,v[Q+2]=ue,v[Q+3]=e[me+1]}if(_==16)for(var w=0;w<a;w++){var Q=w<<2,me=w<<2,ue=e[me];v[Q]=ue,v[Q+1]=ue,v[Q+2]=ue,v[Q+3]=e[me+2]}}else if(c==0)for(var B=o.tabs.tRNS?o.tabs.tRNS:-1,pe=0;pe<s;pe++){var $=pe*l,ee=pe*r;if(_==1)for(var ne=0;ne<r;ne++){var ue=255*(e[$+(ne>>>3)]>>>7-(ne&7)&1),_e=ue==B*255?0:255;p[ee+ne]=_e<<24|ue<<16|ue<<8|ue}else if(_==2)for(var ne=0;ne<r;ne++){var ue=85*(e[$+(ne>>>2)]>>>6-((ne&3)<<1)&3),_e=ue==B*85?0:255;p[ee+ne]=_e<<24|ue<<16|ue<<8|ue}else if(_==4)for(var ne=0;ne<r;ne++){var ue=17*(e[$+(ne>>>1)]>>>4-((ne&1)<<2)&15),_e=ue==B*17?0:255;p[ee+ne]=_e<<24|ue<<16|ue<<8|ue}else if(_==8)for(var ne=0;ne<r;ne++){var ue=e[$+ne],_e=ue==B?0:255;p[ee+ne]=_e<<24|ue<<16|ue<<8|ue}else if(_==16)for(var ne=0;ne<r;ne++){var ue=e[$+(ne<<1)],_e=f(e,$+(ne<<w))==B?0:255;p[ee+ne]=_e<<24|ue<<16|ue<<8|ue}}return v},UPNG.decode=function(e){for(var r=new Uint8Array(e),s=8,o=UPNG._bin,a=o.readUshort,u=o.readUint,l={tabs:{},frames:[]},v=new Uint8Array(r.length),p=0,c,_=0,f=[137,80,78,71,13,10,26,10],g=0;g<8;g++)if(r[g]!=f[g])throw"The input is not a PNG file!";for(;s<r.length;){var y=o.readUint(r,s);s+=4;var w=o.readASCII(r,s,4);if(s+=4,w=="IHDR")UPNG.decode._IHDR(r,s,l);else if(w=="CgBI")l.tabs[w]=r.slice(s,s+4);else if(w=="IDAT"){for(var g=0;g<y;g++)v[p+g]=r[s+g];p+=y}else if(w=="acTL")l.tabs[w]={num_frames:u(r,s),num_plays:u(r,s+4)},c=new Uint8Array(r.length);else if(w=="fcTL"){if(_!=0){var M=l.frames[l.frames.length-1];M.data=UPNG.decode._decompress(l,c.slice(0,_),M.rect.width,M.rect.height),_=0}var T={x:u(r,s+12),y:u(r,s+16),width:u(r,s+4),height:u(r,s+8)},B=a(r,s+22);B=a(r,s+20)/(B==0?100:B);var H={rect:T,delay:Math.round(B*1e3),dispose:r[s+24],blend:r[s+25]};l.frames.push(H)}else if(w=="fdAT"){for(var g=0;g<y-4;g++)c[_+g]=r[s+g+4];_+=y-4}else if(w=="pHYs")l.tabs[w]=[o.readUint(r,s),o.readUint(r,s+4),r[s+8]];else if(w=="cHRM"){l.tabs[w]=[];for(var g=0;g<8;g++)l.tabs[w].push(o.readUint(r,s+g*4))}else if(w=="tEXt"){l.tabs[w]==null&&(l.tabs[w]={});var J=o.nextZero(r,s),Q=o.readASCII(r,s,J-s),q=o.readASCII(r,J+1,s+y-J-1);l.tabs[w][Q]=q}else if(w=="iTXt"){l.tabs[w]==null&&(l.tabs[w]={});var J=0,O=s;J=o.nextZero(r,O);var Q=o.readASCII(r,O,J-O);O=J+1;var K=r[O],pe=r[O+1];O+=2,J=o.nextZero(r,O);var R=o.readASCII(r,O,J-O);O=J+1,J=o.nextZero(r,O);var Te=o.readUTF8(r,O,J-O);O=J+1;var q=o.readUTF8(r,O,y-(O-s));l.tabs[w][Q]=q}else if(w=="PLTE")l.tabs[w]=o.readBytes(r,s,y);else if(w=="hIST"){var re=l.tabs.PLTE.length/3;l.tabs[w]=[];for(var g=0;g<re;g++)l.tabs[w].push(a(r,s+g*2))}else if(w=="tRNS")l.ctype==3?l.tabs[w]=o.readBytes(r,s,y):l.ctype==0?l.tabs[w]=a(r,s):l.ctype==2&&(l.tabs[w]=[a(r,s),a(r,s+2),a(r,s+4)]);else if(w=="gAMA")l.tabs[w]=o.readUint(r,s)/1e5;else if(w=="sRGB")l.tabs[w]=r[s];else if(w=="bKGD")l.ctype==0||l.ctype==4?l.tabs[w]=[a(r,s)]:l.ctype==2||l.ctype==6?l.tabs[w]=[a(r,s),a(r,s+2),a(r,s+4)]:l.ctype==3&&(l.tabs[w]=r[s]);else if(w=="IEND")break;s+=y;var oe=o.readUint(r,s);s+=4}if(_!=0){var M=l.frames[l.frames.length-1];M.data=UPNG.decode._decompress(l,c.slice(0,_),M.rect.width,M.rect.height),_=0}return l.data=UPNG.decode._decompress(l,v,l.width,l.height),delete l.compress,delete l.interlace,delete l.filter,l},UPNG.decode._decompress=function(e,r,s,o){var a=Date.now(),u=UPNG.decode._getBPP(e),l=Math.ceil(s*u/8),v=new Uint8Array((l+1+e.interlace)*o);e.tabs.CgBI?r=UPNG.inflateRaw(r,v):r=UPNG.decode._inflate(r,v);var a=Date.now();return e.interlace==0?r=UPNG.decode._filterZero(r,e,0,s,o):e.interlace==1&&(r=UPNG.decode._readInterlace(r,e)),r},UPNG.decode._inflate=function(e,r){var s=UPNG.inflateRaw(new Uint8Array(e.buffer,2,e.length-6),r);return s},UPNG.inflateRaw=function(){var e={};return e.H={},e.H.N=function(r,s){var o=Uint8Array,a=0,u=0,l=0,v=0,p=0,c=0,_=0,f=0,g=0,y,w;if(r[0]==3&&r[1]==0)return s||new o(0);var M=e.H,T=M.b,B=M.e,H=M.R,J=M.n,Q=M.A,q=M.Z,O=M.m,K=s==null;for(K&&(s=new o(r.length>>>2<<3));a==0;){if(a=T(r,g,1),u=T(r,g+1,2),g+=3,u==0){(g&7)!=0&&(g+=8-(g&7));var pe=(g>>>3)+4,R=r[pe-4]|r[pe-3]<<8;K&&(s=e.H.W(s,f+R)),s.set(new o(r.buffer,r.byteOffset+pe,R),f),g=pe+R<<3,f+=R;continue}if(K&&(s=e.H.W(s,f+(1<<17))),u==1&&(y=O.J,w=O.h,c=(1<<9)-1,_=(1<<5)-1),u==2){l=B(r,g,5)+257,v=B(r,g+5,5)+1,p=B(r,g+10,4)+4,g+=14;for(var Te=g,re=1,oe=0;oe<38;oe+=2)O.Q[oe]=0,O.Q[oe+1]=0;for(var oe=0;oe<p;oe++){var me=B(r,g+oe*3,3);O.Q[(O.X[oe]<<1)+1]=me,me>re&&(re=me)}g+=3*p,J(O.Q,re),Q(O.Q,re,O.u),y=O.w,w=O.d,g=H(O.u,(1<<re)-1,l+v,r,g,O.v);var ue=M.V(O.v,0,l,O.C);c=(1<<ue)-1;var $=M.V(O.v,l,v,O.D);_=(1<<$)-1,J(O.C,ue),Q(O.C,ue,y),J(O.D,$),Q(O.D,$,w)}for(;;){var ee=y[q(r,g)&c];g+=ee&15;var ne=ee>>>4;if(ne>>>8==0)s[f++]=ne;else{if(ne==256)break;var _e=f+ne-254;if(ne>264){var ae=O.q[ne-257];_e=f+(ae>>>3)+B(r,g,ae&7),g+=ae&7}var Me=w[q(r,g)&_];g+=Me&15;var Ne=Me>>>4,Ae=O.c[Ne],Fe=(Ae>>>4)+T(r,g,Ae&15);for(g+=Ae&15;f<_e;)s[f]=s[f++-Fe],s[f]=s[f++-Fe],s[f]=s[f++-Fe],s[f]=s[f++-Fe];f=_e}}}return s.length==f?s:s.slice(0,f)},e.H.W=function(r,s){var o=r.length;if(s<=o)return r;var a=new Uint8Array(o<<1);return a.set(r,0),a},e.H.R=function(r,s,o,a,u,l){for(var v=e.H.e,p=e.H.Z,c=0;c<o;){var _=r[p(a,u)&s];u+=_&15;var f=_>>>4;if(f<=15)l[c]=f,c++;else{var g=0,y=0;f==16?(y=3+v(a,u,2),u+=2,g=l[c-1]):f==17?(y=3+v(a,u,3),u+=3):f==18&&(y=11+v(a,u,7),u+=7);for(var w=c+y;c<w;)l[c]=g,c++}}return u},e.H.V=function(r,s,o,a){for(var u=0,l=0,v=a.length>>>1;l<o;){var p=r[l+s];a[l<<1]=0,a[(l<<1)+1]=p,p>u&&(u=p),l++}for(;l<v;)a[l<<1]=0,a[(l<<1)+1]=0,l++;return u},e.H.n=function(r,s){for(var o=e.H.m,a=r.length,u,l,v,p,c,_=o.j,p=0;p<=s;p++)_[p]=0;for(p=1;p<a;p+=2)_[r[p]]++;var f=o.K;for(u=0,_[0]=0,l=1;l<=s;l++)u=u+_[l-1]<<1,f[l]=u;for(v=0;v<a;v+=2)c=r[v+1],c!=0&&(r[v]=f[c],f[c]++)},e.H.A=function(r,s,o){for(var a=r.length,u=e.H.m,l=u.r,v=0;v<a;v+=2)if(r[v+1]!=0)for(var p=v>>1,c=r[v+1],_=p<<4|c,f=s-c,g=r[v]<<f,y=g+(1<<f);g!=y;){var w=l[g]>>>15-s;o[w]=_,g++}},e.H.l=function(r,s){for(var o=e.H.m.r,a=15-s,u=0;u<r.length;u+=2){var l=r[u]<<s-r[u+1];r[u]=o[l]>>>a}},e.H.M=function(r,s,o){o=o<<(s&7);var a=s>>>3;r[a]|=o,r[a+1]|=o>>>8},e.H.I=function(r,s,o){o=o<<(s&7);var a=s>>>3;r[a]|=o,r[a+1]|=o>>>8,r[a+2]|=o>>>16},e.H.e=function(r,s,o){return(r[s>>>3]|r[(s>>>3)+1]<<8)>>>(s&7)&(1<<o)-1},e.H.b=function(r,s,o){return(r[s>>>3]|r[(s>>>3)+1]<<8|r[(s>>>3)+2]<<16)>>>(s&7)&(1<<o)-1},e.H.Z=function(r,s){return(r[s>>>3]|r[(s>>>3)+1]<<8|r[(s>>>3)+2]<<16)>>>(s&7)},e.H.i=function(r,s){return(r[s>>>3]|r[(s>>>3)+1]<<8|r[(s>>>3)+2]<<16|r[(s>>>3)+3]<<24)>>>(s&7)},e.H.m=function(){var r=Uint16Array,s=Uint32Array;return{K:new r(16),j:new r(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 r(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 s(32),J:new r(512),_:[],h:new r(32),$:[],w:new r(32768),C:[],v:[],d:new r(32768),D:[],u:new r(512),Q:[],r:new r(1<<15),s:new s(286),Y:new s(30),a:new s(19),t:new s(15e3),k:new r(1<<16),g:new r(1<<15)}}(),function(){for(var r=e.H.m,s=1<<15,o=0;o<s;o++){var a=o;a=(a&2863311530)>>>1|(a&1431655765)<<1,a=(a&3435973836)>>>2|(a&858993459)<<2,a=(a&4042322160)>>>4|(a&252645135)<<4,a=(a&4278255360)>>>8|(a&16711935)<<8,r.r[o]=(a>>>16|a<<16)>>>17}function u(l,v,p){for(;v--!=0;)l.push(0,p)}for(var o=0;o<32;o++)r.q[o]=r.S[o]<<3|r.T[o],r.c[o]=r.p[o]<<4|r.z[o];u(r._,144,8),u(r._,255-143,9),u(r._,279-255,7),u(r._,287-279,8),e.H.n(r._,9),e.H.A(r._,9,r.J),e.H.l(r._,9),u(r.$,32,5),e.H.n(r.$,5),e.H.A(r.$,5,r.h),e.H.l(r.$,5),u(r.Q,19,0),u(r.C,286,0),u(r.D,30,0),u(r.v,320,0)}(),e.H.N}(),UPNG.decode._readInterlace=function(e,r){for(var s=r.width,o=r.height,a=UPNG.decode._getBPP(r),u=a>>3,l=Math.ceil(s*a/8),v=new Uint8Array(o*l),p=0,c=[0,0,4,0,2,0,1],_=[0,4,0,2,0,1,0],f=[8,8,8,4,4,2,2],g=[8,8,4,4,2,2,1],y=0;y<7;){for(var w=f[y],M=g[y],T=0,B=0,H=c[y];H<o;)H+=w,B++;for(var J=_[y];J<s;)J+=M,T++;var Q=Math.ceil(T*a/8);UPNG.decode._filterZero(e,r,p,T,B);for(var q=0,O=c[y];O<o;){for(var K=_[y],pe=p+q*Q<<3;K<s;){if(a==1){var R=e[pe>>3];R=R>>7-(pe&7)&1,v[O*l+(K>>3)]|=R<<7-((K&7)<<0)}if(a==2){var R=e[pe>>3];R=R>>6-(pe&7)&3,v[O*l+(K>>2)]|=R<<6-((K&3)<<1)}if(a==4){var R=e[pe>>3];R=R>>4-(pe&7)&15,v[O*l+(K>>1)]|=R<<4-((K&1)<<2)}if(a>=8)for(var Te=O*l+K*u,re=0;re<u;re++)v[Te+re]=e[(pe>>3)+re];pe+=a,K+=M}q++,O+=w}T*B!=0&&(p+=B*(1+Q)),y=y+1}return v},UPNG.decode._getBPP=function(e){var r=[1,null,3,1,2,null,4][e.ctype];return r*e.depth},UPNG.decode._filterZero=function(e,r,s,o,a){var u=UPNG.decode._getBPP(r),l=Math.ceil(o*u/8),v=UPNG.decode._paeth;u=Math.ceil(u/8);var p=0,c=1,_=e[s],f=0;if(_>1&&(e[s]=[0,0,1][_-2]),_==3)for(f=u;f<l;f++)e[f+1]=e[f+1]+(e[f+1-u]>>>1)&255;for(var g=0;g<a;g++)if(p=s+g*l,c=p+g+1,_=e[c-1],f=0,_==0)for(;f<l;f++)e[p+f]=e[c+f];else if(_==1){for(;f<u;f++)e[p+f]=e[c+f];for(;f<l;f++)e[p+f]=e[c+f]+e[p+f-u]}else if(_==2)for(;f<l;f++)e[p+f]=e[c+f]+e[p+f-l];else if(_==3){for(;f<u;f++)e[p+f]=e[c+f]+(e[p+f-l]>>>1);for(;f<l;f++)e[p+f]=e[c+f]+(e[p+f-l]+e[p+f-u]>>>1)}else{for(;f<u;f++)e[p+f]=e[c+f]+v(0,e[p+f-l],0);for(;f<l;f++)e[p+f]=e[c+f]+v(e[p+f-u],e[p+f-l],e[p+f-u-l])}return e},UPNG.decode._paeth=function(e,r,s){var o=e+r-s,a=o-e,u=o-r,l=o-s;return a*a<=u*u&&a*a<=l*l?e:u*u<=l*l?r:s},UPNG.decode._IHDR=function(e,r,s){var o=UPNG._bin;s.width=o.readUint(e,r),r+=4,s.height=o.readUint(e,r),r+=4,s.depth=e[r],r++,s.ctype=e[r],r++,s.compress=e[r],r++,s.filter=e[r],r++,s.interlace=e[r],r++},UPNG._bin={nextZero:function(e,r){for(;e[r]!=0;)r++;return r},readUshort:function(e,r){return e[r]<<8|e[r+1]},writeUshort:function(e,r,s){e[r]=s>>8&255,e[r+1]=s&255},readUint:function(e,r){return e[r]*(256*256*256)+(e[r+1]<<16|e[r+2]<<8|e[r+3])},writeUint:function(e,r,s){e[r]=s>>24&255,e[r+1]=s>>16&255,e[r+2]=s>>8&255,e[r+3]=s&255},readASCII:function(e,r,s){for(var o="",a=0;a<s;a++)o+=String.fromCharCode(e[r+a]);return o},writeASCII:function(e,r,s){for(var o=0;o<s.length;o++)e[r+o]=s.charCodeAt(o)},readBytes:function(e,r,s){for(var o=[],a=0;a<s;a++)o.push(e[r+a]);return o},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,r,s){for(var o="",a,u=0;u<s;u++)o+="%"+UPNG._bin.pad(e[r+u].toString(16));try{a=decodeURIComponent(o)}catch(l){return UPNG._bin.readASCII(e,r,s)}return a}},UPNG._copyTile=function(e,r,s,o,a,u,l,v,p){for(var c=Math.min(r,a),_=Math.min(s,u),f=0,g=0,y=0;y<_;y++)for(var w=0;w<c;w++)if(l>=0&&v>=0?(f=y*r+w<<2,g=(v+y)*a+l+w<<2):(f=(-v+y)*r-l+w<<2,g=y*a+w<<2),p==0)o[g]=e[f],o[g+1]=e[f+1],o[g+2]=e[f+2],o[g+3]=e[f+3];else if(p==1){var M=e[f+3]*(1/255),T=e[f]*M,B=e[f+1]*M,H=e[f+2]*M,J=o[g+3]*(1/255),Q=o[g]*J,q=o[g+1]*J,O=o[g+2]*J,K=1-M,pe=M+J*K,R=pe==0?0:1/pe;o[g+3]=255*pe,o[g+0]=(T+Q*K)*R,o[g+1]=(B+q*K)*R,o[g+2]=(H+O*K)*R}else if(p==2){var M=e[f+3],T=e[f],B=e[f+1],H=e[f+2],J=o[g+3],Q=o[g],q=o[g+1],O=o[g+2];M==J&&T==Q&&B==q&&H==O?(o[g]=0,o[g+1]=0,o[g+2]=0,o[g+3]=0):(o[g]=T,o[g+1]=B,o[g+2]=H,o[g+3]=M)}else if(p==3){var M=e[f+3],T=e[f],B=e[f+1],H=e[f+2],J=o[g+3],Q=o[g],q=o[g+1],O=o[g+2];if(M==J&&T==Q&&B==q&&H==O)continue;if(M<220&&J>20)return!1}return!0},UPNG.encode=function(e,r,s,o,a,u,l){o==null&&(o=0),l==null&&(l=!1);var v=UPNG.encode.compress(e,r,s,o,[!1,!1,!1,0,l]);return UPNG.encode.compressPNG(v,-1),UPNG.encode._main(v,r,s,a,u)},UPNG.encodeLL=function(e,r,s,o,a,u,l,v){for(var p={ctype:0+(o==1?0:2)+(a==0?0:4),depth:u,frames:[]},c=Date.now(),_=(o+a)*u,f=_*r,g=0;g<e.length;g++)p.frames.push({rect:{x:0,y:0,width:r,height:s},img:new Uint8Array(e[g]),blend:0,dispose:1,bpp:Math.ceil(_/8),bpl:Math.ceil(f/8)});UPNG.encode.compressPNG(p,0,!0);var y=UPNG.encode._main(p,r,s,l,v);return y},UPNG.encode._main=function(e,r,s,o,a){a==null&&(a={});var u=UPNG.crc.crc,l=UPNG._bin.writeUint,v=UPNG._bin.writeUshort,p=UPNG._bin.writeASCII,c=8,_=e.frames.length>1,f=!1,g=8+(16+5+4)+(_?20:0);if(a.sRGB!=null&&(g+=8+1+4),a.pHYs!=null&&(g+=8+9+4),e.ctype==3){for(var y=e.plte.length,w=0;w<y;w++)e.plte[w]>>>24!=255&&(f=!0);g+=8+y*3+4+(f?8+y*1+4:0)}for(var M=0;M<e.frames.length;M++){var T=e.frames[M];_&&(g+=38),g+=T.cimg.length+12,M!=0&&(g+=4)}g+=12;for(var B=new Uint8Array(g),H=[137,80,78,71,13,10,26,10],w=0;w<8;w++)B[w]=H[w];if(l(B,c,13),c+=4,p(B,c,"IHDR"),c+=4,l(B,c,r),c+=4,l(B,c,s),c+=4,B[c]=e.depth,c++,B[c]=e.ctype,c++,B[c]=0,c++,B[c]=0,c++,B[c]=0,c++,l(B,c,u(B,c-17,17)),c+=4,a.sRGB!=null&&(l(B,c,1),c+=4,p(B,c,"sRGB"),c+=4,B[c]=a.sRGB,c++,l(B,c,u(B,c-5,5)),c+=4),a.pHYs!=null&&(l(B,c,9),c+=4,p(B,c,"pHYs"),c+=4,l(B,c,a.pHYs[0]),c+=4,l(B,c,a.pHYs[1]),c+=4,B[c]=a.pHYs[2],c++,l(B,c,u(B,c-13,13)),c+=4),_&&(l(B,c,8),c+=4,p(B,c,"acTL"),c+=4,l(B,c,e.frames.length),c+=4,l(B,c,a.loop!=null?a.loop:0),c+=4,l(B,c,u(B,c-12,12)),c+=4),e.ctype==3){var y=e.plte.length;l(B,c,y*3),c+=4,p(B,c,"PLTE"),c+=4;for(var w=0;w<y;w++){var J=w*3,Q=e.plte[w],q=Q&255,O=Q>>>8&255,K=Q>>>16&255;B[c+J+0]=q,B[c+J+1]=O,B[c+J+2]=K}if(c+=y*3,l(B,c,u(B,c-y*3-4,y*3+4)),c+=4,f){l(B,c,y),c+=4,p(B,c,"tRNS"),c+=4;for(var w=0;w<y;w++)B[c+w]=e.plte[w]>>>24&255;c+=y,l(B,c,u(B,c-y-4,y+4)),c+=4}}for(var pe=0,M=0;M<e.frames.length;M++){var T=e.frames[M];_&&(l(B,c,26),c+=4,p(B,c,"fcTL"),c+=4,l(B,c,pe++),c+=4,l(B,c,T.rect.width),c+=4,l(B,c,T.rect.height),c+=4,l(B,c,T.rect.x),c+=4,l(B,c,T.rect.y),c+=4,v(B,c,o[M]),c+=2,v(B,c,1e3),c+=2,B[c]=T.dispose,c++,B[c]=T.blend,c++,l(B,c,u(B,c-30,30)),c+=4);var R=T.cimg,y=R.length;l(B,c,y+(M==0?0:4)),c+=4;var Te=c;p(B,c,M==0?"IDAT":"fdAT"),c+=4,M!=0&&(l(B,c,pe++),c+=4),B.set(R,c),c+=y,l(B,c,u(B,Te,c-Te)),c+=4}return l(B,c,0),c+=4,p(B,c,"IEND"),c+=4,l(B,c,u(B,c-4,4)),c+=4,B.buffer},UPNG.encode.compressPNG=function(e,r,s){for(var o=0;o<e.frames.length;o++){var a=e.frames[o],u=a.rect.width,l=a.rect.height,v=new Uint8Array(l*a.bpl+l);a.cimg=UPNG.encode._filterZero(a.img,l,a.bpp,a.bpl,v,r,s)}},UPNG.encode.compress=function(e,r,s,o,a){for(var u=a[0],l=a[1],v=a[2],p=a[3],c=a[4],_=6,f=8,g=255,y=0;y<e.length;y++)for(var w=new Uint8Array(e[y]),M=w.length,T=0;T<M;T+=4)g&=w[T+3];var B=g!=255,H=UPNG.encode.framize(e,r,s,u,l,v),J={},Q=[],q=[];if(o!=0){for(var O=[],T=0;T<H.length;T++)O.push(H[T].img.buffer);var K=UPNG.encode.concatRGBA(O),pe=UPNG.quantize(K,o);console.log(pe);for(var R=0,Te=new Uint8Array(pe.abuf),T=0;T<H.length;T++){var re=H[T].img,oe=re.length;q.push(new Uint8Array(pe.inds.buffer,R>>2,oe>>2));for(var y=0;y<oe;y+=4)re[y]=Te[R+y],re[y+1]=Te[R+y+1],re[y+2]=Te[R+y+2],re[y+3]=Te[R+y+3];R+=oe}for(var T=0;T<pe.plte.length;T++)Q.push(pe.plte[T].est.rgba)}else for(var y=0;y<H.length;y++){var me=H[y],ue=new Uint32Array(me.img.buffer),$=me.rect.width,M=ue.length,ee=new Uint8Array(M);q.push(ee);for(var T=0;T<M;T++){var ne=ue[T];if(T!=0&&ne==ue[T-1])ee[T]=ee[T-1];else if(T>$&&ne==ue[T-$])ee[T]=ee[T-$];else{var _e=J[ne];if(_e==null&&(J[ne]=_e=Q.length,Q.push(ne),Q.length>=300))break;ee[T]=_e}}}var ae=Q.length;ae<=256&&c==!1&&(ae<=2?f=1:ae<=4?f=2:ae<=16?f=4:f=8,f=Math.max(f,p));for(var y=0;y<H.length;y++){var me=H[y],Me=me.rect.x,Ne=me.rect.y,$=me.rect.width,Ae=me.rect.height,Fe=me.img,De=new Uint32Array(Fe.buffer),ze=4*$,ye=4;if(ae<=256&&c==!1){ze=Math.ceil(f*$/8);for(var he=new Uint8Array(ze*Ae),ke=q[y],le=0;le<Ae;le++){var T=le*ze,Ce=le*$;if(f==8)for(var Be=0;Be<$;Be++)he[T+Be]=ke[Ce+Be];else if(f==4)for(var Be=0;Be<$;Be++)he[T+(Be>>1)]|=ke[Ce+Be]<<4-(Be&1)*4;else if(f==2)for(var Be=0;Be<$;Be++)he[T+(Be>>2)]|=ke[Ce+Be]<<6-(Be&3)*2;else if(f==1)for(var Be=0;Be<$;Be++)he[T+(Be>>3)]|=ke[Ce+Be]<<7-(Be&7)*1}Fe=he,_=3,ye=1}else if(B==!1&&H.length==1){for(var he=new Uint8Array($*Ae*3),we=$*Ae,T=0;T<we;T++){var re=T*3,xe=T*4;he[re]=Fe[xe],he[re+1]=Fe[xe+1],he[re+2]=Fe[xe+2]}Fe=he,_=2,ye=3,ze=3*$}me.img=Fe,me.bpl=ze,me.bpp=ye}return{ctype:_,depth:f,plte:Q,frames:H}},UPNG.encode.framize=function(e,r,s,o,a,u){for(var l=[],v=0;v<e.length;v++){var p=new Uint8Array(e[v]),c=new Uint32Array(p.buffer),_,f=0,g=0,y=r,w=s,M=o?1:0;if(v!=0){for(var T=u||o||v==1||l[v-2].dispose!=0?1:2,B=0,H=1e9,J=0;J<T;J++){for(var me=new Uint8Array(e[v-1-J]),Q=new Uint32Array(e[v-1-J]),q=r,O=s,K=-1,pe=-1,R=0;R<s;R++)for(var Te=0;Te<r;Te++){var re=R*r+Te;c[re]!=Q[re]&&(Te<q&&(q=Te),Te>K&&(K=Te),R<O&&(O=R),R>pe&&(pe=R))}K==-1&&(q=O=K=pe=0),a&&((q&1)==1&&q--,(O&1)==1&&O--);var oe=(K-q+1)*(pe-O+1);oe<H&&(H=oe,B=J,f=q,g=O,y=K-q+1,w=pe-O+1)}var me=new Uint8Array(e[v-1-B]);B==1&&(l[v-1].dispose=2),_=new Uint8Array(y*w*4),UPNG._copyTile(me,r,s,_,y,w,-f,-g,0),M=UPNG._copyTile(p,r,s,_,y,w,-f,-g,3)?1:0,M==1?UPNG.encode._prepareDiff(p,r,s,_,{x:f,y:g,width:y,height:w}):UPNG._copyTile(p,r,s,_,y,w,-f,-g,0)}else _=p.slice(0);l.push({rect:{x:f,y:g,width:y,height:w},img:_,blend:M,dispose:0})}if(o)for(var v=0;v<l.length;v++){var ue=l[v];if(ue.blend!=1){var $=ue.rect,ee=l[v-1].rect,ne=Math.min($.x,ee.x),_e=Math.min($.y,ee.y),ae=Math.max($.x+$.width,ee.x+ee.width),Me=Math.max($.y+$.height,ee.y+ee.height),Ne={x:ne,y:_e,width:ae-ne,height:Me-_e};l[v-1].dispose=1,v-1!=0&&UPNG.encode._updateFrame(e,r,s,l,v-1,Ne,a),UPNG.encode._updateFrame(e,r,s,l,v,Ne,a)}}var Ae=0;if(e.length!=1)for(var re=0;re<l.length;re++){var ue=l[re];Ae+=ue.rect.width*ue.rect.height}return l},UPNG.encode._updateFrame=function(e,r,s,o,a,u,l){for(var v=Uint8Array,p=Uint32Array,c=new v(e[a-1]),_=new p(e[a-1]),f=a+1<e.length?new v(e[a+1]):null,g=new v(e[a]),y=new p(g.buffer),w=r,M=s,T=-1,B=-1,H=0;H<u.height;H++)for(var J=0;J<u.width;J++){var Q=u.x+J,q=u.y+H,O=q*r+Q,K=y[O];K==0||o[a-1].dispose==0&&_[O]==K&&(f==null||f[O*4+3]!=0)||(Q<w&&(w=Q),Q>T&&(T=Q),q<M&&(M=q),q>B&&(B=q))}T==-1&&(w=M=T=B=0),l&&((w&1)==1&&w--,(M&1)==1&&M--),u={x:w,y:M,width:T-w+1,height:B-M+1};var pe=o[a];pe.rect=u,pe.blend=1,pe.img=new Uint8Array(u.width*u.height*4),o[a-1].dispose==0?(UPNG._copyTile(c,r,s,pe.img,u.width,u.height,-u.x,-u.y,0),UPNG.encode._prepareDiff(g,r,s,pe.img,u)):UPNG._copyTile(g,r,s,pe.img,u.width,u.height,-u.x,-u.y,0)},UPNG.encode._prepareDiff=function(e,r,s,o,a){UPNG._copyTile(e,r,s,o,a.width,a.height,-a.x,-a.y,2)},UPNG.encode._filterZero=function(e,r,s,o,a,u,l){var v=[],p=[0,1,2,3,4];u!=-1?p=[u]:(r*o>5e5||s==1)&&(p=[0]);var c;l&&(c={level:0});for(var _=l&&UZIP!=null?UZIP:pako,f=0;f<p.length;f++){for(var g=0;g<r;g++)UPNG.encode._filterLine(a,e,g,o,s,p[f]);v.push(_.deflate(a,c))}for(var y,w=1e9,f=0;f<v.length;f++)v[f].length<w&&(y=f,w=v[f].length);return v[y]},UPNG.encode._filterLine=function(e,r,s,o,a,u){var l=s*o,v=l+s,p=UPNG.decode._paeth;if(e[v]=u,v++,u==0)if(o<500)for(var c=0;c<o;c++)e[v+c]=r[l+c];else e.set(new Uint8Array(r.buffer,l,o),v);else if(u==1){for(var c=0;c<a;c++)e[v+c]=r[l+c];for(var c=a;c<o;c++)e[v+c]=r[l+c]-r[l+c-a]+256&255}else if(s==0){for(var c=0;c<a;c++)e[v+c]=r[l+c];if(u==2)for(var c=a;c<o;c++)e[v+c]=r[l+c];if(u==3)for(var c=a;c<o;c++)e[v+c]=r[l+c]-(r[l+c-a]>>1)+256&255;if(u==4)for(var c=a;c<o;c++)e[v+c]=r[l+c]-p(r[l+c-a],0,0)+256&255}else{if(u==2)for(var c=0;c<o;c++)e[v+c]=r[l+c]+256-r[l+c-o]&255;if(u==3){for(var c=0;c<a;c++)e[v+c]=r[l+c]+256-(r[l+c-o]>>1)&255;for(var c=a;c<o;c++)e[v+c]=r[l+c]+256-(r[l+c-o]+r[l+c-a]>>1)&255}if(u==4){for(var c=0;c<a;c++)e[v+c]=r[l+c]+256-p(0,r[l+c-o],0)&255;for(var c=a;c<o;c++)e[v+c]=r[l+c]+256-p(r[l+c-a],r[l+c-o],r[l+c-a-o])&255}}},UPNG.crc={table:function(){for(var e=new Uint32Array(256),r=0;r<256;r++){for(var s=r,o=0;o<8;o++)s&1?s=3988292384^s>>>1:s=s>>>1;e[r]=s}return e}(),update:function(e,r,s,o){for(var a=0;a<o;a++)e=UPNG.crc.table[(e^r[s+a])&255]^e>>>8;return e},crc:function(e,r,s){return UPNG.crc.update(4294967295,e,r,s)^4294967295}},UPNG.quantize=function(e,r){for(var s=new Uint8Array(e),o=s.slice(0),a=new Uint32Array(o.buffer),u=UPNG.quantize.getKDtree(o,r),l=u[0],v=u[1],p=UPNG.quantize.planeDst,c=s,_=a,f=c.length,g=new Uint8Array(s.length>>2),y=0;y<f;y+=4){var w=c[y]*(1/255),M=c[y+1]*(1/255),T=c[y+2]*(1/255),B=c[y+3]*(1/255),H=UPNG.quantize.getNearest(l,w,M,T,B);g[y>>2]=H.ind,_[y>>2]=H.est.rgba}return{abuf:o.buffer,inds:g,plte:v}},UPNG.quantize.getKDtree=function(e,r,s){s==null&&(s=1e-4);var o=new Uint32Array(e.buffer),a={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};a.bst=UPNG.quantize.stats(e,a.i0,a.i1),a.est=UPNG.quantize.estats(a.bst);for(var u=[a];u.length<r;){for(var l=0,v=0,p=0;p<u.length;p++)u[p].est.L>l&&(l=u[p].est.L,v=p);if(l<s)break;var c=u[v],_=UPNG.quantize.splitPixels(e,o,c.i0,c.i1,c.est.e,c.est.eMq255),f=c.i0>=_||c.i1<=_;if(f){c.est.L=0;continue}var g={i0:c.i0,i1:_,bst:null,est:null,tdst:0,left:null,right:null};g.bst=UPNG.quantize.stats(e,g.i0,g.i1),g.est=UPNG.quantize.estats(g.bst);var y={i0:_,i1:c.i1,bst:null,est:null,tdst:0,left:null,right:null};y.bst={R:[],m:[],N:c.bst.N-g.bst.N};for(var p=0;p<16;p++)y.bst.R[p]=c.bst.R[p]-g.bst.R[p];for(var p=0;p<4;p++)y.bst.m[p]=c.bst.m[p]-g.bst.m[p];y.est=UPNG.quantize.estats(y.bst),c.left=g,c.right=y,u[v]=g,u.push(y)}u.sort(function(w,M){return M.bst.N-w.bst.N});for(var p=0;p<u.length;p++)u[p].ind=p;return[a,u]},UPNG.quantize.getNearest=function(e,r,s,o,a){if(e.left==null)return e.tdst=UPNG.quantize.dist(e.est.q,r,s,o,a),e;var u=UPNG.quantize.planeDst(e.est,r,s,o,a),l=e.left,v=e.right;u>0&&(l=e.right,v=e.left);var p=UPNG.quantize.getNearest(l,r,s,o,a);if(p.tdst<=u*u)return p;var c=UPNG.quantize.getNearest(v,r,s,o,a);return c.tdst<p.tdst?c:p},UPNG.quantize.planeDst=function(e,r,s,o,a){var u=e.e;return u[0]*r+u[1]*s+u[2]*o+u[3]*a-e.eMq},UPNG.quantize.dist=function(e,r,s,o,a){var u=r-e[0],l=s-e[1],v=o-e[2],p=a-e[3];return u*u+l*l+v*v+p*p},UPNG.quantize.splitPixels=function(e,r,s,o,a,u){var l=UPNG.quantize.vecDot;o-=4;for(var v=0;s<o;){for(;l(e,s,a)<=u;)s+=4;for(;l(e,o,a)>u;)o-=4;if(s>=o)break;var p=r[s>>2];r[s>>2]=r[o>>2],r[o>>2]=p,s+=4,o-=4}for(;l(e,s,a)>u;)s-=4;return s+4},UPNG.quantize.vecDot=function(e,r,s){return e[r]*s[0]+e[r+1]*s[1]+e[r+2]*s[2]+e[r+3]*s[3]},UPNG.quantize.stats=function(e,r,s){for(var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=[0,0,0,0],u=s-r>>2,l=r;l<s;l+=4){var v=e[l]*(1/255),p=e[l+1]*(1/255),c=e[l+2]*(1/255),_=e[l+3]*(1/255);a[0]+=v,a[1]+=p,a[2]+=c,a[3]+=_,o[0]+=v*v,o[1]+=v*p,o[2]+=v*c,o[3]+=v*_,o[5]+=p*p,o[6]+=p*c,o[7]+=p*_,o[10]+=c*c,o[11]+=c*_,o[15]+=_*_}return o[4]=o[1],o[8]=o[2],o[9]=o[6],o[12]=o[3],o[13]=o[7],o[14]=o[11],{R:o,m:a,N:u}},UPNG.quantize.estats=function(e){var r=e.R,s=e.m,o=e.N,a=s[0],u=s[1],l=s[2],v=s[3],p=o==0?0:1/o,c=[r[0]-a*a*p,r[1]-a*u*p,r[2]-a*l*p,r[3]-a*v*p,r[4]-u*a*p,r[5]-u*u*p,r[6]-u*l*p,r[7]-u*v*p,r[8]-l*a*p,r[9]-l*u*p,r[10]-l*l*p,r[11]-l*v*p,r[12]-v*a*p,r[13]-v*u*p,r[14]-v*l*p,r[15]-v*v*p],_=c,f=UPNG.M4,g=[.5,.5,.5,.5],y=0,w=0;if(o!=0)for(var M=0;M<16&&(g=f.multVec(_,g),w=Math.sqrt(f.dot(g,g)),g=f.sml(1/w,g),!(M!=0&&Math.abs(w-y)<1e-9));M++)y=w;var T=[a*p,u*p,l*p,v*p],B=f.dot(f.sml(255,T),g);return{Cov:c,q:T,e:g,L:y,eMq255:B,eMq:f.dot(g,T),rgba:(Math.round(255*T[3])<<24|Math.round(255*T[2])<<16|Math.round(255*T[1])<<8|Math.round(255*T[0])<<0)>>>0}},UPNG.M4={multVec:function(e,r){return[e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3],e[4]*r[0]+e[5]*r[1]+e[6]*r[2]+e[7]*r[3],e[8]*r[0]+e[9]*r[1]+e[10]*r[2]+e[11]*r[3],e[12]*r[0]+e[13]*r[1]+e[14]*r[2]+e[15]*r[3]]},dot:function(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]+e[3]*r[3]},sml:function(e,r){return[e*r[0],e*r[1],e*r[2],e*r[3]]}},UPNG.encode.concatRGBA=function(e){for(var r=0,s=0;s<e.length;s++)r+=e[s].byteLength;for(var o=new Uint8Array(r),a=0,s=0;s<e.length;s++){for(var u=new Uint8Array(e[s]),l=u.length,v=0;v<l;v+=4){var p=u[v],c=u[v+1],_=u[v+2],f=u[v+3];f==0&&(p=c=_=0),o[a+v]=p,o[a+v+1]=c,o[a+v+2]=_,o[a+v+3]=f}a+=l}return o.buffer};var UTEX=function(){function e($,ee,ne,_e,ae){for(var Me=new Uint8Array(4*4*4),Ne=0;Ne<ae;Ne+=4)for(var Ae=0;Ae<_e;Ae+=4)c($,ee,Me),w(ne,_e,ae,Ae,Ne,Me),ee+=8;return ee}function r($,ee,ne,_e,ae){for(var Me=new Uint8Array(4*4*4),Ne=0;Ne<ae;Ne+=4)for(var Ae=0;Ae<_e;Ae+=4)c($,ee+8,Me),w(ne,_e,ae,Ae,Ne,Me),ee+=16;return ee}function s($,ee,ne,_e,ae){for(var Me=new Uint8Array(4*4*4),Ne=0;Ne<ae;Ne+=4)for(var Ae=0;Ae<_e;Ae+=4)_($,ee,Me),w(ne,_e,ae,Ae,Ne,Me),ee+=8;return ee}function o($,ee,ne,_e,ae){for(var Me=new Uint8Array(16*4),Ne=0;Ne<ne;Ne+=4)for(var Ae=0;Ae<ee;Ae+=4)y($,ee,ne,Ae,Ne,Me),f(_e,ae,Me),ae+=8;return ae}function a($,ee,ne,_e,ae){for(var Me={q:ee*8},Ne=new Uint8Array(4*4*4),Ae=0;Ae<ae;Ae+=4)for(var Fe=0;Fe<_e;Fe+=4){_($,ee+8,Ne);for(var De=0;De<64;De+=4){var ze=q($,Me,4);Ne[De+3]=255*(ze/15)}w(ne,_e,ae,Fe,Ae,Ne),ee+=16,Me.q+=64}return ee}function u($,ee){var ne=[$,ee];return $>ee?ne.push(6/7*$+1/7*ee,5/7*$+2/7*ee,4/7*$+3/7*ee,3/7*$+4/7*ee,2/7*$+5/7*ee,1/7*$+6/7*ee):ne.push(4/5*$+1/5*ee,3/5*$+2/5*ee,2/5*$+3/5*ee,1/5*$+4/5*ee,0,255),ne}function l($,ee,ne,_e,ae){for(var Me={q:ee*8},Ne=new Uint8Array(4*4*4),Ae=0;Ae<ae;Ae+=4)for(var Fe=0;Fe<_e;Fe+=4){_($,ee+8,Ne);var De=u($[ee],$[ee+1]);Me.q+=16;for(var ze=0;ze<64;ze+=4){var ye=q($,Me,3);Ne[ze+3]=De[ye]}Me.q+=64,w(ne,_e,ae,Fe,Ae,Ne),ee+=16}return ee}function v($,ee,ne,_e,ae){for(var Me=new Uint8Array(16*4),Ne=0;Ne<ne;Ne+=4)for(var Ae=0;Ae<ee;Ae+=4){y($,ee,ne,Ae,Ne,Me);for(var Fe=Me[3],De=Me[3],ze=7;ze<64;ze+=4){var ye=Me[ze];ye<Fe?Fe=ye:De<ye&&(De=ye)}_e[ae]=De,_e[ae+1]=Fe,ae+=2;for(var he=u(De,Fe),ke=ae+2<<3,ze=0;ze<64;ze+=32){for(var le=0,ke=0,Ce=0;Ce<32;Ce+=4){for(var Be=0,we=500,ye=Me[ze+Ce+3],xe=0;xe<8;xe++){var Ie=Math.abs(he[xe]-ye);Ie<we&&(we=Ie,Be=xe)}le=le|Be<<ke,ke+=3}_e[ae]=le,_e[ae+1]=le>>8,_e[ae+2]=le>>16,ae+=3}f(_e,ae,Me),ae+=8}return ae}var p=new Uint8Array(16);function c($,ee,ne){var _e=$[ee+1]<<8|$[ee],ae=$[ee+3]<<8|$[ee+2],Me=(_e&31)*(255/31),Ne=(_e>>>5&31)*(255/31),Ae=(_e>>10)*(255/31),Fe=(ae&31)*(255/31),De=(ae>>>5&63)*(255/63),ze=(ae>>11)*(255/31),ye=p;ye[0]=~~Ae,ye[1]=~~Ne,ye[2]=~~Me,ye[3]=255,ye[12]=~~ze,ye[13]=~~De,ye[14]=~~Fe,ye[15]=255;var he=2/3,ke=1-he;ye[4]=~~(he*Ae+ke*ze),ye[5]=~~(he*Ne+ke*De),ye[6]=~~(he*Me+ke*Fe),ye[7]=255,he=1/3,ke=1-he,ye[8]=~~(he*Ae+ke*ze),ye[9]=~~(he*Ne+ke*De),ye[10]=~~(he*Me+ke*Fe),ye[11]=255,g($,ne,ye,ee)}function _($,ee,ne){var _e=$[ee+1]<<8|$[ee],ae=$[ee+3]<<8|$[ee+2],Me=(_e&31)*(255/31),Ne=(_e>>>5&63)*(255/63),Ae=(_e>>11)*(255/31),Fe=(ae&31)*(255/31),De=(ae>>>5&63)*(255/63),ze=(ae>>11)*(255/31),ye=p;if(ye[0]=~~Ae,ye[1]=~~Ne,ye[2]=~~Me,ye[3]=255,ye[4]=~~ze,ye[5]=~~De,ye[6]=~~Fe,ye[7]=255,ae<_e){var he=2/3,ke=1-he;ye[8]=~~(he*Ae+ke*ze),ye[9]=~~(he*Ne+ke*De),ye[10]=~~(he*Me+ke*Fe),ye[11]=255,he=1/3,ke=1-he,ye[12]=~~(he*Ae+ke*ze),ye[13]=~~(he*Ne+ke*De),ye[14]=~~(he*Me+ke*Fe),ye[15]=255}else{var he=1/2,ke=1-he;ye[8]=~~(he*Ae+ke*ze),ye[9]=~~(he*Ne+ke*De),ye[10]=~~(he*Me+ke*Fe),ye[11]=255,ye[12]=0,ye[13]=0,ye[14]=0,ye[15]=0}g($,ne,ye,ee)}function f($,ee,ne){var _e=pe,ae=R(ne),Me=ne[ae>>8],Ne=ne[(ae>>8)+1],Ae=ne[(ae>>8)+2],Fe=ne[ae&255],De=ne[(ae&255)+1],ze=ne[(ae&255)+2],ye=Me>>3<<11|Ne>>2<<5|Ae>>3,he=Fe>>3<<11|De>>2<<5|ze>>3;if(ye<he){var ke=ye;ye=he,he=ke}var Ae=Math.floor((ye&31)*(255/31)),Ne=Math.floor((ye>>>5&63)*(255/63)),Me=Math.floor((ye>>11)*(255/31)),ze=Math.floor((he&31)*(255/31)),De=Math.floor((he>>>5&63)*(255/63)),Fe=Math.floor((he>>11)*(255/31));$[ee+0]=ye&255,$[ee+1]=ye>>8,$[ee+2]=he&255,$[ee+3]=he>>8;var le=2/3,Ce=1-le,Be=Math.floor(le*Me+Ce*Fe),we=Math.floor(le*Ne+Ce*De),xe=Math.floor(le*Ae+Ce*ze);le=1/3,Ce=1-le;for(var Ie=Math.floor(le*Me+Ce*Fe),Re=Math.floor(le*Ne+Ce*De),Le=Math.floor(le*Ae+Ce*ze),Oe=ee*8+32,Ve=0;Ve<64;Ve+=4){var Xe=ne[Ve],We=ne[Ve+1],t=ne[Ve+2],h=_e(Xe,We,t,Me,Ne,Ae),d=_e(Xe,We,t,Fe,De,ze),x=_e(Xe,We,t,Be,we,xe),E=_e(Xe,We,t,Ie,Re,Le),C=Math.min(h,Math.min(d,Math.min(x,E))),b=0;C==d?b=1:C==x?b=2:C==E&&(b=3),$[Oe>>3]|=b<<(Oe&7),Oe+=2}}function g($,ee,ne,_e){for(var ae=_e+4<<3,Me=0;Me<64;Me+=4){var Ne=$[ae>>3]>>(ae&7)&3;ae+=2,Ne=Ne<<2,ee[Me]=ne[Ne],ee[Me+1]=ne[Ne+1],ee[Me+2]=ne[Ne+2],ee[Me+3]=ne[Ne+3]}}function y($,ee,ne,_e,ae,Me){for(var Ne=0;Ne<4;Ne++){var Ae=(ae+Ne)*ee+_e<<2,Fe=Ne<<4;Me[Fe+0]=$[Ae+0],Me[Fe+1]=$[Ae+1],Me[Fe+2]=$[Ae+2],Me[Fe+3]=$[Ae+3],Me[Fe+4]=$[Ae+4],Me[Fe+5]=$[Ae+5],Me[Fe+6]=$[Ae+6],Me[Fe+7]=$[Ae+7],Me[Fe+8]=$[Ae+8],Me[Fe+9]=$[Ae+9],Me[Fe+10]=$[Ae+10],Me[Fe+11]=$[Ae+11],Me[Fe+12]=$[Ae+12],Me[Fe+13]=$[Ae+13],Me[Fe+14]=$[Ae+14],Me[Fe+15]=$[Ae+15]}}function w($,ee,ne,_e,ae,Me){for(var Ne=0;Ne<4;Ne++){var Ae=(ae+Ne)*ee+_e<<2,Fe=Ne<<4;$[Ae+0]=Me[Fe+0],$[Ae+1]=Me[Fe+1],$[Ae+2]=Me[Fe+2],$[Ae+3]=Me[Fe+3],$[Ae+4]=Me[Fe+4],$[Ae+5]=Me[Fe+5],$[Ae+6]=Me[Fe+6],$[Ae+7]=Me[Fe+7],$[Ae+8]=Me[Fe+8],$[Ae+9]=Me[Fe+9],$[Ae+10]=Me[Fe+10],$[Ae+11]=Me[Fe+11],$[Ae+12]=Me[Fe+12],$[Ae+13]=Me[Fe+13],$[Ae+14]=Me[Fe+14],$[Ae+15]=Me[Fe+15]}}var M="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(" "),T="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(" "),B=[[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]],H=[[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]];function J($,ee,ne,_e,ae){for(var Me=q,Ne={q:0},Ae=new Uint8Array(4*4*4),Fe=[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]],De=[null,null,M,T],ze=[null,null,B,H],ye=0;ye<ae;ye+=4)for(var he=0;he<_e;he+=4){for(var ke=0,le="0000000000000000";($[ee]>>ke&1)!=1;)ke++;Ne.q=(ee<<3)+ke+1;for(var Ce=ke==4||ke==5?Me($,Ne,2):0,Be=ke==4?Me($,Ne,1):0,we=[4,6,6,6,0,0,0,6][ke],xe=Me($,Ne,we),Ie=[4,6,5,7,5,7,7,5][ke],Re=[0,0,0,0,6,8,7,5][ke],Le=[1,1,0,1,0,0,1,1][ke],Oe=[6,4,6,4,2,2,2,4][ke],Ve=[],Xe=0;Xe<4;Xe++)for(var We=Xe==3?Re:Ie,t=0;t<Oe;t++)Ve[Xe*Oe+t]=Me($,Ne,We);for(var t=0;t<Oe;t++){ke==1&&(t&1)==1&&Ne.q--;for(var h=Me($,Ne,Le),Xe=0;Xe<3;Xe++)Ve[Xe*Oe+t]=Ve[Xe*Oe+t]<<Le|h;Re!=0&&(Ve[3*Oe+t]=Ve[3*Oe+t]<<Le|h)}Ie+=Le,Re!=0&&(Re+=Le);for(var Xe=0;Xe<4;Xe++)for(var We=Xe==3?Re:Ie,d=We==0?0:1/((1<<We)-1),t=0;t<Oe;t++)Ve[Xe*Oe+t]*=d;if(Re==0)for(var t=0;t<Oe;t++)Ve[3*Oe+t]=1;var x=[3,2,3,2,1,1,1,2][ke],E=[3,3,2,2,2,2,4,2][ke],C=[0,0,0,0,3,2,0,0][ke],b=[0,0,0];x!=1&&(le=De[x][xe],b=ze[x][xe]);var U=Ne.q,D=U+16*E-x;if(Be==1){var k=U;U=D,D=k,k=E,E=C,C=k}var Z=Fe[E];Ne.q=U;for(var Xe=0;Xe<64;Xe+=4){var Y=le.charCodeAt(Xe>>2)-48,W=b[Y]==Xe>>2?1:0,F=Me($,Ne,E-W),z=Z[F]/64,G=(1-z)*Ve[0*Oe+2*Y+0]+z*Ve[0*Oe+2*Y+1],X=(1-z)*Ve[1*Oe+2*Y+0]+z*Ve[1*Oe+2*Y+1],A=(1-z)*Ve[2*Oe+2*Y+0]+z*Ve[2*Oe+2*Y+1],N=(1-z)*Ve[3*Oe+2*Y+0]+z*Ve[3*Oe+2*Y+1];Ae[Xe]=G*255,Ae[Xe+1]=X*255,Ae[Xe+2]=A*255,Ae[Xe+3]=N*255}if(Z=Fe[C],Ne.q=D,C!=0)for(var Xe=0;Xe<64;Xe+=4){var Y=le.charCodeAt(Xe>>2)-48,W=b[Y]==Xe>>2?1:0,F=Me($,Ne,C-W),z=Z[F]/64,N=(1-z)*Ve[3*Oe+2*Y+0]+z*Ve[3*Oe+2*Y+1];Ae[Xe+3]=N*255}Q(Ae,Ce),w(ne,_e,ae,he,ye,Ae),ee+=16}return ee}function Q($,ee){if(ee!=0)for(var ne=0;ne<64;ne+=4){var _e=$[ne],ae=$[ne+1],Me=$[ne+2],Ne=$[ne+3];if(ee==1){var Ae=Ne;Ne=_e,_e=Ae}if(ee==2){var Ae=Ne;Ne=ae,ae=Ae}if(ee==3){var Ae=Ne;Ne=Me,Me=Ae}$[ne]=_e,$[ne+1]=ae,$[ne+2]=Me,$[ne+3]=Ne}}function q($,ee,ne){for(var _e=0,ae=ne;ne!=0;)_e=_e|O($,ee)<<ae-ne,ne--;return _e}function O($,ee){var ne=ee.q;return ee.q++,$[ne>>3]>>(ne&7)&1}function K($,ee,ne){for(var _e=ee>>1,ae=ne>>1,Me=new Uint8Array(_e*ae*4),Ne=0;Ne<ae;Ne++)for(var Ae=0;Ae<_e;Ae++){var Fe=Ne*_e+Ae<<2,De=(Ne<<1)*ee+(Ae<<1)<<2,ze=$[De+3],ye=$[De+7],he=$[De]*ze+$[De+4]*ye,ke=$[De+1]*ze+$[De+5]*ye,le=$[De+2]*ze+$[De+6]*ye;De+=ee<<2;var Ce=$[De+3],Be=$[De+7];he+=$[De]*Ce+$[De+4]*Be,ke+=$[De+1]*Ce+$[De+5]*Be,le+=$[De+2]*Ce+$[De+6]*Be;var we=ze+ye+Ce+Be+2>>2,xe=we==0?0:.25/we;Me[Fe]=~~(he*xe+.5),Me[Fe+1]=~~(ke*xe+.5),Me[Fe+2]=~~(le*xe+.5),Me[Fe+3]=we}return Me}function pe($,ee,ne,_e,ae,Me){return($-_e)*($-_e)+(ee-ae)*(ee-ae)+(ne-Me)*(ne-Me)}function R($){for(var ee=pe,ne=0,_e=0,ae=0;ae<64;ae+=4)for(var Me=$[ae],Ne=$[ae+1],Ae=$[ae+2],Fe=ae+4;Fe<64;Fe+=4){var De=ee(Me,Ne,Ae,$[Fe],$[Fe+1],$[Fe+2]);De>_e&&(_e=De,ne=ae<<8|Fe)}return ne}var Te=new ArrayBuffer(4),re=new Uint8Array(Te),oe=new Uint32Array(Te),me=new Uint16Array(Te),ue={L:function($,ee){return re[0]=$[ee+0],re[1]=$[ee+1],me[0]},D:function($,ee){return re[0]=$[ee+0],re[1]=$[ee+1],re[2]=$[ee+2],re[3]=$[ee+3],oe[0]},Y:function($,ee,ne){oe[0]=ne,$[ee+0]=re[0],$[ee+1]=re[1],$[ee+2]=re[2],$[ee+3]=re[3]},G:function($,ee,ne){for(var _e="",ae=0;ae<ne;ae++)_e+=String.fromCharCode($[ee+ae]);return _e},k:function($,ee,ne){for(var _e=0;_e<ne.length;_e++)$[ee+_e]=ne.charCodeAt(_e)}};return{V:s,s:a,j:l,z:J,H:e,A:r,M:o,i:v,a:K,l:ue}}();UTEX.DDS=function(){var e={O:1,$:2,R:4,w:8,W:4096,B:131072,C:524288,o:8388608,t:1,n:2,r:4,N:64,Q:512,P:131072,Z:8,g:4194304,X:4096};function r(p){var c=new Uint8Array(p),_=0,f=UTEX.l.G(c,_,4),g,y,w;_+=4,g=o(c,_),_+=124,y=g.c,y._&e.r&&y.J=="DX10"&&(w=v(c,_),_+=20);var M=g.width,T=g.height,B=[],H=y.J,J=y.b,Q={DXT1:"BC1",DXT3:"BC2",DXT5:"BC3",DX10:"BC7"};if(Q[H]&&(H=Q[H]),w){var q=w.f;70<=q&&q<=72?H="BC1":73<=q&&q<=75?H="BC2":76<=q&&q<=78?H="BC3":97<=q&&q<=99?H="BC7":console.log("Unknown DX10 format",q)}for(var O=Math.max(1,g.F),K=0;K<O;K++){var pe=M*T*4,R=new Uint8Array(pe);if(H=="BC1")_=UTEX.V(c,_,R,M,T);else if(H=="BC2")_=UTEX.s(c,_,R,M,T);else if(H=="BC3")_=UTEX.j(c,_,R,M,T);else if(H=="BC7")_=UTEX.z(c,_,R,M,T);else if(H=="ATC ")_=UTEX.H(c,_,R,M,T);else if(H=="ATCA")_=UTEX.A(c,_,R,M,T);else if(H=="ATCI")_=UTEX.A(c,_,R,M,T);else if(y._&e.t&&y._&e.N){var Te=y.u,re=255/Te,oe=y.v,me=255/oe,ue=y.d,$=255/ue,ee=y.S,ne=255/ee;if(J==32){for(var _e=0;_e<pe;_e+=4){var ae=c[_+_e+3]<<24|c[_+_e+2]<<16|c[_+_e+1]<<8|c[_+_e];R[_e+0]=(ae&Te)*re,R[_e+1]=(ae&oe)*me,R[_e+2]=(ae&ue)*$,R[_e+3]=(ae&ee)*ne}_+=pe}else if(J==16){for(var _e=0;_e<pe;_e+=4){var ae=c[_+(_e>>1)+1]<<8|c[_+(_e>>1)];R[_e+0]=(ae&Te)*re,R[_e+1]=(ae&oe)*me,R[_e+2]=(ae&ue)*$,R[_e+3]=(ae&ee)*ne}_+=pe>>>1}else throw"unknown bit count "+J}else if(y._&e.n||y._&e.t||y._&e.P)if(J==8){for(var _e=0;_e<pe;_e+=4)R[_e+3]=c[_+(_e>>2)];_+=pe>>>2}else throw"unknown bit count "+J;else throw console.log("unknown texture format, head flags: ",g._.toString(2),"pixelFormat flags: ",y._.toString(2)),"e";B.push({width:M,height:T,image:R.buffer}),M=M>>>1,T=T>>>1}return B}function s(p,c,_){for(var p=new Uint8Array(p),f=255,g=0,y=0,w=3;w<p.length;w+=4)f&=p[w];var M=f<250,T=new Uint8Array(124+c*_*2);for(UTEX.l.k(T,g,"DDS "),g+=4,a(T,c,_,M,g),g+=124;c*_!=0;)M?g=UTEX.i(p,c,_,T,g):g=UTEX.M(p,c,_,T,g),p=UTEX.a(p,c,_),c=c>>1,_=_>>1,y++;return T[28]=y,T.buffer.slice(0,g)}function o(p,c){var _={},f=UTEX.l.D;return c+=4,_._=f(p,c),c+=4,_.height=f(p,c),c+=4,_.width=f(p,c),c+=4,_.pitch=f(p,c),c+=4,_.depth=f(p,c),c+=4,_.F=f(p,c),c+=4,c+=11*4,_.c=u(p,c),c+=32,_.K=f(p,c),c+=4,_.I=f(p,c),c+=4,_.h=f(p,c),c+=4,_.a1=f(p,c),c+=4,c+=4,_}function a(p,c,_,f,g){var y=UTEX.l.Y,w=e.O|e.$|e.R|e.W;w|=e.B|e.C;var M=e.Z|e.g|e.X,T=(c*_>>1)*(f?2:1),B=f?1:0;y(p,g,124),g+=4,y(p,g,w),g+=4,y(p,g,_),g+=4,y(p,g,c),g+=4,y(p,g,T),g+=4,y(p,g,B),g+=4,y(p,g,10),g+=4,g+=11*4,l(p,f,g),g+=32,y(p,g,M),g+=4,g+=4*4}function u(p,c){var _={},f=UTEX.l.D;return c+=4,_._=f(p,c),c+=4,_.J=UTEX.l.G(p,c,4),c+=4,_.b=f(p,c),c+=4,_.u=f(p,c),c+=4,_.v=f(p,c),c+=4,_.d=f(p,c),c+=4,_.S=f(p,c),c+=4,_}function l(p,c,_){var f=UTEX.l.Y,g=e.r;f(p,_,32),_+=4,f(p,_,g),_+=4,UTEX.l.k(p,_,c?"DXT5":"DXT1"),_+=4,_+=5*4}function v(p,c){var _={},f=UTEX.l.D;return _.f=f(p,c),c+=4,_.a4=f(p,c),c+=4,_.a5=f(p,c),c+=4,_.a2=f(p,c),c+=4,_.a6=f(p,c),c+=4,_}return{encode:s,decode:r}}(),UTEX.VTF=function(){var e={};function r(o){var a=new Uint8Array(o),u=0,l={};u=s(a,u,l);var v=l.p,p=l.m;if(v*p!=0){var c=new Uint8Array(v*p*4);u=UTEX.V(a,u,c,v,p)}for(var _=l.e,f=l.T,g=[],y=0;y<f;y++)for(var w=l.width>>>f-1-y,M=l.height>>>f-1-y,T=0;T<l.frames;T++){var c=new Uint8Array(w*M*4);if(_==0||_==12){for(var B=u,H=_==0?[0,1,2,3]:[2,1,0,3],J=H[0],Q=H[1],q=H[2],O=H[3],K=0;K<c.length;K+=4)c[K+J]=a[B++],c[K+Q]=a[B++],c[K+q]=a[B++],c[K+O]=a[B++];u+=w*M*4}else if(_==2)for(var K=0;K<c.length;K+=4)c[K]=a[u++],c[K+1]=a[u++],c[K+2]=a[u++],c[K+3]=255;else if(_==13)u=UTEX.V(a,u,c,w,M);else if(_==14)u=UTEX.s(a,u,c,w,M);else if(_==15)u=UTEX.j(a,u,c,w,M);else throw _;g.push({width:w,height:M,image:c.buffer})}return g}function s(o,a,u){var l=UTEX.l.D,v=UTEX.l.L,p=UTEX.l.G(o,a,4);a+=4;var c=l(o,a);a+=4;var _=l(o,a);a+=4;var f=l(o,a);return a+=4,u.width=v(o,a),a+=2,u.height=v(o,a),a+=2,u._=l(o,a),a+=4,u.frames=v(o,a),a+=2,u.a0=v(o,a),a+=2,a+=4,a+=12,a+=4,a+=4,u.e=l(o,a),a+=4,u.T=o[a++],u.a3=l(o,a),a+=4,u.p=o[a++],u.m=o[a++],f}return{decode:r}}(),function(){var e={};typeof module=="object"?module.exports=e:self.UTIF=e;var r=typeof require=="function"?require("pako"):self.pako;function s(){(typeof process=="undefined"||process.env.NODE_ENV=="development")&&console.log.apply(console,arguments)}(function(o,a){(function(){"use strict";var u=function(){function f(g){this.message="JPEG error: "+g}return f.prototype=new Error,f.prototype.name="JpegError",f.constructor=f,f}(),l=function(){var f=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]),g=4017,y=799,w=3406,M=2276,T=1567,B=3784,H=5793,J=2896;function Q(re){re==null&&(re={}),re.w==null&&(re.w=-1),this.V=re.n,this.N=re.w}function q(re,oe){for(var me=0,ue=[],$,ee,ne=16,_e;ne>0&&!re[ne-1];)ne--;ue.push({children:[],index:0});var ae=ue[0];for($=0;$<ne;$++){for(ee=0;ee<re[$];ee++){for(ae=ue.pop(),ae.children[ae.index]=oe[me];ae.index>0;)ae=ue.pop();for(ae.index++,ue.push(ae);ue.length<=$;)ue.push(_e={children:[],index:0}),ae.children[ae.index]=_e.children,ae=_e;me++}$+1<ne&&(ue.push(_e={children:[],index:0}),ae.children[ae.index]=_e.children,ae=_e)}return ue[0].children}function O(re,oe,me){return 64*((re.P+1)*oe+me)}function K(re,oe,me,ue,$,ee,ne,_e,ae,Me){Me==null&&(Me=!1);var Ne=me.m,Ae=me.Z,Fe=oe,De=0,ze=0,ye=0,he=0,ke,le=0,Ce,Be,we,xe,Ie,Re,Le=0,Oe,Ve,Xe,We;function t(){if(ze>0)return ze--,De>>ze&1;if(De=re[oe++],De===255){var z=re[oe++];if(z){if(z===220&&Me){oe+=2;var G=p(re,oe);if(oe+=2,G>0&&G!==me.s)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",G)}else if(z===217){if(Me){var X=le*8;if(X>0&&X<me.s/10)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",X)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new u("unexpected marker")}}return ze=7,De>>>7}function h(z){for(var G=z;;){switch(G=G[t()],typeof G){case"number":return G;case"object":continue}throw new u("invalid huffman sequence")}}function d(z){for(var G=0;z>0;)G=G<<1|t(),z--;return G}function x(z){if(z===1)return t()===1?1:-1;var G=d(z);return G>=1<<z-1?G:G+(-1<<z)+1}function E(z,G){var X=h(z.J),A=X===0?0:x(X),N=1;for(z.D[G]=z.Q+=A;N<64;){var I=h(z.i),te=I&15,fe=I>>4;if(te===0){if(fe<15)break;N+=16;continue}N+=fe;var S=f[N];z.D[G+S]=x(te),N++}}function C(z,G){var X=h(z.J),A=X===0?0:x(X)<<ae;z.D[G]=z.Q+=A}function b(z,G){z.D[G]|=t()<<ae}function U(z,G){if(ye>0){ye--;return}for(var X=ee,A=ne;X<=A;){var N=h(z.i),I=N&15,te=N>>4;if(I===0){if(te<15){ye=d(te)+(1<<te)-1;break}X+=16;continue}X+=te;var fe=f[X];z.D[G+fe]=x(I)*(1<<ae),X++}}function D(z,G){for(var X=ee,A=ne,N=0,I,te;X<=A;){var fe=G+f[X],S=z.D[fe]<0?-1:1;switch(he){case 0:if(te=h(z.i),I=te&15,N=te>>4,I===0)N<15?(ye=d(N)+(1<<N),he=4):(N=16,he=1);else{if(I!==1)throw new u("invalid ACn encoding");ke=x(I),he=N?2:3}continue;case 1:case 2:z.D[fe]?z.D[fe]+=S*(t()<<ae):(N--,N===0&&(he=he===2?3:0));break;case 3:z.D[fe]?z.D[fe]+=S*(t()<<ae):(z.D[fe]=ke<<ae,he=0);break;case 4:z.D[fe]&&(z.D[fe]+=S*(t()<<ae));break}X++}he===4&&(ye--,ye===0&&(he=0))}function k(z,G,X,A,N){var I=X/Ne|0,te=X%Ne;le=I*z.A+A;var fe=te*z.h+N,S=O(z,le,fe);G(z,S)}function Z(z,G,X){le=X/z.P|0;var A=X%z.P,N=O(z,le,A);G(z,N)}var Y=ue.length;for(Ae?ee===0?Re=_e===0?C:b:Re=_e===0?U:D:Re=E,Y===1?Ve=ue[0].P*ue[0].c:Ve=Ne*me.R;Le<=Ve;){var W=$?Math.min(Ve-Le,$):Ve;if(W>0){for(Be=0;Be<Y;Be++)ue[Be].Q=0;if(ye=0,Y===1)for(Ce=ue[0],Ie=0;Ie<W;Ie++)Z(Ce,Re,Le),Le++;else for(Ie=0;Ie<W;Ie++){for(Be=0;Be<Y;Be++)for(Ce=ue[Be],Xe=Ce.h,We=Ce.A,we=0;we<We;we++)for(xe=0;xe<Xe;xe++)k(Ce,Re,Le,we,xe);Le++}}if(ze=0,Oe=Te(re,oe),!Oe)break;if(Oe.u){var F=W>0?"unexpected":"excessive";oe=Oe.offset}if(Oe.M>=65488&&Oe.M<=65495)oe+=2;else break}return oe-Fe}function pe(re,oe,me){var ue=re.$,$=re.D,ee,ne,_e,ae,Me,Ne,Ae,Fe,De,ze,ye,he,ke,le,Ce,Be,we;if(!ue)throw new u("missing required Quantization Table.");for(var xe=0;xe<64;xe+=8){if(De=$[oe+xe],ze=$[oe+xe+1],ye=$[oe+xe+2],he=$[oe+xe+3],ke=$[oe+xe+4],le=$[oe+xe+5],Ce=$[oe+xe+6],Be=$[oe+xe+7],De*=ue[xe],(ze|ye|he|ke|le|Ce|Be)==0){we=H*De+512>>10,me[xe]=we,me[xe+1]=we,me[xe+2]=we,me[xe+3]=we,me[xe+4]=we,me[xe+5]=we,me[xe+6]=we,me[xe+7]=we;continue}ze*=ue[xe+1],ye*=ue[xe+2],he*=ue[xe+3],ke*=ue[xe+4],le*=ue[xe+5],Ce*=ue[xe+6],Be*=ue[xe+7],ee=H*De+128>>8,ne=H*ke+128>>8,_e=ye,ae=Ce,Me=J*(ze-Be)+128>>8,Fe=J*(ze+Be)+128>>8,Ne=he<<4,Ae=le<<4,ee=ee+ne+1>>1,ne=ee-ne,we=_e*B+ae*T+128>>8,_e=_e*T-ae*B+128>>8,ae=we,Me=Me+Ae+1>>1,Ae=Me-Ae,Fe=Fe+Ne+1>>1,Ne=Fe-Ne,ee=ee+ae+1>>1,ae=ee-ae,ne=ne+_e+1>>1,_e=ne-_e,we=Me*M+Fe*w+2048>>12,Me=Me*w-Fe*M+2048>>12,Fe=we,we=Ne*y+Ae*g+2048>>12,Ne=Ne*g-Ae*y+2048>>12,Ae=we,me[xe]=ee+Fe,me[xe+7]=ee-Fe,me[xe+1]=ne+Ae,me[xe+6]=ne-Ae,me[xe+2]=_e+Ne,me[xe+5]=_e-Ne,me[xe+3]=ae+Me,me[xe+4]=ae-Me}for(var Ie=0;Ie<8;++Ie){if(De=me[Ie],ze=me[Ie+8],ye=me[Ie+16],he=me[Ie+24],ke=me[Ie+32],le=me[Ie+40],Ce=me[Ie+48],Be=me[Ie+56],(ze|ye|he|ke|le|Ce|Be)==0){we=H*De+8192>>14,we<-2040?we=0:we>=2024?we=255:we=we+2056>>4,$[oe+Ie]=we,$[oe+Ie+8]=we,$[oe+Ie+16]=we,$[oe+Ie+24]=we,$[oe+Ie+32]=we,$[oe+Ie+40]=we,$[oe+Ie+48]=we,$[oe+Ie+56]=we;continue}ee=H*De+2048>>12,ne=H*ke+2048>>12,_e=ye,ae=Ce,Me=J*(ze-Be)+2048>>12,Fe=J*(ze+Be)+2048>>12,Ne=he,Ae=le,ee=(ee+ne+1>>1)+4112,ne=ee-ne,we=_e*B+ae*T+2048>>12,_e=_e*T-ae*B+2048>>12,ae=we,Me=Me+Ae+1>>1,Ae=Me-Ae,Fe=Fe+Ne+1>>1,Ne=Fe-Ne,ee=ee+ae+1>>1,ae=ee-ae,ne=ne+_e+1>>1,_e=ne-_e,we=Me*M+Fe*w+2048>>12,Me=Me*w-Fe*M+2048>>12,Fe=we,we=Ne*y+Ae*g+2048>>12,Ne=Ne*g-Ae*y+2048>>12,Ae=we,De=ee+Fe,Be=ee-Fe,ze=ne+Ae,Ce=ne-Ae,ye=_e+Ne,le=_e-Ne,he=ae+Me,ke=ae-Me,De<16?De=0:De>=4080?De=255:De>>=4,ze<16?ze=0:ze>=4080?ze=255:ze>>=4,ye<16?ye=0:ye>=4080?ye=255:ye>>=4,he<16?he=0:he>=4080?he=255:he>>=4,ke<16?ke=0:ke>=4080?ke=255:ke>>=4,le<16?le=0:le>=4080?le=255:le>>=4,Ce<16?Ce=0:Ce>=4080?Ce=255:Ce>>=4,Be<16?Be=0:Be>=4080?Be=255:Be>>=4,$[oe+Ie]=De,$[oe+Ie+8]=ze,$[oe+Ie+16]=ye,$[oe+Ie+24]=he,$[oe+Ie+32]=ke,$[oe+Ie+40]=le,$[oe+Ie+48]=Ce,$[oe+Ie+56]=Be}}function R(re,oe){for(var me=oe.P,ue=oe.c,$=new Int16Array(64),ee=0;ee<ue;ee++)for(var ne=0;ne<me;ne++){var _e=O(oe,ee,ne);pe(oe,_e,$)}return oe.D}function Te(re,oe,me){me==null&&(me=oe);var ue=re.length-1,$=me<oe?me:oe;if(oe>=ue)return null;var ee=p(re,oe);if(ee>=65472&&ee<=65534)return{u:null,M:ee,offset:oe};for(var ne=p(re,$);!(ne>=65472&&ne<=65534);){if(++$>=ue)return null;ne=p(re,$)}return{u:ee.toString(16),M:ne,offset:$}}return Q.prototype={parse(re,oe){oe==null&&(oe={});var me=oe.F,ue=0,$=null,ee=null,ne,_e,ae=0;function Me(){var te=p(re,ue);ue+=2;var fe=ue+te-2,S=Te(re,fe,ue);S&&S.u&&(fe=S.offset);var de=re.subarray(ue,fe);return ue+=de.length,de}function Ne(te){for(var fe=Math.ceil(te.o/8/te.X),S=Math.ceil(te.s/8/te.B),de=0;de<te.W.length;de++){D=te.W[de];var se=Math.ceil(Math.ceil(te.o/8)*D.h/te.X),ie=Math.ceil(Math.ceil(te.s/8)*D.A/te.B),ge=fe*D.h,Pe=S*D.A,Ye=64*Pe*(ge+1);D.D=new Int16Array(Ye),D.P=se,D.c=ie}te.m=fe,te.R=S}var Ae=[],Fe=[],De=[],ze=p(re,ue);if(ue+=2,ze!==65496)throw new u("SOI not found");ze=p(re,ue),ue+=2;e:for(;ze!==65497;){var ye,he,ke;switch(ze){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 le=Me();ze===65504&&le[0]===74&&le[1]===70&&le[2]===73&&le[3]===70&&le[4]===0&&($={version:{d:le[5],T:le[6]},K:le[7],j:le[8]<<8|le[9],H:le[10]<<8|le[11],S:le[12],I:le[13],C:le.subarray(14,14+3*le[12]*le[13])}),ze===65518&&le[0]===65&&le[1]===100&&le[2]===111&&le[3]===98&&le[4]===101&&(ee={version:le[5]<<8|le[6],k:le[7]<<8|le[8],q:le[9]<<8|le[10],a:le[11]});break;case 65499:var Ce=p(re,ue),Be;ue+=2;for(var we=Ce+ue-2;ue<we;){var xe=re[ue++],Ie=new Uint16Array(64);if(xe>>4==0)for(he=0;he<64;he++)Be=f[he],Ie[Be]=re[ue++];else if(xe>>4==1)for(he=0;he<64;he++)Be=f[he],Ie[Be]=p(re,ue),ue+=2;else throw new u("DQT - invalid table spec");Ae[xe&15]=Ie}break;case 65472:case 65473:case 65474:if(ne)throw new u("Only single frame JPEGs supported");ue+=2,ne={},ne.G=ze===65473,ne.Z=ze===65474,ne.precision=re[ue++];var Re=p(re,ue),Le,Oe=0,Ve=0;ue+=2,ne.s=me||Re,ne.o=p(re,ue),ue+=2,ne.W=[],ne._={};var Xe=re[ue++];for(ye=0;ye<Xe;ye++){Le=re[ue];var We=re[ue+1]>>4,t=re[ue+1]&15;Oe<We&&(Oe=We),Ve<t&&(Ve=t);var h=re[ue+2];ke=ne.W.push({h:We,A:t,L:h,$:null}),ne._[Le]=ke-1,ue+=3}ne.X=Oe,ne.B=Ve,Ne(ne);break;case 65476:var d=p(re,ue);for(ue+=2,ye=2;ye<d;){var x=re[ue++],E=new Uint8Array(16),C=0;for(he=0;he<16;he++,ue++)C+=E[he]=re[ue];var b=new Uint8Array(C);for(he=0;he<C;he++,ue++)b[he]=re[ue];ye+=17+C,(x>>4==0?De:Fe)[x&15]=q(E,b)}break;case 65501:ue+=2,_e=p(re,ue),ue+=2;break;case 65498:var U=++ae==1&&!me,D;ue+=2;var k=re[ue++],Z=[];for(ye=0;ye<k;ye++){var Y=re[ue++],W=ne._[Y];D=ne.W[W],D.index=Y;var F=re[ue++];D.J=De[F>>4],D.i=Fe[F&15],Z.push(D)}var z=re[ue++],G=re[ue++],X=re[ue++];try{var A=K(re,ue,ne,Z,_e,z,G,X>>4,X&15,U);ue+=A}catch(te){if(te instanceof DNLMarkerError)return this.parse(re,{F:te.s});if(te instanceof EOIMarkerError)break e;throw te}break;case 65500:ue+=4;break;case 65535:re[ue]!==255&&ue--;break;default:var N=Te(re,ue-2,ue-3);if(N&&N.u){ue=N.offset;break}if(ue>=re.length-1)break e;throw new u("JpegImage.parse - unknown marker: "+ze.toString(16))}ze=p(re,ue),ue+=2}for(this.width=ne.o,this.height=ne.s,this.g=$,this.b=ee,this.W=[],ye=0;ye<ne.W.length;ye++){D=ne.W[ye];var I=Ae[D.L];I&&(D.$=I),this.W.push({index:D.index,e:R(ne,D),l:D.h/ne.X,t:D.A/ne.B,P:D.P,c:D.c})}this.p=this.W.length},Y(re,oe,me){me==null&&(me=!1);var ue=this.width/re,$=this.height/oe,ee,ne,_e,ae,Me,Ne,Ae,Fe,De,ze,ye=0,he,ke=this.W.length,le=re*oe*ke,Ce=new Uint8ClampedArray(le),Be=new Uint32Array(re),we=4294967288,xe;for(Ae=0;Ae<ke;Ae++){if(ee=this.W[Ae],ne=ee.l*ue,_e=ee.t*$,ye=Ae,he=ee.e,ae=ee.P+1<<3,ne!==xe){for(Me=0;Me<re;Me++)Fe=0|Me*ne,Be[Me]=(Fe&we)<<3|Fe&7;xe=ne}for(Ne=0;Ne<oe;Ne++)for(Fe=0|Ne*_e,ze=ae*(Fe&we)|(Fe&7)<<3,Me=0;Me<re;Me++)Ce[ye]=he[ze+Be[Me]],ye+=ke}var Ie=this.V;if(!me&&ke===4&&!Ie&&(Ie=new Int32Array([-256,255,-256,255,-256,255,-256,255])),Ie)for(Ae=0;Ae<le;)for(Fe=0,De=0;Fe<ke;Fe++,Ae++,De+=2)Ce[Ae]=(Ce[Ae]*Ie[De]>>8)+Ie[De+1];return Ce},get f(){return this.b?!!this.b.a:this.p===3?this.N===0?!1:!(this.W[0].index===82&&this.W[1].index===71&&this.W[2].index===66):this.N===1},z:function(oe){for(var me,ue,$,ee=0,ne=oe.length;ee<ne;ee+=3)me=oe[ee],ue=oe[ee+1],$=oe[ee+2],oe[ee]=me-179.456+1.402*$,oe[ee+1]=me+135.459-.344*ue-.714*$,oe[ee+2]=me-226.816+1.772*ue;return oe},O:function(oe){for(var me,ue,$,ee,ne=0,_e=0,ae=oe.length;_e<ae;_e+=4)me=oe[_e],ue=oe[_e+1],$=oe[_e+2],ee=oe[_e+3],oe[ne++]=-122.67195406894+ue*(-660635669420364e-19*ue+.000437130475926232*$-54080610064599e-18*me+.00048449797120281*ee-.154362151871126)+$*(-.000957964378445773*$+.000817076911346625*me-.00477271405408747*ee+1.53380253221734)+me*(.000961250184130688*me-.00266257332283933*ee+.48357088451265)+ee*(-.000336197177618394*ee+.484791561490776),oe[ne++]=107.268039397724+ue*(219927104525741e-19*ue-.000640992018297945*$+.000659397001245577*me+.000426105652938837*ee-.176491792462875)+$*(-.000778269941513683*$+.00130872261408275*me+.000770482631801132*ee-.151051492775562)+me*(.00126935368114843*me-.00265090189010898*ee+.25802910206845)+ee*(-.000318913117588328*ee-.213742400323665),oe[ne++]=-20.810012546947+ue*(-.000570115196973677*ue-263409051004589e-19*$+.0020741088115012*me-.00288260236853442*ee+.814272968359295)+$*(-153496057440975e-19*$-.000132689043961446*me+.000560833691242812*ee-.195152027534049)+me*(.00174418132927582*me-.00255243321439347*ee+.116935020465145)+ee*(-.000343531996510555*ee+.24165260232407);return oe.subarray(0,ne)},r:function(oe){for(var me,ue,$,ee=0,ne=oe.length;ee<ne;ee+=4)me=oe[ee],ue=oe[ee+1],$=oe[ee+2],oe[ee]=434.456-me-1.402*$,oe[ee+1]=119.541-me+.344*ue+.714*$,oe[ee+2]=481.816-me-1.772*ue;return oe},U:function(oe){for(var me,ue,$,ee,ne=0,_e=0,ae=oe.length;_e<ae;_e+=4)me=oe[_e],ue=oe[_e+1],$=oe[_e+2],ee=oe[_e+3],oe[ne++]=255+me*(-6747147073602441e-20*me+.0008379262121013727*ue+.0002894718188643294*$+.003264231057537806*ee-1.1185611867203937)+ue*(26374107616089405e-21*ue-8626949158638572e-20*$-.0002748769067499491*ee-.02155688794978967)+$*(-3878099212869363e-20*$-.0003267808279485286*ee+.0686742238595345)-ee*(.0003361971776183937*ee+.7430659151342254),oe[ne++]=255+me*(.00013596372813588848*me+.000924537132573585*ue+.00010567359618683593*$+.0004791864687436512*ee-.3109689587515875)+ue*(-.00023545346108370344*ue+.0002702845253534714*$+.0020200308977307156*ee-.7488052167015494)+$*(6834815998235662e-20*$+.00015168452363460973*ee-.09751927774728933)-ee*(.0003189131175883281*ee+.7364883807733168),oe[ne++]=255+me*(13598650411385307e-21*me+.00012423956175490851*ue+.0004751985097583589*$-36729317476630422e-22*ee-.05562186980264034)+ue*(.00016141380598724676*ue+.0009692239130725186*$+.0007782692450036253*ee-.44015232367526463)+$*(5068882914068769e-22*$+.0017778369011375071*ee-.7591454649749609)-ee*(.0003435319965105553*ee+.7063770186160144);return oe.subarray(0,ne)},getData:function(re){var oe=re.width,me=re.height,ue=re.forceRGB,$=re.isSourcePDF;if(this.p>4)throw new u("Unsupported color mode");var ee=this.Y(oe,me,$);if(this.p===1&&ue){for(var ne=ee.length,_e=new Uint8ClampedArray(ne*3),ae=0,Me=0;Me<ne;Me++){var Ne=ee[Me];_e[ae++]=Ne,_e[ae++]=Ne,_e[ae++]=Ne}return _e}else{if(this.p===3&&this.f)return this.z(ee);if(this.p===4){if(this.f)return ue?this.O(ee):this.r(ee);if(ue)return this.U(ee)}}return ee}},Q}();function v(_,f){return _[f]<<24>>24}function p(_,f){return _[f]<<8|_[f+1]}function c(_,f){return(_[f]<<24|_[f+1]<<16|_[f+2]<<8|_[f+3])>>>0}o.JpegDecoder=l})(),o.encodeImage=function(u,l,v,p){var c={t256:[l],t257:[v],t258:[8,8,8,8],t259:[1],t262:[2],t273:[1e3],t277:[4],t278:[v],t279:[l*v*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 _ in p)c[_]=p[_];for(var f=new Uint8Array(o.encode([c])),g=new Uint8Array(u),y=new Uint8Array(1e3+l*v*4),_=0;_<f.length;_++)y[_]=f[_];for(var _=0;_<g.length;_++)y[1e3+_]=g[_];return y.buffer},o.encode=function(u){var l=!1,v=new Uint8Array(2e4),p=4,c=l?o._binLE:o._binBE;v[0]=v[1]=l?73:77,c.writeUshort(v,2,42);var _=8;c.writeUint(v,p,_),p+=4;for(var f=0;f<u.length;f++){var g=o._writeIFD(c,o._types.basic,v,_,u[f]);_=g[1],f<u.length-1&&((_&3)!=0&&(_+=4-(_&3)),c.writeUint(v,g[0],_))}return v.slice(0,_).buffer},o.decode=function(u,l){l==null&&(l={parseMN:!0,debug:!1});var v=new Uint8Array(u),p=0,c=o._binBE.readASCII(v,p,2);p+=2;var _=c=="II"?o._binLE:o._binBE,f=_.readUshort(v,p);p+=2;var g=_.readUint(v,p);p+=4;for(var y=[];;){var w=o._readIFD(_,v,g,y,0,l);if(g=_.readUint(v,w),g==0||w==0)break}return y},o.decodeImage=function(u,l,v){if(!l.data){var p=new Uint8Array(u),c=o._binBE.readASCII(p,0,2);if(l.t256!=null){l.isLE=c=="II",l.width=l.t256[0],l.height=l.t257[0];var _=l.t259?l.t259[0]:1,f=l.t266?l.t266[0]:1;l.t284&&l.t284[0]==2&&s("PlanarConfiguration 2 should not be used!");var g;l.t258?g=Math.min(32,l.t258[0])*l.t258.length:g=l.t277?l.t277[0]:1,_==1&&l.t279!=null&&l.t278&&l.t262[0]==32803&&(g=Math.round(l.t279[0]*8/(l.width*l.t278[0])));var y=Math.ceil(l.width*g/8)*8,w=l.t273;w==null&&(w=l.t324);var M=l.t279;_==1&&w.length==1&&(M=[l.height*(y>>>3)]),M==null&&(M=l.t325);var T=new Uint8Array(l.height*(y>>>3)),B=0;if(l.t322!=null){for(var H=l.t322[0],J=l.t323[0],Q=Math.floor((l.width+H-1)/H),q=Math.floor((l.height+J-1)/J),O=new Uint8Array(Math.ceil(H*J*g/8)|0),K=0;K<q;K++)for(var pe=0;pe<Q;pe++){for(var R=K*Q+pe,Te=0;Te<O.length;Te++)O[Te]=0;o.decode._decompress(l,v,p,w[R],M[R],_,O,0,f),_==6?T=O:o._copyTile(O,Math.ceil(H*g/8)|0,J,T,Math.ceil(l.width*g/8)|0,l.height,Math.ceil(pe*H*g/8)|0,K*J)}B=T.length*8}else{var re=l.t278?l.t278[0]:l.height;re=Math.min(re,l.height);for(var R=0;R<w.length;R++)o.decode._decompress(l,v,p,w[R],M[R],_,T,Math.ceil(B/8)|0,f),B+=y*re;B=Math.min(B,T.length*8)}l.data=new Uint8Array(T.buffer,0,Math.ceil(B/8)|0)}}},o.decode._decompress=function(u,l,v,p,c,_,f,g,y){if(_==1||c==f.length&&_!=32767)for(var w=0;w<c;w++)f[g+w]=v[p+w];else if(_==3)o.decode._decodeG3(v,p,c,f,g,u.width,y,u.t292?(u.t292[0]&1)==1:!1);else if(_==4)o.decode._decodeG4(v,p,c,f,g,u.width,y);else if(_==5)o.decode._decodeLZW(v,p,c,f,g,8);else if(_==6)o.decode._decodeOldJPEG(u,v,p,c,f,g);else if(_==7)o.decode._decodeNewJPEG(u,v,p,c,f,g);else if(_==8)for(var M=new Uint8Array(v.buffer,p,c),T=a.inflate(M),B=0;B<T.length;B++)f[g+B]=T[B];else _==32767?o.decode._decodeARW(u,v,p,c,f,g):_==32773?o.decode._decodePackBits(v,p,c,f,g):_==32809?o.decode._decodeThunder(v,p,c,f,g):_==34713?o.decode._decodeNikon(u,l,v,p,c,f,g):s("Unknown compression",_);var H=u.t258?Math.min(32,u.t258[0]):1,J=u.t277?u.t277[0]:1,Q=H*J>>>3,q=u.t278?u.t278[0]:u.height,O=Math.ceil(H*J*u.width/8);if(H==16&&!u.isLE&&u.t33422==null)for(var K=0;K<q;K++)for(var pe=g+K*O,R=1;R<O;R+=2){var Te=f[pe+R];f[pe+R]=f[pe+R-1],f[pe+R-1]=Te}if(u.t317&&u.t317[0]==2)for(var K=0;K<q;K++){var re=g+K*O;if(H==16)for(var w=Q;w<O;w+=2){var oe=(f[re+w+1]<<8|f[re+w])+(f[re+w-Q+1]<<8|f[re+w-Q]);f[re+w]=oe&255,f[re+w+1]=oe>>>8&255}else if(J==3)for(var w=3;w<O;w+=3)f[re+w]=f[re+w]+f[re+w-3]&255,f[re+w+1]=f[re+w+1]+f[re+w-2]&255,f[re+w+2]=f[re+w+2]+f[re+w-1]&255;else for(var w=Q;w<O;w++)f[re+w]=f[re+w]+f[re+w-Q]&255}},o.decode._ljpeg_diff=function(u,l,v){var p=o.decode._getbithuff,c,_;return c=p(u,l,v[0],v),_=p(u,l,c,0),(_&1<<c-1)==0&&(_-=(1<<c)-1),_},o.decode._decodeARW=function(u,l,v,p,c,_){var f=u.t256[0],g=u.t257[0],y=u.t258[0],w=u.isLE?o._binLE:o._binBE,M=f*g==p||f*g*1.5==p;if(!M){g+=8;var T=[v,0,0,0],B=new Uint16Array(32770),H=[3857,3856,3599,3342,3085,2828,2571,2314,2057,1800,1543,1286,1029,772,771,768,514,513],Ae,J,Q,ue,me,q=0,O=o.decode._ljpeg_diff;for(B[0]=15,Q=Ae=0;Ae<18;Ae++)for(var K=32768>>>(H[Ae]>>>8),J=0;J<K;J++)B[++Q]=H[Ae];for(ue=f;ue--;)for(me=0;me<g+1;me+=2)if(me==g&&(me=1),q+=O(l,T,B),me<g){var pe=q&4095;o.decode._putsF(c,(me*f+ue)*y,pe<<16-y)}return}if(f*g*1.5==p){for(var Ae=0;Ae<p;Ae+=3){var R=l[v+Ae+0],Te=l[v+Ae+1],re=l[v+Ae+2];c[_+Ae]=Te<<4|R>>>4,c[_+Ae+1]=R<<4|re>>>4,c[_+Ae+2]=re<<4|Te>>>4}return}var oe=new Uint16Array(16),me,ue,$,ee,ne,_e,ae,Me,Ne,Ae,Fe,De=new Uint8Array(f+1);for(me=0;me<g;me++){for(var ze=0;ze<f;ze++)De[ze]=l[v++];for(Fe=0,ue=0;ue<f-30;Fe+=16){for(ee=2047&($=w.readUint(De,Fe)),ne=2047&$>>>11,_e=15&$>>>22,ae=15&$>>>26,Me=0;Me<4&&128<<Me<=ee-ne;Me++);for(Ne=30,Ae=0;Ae<16;Ae++)Ae==_e?oe[Ae]=ee:Ae==ae?oe[Ae]=ne:(oe[Ae]=((w.readUshort(De,Fe+(Ne>>3))>>>(Ne&7)&127)<<Me)+ne,oe[Ae]>2047&&(oe[Ae]=2047),Ne+=7);for(Ae=0;Ae<16;Ae++,ue+=2){var pe=oe[Ae]<<1;o.decode._putsF(c,(me*f+ue)*y,pe<<16-y)}ue-=ue&1?1:31}}},o.decode._decodeNikon=function(u,l,v,p,c,_,f){var g=[[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]],y=u.t256[0],w=u.t257[0],M=u.t258[0],T=0,B=0,H=o.decode._make_decoder,J=o.decode._getbithuff,Q=l[0].exifIFD.makerNote,q=Q.t150?Q.t150:Q.t140,O=0,K=q[O++],pe=q[O++];(K==73||pe==88)&&(O+=2110),K==70&&(T=2),M==14&&(T+=3);for(var R=[[0,0],[0,0]],Te=u.isLE?o._binLE:o._binBE,$=0;$<2;$++)for(var re=0;re<2;re++)R[$][re]=Te.readShort(q,O),O+=2;var oe=1<<M&32767,me=0,ue=Te.readShort(q,O);O+=2,ue>1&&(me=Math.floor(oe/(ue-1))),K==68&&pe==32&&me>0&&(B=Te.readShort(q,562));var $,ee,ne,_e,ae,Me,Ne=0,Ae=[0,0],Fe=H(g[T]),De=[p,0,0,0];for(Ne=ee=0;ee<w;ee++)for(B&&ee==B&&(Fe=H(g[T+1])),ne=0;ne<y;ne++){$=J(v,De,Fe[0],Fe),_e=$&15,ae=$>>>4,Me=(J(v,De,_e-ae,0)<<1)+1<<ae>>>1,(Me&1<<_e-1)==0&&(Me-=(1<<_e)-(ae==0?1:0)),ne<2?Ae[ne]=R[ee&1][ne]+=Me:Ae[ne&1]+=Me;var ze=Math.min(Math.max(Ae[ne&1],0),(1<<M)-1),ye=(ee*y+ne)*M;o.decode._putsF(_,ye,ze<<16-M)}},o.decode._putsF=function(u,l,v){v=v<<8-(l&7);var p=l>>>3;u[p]|=v>>>16,u[p+1]|=v>>>8,u[p+2]|=v},o.decode._getbithuff=function(u,l,v,p){var c=0,_=o.decode._get_byte,f,g=l[0],y=l[1],w=l[2],M=l[3];if(v==0||w<0)return 0;for(;!M&&w<v&&(f=u[g++])!=-1&&!(M=c&&f==255&&u[g++]);)y=(y<<8)+f,w+=8;if(f=y<<32-w>>>32-v,p?(w-=p[f+1]>>>8,f=p[f+1]&255):w-=v,w<0)throw"e";return l[0]=g,l[1]=y,l[2]=w,l[3]=M,f},o.decode._make_decoder=function(u){var l,v,p,c,_,f=[];for(l=16;l!=0&&!u[l];l--);var g=17;for(f[0]=l,p=v=1;v<=l;v++)for(c=0;c<u[v];c++,++g)for(_=0;_<1<<l-v;_++)p<=1<<l&&(f[p++]=v<<8|u[g]);return f},o.decode._decodeNewJPEG=function(u,l,v,p,c,_){var f=u.t347,g=f?f.length:0,y=new Uint8Array(g+p);if(f){for(var w=216,M=217,T=0,B=0;B<g-1&&!(f[B]==255&&f[B+1]==M);B++)y[T++]=f[B];var H=l[v],J=l[v+1];(H!=255||J!=w)&&(y[T++]=H,y[T++]=J);for(var B=2;B<p;B++)y[T++]=l[v+B]}else for(var B=0;B<p;B++)y[B]=l[v+B];if(u.t262[0]==32803||u.t262[0]==34892){var Q=u.t258[0],q=o.LosslessJpegDecode(y),O=q.length;if(Q==16)if(u.isLE)for(var B=0;B<O;B++)c[_+(B<<1)]=q[B]&255,c[_+(B<<1)+1]=q[B]>>>8;else for(var B=0;B<O;B++)c[_+(B<<1)]=q[B]>>>8,c[_+(B<<1)+1]=q[B]&255;else if(Q==14||Q==12)for(var K=16-Q,B=0;B<O;B++)o.decode._putsF(c,B*Q,q[B]<<K);else if(Q==8)for(var B=0;B<O;B++)c[_+B]=q[B];else throw new Error("unsupported bit depth "+Q)}else{var pe=new o.JpegDecoder;pe.parse(y);for(var R=pe.getData({width:pe.width,height:pe.height,forceRGB:!0,isSourcePDF:!1}),B=0;B<R.length;B++)c[_+B]=R[B]}u.t262[0]==6&&(u.t262[0]=2)},o.decode._decodeOldJPEGInit=function(u,l,v,p){var c=216,_=217,f=219,g=196,y=221,w=192,M=218,T=0,B=0,H,J,Q=!1,q,O,K,pe=u.t513,R=pe?pe[0]:0,Te=u.t514,re=Te?Te[0]:0,oe=u.t324||u.t273||pe,me=u.t530,ue=0,$=0,ee=u.t277?u.t277[0]:1,ne=u.t515;if(oe&&(B=oe[0],Q=oe.length>1),!Q){if(l[v]==255&&l[v+1]==c)return{jpegOffset:v};if(pe!=null&&(l[v+R]==255&&l[v+R+1]==c?T=v+R:s("JPEGInterchangeFormat does not point to SOI"),Te==null?s("JPEGInterchangeFormatLength field is missing"):(R>=B||R+re<=B)&&s("JPEGInterchangeFormatLength field value is invalid"),T!=null))return{jpegOffset:T}}if(me!=null&&(ue=me[0],$=me[1]),pe!=null&&Te!=null)if(re>=2&&R+re<=B){for(l[v+R+re-2]==255&&l[v+R+re-1]==c?H=new Uint8Array(re-2):H=new Uint8Array(re),q=0;q<H.length;q++)H[q]=l[v+R+q];s("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else s("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");if(H==null){var _e=0,ae=[];ae[_e++]=255,ae[_e++]=c;var Me=u.t519;if(Me==null)throw new Error("JPEGQTables tag is missing");for(q=0;q<Me.length;q++)for(ae[_e++]=255,ae[_e++]=f,ae[_e++]=0,ae[_e++]=67,ae[_e++]=q,O=0;O<64;O++)ae[_e++]=l[v+Me[q]+O];for(K=0;K<2;K++){var Ne=u[K==0?"t520":"t521"];if(Ne==null)throw new Error((K==0?"JPEGDCTables":"JPEGACTables")+" tag is missing");for(q=0;q<Ne.length;q++){ae[_e++]=255,ae[_e++]=g;var Ae=19;for(O=0;O<16;O++)Ae+=l[v+Ne[q]+O];for(ae[_e++]=Ae>>>8,ae[_e++]=Ae&255,ae[_e++]=q|K<<4,O=0;O<16;O++)ae[_e++]=l[v+Ne[q]+O];for(O=0;O<Ae;O++)ae[_e++]=l[v+Ne[q]+16+O]}}if(ae[_e++]=255,ae[_e++]=w,ae[_e++]=0,ae[_e++]=8+3*ee,ae[_e++]=8,ae[_e++]=u.height>>>8&255,ae[_e++]=u.height&255,ae[_e++]=u.width>>>8&255,ae[_e++]=u.width&255,ae[_e++]=ee,ee==1)ae[_e++]=1,ae[_e++]=17,ae[_e++]=0;else for(q=0;q<3;q++)ae[_e++]=q+1,ae[_e++]=q!=0?17:(ue&15)<<4|$&15,ae[_e++]=q;ne!=null&&ne[0]!=0&&(ae[_e++]=255,ae[_e++]=y,ae[_e++]=0,ae[_e++]=4,ae[_e++]=ne[0]>>>8&255,ae[_e++]=ne[0]&255),H=new Uint8Array(ae)}var Fe=-1;for(q=0;q<H.length-1;){if(H[q]==255&&H[q+1]==w){Fe=q;break}q++}if(Fe==-1){var De=new Uint8Array(H.length+10+3*ee);De.set(H);var ze=H.length;if(Fe=H.length,H=De,H[ze++]=255,H[ze++]=w,H[ze++]=0,H[ze++]=8+3*ee,H[ze++]=8,H[ze++]=u.height>>>8&255,H[ze++]=u.height&255,H[ze++]=u.width>>>8&255,H[ze++]=u.width&255,H[ze++]=ee,ee==1)H[ze++]=1,H[ze++]=17,H[ze++]=0;else for(q=0;q<3;q++)H[ze++]=q+1,H[ze++]=q!=0?17:(ue&15)<<4|$&15,H[ze++]=q}if(l[B]==255&&l[B+1]==M){var ye=l[B+2]<<8|l[B+3];for(J=new Uint8Array(ye+2),J[0]=l[B],J[1]=l[B+1],J[2]=l[B+2],J[3]=l[B+3],q=0;q<ye-2;q++)J[q+4]=l[B+q+4]}else{J=new Uint8Array(2+6+2*ee);var he=0;if(J[he++]=255,J[he++]=M,J[he++]=0,J[he++]=6+2*ee,J[he++]=ee,ee==1)J[he++]=1,J[he++]=0;else for(q=0;q<3;q++)J[he++]=q+1,J[he++]=q<<4|q;J[he++]=0,J[he++]=63,J[he++]=0}return{jpegOffset:v,tables:H,sosMarker:J,sofPosition:Fe}},o.decode._decodeOldJPEG=function(u,l,v,p,c,_){var f,g,y,w,M,T=o.decode._decodeOldJPEGInit(u,l,v,p);if(T.jpegOffset!=null)for(g=v+p-T.jpegOffset,w=new Uint8Array(g),f=0;f<g;f++)w[f]=l[T.jpegOffset+f];else{for(y=T.tables.length,w=new Uint8Array(y+T.sosMarker.length+p+2),w.set(T.tables),M=y,w[T.sofPosition+5]=u.height>>>8&255,w[T.sofPosition+6]=u.height&255,w[T.sofPosition+7]=u.width>>>8&255,w[T.sofPosition+8]=u.width&255,(l[v]!=255||l[v+1]!=SOS)&&(w.set(T.sosMarker,M),M+=sosMarker.length),f=0;f<p;f++)w[M++]=l[v+f];w[M++]=255,w[M++]=EOI}var B=new o.JpegDecoder;B.parse(w);for(var H=B.getData({width:B.width,height:B.height,forceRGB:!0,isSourcePDF:!1}),f=0;f<H.length;f++)c[_+f]=H[f];u.t262&&u.t262[0]==6&&(u.t262[0]=2)},o.decode._decodePackBits=function(u,l,v,p,c){for(var _=new Int8Array(u.buffer),f=new Int8Array(p.buffer),g=l+v;l<g;){var y=_[l];if(l++,y>=0&&y<128)for(var w=0;w<y+1;w++)f[c]=_[l],c++,l++;if(y>=-127&&y<0){for(var w=0;w<-y+1;w++)f[c]=_[l],c++;l++}}},o.decode._decodeThunder=function(u,l,v,p,c){for(var _=[0,1,0,-1],f=[0,1,2,3,0,-3,-2,-1],g=l+v,y=c*2,w=0;l<g;){var M=u[l],T=M>>>6,B=M&63;if(l++,T==3&&(w=B&15,p[y>>>1]|=w<<4*(1-y&1),y++),T==0)for(var H=0;H<B;H++)p[y>>>1]|=w<<4*(1-y&1),y++;if(T==2)for(var H=0;H<2;H++){var J=B>>>3*(1-H)&7;J!=4&&(w+=f[J],p[y>>>1]|=w<<4*(1-y&1),y++)}if(T==1)for(var H=0;H<3;H++){var J=B>>>2*(2-H)&3;J!=2&&(w+=_[J],p[y>>>1]|=w<<4*(1-y&1),y++)}}},o.decode._dmap={"1":0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},o.decode._lens=function(){var u=function(y,w,M,T){for(var B=0;B<w.length;B++)y[w[B]]=M+B*T},l="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",v="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",c="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",_="00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";l=l.split(","),v=v.split(","),p=p.split(","),c=c.split(","),_=_.split(",");var f={},g={};return u(f,l,0,1),u(f,p,64,64),u(f,_,1792,64),u(g,v,0,1),u(g,c,64,64),u(g,_,1792,64),[f,g]}(),o.decode._decodeG4=function(u,l,v,p,c,_,f){for(var g=o.decode,y=l<<3,w=0,M="",T=[],B=[],H=0;H<_;H++)B.push(0);B=g._makeDiff(B);for(var J=0,Q=0,q=0,O=0,K=0,pe=0,R=0,Te="",re=0,oe=Math.ceil(_/8)*8;y>>>3<l+v;){O=g._findDiff(B,J+(J==0?0:1),1-pe),K=g._findDiff(B,O,pe);var me=0;if(f==1&&(me=u[y>>>3]>>>7-(y&7)&1),f==2&&(me=u[y>>>3]>>>(y&7)&1),y++,M+=me,Te=="H"){if(g._lens[pe][M]!=null){var ue=g._lens[pe][M];M="",w+=ue,ue<64&&(g._addNtimes(T,w,pe),J+=w,pe=1-pe,w=0,re--,re==0&&(Te=""))}}else M=="0001"&&(M="",g._addNtimes(T,K-J,pe),J=K),M=="001"&&(M="",Te="H",re=2),g._dmap[M]!=null&&(Q=O+g._dmap[M],g._addNtimes(T,Q-J,pe),J=Q,M="",pe=1-pe);T.length==_&&Te==""&&(g._writeBits(T,p,c*8+R*oe),pe=0,R++,J=0,B=g._makeDiff(T),T=[])}},o.decode._findDiff=function(u,l,v){for(var p=0;p<u.length;p+=2)if(u[p]>=l&&u[p+1]==v)return u[p]},o.decode._makeDiff=function(u){var l=[];u[0]==1&&l.push(0,1);for(var v=1;v<u.length;v++)u[v-1]!=u[v]&&l.push(v,u[v]);return l.push(u.length,0,u.length,1),l},o.decode._decodeG3=function(u,l,v,p,c,_,f,g){for(var y=o.decode,w=l<<3,M=0,T="",B=[],H=[],J=0;J<_;J++)B.push(0);for(var Q=0,q=0,O=0,K=0,pe=0,R=0,Te=-1,re="",oe=0,me=!0,ue=Math.ceil(_/8)*8;w>>>3<l+v;){K=y._findDiff(H,Q+(Q==0?0:1),1-R),pe=y._findDiff(H,K,R);var $=0;if(f==1&&($=u[w>>>3]>>>7-(w&7)&1),f==2&&($=u[w>>>3]>>>(w&7)&1),w++,T+=$,me){if(y._lens[R][T]!=null){var ee=y._lens[R][T];T="",M+=ee,ee<64&&(y._addNtimes(B,M,R),R=1-R,M=0)}}else if(re=="H"){if(y._lens[R][T]!=null){var ee=y._lens[R][T];T="",M+=ee,ee<64&&(y._addNtimes(B,M,R),Q+=M,R=1-R,M=0,oe--,oe==0&&(re=""))}}else T=="0001"&&(T="",y._addNtimes(B,pe-Q,R),Q=pe),T=="001"&&(T="",re="H",oe=2),y._dmap[T]!=null&&(q=K+y._dmap[T],y._addNtimes(B,q-Q,R),Q=q,T="",R=1-R);T.endsWith("000000000001")&&(Te>=0&&y._writeBits(B,p,c*8+Te*ue),g&&(f==1&&(me=(u[w>>>3]>>>7-(w&7)&1)==1),f==2&&(me=(u[w>>>3]>>>(w&7)&1)==1),w++),T="",R=0,Te++,Q=0,H=y._makeDiff(B),B=[])}B.length==_&&y._writeBits(B,p,c*8+Te*ue)},o.decode._addNtimes=function(u,l,v){for(var p=0;p<l;p++)u.push(v)},o.decode._writeBits=function(u,l,v){for(var p=0;p<u.length;p++)l[v+p>>>3]|=u[p]<<7-(v+p&7)},o.decode._decodeLZW=o.decode._decodeLZW=function(){var u,l,v,p,c=0,_=0,f=0,g=0,y=function(){var q=u>>>3,O=l[q]<<16|l[q+1]<<8|l[q+2],K=O>>>24-(u&7)-_&(1<<_)-1;return u+=_,K},w=new Uint32Array(4096*4),M=0,T=function(q){if(q!=M){M=q,f=1<<q,g=f+1;for(var O=0;O<g+1;O++)w[4*O]=w[4*O+3]=O,w[4*O+1]=65535,w[4*O+2]=1}},B=function(q){_=q+1,c=g+1},H=function(q){for(var O=q<<2,K=w[O+2],pe=p+K-1;O!=65535;)v[pe--]=w[O],O=w[O+1];p+=K},J=function(q,O){var K=c<<2,pe=q<<2;w[K]=w[(O<<2)+3],w[K+1]=pe,w[K+2]=w[pe+2]+1,w[K+3]=w[pe+3],c++,c+1==1<<_&&_!=12&&_++},Q=function(q,O,K,pe,R,Te){u=O<<3,l=q,v=pe,p=R;var re=O+K<<3,oe=0,me=0;for(T(Te),B(Te);u<re&&(oe=y())!=g;){if(oe==f){if(B(Te),oe=y(),oe==g)break;H(oe)}else oe<c?(H(oe),J(me,oe)):(J(me,me),H(c-1));me=oe}return p};return Q}(),o.tags={},o._types=function(){var u=new Array(250);u.fill(0),u=u.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 l={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:u,rest:l},gps:{main:[1,2,5,2,5,1,5,5,0,9],rest:{18:2,29:2}}}}(),o._readIFD=function(u,l,v,p,c,_){var f=u.readUshort(l,v);v+=2;var g={};_.debug&&s(" ".repeat(c),p.length-1,">>>----------------");for(var y=0;y<f;y++){var w=u.readUshort(l,v);v+=2;var M=u.readUshort(l,v);v+=2;var T=u.readUint(l,v);v+=4;var B=u.readUint(l,v);v+=4;var H=[];if((M==1||M==7)&&(H=new Uint8Array(l.buffer,T<5?v-4:B,T)),M==2){var J=T<5?v-4:B,Q=l[J],q=Math.max(0,Math.min(T-1,l.length-J));Q<128||q==0?H.push(u.readASCII(l,J,q)):H=new Uint8Array(l.buffer,J,q)}if(M==3)for(var O=0;O<T;O++)H.push(u.readUshort(l,(T<3?v-4:B)+2*O));if(M==4||M==13)for(var O=0;O<T;O++)H.push(u.readUint(l,(T<2?v-4:B)+4*O));if(M==5||M==10)for(var K=M==5?u.readUint:u.readInt,O=0;O<T;O++)H.push([K(l,B+O*8),K(l,B+O*8+4)]);if(M==8)for(var O=0;O<T;O++)H.push(u.readShort(l,(T<3?v-4:B)+2*O));if(M==9)for(var O=0;O<T;O++)H.push(u.readInt(l,(T<2?v-4:B)+4*O));if(M==11)for(var O=0;O<T;O++)H.push(u.readFloat(l,B+O*4));if(M==12)for(var O=0;O<T;O++)H.push(u.readDouble(l,B+O*8));if(g["t"+w]=H,T!=0&&H.length==0){if(s(w,"unknown TIFF tag type: ",M,"num:",T),y==0)return;continue}if(_.debug&&s(" ".repeat(c),w,M,o.tags[w],H),!(w==330&&g.t272&&g.t272[0]=="DSLR-A100")){if(w==330||w==34665||w==34853||w==50740&&u.readUshort(l,u.readUint(H,0))<300||w==61440){for(var pe=w==50740?[u.readUint(H,0)]:H,R=[],O=0;O<pe.length;O++)o._readIFD(u,l,pe[O],R,c+1,_);w==330&&(g.subIFD=R),w==34665&&(g.exifIFD=R[0]),w==34853&&(g.gpsiIFD=R[0]),w==50740&&(g.dngPrvt=R[0]),w==61440&&(g.fujiIFD=R[0])}}if(w==37500&&_.parseMN){var Te=H;if(u.readASCII(Te,0,5)=="Nikon")g.makerNote=o.decode(Te.slice(10).buffer)[0];else if(u.readUshort(l,B)<300&&u.readUshort(l,B+4)<=12){var re=[];o._readIFD(u,l,B,re,c+1,_),g.makerNote=re[0]}}}return p.push(g),_.debug&&s(" ".repeat(c),"<<<---------------"),v},o._writeIFD=function(u,l,v,p,c){var _=Object.keys(c),f=_.length;c.exifIFD&&f--,c.gpsiIFD&&f--,u.writeUshort(v,p,f),p+=2;for(var g=p+f*12+4,y=0;y<_.length;y++){var w=_[y];if(!(w=="t34665"||w=="t34853")){w=="exifIFD"&&(w="t34665"),w=="gpsiIFD"&&(w="t34853");var M=parseInt(w.slice(1)),T=l.main[M];if(T==null&&(T=l.rest[M]),T==null||T==0)throw new Error("unknown type of tag: "+M);var B=c[w];if(M==34665){var H=o._writeIFD(u,l,v,g,c.exifIFD);B=[g],g=H[1]}if(M==34853){var H=o._writeIFD(u,o._types.gps,v,g,c.gpsiIFD);B=[g],g=H[1]}T==2&&(B=B[0]+"\0");var J=B.length;u.writeUshort(v,p,M),p+=2,u.writeUshort(v,p,T),p+=2,u.writeUint(v,p,J),p+=4;var Q=[-1,1,1,2,4,8,0,1,0,4,8,0,8][T]*J,q=p;if(Q>4&&(u.writeUint(v,p,g),q=g),T==1||T==7)for(var O=0;O<J;O++)v[q+O]=B[O];else if(T==2)u.writeASCII(v,q,B);else if(T==3)for(var O=0;O<J;O++)u.writeUshort(v,q+2*O,B[O]);else if(T==4)for(var O=0;O<J;O++)u.writeUint(v,q+4*O,B[O]);else if(T==5||T==10)for(var K=T==5?u.writeUint:u.writeInt,O=0;O<J;O++){var pe=B[O],R=pe[0],Te=pe[1];if(R==null)throw"e";K(v,q+8*O,R),K(v,q+8*O+4,Te)}else if(T==9)for(var O=0;O<J;O++)u.writeInt(v,q+4*O,B[O]);else if(T==12)for(var O=0;O<J;O++)u.writeDouble(v,q+8*O,B[O]);else throw T;Q>4&&(Q+=Q&1,g+=Q),p+=4}}return[p,g]},o.toRGBA8=function(u,l){var v=u.width,p=u.height,c=v*p,_=c*4,f=u.data,g=new Uint8Array(c*4),y=u.t262?u.t262[0]:2,w=u.t258?Math.min(32,u.t258[0]):1;if(y==0)for(var M=Math.ceil(w*v/8),T=0;T<p;T++){var B=T*M,H=T*v;if(w==1)for(var J=0;J<v;J++){var Q=H+J<<2,q=f[B+(J>>3)]>>7-(J&7)&1;g[Q]=g[Q+1]=g[Q+2]=(1-q)*255,g[Q+3]=255}if(w==4)for(var J=0;J<v;J++){var Q=H+J<<2,q=f[B+(J>>1)]>>4-4*(J&1)&15;g[Q]=g[Q+1]=g[Q+2]=(15-q)*17,g[Q+3]=255}if(w==8)for(var J=0;J<v;J++){var Q=H+J<<2,q=f[B+J];g[Q]=g[Q+1]=g[Q+2]=255-q,g[Q+3]=255}}else if(y==1){var O=u.t258?u.t258.length:1,M=Math.ceil(O*w*v/8);l==null&&(l=1/256);for(var T=0;T<p;T++){var B=T*M,H=T*v;if(w==1)for(var J=0;J<v;J++){var Q=H+J<<2,q=f[B+(J>>3)]>>7-(J&7)&1;g[Q]=g[Q+1]=g[Q+2]=q*255,g[Q+3]=255}if(w==2)for(var J=0;J<v;J++){var Q=H+J<<2,q=f[B+(J>>2)]>>6-2*(J&3)&3;g[Q]=g[Q+1]=g[Q+2]=q*85,g[Q+3]=255}if(w==8)for(var J=0;J<v;J++){var Q=H+J<<2,q=f[B+J*O];g[Q]=g[Q+1]=g[Q+2]=q,g[Q+3]=255}if(w==16)for(var J=0;J<v;J++){var Q=H+J<<2,K=B+2*J,q=f[K+1]<<8|f[K];g[Q]=g[Q+1]=g[Q+2]=Math.min(255,~~(q*l)),g[Q+3]=255}}}else if(y==2){var O=u.t258?u.t258.length:3;if(w==8){if(O==4)for(var J=0;J<_;J++)g[J]=f[J];if(O==3)for(var J=0;J<c;J++){var Q=J<<2,pe=J*3;g[Q]=f[pe],g[Q+1]=f[pe+1],g[Q+2]=f[pe+2],g[Q+3]=255}}else{if(O==4)for(var J=0;J<c;J++){var Q=J<<2,pe=J*8+1;g[Q]=f[pe],g[Q+1]=f[pe+2],g[Q+2]=f[pe+4],g[Q+3]=f[pe+6]}if(O==3)for(var J=0;J<c;J++){var Q=J<<2,pe=J*6+1;g[Q]=f[pe],g[Q+1]=f[pe+2],g[Q+2]=f[pe+4],g[Q+3]=255}}}else if(y==3)for(var R=u.t320,O=u.t258?u.t258.length:1,J=0;J<c;J++){var Q=J<<2,Te=f[J*O];g[Q]=R[Te]>>8,g[Q+1]=R[256+Te]>>8,g[Q+2]=R[512+Te]>>8,g[Q+3]=255}else if(y==5)for(var O=u.t258?u.t258.length:4,re=O>4?1:0,J=0;J<c;J++){var Q=J<<2,oe=J*O,me=255-f[oe],ue=255-f[oe+1],$=255-f[oe+2],ee=(255-f[oe+3])*(1/255);g[Q]=~~(me*ee+.5),g[Q+1]=~~(ue*ee+.5),g[Q+2]=~~($*ee+.5),g[Q+3]=255*(1-re)+f[oe+4]*re}else if(y==6&&u.t278)for(var ne=u.t278[0],T=0;T<p;T+=ne)for(var J=T*v,_e=ne*v,ae=0;ae<_e;ae++){var Q=4*(J+ae),oe=3*J+4*(ae>>>1),$=f[oe+(ae&1)],Me=f[oe+2]-128,Ne=f[oe+3]-128,Ae=$+((Ne>>2)+(Ne>>3)+(Ne>>5)),Fe=$-((Me>>2)+(Me>>4)+(Me>>5))-((Ne>>1)+(Ne>>3)+(Ne>>4)+(Ne>>5)),De=$+(Me+(Me>>1)+(Me>>2)+(Me>>6));g[Q]=Math.max(0,Math.min(255,Ae)),g[Q+1]=Math.max(0,Math.min(255,Fe)),g[Q+2]=Math.max(0,Math.min(255,De)),g[Q+3]=255}else s("Unknown Photometric interpretation: "+y);return g},o.replaceIMG=function(u){u==null&&(u=document.getElementsByTagName("img"));for(var l=["tif","tiff","dng","cr2","nef"],v=0;v<u.length;v++){var p=u[v],c=p.getAttribute("src");if(c!=null){var _=c.split(".").pop().toLowerCase();if(l.indexOf(_)!=-1){var f=new XMLHttpRequest;o._xhrs.push(f),o._imgs.push(p),f.open("GET",c),f.responseType="arraybuffer",f.onload=o._imgLoaded,f.send()}}}},o._xhrs=[],o._imgs=[],o._imgLoaded=function(u){var l=u.target.response,v=o.decode(l),p=v,c=0,_=p[0];v[0].subIFD&&(p=p.concat(v[0].subIFD));for(var f=0;f<p.length;f++){var B=p[f];if(!(B.t258==null||B.t258.length<3)){var g=B.t256*B.t257;g>c&&(c=g,_=B)}}o.decodeImage(l,_,v);var y=o.toRGBA8(_),w=_.width,M=_.height,T=o._xhrs.indexOf(u.target),B=o._imgs[T];o._xhrs.splice(T,1),o._imgs.splice(T,1);var H=document.createElement("canvas");H.width=w,H.height=M;var J=H.getContext("2d"),Q=new ImageData(new Uint8ClampedArray(y.buffer),w,M);J.putImageData(Q,0,0),B.setAttribute("src",H.toDataURL())},o._binBE={nextZero:function(u,l){for(;u[l]!=0;)l++;return l},readUshort:function(u,l){return u[l]<<8|u[l+1]},readShort:function(u,l){var v=o._binBE.ui8;return v[0]=u[l+1],v[1]=u[l+0],o._binBE.i16[0]},readInt:function(u,l){var v=o._binBE.ui8;return v[0]=u[l+3],v[1]=u[l+2],v[2]=u[l+1],v[3]=u[l+0],o._binBE.i32[0]},readUint:function(u,l){var v=o._binBE.ui8;return v[0]=u[l+3],v[1]=u[l+2],v[2]=u[l+1],v[3]=u[l+0],o._binBE.ui32[0]},readASCII:function(u,l,v){for(var p="",c=0;c<v;c++)p+=String.fromCharCode(u[l+c]);return p},readFloat:function(u,l){for(var v=o._binBE.ui8,p=0;p<4;p++)v[p]=u[l+3-p];return o._binBE.fl32[0]},readDouble:function(u,l){for(var v=o._binBE.ui8,p=0;p<8;p++)v[p]=u[l+7-p];return o._binBE.fl64[0]},writeUshort:function(u,l,v){u[l]=v>>8&255,u[l+1]=v&255},writeInt:function(u,l,v){var p=o._binBE.ui8;o._binBE.i32[0]=v,u[l+3]=p[0],u[l+2]=p[1],u[l+1]=p[2],u[l+0]=p[3]},writeUint:function(u,l,v){u[l]=v>>24&255,u[l+1]=v>>16&255,u[l+2]=v>>8&255,u[l+3]=v>>0&255},writeASCII:function(u,l,v){for(var p=0;p<v.length;p++)u[l+p]=v.charCodeAt(p)},writeDouble:function(u,l,v){o._binBE.fl64[0]=v;for(var p=0;p<8;p++)u[l+p]=o._binBE.ui8[7-p]}},o._binBE.ui8=new Uint8Array(8),o._binBE.i16=new Int16Array(o._binBE.ui8.buffer),o._binBE.i32=new Int32Array(o._binBE.ui8.buffer),o._binBE.ui32=new Uint32Array(o._binBE.ui8.buffer),o._binBE.fl32=new Float32Array(o._binBE.ui8.buffer),o._binBE.fl64=new Float64Array(o._binBE.ui8.buffer),o._binLE={nextZero:o._binBE.nextZero,readUshort:function(u,l){return u[l+1]<<8|u[l]},readShort:function(u,l){var v=o._binBE.ui8;return v[0]=u[l+0],v[1]=u[l+1],o._binBE.i16[0]},readInt:function(u,l){var v=o._binBE.ui8;return v[0]=u[l+0],v[1]=u[l+1],v[2]=u[l+2],v[3]=u[l+3],o._binBE.i32[0]},readUint:function(u,l){var v=o._binBE.ui8;return v[0]=u[l+0],v[1]=u[l+1],v[2]=u[l+2],v[3]=u[l+3],o._binBE.ui32[0]},readASCII:o._binBE.readASCII,readFloat:function(u,l){for(var v=o._binBE.ui8,p=0;p<4;p++)v[p]=u[l+p];return o._binBE.fl32[0]},readDouble:function(u,l){for(var v=o._binBE.ui8,p=0;p<8;p++)v[p]=u[l+p];return o._binBE.fl64[0]},writeUshort:function(u,l,v){u[l]=v&255,u[l+1]=v>>8&255},writeInt:function(u,l,v){var p=o._binBE.ui8;o._binBE.i32[0]=v,u[l+0]=p[0],u[l+1]=p[1],u[l+2]=p[2],u[l+3]=p[3]},writeUint:function(u,l,v){u[l]=v>>>0&255,u[l+1]=v>>>8&255,u[l+2]=v>>>16&255,u[l+3]=v>>>24&255},writeASCII:o._binBE.writeASCII},o._copyTile=function(u,l,v,p,c,_,f,g){for(var y=Math.min(l,c-f),w=Math.min(v,_-g),M=0;M<w;M++)for(var T=(g+M)*c+f,B=M*l,H=0;H<y;H++)p[T+H]=u[B+H]},o.LosslessJpegDecode=function(){function u(c){this.w=c,this.N=0,this._=0,this.G=0}u.prototype={t:function(c){this.N=Math.max(0,Math.min(this.w.length,c))},i:function(){return this.w[this.N++]},l:function(){var c=this.N;return this.N+=2,this.w[c]<<8|this.w[c+1]},J:function(){return this._==0&&(this.G=this.w[this.N],this.N+=1+(this.G+1>>>8),this._=8),this.G>>>--this._&1},Z:function(c){var _=this._,f=this.G,g=Math.min(_,c);c-=g,_-=g;for(var y=f>>>_&(1<<g)-1;c>0;)f=this.w[this.N],this.N+=1+(f+1>>>8),g=Math.min(8,c),c-=g,_=8-g,y<<=g,y|=f>>>_&(1<<g)-1;return this._=_,this.G=f,y}};var l={};l.X=function(){return[0,0,-1]},l.s=function(c,_,f){c[l.Y(c,0,f)+2]=_},l.Y=function(c,_,f){if(c[_+2]!=-1)return 0;if(f==0)return _;for(var g=0;g<2;g++){c[_+g]==0&&(c[_+g]=c.length,c.push(0),c.push(0),c.push(-1));var y=l.Y(c,c[_+g],f-1);if(y!=0)return y}return 0},l.B=function(c,_){for(var f=0,g=0,y=0,w=_._,M=_.G,T=_.N;;)if(w==0&&(M=_.w[T],T+=1+(M+1>>>8),w=8),y=M>>>--w&1,f=c[f+y],g=c[f+2],g!=-1)return _._=w,_.G=M,_.N=T,g;return-1};function v(c){this.z=new u(c),this.D(this.z)}v.prototype={$:function(c,_){this.Q=c.i(),this.F=c.l(),this.o=c.l();var f=this.O=c.i();this.L=[];for(var g=0;g<f;g++){var y=c.i(),w=c.i();c.i(),this.L[y]=g}c.t(c.N+_-(6+f*3))},e:function(){var c=0,_=this.z.i();this.H==null&&(this.H={});for(var f=this.H[_]=l.X(),g=[],y=0;y<16;y++)g[y]=this.z.i(),c+=g[y];for(var y=0;y<16;y++)for(var w=0;w<g[y];w++)l.s(f,this.z.i(),y+1);return c+17},W:function(c){for(;c>0;)c-=this.e()},p:function(c,_){var f=c.i();this.U||(this.U=[]);for(var g=0;g<f;g++){var y=c.i(),w=c.i();this.U[this.L[y]]=this.H[w>>>4]}this.g=c.i(),c.t(c.N+_-(2+f*2))},D:function(c){var _=!1,f=c.l();if(f===v.q)do{var f=c.l(),g=c.l()-2;switch(f){case v.m:this.$(c,g);break;case v.K:this.W(g);break;case v.V:this.p(c,g),_=!0;break;default:c.t(c.N+g);break}}while(!_)},I:function(c,_){var f=l.B(_,c);if(f==16)return-32768;var g=c.Z(f);return(g&1<<f-1)==0&&(g-=(1<<f)-1),g},B:function(c,_){for(var f=this.z,g=this.O,y=this.F,w=this.I,M=this.g,T=this.o*g,B=this.U,H=0;H<g;H++)c[H]=w(f,B[H])+(1<<this.Q-1);for(var J=g;J<T;J+=g)for(var H=0;H<g;H++)c[J+H]=w(f,B[H])+c[J+H-g];for(var Q=_,q=1;q<y;q++){for(var H=0;H<g;H++)c[Q+H]=w(f,B[H])+c[Q+H-_];for(var J=g;J<T;J+=g)for(var H=0;H<g;H++){var O=Q+J+H,K=c[O-g];M==6&&(K=c[O-_]+(K-c[O-g-_]>>>1)),c[O]=K+w(f,B[H])}Q+=_}}},v.m=65475,v.K=65476,v.q=65496,v.V=65498;function p(c){var _=new v(c),f=_.Q>8?Uint16Array:Uint8Array,g=new f(_.o*_.F*_.O),y=_.o*_.O;return _.B(g,y),g}return p}()})(e,r)}(),function(){function e(p){if(!p)throw Error("assert :P")}function r(p,c,_){for(var f=0;4>f;f++)if(p[c+f]!=_.charCodeAt(f))return!0;return!1}function s(p,c,_,f,g){for(var y=0;y<g;y++)p[c+y]=_[f+y]}function o(p,c,_,f){for(var g=0;g<f;g++)p[c+g]=_}function a(p){return new Int32Array(p)}function u(p,c){for(var _=[],f=0;f<p;f++)_.push(new c);return _}function l(){function p(_,f,g){for(var y=g[f],w=0;w<y&&(_.push(g.length>f+1?[]:0),!(g.length<f+1));w++)p(_[w],f+1,g)}var c=[];return p(c,0,[3,11]),c}function v(p,c){function _(g,y,w){for(var M=w[y],T=0;T<M&&(g.push(w.length>y+1?[]:new c),!(w.length<y+1));T++)_(g[T],y+1,w)}var f=[];return _(f,0,p),f}window.WebPDecoder=function(){function p(){a(55)}function c(m,P){for(var L=1<<P-1>>>0;m&L;)L>>>=1;return L?(m&L-1)+L:m}function _(m,P,L,V,ce){e(!(V%L));do V-=L,m[P+V]=ce;while(0<V)}function f(m,P,L,V,ce,ve){var Ee=P,Se=1<<L,be,Ue,He=a(16),qe=a(16);for(e(ce!=0),e(V!=null),e(m!=null),e(0<L),Ue=0;Ue<ce;++Ue){if(15<V[Ue])return 0;++He[V[Ue]]}if(He[0]==ce)return 0;for(qe[1]=0,be=1;15>be;++be){if(He[be]>1<<be)return 0;qe[be+1]=qe[be]+He[be]}for(Ue=0;Ue<ce;++Ue)be=V[Ue],0<V[Ue]&&(ve[qe[be]++]=Ue);if(qe[15]==1)return V=new y,V.g=0,V.value=ve[0],_(m,Ee,1,Se,V),Se;var je=-1,$e=Se-1,Qe=0,rt=1,Ke=1,et,it=1<<L;for(Ue=0,be=1,ce=2;be<=L;++be,ce<<=1){if(Ke<<=1,rt+=Ke,Ke-=He[be],0>Ke)return 0;for(;0<He[be];--He[be])V=new y,V.g=be,V.value=ve[Ue++],_(m,Ee+Qe,ce,it,V),Qe=c(Qe,be)}for(be=L+1,ce=2;15>=be;++be,ce<<=1){if(Ke<<=1,rt+=Ke,Ke-=He[be],0>Ke)return 0;for(;0<He[be];--He[be]){if(V=new y,(Qe&$e)!=je){for(Ee+=it,je=be,et=1<<je-L;15>je&&(et-=He[je],!(0>=et));)++je,et<<=1;et=je-L,it=1<<et,Se+=it,je=Qe&$e,m[P+je].g=et+L,m[P+je].value=Ee-P-je}V.g=be-L,V.value=ve[Ue++],_(m,Ee+(Qe>>L),ce,it,V),Qe=c(Qe,be)}}return rt!=2*qe[15]-1?0:Se}function g(m,P,L,V,ce){if(e(2328>=ce),512>=ce)var ve=a(512);else if(ve=a(ce),ve==null)return 0;return f(m,P,L,V,ce,ve)}function y(){this.value=this.g=0}function w(){this.value=this.g=0}function M(){this.G=u(5,y),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=u(en,w)}function T(m,P,L,V){e(m!=null),e(P!=null),e(2147483648>V),m.Ca=254,m.I=0,m.b=-8,m.Ka=0,m.oa=P,m.pa=L,m.Jd=P,m.Yc=L+V,m.Zc=4<=V?L+V-4+1:L,oe(m)}function B(m,P){for(var L=0;0<P--;)L|=ue(m,128)<<P;return L}function H(m,P){var L=B(m,P);return me(m)?-L:L}function J(m,P,L,V){var ce,ve=0;for(e(m!=null),e(P!=null),e(4294967288>V),m.Sb=V,m.Ra=0,m.u=0,m.h=0,4<V&&(V=4),ce=0;ce<V;++ce)ve+=P[L+ce]<<8*ce;m.Ra=ve,m.bb=V,m.oa=P,m.pa=L}function Q(m){for(;8<=m.u&&m.bb<m.Sb;)m.Ra>>>=8,m.Ra+=m.oa[m.pa+m.bb]<<tn-8>>>0,++m.bb,m.u-=8;R(m)&&(m.h=1,m.u=0)}function q(m,P){if(e(0<=P),!m.h&&P<=na){var L=pe(m)&ia[P];return m.u+=P,Q(m),L}return m.h=1,m.u=0}function O(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function K(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function pe(m){return m.Ra>>>(m.u&tn-1)>>>0}function R(m){return e(m.bb<=m.Sb),m.h||m.bb==m.Sb&&m.u>tn}function Te(m,P){m.u=P,m.h=R(m)}function re(m){m.u>=Hn&&(e(m.u>=Hn),Q(m))}function oe(m){e(m!=null&&m.oa!=null),m.pa<m.Zc?(m.I=(m.oa[m.pa++]|m.I<<8)>>>0,m.b+=8):(e(m!=null&&m.oa!=null),m.pa<m.Yc?(m.b+=8,m.I=m.oa[m.pa++]|m.I<<8):m.Ka?m.b=0:(m.I<<=8,m.b+=8,m.Ka=1))}function me(m){return B(m,1)}function ue(m,P){var L=m.Ca;0>m.b&&oe(m);var V=m.b,ce=L*P>>>8,ve=(m.I>>>V>ce)+0;for(ve?(L-=ce,m.I-=ce+1<<V>>>0):L=ce+1,V=L,ce=0;256<=V;)ce+=8,V>>=8;return V=7^ce+sa[V],m.b-=V,m.Ca=(L<<V)-1,ve}function $(m,P,L){m[P+0]=L>>24&255,m[P+1]=L>>16&255,m[P+2]=L>>8&255,m[P+3]=L>>0&255}function ee(m,P){return m[P+0]<<0|m[P+1]<<8}function ne(m,P){return ee(m,P)|m[P+2]<<16}function _e(m,P){return ee(m,P)|ee(m,P+2)<<16}function ae(m,P){var L=1<<P;return e(m!=null),e(0<P),m.X=a(L),m.X==null?0:(m.Mb=32-P,m.Xa=P,1)}function Me(m,P){e(m!=null),e(P!=null),e(m.Xa==P.Xa),s(P.X,0,m.X,0,1<<P.Xa)}function Ne(){this.X=[],this.Xa=this.Mb=0}function Ae(m,P,L,V){e(L!=null),e(V!=null);var ce=L[0],ve=V[0];return ce==0&&(ce=(m*ve+P/2)/P),ve==0&&(ve=(P*ce+m/2)/m),0>=ce||0>=ve?0:(L[0]=ce,V[0]=ve,1)}function Fe(m,P){return m+(1<<P)-1>>>P}function De(m,P){return((m&4278255360)+(P&4278255360)>>>0&4278255360)+((m&16711935)+(P&16711935)>>>0&16711935)>>>0}function ze(m,P){self[P]=function(L,V,ce,ve,Ee,Se,be){var Ue;for(Ue=0;Ue<Ee;++Ue){var He=self[m](Se[be+Ue-1],ce,ve+Ue);Se[be+Ue]=De(L[V+Ue],He)}}}function ye(){this.ud=this.hd=this.jd=0}function he(m,P){return(((m^P)&4278124286)>>>1)+(m&P)>>>0}function ke(m){if(0<=m&&256>m)return m;if(0>m)return 0;if(255<m)return 255}function le(m,P){return ke(m+(m-P+.5>>1))}function Ce(m,P,L){return Math.abs(P-L)-Math.abs(m-L)}function Be(m,P,L,V,ce,ve,Ee){for(V=ve[Ee-1],L=0;L<ce;++L)ve[Ee+L]=V=De(m[P+L],V)}function we(m,P,L,V,ce){var ve;for(ve=0;ve<L;++ve){var Ee=m[P+ve],Se=Ee>>8&255,be=Ee&16711935,be=be+((Se<<16)+Se),be=be&16711935;V[ce+ve]=(Ee&4278255360)+be>>>0}}function xe(m,P){P.jd=m>>0&255,P.hd=m>>8&255,P.ud=m>>16&255}function Ie(m,P,L,V,ce,ve){var Ee;for(Ee=0;Ee<V;++Ee){var Se=P[L+Ee],be=Se>>>8,Ue=Se>>>16,He=Se,Ue=Ue+((m.jd<<24>>24)*(be<<24>>24)>>>5),Ue=Ue&255,He=He+((m.hd<<24>>24)*(be<<24>>24)>>>5),He=He+((m.ud<<24>>24)*(Ue<<24>>24)>>>5),He=He&255;ce[ve+Ee]=(Se&4278255360)+(Ue<<16)+He}}function Re(m,P,L,V,ce){self[P]=function(ve,Ee,Se,be,Ue,He,qe,je,$e){for(be=qe;be<je;++be)for(qe=0;qe<$e;++qe)Ue[He++]=ce(Se[V(ve[Ee++])])},self[m]=function(ve,Ee,Se,be,Ue,He,qe){var je=8>>ve.b,$e=ve.Ea,Qe=ve.K[0],rt=ve.w;if(8>je)for(ve=(1<<ve.b)-1,rt=(1<<je)-1;Ee<Se;++Ee){var Ke=0,et;for(et=0;et<$e;++et)et&ve||(Ke=V(be[Ue++])),He[qe++]=ce(Qe[Ke&rt]),Ke>>=je}else self["VP8LMapColor"+L](be,Ue,Qe,rt,He,qe,Ee,Se,$e)}}function Le(m,P,L,V,ce){for(L=P+L;P<L;){var ve=m[P++];V[ce++]=ve>>16&255,V[ce++]=ve>>8&255,V[ce++]=ve>>0&255}}function Oe(m,P,L,V,ce){for(L=P+L;P<L;){var ve=m[P++];V[ce++]=ve>>16&255,V[ce++]=ve>>8&255,V[ce++]=ve>>0&255,V[ce++]=ve>>24&255}}function Ve(m,P,L,V,ce){for(L=P+L;P<L;){var ve=m[P++],Ee=ve>>16&240|ve>>12&15,ve=ve>>0&240|ve>>28&15;V[ce++]=Ee,V[ce++]=ve}}function Xe(m,P,L,V,ce){for(L=P+L;P<L;){var ve=m[P++],Ee=ve>>16&248|ve>>13&7,ve=ve>>5&224|ve>>3&31;V[ce++]=Ee,V[ce++]=ve}}function We(m,P,L,V,ce){for(L=P+L;P<L;){var ve=m[P++];V[ce++]=ve>>0&255,V[ce++]=ve>>8&255,V[ce++]=ve>>16&255}}function t(m,P,L,V,ce,ve){if(ve==0)for(L=P+L;P<L;)ve=m[P++],$(V,(ve[0]>>24|ve[1]>>8&65280|ve[2]<<8&16711680|ve[3]<<24)>>>0),ce+=32;else s(V,ce,m,P,L)}function h(m,P){self[P][0]=self[m+"0"],self[P][1]=self[m+"1"],self[P][2]=self[m+"2"],self[P][3]=self[m+"3"],self[P][4]=self[m+"4"],self[P][5]=self[m+"5"],self[P][6]=self[m+"6"],self[P][7]=self[m+"7"],self[P][8]=self[m+"8"],self[P][9]=self[m+"9"],self[P][10]=self[m+"10"],self[P][11]=self[m+"11"],self[P][12]=self[m+"12"],self[P][13]=self[m+"13"],self[P][14]=self[m+"0"],self[P][15]=self[m+"0"]}function d(m){return m==hn||m==ln||m==Mi||m==un}function x(){this.eb=[],this.size=this.A=this.fb=0}function E(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function C(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new x,this.f.kb=new E,this.sd=null}function b(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function U(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function D(m){return alert("todo:WebPSamplerProcessPlane"),m.T}function k(m,P){var L=m.T,V=P.ba.f.RGBA,ce=V.eb,ve=V.fb+m.ka*V.A,Ee=er[P.ba.S],Se=m.y,be=m.O,Ue=m.f,He=m.N,qe=m.ea,je=m.W,$e=P.cc,Qe=P.dc,rt=P.Mc,Ke=P.Nc,et=m.ka,it=m.ka+m.T,ht=m.U,ot=ht+1>>1;for(et==0?Ee(Se,be,null,null,Ue,He,qe,je,Ue,He,qe,je,ce,ve,null,null,ht):(Ee(P.ec,P.fc,Se,be,$e,Qe,rt,Ke,Ue,He,qe,je,ce,ve-V.A,ce,ve,ht),++L);et+2<it;et+=2)$e=Ue,Qe=He,rt=qe,Ke=je,He+=m.Rc,je+=m.Rc,ve+=2*V.A,be+=2*m.fa,Ee(Se,be-m.fa,Se,be,$e,Qe,rt,Ke,Ue,He,qe,je,ce,ve-V.A,ce,ve,ht);return be+=m.fa,m.j+it<m.o?(s(P.ec,P.fc,Se,be,ht),s(P.cc,P.dc,Ue,He,ot),s(P.Mc,P.Nc,qe,je,ot),L--):it&1||Ee(Se,be,null,null,Ue,He,qe,je,Ue,He,qe,je,ce,ve+V.A,null,null,ht),L}function Z(m,P,L){var V=m.F,ce=[m.J];if(V!=null){var ve=m.U,Ee=P.ba.S,Se=Ee==Ci||Ee==Mi;P=P.ba.f.RGBA;var be=[0],Ue=m.ka;be[0]=m.T,m.Kb&&(Ue==0?--be[0]:(--Ue,ce[0]-=m.width),m.j+m.ka+m.T==m.o&&(be[0]=m.o-m.j-Ue));var He=P.eb,Ue=P.fb+Ue*P.A;m=ws(V,ce[0],m.width,ve,be,He,Ue+(Se?0:3),P.A),e(L==be),m&&d(Ee)&&$r(He,Ue,Se,ve,be,P.A)}return 0}function Y(m){var P=m.ma,L=P.ba.S,V=11>L,ce=L==Si||L==Ti||L==Ci||L==on||L==12||d(L);if(P.memory=null,P.Ib=null,P.Jb=null,P.Nd=null,!zn(P.Oa,m,ce?11:12))return 0;if(ce&&d(L)&&kn(),m.da)alert("todo:use_scaling");else{if(V){if(P.Ib=D,m.Kb){if(L=m.U+1>>1,P.memory=a(m.U+2*L),P.memory==null)return 0;P.ec=P.memory,P.fc=0,P.cc=P.ec,P.dc=P.fc+m.U,P.Mc=P.cc,P.Nc=P.dc+L,P.Ib=k,kn()}}else alert("todo:EmitYUV");ce&&(P.Jb=Z,V&&_i())}if(V&&!Fs){for(m=0;256>m;++m)ba[m]=89858*(m-128)+ki>>bi,Ia[m]=-22014*(m-128)+ki,Aa[m]=-45773*(m-128),ka[m]=113618*(m-128)+ki>>bi;for(m=jr;m<pn;++m)P=76283*(m-16)+ki>>bi,Ra[m-jr]=St(P,255),Da[m-jr]=St(P+8>>4,15);Fs=1}return 1}function W(m){var P=m.ma,L=m.U,V=m.T;return e(!(m.ka&1)),0>=L||0>=V?0:(L=P.Ib(m,P),P.Jb!=null&&P.Jb(m,P,L),P.Dc+=L,1)}function F(m){m.ma.memory=null}function z(m,P,L,V){return q(m,8)!=47?0:(P[0]=q(m,14)+1,L[0]=q(m,14)+1,V[0]=q(m,1),q(m,3)!=0?0:!m.h)}function G(m,P){if(4>m)return m+1;var L=m-2>>1;return(2+(m&1)<<L)+q(P,L)+1}function X(m,P){if(120<P)return P-120;var L=pa[P-1],L=(L>>4)*m+(8-(L&15));return 1<=L?L:1}function A(m,P,L){var V=pe(L);P+=V&255;var ce=m[P].g-8;return 0<ce&&(Te(L,L.u+8),V=pe(L),P+=m[P].value,P+=V&(1<<ce)-1),Te(L,L.u+m[P].g),m[P].value}function N(m,P,L){return L.g+=m.g,L.value+=m.value<<P>>>0,e(8>=L.g),m.g}function I(m,P,L){var V=m.xc;return P=V==0?0:m.vc[m.md*(L>>V)+(P>>V)],e(P<m.Wb),m.Ya[P]}function te(m,P,L,V){var ce=m.ab,ve=m.c*P,Ee=m.C;P=Ee+P;var Se=L,be=V;for(V=m.Ta,L=m.Ua;0<ce--;){var Ue=m.gc[ce],He=Ee,qe=P,je=Se,$e=be,be=V,Se=L,Qe=Ue.Ea;switch(e(He<qe),e(qe<=Ue.nc),Ue.hc){case 2:Wn(je,$e,(qe-He)*Qe,be,Se);break;case 0:var rt=Ue,Ke=He,et=qe,it=be,ht=Se,ot=rt.Ea;Ke==0&&(aa(je,$e,null,null,1,it,ht),Be(je,$e+1,0,0,ot-1,it,ht+1),$e+=ot,ht+=ot,++Ke);for(var dt=1<<rt.b,pt=dt-1,xt=Fe(ot,rt.b),wt=rt.K,rt=rt.w+(Ke>>rt.b)*xt;Ke<et;){var It=wt,bt=rt,kt=1;for(oa(je,$e,it,ht-ot,1,it,ht);kt<ot;){var Ot=Xn[It[bt++]>>8&15],Zt=(kt&~pt)+dt;Zt>ot&&(Zt=ot),Ot(je,$e+ +kt,it,ht+kt-ot,Zt-kt,it,ht+kt),kt=Zt}$e+=ot,ht+=ot,++Ke,Ke&pt||(rt+=xt)}qe!=Ue.nc&&s(be,Se-Qe,be,Se+(qe-He-1)*Qe,Qe);break;case 1:for(Qe=je,et=$e,je=Ue.Ea,$e=1<<Ue.b,it=$e-1,ht=je&~it,ot=je-ht,Ke=Fe(je,Ue.b),dt=Ue.K,Ue=Ue.w+(He>>Ue.b)*Ke;He<qe;){for(pt=dt,xt=Ue,wt=new ye,rt=et+ht,It=et+je;et<rt;)xe(pt[xt++],wt),rn(wt,Qe,et,$e,be,Se),et+=$e,Se+=$e;et<It&&(xe(pt[xt++],wt),rn(wt,Qe,et,ot,be,Se),et+=ot,Se+=ot),++He,He&it||(Ue+=Ke)}break;case 3:if(je==be&&$e==Se&&0<Ue.b){for(ht=(qe-He)*Fe(Ue.Ea,Ue.b),Qe=Se+(qe-He)*Qe-ht,et=be,je=Qe,$e=be,it=Se,ot=ht,Ke=[],ht=ot-1;0<=ht;--ht)Ke[ht]=$e[it+ht];for(ht=ot-1;0<=ht;--ht)et[je+ht]=Ke[ht];Vn(Ue,He,qe,be,Qe,be,Se)}else Vn(Ue,He,qe,je,$e,be,Se)}Se=V,be=L}be!=L&&s(V,L,Se,be,ve)}function fe(m,P){var L=m.V,V=m.Ba+m.c*m.C,ce=P-m.C;if(e(P<=m.l.o),e(16>=ce),0<ce){var ve=m.l,Ee=m.Ta,Se=m.Ua,be=ve.width;if(te(m,ce,L,V),Se=[Se],L=m.C,V=P,ce=Se,e(L<V),e(ve.v<ve.va),V>ve.o&&(V=ve.o),L<ve.j){var Ue=ve.j-L,L=ve.j;ce[0]+=Ue*be}if(L>=V?L=0:(ce[0]+=4*ve.v,ve.ka=L-ve.j,ve.U=ve.va-ve.v,ve.T=V-L,L=1),L){if(Se=Se[0],L=m.ca,11>L.S){for(var He=L.f.RGBA,V=L.S,ce=ve.U,ve=ve.T,Ue=He.eb,qe=He.A,je=ve,He=He.fb+m.Ma*He.A;0<je--;){var $e=Ee,Qe=Se,rt=ce,Ke=Ue,et=He;switch(V){case Pi:Yn($e,Qe,rt,Ke,et);break;case Si:nn($e,Qe,rt,Ke,et);break;case hn:nn($e,Qe,rt,Ke,et),$r(Ke,et,0,rt,1,0);break;case ts:qn($e,Qe,rt,Ke,et);break;case Ti:t($e,Qe,rt,Ke,et,1);break;case ln:t($e,Qe,rt,Ke,et,1),$r(Ke,et,0,rt,1,0);break;case Ci:t($e,Qe,rt,Ke,et,0);break;case Mi:t($e,Qe,rt,Ke,et,0),$r(Ke,et,1,rt,1,0);break;case on:sn($e,Qe,rt,Ke,et);break;case un:sn($e,Qe,rt,Ke,et),ys(Ke,et,rt,1,0);break;case rs:Jn($e,Qe,rt,Ke,et);break;default:e(0)}Se+=be,He+=qe}m.Ma+=ve}else alert("todo:EmitRescaledRowsYUVA");e(m.Ma<=L.height)}}m.C=P,e(m.C<=m.i)}function S(m){var P;if(0<m.ua)return 0;for(P=0;P<m.Wb;++P){var L=m.Ya[P].G,V=m.Ya[P].H;if(0<L[1][V[1]+0].g||0<L[2][V[2]+0].g||0<L[3][V[3]+0].g)return 0}return 1}function de(m,P,L,V,ce,ve){if(m.Z!=0){var Ee=m.qd,Se=m.rd;for(e(dr[m.Z]!=null);P<L;++P)dr[m.Z](Ee,Se,V,ce,V,ce,ve),Ee=V,Se=ce,ce+=ve;m.qd=Ee,m.rd=Se}}function se(m,P){var L=m.l.ma,V=L.Z==0||L.Z==1?m.l.j:m.C,V=m.C<V?V:m.C;if(e(P<=m.l.o),P>V){var ce=m.l.width,ve=L.ca,Ee=L.tb+ce*V,Se=m.V,be=m.Ba+m.c*V,Ue=m.gc;e(m.ab==1),e(Ue[0].hc==3),la(Ue[0],V,P,Se,be,ve,Ee),de(L,V,P,ve,Ee,ce)}m.C=m.Ma=P}function ie(m,P,L,V,ce,ve,Ee){var Se=m.$/V,be=m.$%V,Ue=m.m,He=m.s,qe=L+m.$,je=qe;ce=L+V*ce;var $e=L+V*ve,Qe=280+He.ua,rt=m.Pb?Se:16777216,Ke=0<He.ua?He.Wa:null,et=He.wc,it=qe<$e?I(He,be,Se):null;e(m.C<ve),e($e<=ce);var ht=!1;e:for(;;){for(;ht||qe<$e;){var ot=0;if(Se>=rt){var rt=m,dt=qe-L;e(rt.Pb),rt.wd=rt.m,rt.xd=dt,0<rt.s.ua&&Me(rt.s.Wa,rt.s.vb),rt=Se+_a}if(be&et||(it=I(He,be,Se)),e(it!=null),it.Qb&&(P[qe]=it.qb,ht=!0),!ht)if(re(Ue),it.jc){var ot=Ue,dt=P,pt=qe,xt=it.pd[pe(ot)&en-1];e(it.jc),256>xt.g?(Te(ot,ot.u+xt.g),dt[pt]=xt.value,ot=0):(Te(ot,ot.u+xt.g-256),e(256<=xt.value),ot=xt.value),ot==0&&(ht=!0)}else ot=A(it.G[0],it.H[0],Ue);if(Ue.h)break;if(ht||256>ot){if(!ht)if(it.nd)P[qe]=(it.qb|ot<<8)>>>0;else{if(re(Ue),ht=A(it.G[1],it.H[1],Ue),re(Ue),dt=A(it.G[2],it.H[2],Ue),pt=A(it.G[3],it.H[3],Ue),Ue.h)break;P[qe]=(pt<<24|ht<<16|ot<<8|dt)>>>0}if(ht=!1,++qe,++be,be>=V&&(be=0,++Se,Ee!=null&&Se<=ve&&!(Se%16)&&Ee(m,Se),Ke!=null))for(;je<qe;)ot=P[je++],Ke.X[(506832829*ot&4294967295)>>>Ke.Mb]=ot}else if(280>ot){if(ot=G(ot-256,Ue),dt=A(it.G[4],it.H[4],Ue),re(Ue),dt=G(dt,Ue),dt=X(V,dt),Ue.h)break;if(qe-L<dt||ce-qe<ot)break e;for(pt=0;pt<ot;++pt)P[qe+pt]=P[qe+pt-dt];for(qe+=ot,be+=ot;be>=V;)be-=V,++Se,Ee!=null&&Se<=ve&&!(Se%16)&&Ee(m,Se);if(e(qe<=ce),be&et&&(it=I(He,be,Se)),Ke!=null)for(;je<qe;)ot=P[je++],Ke.X[(506832829*ot&4294967295)>>>Ke.Mb]=ot}else if(ot<Qe){for(ht=ot-280,e(Ke!=null);je<qe;)ot=P[je++],Ke.X[(506832829*ot&4294967295)>>>Ke.Mb]=ot;ot=qe,dt=Ke,e(!(ht>>>dt.Xa)),P[ot]=dt.X[ht],ht=!0}else break e;ht||e(Ue.h==R(Ue))}if(m.Pb&&Ue.h&&qe<ce)e(m.m.h),m.a=5,m.m=m.wd,m.$=m.xd,0<m.s.ua&&Me(m.s.vb,m.s.Wa);else{if(Ue.h)break e;Ee!=null&&Ee(m,Se>ve?ve:Se),m.a=0,m.$=qe-L}return 1}return m.a=3,0}function ge(m){e(m!=null),m.vc=null,m.yc=null,m.Ya=null;var P=m.Wa;P!=null&&(P.X=null),m.vb=null,e(m!=null)}function Pe(){var m=new Js;return m==null?null:(m.a=0,m.xb=xs,h("Predictor","VP8LPredictors"),h("Predictor","VP8LPredictors_C"),h("PredictorAdd","VP8LPredictorsAdd"),h("PredictorAdd","VP8LPredictorsAdd_C"),Wn=we,rn=Ie,Yn=Le,nn=Oe,sn=Ve,Jn=Xe,qn=We,self.VP8LMapColor32b=ha,self.VP8LMapColor8b=ua,m)}function Ye(m,P,L,V,ce){var ve=1,Ee=[m],Se=[P],be=V.m,Ue=V.s,He=null,qe=0;e:for(;;){if(L)for(;ve&&q(be,1);){var je=Ee,$e=Se,Qe=V,rt=1,Ke=Qe.m,et=Qe.gc[Qe.ab],it=q(Ke,2);if(Qe.Oc&1<<it)ve=0;else{switch(Qe.Oc|=1<<it,et.hc=it,et.Ea=je[0],et.nc=$e[0],et.K=[null],++Qe.ab,e(4>=Qe.ab),it){case 0:case 1:et.b=q(Ke,3)+2,rt=Ye(Fe(et.Ea,et.b),Fe(et.nc,et.b),0,Qe,et.K),et.K=et.K[0];break;case 3:var ht=q(Ke,8)+1,ot=16<ht?0:4<ht?1:2<ht?2:3;je[0]=Fe(et.Ea,ot),et.b=ot;var rt=Ye(ht,1,0,Qe,et.K),dt;if(dt=rt){var pt,xt=ht,wt=et,It=1<<(8>>wt.b),bt=a(It);if(bt==null)dt=0;else{var kt=wt.K[0],Ot=wt.w;for(bt[0]=wt.K[0][0],pt=1;pt<1*xt;++pt)bt[pt]=De(kt[Ot+pt],bt[pt-1]);for(;pt<4*It;++pt)bt[pt]=0;wt.K[0]=null,wt.K[0]=bt,dt=1}}rt=dt;break;case 2:break;default:e(0)}ve=rt}}if(Ee=Ee[0],Se=Se[0],ve&&q(be,1)&&(qe=q(be,4),ve=1<=qe&&11>=qe,!ve)){V.a=3;break e}var Zt;if(Zt=ve)r:{var Yt=V,or=Ee,Vt=Se,tr=qe,Rr=L,Jt,zt,gn=Yt.m,Qr=Yt.s,Dr=[null],Lr,Ur=1,_n=0,Ba=ga[tr];t:for(;;){if(Rr&&q(gn,1)){var mn=q(gn,3)+2,As=Fe(or,mn),Is=Fe(Vt,mn),Na=As*Is;if(!Ye(As,Is,0,Yt,Dr))break t;for(Dr=Dr[0],Qr.xc=mn,Jt=0;Jt<Na;++Jt){var xn=Dr[Jt]>>8&65535;Dr[Jt]=xn,xn>=Ur&&(Ur=xn+1)}}if(gn.h)break t;for(zt=0;5>zt;++zt){var Tr=is[zt];!zt&&0<tr&&(Tr+=1<<tr),_n<Tr&&(_n=Tr)}var yn=u(Ur*Ba,y),Rs=Ur,Ds=u(Rs,M);if(Ds==null)var Ii=null;else e(65536>=Rs),Ii=Ds;var ei=a(_n);if(Ii==null||ei==null||yn==null){Yt.a=1;break t}var Ri=yn;for(Jt=Lr=0;Jt<Ur;++Jt){var ar=Ii[Jt],Br=ar.G,Nr=ar.H,Ls=0,Di=1,Us=0;for(zt=0;5>zt;++zt){Tr=is[zt],Br[zt]=Ri,Nr[zt]=Lr,!zt&&0<tr&&(Tr+=1<<tr);n:{var Li,wn=Tr,Ui=Yt,ti=ei,Oa=Ri,za=Lr,En=0,pr=Ui.m,Ga=q(pr,1);if(o(ti,0,0,wn),Ga){var Za=q(pr,1)+1,Ha=q(pr,1),Pn=q(pr,Ha==0?1:8);ti[Pn]=1,Za==2&&(Pn=q(pr,8),ti[Pn]=1);var Bi=1}else{var Bs=a(19),Ns=q(pr,4)+4;if(19<Ns){Ui.a=3;var Ni=0;break n}for(Li=0;Li<Ns;++Li)Bs[da[Li]]=q(pr,3);var Oi=void 0,ri=void 0,Os=Ui,Va=Bs,zi=wn,zs=ti,Sn=0,gr=Os.m,Gs=8,Zs=u(128,y);i:for(;;){if(!g(Zs,0,7,Va,19))break i;if(q(gr,1)){var Wa=2+2*q(gr,3),Oi=2+q(gr,Wa);if(Oi>zi)break i}else Oi=zi;for(ri=0;ri<zi&&Oi--;){re(gr);var Hs=Zs[0+(pe(gr)&127)];Te(gr,gr.u+Hs.g);var Or=Hs.value;if(16>Or)zs[ri++]=Or,Or!=0&&(Gs=Or);else{var Xa=Or==16,Vs=Or-16,Ya=ca[Vs],Ws=q(gr,fa[Vs])+Ya;if(ri+Ws>zi)break i;for(var Ja=Xa?Gs:0;0<Ws--;)zs[ri++]=Ja}}Sn=1;break i}Sn||(Os.a=3),Bi=Sn}(Bi=Bi&&!pr.h)&&(En=g(Oa,za,8,ti,wn)),Bi&&En!=0?Ni=En:(Ui.a=3,Ni=0)}if(Ni==0)break t;if(Di&&va[zt]==1&&(Di=Ri[Lr].g==0),Ls+=Ri[Lr].g,Lr+=Ni,3>=zt){var Tn=ei[0],ii;for(ii=1;ii<Tr;++ii)ei[ii]>Tn&&(Tn=ei[ii]);Us+=Tn}}if(ar.nd=Di,ar.Qb=0,Di&&(ar.qb=(Br[3][Nr[3]+0].value<<24|Br[1][Nr[1]+0].value<<16|Br[2][Nr[2]+0].value)>>>0,Ls==0&&256>Br[0][Nr[0]+0].value&&(ar.Qb=1,ar.qb+=Br[0][Nr[0]+0].value<<8)),ar.jc=!ar.Qb&&6>Us,ar.jc){var Gi,ur=ar;for(Gi=0;Gi<en;++Gi){var _r=Gi,mr=ur.pd[_r],Zi=ur.G[0][ur.H[0]+_r];256<=Zi.value?(mr.g=Zi.g+256,mr.value=Zi.value):(mr.g=0,mr.value=0,_r>>=N(Zi,8,mr),_r>>=N(ur.G[1][ur.H[1]+_r],16,mr),_r>>=N(ur.G[2][ur.H[2]+_r],0,mr),N(ur.G[3][ur.H[3]+_r],24,mr))}}}Qr.vc=Dr,Qr.Wb=Ur,Qr.Ya=Ii,Qr.yc=yn,Zt=1;break r}Zt=0}if(ve=Zt,!ve){V.a=3;break e}if(0<qe){if(Ue.ua=1<<qe,!ae(Ue.Wa,qe)){V.a=1,ve=0;break e}}else Ue.ua=0;var Cn=V,Xs=Ee,qa=Se,Mn=Cn.s,Fn=Mn.xc;if(Cn.c=Xs,Cn.i=qa,Mn.md=Fe(Xs,Fn),Mn.wc=Fn==0?-1:(1<<Fn)-1,L){V.xb=Sa;break e}if(He=a(Ee*Se),He==null){V.a=1,ve=0;break e}ve=(ve=ie(V,He,0,Ee,Se,Se,null))&&!be.h;break e}return ve?(ce!=null?ce[0]=He:(e(He==null),e(L)),V.$=0,L||ge(Ue)):ge(Ue),ve}function Ge(m,P){var L=m.c*m.i,V=L+P+16*P;return e(m.c<=P),m.V=a(V),m.V==null?(m.Ta=null,m.Ua=0,m.a=1,0):(m.Ta=m.V,m.Ua=m.Ba+L+P,1)}function Ze(m,P){var L=m.C,V=P-L,ce=m.V,ve=m.Ba+m.c*L;for(e(P<=m.l.o);0<V;){var Ee=16<V?16:V,Se=m.l.ma,be=m.l.width,Ue=be*Ee,He=Se.ca,qe=Se.tb+be*L,je=m.Ta,$e=m.Ua;te(m,Ee,ce,ve),Es(je,$e,He,qe,Ue),de(Se,L,L+Ee,He,qe,be),V-=Ee,ce+=Ee*m.c,L+=Ee}e(L==P),m.C=m.Ma=P}function Je(m,P){var L=[0],V=[0],ce=[0];e:for(;;){if(m==null)return 0;if(P==null)return m.a=2,0;if(m.l=P,m.a=0,J(m.m,P.data,P.w,P.ha),!z(m.m,L,V,ce)){m.a=3;break e}if(m.xb=xs,P.width=L[0],P.height=V[0],!Ye(L[0],V[0],1,m,null))break e;return 1}return e(m.a!=0),0}function tt(){this.ub=this.yd=this.td=this.Rb=0}function nt(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function at(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function ut(){this.Yb=l()}function st(){this.jb=a(3),this.Wc=v([4,8],ut),this.Xc=v([4,17],ut)}function gt(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function ft(){this.ld=this.La=this.dd=this.tc=0}function ct(){this.Na=this.la=0}function _t(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Et(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function mt(){this.uc=this.M=this.Nb=0,this.wa=Array(new ft),this.Y=0,this.ya=Array(new Et),this.aa=0,this.l=new Rt}function vt(){this.y=a(16),this.f=a(8),this.ea=a(8)}function lt(){this.cb=this.a=0,this.sc="",this.m=new O,this.Od=new tt,this.Kc=new nt,this.ed=new gt,this.Qa=new at,this.Ic=this.$c=this.Aa=0,this.D=new mt,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=u(8,O),this.ia=0,new p,this.pb=u(4,_t),this.Pa=new st,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new vt),this.Hd=0,this.rb=Array(new ct),this.sb=0,this.wa=Array(new ft),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Et),this.L=this.aa=0,this.gd=v([4,2],ft),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function St(m,P){return 0>m?0:m>P?P:m}function Rt(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Bt(){var m=new lt;return m!=null&&(m.a=0,m.sc="OK",m.cb=0,m.Xb=0,Kr||(Kr=Ct)),m}function yt(m,P,L){return m.a==0&&(m.a=P,m.sc=L,m.cb=0),0}function Ut(m,P,L){return 3<=L&&m[P+0]==157&&m[P+1]==1&&m[P+2]==42}function Dt(m,P){if(m==null)return 0;if(m.a=0,m.sc="OK",P==null)return yt(m,2,"null VP8Io passed to VP8GetHeaders()");var L=P.data,V=P.w,ce=P.ha;if(4>ce)return yt(m,7,"Truncated header.");var ve=L[V+0]|L[V+1]<<8|L[V+2]<<16,Ee=m.Od;if(Ee.Rb=!(ve&1),Ee.td=ve>>1&7,Ee.yd=ve>>4&1,Ee.ub=ve>>5,3<Ee.td)return yt(m,3,"Incorrect keyframe parameters.");if(!Ee.yd)return yt(m,4,"Frame not displayable.");V+=3,ce-=3;var Se=m.Kc;if(Ee.Rb){if(7>ce)return yt(m,7,"cannot parse picture header");if(!Ut(L,V,ce))return yt(m,3,"Bad code word");Se.c=(L[V+4]<<8|L[V+3])&16383,Se.Td=L[V+4]>>6,Se.i=(L[V+6]<<8|L[V+5])&16383,Se.Ud=L[V+6]>>6,V+=7,ce-=7,m.za=Se.c+15>>4,m.Ub=Se.i+15>>4,P.width=Se.c,P.height=Se.i,P.Da=0,P.j=0,P.v=0,P.va=P.width,P.o=P.height,P.da=0,P.ib=P.width,P.hb=P.height,P.U=P.width,P.T=P.height,ve=m.Pa,o(ve.jb,0,255,ve.jb.length),ve=m.Qa,e(ve!=null),ve.Cb=0,ve.Bb=0,ve.Fb=1,o(ve.Zb,0,0,ve.Zb.length),o(ve.Lb,0,0,ve.Lb)}if(Ee.ub>ce)return yt(m,7,"bad partition length");ve=m.m,T(ve,L,V,Ee.ub),V+=Ee.ub,ce-=Ee.ub,Ee.Rb&&(Se.Ld=me(ve),Se.Kd=me(ve)),Se=m.Qa;var be=m.Pa,Ue;if(e(ve!=null),e(Se!=null),Se.Cb=me(ve),Se.Cb){if(Se.Bb=me(ve),me(ve)){for(Se.Fb=me(ve),Ue=0;4>Ue;++Ue)Se.Zb[Ue]=me(ve)?H(ve,7):0;for(Ue=0;4>Ue;++Ue)Se.Lb[Ue]=me(ve)?H(ve,6):0}if(Se.Bb)for(Ue=0;3>Ue;++Ue)be.jb[Ue]=me(ve)?B(ve,8):255}else Se.Bb=0;if(ve.Ka)return yt(m,3,"cannot parse segment header");if(Se=m.ed,Se.zd=me(ve),Se.Tb=B(ve,6),Se.wb=B(ve,3),Se.Pc=me(ve),Se.Pc&&me(ve)){for(be=0;4>be;++be)me(ve)&&(Se.vd[be]=H(ve,6));for(be=0;4>be;++be)me(ve)&&(Se.od[be]=H(ve,6))}if(m.L=Se.Tb==0?0:Se.zd?1:2,ve.Ka)return yt(m,3,"cannot parse filter header");Ue=V;var He=ce;if(ce=Ue,V=Ue+He,Se=He,m.Xb=(1<<B(m.m,2))-1,be=m.Xb,He<3*be)L=7;else{for(Ue+=3*be,Se-=3*be,He=0;He<be;++He){var qe=L[ce+0]|L[ce+1]<<8|L[ce+2]<<16;qe>Se&&(qe=Se),T(m.Jc[+He],L,Ue,qe),Ue+=qe,Se-=qe,ce+=3}T(m.Jc[+be],L,Ue,Se),L=Ue<V?0:5}if(L!=0)return yt(m,L,"cannot parse partitions");for(Ue=m.m,L=B(Ue,7),ce=me(Ue)?H(Ue,4):0,V=me(Ue)?H(Ue,4):0,Se=me(Ue)?H(Ue,4):0,be=me(Ue)?H(Ue,4):0,Ue=me(Ue)?H(Ue,4):0,He=m.Qa,qe=0;4>qe;++qe){if(He.Cb){var je=He.Zb[qe];He.Fb||(je+=L)}else if(0<qe){m.pb[qe]=m.pb[0];continue}else je=L;var $e=m.pb[qe];$e.Sc[0]=fn[St(je+ce,127)],$e.Sc[1]=cn[St(je+0,127)],$e.Eb[0]=2*fn[St(je+V,127)],$e.Eb[1]=101581*cn[St(je+Se,127)]>>16,8>$e.Eb[1]&&($e.Eb[1]=8),$e.Qc[0]=fn[St(je+be,117)],$e.Qc[1]=cn[St(je+Ue,127)],$e.lc=je+Ue}if(!Ee.Rb)return yt(m,4,"Not a key frame.");for(me(ve),Ee=m.Pa,L=0;4>L;++L){for(ce=0;8>ce;++ce)for(V=0;3>V;++V)for(Se=0;11>Se;++Se)be=ue(ve,Ea[L][ce][V][Se])?B(ve,8):ya[L][ce][V][Se],Ee.Wc[L][ce].Yb[V][Se]=be;for(ce=0;17>ce;++ce)Ee.Xc[L][ce]=Ee.Wc[L][Pa[ce]]}return m.kc=me(ve),m.kc&&(m.Bd=B(ve,8)),m.cb=1}function Ct(m,P,L,V,ce,ve,Ee){var Se=P[ce].Yb[L];for(L=0;16>ce;++ce){if(!ue(m,Se[L+0]))return ce;for(;!ue(m,Se[L+1]);)if(Se=P[++ce].Yb[0],L=0,ce==16)return 16;var be=P[ce+1].Yb;if(ue(m,Se[L+2])){var Ue=m,qe=Se,je=L,He=0;if(ue(Ue,qe[je+3]))if(ue(Ue,qe[je+6])){for(Se=0,He=ue(Ue,qe[je+8]),qe=ue(Ue,qe[je+9+He]),je=2*He+qe,He=0,qe=ma[je];qe[Se];++Se)He+=He+ue(Ue,qe[Se]);He+=3+(8<<je)}else ue(Ue,qe[je+7])?(He=7+2*ue(Ue,165),He+=ue(Ue,145)):He=5+ue(Ue,159);else ue(Ue,qe[je+4])?He=3+ue(Ue,qe[je+5]):He=2;Se=be[2]}else He=1,Se=be[1];be=Ee+xa[ce],Ue=m,0>Ue.b&&oe(Ue);var qe=Ue.b,je=Ue.Ca>>1,$e=je-(Ue.I>>qe)>>31;--Ue.b,Ue.Ca+=$e,Ue.Ca|=1,Ue.I-=(je+1&$e)<<qe,ve[be]=((He^$e)-$e)*V[(0<ce)+0]}return 16}function Wt(m){var P=m.rb[m.sb-1];P.la=0,P.Na=0,o(m.zc,0,0,m.zc.length),m.ja=0}function Kt(m,P){for(m.M=0;m.M<m.Va;++m.M){var L=m.Jc[m.M&m.Xb],V=m.m,ce=m,ve;for(ve=0;ve<ce.za;++ve){var Ee=V,Se=ce,be=Se.Ac,Ue=Se.Bc+4*ve,He=Se.zc,qe=Se.ya[Se.aa+ve];if(Se.Qa.Bb?qe.$b=ue(Ee,Se.Pa.jb[0])?2+ue(Ee,Se.Pa.jb[2]):ue(Ee,Se.Pa.jb[1]):qe.$b=0,Se.kc&&(qe.Ad=ue(Ee,Se.Bd)),qe.Za=!ue(Ee,145)+0,qe.Za){var je=qe.Ob,$e=0;for(Se=0;4>Se;++Se){var Qe=He[0+Se],rt;for(rt=0;4>rt;++rt){Qe=wa[be[Ue+rt]][Qe];for(var Ke=ns[ue(Ee,Qe[0])];0<Ke;)Ke=ns[2*Ke+ue(Ee,Qe[Ke])];Qe=-Ke,be[Ue+rt]=Qe}s(je,$e,be,Ue,4),$e+=4,He[0+Se]=Qe}}else Qe=ue(Ee,156)?ue(Ee,128)?1:3:ue(Ee,163)?2:0,qe.Ob[0]=Qe,o(be,Ue,Qe,4),o(He,0,Qe,4);qe.Dd=ue(Ee,142)?ue(Ee,114)?ue(Ee,183)?1:3:2:0}if(ce.m.Ka)return yt(m,7,"Premature end-of-partition0 encountered.");for(;m.ja<m.za;++m.ja){if(V=m,ce=L,Ee=V.rb[V.sb-1],be=V.rb[V.sb+V.ja],ve=V.ya[V.aa+V.ja],Ue=V.kc?ve.Ad:0)Ee.la=be.la=0,ve.Za||(Ee.Na=be.Na=0),ve.Hc=0,ve.Gc=0,ve.ia=0;else{var et,it,Ee=be,be=ce,Ue=V.Pa.Xc,He=V.ya[V.aa+V.ja],qe=V.pb[He.$b];if(Se=He.ad,je=0,$e=V.rb[V.sb-1],Qe=rt=0,o(Se,je,0,384),He.Za)var ht=0,ot=Ue[3];else{Ke=a(16);var dt=Ee.Na+$e.Na;if(dt=Kr(be,Ue[1],dt,qe.Eb,0,Ke,0),Ee.Na=$e.Na=(0<dt)+0,1<dt)ss(Ke,0,Se,je);else{var pt=Ke[0]+3>>3;for(Ke=0;256>Ke;Ke+=16)Se[je+Ke]=pt}ht=1,ot=Ue[0]}var xt=Ee.la&15,wt=$e.la&15;for(Ke=0;4>Ke;++Ke){var It=wt&1;for(pt=it=0;4>pt;++pt)dt=It+(xt&1),dt=Kr(be,ot,dt,qe.Sc,ht,Se,je),It=dt>ht,xt=xt>>1|It<<7,it=it<<2|(3<dt?3:1<dt?2:Se[je+0]!=0),je+=16;xt>>=4,wt=wt>>1|It<<7,rt=(rt<<8|it)>>>0}for(ot=xt,ht=wt>>4,et=0;4>et;et+=2){for(it=0,xt=Ee.la>>4+et,wt=$e.la>>4+et,Ke=0;2>Ke;++Ke){for(It=wt&1,pt=0;2>pt;++pt)dt=It+(xt&1),dt=Kr(be,Ue[2],dt,qe.Qc,0,Se,je),It=0<dt,xt=xt>>1|It<<3,it=it<<2|(3<dt?3:1<dt?2:Se[je+0]!=0),je+=16;xt>>=2,wt=wt>>1|It<<5}Qe|=it<<4*et,ot|=xt<<4<<et,ht|=(wt&240)<<et}Ee.la=ot,$e.la=ht,He.Hc=rt,He.Gc=Qe,He.ia=Qe&43690?0:qe.ia,Ue=!(rt|Qe)}if(0<V.L&&(V.wa[V.Y+V.ja]=V.gd[ve.$b][ve.Za],V.wa[V.Y+V.ja].La|=!Ue),ce.Ka)return yt(m,7,"Premature end-of-file encountered.")}if(Wt(m),L=m,V=P,ce=1,ve=L.D,Ee=0<L.L&&L.M>=L.zb&&L.M<=L.Va,L.Aa==0)e:{if(ve.M=L.M,ve.uc=Ee,Nn(L,ve),ce=1,it=L.D,ve=it.Nb,Qe=Ai[L.L],Ee=Qe*L.R,be=Qe/2*L.B,Ke=16*ve*L.R,pt=8*ve*L.B,Ue=L.sa,He=L.ta-Ee+Ke,qe=L.qa,Se=L.ra-be+pt,je=L.Ha,$e=L.Ia-be+pt,xt=it.M,wt=xt==0,rt=xt>=L.Va-1,L.Aa==2&&Nn(L,it),it.uc)for(dt=L,It=dt.D.M,e(dt.D.uc),it=dt.yb;it<dt.Hb;++it){var bt=dt;ht=it,ot=It;var kt=bt.D,Ot=kt.Nb;et=bt.R;var kt=kt.wa[kt.Y+ht],Zt=bt.sa,Yt=bt.ta+16*Ot*et+16*ht,or=kt.dd,Vt=kt.tc;if(Vt!=0)if(e(3<=Vt),bt.L==1)0<ht&&gs(Zt,Yt,et,Vt+4),kt.La&&ms(Zt,Yt,et,Vt),0<ot&&ps(Zt,Yt,et,Vt+4),kt.La&&_s(Zt,Yt,et,Vt);else{var tr=bt.B,Rr=bt.qa,Jt=bt.ra+8*Ot*tr+8*ht,zt=bt.Ha,bt=bt.Ia+8*Ot*tr+8*ht,Ot=kt.ld;0<ht&&(hs(Zt,Yt,et,Vt+4,or,Ot),us(Rr,Jt,zt,bt,tr,Vt+4,or,Ot)),kt.La&&(cs(Zt,Yt,et,Vt,or,Ot),ds(Rr,Jt,zt,bt,tr,Vt,or,Ot)),0<ot&&(os(Zt,Yt,et,Vt+4,or,Ot),ls(Rr,Jt,zt,bt,tr,Vt+4,or,Ot)),kt.La&&(fs(Zt,Yt,et,Vt,or,Ot),vs(Rr,Jt,zt,bt,tr,Vt,or,Ot))}}if(L.ia&&alert("todo:DitherRow"),V.put!=null){if(it=16*xt,xt=16*(xt+1),wt?(V.y=L.sa,V.O=L.ta+Ke,V.f=L.qa,V.N=L.ra+pt,V.ea=L.Ha,V.W=L.Ia+pt):(it-=Qe,V.y=Ue,V.O=He,V.f=qe,V.N=Se,V.ea=je,V.W=$e),rt||(xt-=Qe),xt>V.o&&(xt=V.o),V.F=null,V.J=null,L.Fa!=null&&0<L.Fa.length&&it<xt&&(V.J=js(L,V,it,xt-it),V.F=L.mb,V.F==null&&V.F.length==0)){ce=yt(L,3,"Could not decode alpha data.");break e}it<V.j&&(Qe=V.j-it,it=V.j,e(!(Qe&1)),V.O+=L.R*Qe,V.N+=L.B*(Qe>>1),V.W+=L.B*(Qe>>1),V.F!=null&&(V.J+=V.width*Qe)),it<xt&&(V.O+=V.v,V.N+=V.v>>1,V.W+=V.v>>1,V.F!=null&&(V.J+=V.v),V.ka=it-V.j,V.U=V.va-V.v,V.T=xt-it,ce=V.put(V))}ve+1!=L.Ic||rt||(s(L.sa,L.ta-Ee,Ue,He+16*L.R,Ee),s(L.qa,L.ra-be,qe,Se+8*L.B,be),s(L.Ha,L.Ia-be,je,$e+8*L.B,be))}if(!ce)return yt(m,6,"Output aborted.")}return 1}function $t(m,P){if(m==null)return 0;if(P==null)return yt(m,2,"NULL VP8Io parameter in VP8Decode().");if(!m.cb&&!Dt(m,P))return 0;if(e(m.cb),P.ac==null||P.ac(P)){P.ob&&(m.L=0);var L=Ai[m.L];if(m.L==2?(m.yb=0,m.zb=0):(m.yb=P.v-L>>4,m.zb=P.j-L>>4,0>m.yb&&(m.yb=0),0>m.zb&&(m.zb=0)),m.Va=P.o+15+L>>4,m.Hb=P.va+15+L>>4,m.Hb>m.za&&(m.Hb=m.za),m.Va>m.Ub&&(m.Va=m.Ub),0<m.L){var V=m.ed;for(L=0;4>L;++L){var ce;if(m.Qa.Cb){var ve=m.Qa.Lb[L];m.Qa.Fb||(ve+=V.Tb)}else ve=V.Tb;for(ce=0;1>=ce;++ce){var Ee=m.gd[L][ce],Se=ve;if(V.Pc&&(Se+=V.vd[0],ce&&(Se+=V.od[0])),Se=0>Se?0:63<Se?63:Se,0<Se){var be=Se;0<V.wb&&(be=4<V.wb?be>>2:be>>1,be>9-V.wb&&(be=9-V.wb)),1>be&&(be=1),Ee.dd=be,Ee.tc=2*Se+be,Ee.ld=40<=Se?2:15<=Se?1:0}else Ee.tc=0;Ee.La=ce}}}L=0}else yt(m,6,"Frame setup failed"),L=m.a;if(L=L==0){if(L){m.$c=0,0<m.Aa||(m.Ic=Ua);e:{L=m.Ic;var be=m.za,V=4*be,Ue=32*be,He=be+1,qe=0<m.L?be*(0<m.Aa?2:1):0,je=(m.Aa==2?2:1)*be;if(ce=3*(16*L+Ai[m.L])/2*Ue,ve=m.Fa!=null&&0<m.Fa.length?m.Kc.c*m.Kc.i:0,Ee=V+832+ce+ve,Ee!=Ee)L=0;else{if(Ee>m.Vb){if(m.Vb=0,m.Ec=a(Ee),m.Fc=0,m.Ec==null){L=yt(m,1,"no memory during frame initialization.");break e}m.Vb=Ee}Ee=m.Ec,Se=m.Fc,m.Ac=Ee,m.Bc=Se,Se+=V,m.Gd=u(Ue,vt),m.Hd=0,m.rb=u(He+1,ct),m.sb=1,m.wa=qe?u(qe,ft):null,m.Y=0,m.D.Nb=0,m.D.wa=m.wa,m.D.Y=m.Y,0<m.Aa&&(m.D.Y+=be),e(!0),m.oc=Ee,m.pc=Se,Se+=832,m.ya=u(je,Et),m.aa=0,m.D.ya=m.ya,m.D.aa=m.aa,m.Aa==2&&(m.D.aa+=be),m.R=16*be,m.B=8*be,Ue=Ai[m.L],be=Ue*m.R,Ue=Ue/2*m.B,m.sa=Ee,m.ta=Se+be,m.qa=m.sa,m.ra=m.ta+16*L*m.R+Ue,m.Ha=m.qa,m.Ia=m.ra+8*L*m.B+Ue,m.$c=0,Se+=ce,m.mb=ve?Ee:null,m.nb=ve?Se:null,e(Se+ve<=m.Fc+m.Vb),Wt(m),o(m.Ac,m.Bc,0,V),L=1}}if(L){if(P.ka=0,P.y=m.sa,P.O=m.ta,P.f=m.qa,P.N=m.ra,P.ea=m.Ha,P.Vd=m.Ia,P.fa=m.R,P.Rc=m.B,P.F=null,P.J=0,!es){for(L=-255;255>=L;++L)Kn[255+L]=0>L?-L:L;for(L=-1020;1020>=L;++L)$n[1020+L]=-128>L?-128:127<L?127:L;for(L=-112;112>=L;++L)jn[112+L]=-16>L?-16:15<L?15:L;for(L=-255;510>=L;++L)Qn[255+L]=0>L?0:255<L?255:L;es=1}ss=fr,Fi=zr,vn=Hi,Ir=Vi,dn=Wi,as=rr,os=bn,hs=Xr,ls=Yr,us=Jr,fs=di,cs=pi,vs=Ki,ds=kr,ps=Vr,gs=Wr,_s=jt,ms=vi,sr[0]=Yi,sr[1]=si,sr[2]=ai,sr[3]=Zr,sr[4]=oi,sr[5]=cr,sr[6]=Mr,sr[7]=Hr,sr[8]=qi,sr[9]=Ji,vr[0]=Ht,vr[1]=Xi,vr[2]=ir,vr[3]=Cr,vr[4]=Mt,vr[5]=At,vr[6]=Lt,lr[0]=li,lr[1]=Gr,lr[2]=hi,lr[3]=nr,lr[4]=Fr,lr[5]=ui,lr[6]=br,L=1}else L=0}L&&(L=Kt(m,P)),P.bc!=null&&P.bc(P),L&=1}return L?(m.cb=0,L):0}function Ft(m,P,L,V,ce){ce=m[P+L+32*V]+(ce>>3),m[P+L+32*V]=ce&-256?0>ce?0:255:ce}function Gt(m,P,L,V,ce,ve){Ft(m,P,0,L,V+ce),Ft(m,P,1,L,V+ve),Ft(m,P,2,L,V-ve),Ft(m,P,3,L,V-ce)}function Nt(m){return(20091*m>>16)+m}function hr(m,P,L,V){var ce=0,ve,Ee=a(16);for(ve=0;4>ve;++ve){var Se=m[P+0]+m[P+8],be=m[P+0]-m[P+8],Ue=(35468*m[P+4]>>16)-Nt(m[P+12]),He=Nt(m[P+4])+(35468*m[P+12]>>16);Ee[ce+0]=Se+He,Ee[ce+1]=be+Ue,Ee[ce+2]=be-Ue,Ee[ce+3]=Se-He,ce+=4,P++}for(ve=ce=0;4>ve;++ve)m=Ee[ce+0]+4,Se=m+Ee[ce+8],be=m-Ee[ce+8],Ue=(35468*Ee[ce+4]>>16)-Nt(Ee[ce+12]),He=Nt(Ee[ce+4])+(35468*Ee[ce+12]>>16),Ft(L,V,0,0,Se+He),Ft(L,V,1,0,be+Ue),Ft(L,V,2,0,be-Ue),Ft(L,V,3,0,Se-He),ce++,V+=32}function rr(m,P,L,V){var ce=m[P+0]+4,ve=35468*m[P+4]>>16,Ee=Nt(m[P+4]),Se=35468*m[P+1]>>16;m=Nt(m[P+1]),Gt(L,V,0,ce+Ee,m,Se),Gt(L,V,1,ce+ve,m,Se),Gt(L,V,2,ce-ve,m,Se),Gt(L,V,3,ce-Ee,m,Se)}function zr(m,P,L,V,ce){hr(m,P,L,V),ce&&hr(m,P+16,L,V+4)}function Hi(m,P,L,V){Fi(m,P+0,L,V,1),Fi(m,P+32,L,V+128,1)}function Vi(m,P,L,V){m=m[P+0]+4;var ce;for(ce=0;4>ce;++ce)for(P=0;4>P;++P)Ft(L,V,P,ce,m)}function Wi(m,P,L,V){m[P+0]&&Ir(m,P+0,L,V),m[P+16]&&Ir(m,P+16,L,V+4),m[P+32]&&Ir(m,P+32,L,V+128),m[P+48]&&Ir(m,P+48,L,V+128+4)}function fr(m,P,L,V){var ce=a(16),ve;for(ve=0;4>ve;++ve){var Ee=m[P+0+ve]+m[P+12+ve],Se=m[P+4+ve]+m[P+8+ve],be=m[P+4+ve]-m[P+8+ve],Ue=m[P+0+ve]-m[P+12+ve];ce[0+ve]=Ee+Se,ce[8+ve]=Ee-Se,ce[4+ve]=Ue+be,ce[12+ve]=Ue-be}for(ve=0;4>ve;++ve)m=ce[0+4*ve]+3,Ee=m+ce[3+4*ve],Se=ce[1+4*ve]+ce[2+4*ve],be=ce[1+4*ve]-ce[2+4*ve],Ue=m-ce[3+4*ve],L[V+0]=Ee+Se>>3,L[V+16]=Ue+be>>3,L[V+32]=Ee-Se>>3,L[V+48]=Ue-be>>3,V+=64}function ni(m,P,L){var V=P-32,ce=qt,ve=255-m[V-1],Ee;for(Ee=0;Ee<L;++Ee){var Se=ce,be=ve+m[P-1],Ue;for(Ue=0;Ue<L;++Ue)m[P+Ue]=Se[be+m[V+Ue]];P+=32}}function si(m,P){ni(m,P,4)}function Gr(m,P){ni(m,P,8)}function Xi(m,P){ni(m,P,16)}function ir(m,P){var L;for(L=0;16>L;++L)s(m,P+32*L,m,P-32,16)}function Cr(m,P){var L;for(L=16;0<L;--L)o(m,P,m[P-1],16),P+=32}function Xt(m,P,L){var V;for(V=0;16>V;++V)o(P,L+32*V,m,16)}function Ht(m,P){var L=16,V;for(V=0;16>V;++V)L+=m[P-1+32*V]+m[P+V-32];Xt(L>>5,m,P)}function Mt(m,P){var L=8,V;for(V=0;16>V;++V)L+=m[P-1+32*V];Xt(L>>4,m,P)}function At(m,P){var L=8,V;for(V=0;16>V;++V)L+=m[P+V-32];Xt(L>>4,m,P)}function Lt(m,P){Xt(128,m,P)}function Pt(m,P,L){return m+2*P+L+2>>2}function ai(m,P){var L=P-32,L=new Uint8Array([Pt(m[L-1],m[L+0],m[L+1]),Pt(m[L+0],m[L+1],m[L+2]),Pt(m[L+1],m[L+2],m[L+3]),Pt(m[L+2],m[L+3],m[L+4])]),V;for(V=0;4>V;++V)s(m,P+32*V,L,0,L.length)}function Zr(m,P){var L=m[P-1],V=m[P-1+32],ce=m[P-1+64],ve=m[P-1+96];$(m,P+0,16843009*Pt(m[P-1-32],L,V)),$(m,P+32,16843009*Pt(L,V,ce)),$(m,P+64,16843009*Pt(V,ce,ve)),$(m,P+96,16843009*Pt(ce,ve,ve))}function Yi(m,P){var L=4,V;for(V=0;4>V;++V)L+=m[P+V-32]+m[P-1+32*V];for(L>>=3,V=0;4>V;++V)o(m,P+32*V,L,4)}function oi(m,P){var L=m[P-1+0],V=m[P-1+32],ce=m[P-1+64],ve=m[P-1-32],Ee=m[P+0-32],Se=m[P+1-32],be=m[P+2-32],Ue=m[P+3-32];m[P+0+96]=Pt(V,ce,m[P-1+96]),m[P+1+96]=m[P+0+64]=Pt(L,V,ce),m[P+2+96]=m[P+1+64]=m[P+0+32]=Pt(ve,L,V),m[P+3+96]=m[P+2+64]=m[P+1+32]=m[P+0+0]=Pt(Ee,ve,L),m[P+3+64]=m[P+2+32]=m[P+1+0]=Pt(Se,Ee,ve),m[P+3+32]=m[P+2+0]=Pt(be,Se,Ee),m[P+3+0]=Pt(Ue,be,Se)}function Mr(m,P){var L=m[P+1-32],V=m[P+2-32],ce=m[P+3-32],ve=m[P+4-32],Ee=m[P+5-32],Se=m[P+6-32],be=m[P+7-32];m[P+0+0]=Pt(m[P+0-32],L,V),m[P+1+0]=m[P+0+32]=Pt(L,V,ce),m[P+2+0]=m[P+1+32]=m[P+0+64]=Pt(V,ce,ve),m[P+3+0]=m[P+2+32]=m[P+1+64]=m[P+0+96]=Pt(ce,ve,Ee),m[P+3+32]=m[P+2+64]=m[P+1+96]=Pt(ve,Ee,Se),m[P+3+64]=m[P+2+96]=Pt(Ee,Se,be),m[P+3+96]=Pt(Se,be,be)}function cr(m,P){var L=m[P-1+0],V=m[P-1+32],ce=m[P-1+64],ve=m[P-1-32],Ee=m[P+0-32],Se=m[P+1-32],be=m[P+2-32],Ue=m[P+3-32];m[P+0+0]=m[P+1+64]=ve+Ee+1>>1,m[P+1+0]=m[P+2+64]=Ee+Se+1>>1,m[P+2+0]=m[P+3+64]=Se+be+1>>1,m[P+3+0]=be+Ue+1>>1,m[P+0+96]=Pt(ce,V,L),m[P+0+64]=Pt(V,L,ve),m[P+0+32]=m[P+1+96]=Pt(L,ve,Ee),m[P+1+32]=m[P+2+96]=Pt(ve,Ee,Se),m[P+2+32]=m[P+3+96]=Pt(Ee,Se,be),m[P+3+32]=Pt(Se,be,Ue)}function Hr(m,P){var L=m[P+0-32],V=m[P+1-32],ce=m[P+2-32],ve=m[P+3-32],Ee=m[P+4-32],Se=m[P+5-32],be=m[P+6-32],Ue=m[P+7-32];m[P+0+0]=L+V+1>>1,m[P+1+0]=m[P+0+64]=V+ce+1>>1,m[P+2+0]=m[P+1+64]=ce+ve+1>>1,m[P+3+0]=m[P+2+64]=ve+Ee+1>>1,m[P+0+32]=Pt(L,V,ce),m[P+1+32]=m[P+0+96]=Pt(V,ce,ve),m[P+2+32]=m[P+1+96]=Pt(ce,ve,Ee),m[P+3+32]=m[P+2+96]=Pt(ve,Ee,Se),m[P+3+64]=Pt(Ee,Se,be),m[P+3+96]=Pt(Se,be,Ue)}function Ji(m,P){var L=m[P-1+0],V=m[P-1+32],ce=m[P-1+64],ve=m[P-1+96];m[P+0+0]=L+V+1>>1,m[P+2+0]=m[P+0+32]=V+ce+1>>1,m[P+2+32]=m[P+0+64]=ce+ve+1>>1,m[P+1+0]=Pt(L,V,ce),m[P+3+0]=m[P+1+32]=Pt(V,ce,ve),m[P+3+32]=m[P+1+64]=Pt(ce,ve,ve),m[P+3+64]=m[P+2+64]=m[P+0+96]=m[P+1+96]=m[P+2+96]=m[P+3+96]=ve}function qi(m,P){var L=m[P-1+0],V=m[P-1+32],ce=m[P-1+64],ve=m[P-1+96],Ee=m[P-1-32],Se=m[P+0-32],be=m[P+1-32],Ue=m[P+2-32];m[P+0+0]=m[P+2+32]=L+Ee+1>>1,m[P+0+32]=m[P+2+64]=V+L+1>>1,m[P+0+64]=m[P+2+96]=ce+V+1>>1,m[P+0+96]=ve+ce+1>>1,m[P+3+0]=Pt(Se,be,Ue),m[P+2+0]=Pt(Ee,Se,be),m[P+1+0]=m[P+3+32]=Pt(L,Ee,Se),m[P+1+32]=m[P+3+64]=Pt(V,L,Ee),m[P+1+64]=m[P+3+96]=Pt(ce,V,L),m[P+1+96]=Pt(ve,ce,V)}function hi(m,P){var L;for(L=0;8>L;++L)s(m,P+32*L,m,P-32,8)}function nr(m,P){var L;for(L=0;8>L;++L)o(m,P,m[P-1],8),P+=32}function xr(m,P,L){var V;for(V=0;8>V;++V)o(P,L+32*V,m,8)}function li(m,P){var L=8,V;for(V=0;8>V;++V)L+=m[P+V-32]+m[P-1+32*V];xr(L>>4,m,P)}function ui(m,P){var L=4,V;for(V=0;8>V;++V)L+=m[P+V-32];xr(L>>3,m,P)}function Fr(m,P){var L=4,V;for(V=0;8>V;++V)L+=m[P-1+32*V];xr(L>>3,m,P)}function br(m,P){xr(128,m,P)}function yr(m,P,L){var V=m[P-L],ce=m[P+0],ve=3*(ce-V)+an[1020+m[P-2*L]-m[P+L]],Ee=Ei[112+(ve+4>>3)];m[P-L]=qt[255+V+Ei[112+(ve+3>>3)]],m[P+0]=qt[255+ce-Ee]}function fi(m,P,L,V){var ce=m[P+0],ve=m[P+L];return Qt[255+m[P-2*L]-m[P-L]]>V||Qt[255+ve-ce]>V}function Tt(m,P,L,V){return 4*Qt[255+m[P-L]-m[P+0]]+Qt[255+m[P-2*L]-m[P+L]]<=V}function ci(m,P,L,V,ce){var ve=m[P-3*L],Ee=m[P-2*L],Se=m[P-L],be=m[P+0],Ue=m[P+L],He=m[P+2*L],qe=m[P+3*L];return 4*Qt[255+Se-be]+Qt[255+Ee-Ue]>V?0:Qt[255+m[P-4*L]-ve]<=ce&&Qt[255+ve-Ee]<=ce&&Qt[255+Ee-Se]<=ce&&Qt[255+qe-He]<=ce&&Qt[255+He-Ue]<=ce&&Qt[255+Ue-be]<=ce}function Vr(m,P,L,V){var ce=2*V+1;for(V=0;16>V;++V)Tt(m,P+V,L,ce)&&yr(m,P+V,L)}function Wr(m,P,L,V){var ce=2*V+1;for(V=0;16>V;++V)Tt(m,P+V*L,1,ce)&&yr(m,P+V*L,1)}function jt(m,P,L,V){var ce;for(ce=3;0<ce;--ce)P+=4*L,Vr(m,P,L,V)}function vi(m,P,L,V){var ce;for(ce=3;0<ce;--ce)P+=4,Wr(m,P,L,V)}function wr(m,P,L,V,ce,ve,Ee,Se){for(ve=2*ve+1;0<ce--;){if(ci(m,P,L,ve,Ee))if(fi(m,P,L,Se))yr(m,P,L);else{var be=m,Ue=P,He=L,qe=be[Ue-2*He],je=be[Ue-He],$e=be[Ue+0],Qe=be[Ue+He],rt=be[Ue+2*He],Ke=an[1020+3*($e-je)+an[1020+qe-Qe]],et=27*Ke+63>>7,it=18*Ke+63>>7,Ke=9*Ke+63>>7;be[Ue-3*He]=qt[255+be[Ue-3*He]+Ke],be[Ue-2*He]=qt[255+qe+it],be[Ue-He]=qt[255+je+et],be[Ue+0]=qt[255+$e-et],be[Ue+He]=qt[255+Qe-it],be[Ue+2*He]=qt[255+rt-Ke]}P+=V}}function Er(m,P,L,V,ce,ve,Ee,Se){for(ve=2*ve+1;0<ce--;){if(ci(m,P,L,ve,Ee))if(fi(m,P,L,Se))yr(m,P,L);else{var be=m,Ue=P,He=L,qe=be[Ue-He],je=be[Ue+0],$e=be[Ue+He],Qe=3*(je-qe),rt=Ei[112+(Qe+4>>3)],Qe=Ei[112+(Qe+3>>3)],Ke=rt+1>>1;be[Ue-2*He]=qt[255+be[Ue-2*He]+Ke],be[Ue-He]=qt[255+qe+Qe],be[Ue+0]=qt[255+je-rt],be[Ue+He]=qt[255+$e-Ke]}P+=V}}function bn(m,P,L,V,ce,ve){wr(m,P,L,1,16,V,ce,ve)}function Xr(m,P,L,V,ce,ve){wr(m,P,1,L,16,V,ce,ve)}function di(m,P,L,V,ce,ve){var Ee;for(Ee=3;0<Ee;--Ee)P+=4*L,Er(m,P,L,1,16,V,ce,ve)}function pi(m,P,L,V,ce,ve){var Ee;for(Ee=3;0<Ee;--Ee)P+=4,Er(m,P,1,L,16,V,ce,ve)}function Yr(m,P,L,V,ce,ve,Ee,Se){wr(m,P,ce,1,8,ve,Ee,Se),wr(L,V,ce,1,8,ve,Ee,Se)}function Jr(m,P,L,V,ce,ve,Ee,Se){wr(m,P,1,ce,8,ve,Ee,Se),wr(L,V,1,ce,8,ve,Ee,Se)}function Ki(m,P,L,V,ce,ve,Ee,Se){Er(m,P+4*ce,ce,1,8,ve,Ee,Se),Er(L,V+4*ce,ce,1,8,ve,Ee,Se)}function kr(m,P,L,V,ce,ve,Ee,Se){Er(m,P+4,1,ce,8,ve,Ee,Se),Er(L,V+4,1,ce,8,ve,Ee,Se)}function gi(){this.ba=new C,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new U,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function qr(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Ar(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Ys(){this.ua=0,this.Wa=new Ne,this.vb=new Ne,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new M,this.yc=new y}function Js(){this.xb=this.a=0,this.l=new Rt,this.ca=new C,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new K,this.Pb=0,this.wd=new K,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Ys,this.ab=0,this.gc=u(4,Ar),this.Oc=0}function qs(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Rt,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function $i(m,P,L,V,ce,ve,Ee){for(m=m==null?0:m[P+0],P=0;P<Ee;++P)ce[ve+P]=m+L[V+P]&255,m=ce[ve+P]}function Ks(m,P,L,V,ce,ve,Ee){if(m==null)$i(null,null,L,V,ce,ve,Ee);else{var Se;for(Se=0;Se<Ee;++Se)ce[ve+Se]=m[P+Se]+L[V+Se]&255}}function $s(m,P,L,V,ce,ve,Ee){if(m==null)$i(null,null,L,V,ce,ve,Ee);else{var Se=m[P+0],be=Se,Ue=Se,He;for(He=0;He<Ee;++He)Se=m[P+He],be=Ue+Se-be,Ue=L[V+He]+(be&-256?0>be?0:255:be)&255,be=Se,ce[ve+He]=Ue}}function js(m,P,L,V){var ce=P.width,ve=P.o;if(e(m!=null&&P!=null),0>L||0>=V||L+V>ve)return null;if(!m.Cc){if(m.ga==null){m.ga=new qs;var Ee;if((Ee=m.ga==null)||(Ee=P.width*P.o,e(m.Gb.length==0),m.Gb=a(Ee),m.Uc=0,m.Gb==null?Ee=0:(m.mb=m.Gb,m.nb=m.Uc,m.rc=null,Ee=1),Ee=!Ee),!Ee){Ee=m.ga;var Se=m.Fa,be=m.P,Ue=m.qc,He=m.mb,qe=m.nb,je=be+1,$e=Ue-1,Qe=Ee.l;if(e(Se!=null&&He!=null&&P!=null),dr[0]=null,dr[1]=$i,dr[2]=Ks,dr[3]=$s,Ee.ca=He,Ee.tb=qe,Ee.c=P.width,Ee.i=P.height,e(0<Ee.c&&0<Ee.i),1>=Ue)P=0;else if(Ee.$a=Se[be+0]>>0&3,Ee.Z=Se[be+0]>>2&3,Ee.Lc=Se[be+0]>>4&3,be=Se[be+0]>>6&3,0>Ee.$a||1<Ee.$a||4<=Ee.Z||1<Ee.Lc||be)P=0;else if(Qe.put=W,Qe.ac=Y,Qe.bc=F,Qe.ma=Ee,Qe.width=P.width,Qe.height=P.height,Qe.Da=P.Da,Qe.v=P.v,Qe.va=P.va,Qe.j=P.j,Qe.o=P.o,Ee.$a)e:{e(Ee.$a==1),P=Pe();r:for(;;){if(P==null){P=0;break e}if(e(Ee!=null),Ee.mc=P,P.c=Ee.c,P.i=Ee.i,P.l=Ee.l,P.l.ma=Ee,P.l.width=Ee.c,P.l.height=Ee.i,P.a=0,J(P.m,Se,je,$e),!Ye(Ee.c,Ee.i,1,P,null)||(P.ab==1&&P.gc[0].hc==3&&S(P.s)?(Ee.ic=1,Se=P.c*P.i,P.Ta=null,P.Ua=0,P.V=a(Se),P.Ba=0,P.V==null?(P.a=1,P=0):P=1):(Ee.ic=0,P=Ge(P,Ee.c)),!P))break r;P=1;break e}Ee.mc=null,P=0}else P=$e>=Ee.c*Ee.i;Ee=!P}if(Ee)return null;m.ga.Lc!=1?m.Ga=0:V=ve-L}e(m.ga!=null),e(L+V<=ve);e:{if(Se=m.ga,P=Se.c,ve=Se.l.o,Se.$a==0){if(je=m.rc,$e=m.Vc,Qe=m.Fa,be=m.P+1+L*P,Ue=m.mb,He=m.nb+L*P,e(be<=m.P+m.qc),Se.Z!=0)for(e(dr[Se.Z]!=null),Ee=0;Ee<V;++Ee)dr[Se.Z](je,$e,Qe,be,Ue,He,P),je=Ue,$e=He,He+=P,be+=P;else for(Ee=0;Ee<V;++Ee)s(Ue,He,Qe,be,P),je=Ue,$e=He,He+=P,be+=P;m.rc=je,m.Vc=$e}else{if(e(Se.mc!=null),P=L+V,Ee=Se.mc,e(Ee!=null),e(P<=Ee.i),Ee.C>=P)P=1;else if(Se.ic||_i(),Se.ic){var Se=Ee.V,je=Ee.Ba,$e=Ee.c,rt=Ee.i,Qe=1,be=Ee.$/$e,Ue=Ee.$%$e,He=Ee.m,qe=Ee.s,Ke=Ee.$,et=$e*rt,it=$e*P,ht=qe.wc,ot=Ke<it?I(qe,Ue,be):null;e(Ke<=et),e(P<=rt),e(S(qe));r:for(;;){for(;!He.h&&Ke<it;){if(Ue&ht||(ot=I(qe,Ue,be)),e(ot!=null),re(He),rt=A(ot.G[0],ot.H[0],He),256>rt)Se[je+Ke]=rt,++Ke,++Ue,Ue>=$e&&(Ue=0,++be,be<=P&&!(be%16)&&se(Ee,be));else if(280>rt){var rt=G(rt-256,He),dt=A(ot.G[4],ot.H[4],He);if(re(He),dt=G(dt,He),dt=X($e,dt),Ke>=dt&&et-Ke>=rt){var pt;for(pt=0;pt<rt;++pt)Se[je+Ke+pt]=Se[je+Ke+pt-dt]}else{Qe=0;break r}for(Ke+=rt,Ue+=rt;Ue>=$e;)Ue-=$e,++be,be<=P&&!(be%16)&&se(Ee,be);Ke<it&&Ue&ht&&(ot=I(qe,Ue,be))}else{Qe=0;break r}e(He.h==R(He))}se(Ee,be>P?P:be);break r}!Qe||He.h&&Ke<et?(Qe=0,Ee.a=He.h?5:3):Ee.$=Ke,P=Qe}else P=ie(Ee,Ee.V,Ee.Ba,Ee.c,Ee.i,P,Ze);if(!P){V=0;break e}}L+V>=ve&&(m.Cc=1),V=1}if(!V)return null;if(m.Cc&&(V=m.ga,V!=null&&(V.mc=null),m.ga=null,0<m.Ga))return alert("todo:WebPDequantizeLevels"),null}return m.nb+L*ce}function Qs(m,P,L,V,ce,ve){for(;0<ce--;){var Ee=m,Se=P+(L?1:0),be=m,Ue=P+(L?0:3),He;for(He=0;He<V;++He){var qe=be[Ue+4*He];qe!=255&&(qe*=32897,Ee[Se+4*He+0]=Ee[Se+4*He+0]*qe>>23,Ee[Se+4*He+1]=Ee[Se+4*He+1]*qe>>23,Ee[Se+4*He+2]=Ee[Se+4*He+2]*qe>>23)}P+=ve}}function ea(m,P,L,V,ce){for(;0<V--;){var ve;for(ve=0;ve<L;++ve){var Ee=m[P+2*ve+0],Se=m[P+2*ve+1],be=Se&15,Ue=4369*be,Se=(Se&240|Se>>4)*Ue>>16;m[P+2*ve+0]=(Ee&240|Ee>>4)*Ue>>16&240|(Ee&15|Ee<<4)*Ue>>16>>4&15,m[P+2*ve+1]=Se&240|be}P+=ce}}function ta(m,P,L,V,ce,ve,Ee,Se){var be=255,Ue,He;for(He=0;He<ce;++He){for(Ue=0;Ue<V;++Ue){var qe=m[P+Ue];ve[Ee+4*Ue]=qe,be&=qe}P+=L,Ee+=Se}return be!=255}function ra(m,P,L,V,ce){var ve;for(ve=0;ve<ce;++ve)L[V+ve]=m[P+ve]>>8}function _i(){$r=Qs,ys=ea,ws=ta,Es=ra}function Pr(m,P,L){self[m]=function(V,ce,ve,Ee,Se,be,Ue,He,qe,je,$e,Qe,rt,Ke,et,it,ht){var ot,dt=ht-1>>1,pt=Se[be+0]|Ue[He+0]<<16,xt=qe[je+0]|$e[Qe+0]<<16;e(V!=null);var wt=3*pt+xt+131074>>2;for(P(V[ce+0],wt&255,wt>>16,rt,Ke),ve!=null&&(wt=3*xt+pt+131074>>2,P(ve[Ee+0],wt&255,wt>>16,et,it)),ot=1;ot<=dt;++ot){var It=Se[be+ot]|Ue[He+ot]<<16,bt=qe[je+ot]|$e[Qe+ot]<<16,kt=pt+It+xt+bt+524296,Ot=kt+2*(It+xt)>>3;kt=kt+2*(pt+bt)>>3,wt=Ot+pt>>1,pt=kt+It>>1,P(V[ce+2*ot-1],wt&255,wt>>16,rt,Ke+(2*ot-1)*L),P(V[ce+2*ot-0],pt&255,pt>>16,rt,Ke+(2*ot-0)*L),ve!=null&&(wt=kt+xt>>1,pt=Ot+bt>>1,P(ve[Ee+2*ot-1],wt&255,wt>>16,et,it+(2*ot-1)*L),P(ve[Ee+2*ot+0],pt&255,pt>>16,et,it+(2*ot+0)*L)),pt=It,xt=bt}ht&1||(wt=3*pt+xt+131074>>2,P(V[ce+ht-1],wt&255,wt>>16,rt,Ke+(ht-1)*L),ve!=null&&(wt=3*xt+pt+131074>>2,P(ve[Ee+ht-1],wt&255,wt>>16,et,it+(ht-1)*L)))}}function kn(){er[Pi]=Ta,er[Si]=Ps,er[ts]=Ca,er[Ti]=Ss,er[Ci]=Ts,er[on]=Cs,er[rs]=Ma,er[hn]=Ps,er[ln]=Ss,er[Mi]=Ts,er[un]=Cs}function ji(m){return m&~Fa?0>m?0:255:m>>Ms}function mi(m,P){return ji((19077*m>>8)+(26149*P>>8)-14234)}function xi(m,P,L){return ji((19077*m>>8)-(6419*P>>8)-(13320*L>>8)+8708)}function yi(m,P){return ji((19077*m>>8)+(33050*P>>8)-17685)}function wi(m,P,L,V,ce){V[ce+0]=mi(m,L),V[ce+1]=xi(m,P,L),V[ce+2]=yi(m,P)}function Qi(m,P,L,V,ce){V[ce+0]=yi(m,P),V[ce+1]=xi(m,P,L),V[ce+2]=mi(m,L)}function An(m,P,L,V,ce){var ve=xi(m,P,L);P=ve<<3&224|yi(m,P)>>3,V[ce+0]=mi(m,L)&248|ve>>5,V[ce+1]=P}function In(m,P,L,V,ce){var ve=yi(m,P)&240|15;V[ce+0]=mi(m,L)&240|xi(m,P,L)>>4,V[ce+1]=ve}function Rn(m,P,L,V,ce){V[ce+0]=255,wi(m,P,L,V,ce+1)}function Dn(m,P,L,V,ce){Qi(m,P,L,V,ce),V[ce+3]=255}function Ln(m,P,L,V,ce){wi(m,P,L,V,ce),V[ce+3]=255}function St(m,P){return 0>m?0:m>P?P:m}function Sr(m,P,L){self[m]=function(V,ce,ve,Ee,Se,be,Ue,He,qe){for(var je=He+(qe&-2)*L;He!=je;)P(V[ce+0],ve[Ee+0],Se[be+0],Ue,He),P(V[ce+1],ve[Ee+0],Se[be+0],Ue,He+L),ce+=2,++Ee,++be,He+=2*L;qe&1&&P(V[ce+0],ve[Ee+0],Se[be+0],Ue,He)}}function Un(m,P,L){return L==0?m==0?P==0?6:5:P==0?4:0:L}function Bn(m,P,L,V,ce){switch(m>>>30){case 3:Fi(P,L,V,ce,0);break;case 2:as(P,L,V,ce);break;case 1:Ir(P,L,V,ce)}}function Nn(m,P){var L,V,ce=P.M,ve=P.Nb,Ee=m.oc,Se=m.pc+40,be=m.oc,Ue=m.pc+584,He=m.oc,qe=m.pc+600;for(L=0;16>L;++L)Ee[Se+32*L-1]=129;for(L=0;8>L;++L)be[Ue+32*L-1]=129,He[qe+32*L-1]=129;for(0<ce?Ee[Se-1-32]=be[Ue-1-32]=He[qe-1-32]=129:(o(Ee,Se-32-1,127,21),o(be,Ue-32-1,127,9),o(He,qe-32-1,127,9)),V=0;V<m.za;++V){var je=P.ya[P.aa+V];if(0<V){for(L=-1;16>L;++L)s(Ee,Se+32*L-4,Ee,Se+32*L+12,4);for(L=-1;8>L;++L)s(be,Ue+32*L-4,be,Ue+32*L+4,4),s(He,qe+32*L-4,He,qe+32*L+4,4)}var $e=m.Gd,Qe=m.Hd+V,rt=je.ad,Ke=je.Hc;if(0<ce&&(s(Ee,Se-32,$e[Qe].y,0,16),s(be,Ue-32,$e[Qe].f,0,8),s(He,qe-32,$e[Qe].ea,0,8)),je.Za){var et=Ee,it=Se-32+16;for(0<ce&&(V>=m.za-1?o(et,it,$e[Qe].y[15],4):s(et,it,$e[Qe+1].y,0,4)),L=0;4>L;L++)et[it+128+L]=et[it+256+L]=et[it+384+L]=et[it+0+L];for(L=0;16>L;++L,Ke<<=2)et=Ee,it=Se+bs[L],sr[je.Ob[L]](et,it),Bn(Ke,rt,16*+L,et,it)}else if(et=Un(V,ce,je.Ob[0]),vr[et](Ee,Se),Ke!=0)for(L=0;16>L;++L,Ke<<=2)Bn(Ke,rt,16*+L,Ee,Se+bs[L]);for(L=je.Gc,et=Un(V,ce,je.Dd),lr[et](be,Ue),lr[et](He,qe),je=L>>0,Ke=rt,et=be,it=Ue,je&255&&(je&170?vn(Ke,256,et,it):dn(Ke,256,et,it)),L>>=8,je=He,Ke=qe,L&255&&(L&170?vn(rt,320,je,Ke):dn(rt,320,je,Ke)),ce<m.Ub-1&&(s($e[Qe].y,0,Ee,Se+480,16),s($e[Qe].f,0,be,Ue+224,8),s($e[Qe].ea,0,He,qe+224,8)),L=8*ve*m.B,$e=m.sa,Qe=m.ta+16*V+16*ve*m.R,rt=m.qa,je=m.ra+8*V+L,Ke=m.Ha,et=m.Ia+8*V+L,L=0;16>L;++L)s($e,Qe+L*m.R,Ee,Se+32*L,16);for(L=0;8>L;++L)s(rt,je+L*m.B,be,Ue+32*L,8),s(Ke,et+L*m.B,He,qe+32*L,8)}}function On(m,P,L,V,ce,ve,Ee,Se,be){var Ue=[0],He=[0],qe=0,je=be!=null?be.kd:0,$e=be!=null?be:new qr;if(m==null||12>L)return 7;$e.data=m,$e.w=P,$e.ha=L,P=[P],L=[L],$e.gb=[$e.gb];e:{var Qe=P,rt=L,Ke=$e.gb;if(e(m!=null),e(rt!=null),e(Ke!=null),Ke[0]=0,12<=rt[0]&&!r(m,Qe[0],"RIFF")){if(r(m,Qe[0]+8,"WEBP")){Ke=3;break e}var et=_e(m,Qe[0]+4);if(12>et||4294967286<et){Ke=3;break e}if(je&&et>rt[0]-8){Ke=7;break e}Ke[0]=et,Qe[0]+=12,rt[0]-=12}Ke=0}if(Ke!=0)return Ke;for(et=0<$e.gb[0],L=L[0];;){Qe=[0],qe=[qe];e:{var it=m;rt=P,Ke=L;var ht=qe,ot=Ue,dt=He,pt=Qe;if(ht[0]=0,8>Ke[0])Ke=7;else{if(!r(it,rt[0],"VP8X")){if(_e(it,rt[0]+4)!=10){Ke=3;break e}if(18>Ke[0]){Ke=7;break e}var xt=_e(it,rt[0]+8),wt=1+ne(it,rt[0]+12);if(it=1+ne(it,rt[0]+15),2147483648<=wt*it){Ke=3;break e}pt!=null&&(pt[0]=xt),ot!=null&&(ot[0]=wt),dt!=null&&(dt[0]=it),rt[0]+=18,Ke[0]-=18,ht[0]=1}Ke=0}}if(qe=qe[0],Qe=Qe[0],Ke!=0)return Ke;if(rt=!!(Qe&2),!et&&qe)return 3;if(ve!=null&&(ve[0]=!!(Qe&16)),Ee!=null&&(Ee[0]=rt),Se!=null&&(Se[0]=0),Ee=Ue[0],Qe=He[0],qe&&rt&&be==null){Ke=0;break}if(4>L){Ke=7;break}if(et&&qe||!et&&!qe&&!r(m,P[0],"ALPH")){L=[L],$e.na=[$e.na],$e.P=[$e.P],$e.Sa=[$e.Sa];e:{xt=m,Ke=P,et=L;var ht=$e.gb,ot=$e.na,dt=$e.P,pt=$e.Sa;wt=22,e(xt!=null),e(et!=null),it=Ke[0];var It=et[0];for(e(ot!=null),e(pt!=null),ot[0]=null,dt[0]=null,pt[0]=0;;){if(Ke[0]=it,et[0]=It,8>It){Ke=7;break e}var bt=_e(xt,it+4);if(4294967286<bt){Ke=3;break e}var kt=8+bt+1&-2;if(wt+=kt,0<ht&&wt>ht){Ke=3;break e}if(!r(xt,it,"VP8 ")||!r(xt,it,"VP8L")){Ke=0;break e}if(It[0]<kt){Ke=7;break e}r(xt,it,"ALPH")||(ot[0]=xt,dt[0]=it+8,pt[0]=bt),it+=kt,It-=kt}}if(L=L[0],$e.na=$e.na[0],$e.P=$e.P[0],$e.Sa=$e.Sa[0],Ke!=0)break}L=[L],$e.Ja=[$e.Ja],$e.xa=[$e.xa];e:if(ht=m,Ke=P,et=L,ot=$e.gb[0],dt=$e.Ja,pt=$e.xa,xt=Ke[0],it=!r(ht,xt,"VP8 "),wt=!r(ht,xt,"VP8L"),e(ht!=null),e(et!=null),e(dt!=null),e(pt!=null),8>et[0])Ke=7;else{if(it||wt){if(ht=_e(ht,xt+4),12<=ot&&ht>ot-12){Ke=3;break e}if(je&&ht>et[0]-8){Ke=7;break e}dt[0]=ht,Ke[0]+=8,et[0]-=8,pt[0]=wt}else pt[0]=5<=et[0]&&ht[xt+0]==47&&!(ht[xt+4]>>5),dt[0]=et[0];Ke=0}if(L=L[0],$e.Ja=$e.Ja[0],$e.xa=$e.xa[0],P=P[0],Ke!=0)break;if(4294967286<$e.Ja)return 3;if(Se==null||rt||(Se[0]=$e.xa?2:1),Ee=[Ee],Qe=[Qe],$e.xa){if(5>L){Ke=7;break}Se=Ee,je=Qe,rt=ve,m==null||5>L?m=0:5<=L&&m[P+0]==47&&!(m[P+4]>>5)?(et=[0],ht=[0],ot=[0],dt=new K,J(dt,m,P,L),z(dt,et,ht,ot)?(Se!=null&&(Se[0]=et[0]),je!=null&&(je[0]=ht[0]),rt!=null&&(rt[0]=ot[0]),m=1):m=0):m=0}else{if(10>L){Ke=7;break}Se=Qe,m==null||10>L||!Ut(m,P+3,L-3)?m=0:(je=m[P+0]|m[P+1]<<8|m[P+2]<<16,rt=(m[P+7]<<8|m[P+6])&16383,m=(m[P+9]<<8|m[P+8])&16383,je&1||3<(je>>1&7)||!(je>>4&1)||je>>5>=$e.Ja||!rt||!m?m=0:(Ee&&(Ee[0]=rt),Se&&(Se[0]=m),m=1))}if(!m||(Ee=Ee[0],Qe=Qe[0],qe&&(Ue[0]!=Ee||He[0]!=Qe)))return 3;be!=null&&(be[0]=$e,be.offset=P-be.w,e(4294967286>P-be.w),e(be.offset==be.ha-L));break}return Ke==0||Ke==7&&qe&&be==null?(ve!=null&&(ve[0]|=$e.na!=null&&0<$e.na.length),V!=null&&(V[0]=Ee),ce!=null&&(ce[0]=Qe),0):Ke}function zn(m,P,L){var V=P.width,ce=P.height,ve=0,Ee=0,Se=V,be=ce;if(P.Da=m!=null&&0<m.Da,P.Da&&(Se=m.cd,be=m.bd,ve=m.v,Ee=m.j,11>L||(ve&=-2,Ee&=-2),0>ve||0>Ee||0>=Se||0>=be||ve+Se>V||Ee+be>ce))return 0;if(P.v=ve,P.j=Ee,P.va=ve+Se,P.o=Ee+be,P.U=Se,P.T=be,P.da=m!=null&&0<m.da,P.da){if(L=[m.ib],ve=[m.hb],!Ae(Se,be,L,ve))return 0;P.ib=L[0],P.hb=ve[0]}return P.ob=m!=null&&m.ob,P.Kb=m==null||!m.Sd,P.da&&(P.ob=P.ib<3*V/4&&P.hb<3*ce/4,P.Kb=0),1}function Gn(m){if(m==null)return 2;if(11>m.S){var P=m.f.RGBA;P.fb+=(m.height-1)*P.A,P.A=-P.A}else P=m.f.kb,m=m.height,P.O+=(m-1)*P.fa,P.fa=-P.fa,P.N+=(m-1>>1)*P.Ab,P.Ab=-P.Ab,P.W+=(m-1>>1)*P.Db,P.Db=-P.Db,P.F!=null&&(P.J+=(m-1)*P.lb,P.lb=-P.lb);return 0}function Zn(m,P,L,V){if(V==null||0>=m||0>=P)return 2;if(L!=null){if(L.Da){var ce=L.cd,ve=L.bd,Ee=L.v&-2,Se=L.j&-2;if(0>Ee||0>Se||0>=ce||0>=ve||Ee+ce>m||Se+ve>P)return 2;m=ce,P=ve}if(L.da){if(ce=[L.ib],ve=[L.hb],!Ae(m,P,ce,ve))return 2;m=ce[0],P=ve[0]}}V.width=m,V.height=P;e:{var be=V.width,Ue=V.height;if(m=V.S,0>=be||0>=Ue||!(m>=Pi&&13>m))m=2;else{if(0>=V.Rd&&V.sd==null){var Ee=ve=ce=P=0,Se=be*ks[m],He=Se*Ue;if(11>m||(P=(be+1)/2,ve=(Ue+1)/2*P,m==12&&(ce=be,Ee=ce*Ue)),Ue=a(He+2*ve+Ee),Ue==null){m=1;break e}V.sd=Ue,11>m?(be=V.f.RGBA,be.eb=Ue,be.fb=0,be.A=Se,be.size=He):(be=V.f.kb,be.y=Ue,be.O=0,be.fa=Se,be.Fd=He,be.f=Ue,be.N=0+He,be.Ab=P,be.Cd=ve,be.ea=Ue,be.W=0+He+ve,be.Db=P,be.Ed=ve,m==12&&(be.F=Ue,be.J=0+He+2*ve),be.Tc=Ee,be.lb=ce)}if(P=1,ce=V.S,ve=V.width,Ee=V.height,ce>=Pi&&13>ce)if(11>ce)m=V.f.RGBA,Se=Math.abs(m.A),P&=Se*(Ee-1)+ve<=m.size,P&=Se>=ve*ks[ce],P&=m.eb!=null;else{m=V.f.kb,Se=(ve+1)/2,He=(Ee+1)/2,be=Math.abs(m.fa);var Ue=Math.abs(m.Ab),qe=Math.abs(m.Db),je=Math.abs(m.lb),$e=je*(Ee-1)+ve;P&=be*(Ee-1)+ve<=m.Fd,P&=Ue*(He-1)+Se<=m.Cd,P&=qe*(He-1)+Se<=m.Ed,P=P&be>=ve&Ue>=Se&qe>=Se,P&=m.y!=null,P&=m.f!=null,P&=m.ea!=null,ce==12&&(P&=je>=ve,P&=$e<=m.Tc,P&=m.F!=null)}else P=0;m=P?0:2}}return m!=0||L!=null&&L.fd&&(m=Gn(V)),m}var en=64,ia=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],na=24,tn=32,Hn=8,sa=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ze("Predictor0","PredictorAdd0"),self.Predictor0=function(){return 4278190080},self.Predictor1=function(m){return m},self.Predictor2=function(m,P,L){return P[L+0]},self.Predictor3=function(m,P,L){return P[L+1]},self.Predictor4=function(m,P,L){return P[L-1]},self.Predictor5=function(m,P,L){return he(he(m,P[L+1]),P[L+0])},self.Predictor6=function(m,P,L){return he(m,P[L-1])},self.Predictor7=function(m,P,L){return he(m,P[L+0])},self.Predictor8=function(m,P,L){return he(P[L-1],P[L+0])},self.Predictor9=function(m,P,L){return he(P[L+0],P[L+1])},self.Predictor10=function(m,P,L){return he(he(m,P[L-1]),he(P[L+0],P[L+1]))},self.Predictor11=function(m,P,L){var V=P[L+0];return P=P[L-1],0>=Ce(V>>24&255,m>>24&255,P>>24&255)+Ce(V>>16&255,m>>16&255,P>>16&255)+Ce(V>>8&255,m>>8&255,P>>8&255)+Ce(V&255,m&255,P&255)?V:m},self.Predictor12=function(m,P,L){var V=P[L+0];return P=P[L-1],(ke((m>>24&255)+(V>>24&255)-(P>>24&255))<<24|ke((m>>16&255)+(V>>16&255)-(P>>16&255))<<16|ke((m>>8&255)+(V>>8&255)-(P>>8&255))<<8|ke((m&255)+(V&255)-(P&255)))>>>0},self.Predictor13=function(m,P,L){var V=P[L-1];return m=he(m,P[L+0]),(le(m>>24&255,V>>24&255)<<24|le(m>>16&255,V>>16&255)<<16|le(m>>8&255,V>>8&255)<<8|le(m>>0&255,V>>0&255))>>>0};var aa=self.PredictorAdd0;self.PredictorAdd1=Be,ze("Predictor2","PredictorAdd2"),ze("Predictor3","PredictorAdd3"),ze("Predictor4","PredictorAdd4"),ze("Predictor5","PredictorAdd5"),ze("Predictor6","PredictorAdd6"),ze("Predictor7","PredictorAdd7"),ze("Predictor8","PredictorAdd8"),ze("Predictor9","PredictorAdd9"),ze("Predictor10","PredictorAdd10"),ze("Predictor11","PredictorAdd11"),ze("Predictor12","PredictorAdd12"),ze("Predictor13","PredictorAdd13");var oa=self.PredictorAdd2;Re("ColorIndexInverseTransform","MapARGB","32b",function(m){return m>>8&255},function(m){return m}),Re("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(m){return m},function(m){return m>>8&255});var Vn=self.ColorIndexInverseTransform,ha=self.MapARGB,la=self.VP8LColorIndexInverseTransformAlpha,ua=self.MapAlpha,Wn,Xn=self.VP8LPredictorsAdd=[];Xn.length=16,(self.VP8LPredictors=[]).length=16,(self.VP8LPredictorsAdd_C=[]).length=16,(self.VP8LPredictors_C=[]).length=16;var rn,Yn,nn,sn,Jn,qn,Kn=a(511),$n=a(2041),jn=a(225),Qn=a(767),es=0,an=$n,Ei=jn,qt=Qn,Qt=Kn,Pi=0,Si=1,ts=2,Ti=3,Ci=4,on=5,rs=6,hn=7,ln=8,Mi=9,un=10,fa=[2,3,7],ca=[3,3,11],is=[280,256,256,256,40],va=[0,1,1,1,0],da=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],pa=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],ga=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],_a=8,fn=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,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,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],cn=[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,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Kr=null,ma=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],xa=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],ns=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ya=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],wa=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Ea=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Pa=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ss,vr=[],sr=[],lr=[],Fi,as,vn,Ir,dn,os,hs,ls,us,fs,cs,vs,ds,ps,gs,_s,ms,Sa=1,xs=2,dr=[],$r,ys,ws,Es,er=[];Pr("UpsampleRgbLinePair",wi,3),Pr("UpsampleBgrLinePair",Qi,3),Pr("UpsampleRgbaLinePair",Ln,4),Pr("UpsampleBgraLinePair",Dn,4),Pr("UpsampleArgbLinePair",Rn,4),Pr("UpsampleRgba4444LinePair",In,2),Pr("UpsampleRgb565LinePair",An,2);var Ta=window.UpsampleRgbLinePair,Ca=window.UpsampleBgrLinePair,Ps=window.UpsampleRgbaLinePair,Ss=window.UpsampleBgraLinePair,Ts=window.UpsampleArgbLinePair,Cs=window.UpsampleRgba4444LinePair,Ma=window.UpsampleRgb565LinePair,bi=16,ki=1<<bi-1,jr=-227,pn=482,Ms=6,Fa=(256<<Ms)-1,Fs=0,ba=a(256),ka=a(256),Aa=a(256),Ia=a(256),Ra=a(pn-jr),Da=a(pn-jr);Sr("YuvToRgbRow",wi,3),Sr("YuvToBgrRow",Qi,3),Sr("YuvToRgbaRow",Ln,4),Sr("YuvToBgraRow",Dn,4),Sr("YuvToArgbRow",Rn,4),Sr("YuvToRgba4444Row",In,2),Sr("YuvToRgb565Row",An,2);var bs=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Ai=[0,2,8],La=[8,7,6,4,4,2,2,2,1,1,1,1],Ua=1;this.WebPDecodeRGBA=function(m,P,L,V,ce){var ve=Si,Ee=new gi,Se=new C;Ee.ba=Se,Se.S=ve,Se.width=[Se.width],Se.height=[Se.height];var be=Se.width,Ue=Se.height,He=new b;if(He==null||m==null)var qe=2;else e(He!=null),qe=On(m,P,L,He.width,He.height,He.Pd,He.Qd,He.format,null);if(qe!=0?be=0:(be!=null&&(be[0]=He.width[0]),Ue!=null&&(Ue[0]=He.height[0]),be=1),be){Se.width=Se.width[0],Se.height=Se.height[0],V!=null&&(V[0]=Se.width),ce!=null&&(ce[0]=Se.height);e:{if(V=new Rt,ce=new qr,ce.data=m,ce.w=P,ce.ha=L,ce.kd=1,P=[0],e(ce!=null),m=On(ce.data,ce.w,ce.ha,null,null,null,P,null,ce),(m==0||m==7)&&P[0]&&(m=4),P=m,P==0){if(e(Ee!=null),V.data=ce.data,V.w=ce.w+ce.offset,V.ha=ce.ha-ce.offset,V.put=W,V.ac=Y,V.bc=F,V.ma=Ee,ce.xa){if(m=Pe(),m==null){Ee=1;break e}if(Je(m,V)){if(P=Zn(V.width,V.height,Ee.Oa,Ee.ba),V=P==0){r:{V=m;t:for(;;){if(V==null){V=0;break r}if(e(V.s.yc!=null),e(V.s.Ya!=null),e(0<V.s.Wb),L=V.l,e(L!=null),ce=L.ma,e(ce!=null),V.xb!=0){if(V.ca=ce.ba,V.tb=ce.tb,e(V.ca!=null),!zn(ce.Oa,L,Ti)){V.a=2;break t}if(!Ge(V,L.width)||L.da)break t;if((L.da||d(V.ca.S))&&_i(),11>V.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),V.ca.f.kb.F!=null&&_i()),V.Pb&&0<V.s.ua&&V.s.vb.X==null&&!ae(V.s.vb,V.s.Wa.Xa)){V.a=1;break t}V.xb=0}if(!ie(V,V.V,V.Ba,V.c,V.i,L.o,fe))break t;ce.Dc=V.Ma,V=1;break r}e(V.a!=0),V=0}V=!V}V&&(P=m.a)}else P=m.a}else{if(m=new Bt,m==null){Ee=1;break e}if(m.Fa=ce.na,m.P=ce.P,m.qc=ce.Sa,Dt(m,V)){if(P=Zn(V.width,V.height,Ee.Oa,Ee.ba),P==0){if(m.Aa=0,L=Ee.Oa,ce=m,e(ce!=null),L!=null){if(be=L.Md,be=0>be?0:100<be?255:255*be/100,0<be){for(Ue=He=0;4>Ue;++Ue)qe=ce.pb[Ue],12>qe.lc&&(qe.ia=be*La[0>qe.lc?0:qe.lc]>>3),He|=qe.ia;He&&(alert("todo:VP8InitRandom"),ce.ia=1)}ce.Ga=L.Id,100<ce.Ga?ce.Ga=100:0>ce.Ga&&(ce.Ga=0)}$t(m,V)||(P=m.a)}}else P=m.a}P==0&&Ee.Oa!=null&&Ee.Oa.fd&&(P=Gn(Ee.ba))}Ee=P}ve=Ee!=0?null:11>ve?Se.f.RGBA.eb:Se.f.kb.y}else ve=null;return ve};var ks=[3,4,3,4,4,2,2,4,4,4,2,1,1]},new window.WebPDecoder}();function GifWriter(e,r,s,o){var a=0,o=o===void 0?{}:o,u=o.loop===void 0?null:o.loop,l=o.palette===void 0?null:o.palette;if(r<=0||s<=0||r>65535||s>65535)throw new Error("Width/Height invalid.");function v(M){var T=M.length;if(T<2||T>256||T&T-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return T}e[a++]=71,e[a++]=73,e[a++]=70,e[a++]=56,e[a++]=57,e[a++]=97;var p=0,c=0;if(l!==null){for(var _=v(l);_>>=1;)++p;if(_=1<<p,--p,o.background!==void 0){if(c=o.background,c>=_)throw new Error("Background index out of range.");if(c===0)throw new Error("Background index explicitly passed as 0.")}}if(e[a++]=r&255,e[a++]=r>>8&255,e[a++]=s&255,e[a++]=s>>8&255,e[a++]=(l!==null?128:0)|p,e[a++]=c,e[a++]=0,l!==null)for(var f=0,g=l.length;f<g;++f){var y=l[f];e[a++]=y>>16&255,e[a++]=y>>8&255,e[a++]=y&255}if(u!==null){if(u<0||u>65535)throw new Error("Loop count invalid.");e[a++]=33,e[a++]=255,e[a++]=11,e[a++]=78,e[a++]=69,e[a++]=84,e[a++]=83,e[a++]=67,e[a++]=65,e[a++]=80,e[a++]=69,e[a++]=50,e[a++]=46,e[a++]=48,e[a++]=3,e[a++]=1,e[a++]=u&255,e[a++]=u>>8&255,e[a++]=0}var w=!1;this.addFrame=function(M,T,B,H,J,Q){if(w===!0&&(--a,w=!1),Q=Q===void 0?{}:Q,M<0||T<0||M>65535||T>65535)throw new Error("x/y invalid.");if(B<=0||H<=0||B>65535||H>65535)throw new Error("Width/Height invalid.");if(J.length<B*H)throw new Error("Not enough pixels for the frame size.");var q=!0,O=Q.palette;if(O==null&&(q=!1,O=l),O==null)throw new Error("Must supply either a local or global palette.");for(var K=v(O),pe=0;K>>=1;)++pe;K=1<<pe;var R=Q.delay===void 0?0:Q.delay,Te=Q.disposal===void 0?0:Q.disposal;if(Te<0||Te>3)throw new Error("Disposal out of range.");var re=!1,oe=0;if(Q.transparent!==void 0&&Q.transparent!==null&&(re=!0,oe=Q.transparent,oe<0||oe>=K))throw new Error("Transparent color index.");if((Te!==0||re||R!==0)&&(e[a++]=33,e[a++]=249,e[a++]=4,e[a++]=Te<<2|(re===!0?1:0),e[a++]=R&255,e[a++]=R>>8&255,e[a++]=oe,e[a++]=0),e[a++]=44,e[a++]=M&255,e[a++]=M>>8&255,e[a++]=T&255,e[a++]=T>>8&255,e[a++]=B&255,e[a++]=B>>8&255,e[a++]=H&255,e[a++]=H>>8&255,e[a++]=q===!0?128|pe-1:0,q===!0)for(var me=0,ue=O.length;me<ue;++me){var $=O[me];e[a++]=$>>16&255,e[a++]=$>>8&255,e[a++]=$&255}return a=GifWriterOutputLZWCodeStream(e,a,pe<2?2:pe,J),a},this.end=function(){return w===!1&&(e[a++]=59,w=!0),a},this.getOutputBuffer=function(){return e},this.setOutputBuffer=function(M){e=M},this.getOutputBufferPosition=function(){return a},this.setOutputBufferPosition=function(M){a=M}}function GifWriterOutputLZWCodeStream(e,r,s,o){e[r++]=s;var a=r++,u=1<<s,l=u-1,v=u+1,p=v+1,c=s+1,_=0,f=0;function g(q){for(;_>=q;)e[r++]=f&255,f>>=8,_-=8,r===a+256&&(e[a]=255,a=r++)}function y(q){f|=q<<_,_+=c,g(8)}var w=o[0]&l,M={};y(u);for(var T=1,B=o.length;T<B;++T){var H=o[T]&l,J=w<<8|H,Q=M[J];if(Q===void 0){for(f|=w<<_,_+=c;_>=8;)e[r++]=f&255,f>>=8,_-=8,r===a+256&&(e[a]=255,a=r++);p===4096?(y(u),p=v+1,c=s+1,M={}):(p>=1<<c&&++c,M[J]=p++),w=H}else w=Q}return y(w),y(v),g(1),a+1===r?e[a]=0:(e[a]=r-a-1,e[r++]=0),r}var UGIF=function(){var e=function(){var _,f,g,y,w=0,M=0,T=0,B=0,H=function(){var Te=_>>>3,re=f[Te+2]<<16|f[Te+1]<<8|f[Te],oe=re>>>(_&7)&(1<<M)-1;return _+=M,oe},J=new Uint32Array(4096*4),Q=0,q=function(Te){if(Te!=Q){Q=Te,T=1<<Te,B=T+1;for(var re=0;re<B+1;re++)J[4*re]=J[4*re+3]=re,J[4*re+1]=65535,J[4*re+2]=1}},O=function(Te){M=Te+1,w=B+1},K=function(Te){for(var re=Te<<2,oe=J[re+2],me=y+oe-1;re!=65535;)g[me--]=J[re],re=J[re+1];y+=oe},pe=function(Te,re){var oe=w<<2,me=Te<<2;J[oe]=J[(re<<2)+3],J[oe+1]=me,J[oe+2]=J[me+2]+1,J[oe+3]=J[me+3],w++,w==1<<M&&M!=12&&M++},R=function(Te,re,oe,me,ue,$){_=re<<3,f=Te,g=me,y=ue;var ee=re+oe<<3,ne=0,_e=0;for(q($),O($);_<ee&&(ne=H())!=B;){if(ne==T){if(O($),ne=H(),ne==B)break;K(ne)}else ne<w?(K(ne),pe(_e,ne)):(pe(_e,_e),K(w-1));_e=ne}return y};return R}(),r,s,o=new Uint8Array(128),a=function(){return r[s++]},u=function(){var _=r[s+1]<<8|r[s];return s+=2,_},l=function(){for(;r[s]!=0;)s+=1+r[s];s++},v=function(_){r=new Uint8Array(_),s=6;var f=u(),g=u(),y=a(),w=a(),M=a(),T=y>>>7,B=y>>>4&7,H=y>>>3&1,J=y>>>0&7,Q=s,q=0,O,K=0,pe=0,R=0,Te=260;T==1&&(s+=3*(1<<J+1));for(var re=[];s<r.length;){var oe=a();if(oe==33){var me=a();if(me==249){var ue=a(),y=a();K=y>>>2&7,pe=u(),Te=a(),(y&1)==0&&(Te=260),a()}else if(me==254)l();else if(me==255)l();else throw me}else if(oe==44){var $=u(),ee=u(),ne=u(),_e=u(),ae=a(),Me=ae>>>7;if(R=ae>>>6&1,Me==1){var J=ae>>>0&7;q=s,s+=3*(1<<J+1)}O={x:$,y:ee,a:ne,O:_e,f:K,delay:pe,B:Te,A:q==0?Q:q,U:R},re.push(O),q=0}else if(oe<=8){var ne=O.a,_e=O.O,Ne=ne*_e,Ae=0;for(o.length<Ne*1.2&&(o=new Uint8Array(~~(Ne*1.3)));s<r.length&&r[s]!=0;){for(var Fe=a(),De=0;De<Fe;De++)o[Ae+De]=r[s+De];Ae+=Fe,s+=Fe}if(s>=r.length){alert("Some frames are damaged."),re.pop();break}a(),O.d=new Uint8Array(Ne);var ze=e(o,0,Ae,O.d,0,oe)}else{if(oe==59)break;throw oe}}return{width:f,height:g,data:r,frames:re}};function p(_,f,g,y,w,M,T,B){for(var H=0;H<T;H++){var J=w[M+H];if(J!=B){var Q=f+H<<2,q=y+J*3;_[Q]=g[q],_[Q+1]=g[q+1],_[Q+2]=g[q+2],_[Q+3]=255}}}var c=function(_){for(var f=_.frames,g=_.width,y=_.height,w=new Uint8Array(g*y*4),M,T=[],B=_.data,H=0;H<f.length;H++){var J=f[H],Q=J.x,q=J.y,O=J.a,K=J.O,pe=J.f;pe==3&&(M==null?M=w.slice(0):M.set(w));var R=[];if(J.U==1){for(var Te=0;Te<K;Te+=8)R.push(Te);for(var Te=4;Te<K;Te+=8)R.push(Te);for(var Te=2;Te<K;Te+=4)R.push(Te);for(var Te=1;Te<K;Te+=2)R.push(Te)}for(var re=J.d,oe=J.A,me=J.B,ue=J.U,Te=0;Te<K;Te++){var $=ue==0?Te:R[Te];p(w,($+q)*g+Q,B,oe,re,Te*O,O,me)}if(T.push(w.slice(0).buffer),!(pe<2))if(pe==2)for(var Te=0;Te<K;Te++){var ee=((q+Te)*g+Q)*4;w.fill(0,ee,ee+O*4)}else pe==3&&w.set(M)}return T};return{decode:v,toRGBA8:c}}();(function(e){var r=e.noise={};function s(y,w,M){this.x=y,this.y=w,this.z=M}s.prototype.dot2=function(y,w){return this.x*y+this.y*w},s.prototype.dot3=function(y,w,M){return this.x*y+this.y*w+this.z*M};var o=[new s(1,1,0),new s(-1,1,0),new s(1,-1,0),new s(-1,-1,0),new s(1,0,1),new s(-1,0,1),new s(1,0,-1),new s(-1,0,-1),new s(0,1,1),new s(0,-1,1),new s(0,1,-1),new s(0,-1,-1)],a=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],u=new Array(512),l=new Array(512);r.seed=function(y){y>0&&y<1&&(y*=65536),y=Math.floor(y),y<256&&(y|=y<<8);for(var w=0;w<256;w++){var M;w&1?M=a[w]^y&255:M=a[w]^y>>8&255,u[w]=u[w+256]=M,l[w]=l[w+256]=o[M%12]}},r.seed(0);var v=.5*(Math.sqrt(3)-1),p=(3-Math.sqrt(3))/6,c=1/3,_=1/6;r.simplex2=function(y,w){var M,T,B,H=(y+w)*v,J=Math.floor(y+H),Q=Math.floor(w+H),q=(J+Q)*p,O=y-J+q,K=w-Q+q,pe,R;O>K?(pe=1,R=0):(pe=0,R=1);var Te=O-pe+p,re=K-R+p,oe=O-1+2*p,me=K-1+2*p;J&=255,Q&=255;var ue=l[J+u[Q]],$=l[J+pe+u[Q+R]],ee=l[J+1+u[Q+1]],ne=.5-O*O-K*K;ne<0?M=0:(ne*=ne,M=ne*ne*ue.dot2(O,K));var _e=.5-Te*Te-re*re;_e<0?T=0:(_e*=_e,T=_e*_e*$.dot2(Te,re));var ae=.5-oe*oe-me*me;return ae<0?B=0:(ae*=ae,B=ae*ae*ee.dot2(oe,me)),70*(M+T+B)},r.simplex3=function(y,w,M){var T,B,H,J,Q=(y+w+M)*c,q=Math.floor(y+Q),O=Math.floor(w+Q),K=Math.floor(M+Q),pe=(q+O+K)*_,R=y-q+pe,Te=w-O+pe,re=M-K+pe,oe,me,ue,$,ee,ne;R>=Te?Te>=re?(oe=1,me=0,ue=0,$=1,ee=1,ne=0):R>=re?(oe=1,me=0,ue=0,$=1,ee=0,ne=1):(oe=0,me=0,ue=1,$=1,ee=0,ne=1):Te<re?(oe=0,me=0,ue=1,$=0,ee=1,ne=1):R<re?(oe=0,me=1,ue=0,$=0,ee=1,ne=1):(oe=0,me=1,ue=0,$=1,ee=1,ne=0);var _e=R-oe+_,ae=Te-me+_,Me=re-ue+_,Ne=R-$+2*_,Ae=Te-ee+2*_,Fe=re-ne+2*_,De=R-1+3*_,ze=Te-1+3*_,ye=re-1+3*_;q&=255,O&=255,K&=255;var he=l[q+u[O+u[K]]],ke=l[q+oe+u[O+me+u[K+ue]]],le=l[q+$+u[O+ee+u[K+ne]]],Ce=l[q+1+u[O+1+u[K+1]]],Be=.6-R*R-Te*Te-re*re;Be<0?T=0:(Be*=Be,T=Be*Be*he.dot3(R,Te,re));var we=.6-_e*_e-ae*ae-Me*Me;we<0?B=0:(we*=we,B=we*we*ke.dot3(_e,ae,Me));var xe=.6-Ne*Ne-Ae*Ae-Fe*Fe;xe<0?H=0:(xe*=xe,H=xe*xe*le.dot3(Ne,Ae,Fe));var Ie=.6-De*De-ze*ze-ye*ye;return Ie<0?J=0:(Ie*=Ie,J=Ie*Ie*Ce.dot3(De,ze,ye)),32*(T+B+H+J)};function f(y){return y*y*y*(y*(y*6-15)+10)}function g(y,w,M){return(1-M)*y+M*w}r.perlin2=function(y,w){var M=Math.floor(y),T=Math.floor(w);y=y-M,w=w-T,M=M&255,T=T&255;var B=l[M+u[T]].dot2(y,w),H=l[M+u[T+1]].dot2(y,w-1),J=l[M+1+u[T]].dot2(y-1,w),Q=l[M+1+u[T+1]].dot2(y-1,w-1),q=f(y);return g(g(B,J,q),g(H,Q,q),f(w))},r.perlin3=function(y,w,M){var T=Math.floor(y),B=Math.floor(w),H=Math.floor(M);y=y-T,w=w-B,M=M-H,T=T&255,B=B&255,H=H&255;var J=l[T+u[B+u[H]]].dot3(y,w,M),Q=l[T+u[B+u[H+1]]].dot3(y,w,M-1),q=l[T+u[B+1+u[H]]].dot3(y,w-1,M),O=l[T+u[B+1+u[H+1]]].dot3(y,w-1,M-1),K=l[T+1+u[B+u[H]]].dot3(y-1,w,M),pe=l[T+1+u[B+u[H+1]]].dot3(y-1,w,M-1),R=l[T+1+u[B+1+u[H]]].dot3(y-1,w-1,M),Te=l[T+1+u[B+1+u[H+1]]].dot3(y-1,w-1,M-1),re=f(y),oe=f(w),me=f(M);return g(g(g(J,K,re),g(Q,pe,re),me),g(g(q,R,re),g(O,Te,re),me),oe)}})(this);var linear=function(){function e(o,a){this.data=new Array(o.length);for(var u=0,l=o[0].length;u<o.length;u++){this.data[u]=new Array(l);for(var v=0;v<l;v++)this.data[u][v]=o[u][v]}if(a){if(typeof a[0]!="object")for(var u=0;u<a.length;u++)a[u]=[a[u]];this.mirror=new e(a)}}e.prototype.swap=function(o,a){this.mirror&&this.mirror.swap(o,a);var u=this.data[o];this.data[o]=this.data[a],this.data[a]=u},e.prototype.multline=function(o,a){this.mirror&&this.mirror.multline(o,a);for(var u=this.data[o],l=u.length-1;l>=0;l--)u[l]*=a},e.prototype.addmul=function(o,a,u){this.mirror&&this.mirror.addmul(o,a,u);for(var l=this.data[o],v=this.data[a],p=l.length-1;p>=0;p--)l[p]=l[p]+u*v[p]},e.prototype.hasNullLine=function(o){for(var a=0;a<this.data[o].length;a++)if(this.data[o][a]!==0)return!1;return!0},e.prototype.gauss=function(){for(var o=0,a=this.data.length,u=this.data[0].length,l=[],v=0;v<u;v++){for(var p=0,c=0,_=o;_<a;_++){var f=this.data[_][v];Math.abs(f)>Math.abs(p)&&(c=_,p=f)}if(p===0)l.push(o);else{this.multline(c,1/p),this.swap(c,o);for(var g=0;g<a;g++)g!==o&&this.addmul(g,o,-this.data[g][v])}o++}for(var g=0;g<l.length;g++)if(!this.mirror.hasNullLine(l[g]))throw new Error("singular matrix");return this.mirror.data};var r={};r.solve=function(a,u){var l=new e(a,u).gauss();if(l.length>0&&l[0].length===1)for(var v=0;v<l.length;v++)l[v]=l[v][0];return l};function s(o){for(var a=new Array(o),u=0;u<o;u++){a[u]=new Array(o);for(var l=0;l<o;l++)a[u][l]=u===l?1:0}return a}return r.invert=function(a){return new e(a,s(a.length)).gauss()},r}(),Typr=function(){var e={};return e.parse=function(r){var s=function(w,M,T,B){var H=e.B,J=e.T,Q={cmap:J.w,head:J.head,hhea:J.am,maxp:J.aQ,hmtx:J.ah,name:J.name,"OS/2":J.f,post:J.aj,loca:J.az,kern:J.C,glyf:J.n,"CFF ":J.O,"SVG ":J.aK},q={_data:w,_index:M,_offset:T};for(var O in Q){var K=e.findTable(w,O,T);if(K){var pe=K[0],R=B[pe];R==null&&(R=Q[O].V(w,pe,K[1],q)),q[O]=B[pe]=R}}return q},o=e.B,a=new Uint8Array(r),u={},l=o.$(a,0,4);if(l=="ttcf"){var v=4,p=o.m(a,v);v+=2;var c=o.m(a,v);v+=2;var _=o.k(a,v);v+=4;for(var f=[],g=0;g<_;g++){var y=o.k(a,v);v+=4,f.push(s(a,g,y,u))}return f}else return[s(a,0,0,u)]},e.findTable=function(r,s,o){for(var a=e.B,u=a.m(r,o+4),l=o+12,v=0;v<u;v++){var p=a.$(r,l,4),c=a.k(r,l+4),_=a.k(r,l+8),f=a.k(r,l+12);if(p==s)return[_,f];l+=16}return null},e.T={},e.B={v:function(r,s){return(r[s]<<8|r[s+1])+(r[s+2]<<8|r[s+3])/(256*256+4)},g:function(r,s){var o=e.B.R(r,s);return o/16384},N:function(r,s){var o=e.B.F.I;return o[0]=r[s+3],o[1]=r[s+2],o[2]=r[s+1],o[3]=r[s],e.B.F.aW[0]},j:function(r,s){var o=e.B.F.I;return o[0]=r[s],e.B.F.Oa[0]},R:function(r,s){var o=e.B.F.I;return o[1]=r[s],o[0]=r[s+1],e.B.F.OO[0]},m:function(r,s){return r[s]<<8|r[s+1]},Ow:function(r,s,o){r[s]=o>>8&255,r[s+1]=o&255},aS:function(r,s,o){for(var a=[],u=0;u<o;u++){var l=e.B.m(r,s+u*2);a.push(l)}return a},k:function(r,s){var o=e.B.F.I;return o[3]=r[s],o[2]=r[s+1],o[1]=r[s+2],o[0]=r[s+3],e.B.F.as[0]},Oy:function(r,s,o){r[s]=o>>24&255,r[s+1]=o>>16&255,r[s+2]=o>>8&255,r[s+3]=o>>0&255},K:function(r,s){return e.B.k(r,s)*(4294967295+1)+e.B.k(r,s+4)},$:function(r,s,o){for(var a="",u=0;u<o;u++)a+=String.fromCharCode(r[s+u]);return a},Ok:function(r,s,o){for(var a=0;a<o.length;a++)r[s+a]=o.charCodeAt(a)},i:function(r,s,o){for(var a="",u=0;u<o;u++){var l=r[s++]<<8|r[s++];a+=String.fromCharCode(l)}return a},al:window.TextDecoder?new window.TextDecoder:null,aH:function(r,s,o){var a=e.B.al;return a&&s==0&&o==r.length?a.decode(r):e.B.$(r,s,o)},Q:function(r,s,o){for(var a=[],u=0;u<o;u++)a.push(r[s+u]);return a},Oh:function(r,s,o){for(var a=[],u=0;u<o;u++)a.push(String.fromCharCode(r[s+u]));return a},F:function(){var r=new ArrayBuffer(8);return{ai:r,Oa:new Int8Array(r),I:new Uint8Array(r),OO:new Int16Array(r),ak:new Uint16Array(r),aW:new Int32Array(r),as:new Uint32Array(r)}}()},e.T.O={V:function(r,s,o){var a=e.B,u=e.T.O;r=new Uint8Array(r.buffer,s,o),s=0;var l=r[s];s++;var v=r[s];s++;var p=r[s];s++;var c=r[s];s++;var _=[];s=u.o(r,s,_);for(var f=[],g=0;g<_.length-1;g++)f.push(a.$(r,s+_[g],_[g+1]-_[g]));s+=_[_.length-1];var y=[];s=u.o(r,s,y);for(var w=[],g=0;g<y.length-1;g++)w.push(u.q(r,s+y[g],s+y[g+1]));s+=y[y.length-1];var M=w[0],T=[];s=u.o(r,s,T);for(var B=[],g=0;g<T.length-1;g++)B.push(a.$(r,s+T[g],T[g+1]-T[g]));if(s+=T[T.length-1],u.M(r,s,M),M.CharStrings&&(M.CharStrings=u.Q(r,M.CharStrings)),M.ROS){s=M.FDArray;var H=[];s=u.o(r,s,H),M.FDArray=[];for(var g=0;g<H.length-1;g++){var J=u.q(r,s+H[g],s+H[g+1]);u.D(r,J,B),M.FDArray.push(J)}s+=H[H.length-1],s=M.FDSelect,M.FDSelect=[];var Q=r[s];if(s++,Q==3){var q=a.m(r,s);s+=2;for(var g=0;g<q+1;g++)M.FDSelect.push(a.m(r,s),r[s+2]),s+=3}else throw Q}return M.charset&&(M.charset=u.au(r,M.charset,M.CharStrings.length)),u.D(r,M,B),M},D:function(r,s,o){var a=e.T.O,u;s.Private&&(u=s.Private[1],s.Private=a.q(r,u,u+s.Private[0]),s.Private.Subrs&&a.M(r,u+s.Private.Subrs,s.Private));for(var l in s)"FamilyName FontName FullName Notice version Copyright".split(" ").indexOf(l)!=-1&&(s[l]=o[s[l]-426+35])},M:function(r,s,o){o.Subrs=e.T.O.Q(r,s);var a,u=o.Subrs.length+1;u<1240?a=107:u<33900?a=1131:a=32768,o.Bias=a},Q:function(r,s){var o=e.B,a=[];s=e.T.O.o(r,s,a);for(var u=[],l=a.length-1,v=r.byteOffset+s,p=0;p<l;p++){var c=a[p];u.push(new Uint8Array(r.buffer,v+c,a[p+1]-c))}return u},af:[0,0,0,0,0,0,0,0,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],at:function(r,s){for(var o=0;o<r.charset.length;o++)if(r.charset[o]==s)return o;return-1},r:function(r,s){return s<0||s>255?-1:e.T.O.at(r,e.T.O.af[s])},au:function(r,s,o){var a=e.B,u=[".notdef"],l=r[s];if(s++,l==0)for(var v=0;v<o;v++){var p=a.m(r,s);s+=2,u.push(p)}else if(l==1||l==2)for(;u.length<o;){var p=a.m(r,s),c=0;s+=2,l==1?(c=r[s],s++):(c=a.m(r,s),s+=2);for(var v=0;v<=c;v++)u.push(p),p++}else throw"error: format: "+l;return u},o:function(r,s,o){var a=e.B,u=a.m(r,s)+1;s+=2;var l=r[s];if(s++,l==1)for(var v=0;v<u;v++)o.push(r[s+v]);else if(l==2)for(var v=0;v<u;v++)o.push(a.m(r,s+v*2));else if(l==3)for(var v=0;v<u;v++)o.push(a.k(r,s+v*3-1)&16777215);else if(l==4)for(var v=0;v<u;v++)o.push(a.k(r,s+v*4));else if(u!=1)throw"unsupported offset size: "+l+", count: "+u;return s+=u*l,s-1},OS:function(r,s,o){var a=e.B,u=r[s],l=r[s+1],v=r[s+2],p=r[s+3],c=r[s+4],_=1,f=null,g=null;u<=20&&(f=u,_=1),u==12&&(f=u*100+l,_=2),21<=u&&u<=27&&(f=u,_=1),u==28&&(g=a.R(r,s+1),_=3),29<=u&&u<=31&&(f=u,_=1),32<=u&&u<=246&&(g=u-139,_=1),247<=u&&u<=250&&(g=(u-247)*256+l+108,_=2),251<=u&&u<=254&&(g=-(u-251)*256-l-108,_=2),u==255&&(g=a.N(r,s+1)/65535,_=5),o.aR=g!=null?g:"o"+f,o.size=_},OA:function(r,s,o){for(var a=s+o,u=e.B,l=[];s<a;){var v=r[s],p=r[s+1],c=r[s+2],_=r[s+3],f=r[s+4],g=1,y=null,w=null;v<=20&&(y=v,g=1),v==12&&(y=v*100+p,g=2),(v==19||v==20)&&(y=v,g=2),21<=v&&v<=27&&(y=v,g=1),v==28&&(w=u.R(r,s+1),g=3),29<=v&&v<=31&&(y=v,g=1),32<=v&&v<=246&&(w=v-139,g=1),247<=v&&v<=250&&(w=(v-247)*256+p+108,g=2),251<=v&&v<=254&&(w=-(v-251)*256-p-108,g=2),v==255&&(w=u.N(r,s+1)/65535,g=5),l.push(w!=null?w:"o"+y),s+=g}return l},q:function(r,s,o){for(var a=e.B,u={},l=[];s<o;){var v=r[s],p=r[s+1],c=r[s+2],_=r[s+3],f=r[s+4],g=1,y=null,w=null;if(v==28&&(w=a.R(r,s+1),g=3),v==29&&(w=a.N(r,s+1),g=5),32<=v&&v<=246&&(w=v-139,g=1),247<=v&&v<=250&&(w=(v-247)*256+p+108,g=2),251<=v&&v<=254&&(w=-(v-251)*256-p-108,g=2),v==255)throw w=a.N(r,s+1)/65535,g=5,"unknown number";if(v==30){var M=[],T="";for(g=1;;){var B=r[s+g];g++;var H=B>>4,J=B&15;if(H!=15&&M.push(H),J!=15&&M.push(J),J==15)break}for(var Q=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],q=0;q<M.length;q++)T+=Q[M[q]];w=parseFloat(T)}if(v<=21){var O="version Notice FullName FamilyName Weight FontBBox BlueValues OtherBlues FamilyBlues FamilyOtherBlues StdHW StdVW escape UniqueID XUID charset Encoding CharStrings Private Subrs defaultWidthX nominalWidthX".split(" ");if(y=O[v],g=1,v==12){var O="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(" ");y=O[p],g=2}}y!=null?(u[y]=l.length==1?l[0]:l,l=[]):l.push(w),s+=g}return u}},e.T.w={V:function(r,s,o){var a={_:[],S:{},ac:s};r=new Uint8Array(r.buffer,s,o),s=0;var u=s,l=e.B,v=l.m,p=e.T.w,c=v(r,s);s+=2;var _=v(r,s);s+=2;for(var f=[],g=0;g<_;g++){var y=v(r,s);s+=2;var w=v(r,s);s+=2;var M=l.k(r,s);s+=4;var T="p"+y+"e"+w,B=f.indexOf(M);if(B==-1){B=a._.length;var H={};f.push(M);var J=H.a_=v(r,M);J==0?H=p.Ox(r,M,H):J==4?H=p.aA(r,M,H):J==6?H=p.aX(r,M,H):J==12&&(H=p.aZ(r,M,H)),a._.push(H)}if(a.S[T]!=null)throw"multiple tables for one platform+encoding";a.S[T]=B}return a},Ox:function(r,s,o){var a=e.B;s+=2;var u=a.m(r,s);s+=2;var l=a.m(r,s);s+=2,o.map=[];for(var v=0;v<u-6;v++)o.map.push(r[s+v]);return o},aA:function(r,s,o){var a=e.B,u=a.m,l=a.aS,v=s;s+=2;var p=u(r,s);s+=2;var c=u(r,s);s+=2;var _=u(r,s);s+=2;var f=_>>>1;o.aB=u(r,s),s+=2,o.aV=u(r,s),s+=2,o.aY=u(r,s),s+=2,o.aa=l(r,s,f),s+=f*2,s+=2,o.aT=l(r,s,f),s+=f*2,o.ab=[];for(var g=0;g<f;g++)o.ab.push(a.R(r,s)),s+=2;return o.T=l(r,s,f),s+=f*2,o.l=l(r,s,v+p-s>>>1),o},aX:function(r,s,o){var a=e.B,u=s;s+=2;var l=a.m(r,s);s+=2;var v=a.m(r,s);s+=2,o.ax=a.m(r,s),s+=2;var p=a.m(r,s);s+=2,o.l=[];for(var c=0;c<p;c++)o.l.push(a.m(r,s)),s+=2;return o},aZ:function(r,s,o){var a=e.B,u=a.k,l=s;s+=4;var v=u(r,s);s+=4;var p=u(r,s);s+=4;var c=u(r,s)*3;s+=4;for(var _=o.ay=new Uint32Array(c),f=0;f<c;f+=3)_[f]=u(r,s+(f<<2)),_[f+1]=u(r,s+(f<<2)+4),_[f+2]=u(r,s+(f<<2)+8);return o}},e.T.n={V:function(r,s,o,a){for(var u=[],l=a.maxp.numGlyphs,v=0;v<l;v++)u.push(null);return u},ar:function(r,s){var o=e.B,a=r._data,u=r.loca;if(u[s]==u[s+1])return null;var l=e.findTable(a,"glyf",r._offset)[0]+u[s],v={};if(v.L=o.R(a,l),l+=2,v.aU=o.R(a,l),l+=2,v.an=o.R(a,l),l+=2,v.ad=o.R(a,l),l+=2,v.ao=o.R(a,l),l+=2,v.aU>=v.ad||v.an>=v.ao)return null;if(v.L>0){v.c=[];for(var p=0;p<v.L;p++)v.c.push(o.m(a,l)),l+=2;var c=o.m(a,l),_=0,f=0;if(l+=2,a.length-l<c)return null;v.aq=o.Q(a,l,c),l+=c;var g=v.c[v.L-1]+1;v.G=[];for(var p=0;p<g;p++){var y=a[l];if(l++,v.G.push(y),(y&8)!=0){var w=a[l];l++;for(var M=0;M<w;M++)v.G.push(y),p++}}v.a=[];for(var p=0;p<g;p++){var T=(v.G[p]&2)!=0,B=(v.G[p]&16)!=0;T?(v.a.push(B?a[l]:-a[l]),l++):B?v.a.push(0):(v.a.push(o.R(a,l)),l+=2)}v.s=[];for(var p=0;p<g;p++){var T=(v.G[p]&4)!=0,B=(v.G[p]&32)!=0;T?(v.s.push(B?a[l]:-a[l]),l++):B?v.s.push(0):(v.s.push(o.R(a,l)),l+=2)}for(var p=0;p<g;p++)_+=v.a[p],f+=v.s[p],v.a[p]=_,v.s[p]=f}else{var H=1<<0,J=1<<1,Q=1<<2,q=1<<3,O=1<<4,K=1<<5,pe=1<<6,R=1<<7,Te=1<<8,re=1<<9,oe=1<<10,me=1<<11,ue=1<<12,$;v.b=[];do{$=o.m(a,l),l+=2;var ee={A:{X:1,aC:0,aO:0,H:1,Os:0,av:0},ae:-1,aP:-1};if(v.b.push(ee),ee.ap=o.m(a,l),l+=2,$&H){var ne=o.R(a,l);l+=2;var _e=o.R(a,l);l+=2}else{var ne=o.j(a,l);l++;var _e=o.j(a,l);l++}$&J?(ee.A.Os=ne,ee.A.av=_e):(ee.ae=ne,ee.aP=_e),$&q?(ee.A.X=ee.A.H=o.g(a,l),l+=2):$&pe?(ee.A.X=o.g(a,l),l+=2,ee.A.H=o.g(a,l),l+=2):$&R&&(ee.A.X=o.g(a,l),l+=2,ee.A.aC=o.g(a,l),l+=2,ee.A.aO=o.g(a,l),l+=2,ee.A.H=o.g(a,l),l+=2)}while($&K);if($&Te){var ae=o.m(a,l);l+=2,v.ag=[];for(var p=0;p<ae;p++)v.ag.push(a[l]),l++}}return v}},e.T.head={V:function(r,s,o){var a=e.B,u={},l=a.v(r,s);s+=4,u.fontRevision=a.v(r,s),s+=4;var v=a.k(r,s);s+=4;var p=a.k(r,s);return s+=4,u.flags=a.m(r,s),s+=2,u.unitsPerEm=a.m(r,s),s+=2,u.created=a.K(r,s),s+=8,u.modified=a.K(r,s),s+=8,u.xMin=a.R(r,s),s+=2,u.yMin=a.R(r,s),s+=2,u.xMax=a.R(r,s),s+=2,u.yMax=a.R(r,s),s+=2,u.macStyle=a.m(r,s),s+=2,u.lowestRecPPEM=a.m(r,s),s+=2,u.fontDirectionHint=a.R(r,s),s+=2,u.indexToLocFormat=a.R(r,s),s+=2,u.glyphDataFormat=a.R(r,s),s+=2,u}},e.T.am={V:function(r,s,o){var a=e.B,u={},l=a.v(r,s);s+=4;for(var v="ascender descender lineGap advanceWidthMax minLeftSideBearing minRightSideBearing xMaxExtent caretSlopeRise caretSlopeRun caretOffset res0 res1 res2 res3 metricDataFormat numberOfHMetrics".split(" "),p=0;p<v.length;p++){var c=v[p],_=c=="advanceWidthMax"||c=="numberOfHMetrics"?a.m:a.R;u[c]=_(r,s+p*2)}return u}},e.T.ah={V:function(r,s,o,a){for(var u=e.B,l=[],v=[],p=a.maxp.numGlyphs,c=a.hhea.numberOfHMetrics,_=0,f=0,g=0;g<c;)_=u.m(r,s+(g<<2)),f=u.R(r,s+(g<<2)+2),l.push(_),v.push(f),g++;for(;g<p;)l.push(_),v.push(f),g++;return{aE:l,aI:v}}},e.T.C={V:function(r,s,o,a){var u=e.B,l=e.T.C,v=u.m(r,s);if(v==1)return l.a$(r,s,o,a);var p=u.m(r,s+2);s+=4;for(var c={J:[],z:[]},_=0;_<p;_++){s+=2;var o=u.m(r,s);s+=2;var f=u.m(r,s);s+=2;var g=f>>>8;g&=15,g==0&&(s=l.h(r,s,c))}return c},a$:function(r,s,o,a){var u=e.B,l=e.T.C,v=u.v(r,s),p=u.k(r,s+4);s+=8;for(var c={J:[],z:[]},_=0;_<p;_++){var o=u.k(r,s);s+=4;var f=u.m(r,s);s+=2;var g=u.m(r,s);s+=2;var y=f&255;y==0&&(s=l.h(r,s,c))}return c},h:function(r,s,o){var a=e.B,u=a.m,l=-1,v=u(r,s),p=u(r,s+2),c=u(r,s+4),_=u(r,s+6);s+=8;for(var f=0;f<v;f++){var g=u(r,s);s+=2;var y=u(r,s);s+=2;var w=a.R(r,s);s+=2,g!=l&&(o.J.push(g),o.z.push({aw:[],aG:[]}));var M=o.z[o.z.length-1];M.aw.push(y),M.aG.push(w),l=g}return s}},e.T.az={V:function(r,s,o,a){var u=e.B,l=[],v=a.head.indexToLocFormat,p=a.maxp.numGlyphs+1;if(v==0)for(var c=0;c<p;c++)l.push(u.m(r,s+(c<<1))<<1);if(v==1)for(var c=0;c<p;c++)l.push(u.k(r,s+(c<<2)));return l}},e.T.aQ={V:function(r,s,o){var a=e.B,u=a.m,l={},v=a.k(r,s);return s+=4,l.numGlyphs=u(r,s),s+=2,l}},e.T.name={V:function(r,s,o){var a=e.B,u={},l=a.m(r,s),v="postScriptName",p;s+=2;var c=a.m(r,s);s+=2;var _=a.m(r,s);s+=2;for(var f="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=s,y=a.m,w=0;w<c;w++){var M=y(r,s),T;s+=2;var B=y(r,s);s+=2;var H=y(r,s);s+=2;var J=y(r,s);s+=2;var Q=y(r,s);s+=2;var q=y(r,s);s+=2;var O=g+c*12+q;M==0||M==3&&B==0?T=a.i(r,O,Q/2):B==0?T=a.$(r,O,Q):B==1||B==3||B==4||B==10?T=a.i(r,O,Q/2):M==1?(T=a.$(r,O,Q),console.log("reading unknown MAC encoding "+B+" as ASCII")):(console.log("unknown encoding "+B+", platformID: "+M),T=a.$(r,O,Q));var K="p"+M+","+H.toString(16);u[K]==null&&(u[K]={}),u[K][f[J]]=T,u[K]._lang=H}for(var pe in u)if(u[pe][v]!=null&&u[pe]._lang==1033)return u[pe];for(var pe in u)if(u[pe][v]!=null&&u[pe]._lang==0)return u[pe];for(var pe in u)if(u[pe][v]!=null&&u[pe]._lang==3084)return u[pe];for(var pe in u)if(u[pe][v]!=null)return u[pe];for(var pe in u){p=u[pe];break}return console.log("returning name table with languageID "+p.Ov),p[v]==null&&p.ID!=null&&(p[v]=p.ID),p}},e.T.f={V:function(r,s,o){var a=e.B,u=a.m(r,s);s+=2;var l=e.T.f,v={};if(u==0)l.B(r,s,v);else if(u==1)l.p(r,s,v);else if(u==2||u==3||u==4)l.Om(r,s,v);else if(u==5)l.aJ(r,s,v);else throw"unknown OS/2 table version: "+u;return v},B:function(r,s,o){var a=e.B;return o.xAvgCharWidth=a.R(r,s),s+=2,o.usWeightClass=a.m(r,s),s+=2,o.usWidthClass=a.m(r,s),s+=2,o.fsType=a.m(r,s),s+=2,o.ySubscriptXSize=a.R(r,s),s+=2,o.ySubscriptYSize=a.R(r,s),s+=2,o.ySubscriptXOffset=a.R(r,s),s+=2,o.ySubscriptYOffset=a.R(r,s),s+=2,o.ySuperscriptXSize=a.R(r,s),s+=2,o.ySuperscriptYSize=a.R(r,s),s+=2,o.ySuperscriptXOffset=a.R(r,s),s+=2,o.ySuperscriptYOffset=a.R(r,s),s+=2,o.yStrikeoutSize=a.R(r,s),s+=2,o.yStrikeoutPosition=a.R(r,s),s+=2,o.sFamilyClass=a.R(r,s),s+=2,o.panose=a.Q(r,s,10),s+=10,o.ulUnicodeRange1=a.k(r,s),s+=4,o.ulUnicodeRange2=a.k(r,s),s+=4,o.ulUnicodeRange3=a.k(r,s),s+=4,o.ulUnicodeRange4=a.k(r,s),s+=4,o.achVendID=a.$(r,s,4),s+=4,o.fsSelection=a.m(r,s),s+=2,o.usFirstCharIndex=a.m(r,s),s+=2,o.usLastCharIndex=a.m(r,s),s+=2,o.sTypoAscender=a.R(r,s),s+=2,o.sTypoDescender=a.R(r,s),s+=2,o.sTypoLineGap=a.R(r,s),s+=2,o.usWinAscent=a.m(r,s),s+=2,o.usWinDescent=a.m(r,s),s+=2,s},p:function(r,s,o){var a=e.B;return s=e.T.f.B(r,s,o),o.ulCodePageRange1=a.k(r,s),s+=4,o.ulCodePageRange2=a.k(r,s),s+=4,s},Om:function(r,s,o){var a=e.B,u=a.m;return s=e.T.f.p(r,s,o),o.sxHeight=a.R(r,s),s+=2,o.sCapHeight=a.R(r,s),s+=2,o.usDefault=u(r,s),s+=2,o.usBreak=u(r,s),s+=2,o.usMaxContext=u(r,s),s+=2,s},aJ:function(r,s,o){var a=e.B.m;return s=e.T.f.Om(r,s,o),o.usLowerOpticalPointSize=a(r,s),s+=2,o.usUpperOpticalPointSize=a(r,s),s+=2,s}},e.T.aj={V:function(r,s,o){var a=e.B,u={};return u.version=a.v(r,s),s+=4,u.italicAngle=a.v(r,s),s+=4,u.underlinePosition=a.R(r,s),s+=2,u.underlineThickness=a.R(r,s),s+=2,u}},e.T.aK={V:function(r,s,o){var a=e.B,u={entries:[]},l=s,v=a.m(r,s);s+=2;var p=a.k(r,s);s+=4;var c=a.k(r,s);s+=4,s=p+l;var _=a.m(r,s);s+=2;for(var f=0;f<_;f++){var g=a.m(r,s);s+=2;var y=a.m(r,s);s+=2;var w=a.k(r,s);s+=4;var M=a.k(r,s);s+=4;for(var T=new Uint8Array(r.buffer,l+w+p,M),B=a.aH(T,0,T.length),H=g;H<=y;H++)u.entries[H]=B}return u}},e.U={shape:function(r,s,o){for(var a=function(w,M,T,B){var H=M[T],J=M[T+1],Q=w.kern;if(Q){var q=Q.J.indexOf(H);if(q!=-1){var O=Q.z[q].aw.indexOf(J);if(O!=-1)return[0,0,Q.z[q].aG[O],0]}}return[0,0,0,0]},u=[],l=0,v=0,p=0;p<s.length;p++){var c=s.codePointAt(p);c>65535&&p++,u.push(e.U.codeToGlyph(r,c))}for(var _=[],p=0;p<u.length;p++){var f=a(r,u,p,o),g=u[p],y=r.hmtx.aE[g]+f[2];_.push({g,cl:p,dx:0,dy:0,ax:y,ay:0}),l+=y}return _},shapeToPath:function(r,s,o){for(var a={d:[],U:[]},u=0,l=0,v=0;v<s.length;v++){for(var p=s[v],c=e.U.glyphToPath(r,p.g),_=c.crds,f=0;f<_.length;f+=2)a.U.push(_[f]+u+p.dx),a.U.push(_[f+1]+l+p.dy);o&&a.d.push(o);for(var f=0;f<c.cmds.length;f++)a.d.push(c.cmds[f]);var g=a.d.length;o&&g!=0&&a.d[g-1]!="X"&&a.d.push("X"),u+=p.ax,l+=p.ay}return{cmds:a.d,crds:a.U}},codeToGlyph:function(r,s){for(var o=r.cmap,a=-1,u="p3e10 p0e4 p3e1 p1e0 p0e3 p0e1".split(" "),l=0;l<u.length;l++)if(o.S[u[l]]!=null){a=o.S[u[l]];break}if(a==-1)throw"no familiar platform and encoding!";var v=function(J,Q,q){for(var O=0,K=Math.floor(J.length/Q);O+1!=K;){var pe=O+(K-O>>>1);J[pe*Q]<=q?O=pe:K=pe}return O*Q},p=o._[a],c=p.a_,_=-1;if(c==0)s>=p.map.length?_=0:_=p.map[s];else if(c==4){var f=-1,g=p.aa;if(s>g[g.length-1]?f=-1:(f=v(g,1,s),g[f]<s&&f++),f==-1)_=0;else if(s<p.aT[f])_=0;else{var y=0;p.T[f]!=0?y=p.l[s-p.aT[f]+(p.T[f]>>1)-(p.T.length-f)]:y=s+p.ab[f],_=y&65535}}else if(c==6){var w=s-p.ax,M=p.l;w<0||w>=M.length?_=0:_=M[w]}else if(c==12){var T=p.ay;if(s>T[T.length-2])_=0;else{var l=v(T,3,s);T[l]<=s&&s<=T[l+1]&&(_=T[l+2]+(s-T[l])),_==-1&&(_=0)}}else throw"unknown cmap table format "+p.a_;var B=r["SVG "],H=r.loca;return _!=0&&r["CFF "]==null&&(B==null||B.entries[_]==null)&&H[_]==H[_+1]&&[9,10,11,12,13,32,133,160,5760,8232,8233,8239,12288,6158,8203,8204,8205,8288,65279].indexOf(s)==-1&&!(8192<=s&&s<=8202)&&(_=0),_},glyphToPath:function(r,s){var o={d:[],U:[]},a=r["SVG "],u=r["CFF "],l=e.U;if(a&&a.entries[s]){var v=a.entries[s];v!=null&&(typeof v=="string"&&(v=l.SVG.aD(v),a.entries[s]=v),o=v)}else if(u){var p=u.Private,c={x:0,y:0,stack:[],e:0,P:!1,width:p?p.defaultWidthX:0,open:!1};if(u.ROS){for(var _=0;u.FDSelect[_+2]<=s;)_+=2;p=u.FDArray[u.FDSelect[_+1]].Private}l._drawCFF(u.CharStrings[s],c,u,p,o)}else r.glyf&&l._drawGlyf(s,r,o);return{cmds:o.d,crds:o.U}},_drawGlyf:function(r,s,o){var a=s.glyf[r];a==null&&(a=s.glyf[r]=e.T.n.ar(s,r)),a!=null&&(a.L>-1?e.U._simpleGlyph(a,o):e.U._compoGlyph(a,s,o))},_simpleGlyph:function(r,s){for(var o=e.U.P,a=0;a<r.L;a++){for(var u=a==0?0:r.c[a-1]+1,l=r.c[a],v=u;v<=l;v++){var p=v==u?l:v-1,c=v==l?u:v+1,_=r.G[v]&1,f=r.G[p]&1,g=r.G[c]&1,y=r.a[v],w=r.s[v];if(v==u)if(_)if(f)o.u(s,r.a[p],r.s[p]);else{o.u(s,y,w);continue}else f?o.u(s,r.a[p],r.s[p]):o.u(s,Math.floor((r.a[p]+y)*.5),Math.floor((r.s[p]+w)*.5));_?f&&o.Z(s,y,w):g?o.OR(s,y,w,r.a[c],r.s[c]):o.OR(s,y,w,Math.floor((y+r.a[c])*.5),Math.floor((w+r.s[c])*.5))}o.W(s)}},_compoGlyph:function(r,s,o){for(var a=0;a<r.b.length;a++){var u={d:[],U:[]},l=r.b[a];e.U._drawGlyf(l.ap,s,u);for(var v=l.A,p=0;p<u.U.length;p+=2){var c=u.U[p],_=u.U[p+1];o.U.push(c*v.X+_*v.aC+v.Os),o.U.push(c*v.aO+_*v.H+v.av)}for(var p=0;p<u.d.length;p++)o.d.push(u.d[p])}},pathToSVG:function(r,s){var o=r.cmds,a=r.crds,u=0;s==null&&(s=5);for(var l=[],v={M:2,L:2,Q:4,C:6},p=0;p<o.length;p++){var c=o[p],_=u+(v[c]?v[c]:0);for(l.push(c);u<_;){var f=a[u++];l.push(parseFloat(f.toFixed(s))+(u==_?"":" "))}}return l.join("")},SVGToPath:function(r){var s={d:[],U:[]};return e.U.SVG.aM(r,s),{cmds:s.d,crds:s.U}},pathToContext:function(r,s){for(var o=0,a=r.cmds,u=r.crds,l=0;l<a.length;l++){var v=a[l];v=="M"?(s.moveTo(u[o],u[o+1]),o+=2):v=="L"?(s.lineTo(u[o],u[o+1]),o+=2):v=="C"?(s.bezierCurveTo(u[o],u[o+1],u[o+2],u[o+3],u[o+4],u[o+5]),o+=6):v=="Q"?(s.quadraticCurveTo(u[o],u[o+1],u[o+2],u[o+3]),o+=4):v.charAt(0)=="#"?(s.beginPath(),s.fillStyle=v):v=="Z"?s.closePath():v=="X"&&s.fill()}},P:{u:function(r,s,o){r.d.push("M"),r.U.push(s,o)},Z:function(r,s,o){r.d.push("L"),r.U.push(s,o)},Y:function(r,s,o,a,u,l,v){r.d.push("C"),r.U.push(s,o,a,u,l,v)},OR:function(r,s,o,a,u){r.d.push("Q"),r.U.push(s,o,a,u)},W:function(r){r.d.push("Z")}},_drawCFF:function(r,s,o,a,u){for(var l=s.stack,v=s.e,p=s.P,c=s.width,_=s.open,f=0,g=s.x,y=s.y,w=0,M=0,T=0,B=0,H=0,J=0,Q=0,q=0,O=0,K=0,pe=e.T.O,R=e.U.P,Te=a.nominalWidthX,re={aR:0,size:0};f<r.length;){pe.OS(r,f,re);var oe=re.aR;if(f+=re.size,oe=="o1"||oe=="o18"){var me;me=l.length%2!=0,me&&!p&&(c=l.shift()+Te),v+=l.length>>1,l.length=0,p=!0}else if(oe=="o3"||oe=="o23"){var me;me=l.length%2!=0,me&&!p&&(c=l.shift()+Te),v+=l.length>>1,l.length=0,p=!0}else if(oe=="o4")l.length>1&&!p&&(c=l.shift()+Te,p=!0),_&&R.W(u),y+=l.pop(),R.u(u,g,y),_=!0;else if(oe=="o5")for(;l.length>0;)g+=l.shift(),y+=l.shift(),R.Z(u,g,y);else if(oe=="o6"||oe=="o7")for(var ue=l.length,$=oe=="o6",ee=0;ee<ue;ee++){var ne=l.shift();$?g+=ne:y+=ne,$=!$,R.Z(u,g,y)}else if(oe=="o8"||oe=="o24"){for(var ue=l.length,_e=0;_e+6<=ue;)w=g+l.shift(),M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),g=T+l.shift(),y=B+l.shift(),R.Y(u,w,M,T,B,g,y),_e+=6;oe=="o24"&&(g+=l.shift(),y+=l.shift(),R.Z(u,g,y))}else{if(oe=="o11")break;if(oe=="o1234"||oe=="o1235"||oe=="o1236"||oe=="o1237")oe=="o1234"&&(w=g+l.shift(),M=y,T=w+l.shift(),B=M+l.shift(),O=T+l.shift(),K=B,H=O+l.shift(),J=B,Q=H+l.shift(),q=y,g=Q+l.shift(),R.Y(u,w,M,T,B,O,K),R.Y(u,H,J,Q,q,g,y)),oe=="o1235"&&(w=g+l.shift(),M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),O=T+l.shift(),K=B+l.shift(),H=O+l.shift(),J=K+l.shift(),Q=H+l.shift(),q=J+l.shift(),g=Q+l.shift(),y=q+l.shift(),l.shift(),R.Y(u,w,M,T,B,O,K),R.Y(u,H,J,Q,q,g,y)),oe=="o1236"&&(w=g+l.shift(),M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),O=T+l.shift(),K=B,H=O+l.shift(),J=B,Q=H+l.shift(),q=J+l.shift(),g=Q+l.shift(),R.Y(u,w,M,T,B,O,K),R.Y(u,H,J,Q,q,g,y)),oe=="o1237"&&(w=g+l.shift(),M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),O=T+l.shift(),K=B+l.shift(),H=O+l.shift(),J=K+l.shift(),Q=H+l.shift(),q=J+l.shift(),Math.abs(Q-g)>Math.abs(q-y)?g=Q+l.shift():y=q+l.shift(),R.Y(u,w,M,T,B,O,K),R.Y(u,H,J,Q,q,g,y));else if(oe=="o14"){if(l.length>0&&!p&&(c=l.shift()+o.nominalWidthX,p=!0),l.length==4){var ae=0,Me=l.shift(),Ne=l.shift(),Ae=l.shift(),Fe=l.shift(),De=pe.r(o,Ae),ze=pe.r(o,Fe);e.U._drawCFF(o.CharStrings[De],s,o,a,u),s.x=Me,s.y=Ne,e.U._drawCFF(o.CharStrings[ze],s,o,a,u)}_&&(R.W(u),_=!1)}else if(oe=="o19"||oe=="o20"){var me;me=l.length%2!=0,me&&!p&&(c=l.shift()+Te),v+=l.length>>1,l.length=0,p=!0,f+=v+7>>3}else if(oe=="o21")l.length>2&&!p&&(c=l.shift()+Te,p=!0),y+=l.pop(),g+=l.pop(),_&&R.W(u),R.u(u,g,y),_=!0;else if(oe=="o22")l.length>1&&!p&&(c=l.shift()+Te,p=!0),g+=l.pop(),_&&R.W(u),R.u(u,g,y),_=!0;else if(oe=="o25"){for(;l.length>6;)g+=l.shift(),y+=l.shift(),R.Z(u,g,y);w=g+l.shift(),M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),g=T+l.shift(),y=B+l.shift(),R.Y(u,w,M,T,B,g,y)}else if(oe=="o26")for(l.length%2&&(g+=l.shift());l.length>0;)w=g,M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),g=T,y=B+l.shift(),R.Y(u,w,M,T,B,g,y);else if(oe=="o27")for(l.length%2&&(y+=l.shift());l.length>0;)w=g+l.shift(),M=y,T=w+l.shift(),B=M+l.shift(),g=T+l.shift(),y=B,R.Y(u,w,M,T,B,g,y);else if(oe=="o10"||oe=="o29"){var ye=oe=="o10"?a:o;if(l.length==0)console.log("error: empty stack");else{var he=l.pop(),ke=ye.Subrs[he+ye.Bias];s.x=g,s.y=y,s.e=v,s.P=p,s.width=c,s.open=_,e.U._drawCFF(ke,s,o,a,u),g=s.x,y=s.y,v=s.e,p=s.P,c=s.width,_=s.open}}else if(oe=="o30"||oe=="o31"){var ue,le=l.length,_e=0,Ce=oe=="o31";for(ue=le&~2,_e+=le-ue;_e<ue;)Ce?(w=g+l.shift(),M=y,T=w+l.shift(),B=M+l.shift(),y=B+l.shift(),ue-_e==5?(g=T+l.shift(),_e++):g=T,Ce=!1):(w=g,M=y+l.shift(),T=w+l.shift(),B=M+l.shift(),g=T+l.shift(),ue-_e==5?(y=B+l.shift(),_e++):y=B,Ce=!0),R.Y(u,w,M,T,B,g,y),_e+=4}else{if((oe+"").charAt(0)=="o")throw console.log("Unknown operation: "+oe,r),oe;l.push(oe)}}}s.x=g,s.y=y,s.e=v,s.P=p,s.width=c,s.open=_},SVG:function(){var r={OU:function(f){return Math.sqrt(Math.abs(f[0]*f[3]-f[1]*f[2]))},translate:function(f,g,y){r.concat(f,[1,0,0,1,g,y])},rotate:function(f,g){r.concat(f,[Math.cos(g),-Math.sin(g),Math.sin(g),Math.cos(g),0,0])},scale:function(f,g,y){r.concat(f,[g,0,0,y,0,0])},concat:function(f,g){var y=f[0],w=f[1],M=f[2],T=f[3],B=f[4],H=f[5];f[0]=y*g[0]+w*g[2],f[1]=y*g[1]+w*g[3],f[2]=M*g[0]+T*g[2],f[3]=M*g[1]+T*g[3],f[4]=B*g[0]+H*g[2]+g[4],f[5]=B*g[1]+H*g[3]+g[5]},On:function(f){var g=f[0],y=f[1],w=f[2],M=f[3],T=f[4],B=f[5],H=g*M-y*w;f[0]=M/H,f[1]=-y/H,f[2]=-w/H,f[3]=g/H,f[4]=(w*B-M*T)/H,f[5]=(y*T-g*B)/H},Oi:function(f,g){var y=g[0],w=g[1];return[y*f[0]+w*f[2]+f[4],y*f[1]+w*f[3]+f[5]]},aF:function(f,g){for(var y=0;y<g.length;y+=2){var w=g[y],M=g[y+1];g[y]=w*f[0]+M*f[2]+f[4],g[y+1]=w*f[1]+M*f[3]+f[5]}}};function s(f,g,y){for(var w=[],M=0,T=0,B=0;;){var H=f.indexOf(g,T),J=f.indexOf(y,T);if(H==-1&&J==-1)break;J==-1||H!=-1&&H<J?(B==0&&(w.push(f.slice(M,H).trim()),M=H+1),B++,T=H+1):(H==-1||J!=-1&&J<H)&&(B--,B==0&&(w.push(f.slice(M,J).trim()),M=J+1),T=J+1)}return w}function o(f){for(var g=s(f,"{","}"),y={},w=0;w<g.length;w+=2)for(var M=g[w].split(","),T=0;T<M.length;T++){var B=M[T].trim();y[B]==null&&(y[B]=""),y[B]+=g[w+1]}return y}function a(f){for(var g=s(f,"(",")"),y=[1,0,0,1,0,0],w=0;w<g.length;w+=2){var M=y;y=u(g[w],g[w+1]),r.concat(y,M)}return y}function u(f,g){for(var y=[1,0,0,1,0,0],w=!0,M=0;M<g.length;M++){var T=g.charAt(M);T==","||T==" "?w=!0:T=="."?(w||(g=g.slice(0,M)+","+g.slice(M),M++),w=!1):T=="-"&&M>0&&g[M-1]!="e"&&(g=g.slice(0,M)+" "+g.slice(M),M++,w=!0)}if(g=g.split(/\s*[\s,]\s*/).map(parseFloat),f=="translate")g.length==1?r.translate(y,g[0],0):r.translate(y,g[0],g[1]);else if(f=="scale")g.length==1?r.scale(y,g[0],g[0]):r.scale(y,g[0],g[1]);else if(f=="rotate"){var B=0,H=0;g.length!=1&&(B=g[1],H=g[2]),r.translate(y,-B,-H),r.rotate(y,-Math.PI*g[0]/180),r.translate(y,B,H)}else f=="matrix"?y=g:console.log("unknown transform: ",f);return y}function l(f){var g={d:[],U:[]};if(f==null)return g;var y=new DOMParser,w=y.parseFromString(f,"image/svg+xml"),M=w.getElementsByTagName("svg")[0],T=M.getAttribute("viewBox");T?T=T.trim().split(" ").map(parseFloat):T=[0,0,1e3,1e3],v(M.children,g);for(var B=0;B<g.U.length;B+=2){var H=g.U[B],J=g.U[B+1];H-=T[0],J-=T[1],J=-J,g.U[B]=H,g.U[B+1]=J}return g}function v(f,g,y){for(var w=0;w<f.length;w++){var M=f[w],T=M.tagName,B=M.getAttribute("fill");if(B==null&&(B=y),T=="g"){var H={U:[],d:[]};v(M.children,H,B);var J=M.getAttribute("transform");if(J){var Q=a(J);r.aF(Q,H.U)}g.U=g.U.concat(H.U),g.d=g.d.concat(H.d)}else if(T=="path"||T=="circle"||T=="ellipse"){g.d.push(B||"#000000");var q;if(T=="path"&&(q=M.getAttribute("d")),T=="circle"||T=="ellipse"){for(var O=[0,0,0,0],K=["cx","cy","rx","ry","r"],pe=0;pe<5;pe++){var R=M.getAttribute(K[pe]);R&&(R=parseFloat(R),pe<4?O[pe]=R:O[2]=O[3]=R)}var Te=O[0],re=O[1],oe=O[2],me=O[3];q=["M",Te-oe,re,"a",oe,me,0,1,0,oe*2,0,"a",oe,me,0,1,0,-oe*2,0].join(" ")}_(q,g),g.d.push("X")}else T=="defs"||console.log(T,M)}}function p(f){for(var g=[],y=0,w=!1,M="",T="";y<f.length;){var B=f.charCodeAt(y),H=f.charAt(y);y++;var J=48<=B&&B<=57||H=="."||H=="-"||H=="e"||H=="E";w?H=="-"&&T!="e"||H=="."&&M.indexOf(".")!=-1?(g.push(parseFloat(M)),M=H):J?M+=H:(g.push(parseFloat(M)),H!=","&&H!=" "&&g.push(H),w=!1):J?(M=H,w=!0):H!=","&&H!=" "&&g.push(H),T=H}return w&&g.push(parseFloat(M)),g}function c(f,g,y){for(var w=g;w<f.length&&typeof f[w]!="string";)w+=y;return(w-g)/y}function _(f,g){for(var y=p(f),w=0,M=0,T=0,B=0,H=0,J=g.U.length,Q={M:2,L:2,H:1,V:1,T:2,S:4,A:7,Q:4,C:6},q=g.d,O=g.U;w<y.length;){var K=y[w];w++;var pe=K.toUpperCase();if(pe=="Z")q.push("Z"),M=B,T=H;else for(var R=Q[pe],Te=c(y,w,R),re=0;re<Te;re++){re==1&&pe=="M"&&(K=K==pe?"L":"l",pe="L");var oe=0,me=0;if(K!=pe&&(oe=M,me=T),pe=="M")M=oe+y[w++],T=me+y[w++],q.push("M"),O.push(M,T),B=M,H=T;else if(pe=="L")M=oe+y[w++],T=me+y[w++],q.push("L"),O.push(M,T);else if(pe=="H")M=oe+y[w++],q.push("L"),O.push(M,T);else if(pe=="V")T=me+y[w++],q.push("L"),O.push(M,T);else if(pe=="Q"){var ue=oe+y[w++],$=me+y[w++],ee=oe+y[w++],ne=me+y[w++];q.push("Q"),O.push(ue,$,ee,ne),M=ee,T=ne}else if(pe=="T"){var _e=Math.max(O.length-2,J),ue=M+M-O[_e],$=T+T-O[_e+1],ee=oe+y[w++],ne=me+y[w++];q.push("Q"),O.push(ue,$,ee,ne),M=ee,T=ne}else if(pe=="C"){var ue=oe+y[w++],$=me+y[w++],ee=oe+y[w++],ne=me+y[w++],ae=oe+y[w++],Me=me+y[w++];q.push("C"),O.push(ue,$,ee,ne,ae,Me),M=ae,T=Me}else if(pe=="S"){var _e=Math.max(O.length-(q[q.length-1]=="C"?4:2),J),ue=M+M-O[_e],$=T+T-O[_e+1],ee=oe+y[w++],ne=me+y[w++],ae=oe+y[w++],Me=me+y[w++];q.push("C"),O.push(ue,$,ee,ne,ae,Me),M=ae,T=Me}else if(pe=="A"){var ue=M,$=T,Ne=y[w++],Ae=y[w++],Fe=y[w++]*(Math.PI/180),De=y[w++],ze=y[w++],ee=oe+y[w++],ne=me+y[w++];if(ee==M&&ne==T&&Ne==0&&Ae==0)continue;var ye=(ue-ee)/2,he=($-ne)/2,ke=Math.cos(Fe),le=Math.sin(Fe),Ce=ke*ye+le*he,Be=-le*ye+ke*he,we=Ne*Ne,xe=Ae*Ae,Ie=Ce*Ce,Re=Be*Be,Le=(we*xe-we*Re-xe*Ie)/(we*Re+xe*Ie),Oe=(De!=ze?1:-1)*Math.sqrt(Math.max(Le,0)),Ve=Oe*(Ne*Be)/Ae,Xe=-Oe*(Ae*Ce)/Ne,We=ke*Ve-le*Xe+(ue+ee)/2,t=le*Ve+ke*Xe+($+ne)/2,h=function(W,F,z,G){var X=Math.sqrt(W*W+F*F),A=Math.sqrt(z*z+G*G),N=(W*z+F*G)/(X*A);return(W*G-F*z>=0?1:-1)*Math.acos(Math.max(-1,Math.min(1,N)))},d=(Ce-Ve)/Ne,x=(Be-Xe)/Ae,E=h(1,0,d,x),C=h(d,x,(-Ce-Ve)/Ne,(-Be-Xe)/Ae);C=C%(2*Math.PI);var b=function(W,F,z,G,X,A,N){var I=function(st,gt){var ft=Math.sin(gt),ct=Math.cos(gt),gt=st[0],_t=st[1],Et=st[2],mt=st[3];st[0]=gt*ct+_t*ft,st[1]=-gt*ft+_t*ct,st[2]=Et*ct+mt*ft,st[3]=-Et*ft+mt*ct},te=function(st,gt){for(var ft=0;ft<gt.length;ft+=2){var ct=gt[ft],_t=gt[ft+1];gt[ft]=st[0]*ct+st[2]*_t+st[4],gt[ft+1]=st[1]*ct+st[3]*_t+st[5]}},fe=function(st,gt){for(var ft=0;ft<gt.length;ft++)st.push(gt[ft])},S=function(st,gt){fe(st.d,gt.d),fe(st.U,gt.U)};if(N)for(;A>X;)A-=2*Math.PI;else for(;A<X;)A+=2*Math.PI;var de=(A-X)/4,se=Math.cos(de/2),ie=-Math.sin(de/2),ge=(4-se)/3,Pe=ie==0?ie:(1-se)*(3-se)/(3*ie),Ye=ge,Ge=-Pe,Ze=se,Je=-ie,tt=[ge,Pe,Ye,Ge,Ze,Je],nt={d:["C","C","C","C"],U:tt.slice(0)},at=[1,0,0,1,0,0];I(at,-de);for(var ut=0;ut<3;ut++)te(at,tt),fe(nt.U,tt);I(at,-X+de/2),at[0]*=G,at[1]*=G,at[2]*=G,at[3]*=G,at[4]=F,at[5]=z,te(at,nt.U),te(W.aN,nt.U),S(W.aL,nt)},U={aL:g,aN:[Ne*ke,Ne*le,-Ae*le,Ae*ke,We,t]};b(U,0,0,1,E,E+C,ze==0),M=ee,T=ne}else console.log("Unknown SVG command "+K)}}}return{cssMap:o,readTrnf:a,aM:_,aD:l}}(),initHB:function(r,s){var o=function(a){var u=0;return(a&4294967295-(1<<7)+1)==0?u=1:(a&4294967295-(1<<11)+1)==0?u=2:(a&4294967295-(1<<16)+1)==0?u=3:(a&4294967295-(1<<21)+1)==0&&(u=4),u};fetch(r).then(function(a){return a.arrayBuffer()}).then(function(a){return WebAssembly.instantiate(a)}).then(function(a){console.log("HB ready");var u=a.instance.exports,l=u.memory,v,p,c,_,f,g,y,w;l.grow(30),e.U.shapeHB=function(){var M=function(B){for(var H=u.hb_buffer_get_length(B),J=[],Q=u.hb_buffer_get_glyph_infos(B,0)>>>2,q=u.hb_buffer_get_glyph_positions(B,0)>>>2,O=0;O<H;++O){var K=Q+O*5,pe=q+O*5;J.push({g:p[K+0],cl:p[K+2],ax:c[pe+0],ay:c[pe+1],dx:c[pe+2],dy:c[pe+3]})}return J},T;return function(B,H,J){var Q=B._data,q=B.name.postScriptName,O=l.buffer.byteLength,K=Q.length+H.length*16+4e6,pe=0,R=0;if(O<K&&l.grow((K-O>>>16)+4),v=new Uint8Array(l.buffer),p=new Uint32Array(l.buffer),c=new Int32Array(l.buffer),_!=q&&(f!=null&&(u.hb_blob_destroy(f),u.free(g),u.hb_face_destroy(y),u.hb_font_destroy(w)),g=u.malloc(Q.byteLength),v.set(Q,g),f=u.hb_blob_create(g,Q.byteLength,2,0,0),y=u.hb_face_create(f,0),w=u.hb_font_create(y),_=q),window.TextEncoder==null){alert("Your browser is too old. Please, update it.");return}T==null&&(T=new window.TextEncoder("utf8"));var Te=u.hb_buffer_create(),re=T.encode(H),oe=re.length,me=u.malloc(oe);v.set(re,me),u.hb_buffer_add_utf8(Te,me,oe,0,oe),u.free(me),u.hb_buffer_set_direction(Te,J?4:5),u.hb_buffer_guess_segment_properties(Te),u.hb_shape(w,Te,0,0);var ue=M(Te);u.hb_buffer_destroy(Te);var $=ue.slice(0);J||$.reverse();for(var ee=1;ee<$.length;ee++){for(var ne=$[ee],_e=ne.cl;;){var ae=H.codePointAt(pe),Me=o(ae);if(R+Me<=_e)R+=Me,pe+=ae<=65535?1:2;else break}ne.cl=pe}return ue}}(),s()})}},e}(),UZIP={};typeof module=="object"&&(module.exports=UZIP),UZIP.parse=function(e,r){for(var s=UZIP.bin.readUshort,o=UZIP.bin.readUint,a=0,u={},l=new Uint8Array(e),v=l.length-4;o(l,v)!=101010256;)v--;var a=v;a+=4,a+=4;var p=s(l,a);a+=2;var c=s(l,a);a+=2;var _=o(l,a);a+=4;var f=o(l,a);a+=4,a=f;for(var g=0;g<p;g++){var y=o(l,a);a+=4,a+=4,a+=4,a+=4;var w=o(l,a);a+=4;var _=o(l,a);a+=4;var M=o(l,a);a+=4;var T=s(l,a),B=s(l,a+2),H=s(l,a+4);a+=6,a+=8;var J=o(l,a);a+=4,a+=T+B+H,UZIP._readLocal(l,J,u,_,M,r)}return u},UZIP._readLocal=function(e,r,s,o,a,u){var l=UZIP.bin.readUshort,v=UZIP.bin.readUint,p=v(e,r);r+=4;var c=l(e,r);r+=2;var _=l(e,r);r+=2;var f=l(e,r);r+=2;var g=v(e,r);r+=4;var y=v(e,r);r+=4,r+=8;var w=l(e,r);r+=2;var M=l(e,r);r+=2;var T=UZIP.bin.readUTF8(e,r,w);if(r+=w,r+=M,u){s[T]={size:a,csize:o};return}var B=new Uint8Array(e.buffer,r);if(f==0)s[T]=new Uint8Array(B.buffer.slice(r,r+o));else if(f==8){var H=new Uint8Array(a);UZIP.inflateRaw(B,H),s[T]=H}else throw"unknown compression method: "+f},UZIP.inflateRaw=function(e,r){return UZIP.F.inflate(e,r)},UZIP.inflate=function(e,r){var s=e[0],o=e[1],a=s&15,u=s>>>4;return UZIP.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),r)},UZIP.deflate=function(e,r){r==null&&(r={level:6});var s=0,o=new Uint8Array(50+Math.floor(e.length*1.1));o[s]=120,o[s+1]=156,s+=2,s=UZIP.F.deflateRaw(e,o,s,r.level);var a=UZIP.adler(e,0,e.length);return o[s+0]=a>>>24&255,o[s+1]=a>>>16&255,o[s+2]=a>>>8&255,o[s+3]=a>>>0&255,new Uint8Array(o.buffer,0,s+4)},UZIP.deflateRaw=function(e,r){r==null&&(r={level:6});var s=new Uint8Array(50+Math.floor(e.length*1.1)),o=UZIP.F.deflateRaw(e,s,o,r.level);return new Uint8Array(s.buffer,0,o)},UZIP.encode=function(e,r){r==null&&(r=!1);var s=0,o=UZIP.bin.writeUint,a=UZIP.bin.writeUshort,u={};for(var l in e){var v=!UZIP._noNeed(l)&&!r,p=e[l],c=UZIP.crc.crc(p,0,p.length);u[l]={cpr:v,usize:p.length,crc:c,file:v?UZIP.deflateRaw(p):p}}for(var l in u)s+=u[l].file.length+30+46+2*UZIP.bin.sizeUTF8(l);s+=22;var _=new Uint8Array(s),f=0,g=[];for(var l in u){var y=u[l];g.push(f),f=UZIP._writeHeader(_,f,l,y,0)}var w=0,M=f;for(var l in u){var y=u[l];g.push(f),f=UZIP._writeHeader(_,f,l,y,1,g[w++])}var T=f-M;return o(_,f,101010256),f+=4,f+=4,a(_,f,w),f+=2,a(_,f,w),f+=2,o(_,f,T),f+=4,o(_,f,M),f+=4,f+=2,_.buffer},UZIP._noNeed=function(e){var r=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(r)!=-1},UZIP._writeHeader=function(e,r,s,o,a,u){var l=UZIP.bin.writeUint,v=UZIP.bin.writeUshort,p=o.file;l(e,r,a==0?67324752:33639248),r+=4,a==1&&(r+=2),v(e,r,20),r+=2,v(e,r,0),r+=2,v(e,r,o.cpr?8:0),r+=2,l(e,r,0),r+=4,l(e,r,o.crc),r+=4,l(e,r,p.length),r+=4,l(e,r,o.usize),r+=4,v(e,r,UZIP.bin.sizeUTF8(s)),r+=2,v(e,r,0),r+=2,a==1&&(r+=2,r+=2,r+=6,l(e,r,u),r+=4);var c=UZIP.bin.writeUTF8(e,r,s);return r+=c,a==0&&(e.set(p,r),r+=p.length),r},UZIP.crc={table:function(){for(var e=new Uint32Array(256),r=0;r<256;r++){for(var s=r,o=0;o<8;o++)s&1?s=3988292384^s>>>1:s=s>>>1;e[r]=s}return e}(),update:function(e,r,s,o){for(var a=0;a<o;a++)e=UZIP.crc.table[(e^r[s+a])&255]^e>>>8;return e},crc:function(e,r,s){return UZIP.crc.update(4294967295,e,r,s)^4294967295}},UZIP.adler=function(e,r,s){for(var o=1,a=0,u=r,l=r+s;u<l;){for(var v=Math.min(u+5552,l);u<v;)o+=e[u++],a+=o;o=o%65521,a=a%65521}return a<<16|o},UZIP.bin={readUshort:function(e,r){return e[r]|e[r+1]<<8},writeUshort:function(e,r,s){e[r]=s&255,e[r+1]=s>>8&255},readUint:function(e,r){return e[r+3]*(256*256*256)+(e[r+2]<<16|e[r+1]<<8|e[r])},writeUint:function(e,r,s){e[r]=s&255,e[r+1]=s>>8&255,e[r+2]=s>>16&255,e[r+3]=s>>24&255},readASCII:function(e,r,s){for(var o="",a=0;a<s;a++)o+=String.fromCharCode(e[r+a]);return o},writeASCII:function(e,r,s){for(var o=0;o<s.length;o++)e[r+o]=s.charCodeAt(o)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,r,s){for(var o="",a,u=0;u<s;u++)o+="%"+UZIP.bin.pad(e[r+u].toString(16));try{a=decodeURIComponent(o)}catch(l){return UZIP.bin.readASCII(e,r,s)}return a},writeUTF8:function(e,r,s){for(var o=s.length,a=0,u=0;u<o;u++){var l=s.charCodeAt(u);if((l&4294967295-(1<<7)+1)==0)e[r+a]=l,a++;else if((l&4294967295-(1<<11)+1)==0)e[r+a]=192|l>>6,e[r+a+1]=128|l>>0&63,a+=2;else if((l&4294967295-(1<<16)+1)==0)e[r+a]=224|l>>12,e[r+a+1]=128|l>>6&63,e[r+a+2]=128|l>>0&63,a+=3;else if((l&4294967295-(1<<21)+1)==0)e[r+a]=240|l>>18,e[r+a+1]=128|l>>12&63,e[r+a+2]=128|l>>6&63,e[r+a+3]=128|l>>0&63,a+=4;else throw"e"}return a},sizeUTF8:function(e){for(var r=e.length,s=0,o=0;o<r;o++){var a=e.charCodeAt(o);if((a&4294967295-(1<<7)+1)==0)s++;else if((a&4294967295-(1<<11)+1)==0)s+=2;else if((a&4294967295-(1<<16)+1)==0)s+=3;else if((a&4294967295-(1<<21)+1)==0)s+=4;else throw"e"}return s}},UZIP.F={},UZIP.F.deflateRaw=function(e,r,s,o){var a=[[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]],u=a[o],l=UZIP.F.U,v=UZIP.F._goodIndex,p=UZIP.F._hash,c=UZIP.F._putsE,_=0,f=s<<3,g=0,y=e.length;if(o==0){for(;_<y;){var w=Math.min(65535,y-_);c(r,f,_+w==y?1:0),f=UZIP.F._copyExact(e,_,w,r,f+8),_+=w}return f>>>3}var M=l.lits,T=l.strt,B=l.prev,H=0,J=0,Q=0,q=0,O=0,K=0;y>2&&(K=UZIP.F._hash(e,0),T[K]=0);var pe=0,R=0;for(_=0;_<y;_++){if(O=K,_+1<y-2){K=UZIP.F._hash(e,_+1);var Te=_+1&32767;B[Te]=T[K],T[K]=Te}if(g<=_){(H>14e3||J>26697)&&y-_>100&&(g<_&&(M[H]=_-g,H+=2,g=_),f=UZIP.F._writeBlock(_==y-1||g==y?1:0,M,H,q,e,Q,_-Q,r,f),H=J=q=0,Q=_);var re=0;_<y-2&&(re=UZIP.F._bestMatch(e,_,B,O,Math.min(u[2],y-_),u[3]));var w=re>>>16,oe=re&65535;if(re!=0){var w=re>>>16,oe=re&65535,me=v(w,l.of0);l.lhst[257+me]++;var ue=v(oe,l.df0);l.dhst[ue]++,q+=l.exb[me]+l.dxb[ue],M[H]=w<<23|_-g,M[H+1]=oe<<16|me<<8|ue,H+=2,g=_+w}else l.lhst[e[_]]++;J++}}for((Q!=_||e.length==0)&&(g<_&&(M[H]=_-g,H+=2,g=_),f=UZIP.F._writeBlock(1,M,H,q,e,Q,_-Q,r,f),H=0,J=0,H=J=q=0,Q=_);(f&7)!=0;)f++;return f>>>3},UZIP.F._bestMatch=function(e,r,s,o,a,u){var l=r&32767,v=s[l],p=l-v+(1<<15)&32767;if(v==l||o!=UZIP.F._hash(e,r-p))return 0;for(var c=0,_=0,f=Math.min(32767,r);p<=f&&--u!=0&&v!=l;){if(c==0||e[r+c]==e[r+c-p]){var g=UZIP.F._howLong(e,r,p);if(g>c){if(c=g,_=p,c>=a)break;p+2<g&&(g=p+2);for(var y=0,w=0;w<g-2;w++){var M=r-p+w+(1<<15)&32767,T=s[M],B=M-T+(1<<15)&32767;B>y&&(y=B,v=M)}}}l=v,v=s[l],p+=l-v+(1<<15)&32767}return c<<16|_},UZIP.F._howLong=function(e,r,s){if(e[r]!=e[r-s]||e[r+1]!=e[r+1-s]||e[r+2]!=e[r+2-s])return 0;var o=r,a=Math.min(e.length,r+258);for(r+=3;r<a&&e[r]==e[r-s];)r++;return r-o},UZIP.F._hash=function(e,r){return(e[r]<<8|e[r+1])+(e[r+2]<<4)&65535},UZIP.saved=0,UZIP.F._writeBlock=function(e,r,s,o,a,u,l,v,p){var c=UZIP.F.U,_=UZIP.F._putsF,f=UZIP.F._putsE,g,y,w,M,T,B,H,J,Q;c.lhst[256]++,g=UZIP.F.getTrees(),y=g[0],w=g[1],M=g[2],T=g[3],B=g[4],H=g[5],J=g[6],Q=g[7];var q=((p+3&7)==0?0:8-(p+3&7))+32+(l<<3),O=o+UZIP.F.contSize(c.fltree,c.lhst)+UZIP.F.contSize(c.fdtree,c.dhst),K=o+UZIP.F.contSize(c.ltree,c.lhst)+UZIP.F.contSize(c.dtree,c.dhst);K+=14+3*H+UZIP.F.contSize(c.itree,c.ihst)+(c.ihst[16]*2+c.ihst[17]*3+c.ihst[18]*7);for(var pe=0;pe<286;pe++)c.lhst[pe]=0;for(var pe=0;pe<30;pe++)c.dhst[pe]=0;for(var pe=0;pe<19;pe++)c.ihst[pe]=0;var R=q<O&&q<K?0:O<K?1:2;_(v,p,e),_(v,p+1,R),p+=3;var Te=p;if(R==0){for(;(p&7)!=0;)p++;p=UZIP.F._copyExact(a,u,l,v,p)}else{var re,oe;if(R==1&&(re=c.fltree,oe=c.fdtree),R==2){UZIP.F.makeCodes(c.ltree,y),UZIP.F.revCodes(c.ltree,y),UZIP.F.makeCodes(c.dtree,w),UZIP.F.revCodes(c.dtree,w),UZIP.F.makeCodes(c.itree,M),UZIP.F.revCodes(c.itree,M),re=c.ltree,oe=c.dtree,f(v,p,T-257),p+=5,f(v,p,B-1),p+=5,f(v,p,H-4),p+=4;for(var me=0;me<H;me++)f(v,p+me*3,c.itree[(c.ordr[me]<<1)+1]);p+=3*H,p=UZIP.F._codeTiny(J,c.itree,v,p),p=UZIP.F._codeTiny(Q,c.itree,v,p)}for(var ue=u,$=0;$<s;$+=2){for(var ee=r[$],ne=ee>>>23,_e=ue+(ee&(1<<23)-1);ue<_e;)p=UZIP.F._writeLit(a[ue++],re,v,p);if(ne!=0){var ae=r[$+1],Me=ae>>16,Ne=ae>>8&255,Ae=ae&255;p=UZIP.F._writeLit(257+Ne,re,v,p),f(v,p,ne-c.of0[Ne]),p+=c.exb[Ne],p=UZIP.F._writeLit(Ae,oe,v,p),_(v,p,Me-c.df0[Ae]),p+=c.dxb[Ae],ue+=ne}}p=UZIP.F._writeLit(256,re,v,p)}return p},UZIP.F._copyExact=function(e,r,s,o,a){var u=a>>>3;return o[u]=s,o[u+1]=s>>>8,o[u+2]=255-o[u],o[u+3]=255-o[u+1],u+=4,o.set(new Uint8Array(e.buffer,r,s),u),a+(s+4<<3)},UZIP.F.getTrees=function(){for(var e=UZIP.F.U,r=UZIP.F._hufTree(e.lhst,e.ltree,15),s=UZIP.F._hufTree(e.dhst,e.dtree,15),o=[],a=UZIP.F._lenCodes(e.ltree,o),u=[],l=UZIP.F._lenCodes(e.dtree,u),v=0;v<o.length;v+=2)e.ihst[o[v]]++;for(var v=0;v<u.length;v+=2)e.ihst[u[v]]++;for(var p=UZIP.F._hufTree(e.ihst,e.itree,7),c=19;c>4&&e.itree[(e.ordr[c-1]<<1)+1]==0;)c--;return[r,s,p,a,l,c,o,u]},UZIP.F.getSecond=function(e){for(var r=[],s=0;s<e.length;s+=2)r.push(e[s+1]);return r},UZIP.F.nonZero=function(e){for(var r="",s=0;s<e.length;s+=2)e[s+1]!=0&&(r+=(s>>1)+",");return r},UZIP.F.contSize=function(e,r){for(var s=0,o=0;o<r.length;o++)s+=r[o]*e[(o<<1)+1];return s},UZIP.F._codeTiny=function(e,r,s,o){for(var a=0;a<e.length;a+=2){var u=e[a],l=e[a+1];o=UZIP.F._writeLit(u,r,s,o);var v=u==16?2:u==17?3:7;u>15&&(UZIP.F._putsE(s,o,l,v),o+=v)}return o},UZIP.F._lenCodes=function(e,r){for(var s=e.length;s!=2&&e[s-1]==0;)s-=2;for(var o=0;o<s;o+=2){var a=e[o+1],u=o+3<s?e[o+3]:-1,l=o+5<s?e[o+5]:-1,v=o==0?-1:e[o-1];if(a==0&&u==a&&l==a){for(var p=o+5;p+2<s&&e[p+2]==a;)p+=2;var c=Math.min(p+1-o>>>1,138);c<11?r.push(17,c-3):r.push(18,c-11),o+=c*2-2}else if(a==v&&u==a&&l==a){for(var p=o+5;p+2<s&&e[p+2]==a;)p+=2;var c=Math.min(p+1-o>>>1,6);r.push(16,c-3),o+=c*2-2}else r.push(a,0)}return s>>>1},UZIP.F._hufTree=function(e,r,s){var o=[],a=e.length,u=r.length,l=0;for(l=0;l<u;l+=2)r[l]=0,r[l+1]=0;for(l=0;l<a;l++)e[l]!=0&&o.push({lit:l,f:e[l]});var v=o.length,p=o.slice(0);if(v==0)return 0;if(v==1){var c=o[0].lit,p=c==0?1:0;return r[(c<<1)+1]=1,r[(p<<1)+1]=1,1}o.sort(function(T,B){return T.f-B.f});var _=o[0],f=o[1],g=0,y=1,w=2;for(o[0]={lit:-1,f:_.f+f.f,l:_,r:f,d:0};y!=v-1;)g!=y&&(w==v||o[g].f<o[w].f)?_=o[g++]:_=o[w++],g!=y&&(w==v||o[g].f<o[w].f)?f=o[g++]:f=o[w++],o[y++]={lit:-1,f:_.f+f.f,l:_,r:f};var M=UZIP.F.setDepth(o[y-1],0);for(M>s&&(UZIP.F.restrictDepth(p,s,M),M=s),l=0;l<v;l++)r[(p[l].lit<<1)+1]=p[l].d;return M},UZIP.F.setDepth=function(e,r){return e.lit!=-1?(e.d=r,r):Math.max(UZIP.F.setDepth(e.l,r+1),UZIP.F.setDepth(e.r,r+1))},UZIP.F.restrictDepth=function(e,r,s){var o=0,a=1<<s-r,u=0;for(e.sort(function(v,p){return p.d==v.d?v.f-p.f:p.d-v.d}),o=0;o<e.length&&e[o].d>r;o++){var l=e[o].d;e[o].d=r,u+=a-(1<<s-l)}for(u=u>>>s-r;u>0;){var l=e[o].d;l<r?(e[o].d++,u-=1<<r-l-1):o++}for(;o>=0;o--)e[o].d==r&&u<0&&(e[o].d--,u++);u!=0&&console.log("debt left")},UZIP.F._goodIndex=function(e,r){var s=0;return r[s|16]<=e&&(s|=16),r[s|8]<=e&&(s|=8),r[s|4]<=e&&(s|=4),r[s|2]<=e&&(s|=2),r[s|1]<=e&&(s|=1),s},UZIP.F._writeLit=function(e,r,s,o){return UZIP.F._putsF(s,o,r[e<<1]),o+r[(e<<1)+1]},UZIP.F.inflate=function(e,r){var s=Uint8Array;if(e[0]==3&&e[1]==0)return r||new s(0);var o=UZIP.F,a=o._bitsF,u=o._bitsE,l=o._decodeTiny,v=o.makeCodes,p=o.codes2map,c=o._get17,_=o.U,f=r==null;f&&(r=new s(e.length>>>2<<3));for(var g=0,y=0,w=0,M=0,T=0,B=0,H=0,J=0,Q=0,q,O;g==0;){if(g=a(e,Q,1),y=a(e,Q+1,2),Q+=3,y==0){(Q&7)!=0&&(Q+=8-(Q&7));var K=(Q>>>3)+4,pe=e[K-4]|e[K-3]<<8;f&&(r=UZIP.F._check(r,J+pe)),r.set(new s(e.buffer,e.byteOffset+K,pe),J),Q=K+pe<<3,J+=pe;continue}if(f&&(r=UZIP.F._check(r,J+(1<<17))),y==1&&(q=_.flmap,O=_.fdmap,B=(1<<9)-1,H=(1<<5)-1),y==2){w=u(e,Q,5)+257,M=u(e,Q+5,5)+1,T=u(e,Q+10,4)+4,Q+=14;for(var R=Q,Te=0;Te<38;Te+=2)_.itree[Te]=0,_.itree[Te+1]=0;for(var re=1,Te=0;Te<T;Te++){var oe=u(e,Q+Te*3,3);_.itree[(_.ordr[Te]<<1)+1]=oe,oe>re&&(re=oe)}Q+=3*T,v(_.itree,re),p(_.itree,re,_.imap),q=_.lmap,O=_.dmap,Q=l(_.imap,(1<<re)-1,w+M,e,Q,_.ttree);var me=o._copyOut(_.ttree,0,w,_.ltree);B=(1<<me)-1;var ue=o._copyOut(_.ttree,w,M,_.dtree);H=(1<<ue)-1,v(_.ltree,me),p(_.ltree,me,q),v(_.dtree,ue),p(_.dtree,ue,O)}for(;;){var $=q[c(e,Q)&B];Q+=$&15;var ee=$>>>4;if(ee>>>8==0)r[J++]=ee;else{if(ee==256)break;var ne=J+ee-254;if(ee>264){var _e=_.ldef[ee-257];ne=J+(_e>>>3)+u(e,Q,_e&7),Q+=_e&7}var ae=O[c(e,Q)&H];Q+=ae&15;var Me=ae>>>4,Ne=_.ddef[Me],Ae=(Ne>>>4)+a(e,Q,Ne&15);for(Q+=Ne&15,f&&(r=UZIP.F._check(r,J+(1<<17)));J<ne;)r[J]=r[J++-Ae],r[J]=r[J++-Ae],r[J]=r[J++-Ae],r[J]=r[J++-Ae];J=ne}}}return r.length==J?r:r.slice(0,J)},UZIP.F._check=function(e,r){var s=e.length;if(r<=s)return e;var o=new Uint8Array(Math.max(s<<1,r));return o.set(e,0),o},UZIP.F._decodeTiny=function(e,r,s,o,a,u){for(var l=UZIP.F._bitsE,v=UZIP.F._get17,p=0;p<s;){var c=e[v(o,a)&r];a+=c&15;var _=c>>>4;if(_<=15)u[p]=_,p++;else{var f=0,g=0;_==16?(g=3+l(o,a,2),a+=2,f=u[p-1]):_==17?(g=3+l(o,a,3),a+=3):_==18&&(g=11+l(o,a,7),a+=7);for(var y=p+g;p<y;)u[p]=f,p++}}return a},UZIP.F._copyOut=function(e,r,s,o){for(var a=0,u=0,l=o.length>>>1;u<s;){var v=e[u+r];o[u<<1]=0,o[(u<<1)+1]=v,v>a&&(a=v),u++}for(;u<l;)o[u<<1]=0,o[(u<<1)+1]=0,u++;return a},UZIP.F.makeCodes=function(e,r){for(var s=UZIP.F.U,o=e.length,a,u,l,v,p,c=s.bl_count,v=0;v<=r;v++)c[v]=0;for(v=1;v<o;v+=2)c[e[v]]++;var _=s.next_code;for(a=0,c[0]=0,u=1;u<=r;u++)a=a+c[u-1]<<1,_[u]=a;for(l=0;l<o;l+=2)p=e[l+1],p!=0&&(e[l]=_[p],_[p]++)},UZIP.F.codes2map=function(e,r,s){for(var o=e.length,a=UZIP.F.U,u=a.rev15,l=0;l<o;l+=2)if(e[l+1]!=0)for(var v=l>>1,p=e[l+1],c=v<<4|p,_=r-p,f=e[l]<<_,g=f+(1<<_);f!=g;){var y=u[f]>>>15-r;s[y]=c,f++}},UZIP.F.revCodes=function(e,r){for(var s=UZIP.F.U.rev15,o=15-r,a=0;a<e.length;a+=2){var u=e[a]<<r-e[a+1];e[a]=s[u]>>>o}},UZIP.F._putsE=function(e,r,s){s=s<<(r&7);var o=r>>>3;e[o]|=s,e[o+1]|=s>>>8},UZIP.F._putsF=function(e,r,s){s=s<<(r&7);var o=r>>>3;e[o]|=s,e[o+1]|=s>>>8,e[o+2]|=s>>>16},UZIP.F._bitsE=function(e,r,s){return(e[r>>>3]|e[(r>>>3)+1]<<8)>>>(r&7)&(1<<s)-1},UZIP.F._bitsF=function(e,r,s){return(e[r>>>3]|e[(r>>>3)+1]<<8|e[(r>>>3)+2]<<16)>>>(r&7)&(1<<s)-1},UZIP.F._get17=function(e,r){return(e[r>>>3]|e[(r>>>3)+1]<<8|e[(r>>>3)+2]<<16)>>>(r&7)},UZIP.F._get25=function(e,r){return(e[r>>>3]|e[(r>>>3)+1]<<8|e[(r>>>3)+2]<<16|e[(r>>>3)+3]<<24)>>>(r&7)},UZIP.F.U=function(){var e=Uint16Array,r=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new r(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(1<<15),lhst:new r(286),dhst:new r(30),ihst:new r(19),lits:new r(15e3),strt:new e(1<<16),prev:new e(1<<15)}}(),function(){for(var e=UZIP.F.U,r=1<<15,s=0;s<r;s++){var o=s;o=(o&2863311530)>>>1|(o&1431655765)<<1,o=(o&3435973836)>>>2|(o&858993459)<<2,o=(o&4042322160)>>>4|(o&252645135)<<4,o=(o&4278255360)>>>8|(o&16711935)<<8,e.rev15[s]=(o>>>16|o<<16)>>>17}function a(u,l,v){for(;l--!=0;)u.push(0,v)}for(var s=0;s<32;s++)e.ldef[s]=e.of0[s]<<3|e.exb[s],e.ddef[s]=e.df0[s]<<4|e.dxb[s];a(e.fltree,144,8),a(e.fltree,255-143,9),a(e.fltree,279-255,7),a(e.fltree,287-279,8),UZIP.F.makeCodes(e.fltree,9),UZIP.F.codes2map(e.fltree,9,e.flmap),UZIP.F.revCodes(e.fltree,9),a(e.fdtree,32,5),UZIP.F.makeCodes(e.fdtree,5),UZIP.F.codes2map(e.fdtree,5,e.fdmap),UZIP.F.revCodes(e.fdtree,5),a(e.itree,19,0),a(e.ltree,286,0),a(e.dtree,30,0),a(e.ttree,320,0)}();var paper=function(e,r){var s=(e=e||require("./node/self.js")).window,o=e.document,a=new function(){function t(W,F,z,G,X){function A(de,se){typeof(se=se||(se=b(F,de))&&(se.get?se:se.value))=="string"&&se[0]==="#"&&(se=W[se.substring(1)]||se);var ie,ge=typeof se=="function",Pe=se,Ye=X||ge&&!se.base?se&&se.get?de in W:W[de]:null;X&&Ye||(ge&&Ye&&(se.base=Ye),ge&&G!==!1&&(ie=de.match(/^([gs]et|is)(([A-Z])(.*))$/))&&(N[ie[3].toLowerCase()+ie[4]]=ie[2]),Pe&&!ge&&Pe.get&&typeof Pe.get=="function"&&h.isPlainObject(Pe)||(Pe={value:Pe,writable:!0}),(b(W,de)||{configurable:!0}).configurable&&(Pe.configurable=!0,Pe.enumerable=z!=null?z:!ie),U(W,de,Pe))}var N={};if(F){for(var I in F)F.hasOwnProperty(I)&&!d.test(I)&&A(I);for(var I in N){var te=N[I],fe=W["set"+te],S=W["get"+te]||fe&&W["is"+te];!S||G!==!0&&S.length!==0||A(I,{get:S,set:fe})}}return W}function h(){for(var W=0,F=arguments.length;W<F;W++){var z=arguments[W];z&&Z(this,z)}return this}var d=/^(statics|enumerable|beans|preserve)$/,x=[],E=x.slice,C=Object.create,b=Object.getOwnPropertyDescriptor,U=Object.defineProperty,D=x.forEach||function(W,F){for(var z=0,G=this.length;z<G;z++)W.call(F,this[z],z,this)},k=function(W,F){for(var z in this)this.hasOwnProperty(z)&&W.call(F,this[z],z,this)},Z=Object.assign||function(W){for(var F=1,z=arguments.length;F<z;F++){var G=arguments[F];for(var X in G)G.hasOwnProperty(X)&&(W[X]=G[X])}return W},Y=function(W,F,z){if(W){var G=b(W,"length");(G&&typeof G.value=="number"?D:k).call(W,F,z=z||W)}return z};return t(h,{inject:function(W){if(W){var F=W.statics===!0?W:W.statics,z=W.beans,G=W.preserve;F!==W&&t(this.prototype,W,W.enumerable,z,G),t(this,F,null,z,G)}for(var X=1,A=arguments.length;X<A;X++)this.inject(arguments[X]);return this},extend:function(){for(var W,F,z,G=this,X=0,A=arguments.length;X<A&&(!W||!F);X++)z=arguments[X],W=W||z.initialize,F=F||z.prototype;return W=W||function(){G.apply(this,arguments)},F=W.prototype=F||C(this.prototype),U(F,"constructor",{value:W,writable:!0,configurable:!0}),t(W,this),arguments.length&&this.inject.apply(W,arguments),W.base=G,W}}).inject({enumerable:!1,initialize:h,set:h,inject:function(){for(var W=0,F=arguments.length;W<F;W++){var z=arguments[W];z&&t(this,z,z.enumerable,z.beans,z.preserve)}return this},extend:function(){var W=C(this);return W.inject.apply(W,arguments)},each:function(W,F){return Y(this,W,F)},clone:function(){return new this.constructor(this)},statics:{set:Z,each:Y,create:C,define:U,describe:b,clone:function(W){return Z(new W.constructor,W)},isPlainObject:function(W){var F=W!=null&&W.constructor;return F&&(F===Object||F===h||F.name==="Object")},pick:function(W,F){return W!==r?W:F},slice:function(W,F,z){return E.call(W,F,z)}}})};typeof module!="undefined"&&(module.exports=a),a.inject({enumerable:!1,toString:function(){return this._id!=null?(this._class||"Object")+(this._name?" '"+this._name+"'":" @"+this._id):"{ "+a.each(this,function(t,h){if(!/^_/.test(h)){var d=typeof t;this.push(h+": "+(d==="number"?p.instance.number(t):d==="string"?"'"+t+"'":t))}},[]).join(", ")+" }"},getClassName:function(){return this._class||""},importJSON:function(t){return a.importJSON(t,this)},exportJSON:function(t){return a.exportJSON(this,t)},toJSON:function(){return a.serialize(this)},set:function(t,h){return t&&a.filter(this,t,h,this._prioritize),this}},{beans:!1,statics:{exports:{},extend:function t(){var h=t.base.apply(this,arguments),d=h.prototype._class;return d&&!a.exports[d]&&(a.exports[d]=h),h},equals:function(t,h){if(t===h)return!0;if(t&&t.equals)return t.equals(h);if(h&&h.equals)return h.equals(t);if(t&&h&&typeof t=="object"&&typeof h=="object"){if(Array.isArray(t)&&Array.isArray(h)){if((x=t.length)!==h.length)return!1;for(;x--;)if(!a.equals(t[x],h[x]))return!1}else{var d=Object.keys(t),x=d.length;if(x!==Object.keys(h).length)return!1;for(;x--;){var E=d[x];if(!h.hasOwnProperty(E)||!a.equals(t[E],h[E]))return!1}}return!0}return!1},read:function(t,h,d,x){if(this===a){var E=this.peek(t,h);return t.__index++,E}var C=this.prototype,b=C._readIndex,U=h||b&&t.__index||0,D=t.length,k=t[U];if(x=x||D-U,k instanceof this||d&&d.readNull&&k==null&&x<=1)return b&&(t.__index=U+1),k&&d&&d.clone?k.clone():k;if(k=a.create(C),b&&(k.__read=!0),k=k.initialize.apply(k,U>0||U+x<D?a.slice(t,U,U+x):t)||k,b){t.__index=U+k.__read;var Z=k.__filtered;Z&&(t.__filtered=Z,k.__filtered=r),k.__read=r}return k},peek:function(t,h){return t[t.__index=h||t.__index||0]},remain:function(t){return t.length-(t.__index||0)},readList:function(t,h,d,x){for(var E,C=[],b=h||0,U=x?b+x:t.length,D=b;D<U;D++)C.push(Array.isArray(E=t[D])?this.read(E,0,d):this.read(t,D,d,1));return C},readNamed:function(t,h,d,x,E){var C=this.getNamed(t,h),b=C!==r;if(b){var U=t.__filtered;U||((U=t.__filtered=a.create(t[0])).__unfiltered=t[0]),U[h]=r}var D=b?[C]:t;return this.read(D,d,x,E)},getNamed:function(t,h){var d=t[0];if(t._hasObject===r&&(t._hasObject=t.length===1&&a.isPlainObject(d)),t._hasObject)return h?d[h]:t.__filtered||d},hasNamed:function(t,h){return!!this.getNamed(t,h)},filter:function(t,h,d,x){function E(Z){if(!(d&&Z in d||C&&Z in C)){var Y=h[Z];Y!==r&&(t[Z]=Y)}}var C;if(x){for(var b,U={},D=0,k=x.length;D<k;D++)(b=x[D])in h&&(E(b),U[b]=!0);C=U}return Object.keys(h.__unfiltered||h).forEach(E),t},isPlainValue:function(t,h){return a.isPlainObject(t)||Array.isArray(t)||h&&typeof t=="string"},serialize:function(t,h,d,x){h=h||{};var E,C=!x;if(C&&(h.formatter=new p(h.precision),x={length:0,definitions:{},references:{},add:function(Y,W){var F="#"+Y._id,z=this.references[F];if(!z){this.length++;var G=W.call(Y),X=Y._class;X&&G[0]!==X&&G.unshift(X),this.definitions[F]=G,z=this.references[F]=[F]}return z}}),t&&t._serialize){E=t._serialize(h,x);var b=t._class;!b||t._compactSerialize||!C&&d||E[0]===b||E.unshift(b)}else if(Array.isArray(t)){E=[];for(var U=0,D=t.length;U<D;U++)E[U]=a.serialize(t[U],h,d,x)}else if(a.isPlainObject(t)){E={};for(var k=Object.keys(t),U=0,D=k.length;U<D;U++){var Z=k[U];E[Z]=a.serialize(t[Z],h,d,x)}}else E=typeof t=="number"?h.formatter.number(t,h.precision):t;return C&&x.length>0?[["dictionary",x.definitions],E]:E},deserialize:function(t,h,d,x,E){var C=t,b=!d,U=b&&t&&t.length&&t[0][0]==="dictionary";if(d=d||{},Array.isArray(t)){var D=t[0],k=D==="dictionary";if(t.length==1&&/^#/.test(D))return d.dictionary[D];C=[];for(var Z=(D=a.exports[D])?1:0,Y=t.length;Z<Y;Z++)C.push(a.deserialize(t[Z],h,d,k,U));if(D){var W=C;h?C=h(D,W,b||E):(C=a.create(D.prototype),D.apply(C,W))}}else if(a.isPlainObject(t)){C={},x&&(d.dictionary=C);for(var F in t)C[F]=a.deserialize(t[F],h,d)}return U?C[1]:C},exportJSON:function(t,h){var d=a.serialize(t,h);return h&&h.asString==0?d:JSON.stringify(d)},importJSON:function(t,h){return a.deserialize(typeof t=="string"?JSON.parse(t):t,function(d,x,E){var C=E&&h&&h.constructor===d,b=C?h:a.create(d.prototype);if(x.length===1&&b instanceof Q&&(C||!(b instanceof O))){var U=x[0];a.isPlainObject(U)&&(U.insert=!1)}return(C?b.set:d).apply(b,x),C&&(h=null),b})},splice:function(t,h,d,x){var E=h&&h.length,C=d===r;for((d=C?t.length:d)>t.length&&(d=t.length),D=0;D<E;D++)h[D]._index=d+D;if(C)return t.push.apply(t,h),[];var b=[d,x];h&&b.push.apply(b,h);for(var U=t.splice.apply(t,b),D=0,k=U.length;D<k;D++)U[D]._index=r;for(var D=d+E,k=t.length;D<k;D++)t[D]._index=D;return U},capitalize:function(t){return t.replace(/\b[a-z]/g,function(h){return h.toUpperCase()})},camelize:function(t){return t.replace(/-(.)/g,function(h,d){return d.toUpperCase()})},hyphenate:function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}}});var u={on:function(t,h){if(typeof t!="string")a.each(t,function(C,b){this.on(b,C)},this);else{var d=this._eventTypes,x=d&&d[t],E=this._callbacks=this._callbacks||{};(E=E[t]=E[t]||[]).indexOf(h)===-1&&(E.push(h),x&&x.install&&E.length===1&&x.install.call(this,t))}return this},off:function(t,h){if(typeof t=="string"){var d,x=this._eventTypes,E=x&&x[t],C=this._callbacks&&this._callbacks[t];return C&&(!h||(d=C.indexOf(h))!==-1&&C.length===1?(E&&E.uninstall&&E.uninstall.call(this,t),delete this._callbacks[t]):d!==-1&&C.splice(d,1)),this}a.each(t,function(b,U){this.off(U,b)},this)},once:function(t,h){return this.on(t,function(){h.apply(this,arguments),this.off(t,h)})},emit:function(t,h){var d=this._callbacks&&this._callbacks[t];if(!d)return!1;var x=a.slice(arguments,1),E=h&&h.target&&!h.currentTarget;d=d.slice(),E&&(h.currentTarget=this);for(var C=0,b=d.length;C<b;C++)if(d[C].apply(this,x)==0){h&&h.stop&&h.stop();break}return E&&delete h.currentTarget,!0},responds:function(t){return!(!this._callbacks||!this._callbacks[t])},attach:"#on",detach:"#off",fire:"#emit",_installEvents:function(t){var h=this._eventTypes,d=this._callbacks,x=t?"install":"uninstall";if(h){for(var E in d)if(d[E].length>0){var C=h[E],b=C&&C[x];b&&b.call(this,E)}}},statics:{inject:function t(h){var d=h._events;if(d){var x={};a.each(d,function(E,C){var b=typeof E=="string",U=b?E:C,D=a.capitalize(U),k=U.substring(2).toLowerCase();x[k]=b?{}:E,U="_"+U,h["get"+D]=function(){return this[U]},h["set"+D]=function(Z){var Y=this[U];Y&&this.off(k,Y),Z&&this.on(k,Z),this[U]=Z}}),h._eventTypes=x}return t.base.apply(this,arguments)}}},l=a.extend({_class:"PaperScope",initialize:function t(){paper=this,this.settings=new a({applyMatrix:!0,insertItems:!0,handleSize:4,hitTolerance:0}),this.project=null,this.projects=[],this.tools=[],this._id=t._id++,t._scopes[this._id]=this;var h=t.prototype;if(!this.support){var d=Oe.getContext(1,1)||{};h.support={nativeDash:"setLineDash"in d||"mozDash"in d,nativeBlendModes:Ve.nativeModes},Oe.release(d)}if(!this.agent){var x=e.navigator.userAgent.toLowerCase(),E=(/(darwin|win|mac|linux|freebsd|sunos)/.exec(x)||[])[0],C=E==="darwin"?"mac":E,b=h.agent=h.browser={platform:C};C&&(b[C]=!0),x.replace(/(opera|chrome|safari|webkit|firefox|msie|trident|atom|node)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:v?([.\d]+))?/g,function(U,D,k,Z,Y){if(!b.chrome){var W=D==="opera"?Z:/^(node|trident)$/.test(D)?Y:k;b.version=W,b.versionNumber=parseFloat(W),D=D==="trident"?"msie":D,b.name=D,b[D]=!0}}),b.chrome&&delete b.webkit,b.atom&&delete b.chrome}},version:"0.11.5",getView:function(){var t=this.project;return t&&t._view},getPaper:function(){return this},execute:function(t,h){paper.PaperScript.execute(t,this,h),le.updateFocus()},install:function(t){var h=this;a.each(["project","view","tool"],function(x){a.define(t,x,{configurable:!0,get:function(){return h[x]}})});for(var d in this)!/^_/.test(d)&&this[d]&&(t[d]=this[d])},setup:function(t){return paper=this,this.project=new J(t),this},createCanvas:function(t,h){return Oe.getCanvas(t,h)},activate:function(){paper=this},clear:function(){for(var t=this.projects,h=this.tools,d=t.length-1;d>=0;d--)t[d].remove();for(d=h.length-1;d>=0;d--)h[d].remove()},remove:function(){this.clear(),delete l._scopes[this._id]},statics:new function(){function t(h){return h+="Attribute",function(d,x){return d[h](x)||d[h]("data-paper-"+x)}}return{_scopes:{},_id:0,get:function(h){return this._scopes[h]||null},getAttribute:t("get"),hasAttribute:t("has")}}}),v=a.extend(u,{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 this._index!=null&&(a.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()}}),p=a.extend({initialize:function(t){this.precision=a.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,h,d){return this.number(t)+(d||",")+this.number(h)},point:function(t,h){return this.number(t.x)+(h||",")+this.number(t.y)},size:function(t,h){return this.number(t.width)+(h||",")+this.number(t.height)},rectangle:function(t,h){return this.point(t,h)+(h||",")+this.size(t,h)}});p.instance=new p;var c=new function(){function t(k,Z,Y){return k<Z?Z:k>Y?Y:k}function h(k,Z,Y){function W(te){var fe=134217729*te,S=te-fe+fe;return[S,te-S]}var F=Z*Z-k*Y,z=Z*Z+k*Y;if(3*C(F)<z){var G=W(k),X=W(Z),A=W(Y),N=Z*Z,I=k*Y;F=N-I+(X[0]*X[0]-N+2*X[0]*X[1]+X[1]*X[1]-(G[0]*A[0]-I+G[0]*A[1]+G[1]*A[0]+G[1]*A[1]))}return F}function d(){var k=Math.max.apply(Math,arguments);return k&&(k<1e-8||k>1e8)?U(2,-Math.round(D(k))):0}var x=[[.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]],E=[[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]],C=Math.abs,b=Math.sqrt,U=Math.pow,D=Math.log2||function(k){return Math.log(k)*Math.LOG2E};return{EPSILON:1e-12,MACHINE_EPSILON:112e-18,CURVETIME_EPSILON:1e-8,GEOMETRIC_EPSILON:1e-7,TRIGONOMETRIC_EPSILON:1e-8,KAPPA:4*(b(2)-1)/3,isZero:function(k){return k>=-1e-12&&k<=1e-12},clamp:t,integrate:function(k,Z,Y,W){for(var F=x[W-2],z=E[W-2],G=.5*(Y-Z),X=G+Z,A=0,N=W+1>>1,I=1&W?z[A++]*k(X):0;A<N;){var te=G*F[A];I+=z[A++]*(k(X+te)+k(X-te))}return G*I},findRoot:function(k,Z,Y,W,F,z,G){for(var X=0;X<z;X++){var A=k(Y),N=A/Z(Y),I=Y-N;if(C(N)<G){Y=I;break}A>0?(F=Y,Y=I<=W?.5*(W+F):I):(W=Y,Y=I>=F?.5*(W+F):I)}return t(Y,W,F)},solveQuadratic:function(k,Z,Y,W,F,z){var G,X=1/0;if(C(k)<1e-12){if(C(Z)<1e-12)return C(Y)<1e-12?-1:0;G=-Y/Z}else{var A=h(k,Z*=-.5,Y);if(A&&C(A)<112e-18){var N=d(C(k),C(Z),C(Y));N&&(A=h(k*=N,Z*=N,Y*=N))}if(A>=-112e-18){var I=A<0?0:b(A),te=Z+(Z<0?-I:I);te===0?X=-(G=Y/k):(G=te/k,X=Y/te)}}var fe=0,S=F==null,de=F-1e-12,se=z+1e-12;return isFinite(G)&&(S||G>de&&G<se)&&(W[fe++]=S?G:t(G,F,z)),X!==G&&isFinite(X)&&(S||X>de&&X<se)&&(W[fe++]=S?X:t(X,F,z)),fe},solveCubic:function(k,Z,Y,W,F,z,G){function X(Je){var tt=k*(A=Je);te=(tt+(N=tt+Z))*A+(I=N*A+Y),fe=I*A+W}var A,N,I,te,fe,S=d(C(k),C(Z),C(Y),C(W));if(S&&(k*=S,Z*=S,Y*=S,W*=S),C(k)<1e-12)k=Z,N=Y,I=W,A=1/0;else if(C(W)<1e-12)N=Z,I=Y,A=0;else{X(-Z/k/3);var de=fe/k,se=U(C(de),1/3),ie=de<0?-1:1,ge=-te/k,Pe=ge>0?1.324717957244746*Math.max(se,b(ge)):se,Ye=A-ie*Pe;if(Ye!==A){do X(Ye),Ye=te===0?A:A-fe/te/(1+112e-18);while(ie*Ye>ie*A);C(k)*A*A>C(W/A)&&(N=((I=-W/A)-Y)/A)}}var Ge=c.solveQuadratic(k,N,I,F,z,G),Ze=z==null;return isFinite(A)&&(Ge===0||Ge>0&&A!==F[0]&&A!==F[1])&&(Ze||A>z-1e-12&&A<G+1e-12)&&(F[Ge++]=Ze?A:t(A,z,G)),Ge}}},_={_id:1,_pools:{},get:function(t){if(t){var h=this._pools[t];return h||(h=this._pools[t]={_id:1}),h._id++}return this._id++}},f=a.extend({_class:"Point",_readIndex:!0,initialize:function(t,h){var d=typeof t,x=this.__read,E=0;if(d==="number"){var C=typeof h=="number";this._set(t,C?h:t),x&&(E=C?2:1)}else if(d==="undefined"||t===null)this._set(0,0),x&&(E=t===null?1:0);else{var b=d==="string"?t.split(/[\s,]+/)||[]:t;E=1,Array.isArray(b)?this._set(+b[0],+(b.length>1?b[1]:b[0])):"x"in b?this._set(b.x||0,b.y||0):"width"in b?this._set(b.width||0,b.height||0):"angle"in b?(this._set(b.length||0,0),this.setAngle(b.angle||0)):(this._set(0,0),E=0)}return x&&(this.__read=E),this},set:"#initialize",_set:function(t,h){return this.x=t,this.y=h,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 f(this.x,this.y)},toString:function(){var t=p.instance;return"{ x: "+t.number(this.x)+", y: "+t.number(this.y)+" }"},_serialize:function(t){var h=t.formatter;return[h.number(this.x),h.number(this.y)]},getLength:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},setLength:function(t){if(this.isZero()){var h=this._angle||0;this._set(Math.cos(h)*t,Math.sin(h)*t)}else{var d=t/this.getLength();c.isZero(d)&&this.getAngle(),this._set(this.x*d,this.y*d)}},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=f.read(arguments),h=this.getLength()*t.getLength();if(c.isZero(h))return NaN;var d=this.dot(t)/h;return Math.acos(d<-1?-1:d>1?1:d)}return this.isZero()?this._angle||0:this._angle=Math.atan2(this.y,this.x)},setAngleInRadians:function(t){if(this._angle=t,!this.isZero()){var h=this.getLength();this._set(Math.cos(t)*h,Math.sin(t)*h)}},getQuadrant:function(){return this.x>=0?this.y>=0?1:4:this.y>=0?2:3}},{beans:!1,getDirectedAngle:function(){var t=f.read(arguments);return 180*Math.atan2(this.cross(t),this.dot(t))/Math.PI},getDistance:function(){var t=f.read(arguments),h=t.x-this.x,d=t.y-this.y,x=h*h+d*d;return a.read(arguments)?x:Math.sqrt(x)},normalize:function(t){t===r&&(t=1);var h=this.getLength(),d=h!==0?t/h:0,x=new f(this.x*d,this.y*d);return d>=0&&(x._angle=this._angle),x},rotate:function(t,h){if(t===0)return this.clone();t=t*Math.PI/180;var d=h?this.subtract(h):this,x=Math.sin(t),E=Math.cos(t);return d=new f(d.x*E-d.y*x,d.x*x+d.y*E),h?d.add(h):d},transform:function(t){return t?t._transformPoint(this):this},add:function(){var t=f.read(arguments);return new f(this.x+t.x,this.y+t.y)},subtract:function(){var t=f.read(arguments);return new f(this.x-t.x,this.y-t.y)},multiply:function(){var t=f.read(arguments);return new f(this.x*t.x,this.y*t.y)},divide:function(){var t=f.read(arguments);return new f(this.x/t.x,this.y/t.y)},modulo:function(){var t=f.read(arguments);return new f(this.x%t.x,this.y%t.y)},negate:function(){return new f(-this.x,-this.y)},isInside:function(){return M.read(arguments).contains(this)},isClose:function(){var t=f.read(arguments),h=a.read(arguments);return this.getDistance(t)<=h},isCollinear:function(){var t=f.read(arguments);return f.isCollinear(this.x,this.y,t.x,t.y)},isColinear:"#isCollinear",isOrthogonal:function(){var t=f.read(arguments);return f.isOrthogonal(this.x,this.y,t.x,t.y)},isZero:function(){var t=c.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=f.read(arguments);return this.x*t.x+this.y*t.y},cross:function(){var t=f.read(arguments);return this.x*t.y-this.y*t.x},project:function(){var t=f.read(arguments),h=t.isZero()?0:this.dot(t)/t.dot(t);return new f(t.x*h,t.y*h)},statics:{min:function(){var t=f.read(arguments),h=f.read(arguments);return new f(Math.min(t.x,h.x),Math.min(t.y,h.y))},max:function(){var t=f.read(arguments),h=f.read(arguments);return new f(Math.max(t.x,h.x),Math.max(t.y,h.y))},random:function(){return new f(Math.random(),Math.random())},isCollinear:function(t,h,d,x){return Math.abs(t*x-h*d)<=1e-8*Math.sqrt((t*t+h*h)*(d*d+x*x))},isOrthogonal:function(t,h,d,x){return Math.abs(t*d+h*x)<=1e-8*Math.sqrt((t*t+h*h)*(d*d+x*x))}}},a.each(["round","ceil","floor","abs"],function(t){var h=Math[t];this[t]=function(){return new f(h(this.x),h(this.y))}},{})),g=f.extend({initialize:function(t,h,d,x){this._x=t,this._y=h,this._owner=d,this._setter=x},_set:function(t,h,d){return this._x=t,this._y=h,d||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 this._setter==="setPosition"?4:0}}),y=a.extend({_class:"Size",_readIndex:!0,initialize:function(t,h){var d=typeof t,x=this.__read,E=0;if(d==="number"){var C=typeof h=="number";this._set(t,C?h:t),x&&(E=C?2:1)}else if(d==="undefined"||t===null)this._set(0,0),x&&(E=t===null?1:0);else{var b=d==="string"?t.split(/[\s,]+/)||[]:t;E=1,Array.isArray(b)?this._set(+b[0],+(b.length>1?b[1]:b[0])):"width"in b?this._set(b.width||0,b.height||0):"x"in b?this._set(b.x||0,b.y||0):(this._set(0,0),E=0)}return x&&(this.__read=E),this},set:"#initialize",_set:function(t,h){return this.width=t,this.height=h,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 y(this.width,this.height)},toString:function(){var t=p.instance;return"{ width: "+t.number(this.width)+", height: "+t.number(this.height)+" }"},_serialize:function(t){var h=t.formatter;return[h.number(this.width),h.number(this.height)]},add:function(){var t=y.read(arguments);return new y(this.width+t.width,this.height+t.height)},subtract:function(){var t=y.read(arguments);return new y(this.width-t.width,this.height-t.height)},multiply:function(){var t=y.read(arguments);return new y(this.width*t.width,this.height*t.height)},divide:function(){var t=y.read(arguments);return new y(this.width/t.width,this.height/t.height)},modulo:function(){var t=y.read(arguments);return new y(this.width%t.width,this.height%t.height)},negate:function(){return new y(-this.width,-this.height)},isZero:function(){var t=c.isZero;return t(this.width)&&t(this.height)},isNaN:function(){return isNaN(this.width)||isNaN(this.height)},statics:{min:function(t,h){return new y(Math.min(t.width,h.width),Math.min(t.height,h.height))},max:function(t,h){return new y(Math.max(t.width,h.width),Math.max(t.height,h.height))},random:function(){return new y(Math.random(),Math.random())}}},a.each(["round","ceil","floor","abs"],function(t){var h=Math[t];this[t]=function(){return new y(h(this.width),h(this.height))}},{})),w=y.extend({initialize:function(t,h,d,x){this._width=t,this._height=h,this._owner=d,this._setter=x},_set:function(t,h,d){return this._width=t,this._height=h,d||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)}}),M=a.extend({_class:"Rectangle",_readIndex:!0,beans:!0,initialize:function(t,h,d,x){var E,C=typeof t;if(C==="number"?(this._set(t,h,d,x),E=4):C==="undefined"||t===null?(this._set(0,0,0,0),E=t===null?1:0):arguments.length===1&&(Array.isArray(t)?(this._set.apply(this,t),E=1):t.x!==r||t.width!==r?(this._set(t.x||0,t.y||0,t.width||0,t.height||0),E=1):t.from===r&&t.to===r&&(this._set(0,0,0,0),a.filter(this,t),E=1)),E===r){var b,U,D=f.readNamed(arguments,"from"),k=a.peek(arguments),Z=D.x,Y=D.y;if(k&&k.x!==r||a.hasNamed(arguments,"to")){var W=f.readNamed(arguments,"to");b=W.x-Z,U=W.y-Y,b<0&&(Z=W.x,b=-b),U<0&&(Y=W.y,U=-U)}else{var F=y.read(arguments);b=F.width,U=F.height}this._set(Z,Y,b,U),E=arguments.__index;var z=arguments.__filtered;z&&(this.__filtered=z)}return this.__read&&(this.__read=E),this},set:"#initialize",_set:function(t,h,d,x){return this.x=t,this.y=h,this.width=d,this.height=x,this},clone:function(){return new M(this.x,this.y,this.width,this.height)},equals:function(t){var h=a.isPlainValue(t)?M.read(arguments):t;return h===this||h&&this.x===h.x&&this.y===h.y&&this.width===h.width&&this.height===h.height||!1},toString:function(){var t=p.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 h=t.formatter;return[h.number(this.x),h.number(this.y),h.number(this.width),h.number(this.height)]},getPoint:function(t){return new(t?f:g)(this.x,this.y,this,"setPoint")},setPoint:function(){var t=f.read(arguments);this.x=t.x,this.y=t.y},getSize:function(t){return new(t?y:w)(this.width,this.height,this,"setSize")},_fw:1,_fh:1,setSize:function(){var t=y.read(arguments),h=this._sx,d=this._sy,x=t.width,E=t.height;h&&(this.x+=(this.width-x)*h),d&&(this.y+=(this.height-E)*d),this.width=x,this.height=E,this._fw=this._fh=1},getLeft:function(){return this.x},setLeft:function(t){if(!this._fw){var h=t-this.x;this.width-=this._sx===.5?2*h:h}this.x=t,this._sx=this._fw=0},getTop:function(){return this.y},setTop:function(t){if(!this._fh){var h=t-this.y;this.height-=this._sy===.5?2*h:h}this.y=t,this._sy=this._fh=0},getRight:function(){return this.x+this.width},setRight:function(t){if(!this._fw){var h=t-this.x;this.width=this._sx===.5?2*h:h}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 h=t-this.y;this.height=this._sy===.5?2*h:h}this.y=t-this.height,this._sy=1,this._fh=0},getCenterX:function(){return this.x+this.width/2},setCenterX:function(t){this._fw||this._sx===.5?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||this._sy===.5?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?f:g)(this.getCenterX(),this.getCenterY(),this,"setCenter")},setCenter:function(){var t=f.read(arguments);return this.setCenterX(t.x),this.setCenterY(t.y),this},getArea:function(){return this.width*this.height},isEmpty:function(){return this.width===0||this.height===0},contains:function(t){return t&&t.width!==r||(Array.isArray(t)?t:arguments).length===4?this._containsRectangle(M.read(arguments)):this._containsPoint(f.read(arguments))},_containsPoint:function(t){var h=t.x,d=t.y;return h>=this.x&&d>=this.y&&h<=this.x+this.width&&d<=this.y+this.height},_containsRectangle:function(t){var h=t.x,d=t.y;return h>=this.x&&d>=this.y&&h+t.width<=this.x+this.width&&d+t.height<=this.y+this.height},intersects:function(){var t=M.read(arguments),h=a.read(arguments)||0;return t.x+t.width>this.x-h&&t.y+t.height>this.y-h&&t.x<this.x+this.width+h&&t.y<this.y+this.height+h},intersect:function(){var t=M.read(arguments),h=Math.max(this.x,t.x),d=Math.max(this.y,t.y),x=Math.min(this.x+this.width,t.x+t.width),E=Math.min(this.y+this.height,t.y+t.height);return new M(h,d,x-h,E-d)},unite:function(){var t=M.read(arguments),h=Math.min(this.x,t.x),d=Math.min(this.y,t.y),x=Math.max(this.x+this.width,t.x+t.width),E=Math.max(this.y+this.height,t.y+t.height);return new M(h,d,x-h,E-d)},include:function(){var t=f.read(arguments),h=Math.min(this.x,t.x),d=Math.min(this.y,t.y),x=Math.max(this.x+this.width,t.x),E=Math.max(this.y+this.height,t.y);return new M(h,d,x-h,E-d)},expand:function(){var t=y.read(arguments),h=t.width,d=t.height;return new M(this.x-h/2,this.y-d/2,this.width+h,this.height+d)},scale:function(t,h){return this.expand(this.width*t-this.width,this.height*(h===r?t:h)-this.height)}},a.each([["Top","Left"],["Top","Right"],["Bottom","Left"],["Bottom","Right"],["Left","Center"],["Top","Center"],["Right","Center"],["Bottom","Center"]],function(t,h){var d=t.join(""),x=/^[RL]/.test(d);h>=4&&(t[1]+=x?"Y":"X");var E=t[x?0:1],C=t[x?1:0],b="get"+E,U="get"+C,D="set"+E,k="set"+C,Z="set"+d;this["get"+d]=function(Y){return new(Y?f:g)(this[b](),this[U](),this,Z)},this[Z]=function(){var Y=f.read(arguments);this[D](Y.x),this[k](Y.y)}},{beans:!0})),T=M.extend({initialize:function(t,h,d,x,E,C){this._set(t,h,d,x,!0),this._owner=E,this._setter=C},_set:function(t,h,d,x,E){return this._x=t,this._y=h,this._width=d,this._height=x,E||this._owner[this._setter](this),this}},new function(){var t=M.prototype;return a.each(["x","y","width","height"],function(h){var d=a.capitalize(h),x="_"+h;this["get"+d]=function(){return this[x]},this["set"+d]=function(E){this[x]=E,this._dontNotify||this._owner[this._setter](this)}},a.each(["Point","Size","Center","Left","Top","Right","Bottom","CenterX","CenterY","TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],function(h){var d="set"+h;this[d]=function(){this._dontNotify=!0,t[d].apply(this,arguments),this._dontNotify=!1,this._owner[this._setter](this)}},{isSelected:function(){return!!(2&this._owner._selection)},setSelected:function(h){var d=this._owner;d._changeSelection&&d._changeSelection(2,h)}}))}),B=a.extend({_class:"Matrix",initialize:function t(h,d){var x=arguments.length,E=!0;if(x>=6?this._set.apply(this,arguments):x===1||x===2?h instanceof t?this._set(h._a,h._b,h._c,h._d,h._tx,h._ty,d):Array.isArray(h)?this._set.apply(this,d?h.concat([d]):h):E=!1:x?E=!1:this.reset(),!E)throw new Error("Unsupported matrix parameters");return this},set:"#initialize",_set:function(t,h,d,x,E,C,b){return this._a=t,this._b=h,this._c=d,this._d=x,this._tx=E,this._ty=C,b||this._changed(),this},_serialize:function(t,h){return a.serialize(this.getValues(),t,!0,h)},_changed:function(){var t=this._owner;t&&(t._applyMatrix?t.transform(null,!0):t._changed(9))},clone:function(){return new B(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=p.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,h){var d=this._owner;return!!d&&(d.transform(null,!0,a.pick(t,!0),h),this.isIdentity())},translate:function(){var t=f.read(arguments),h=t.x,d=t.y;return this._tx+=h*this._a+d*this._c,this._ty+=h*this._b+d*this._d,this._changed(),this},scale:function(){var t=f.read(arguments),h=f.read(arguments,0,{readNull:!0});return h&&this.translate(h),this._a*=t.x,this._b*=t.x,this._c*=t.y,this._d*=t.y,h&&this.translate(h.negate()),this._changed(),this},rotate:function(t){t*=Math.PI/180;var h=f.read(arguments,1),d=h.x,x=h.y,E=Math.cos(t),C=Math.sin(t),b=d-d*E+x*C,U=x-d*C-x*E,D=this._a,k=this._b,Z=this._c,Y=this._d;return this._a=E*D+C*Z,this._b=E*k+C*Y,this._c=-C*D+E*Z,this._d=-C*k+E*Y,this._tx+=b*D+U*Z,this._ty+=b*k+U*Y,this._changed(),this},shear:function(){var t=f.read(arguments),h=f.read(arguments,0,{readNull:!0});h&&this.translate(h);var d=this._a,x=this._b;return this._a+=t.y*this._c,this._b+=t.y*this._d,this._c+=t.x*d,this._d+=t.x*x,h&&this.translate(h.negate()),this._changed(),this},skew:function(){var t=f.read(arguments),h=f.read(arguments,0,{readNull:!0}),d=Math.PI/180,x=new f(Math.tan(t.x*d),Math.tan(t.y*d));return this.shear(x,h)},append:function(t,h){if(t){var d=this._a,x=this._b,E=this._c,C=this._d,b=t._a,U=t._c,D=t._b,k=t._d,Z=t._tx,Y=t._ty;this._a=b*d+D*E,this._c=U*d+k*E,this._b=b*x+D*C,this._d=U*x+k*C,this._tx+=Z*d+Y*E,this._ty+=Z*x+Y*C,h||this._changed()}return this},prepend:function(t,h){if(t){var d=this._a,x=this._b,E=this._c,C=this._d,b=this._tx,U=this._ty,D=t._a,k=t._c,Z=t._b,Y=t._d,W=t._tx,F=t._ty;this._a=D*d+k*x,this._c=D*E+k*C,this._b=Z*d+Y*x,this._d=Z*E+Y*C,this._tx=D*b+k*U+W,this._ty=Z*b+Y*U+F,h||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,h=this._b,d=this._c,x=this._d,E=this._tx,C=this._ty,b=t*x-h*d,U=null;return b&&!isNaN(b)&&isFinite(E)&&isFinite(C)&&(this._a=x/b,this._b=-h/b,this._c=-d/b,this._d=t/b,this._tx=(d*C-x*E)/b,this._ty=(h*E-t*C)/b,U=this),U},inverted:function(){return this.clone().invert()},concatenate:"#append",preConcatenate:"#prepend",chain:"#appended",_shiftless:function(){return new B(this._a,this._b,this._c,this._d,0,0)},_orNullIfIdentity:function(){return this.isIdentity()?null:this},isIdentity:function(){return this._a===1&&this._b===0&&this._c===0&&this._d===1&&this._tx===0&&this._ty===0},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,h,d){return arguments.length<3?this._transformPoint(f.read(arguments)):this._transformCoordinates(t,h,d)},_transformPoint:function(t,h,d){var x=t.x,E=t.y;return h||(h=new f),h._set(x*this._a+E*this._c+this._tx,x*this._b+E*this._d+this._ty,d)},_transformCoordinates:function(t,h,d){for(var x=0,E=2*d;x<E;x+=2){var C=t[x],b=t[x+1];h[x]=C*this._a+b*this._c+this._tx,h[x+1]=C*this._b+b*this._d+this._ty}return h},_transformCorners:function(t){var h=t.x,d=t.y,x=h+t.width,E=d+t.height,C=[h,d,x,d,x,E,h,E];return this._transformCoordinates(C,C,4)},_transformBounds:function(t,h,d){for(var x=this._transformCorners(t),E=x.slice(0,2),C=E.slice(),b=2;b<8;b++){var U=x[b],D=1&b;U<E[D]?E[D]=U:U>C[D]&&(C[D]=U)}return h||(h=new M),h._set(E[0],E[1],C[0]-E[0],C[1]-E[1],d)},inverseTransform:function(){return this._inverseTransform(f.read(arguments))},_inverseTransform:function(t,h,d){var x=this._a,E=this._b,C=this._c,b=this._d,U=this._tx,D=this._ty,k=x*b-E*C,Z=null;if(k&&!isNaN(k)&&isFinite(U)&&isFinite(D)){var Y=t.x-this._tx,W=t.y-this._ty;h||(h=new f),Z=h._set((Y*b-W*C)/k,(W*x-Y*E)/k,d)}return Z},decompose:function(){var t,h,d,x=this._a,E=this._b,C=this._c,b=this._d,U=x*b-E*C,D=Math.sqrt,k=Math.atan2,Z=180/Math.PI;if(x!==0||E!==0){var Y=D(x*x+E*E);t=Math.acos(x/Y)*(E>0?1:-1),h=[Y,U/Y],d=[k(x*C+E*b,Y*Y),0]}else if(C!==0||b!==0){var W=D(C*C+b*b);t=Math.asin(C/W)*(b>0?1:-1),h=[U/W,W],d=[0,k(x*C+E*b,W*W)]}else t=0,d=h=[0,0];return{translation:this.getTranslation(),rotation:t*Z,scaling:new f(h),skewing:new f(d[0]*Z,d[1]*Z)}},getValues:function(){return[this._a,this._b,this._c,this._d,this._tx,this._ty]},getTranslation:function(){return new f(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)}},a.each(["a","b","c","d","tx","ty"],function(t){var h=a.capitalize(t),d="_"+t;this["get"+h]=function(){return this[d]},this["set"+h]=function(x){this[d]=x,this._changed()}},{})),H=a.extend({_class:"Line",initialize:function(t,h,d,x,E){var C=!1;arguments.length>=4?(this._px=t,this._py=h,this._vx=d,this._vy=x,C=E):(this._px=t.x,this._py=t.y,this._vx=h.x,this._vy=h.y,C=d),C||(this._vx-=this._px,this._vy-=this._py)},getPoint:function(){return new f(this._px,this._py)},getVector:function(){return new f(this._vx,this._vy)},getLength:function(){return this.getVector().getLength()},intersect:function(t,h){return H.intersect(this._px,this._py,this._vx,this._vy,t._px,t._py,t._vx,t._vy,!0,h)},getSide:function(t,h){return H.getSide(this._px,this._py,this._vx,this._vy,t.x,t.y,!0,h)},getDistance:function(t){return Math.abs(this.getSignedDistance(t))},getSignedDistance:function(t){return H.getSignedDistance(this._px,this._py,this._vx,this._vy,t.x,t.y,!0)},isCollinear:function(t){return f.isCollinear(this._vx,this._vy,t._vx,t._vy)},isOrthogonal:function(t){return f.isOrthogonal(this._vx,this._vy,t._vx,t._vy)},statics:{intersect:function(t,h,d,x,E,C,b,U,D,k){D||(d-=t,x-=h,b-=E,U-=C);var Z=d*U-x*b;if(!c.isZero(Z)){var Y=t-E,W=h-C,F=(b*W-U*Y)/Z,z=(d*W-x*Y)/Z;if(k||-1e-12<F&&F<1+1e-12&&-1e-12<z&&z<1+1e-12)return k||(F=F<=0?0:F>=1?1:F),new f(t+F*d,h+F*x)}},getSide:function(t,h,d,x,E,C,b,U){b||(d-=t,x-=h);var D=E-t,k=D*x-(C-h)*d;return!U&&c.isZero(k)&&(k=(D*d+D*d)/(d*d+x*x))>=0&&k<=1&&(k=0),k<0?-1:k>0?1:0},getSignedDistance:function(t,h,d,x,E,C,b){return b||(d-=t,x-=h),d===0?x>0?E-t:t-E:x===0?d<0?C-h:h-C:((E-t)*x-(C-h)*d)/Math.sqrt(d*d+x*x)},getDistance:function(t,h,d,x,E,C,b){return Math.abs(H.getSignedDistance(t,h,d,x,E,C,b))}}}),J=v.extend({_class:"Project",_list:"projects",_reference:"project",_compactSerialize:!0,initialize:function(t){v.call(this,!0),this._children=[],this._namedChildren={},this._activeLayer=null,this._currentStyle=new ye(null,null,this),this._view=le.create(this,t||Oe.getCanvas(1,1)),this._selectionItems={},this._selectionCount=0,this._updateVersion=0},_serialize:function(t,h){return a.serialize(this._children,t,!0,h)},_changed:function(t,h){if(1&t){var d=this._view;d&&(d._needsUpdate=!0,!d._requested&&d._autoUpdate&&d.requestUpdate())}var x=this._changes;if(x&&h){var E=this._changesById,C=h._id,b=E[C];b?b.flags|=t:x.push(E[C]={item:h,flags:t})}},clear:function(){for(var t=this._children,h=t.length-1;h>=0;h--)t[h].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 O({project:this,insert:!0})},getSymbolDefinitions:function(){var t=[],h={};return this.getItems({class:R,match:function(d){var x=d._definition,E=x._id;return h[E]||(h[E]=!0,t.push(x)),!1}}),t},getSymbols:"getSymbolDefinitions",getSelectedItems:function(){var t=this._selectionItems,h=[];for(var d in t){var x=t[d],E=x._selection;1&E&&x.isInserted()?h.push(x):E||this._updateSelection(x)}return h},_updateSelection:function(t){var h=t._id,d=this._selectionItems;t._selection?d[h]!==t&&(this._selectionCount++,d[h]=t):d[h]===t&&(this._selectionCount--,delete d[h])},selectAll:function(){for(var t=this._children,h=0,d=t.length;h<d;h++)t[h].setFullySelected(!0)},deselectAll:function(){var t=this._selectionItems;for(var h in t)t[h].setFullySelected(!1)},addLayer:function(t){return this.insertLayer(r,t)},insertLayer:function(t,h){if(h instanceof O){h._remove(!1,!0),a.splice(this._children,[h],t,0),h._setProject(this,!0);var d=h._name;d&&h.setName(d),this._changes&&h._changed(5),this._activeLayer||(this._activeLayer=h)}else h=null;return h},_insertItem:function(t,h,d){return h=this.insertLayer(t,h)||(this._activeLayer||this._insertItem(r,new O(Q.NO_INSERT),!0)).insertChild(t,h),d&&h.activate&&h.activate(),h},getItems:function(t){return Q._getItems(this,t)},getItem:function(t){return Q._getItems(this,t,null,null,!0)[0]||null},importJSON:function(t){this.activate();var h=this._activeLayer;return a.importJSON(t,h&&h.isEmpty()&&h)},removeOn:function(t){var h=this._removeSets;if(h){t==="mouseup"&&(h.mousedrag=null);var d=h[t];if(d){for(var x in d){var E=d[x];for(var C in h){var b=h[C];b&&b!=d&&delete b[E._id]}E.remove()}h[t]=null}}},draw:function(t,h,d){this._updateVersion++,t.save(),h.applyToContext(t);for(var x=this._children,E=new a({offset:new f(0,0),pixelRatio:d,viewMatrix:h.isIdentity()?null:h,matrices:[new B],updateMatrix:!0}),C=0,b=x.length;C<b;C++)x[C].draw(t,E);if(t.restore(),this._selectionCount>0){t.save(),t.strokeWidth=1;var U=this._selectionItems,D=this._scope.settings.handleSize,k=this._updateVersion;for(var Z in U)U[Z]._drawSelection(t,h,D,U,k);t.restore()}}}),Q=a.extend(u,{statics:{extend:function t(h){return h._serializeFields&&(h._serializeFields=a.set({},this.prototype._serializeFields,h._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 B,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 a.each(t,function(h){this._events[h]={install:function(d){this.getView()._countItemEvent(d,1)},uninstall:function(d){this.getView()._countItemEvent(d,-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,h){var d=t&&a.isPlainObject(t),x=d&&t.internal===!0,E=this._matrix=new B,C=d&&t.project||paper.project,b=paper.settings;return this._id=x?null:_.get(),this._parent=this._index=null,this._applyMatrix=this._canApplyMatrix&&b.applyMatrix,h&&E.translate(h),E._owner=this,this._style=new ye(C._currentStyle,this,C),x||d&&t.insert==0||!b.insertItems&&(!d||t.insert!==!0)?this._setProject(C):(d&&t.parent||C)._insertItem(r,this,!0),d&&t!==Q.NO_INSERT&&this.set(t,{internal:!0,insert:!0,project:!0,parent:!0}),d},_serialize:function(t,h){function d(C){for(var b in C){var U=E[b];a.equals(U,b==="leading"?1.2*C.fontSize:C[b])||(x[b]=a.serialize(U,t,b!=="data",h))}}var x={},E=this;return d(this._serializeFields),this instanceof q||d(this._style._defaults),[this._class,x]},_changed:function(t){var h=this._symbol,d=this._parent||h,x=this._project;8&t&&(this._bounds=this._position=this._decomposed=this._globalMatrix=r),d&&40&t&&Q._clearBoundsCache(d),2&t&&Q._clearBoundsCache(this),x&&x._changed(t,this),h&&h._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 h=this._getOwner();if(t&&h){var d=h._children,x=h._namedChildren;(x[t]=x[t]||[]).push(this),t in d||(d[t]=this)}this._name=t||r,this._changed(128)},getStyle:function(){return this._style},setStyle:function(t){this.getStyle().set(t)}},a.each(["locked","visible","blendMode","opacity","guide"],function(t){var h=a.capitalize(t),d="_"+t,x={locked:128,visible:137};this["get"+h]=function(){return this[d]},this["set"+h]=function(E){E!=this[d]&&(this[d]=E,this._changed(x[t]||129))}},{}),{beans:!0,getSelection:function(){return this._selection},setSelection:function(t){if(t!==this._selection){this._selection=t;var h=this._project;h&&(h._updateSelection(this),this._changed(129))}},_changeSelection:function(t,h){var d=this._selection;this.setSelection(h?d|t:d&~t)},isSelected:function(){if(this._selectChildren){for(var t=this._children,h=0,d=t.length;h<d;h++)if(t[h].isSelected())return!0}return!!(1&this._selection)},setSelected:function(t){if(this._selectChildren)for(var h=this._children,d=0,x=h.length;d<x;d++)h[d].setSelected(t);this._changeSelection(1,t)},isFullySelected:function(){var t=this._children,h=!!(1&this._selection);if(t&&h){for(var d=0,x=t.length;d<x;d++)if(!t[d].isFullySelected())return!1;return!0}return h},setFullySelected:function(t){var h=this._children;if(h)for(var d=0,x=h.length;d<x;d++)h[d].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 h=this._position,d=t?f:g;if(!h){var x=this._pivot;h=this._position=x?this._matrix._transformPoint(x):this.getBounds().getCenter(!0)}return new d(h.x,h.y,this,"setPosition")},setPosition:function(){this.translate(f.read(arguments).subtract(this.getPosition(!0)))},getPivot:function(){var t=this._pivot;return t?new g(t.x,t.y,this,"setPivot"):null},setPivot:function(){this._pivot=f.read(arguments,0,{clone:!0,readNull:!0}),this._position=r}},a.each({getStrokeBounds:{stroke:!0},getHandleBounds:{handle:!0},getInternalBounds:{internal:!0}},function(t,h){this[h]=function(d){return this.getBounds(d,t)}},{beans:!0,getBounds:function(t,h){var d=h||t instanceof B,x=a.set({},d?h:t,this._boundsOptions);x.stroke&&!this.getStrokeScaling()||(x.cacheItem=this);var E=this._getCachedBounds(d&&t,x).rect;return arguments.length?E:new T(E.x,E.y,E.width,E.height,this,"setBounds")},setBounds:function(){var t=M.read(arguments),h=this.getBounds(),d=this._matrix,x=new B,E=t.getCenter();x.translate(E),t.width==h.width&&t.height==h.height||(d.isInvertible()||(d.set(d._backup||new B().translate(d.getTranslation())),h=this.getBounds()),x.scale(h.width!==0?t.width/h.width:0,h.height!==0?t.height/h.height:0)),E=h.getCenter(),x.translate(-E.x,-E.y),this.transform(x)},_getBounds:function(t,h){var d=this._children;return d&&d.length?(Q._updateBoundsCache(this,h.cacheItem),Q._getBounds(d,t,h)):new M},_getBoundsCacheKey:function(t,h){return[t.stroke?1:0,t.handle?1:0,h?1:0].join("")},_getCachedBounds:function(t,h,d){t=t&&t._orNullIfIdentity();var x=h.internal&&!d,E=h.cacheItem,C=x?null:this._matrix._orNullIfIdentity(),b=E&&(!t||t.equals(C))&&this._getBoundsCacheKey(h,x),U=this._bounds;if(Q._updateBoundsCache(this._parent||this._symbol,E),b&&U&&b in U)return{rect:(W=U[b]).rect.clone(),nonscaling:W.nonscaling};var D=this._getBounds(t||C,h),k=D.rect||D,Z=this._style,Y=D.nonscaling||Z.hasStroke()&&!Z.getStrokeScaling();if(b){U||(this._bounds=U={});var W=U[b]={rect:k.clone(),nonscaling:Y,internal:x}}return{rect:k,nonscaling:Y}},_getStrokeMatrix:function(t,h){var d=this.getStrokeScaling()?null:h&&h.internal?this:this._parent||this._symbol&&this._symbol._item,x=d?d.getViewMatrix().invert():t;return x&&x._shiftless()},statics:{_updateBoundsCache:function(t,h){if(t&&h){var d=h._id,x=t._boundsCache=t._boundsCache||{ids:{},list:[]};x.ids[d]||(x.list.push(h),x.ids[d]=h)}},_clearBoundsCache:function(t){var h=t._boundsCache;if(h){t._bounds=t._position=t._boundsCache=r;for(var d=0,x=h.list,E=x.length;d<E;d++){var C=x[d];C!==t&&(C._bounds=C._position=r,C._boundsCache&&Q._clearBoundsCache(C))}}},_getBounds:function(t,h,d){var x=1/0,E=-x,C=x,b=E,U=!1;d=d||{};for(var D=0,k=t.length;D<k;D++){var Z=t[D];if(Z._visible&&!Z.isEmpty()){var Y=Z._getCachedBounds(h&&h.appended(Z._matrix),d,!0),W=Y.rect;x=Math.min(W.x,x),C=Math.min(W.y,C),E=Math.max(W.x+W.width,E),b=Math.max(W.y+W.height,b),Y.nonscaling&&(U=!0)}}return{rect:isFinite(x)?new M(x,C,E-x,b-C):new M,nonscaling:U}}}}),{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 h=this.getRotation();if(h!=null&&t!=null){var d=this._decomposed;this.rotate(t-h),d&&(d.rotation=t,this._decomposed=d)}},getScaling:function(){var t=this._decompose(),h=t&&t.scaling;return new g(h?h.x:1,h?h.y:1,this,"setScaling")},setScaling:function(){var t=this.getScaling(),h=f.read(arguments,0,{clone:!0,readNull:!0});if(t&&h&&!t.equals(h)){var d=this.getRotation(),x=this._decomposed,E=new B,C=this.getPosition(!0);E.translate(C),d&&E.rotate(d),E.scale(h.x/t.x,h.y/t.y),d&&E.rotate(-d),E.translate(C.negate()),this.transform(E),x&&(x.scaling=h,this._decomposed=x)}},getMatrix:function(){return this._matrix},setMatrix:function(){var t=this._matrix;t.initialize.apply(t,arguments)},getGlobalMatrix:function(t){var h=this._globalMatrix,d=this._project._updateVersion;if(h&&h._updateVersion!==d&&(h=null),!h){h=this._globalMatrix=this._matrix.clone();var x=this._parent;x&&h.prepend(x.getGlobalMatrix(!0)),h._updateVersion=d}return t?h:h.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,h){if(this._project!==t){this._project&&this._installEvents(!1),this._project=t;for(var d=this._children,x=0,E=d&&d.length;x<E;x++)d[x]._setProject(t);h=!0}h&&this._installEvents(!0)},getView:function(){return this._project._view},_installEvents:function t(h){t.base.call(this,h);for(var d=this._children,x=0,E=d&&d.length;x<E;x++)d[x]._installEvents(h)},getLayer:function(){for(var t=this;t=t._parent;)if(t instanceof O)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 a.equals(this._children,t._children)},clone:function(t){var h=new this.constructor(Q.NO_INSERT),d=this._children,x=a.pick(t?t.insert:r,t===r||t===!0),E=a.pick(t?t.deep:r,!0);d&&h.copyAttributes(this),d&&!E||h.copyContent(this),d||h.copyAttributes(this),x&&h.insertAbove(this);var C=this._name,b=this._parent;if(C&&b){for(var d=b._children,U=C,D=1;d[C];)C=U+" "+D++;C!==U&&h.setName(C)}return h},copyContent:function(t){for(var h=t._children,d=0,x=h&&h.length;d<x;d++)this.addChild(h[d].clone(!1),!0)},copyAttributes:function(t,h){this.setStyle(t._style);for(var d=["_locked","_visible","_blendMode","_opacity","_clipMask","_guide"],x=0,E=d.length;x<E;x++){var C=d[x];t.hasOwnProperty(C)&&(this[C]=t[C])}h||this._matrix.set(t._matrix,!0),this.setApplyMatrix(t._applyMatrix),this.setPivot(t._pivot),this.setSelection(t._selection);var b=t._data,U=t._name;this._data=b?a.clone(b):null,U&&this.setName(U)},rasterize:function(t,h){var d=this.getStrokeBounds(),x=(t||this.getView().getResolution())/72,E=d.getTopLeft().floor(),C=d.getBottomRight().ceil(),b=new y(C.subtract(E)),U=new pe(Q.NO_INSERT);if(!b.isZero()){var D=Oe.getCanvas(b.multiply(x)),k=D.getContext("2d"),Z=new B().scale(x).translate(E.negate());k.save(),Z.applyToContext(k),this.draw(k,new a({matrices:[Z]})),k.restore(),U.setCanvas(D)}return U.transform(new B().translate(E.add(b.divide(2))).scale(1/x)),(h===r||h)&&U.insertAbove(this),U},contains:function(){return!!this._contains(this._matrix._inverseTransform(f.read(arguments)))},_contains:function(t){var h=this._children;if(h){for(var d=h.length-1;d>=0;d--)if(h[d].contains(t))return!0;return!1}return t.isInside(this.getInternalBounds())},isInside:function(){return M.read(arguments).contains(this.getBounds())},_asPathItem:function(){return new ne.Rectangle({rectangle:this.getInternalBounds(),matrix:this._matrix,insert:!1})},intersects:function(t,h){return t instanceof Q&&this._asPathItem().getIntersections(t._asPathItem(),null,h,!0).length>0}},new function(){function t(){return this._hitTest(f.read(arguments),re.getOptions(arguments))}function h(){var x=f.read(arguments),E=re.getOptions(arguments),C=[];return this._hitTest(x,a.set({all:C},E)),C}function d(x,E,C,b){var U=this._children;if(U)for(var D=U.length-1;D>=0;D--){var k=U[D],Z=k!==b&&k._hitTest(x,E,C);if(Z&&!E.all)return Z}return null}return J.inject({hitTest:t,hitTestAll:h,_hitTest:d}),{hitTest:t,hitTestAll:h,_hitTestChildren:d}},{_hitTest:function(t,h,d){function x(I){return I&&W&&!W(I)&&(I=null),I&&h.all&&h.all.push(I),I}function E(I,te){var fe=te?k["get"+te]():F.getPosition();if(t.subtract(fe).divide(D).length<=1)return new re(I,F,{name:te?a.hyphenate(te):I,point:fe})}if(this._locked||!this._visible||this._guide&&!h.guides||this.isEmpty())return null;var C=this._matrix,b=d?d.appended(C):this.getGlobalMatrix().prepend(this.getView()._matrix),U=Math.max(h.tolerance,1e-12),D=h._tolerancePadding=new y(ne._getStrokePadding(U,C._shiftless().invert()));if(!(t=C._inverseTransform(t))||!this._children&&!this.getBounds({internal:!0,stroke:!0,handle:!0}).expand(D.multiply(2))._containsPoint(t))return null;var k,Z,Y=!(h.guides&&!this._guide||h.selected&&!this.isSelected()||h.type&&h.type!==a.hyphenate(this._class)||h.class&&!(this instanceof h.class)),W=h.match,F=this,z=h.position,G=h.center,X=h.bounds;if(Y&&this._parent&&(z||G||X)){if((G||X)&&(k=this.getInternalBounds()),!(Z=z&&E("position")||G&&E("center","Center"))&&X)for(var A=["TopLeft","TopRight","BottomLeft","BottomRight","LeftCenter","TopCenter","RightCenter","BottomCenter"],N=0;N<8&&!Z;N++)Z=E("bounds",A[N]);Z=x(Z)}return Z||(Z=this._hitTestChildren(t,h,b)||Y&&x(this._hitTestSelf(t,h,b,this.getStrokeScaling()?null:b._shiftless().invert()))||null),Z&&Z.point&&(Z.point=C.transform(Z.point)),Z},_hitTestSelf:function(t,h){if(h.fill&&this.hasFill()&&this._contains(t))return new re("fill",this)},matches:function(t,h){function d(b,U){for(var D in b)if(b.hasOwnProperty(D)){var k=b[D],Z=U[D];if(a.isPlainObject(k)&&a.isPlainObject(Z)){if(!d(k,Z))return!1}else if(!a.equals(k,Z))return!1}return!0}var x=typeof t;if(x==="object"){for(var E in t)if(t.hasOwnProperty(E)&&!this.matches(E,t[E]))return!1;return!0}if(x==="function")return t(this);if(t==="match")return h(this);var C=/^(empty|editable)$/.test(t)?this["is"+a.capitalize(t)]():t==="type"?a.hyphenate(this._class):this[t];if(t==="class"){if(typeof h=="function")return this instanceof h;C=this._class}if(typeof h=="function")return!!h(C);if(h){if(h.test)return h.test(C);if(a.isPlainObject(h))return d(h,C)}return a.equals(C,h)},getItems:function(t){return Q._getItems(this,t,this._matrix)},getItem:function(t){return Q._getItems(this,t,this._matrix,null,!0)[0]||null},statics:{_getItems:function t(h,d,x,E,C){if(!E){var b=typeof d=="object"&&d,U=b&&b.overlapping,D=b&&b.inside,k=(A=U||D)&&M.read([A]);E={items:[],recursive:b&&b.recursive!==!1,inside:!!D,overlapping:!!U,rect:k,path:U&&new ne.Rectangle({rectangle:k,insert:!1})},b&&(d=a.filter({},d,{recursive:!0,inside:!0,overlapping:!0}))}var Z=h._children,Y=E.items;x=(k=E.rect)&&(x||new B);for(var W=0,F=Z&&Z.length;W<F;W++){var z=Z[W],G=x&&x.appended(z._matrix),X=!0;if(k){var A=z.getBounds(G);if(!k.intersects(A))continue;k.contains(A)||E.overlapping&&(A.contains(k)||E.path.intersects(z,G))||(X=!1)}if(X&&z.matches(d)&&(Y.push(z),C)||(E.recursive!==!1&&t(z,d,G,E,C),C&&Y.length>0))break}return Y}}},{importJSON:function(t){var h=a.importJSON(t,this);return h!==this?this.addChild(h):h},addChild:function(t){return this.insertChild(r,t)},insertChild:function(t,h){var d=h?this.insertChildren(t,[h]):null;return d&&d[0]},addChildren:function(t){return this.insertChildren(this._children.length,t)},insertChildren:function(t,h){var d=this._children;if(d&&h&&h.length>0){for(var x={},E=(h=a.slice(h)).length-1;E>=0;E--){var C=(k=h[E])&&k._id;!k||x[C]?h.splice(E,1):(k._remove(!1,!0),x[C]=!0)}a.splice(d,h,t,0);for(var b=this._project,U=b._changes,E=0,D=h.length;E<D;E++){var k=h[E],Z=k._name;k._parent=this,k._setProject(b,!0),Z&&k.setName(Z),U&&k._changed(5)}this._changed(11)}else h=null;return h},_insertItem:"#insertChild",_insertAt:function(t,h){var d=t&&t._getOwner(),x=t!==this&&d?this:null;return x&&(x._remove(!1,!0),d._insertItem(t._index+h,x)),x},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(r,this):null},appendTop:"#addChild",appendBottom:function(t){return this.insertChild(0,t)},moveAbove:"#insertAbove",moveBelow:"#insertBelow",addTo:function(t){return t._insertItem(r,this)},copyTo:function(t){return this.clone(!1).addTo(t)},reduce:function(t){var h=this._children;if(h&&h.length===1){var d=h[0].reduce(t);return this._parent?(d.insertAbove(this),this.remove()):d.remove(),d}return this},_removeNamed:function(){var t=this._getOwner();if(t){var h=t._children,d=t._namedChildren,x=this._name,E=d[x],C=E?E.indexOf(this):-1;C!==-1&&(h[x]==this&&delete h[x],E.splice(C,1),E.length?h[x]=E[0]:delete d[x])}},_remove:function(t,h){var d=this._getOwner(),x=this._project,E=this._index;return!!d&&(this._name&&this._removeNamed(),E!=null&&(x._activeLayer===this&&(x._activeLayer=this.getNextSibling()||this.getPreviousSibling()),a.splice(d._children,null,E,1)),this._installEvents(!1),t&&x._changes&&this._changed(5),h&&d._changed(11,this),this._parent=null,!0)},remove:function(){return this._remove(!0,!0)},replaceWith:function(t){var h=t&&t.insertBelow(this);return h&&this.remove(),h},removeChildren:function(t,h){if(!this._children)return null;t=t||0,h=a.pick(h,this._children.length);for(var d=a.splice(this._children,null,t,h-t),x=d.length-1;x>=0;x--)d[x]._remove(!0,!1);return d.length>0&&this._changed(11),d},clear:"#removeChildren",reverseChildren:function(){if(this._children){this._children.reverse();for(var t=0,h=this._children.length;t<h;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 h(b){var U=[];do U.unshift(b);while(b=b._parent);return U}for(var d=h(this),x=h(t),E=0,C=Math.min(d.length,x.length);E<C;E++)if(d[E]!=x[E])return d[E]._index<x[E]._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 this._getOrder(t)===-1},isBelow:function(t){return this._getOrder(t)===1},isParent:function(t){return this._parent===t},isChild:function(t){return t&&t._parent===this},isDescendant:function(t){for(var h=this;h=h._parent;)if(h===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 h=this._parent;h;){if(h._parent&&/^(Group|Layer|CompoundPath)$/.test(h._class)&&t.isDescendant(h))return!0;h=h._parent}return!1}},a.each(["rotate","scale","shear","skew"],function(t){var h=t==="rotate";this[t]=function(){var d=(h?a:f).read(arguments),x=f.read(arguments,0,{readNull:!0});return this.transform(new B()[t](d,x||this.getPosition(!0)))}},{translate:function(){var t=new B;return this.transform(t.translate.apply(t,arguments))},transform:function(t,h,d,x){var E=this._matrix,C=t&&!t.isIdentity(),b=(h||this._applyMatrix)&&(!E.isIdentity()||C||h&&d&&this._children);if(!C&&!b)return this;if(C){!t.isInvertible()&&E.isInvertible()&&(E._backup=E.getValues()),E.prepend(t,!0);var U=this._style,D=U.getFillColor(!0),k=U.getStrokeColor(!0);D&&D.transform(t),k&&k.transform(t)}if(b&&(b=this._transformContent(E,d,x))){var Z=this._pivot;Z&&E._transformPoint(Z,Z,!0),E.reset(!0),x&&this._canApplyMatrix&&(this._applyMatrix=!0)}var Y=this._bounds,W=this._position;(C||b)&&this._changed(9);var F=C&&Y&&t.decompose();if(F&&F.skewing.isZero()&&F.rotation%90==0){for(var z in Y){var G=Y[z];if(G.nonscaling)delete Y[z];else if(b||!G.internal){var X=G.rect;t._transformBounds(X,X)}}this._bounds=Y;var A=Y[this._getBoundsCacheKey(this._boundsOptions||{})];A&&(this._position=A.rect.getCenter(!0))}else C&&W&&this._pivot&&(this._position=t._transformPoint(W,W));return this},_transformContent:function(t,h,d){var x=this._children;if(x){for(var E=0,C=x.length;E<C;E++)x[E].transform(t,!0,h,d);return!0}},globalToLocal:function(){return this.getGlobalMatrix(!0)._inverseTransform(f.read(arguments))},localToGlobal:function(){return this.getGlobalMatrix(!0)._transformPoint(f.read(arguments))},parentToLocal:function(){return this._matrix._inverseTransform(f.read(arguments))},localToParent:function(){return this._matrix._transformPoint(f.read(arguments))},fitBounds:function(t,h){t=M.read(arguments);var d=this.getBounds(),x=d.height/d.width,E=t.height/t.width,C=(h?x>E:x<E)?t.width/d.width:t.height/d.height,b=new M(new f,new y(d.width*C,d.height*C));b.setCenter(t.getCenter()),this.setBounds(b)}}),{_setStyles:function(t,h,d){var x=this._style,E=this._matrix;if(x.hasFill()&&(t.fillStyle=x.getFillColor().toCanvasStyle(t,E)),x.hasStroke()){t.strokeStyle=x.getStrokeColor().toCanvasStyle(t,E),t.lineWidth=x.getStrokeWidth();var C=x.getStrokeJoin(),b=x.getStrokeCap(),U=x.getMiterLimit();if(C&&(t.lineJoin=C),b&&(t.lineCap=b),U&&(t.miterLimit=U),paper.support.nativeDash){var D=x.getDashArray(),k=x.getDashOffset();D&&D.length&&("setLineDash"in t?(t.setLineDash(D),t.lineDashOffset=k):(t.mozDash=D,t.mozDashOffset=k))}}if(x.hasShadow()){var Z=h.pixelRatio||1,Y=d._shiftless().prepend(new B().scale(Z,Z)),W=Y.transform(new f(x.getShadowBlur(),0)),F=Y.transform(this.getShadowOffset());t.shadowColor=x.getShadowColor().toCanvasStyle(t),t.shadowBlur=W.getLength(),t.shadowOffsetX=F.x,t.shadowOffsetY=F.y}},draw:function(t,h,d){var x=this._updateVersion=this._project._updateVersion;if(this._visible&&this._opacity!==0){var E=h.matrices,C=h.viewMatrix,b=this._matrix,U=E[E.length-1].appended(b);if(U.isInvertible()){C=C?C.appended(U):U,E.push(U),h.updateMatrix&&(U._updateVersion=x,this._globalMatrix=U);var D,k,Z,Y=this._blendMode,W=this._opacity,F=Y==="normal",z=Ve.nativeModes[Y],G=F&&W===1||h.dontStart||h.clip||(z||F&&W<1)&&this._canComposite(),X=h.pixelRatio||1;if(!G){var A=this.getStrokeBounds(C);if(!A.width||!A.height)return;Z=h.offset,k=h.offset=A.getTopLeft().floor(),D=t,t=Oe.getContext(A.getSize().ceil().add(1).multiply(X)),X!==1&&t.scale(X,X)}t.save();var N=d?d.appended(b):this._canScaleStroke&&!this.getStrokeScaling(!0)&&C,I=!G&&h.clipItem,te=!N||I;if(G?(t.globalAlpha=W,z&&(t.globalCompositeOperation=Y)):te&&t.translate(-k.x,-k.y),te&&(G?b:C).applyToContext(t),I&&h.clipItem.draw(t,h.extend({clip:!0})),N){t.setTransform(X,0,0,X,0,0);var fe=h.offset;fe&&t.translate(-fe.x,-fe.y)}this._draw(t,h,C,N),t.restore(),E.pop(),h.clip&&!h.dontFinish&&t.clip(),G||(Ve.process(Y,t,D,W,k.subtract(Z).multiply(X)),Oe.release(t),h.offset=Z)}}},_isUpdated:function(t){var h=this._parent;if(h instanceof _e)return h._isUpdated(t);var d=this._updateVersion===t;return!d&&h&&h._visible&&h._isUpdated(t)&&(this._updateVersion=t,d=!0),d},_drawSelection:function(t,h,d,x,E){var C=this._selection,b=1&C,U=2&C||b&&this._selectBounds,D=4&C;if(this._drawSelected||(b=!1),(b||U||D)&&this._isUpdated(E)){var k,Z=this.getSelectedColor(!0)||(k=this.getLayer())&&k.getSelectedColor(!0),Y=h.appended(this.getGlobalMatrix(!0)),W=d/2;if(t.strokeStyle=t.fillStyle=Z?Z.toCanvasStyle(t):"#009dec",b&&this._drawSelected(t,Y,x),D){var F=this.getPosition(!0),z=F.x,G=F.y;t.beginPath(),t.arc(z,G,W,0,2*Math.PI,!0),t.stroke();for(var X=[[0,-1],[1,0],[0,1],[-1,0]],A=W,N=d+1,I=0;I<4;I++){var te=X[I],fe=te[0],S=te[1];t.moveTo(z+fe*A,G+S*A),t.lineTo(z+fe*N,G+S*N),t.stroke()}}if(U){var de=Y._transformCorners(this.getInternalBounds());for(t.beginPath(),I=0;I<8;I++)t[I?"lineTo":"moveTo"](de[I],de[++I]);for(t.closePath(),t.stroke(),I=0;I<8;I++)t.fillRect(de[I]-W,de[++I]-W,d,d)}}},_canComposite:function(){return!1}},a.each(["down","drag","up","move"],function(t){this["removeOn"+a.capitalize(t)]=function(){var h={};return h[t]=!0,this.removeOn(h)}},{removeOn:function(t){for(var h in t)if(t[h]){var d="mouse"+h,x=this._project,E=x._removeSets=x._removeSets||{};E[d]=E[d]||{},E[d][this._id]=this}return this}})),q=Q.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(h){t.base.call(this,h),1026&h&&(this._clipItem=r)},_getClipItem:function(){var t=this._clipItem;if(t===r){t=null;for(var h=this._children,d=0,x=h.length;d<x;d++)if(h[d]._clipMask){t=h[d];break}this._clipItem=t}return t},isClipped:function(){return!!this._getClipItem()},setClipped:function(t){var h=this.getFirstChild();h&&h.setClipMask(t)},_getBounds:function t(h,d){var x=this._getClipItem();return x?x._getCachedBounds(h&&h.appended(x._matrix),a.set({},d,{stroke:!1})):t.base.call(this,h,d)},_hitTestChildren:function t(h,d,x){var E=this._getClipItem();return(!E||E.contains(h))&&t.base.call(this,h,d,x,E)},_draw:function(t,h){var d=h.clip,x=!d&&this._getClipItem();h=h.extend({clipItem:x,clip:!1}),d?(t.beginPath(),h.dontStart=h.dontFinish=!0):x&&x.draw(t,h.extend({clip:!0}));for(var E=this._children,C=0,b=E.length;C<b;C++){var U=E[C];U!==x&&U.draw(t,h)}}}),O=q.extend({_class:"Layer",initialize:function(){q.apply(this,arguments)},_getOwner:function(){return this._parent||this._index!=null&&this._project},isInserted:function t(){return this._parent?t.base.call(this):this._index!=null},activate:function(){this._project._activeLayer=this},_hitTestSelf:function(){}}),K=Q.extend({_class:"Shape",_applyMatrix:!1,_canApplyMatrix:!1,_canScaleStroke:!0,_serializeFields:{type:null,size:null,radius:null},initialize:function(t,h){this._initialize(t,h)},_equals:function(t){return this._type===t._type&&this._size.equals(t._size)&&a.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 w(t.width,t.height,this,"setSize")},setSize:function(){var t=y.read(arguments);if(this._size){if(!this._size.equals(t)){var h=this._type,d=t.width,x=t.height;h==="rectangle"?this._radius.set(y.min(this._radius,t.divide(2))):h==="circle"?(d=x=(d+x)/2,this._radius=d/2):h==="ellipse"&&this._radius._set(d/2,x/2),this._size._set(d,x),this._changed(9)}}else this._size=t.clone()},getRadius:function(){var t=this._radius;return this._type==="circle"?t:new w(t.width,t.height,this,"setRadius")},setRadius:function(t){var h=this._type;if(h==="circle"){if(t===this._radius)return;d=2*t,this._radius=t,this._size._set(d,d)}else if(t=y.read(arguments),this._radius){if(this._radius.equals(t))return;if(this._radius.set(t),h==="rectangle"){var d=y.max(this._size,t.multiply(2));this._size.set(d)}else h==="ellipse"&&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 h=new ne[a.capitalize(this._type)]({center:new f,size:this._size,radius:this._radius,insert:!1});return h.copyAttributes(this),paper.settings.applyMatrix&&h.setApplyMatrix(!0),(t===r||t)&&h.insertAbove(this),h},toShape:"#clone",_asPathItem:function(){return this.toPath(!1)},_draw:function(t,h,d,x){var E=this._style,C=E.hasFill(),b=E.hasStroke(),U=h.dontFinish||h.clip,D=!x;if(C||b||U){var k=this._type,Z=this._radius,Y=k==="circle";if(h.dontStart||t.beginPath(),D&&Y)t.arc(0,0,Z,0,2*Math.PI,!0);else{var W=Y?Z:Z.width,F=Y?Z:Z.height,z=this._size,G=z.width,X=z.height;if(D&&k==="rectangle"&&W===0&&F===0)t.rect(-G/2,-X/2,G,X);else{var A=G/2,N=X/2,I=.44771525016920644,te=W*I,fe=F*I,S=[-A,-N+F,-A,-N+fe,-A+te,-N,-A+W,-N,A-W,-N,A-te,-N,A,-N+fe,A,-N+F,A,N-F,A,N-fe,A-te,N,A-W,N,-A+W,N,-A+te,N,-A,N-fe,-A,N-F];x&&x.transform(S,S,32),t.moveTo(S[0],S[1]),t.bezierCurveTo(S[2],S[3],S[4],S[5],S[6],S[7]),A!==W&&t.lineTo(S[8],S[9]),t.bezierCurveTo(S[10],S[11],S[12],S[13],S[14],S[15]),N!==F&&t.lineTo(S[16],S[17]),t.bezierCurveTo(S[18],S[19],S[20],S[21],S[22],S[23]),A!==W&&t.lineTo(S[24],S[25]),t.bezierCurveTo(S[26],S[27],S[28],S[29],S[30],S[31])}}t.closePath()}U||!C&&!b||(this._setStyles(t,h,d),C&&(t.fill(E.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),b&&t.stroke())},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_getBounds:function(t,h){var d=new M(this._size).setCenter(0,0),x=this._style,E=h.stroke&&x.hasStroke()&&x.getStrokeWidth();return t&&(d=t._transformBounds(d)),E?d.expand(ne._getStrokePadding(E,this._getStrokeMatrix(t,h))):d}},new function(){function t(d,x,E){var C=d._radius;if(!C.isZero())for(var b=d._size.divide(2),U=1;U<=4;U++){var D=new f(U>1&&U<4?-1:1,U>2?-1:1),k=D.multiply(b),Z=k.subtract(D.multiply(C));if(new M(E?k.add(D.multiply(E)):k,Z).contains(x))return{point:Z,quadrant:U}}}function h(d,x,E,C){var b=d.divide(x);return(!C||b.isInQuadrant(C))&&b.subtract(b.normalize()).multiply(x).divide(E).length<=1}return{_contains:function d(x){if(this._type==="rectangle"){var E=t(this,x);return E?x.subtract(E.point).divide(this._radius).getLength()<=1:d.base.call(this,x)}return x.divide(this.size).getLength()<=.5},_hitTestSelf:function d(x,E,C,b){var U=!1,D=this._style,k=E.stroke&&D.hasStroke(),Z=E.fill&&D.hasFill();if(k||Z){var Y=this._type,W=this._radius,F=k?D.getStrokeWidth()/2:0,z=E._tolerancePadding.add(ne._getStrokePadding(F,!D.getStrokeScaling()&&b));if(Y==="rectangle"){var G=z.multiply(2),X=t(this,x,G);if(X)U=h(x.subtract(X.point),W,z,X.quadrant);else{var A=new M(this._size).setCenter(0,0),N=A.expand(G),I=A.expand(G.negate());U=N._containsPoint(x)&&!I._containsPoint(x)}}else U=h(x,W,z)}return U?new re(k?"stroke":"fill",this):d.base.apply(this,arguments)}}},{statics:new function(){function t(h,d,x,E,C){var b=new K(a.getNamed(C),d);return b._type=h,b._size=x,b._radius=E,b}return{Circle:function(){var h=f.readNamed(arguments,"center"),d=a.readNamed(arguments,"radius");return t("circle",h,new y(2*d),d,arguments)},Rectangle:function(){var h=M.readNamed(arguments,"rectangle"),d=y.min(y.readNamed(arguments,"radius"),h.getSize(!0).divide(2));return t("rectangle",h.getCenter(!0),h.getSize(!0),d,arguments)},Ellipse:function(){var h=K._readEllipse(arguments),d=h.radius;return t("ellipse",h.center,d.multiply(2),d,arguments)},_readEllipse:function(h){var d,x;if(a.hasNamed(h,"radius"))d=f.readNamed(h,"center"),x=y.readNamed(h,"radius");else{var E=M.readNamed(h,"rectangle");d=E.getCenter(!0),x=E.getSize(!0).divide(2)}return{center:d,radius:x}}}}}),pe=Q.extend({_class:"Raster",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!1,handle:!1},_serializeFields:{crossOrigin:null,source:null},_prioritize:["crossOrigin"],initialize:function(t,h){if(!this._initialize(t,h!==r&&f.read(arguments,1))){var d=typeof t=="string"?o.getElementById(t):t;d?this.setImage(d):this.setSource(t)}this._size||(this._size=new y,this._loaded=!1)},_equals:function(t){return this.getSource()===t.getSource()},copyContent:function(t){var h=t._image,d=t._canvas;if(h)this._setImage(h);else if(d){var x=Oe.getCanvas(t._size);x.getContext("2d").drawImage(d,0,0),this._setImage(x)}this._crossOrigin=t._crossOrigin},getSize:function(){var t=this._size;return new w(t?t.width:0,t?t.height:0,this,"setSize")},setSize:function(){var t=y.read(arguments);if(!t.equals(this._size))if(t.width>0&&t.height>0){var h=this.getElement();this._setImage(Oe.getCanvas(t)),h&&this.getContext(!0).drawImage(h,0,0,t.width,t.height)}else this._canvas&&Oe.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||t.width===0&&t.height===0},getResolution:function(){var t=this._matrix,h=new f(0,0).transform(t),d=new f(1,0).transform(t).subtract(h),x=new f(0,1).transform(t).subtract(h);return new y(72/d.getLength(),72/x.getLength())},getPpi:"#getResolution",getImage:function(){return this._image},setImage:function(t){function h(x){var E=d.getView(),C=x&&x.type||"load";E&&d.responds(C)&&(paper=E._scope,d.emit(C,new Be(x)))}var d=this;this._setImage(t),this._loaded?setTimeout(h,0):t&&ke.add(t,{load:function(x){d._setImage(t),h(x)},error:h})},_setImage:function(t){this._canvas&&Oe.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 y(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=Oe.getContext(this._size);try{this._image&&t.drawImage(this._image,0,0),this._canvas=t.canvas}catch(h){Oe.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(t){var h=new e.Image,d=this._crossOrigin;d&&(h.crossOrigin=d),h.src=t,this.setImage(h)},getCrossOrigin:function(){var t=this._image;return t&&t.crossOrigin||this._crossOrigin||""},setCrossOrigin:function(t){this._crossOrigin=t;var h=this._image;h&&(h.crossOrigin=t)},getElement:function(){return this._canvas||this._loaded&&this._image}},{beans:!1,getSubCanvas:function(){var t=M.read(arguments),h=Oe.getContext(t.getSize());return h.drawImage(this.getCanvas(),t.x,t.y,t.width,t.height,0,0,t.width,t.height),h.canvas},getSubRaster:function(){var t=M.read(arguments),h=new pe(Q.NO_INSERT);return h._setImage(this.getSubCanvas(t)),h.translate(t.getCenter().subtract(this.getSize().divide(2))),h._matrix.prepend(this._matrix),h.insertAbove(this),h},toDataURL:function(){var t=this._image,h=t&&t.src;if(/^data:/.test(h))return h;var d=this.getCanvas();return d?d.toDataURL.apply(d,arguments):null},drawImage:function(t){var h=f.read(arguments,1);this.getContext(!0).drawImage(t,h.x,h.y)},getAverageColor:function(t){var h,d;if(t?t instanceof ee?(d=t,h=t.getBounds()):typeof t=="object"&&("width"in t?h=new M(t):"x"in t&&(h=new M(t.x-.5,t.y-.5,1,1))):h=this.getBounds(),!h)return null;var x=Math.min(h.width,32),E=Math.min(h.height,32),C=pe._sampleContext;C?C.clearRect(0,0,33,33):C=pe._sampleContext=Oe.getContext(new y(32)),C.save();var b=new B().scale(x/h.width,E/h.height).translate(-h.x,-h.y);b.applyToContext(C),d&&d.draw(C,new a({clip:!0,matrices:[b]})),this._matrix.applyToContext(C);var U=this.getElement(),D=this._size;U&&C.drawImage(U,-D.width/2,-D.height/2),C.restore();for(var k=C.getImageData(.5,.5,Math.ceil(x),Math.ceil(E)).data,Z=[0,0,0],Y=0,W=0,F=k.length;W<F;W+=4){var z=k[W+3];Y+=z,z/=255,Z[0]+=k[W]*z,Z[1]+=k[W+1]*z,Z[2]+=k[W+2]*z}for(W=0;W<3;W++)Z[W]/=Y;return Y?Fe.read(Z):null},getPixel:function(){var t=f.read(arguments),h=this.getContext().getImageData(t.x,t.y,1,1).data;return new Fe("rgb",[h[0]/255,h[1]/255,h[2]/255],h[3]/255)},setPixel:function(){var t=f.read(arguments),h=Fe.read(arguments),d=h._convert("rgb"),x=h._alpha,E=this.getContext(!0),C=E.createImageData(1,1),b=C.data;b[0]=255*d[0],b[1]=255*d[1],b[2]=255*d[2],b[3]=x!=null?255*x:255,E.putImageData(C,t.x,t.y)},createImageData:function(){var t=y.read(arguments);return this.getContext().createImageData(t.width,t.height)},getImageData:function(){var t=M.read(arguments);return t.isEmpty()&&(t=new M(this._size)),this.getContext().getImageData(t.x,t.y,t.width,t.height)},setImageData:function(t){var h=f.read(arguments,1);this.getContext(!0).putImageData(t,h.x,h.y)},_getBounds:function(t,h){var d=new M(this._size).setCenter(0,0);return t?t._transformBounds(d):d},_hitTestSelf:function(t){if(this._contains(t)){var h=this;return new re("pixel",h,{offset:t.add(h._size.divide(2)).round(),color:{get:function(){return h.getPixel(this.offset)}}})}},_draw:function(t){var h=this.getElement();h&&(t.globalAlpha=this._opacity,t.drawImage(h,-this._size.width/2,-this._size.height/2))},_canComposite:function(){return!0}}),R=Q.extend({_class:"SymbolItem",_applyMatrix:!1,_canApplyMatrix:!1,_boundsOptions:{stroke:!0},_serializeFields:{symbol:null},initialize:function(t,h){this._initialize(t,h!==r&&f.read(arguments,1))||this.setDefinition(t instanceof Te?t:new Te(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,h){var d=this._definition._item;return d._getCachedBounds(d._matrix.prepended(t),h)},_hitTestSelf:function(t,h,d){var x=this._definition._item._hitTest(t,h,d);return x&&(x.item=this),x},_draw:function(t,h){this._definition._item.draw(t,h)}}),Te=a.extend({_class:"SymbolDefinition",initialize:function(t,h){this._id=_.get(),this.project=paper.project,t&&this.setItem(t,h)},_serialize:function(t,h){return h.add(this,function(){return a.serialize([this._class,this._item],t,!1,h)})},_changed:function(t){8&t&&Q._clearBoundsCache(this),1&t&&this.project._changed(t)},getItem:function(){return this._item},setItem:function(t,h){t._symbol&&(t=t.clone()),this._item&&(this._item._symbol=null),this._item=t,t.remove(),t.setSelected(!1),h||t.setPosition(new f),t._symbol=this,this._changed(9)},getDefinition:"#getItem",setDefinition:"#setItem",place:function(t){return new R(this,t)},clone:function(){return new Te(this._item.clone(!1))},equals:function(t){return t===this||t&&this._item.equals(t._item)||!1}}),re=a.extend({_class:"HitResult",initialize:function(t,h,d){this.type=t,this.item=h,d&&this.inject(d)},statics:{getOptions:function(t){var h=t&&a.read(t);return a.set({type:null,tolerance:paper.settings.hitTolerance,fill:!h,stroke:!h,segments:!h,handles:!1,ends:!1,position:!1,center:!1,bounds:!1,guides:!1,selected:!1},h)}}}),oe=a.extend({_class:"Segment",beans:!0,_selection:0,initialize:function(t,h,d,x,E,C){var b,U,D,k,Z=arguments.length;Z>0&&(t==null||typeof t=="object"?Z===1&&t&&"point"in t?(b=t.point,U=t.handleIn,D=t.handleOut,k=t.selection):(b=t,U=h,D=d,k=x):(b=[t,h],U=d!==r?[d,x]:null,D=E!==r?[E,C]:null)),new me(b,this,"_point"),new me(U,this,"_handleIn"),new me(D,this,"_handleOut"),k&&this.setSelection(k)},_serialize:function(t,h){var d=this._point,x=this._selection,E=x||this.hasHandles()?[d,this._handleIn,this._handleOut]:d;return x&&E.push(x),a.serialize(E,t,!0,h)},_changed:function(t){var h=this._path;if(h){var d,x=h._curves,E=this._index;x&&(t&&t!==this._point&&t!==this._handleIn||!(d=E>0?x[E-1]:h._closed?x[x.length-1]:null)||d._changed(),t&&t!==this._point&&t!==this._handleOut||!(d=x[E])||d._changed()),h._changed(25)}},getPoint:function(){return this._point},setPoint:function(){this._point.set(f.read(arguments))},getHandleIn:function(){return this._handleIn},setHandleIn:function(){this._handleIn.set(f.read(arguments))},getHandleOut:function(){return this._handleOut},setHandleOut:function(){this._handleOut.set(f.read(arguments))},hasHandles:function(){return!this._handleIn.isZero()||!this._handleOut.isZero()},isSmooth:function(){var t=this._handleIn,h=this._handleOut;return!t.isZero()&&!h.isZero()&&t.isCollinear(h)},clearHandles:function(){this._handleIn._set(0,0),this._handleOut._set(0,0)},getSelection:function(){return this._selection},setSelection:function(t){var h=this._selection,d=this._path;this._selection=t=t||0,d&&t!==h&&(d._updateSelection(this,h,t),d._changed(129))},_changeSelection:function(t,h){var d=this._selection;this.setSelection(h?d|t:d&~t)},isSelected:function(){return!!(7&this._selection)},setSelected:function(t){this._changeSelection(7,t)},getIndex:function(){return this._index!==r?this._index:null},getPath:function(){return this._path||null},getCurve:function(){var t=this._path,h=this._index;return t?(h>0&&!t._closed&&h===t._segments.length-1&&h--,t.getCurves()[h]||null):null},getLocation:function(){var t=this.getCurve();return t?new $(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,h,d){var x=t||{},E=x.type,C=x.factor,b=this.getPrevious(),U=this.getNext(),D=(b||this)._point,k=this._point,Z=(U||this)._point,Y=D.getDistance(k),W=k.getDistance(Z);if(E&&E!=="catmull-rom"){if(E!=="geometric")throw new Error("Smoothing method '"+E+"' not supported.");if(b&&U){var F=D.subtract(Z),z=C===r?.4:C,G=z*Y/(Y+W);h||this.setHandleIn(F.multiply(G)),d||this.setHandleOut(F.multiply(G-z))}}else{var X=C===r?.5:C,A=Math.pow(Y,X),N=A*A,I=Math.pow(W,X),te=I*I;if(!h&&b){var fe=2*te+3*I*A+N,S=3*I*(I+A);this.setHandleIn(S!==0?new f((te*D._x+fe*k._x-N*Z._x)/S-k._x,(te*D._y+fe*k._y-N*Z._y)/S-k._y):new f)}if(!d&&U){var fe=2*N+3*A*I+te,S=3*A*(A+I);this.setHandleOut(S!==0?new f((N*Z._x+fe*k._x-te*D._x)/S-k._x,(N*Z._y+fe*k._y-te*D._y)/S-k._y):new f)}}},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,h=this._handleOut,d=t.clone();t.set(h),h.set(d)},reversed:function(){return new oe(this._point,this._handleOut,this._handleIn)},remove:function(){return!!this._path&&!!this._path.removeSegment(this._index)},clone:function(){return new oe(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,h,d){var x=1-d,E=d,C=t._point,b=h._point,U=t._handleIn,D=h._handleIn,k=h._handleOut,Z=t._handleOut;this._point._set(x*C._x+E*b._x,x*C._y+E*b._y,!0),this._handleIn._set(x*U._x+E*D._x,x*U._y+E*D._y,!0),this._handleOut._set(x*Z._x+E*k._x,x*Z._y+E*k._y,!0),this._changed()},_transformCoordinates:function(t,h,d){var x=this._point,E=d&&this._handleIn.isZero()?null:this._handleIn,C=d&&this._handleOut.isZero()?null:this._handleOut,b=x._x,U=x._y,D=2;return h[0]=b,h[1]=U,E&&(h[D++]=E._x+b,h[D++]=E._y+U),C&&(h[D++]=C._x+b,h[D++]=C._y+U),t&&(t._transformCoordinates(h,h,D/2),b=h[0],U=h[1],d?(x._x=b,x._y=U,D=2,E&&(E._x=h[D++]-b,E._y=h[D++]-U),C&&(C._x=h[D++]-b,C._y=h[D++]-U)):(E||(h[D++]=b,h[D++]=U),C||(h[D++]=b,h[D++]=U))),h}}),me=f.extend({initialize:function(t,h,d){var x,E,C;if(t)if((x=t[0])!==r)E=t[1];else{var b=t;(x=b.x)===r&&(x=(b=f.read(arguments)).x),E=b.y,C=b.selected}else x=E=0;this._x=x,this._y=E,this._owner=h,h[d]=this,C&&this.setSelected(!0)},_set:function(t,h){return this._x=t,this._y=h,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=c.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}}),ue=a.extend({_class:"Curve",beans:!0,initialize:function(t,h,d,x,E,C,b,U){var D,k,Z,Y,W,F,z=arguments.length;z===3?(this._path=t,D=h,k=d):z?z===1?"segment1"in t?(D=new oe(t.segment1),k=new oe(t.segment2)):"point1"in t?(Z=t.point1,W=t.handle1,F=t.handle2,Y=t.point2):Array.isArray(t)&&(Z=[t[0],t[1]],Y=[t[6],t[7]],W=[t[2]-t[0],t[3]-t[1]],F=[t[4]-t[6],t[5]-t[7]]):z===2?(D=new oe(t),k=new oe(h)):z===4?(Z=t,W=h,F=d,Y=x):z===8&&(Z=[t,h],Y=[b,U],W=[d-t,x-h],F=[E-b,C-U]):(D=new oe,k=new oe),this._segment1=D||new oe(Z,null,W),this._segment2=k||new oe(Y,F,null)},_serialize:function(t,h){return a.serialize(this.hasHandles()?[this.getPoint1(),this.getHandle1(),this.getHandle2(),this.getPoint2()]:[this.getPoint1(),this.getPoint2()],t,!0,h)},_changed:function(){this._length=this._bounds=r},clone:function(){return new ue(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 ue.classify(this.getValues())},remove:function(){var t=!1;if(this._path){var h=this._segment2,d=h._handleOut;(t=h.remove())&&this._segment1._handleOut.set(d)}return t},getPoint1:function(){return this._segment1._point},setPoint1:function(){this._segment1._point.set(f.read(arguments))},getPoint2:function(){return this._segment2._point},setPoint2:function(){this._segment2._point.set(f.read(arguments))},getHandle1:function(){return this._segment1._handleOut},setHandle1:function(){this._segment1._handleOut.set(f.read(arguments))},getHandle2:function(){return this._segment2._handleIn},setHandle2:function(){this._segment2._handleIn.set(f.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 ue.getValues(this._segment1,this._segment2,t)},getPoints:function(){for(var t=this.getValues(),h=[],d=0;d<8;d+=2)h.push(new f(t[d],t[d+1]));return h}},{getLength:function(){return this._length==null&&(this._length=ue.getLength(this.getValues(),0,1)),this._length},getArea:function(){return ue.getArea(this.getValues())},getLine:function(){return new H(this._segment1._point,this._segment2._point)},getPart:function(t,h){return new ue(ue.getPart(this.getValues(),t,h))},getPartLength:function(t,h){return ue.getLength(this.getValues(),t,h)},divideAt:function(t){return this.divideAtTime(t&&t.curve===this?t.time:this.getTimeAt(t))},divideAtTime:function(t,h){var d=null;if(t>=1e-8&&t<=1-1e-8){var x=ue.subdivide(this.getValues(),t),E=x[0],C=x[1],b=h||this.hasHandles(),U=this._segment1,D=this._segment2,k=this._path;b&&(U._handleOut._set(E[2]-E[0],E[3]-E[1]),D._handleIn._set(C[4]-C[6],C[5]-C[7]));var Z=E[6],Y=E[7],W=new oe(new f(Z,Y),b&&new f(E[4]-Z,E[5]-Y),b&&new f(C[2]-Z,C[3]-Y));k?(k.insert(U._index+1,W),d=this.getNext()):(this._segment2=W,this._changed(),d=new ue(W,D))}return d},splitAt:function(t){var h=this._path;return h?h.splitAt(t):null},splitAtTime:function(t){return this.splitAt(this.getLocationAtTime(t))},divide:function(t,h){return this.divideAtTime(t===r?.5:h?t:this.getTimeAt(t))},split:function(t,h){return this.splitAtTime(t===r?.5:h?t:this.getTimeAt(t))},reversed:function(){return new ue(this._segment2.reversed(),this._segment1.reversed())},clearHandles:function(){this._segment1._handleOut._set(0,0),this._segment2._handleIn._set(0,0)},statics:{getValues:function(t,h,d,x){var E=t._point,C=t._handleOut,b=h._handleIn,U=h._point,D=E.x,k=E.y,Z=U.x,Y=U.y,W=x?[D,k,D,k,Z,Y,Z,Y]:[D,k,D+C._x,k+C._y,Z+b._x,Y+b._y,Z,Y];return d&&d._transformCoordinates(W,W,4),W},subdivide:function(t,h){var d=t[0],x=t[1],E=t[2],C=t[3],b=t[4],U=t[5],D=t[6],k=t[7];h===r&&(h=.5);var Z=1-h,Y=Z*d+h*E,W=Z*x+h*C,F=Z*E+h*b,z=Z*C+h*U,G=Z*b+h*D,X=Z*U+h*k,A=Z*Y+h*F,N=Z*W+h*z,I=Z*F+h*G,te=Z*z+h*X,fe=Z*A+h*I,S=Z*N+h*te;return[[d,x,Y,W,A,N,fe,S],[fe,S,I,te,G,X,D,k]]},getMonoCurves:function(t,h){var d=[],x=h?0:1,E=t[x+0],C=t[x+2],b=t[x+4],U=t[x+6];if(E>=C==C>=b&&C>=b==b>=U||ue.isStraight(t))d.push(t);else{var D=3*(C-b)-E+U,k=2*(E+b)-4*C,Z=C-E,Y=[],W=c.solveQuadratic(D,k,Z,Y,1e-8,1-1e-8);if(W){Y.sort();var F=Y[0],z=ue.subdivide(t,F);d.push(z[0]),W>1&&(F=(Y[1]-F)/(1-F),z=ue.subdivide(z[1],F),d.push(z[0])),d.push(z[1])}else d.push(t)}return d},solveCubic:function(t,h,d,x,E,C){var b=t[h],U=t[h+2],D=t[h+4],k=t[h+6],Z=0;if(!(b<d&&k<d&&U<d&&D<d||b>d&&k>d&&U>d&&D>d)){var Y=3*(U-b),W=3*(D-U)-Y,F=k-b-Y-W;Z=c.solveCubic(F,W,Y,b-d,x,E,C)}return Z},getTimeOf:function(t,h){var d=new f(t[0],t[1]),x=new f(t[6],t[7]);if((h.isClose(d,1e-12)?0:h.isClose(x,1e-12)?1:null)===null)for(var E=[h.x,h.y],C=[],b=0;b<2;b++)for(var U=ue.solveCubic(t,b,E[b],C,0,1),D=0;D<U;D++){var k=C[D];if(h.isClose(ue.getPoint(t,k),1e-7))return k}return h.isClose(d,1e-7)?0:h.isClose(x,1e-7)?1:null},getNearestTime:function(t,h){function d(F){if(F>=0&&F<=1){var z=h.getDistance(ue.getPoint(t,F),!0);if(z<k)return k=z,Z=F,!0}}if(ue.isStraight(t)){var x=t[0],E=t[1],C=t[6]-x,b=t[7]-E,U=C*C+b*b;if(U===0)return 0;var D=((h.x-x)*C+(h.y-E)*b)/U;return D<1e-12?0:D>.999999999999?1:ue.getTimeOf(t,new f(x+D*C,E+D*b))}for(var k=1/0,Z=0,Y=0;Y<=100;Y++)d(Y/100);for(var W=.005;W>1e-8;)d(Z-W)||d(Z+W)||(W/=2);return Z},getPart:function(t,h,d){var x=h>d;if(x){var E=h;h=d,d=E}return h>0&&(t=ue.subdivide(t,h)[1]),d<1&&(t=ue.subdivide(t,(d-h)/(1-h))[0]),x?[t[6],t[7],t[4],t[5],t[2],t[3],t[0],t[1]]:t},isFlatEnough:function(t,h){var d=t[0],x=t[1],E=t[2],C=t[3],b=t[4],U=t[5],D=t[6],k=t[7],Z=3*E-2*d-D,Y=3*C-2*x-k,W=3*b-2*D-d,F=3*U-2*k-x;return Math.max(Z*Z,W*W)+Math.max(Y*Y,F*F)<=16*h*h},getArea:function(t){var h=t[0],d=t[1],x=t[2],E=t[3],C=t[4],b=t[5],U=t[6],D=t[7];return 3*((D-d)*(x+C)-(U-h)*(E+b)+E*(h-C)-x*(d-b)+D*(C+h/3)-U*(b+d/3))/20},getBounds:function(t){for(var h=t.slice(0,2),d=h.slice(),x=[0,0],E=0;E<2;E++)ue._addBounds(t[E],t[E+2],t[E+4],t[E+6],E,0,h,d,x);return new M(h[0],h[1],d[0]-h[0],d[1]-h[1])},_addBounds:function(t,h,d,x,E,C,b,U,D){function k(I,te){var fe=I-te,S=I+te;fe<b[E]&&(b[E]=fe),S>U[E]&&(U[E]=S)}C/=2;var Z=b[E]-C,Y=U[E]+C;if(t<Z||h<Z||d<Z||x<Z||t>Y||h>Y||d>Y||x>Y)if(h<t!=h<x&&d<t!=d<x)k(t,C),k(x,C);else{var W=3*(h-d)-t+x,F=2*(t+d)-4*h,z=h-t,G=c.solveQuadratic(W,F,z,D);k(x,0);for(var X=0;X<G;X++){var A=D[X],N=1-A;1e-8<=A&&A<=1-1e-8&&k(N*N*N*t+3*N*N*A*h+3*N*A*A*d+A*A*A*x,C)}}}}},a.each(["getBounds","getStrokeBounds","getHandleBounds"],function(t){this[t]=function(){this._bounds||(this._bounds={});var h=this._bounds[t];return h||(h=this._bounds[t]=ne[t]([this._segment1,this._segment2],!1,this._path)),h.clone()}},{}),a.each({isStraight:function(t,h,d,x){if(h.isZero()&&d.isZero())return!0;var E=x.subtract(t);if(E.isZero())return!1;if(E.isCollinear(h)&&E.isCollinear(d)){var C=new H(t,x);if(C.getDistance(t.add(h))<1e-7&&C.getDistance(x.add(d))<1e-7){var b=E.dot(E),U=E.dot(h)/b,D=E.dot(d)/b;return U>=0&&U<=1&&D<=0&&D>=-1}}return!1},isLinear:function(t,h,d,x){var E=x.subtract(t).divide(3);return h.equals(E)&&d.negate().equals(E)}},function(t,h){this[h]=function(d){var x=this._segment1,E=this._segment2;return t(x._point,x._handleOut,E._handleIn,E._point,d)},this.statics[h]=function(d,x){var E=d[0],C=d[1],b=d[6],U=d[7];return t(new f(E,C),new f(d[2]-E,d[3]-C),new f(d[4]-b,d[5]-U),new f(b,U),x)}},{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,h){return this.getLocationAtTime(h?t:this.getTimeAt(t))},getLocationAtTime:function(t){return t!=null&&t>=0&&t<=1?new $(this,t):null},getTimeAt:function(t,h){return ue.getTimeAt(this.getValues(),t,h)},getParameterAt:"#getTimeAt",getOffsetAtTime:function(t){return this.getPartLength(0,t)},getLocationOf:function(){return this.getLocationAtTime(this.getTimeOf(f.read(arguments)))},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getTimeOf:function(){return ue.getTimeOf(this.getValues(),f.read(arguments))},getParameterOf:"#getTimeOf",getNearestLocation:function(){var t=f.read(arguments),h=this.getValues(),d=ue.getNearestTime(h,t),x=ue.getPoint(h,d);return new $(this,d,x,null,t.getDistance(x))},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t&&t.getPoint()}},new function(){var t=["getPoint","getTangent","getNormal","getWeightedTangent","getWeightedNormal","getCurvature"];return a.each(t,function(h){this[h+"At"]=function(d,x){var E=this.getValues();return ue[h](E,x?d:ue.getTimeAt(E,d))},this[h+"AtTime"]=function(d){return ue[h](this.getValues(),d)}},{statics:{_evaluateMethods:t}})},new function(){function t(x){var E=x[0],C=x[1],b=x[2],U=x[3],D=x[4],k=x[5],Z=9*(b-D)+3*(x[6]-E),Y=6*(E+D)-12*b,W=3*(b-E),F=9*(U-k)+3*(x[7]-C),z=6*(C+k)-12*U,G=3*(U-C);return function(X){var A=(Z*X+Y)*X+W,N=(F*X+z)*X+G;return Math.sqrt(A*A+N*N)}}function h(x,E){return Math.max(2,Math.min(16,Math.ceil(32*Math.abs(E-x))))}function d(x,E,C,b){if(E==null||E<0||E>1)return null;var U=x[0],D=x[1],k=x[2],Z=x[3],Y=x[4],W=x[5],F=x[6],z=x[7],G=c.isZero;G(k-U)&&G(Z-D)&&(k=U,Z=D),G(Y-F)&&G(W-z)&&(Y=F,W=z);var X,A,N=3*(k-U),I=3*(Y-k)-N,te=F-U-N-I,fe=3*(Z-D),S=3*(W-Z)-fe,de=z-D-fe-S;if(C===0)X=E===0?U:E===1?F:((te*E+I)*E+N)*E+U,A=E===0?D:E===1?z:((de*E+S)*E+fe)*E+D;else{if(E<1e-8?(X=N,A=fe):E>1-1e-8?(X=3*(F-Y),A=3*(z-W)):(X=(3*te*E+2*I)*E+N,A=(3*de*E+2*S)*E+fe),b){X===0&&A===0&&(E<1e-8||E>1-1e-8)&&(X=Y-k,A=W-Z);var se=Math.sqrt(X*X+A*A);se&&(X/=se,A/=se)}if(C===3){var Y=6*te*E+2*I,W=6*de*E+2*S,ie=Math.pow(X*X+A*A,1.5);X=ie!==0?(X*W-A*Y)/ie:0,A=0}}return C===2?new f(A,-X):new f(X,A)}return{statics:{classify:function(x){function E(de,se,ie){var ge=se!==r,Pe=ge&&se>0&&se<1,Ye=ge&&ie>0&&ie<1;return!ge||(Pe||Ye)&&(de!=="loop"||Pe&&Ye)||(de="arch",Pe=Ye=!1),{type:de,roots:Pe||Ye?Pe&&Ye?se<ie?[se,ie]:[ie,se]:[Pe?se:ie]:null}}var C=x[0],b=x[1],U=x[2],D=x[3],k=x[4],Z=x[5],Y=x[6],W=x[7],F=U*(b-W)+D*(Y-C)+C*W-b*Y,z=3*(k*(D-b)+Z*(C-U)+U*b-D*C),G=z-F,X=G-F+(C*(W-Z)+b*(k-Y)+Y*Z-W*k),A=Math.sqrt(X*X+G*G+z*z),N=A!==0?1/A:0,I=c.isZero;if(X*=N,G*=N,z*=N,I(X))return I(G)?E(I(z)?"line":"quadratic"):E("serpentine",z/(3*G));var te=3*G*G-4*X*z;if(I(te))return E("cusp",G/(2*X));var fe=te>0?Math.sqrt(te/3):Math.sqrt(-te),S=2*X;return E(te>0?"serpentine":"loop",(G+fe)/S,(G-fe)/S)},getLength:function(x,E,C,b){if(E===r&&(E=0),C===r&&(C=1),ue.isStraight(x)){var U=x;C<1&&(U=ue.subdivide(U,C)[0],E/=C),E>0&&(U=ue.subdivide(U,E)[1]);var D=U[6]-U[0],k=U[7]-U[1];return Math.sqrt(D*D+k*k)}return c.integrate(b||t(x),E,C,h(E,C))},getTimeAt:function(x,E,C){if(C===r&&(C=E<0?1:0),E===0)return C;var b=Math.abs,U=E>0,D=U?C:0,k=U?1:C,Z=t(x),Y=ue.getLength(x,D,k,Z),W=b(E)-Y;if(b(W)<1e-12)return U?k:D;if(W>1e-12)return null;var F=E/Y,z=0;return c.findRoot(function(G){return z+=c.integrate(Z,C,G,h(C,G)),C=G,z-E},Z,C+F,D,k,32,1e-12)},getPoint:function(x,E){return d(x,E,0,!1)},getTangent:function(x,E){return d(x,E,1,!0)},getWeightedTangent:function(x,E){return d(x,E,1,!1)},getNormal:function(x,E){return d(x,E,2,!0)},getWeightedNormal:function(x,E){return d(x,E,2,!1)},getCurvature:function(x,E){return d(x,E,3,!1).x},getPeaks:function(x){var E=x[0],C=x[1],b=x[2],U=x[3],D=x[4],k=x[5],Z=3*b-E-3*D+x[6],Y=3*E-6*b+3*D,W=-3*E+3*b,F=3*U-C-3*k+x[7],z=3*C-6*U+3*k,G=-3*C+3*U,X=[];return c.solveCubic(9*(Z*Z+F*F),9*(Z*Y+z*F),2*(Y*Y+z*z)+3*(W*Z+G*F),W*Y+z*G,X,1e-8,1-1e-8),X.sort()}}}},new function(){function t(Y,W,F,z,G,X,A){var N=!A&&F.getPrevious()===G,I=!A&&F!==G&&F.getNext()===G;if(z!==null&&z>=(N?1e-8:0)&&z<=(I?1-1e-8:1)&&X!==null&&X>=(I?1e-8:0)&&X<=(N?1-1e-8:1)){var te=new $(F,z,null,A),fe=new $(G,X,null,A);te._intersection=fe,fe._intersection=te,W&&!W(te)||$.insert(Y,te,!0)}}function h(Y,W,F,z,G,X,A,N,I,te,fe,S,de){if(++I>=4096||++N>=40)return I;var se,ie,ge=W[0],Pe=W[1],Ye=W[6],Ge=W[7],Ze=H.getSignedDistance,Je=Ze(ge,Pe,Ye,Ge,W[2],W[3]),tt=Ze(ge,Pe,Ye,Ge,W[4],W[5]),nt=Je*tt>0?.75:4/9,at=nt*Math.min(0,Je,tt),ut=nt*Math.max(0,Je,tt),st=Ze(ge,Pe,Ye,Ge,Y[0],Y[1]),gt=Ze(ge,Pe,Ye,Ge,Y[2],Y[3]),ft=Ze(ge,Pe,Ye,Ge,Y[4],Y[5]),ct=Ze(ge,Pe,Ye,Ge,Y[6],Y[7]),_t=d(st,gt,ft,ct),Et=_t[0],mt=_t[1];if(Je===0&&tt===0&&st===0&>===0&&ft===0&&ct===0||(se=x(Et,mt,at,ut))==null||(ie=x(Et.reverse(),mt.reverse(),at,ut))==null)return I;var vt=te+(fe-te)*se,lt=te+(fe-te)*ie;if(Math.max(de-S,lt-vt)<1e-9){var St=(vt+lt)/2,Rt=(S+de)/2;t(G,X,A?z:F,A?Rt:St,A?F:z,A?St:Rt)}else if(Y=ue.getPart(Y,se,ie),ie-se>.8)if(lt-vt>de-S)St=(vt+lt)/2,I=h(W,(Bt=ue.subdivide(Y,.5))[0],z,F,G,X,!A,N,I,S,de,vt,St),I=h(W,Bt[1],z,F,G,X,!A,N,I,S,de,St,lt);else{var Bt=ue.subdivide(W,.5),Rt=(S+de)/2;I=h(Bt[0],Y,z,F,G,X,!A,N,I,S,Rt,vt,lt),I=h(Bt[1],Y,z,F,G,X,!A,N,I,Rt,de,vt,lt)}else I=de-S>=1e-9?h(W,Y,z,F,G,X,!A,N,I,S,de,vt,lt):h(Y,W,F,z,G,X,A,N,I,vt,lt,S,de);return I}function d(Y,W,F,z){var G,X=[0,Y],A=[1/3,W],N=[2/3,F],I=[1,z],te=W-(2*Y+z)/3,fe=F-(Y+2*z)/3;if(te*fe<0)G=[[X,A,I],[X,N,I]];else{var S=te/fe;G=[S>=2?[X,A,I]:S<=.5?[X,N,I]:[X,A,N,I],[X,I]]}return(te||fe)<0?G.reverse():G}function x(Y,W,F,z){return Y[0][1]<F?E(Y,!0,F):W[0][1]>z?E(W,!1,z):Y[0][0]}function E(Y,W,F){for(var z=Y[0][0],G=Y[0][1],X=1,A=Y.length;X<A;X++){var N=Y[X][0],I=Y[X][1];if(W?I>=F:I<=F)return I===F?N:z+(F-G)*(N-z)/(I-G);z=N,G=I}return null}function C(Y,W,F,z,G){var X=c.isZero;if(X(z)&&X(G)){var A=ue.getTimeOf(Y,new f(W,F));return A===null?[]:[A]}for(var N=Math.atan2(-G,z),I=Math.sin(N),te=Math.cos(N),fe=[],S=[],de=0;de<8;de+=2){var se=Y[de]-W,ie=Y[de+1]-F;fe.push(se*te-ie*I,se*I+ie*te)}return ue.solveCubic(fe,1,0,S,0,1),S}function b(Y,W,F,z,G,X,A){for(var N=W[0],I=W[1],te=C(Y,N,I,W[6]-N,W[7]-I),fe=0,S=te.length;fe<S;fe++){var de=te[fe],se=ue.getPoint(Y,de),ie=ue.getTimeOf(W,se);ie!==null&&t(G,X,A?z:F,A?ie:de,A?F:z,A?de:ie)}}function U(Y,W,F,z,G,X){var A=H.intersect(Y[0],Y[1],Y[6],Y[7],W[0],W[1],W[6],W[7]);A&&t(G,X,F,ue.getTimeOf(Y,A),z,ue.getTimeOf(W,A))}function D(Y,W,F,z,G,X){var A=Math.min,N=Math.max;if(N(Y[0],Y[2],Y[4],Y[6])+1e-12>A(W[0],W[2],W[4],W[6])&&A(Y[0],Y[2],Y[4],Y[6])-1e-12<N(W[0],W[2],W[4],W[6])&&N(Y[1],Y[3],Y[5],Y[7])+1e-12>A(W[1],W[3],W[5],W[7])&&A(Y[1],Y[3],Y[5],Y[7])-1e-12<N(W[1],W[3],W[5],W[7])){var I=Z(Y,W);if(I)for(ge=0;ge<2;ge++){var te=I[ge];t(G,X,F,te[0],z,te[1],!0)}else{var fe=ue.isStraight(Y),S=ue.isStraight(W),de=fe&&S,se=fe&&!S,ie=G.length;if((de?U:fe||S?b:h)(se?W:Y,se?Y:W,se?z:F,se?F:z,G,X,se,0,0,0,1,0,1),!de||G.length===ie)for(var ge=0;ge<4;ge++){var Pe=ge>>1,Ye=1&ge,Ge=6*Pe,Ze=6*Ye,Je=new f(Y[Ge],Y[Ge+1]),tt=new f(W[Ze],W[Ze+1]);Je.isClose(tt,1e-12)&&t(G,X,F,Pe,z,Ye)}}}return G}function k(Y,W,F,z){var G=ue.classify(Y);if(G.type==="loop"){var X=G.roots;t(F,z,W,X[0],W,X[1])}return F}function Z(Y,W){function F(st){var gt=st[6]-st[0],ft=st[7]-st[1];return gt*gt+ft*ft}var z=Math.abs,G=H.getDistance,X=ue.isStraight(Y),A=ue.isStraight(W),N=X&&A,I=F(Y)<F(W),te=I?W:Y,fe=I?Y:W,S=te[0],de=te[1],se=te[6]-S,ie=te[7]-de;if(G(S,de,se,ie,fe[0],fe[1],!0)<1e-7&&G(S,de,se,ie,fe[6],fe[7],!0)<1e-7)!N&&G(S,de,se,ie,te[2],te[3],!0)<1e-7&&G(S,de,se,ie,te[4],te[5],!0)<1e-7&&G(S,de,se,ie,fe[2],fe[3],!0)<1e-7&&G(S,de,se,ie,fe[4],fe[5],!0)<1e-7&&(X=A=N=!0);else if(N)return null;if(X^A)return null;for(var ge=[Y,W],Pe=[],Ye=0;Ye<4&&Pe.length<2;Ye++){var Ge=1&Ye,Ze=1^Ge,Je=Ye>>1,tt=ue.getTimeOf(ge[Ge],new f(ge[Ze][Je?6:0],ge[Ze][Je?7:1]));if(tt!=null){var nt=Ge?[Je,tt]:[tt,Je];(!Pe.length||z(nt[0]-Pe[0][0])>1e-8&&z(nt[1]-Pe[0][1])>1e-8)&&Pe.push(nt)}if(Ye>2&&!Pe.length)break}if(Pe.length!==2)Pe=null;else if(!N){var at=ue.getPart(Y,Pe[0][0],Pe[1][0]),ut=ue.getPart(W,Pe[0][1],Pe[1][1]);(z(ut[2]-at[2])>1e-7||z(ut[3]-at[3])>1e-7||z(ut[4]-at[4])>1e-7||z(ut[5]-at[5])>1e-7)&&(Pe=null)}return Pe}return{getIntersections:function(Y){var W=this.getValues(),F=Y&&Y!==this&&Y.getValues();return F?D(W,F,this,Y,[]):k(W,this,[])},statics:{getOverlaps:Z,getIntersections:function(Y,W,F,z,G,X){var A=!W;A&&(W=Y);for(var N,I,te=Y.length,fe=W.length,S=[],de=[],se=0;se<fe;se++)S[se]=W[se].getValues(G);for(se=0;se<te;se++){var ie=Y[se],ge=A?S[se]:ie.getValues(z),Pe=ie.getPath();Pe!==I&&(I=Pe,N=[],de.push(N)),A&&k(ge,ie,N,F);for(var Ye=A?se+1:0;Ye<fe;Ye++){if(X&&N.length)return N;D(ge,S[Ye],ie,W[Ye],N,F)}}N=[];for(var se=0,Ge=de.length;se<Ge;se++)N.push.apply(N,de[se]);return N},getCurveLineIntersections:C}}}),$=a.extend({_class:"CurveLocation",initialize:function(t,h,d,x,E){if(h>=.99999999){var C=t.getNext();C&&(h=0,t=C)}this._setCurve(t),this._time=h,this._point=d||t.getPointAtTime(h),this._overlap=x,this._distance=E,this._intersection=this._next=this._previous=null},_setCurve:function(t){var h=t._path;this._path=h,this._version=h?h._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 h=this.getCurve(),d=this.getTime();d===0?t=h._segment1:d===1?t=h._segment2:d!=null&&(t=h.getPartLength(0,d)<h.getPartLength(d,1)?h._segment1:h._segment2),this._segment=t}return t},getCurve:function(){function t(x){var E=x&&x.getCurve();if(E&&(d._time=E.getTimeOf(d._point))!=null)return d._setCurve(E),E}var h=this._path,d=this;return h&&h._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(),h=this._time;return t&&h==null?this._time=t.getTimeOf(this._point):h},getParameter:"#getTime",getPoint:function(){return this._point},getOffset:function(){var t=this._offset;if(t==null){t=0;var h=this.getPath(),d=this.getIndex();if(h&&d!=null)for(var x=h.getCurves(),E=0;E<d;E++)t+=x[E].getLength();this._offset=t+=this.getCurveOffset()}return t},getCurveOffset:function(){var t=this._curveOffset;if(t==null){var h=this.getCurve(),d=this.getTime();this._curveOffset=t=d!=null&&h&&h.getPartLength(0,d)}return t},getIntersection:function(){return this._intersection},getDistance:function(){return this._distance},divide:function(){var t=this.getCurve(),h=t&&t.divideAtTime(this.getTime());return h&&this._setSegment(h._segment1),h},split:function(){var t=this.getCurve(),h=t._path,d=t&&t.splitAtTime(this.getTime());return d&&this._setSegment(h.getLastSegment()),d},equals:function(t,h){var d=this===t;if(!d&&t instanceof $){var x=this.getCurve(),E=t.getCurve(),C=x._path;if(C===E._path){var b=Math.abs,U=b(this.getOffset()-t.getOffset()),D=!h&&this._intersection,k=!h&&t._intersection;d=(U<1e-7||C&&b(C.getLength()-U)<1e-7)&&(!D&&!k||D&&k&&D.equals(k,!0))}}return d},toString:function(){var t=[],h=this.getPoint(),d=p.instance;h&&t.push("point: "+h);var x=this.getIndex();x!=null&&t.push("index: "+x);var E=this.getTime();return E!=null&&t.push("time: "+d.number(E)),this._distance!=null&&t.push("distance: "+d.number(this._distance)),"{ "+t.join(", ")+" }"},isTouching:function(){var t=this._intersection;if(t&&this.getTangent().isCollinear(t.getTangent())){var h=this.getCurve(),d=t.getCurve();return!(h.isStraight()&&d.isStraight()&&h.getLine().intersect(d.getLine()))}return!1},isCrossing:function(){function t(S,de){var se=S.getValues(),ie=ue.classify(se).roots||ue.getPeaks(se),ge=ie.length,Pe=de&&ge>1?ie[ge-1]:ge>0?ie[0]:.5;Y.push(ue.getLength(se,de?Pe:0,de?1:Pe)/2)}function h(S,de,se){return de<se?S>de&&S<se:S>de||S<se}var d=this._intersection;if(!d)return!1;var x=this.getTime(),E=d.getTime(),C=x>=1e-8&&x<=1-1e-8,b=E>=1e-8&&E<=1-1e-8;if(C&&b)return!this.isTouching();var U=this.getCurve(),D=x<1e-8?U.getPrevious():U,k=d.getCurve(),Z=E<1e-8?k.getPrevious():k;if(x>1-1e-8&&(U=U.getNext()),E>1-1e-8&&(k=k.getNext()),!(D&&U&&Z&&k))return!1;var Y=[];C||(t(D,!0),t(U,!1)),b||(t(Z,!0),t(k,!1));var W=this.getPoint(),F=Math.min.apply(Math,Y),z=C?U.getTangentAtTime(x):U.getPointAt(F).subtract(W),G=C?z.negate():D.getPointAt(-F).subtract(W),X=b?k.getTangentAtTime(E):k.getPointAt(F).subtract(W),A=b?X.negate():Z.getPointAt(-F).subtract(W),N=G.getAngle(),I=z.getAngle(),te=A.getAngle(),fe=X.getAngle();return!!(C?h(N,te,fe)^h(I,te,fe)&&h(N,fe,te)^h(I,fe,te):h(te,N,I)^h(fe,N,I)&&h(te,I,N)^h(fe,I,N))},hasOverlap:function(){return!!this._overlap}},a.each(ue._evaluateMethods,function(t){var h=t+"At";this[t]=function(){var d=this.getCurve(),x=this.getTime();return x!=null&&d&&d[h](x,!0)}},{preserve:!0}),new function(){function t(h,d,x){function E(F,z){for(var G=F+z;G>=-1&&G<=C;G+=z){var X=h[(G%C+C)%C];if(!d.getPoint().isClose(X.getPoint(),1e-7))break;if(d.equals(X))return X}return null}for(var C=h.length,b=0,U=C-1;b<=U;){var D,k=b+U>>>1,Z=h[k];if(x&&(D=d.equals(Z)?Z:E(k,-1)||E(k,1)))return d._overlap&&(D._overlap=D._intersection._overlap=!0),D;var Y=d.getPath(),W=Z.getPath();(Y!==W?Y._id-W._id:d.getIndex()+d.getTime()-(Z.getIndex()+Z.getTime()))<0?U=k-1:b=k+1}return h.splice(b,0,d),d}return{statics:{insert:t,expand:function(h){for(var d=h.slice(),x=h.length-1;x>=0;x--)t(d,h[x]._intersection,!1);return d}}}}),ee=Q.extend({_class:"PathItem",_selectBounds:!1,_canScaleStroke:!0,beans:!0,initialize:function(){},statics:{create:function(t){var h,d,x;if(a.isPlainObject(t)?(d=t.segments,h=t.pathData):Array.isArray(t)?d=t:typeof t=="string"&&(h=t),d){var E=d[0];x=E&&Array.isArray(E[0])}else h&&(x=(h.match(/m/gi)||[]).length>1||/z\s*\S+/i.test(h));return new(x?_e:ne)(t)}},_asPathItem:function(){return this},isClockwise:function(){return this.getArea()>=0},setClockwise:function(t){this.isClockwise()!=(t=!!t)&&this.reverse()},setPathData:function(t){function h(I,te){var fe=+x[I];return U&&(fe+=D[te]),fe}function d(I){return new f(h(I,"x"),h(I+1,"y"))}var x,E,C,b=t&&t.match(/[mlhvcsqtaz][^mlhvcsqtaz]*/gi),U=!1,D=new f,k=new f;this.clear();for(var Z=0,Y=b&&b.length;Z<Y;Z++){var W=b[Z],F=W[0],z=F.toLowerCase(),G=(x=W.match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g))&&x.length;switch(U=F===z,E!=="z"||/[mz]/.test(z)||this.moveTo(D),z){case"m":case"l":for(var X=z==="m",A=0;A<G;A+=2)this[X?"moveTo":"lineTo"](D=d(A)),X&&(k=D,X=!1);C=D;break;case"h":case"v":var N=z==="h"?"x":"y";for(D=D.clone(),A=0;A<G;A++)D[N]=h(A,N),this.lineTo(D);C=D;break;case"c":for(A=0;A<G;A+=6)this.cubicCurveTo(d(A),C=d(A+2),D=d(A+4));break;case"s":for(A=0;A<G;A+=4)this.cubicCurveTo(/[cs]/.test(E)?D.multiply(2).subtract(C):D,C=d(A),D=d(A+2)),E=z;break;case"q":for(A=0;A<G;A+=4)this.quadraticCurveTo(C=d(A),D=d(A+2));break;case"t":for(A=0;A<G;A+=2)this.quadraticCurveTo(C=/[qt]/.test(E)?D.multiply(2).subtract(C):D,D=d(A)),E=z;break;case"a":for(A=0;A<G;A+=7)this.arcTo(D=d(A+5),new y(+x[A],+x[A+1]),+x[A+2],+x[A+4],+x[A+3]);break;case"z":this.closePath(1e-12),D=k}E=z}},_canComposite:function(){return!(this.hasFill()&&this.hasStroke())},_contains:function(t){var h=t.isInside(this.getBounds({internal:!0,handle:!0}))?this._getWinding(t):{};return h.onPath||!!(this.getFillRule()==="evenodd"?1&h.windingL||1&h.windingR:h.winding)},getIntersections:function(t,h,d,x){var E=this===t||!t,C=this._matrix._orNullIfIdentity(),b=E?C:(d||t._matrix)._orNullIfIdentity();return E||this.getBounds(C).intersects(t.getBounds(b),1e-12)?ue.getIntersections(this.getCurves(),!E&&t.getCurves(),h,C,b,x):[]},getCrossings:function(t){return this.getIntersections(t,function(h){return h.hasOverlap()||h.isCrossing()})},getNearestLocation:function(){for(var t=f.read(arguments),h=this.getCurves(),d=1/0,x=null,E=0,C=h.length;E<C;E++){var b=h[E].getNearestLocation(t);b._distance<d&&(d=b._distance,x=b)}return x},getNearestPoint:function(){var t=this.getNearestLocation.apply(this,arguments);return t&&t.getPoint()},interpolate:function(t,h,d){var x=!this._children,E=x?"_segments":"_children",C=t[E],b=h[E],U=this[E];if(!C||!b||C.length!==b.length)throw new Error("Invalid operands in interpolate() call: "+t+", "+h);var D=U.length,k=b.length;if(D<k)for(var Z=x?oe:ne,Y=D;Y<k;Y++)this.add(new Z);else D>k&&this[x?"removeSegments":"removeChildren"](k,D);for(Y=0;Y<k;Y++)U[Y].interpolate(C[Y],b[Y],d);x&&(this.setClosed(t._closed),this._changed(9))},compare:function(t){var h=!1;if(t){var d=this._children||[this],x=t._children?t._children.slice():[t],E=d.length,C=x.length,b=[],U=0;h=!0;for(var D=E-1;D>=0&&h;D--){var k=d[D];h=!1;for(var Z=C-1;Z>=0&&!h;Z--)k.compare(x[Z])&&(b[Z]||(b[Z]=!0,U++),h=!0)}h=h&&U===C}return h}}),ne=ee.extend({_class:"Path",_serializeFields:{segments:[],closed:!1},initialize:function(t){this._closed=!1,this._segments=[],this._version=0;var h=Array.isArray(t)?typeof t[0]=="object"?t:arguments:!t||t.size!==r||t.x===r&&t.point===r?null:arguments;h&&h.length>0?this.setSegments(h):(this._curves=r,this._segmentSelection=0,h||typeof t!="string"||(this.setPathData(t),t=null)),this._initialize(!h&&t)},_equals:function(t){return this._closed===t._closed&&a.equals(this._segments,t._segments)},copyContent:function(t){this.setSegments(t._segments),this._closed=t._closed},_changed:function t(h){if(t.base.call(this,h),8&h){if(this._length=this._area=r,16&h)this._version++;else if(this._curves)for(var d=0,x=this._curves.length;d<x;d++)this._curves[d]._changed()}else 32&h&&(this._bounds=r)},getStyle:function(){var t=this._parent;return(t instanceof _e?t:this)._style},getSegments:function(){return this._segments},setSegments:function(t){var h=this.isFullySelected(),d=t&&t.length;if(this._segments.length=0,this._segmentSelection=0,this._curves=r,d){var x=t[d-1];typeof x=="boolean"&&(this.setClosed(x),d--),this._add(oe.readList(t,0,{},d))}h&&this.setFullySelected(!0)},getFirstSegment:function(){return this._segments[0]},getLastSegment:function(){return this._segments[this._segments.length-1]},getCurves:function(){var t=this._curves,h=this._segments;if(!t){var d=this._countCurves();t=this._curves=new Array(d);for(var x=0;x<d;x++)t[x]=new ue(this,h[x],h[x+1]||h[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 h=this._curves.length=this._countCurves();t&&(this._curves[h-1]=new ue(this,this._segments[h-1],this._segments[0]))}this._changed(25)}}},{beans:!0,getPathData:function(t,h){function d(N,I){if(N._transformCoordinates(t,z),x=z[0],E=z[1],G)X.push("M"+F.pair(x,E)),G=!1;else if(U=z[2],D=z[3],U===x&&D===E&&k===C&&Z===b){if(!I){var te=x-C,fe=E-b;X.push(te===0?"v"+F.number(fe):fe===0?"h"+F.number(te):"l"+F.pair(te,fe))}}else X.push("c"+F.pair(k-C,Z-b)+" "+F.pair(U-C,D-b)+" "+F.pair(x-C,E-b));C=x,b=E,k=z[4],Z=z[5]}var x,E,C,b,U,D,k,Z,Y=this._segments,W=Y.length,F=new p(h),z=new Array(6),G=!0,X=[];if(!W)return"";for(var A=0;A<W;A++)d(Y[A]);return this._closed&&W>0&&(d(Y[0],!0),X.push("z")),X.join("")},isEmpty:function(){return!this._segments.length},_transformContent:function(t){for(var h=this._segments,d=new Array(6),x=0,E=h.length;x<E;x++)h[x]._transformCoordinates(t,d,!0);return!0},_add:function(t,h){for(var d=this._segments,x=this._curves,E=t.length,C=h==null,h=C?d.length:h,b=0;b<E;b++){var U=t[b];U._path&&(U=t[b]=U.clone()),U._path=this,U._index=h+b,U._selection&&this._updateSelection(U,0,U._selection)}if(C)d.push.apply(d,t);else{d.splice.apply(d,[h,0].concat(t));for(var b=h+E,D=d.length;b<D;b++)d[b]._index=b}if(x){var k=this._countCurves(),Z=h>0&&h+E-1===k?h-1:h,Y=Z,W=Math.min(Z+E,k);for(t._curves&&(x.splice.apply(x,[Z,0].concat(t._curves)),Y+=t._curves.length),b=Y;b<W;b++)x.splice(b,0,new ue(this,null,null));this._adjustCurves(Z,W)}return this._changed(25),t},_adjustCurves:function(t,h){for(var d,x=this._segments,E=this._curves,C=t;C<h;C++)(d=E[C])._path=this,d._segment1=x[C],d._segment2=x[C+1]||x[0],d._changed();(d=E[this._closed&&!t?x.length-1:t-1])&&(d._segment2=x[t]||x[0],d._changed()),(d=E[h])&&(d._segment1=x[h],d._changed())},_countCurves:function(){var t=this._segments.length;return!this._closed&&t>0?t-1:t},add:function(t){return arguments.length>1&&typeof t!="number"?this._add(oe.readList(arguments)):this._add([oe.read(arguments)])[0]},insert:function(t,h){return arguments.length>2&&typeof h!="number"?this._add(oe.readList(arguments,1),t):this._add([oe.read(arguments,1)],t)[0]},addSegment:function(){return this._add([oe.read(arguments)])[0]},insertSegment:function(t){return this._add([oe.read(arguments,1)],t)[0]},addSegments:function(t){return this._add(oe.readList(t))},insertSegments:function(t,h){return this._add(oe.readList(h),t)},removeSegment:function(t){return this.removeSegments(t,t+1)[0]||null},removeSegments:function(t,h,d){t=t||0,h=a.pick(h,this._segments.length);var x=this._segments,E=this._curves,C=x.length,b=x.splice(t,h-t),U=b.length;if(!U)return b;for(k=0;k<U;k++){var D=b[k];D._selection&&this._updateSelection(D,D._selection,0),D._index=D._path=null}for(var k=t,Z=x.length;k<Z;k++)x[k]._index=k;if(E){for(var Y=t>0&&h===C+(this._closed?1:0)?t-1:t,k=(E=E.splice(Y,U)).length-1;k>=0;k--)E[k]._path=null;d&&(b._curves=E.slice(1)),this._adjustCurves(Y,Y)}return this._changed(25),b},clear:"#removeSegments",hasHandles:function(){for(var t=this._segments,h=0,d=t.length;h<d;h++)if(t[h].hasHandles())return!0;return!1},clearHandles:function(){for(var t=this._segments,h=0,d=t.length;h<d;h++)t[h].clearHandles()},getLength:function(){if(this._length==null){for(var t=this.getCurves(),h=0,d=0,x=t.length;d<x;d++)h+=t[d].getLength();this._length=h}return this._length},getArea:function(){var t=this._area;if(t==null){var h=this._segments,d=this._closed;t=0;for(var x=0,E=h.length;x<E;x++){var C=x+1===E;t+=ue.getArea(ue.getValues(h[x],h[C?0:x+1],null,C&&!d))}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(h){1&h||this._selectSegments(!1),t.base.call(this,h)},_selectSegments:function(t){var h=this._segments,d=h.length,x=t?7:0;this._segmentSelection=x*d;for(var E=0;E<d;E++)h[E]._selection=x},_updateSelection:function(t,h,d){t._selection=d,(this._segmentSelection+=d-h)>0&&this.setSelected(!0)},divideAt:function(t){var h,d=this.getLocationAt(t);return d&&(h=d.getCurve().divideAt(d.getCurveOffset()))?h._segment1:null},splitAt:function(t){var h=this.getLocationAt(t),d=h&&h.index,x=h&&h.time;x>1-1e-8&&(d++,x=0);var E=this.getCurves();if(d>=0&&d<E.length){x>=1e-8&&E[d++].divideAtTime(x);var C,b=this.removeSegments(d,this._segments.length,!0);return this._closed?(this.setClosed(!1),C=this):((C=new ne(Q.NO_INSERT)).insertAbove(this),C.copyAttributes(this)),C._add(b,0),this.addSegment(b[0]),C}return null},split:function(t,h){var d,x=h===r?t:(d=this.getCurves()[t])&&d.getLocationAtTime(h);return x!=null?this.splitAt(x):null},join:function(t,h){var d=h||0;if(t&&t!==this){var x=t._segments,E=this.getLastSegment(),C=t.getLastSegment();if(!C)return this;E&&E._point.isClose(C._point,d)&&t.reverse();var b=t.getFirstSegment();if(E&&E._point.isClose(b._point,d))E.setHandleOut(b._handleOut),this._add(x.slice(1));else{var U=this.getFirstSegment();U&&U._point.isClose(b._point,d)&&t.reverse(),C=t.getLastSegment(),U&&U._point.isClose(C._point,d)?(U.setHandleIn(C._handleIn),this._add(x.slice(0,x.length-1),0)):this._add(x.slice())}t._closed&&this._add([x[0]]),t.remove()}var D=this.getFirstSegment(),k=this.getLastSegment();return D!==k&&D._point.isClose(k._point,d)&&(D.setHandleIn(k._handleIn),k.remove(),this.setClosed(!0)),this},reduce:function(t){for(var h=this.getCurves(),d=t&&t.simplify,x=d?1e-7:0,E=h.length-1;E>=0;E--){var C=h[E];!C.hasHandles()&&(!C.hasLength(x)||d&&C.isCollinear(C.getNext()))&&C.remove()}return this},reverse:function(){this._segments.reverse();for(var t=0,h=this._segments.length;t<h;t++){var d=this._segments[t],x=d._handleIn;d._handleIn=d._handleOut,d._handleOut=x,d._index=t}this._curves=null,this._changed(9)},flatten:function(t){for(var h=new ae(this,t||.25,256,!0).parts,d=h.length,x=[],E=0;E<d;E++)x.push(new oe(h[E].curve.slice(0,2)));!this._closed&&d>0&&x.push(new oe(h[d-1].curve.slice(6))),this.setSegments(x)},simplify:function(t){var h=new Me(this).fit(t||2.5);return h&&this.setSegments(h),!!h},smooth:function(t){function h(mt,vt){var lt=mt&&mt.index;if(lt!=null){var St=mt.path;if(St&&St!==d)throw new Error(mt._class+" "+lt+" of "+St+" is not part of "+d);vt&&mt instanceof ue&<++}else lt=typeof mt=="number"?mt:vt;return Math.min(lt<0&&U?lt%b:lt<0?lt+b:lt,b-1)}var d=this,x=t||{},E=x.type||"asymmetric",C=this._segments,b=C.length,U=this._closed,D=U&&x.from===r&&x.to===r,k=h(x.from,0),Z=h(x.to,b-1);if(k>Z)if(U)k-=b;else{var Y=k;k=Z,Z=Y}if(/^(?:asymmetric|continuous)$/.test(E)){var W=E==="asymmetric",F=Math.min,z=Z-k+1,G=z-1,X=D?F(z,4):1,A=X,N=X,I=[];if(U||(A=F(1,k),N=F(1,b-Z-1)),(G+=A+N)<=1)return;for(var te=0,fe=k-A;te<=G;te++,fe++)I[te]=C[(fe<0?fe+b:fe)%b]._point;for(var S=I[0]._x+2*I[1]._x,de=I[0]._y+2*I[1]._y,se=2,ie=G-1,ge=[S],Pe=[de],Ye=[se],Ge=[],Ze=[],te=1;te<G;te++){var Je=te<ie,tt=Je||W?1:2,nt=Je?4:W?2:7,at=Je?4:W?3:8,ut=Je?2:W?0:1,st=tt/se;se=Ye[te]=nt-st,S=ge[te]=at*I[te]._x+ut*I[te+1]._x-st*S,de=Pe[te]=at*I[te]._y+ut*I[te+1]._y-st*de}for(Ge[ie]=ge[ie]/Ye[ie],Ze[ie]=Pe[ie]/Ye[ie],te=G-2;te>=0;te--)Ge[te]=(ge[te]-Ge[te+1])/Ye[te],Ze[te]=(Pe[te]-Ze[te+1])/Ye[te];Ge[G]=(3*I[G]._x-Ge[ie])/2,Ze[G]=(3*I[G]._y-Ze[ie])/2;for(var te=A,gt=G-N,fe=k;te<=gt;te++,fe++){var ft=C[fe<0?fe+b:fe],ct=ft._point,_t=Ge[te]-ct._x,Et=Ze[te]-ct._y;(D||te<gt)&&ft.setHandleOut(_t,Et),(D||te>A)&&ft.setHandleIn(-_t,-Et)}}else for(te=k;te<=Z;te++)C[te<0?te+b:te].smooth(x,!D&&te===k,!D&&te===Z)},toShape:function(t){function h(Y,W){var F=D[Y],z=F.getNext(),G=D[W],X=G.getNext();return F._handleOut.isZero()&&z._handleIn.isZero()&&G._handleOut.isZero()&&X._handleIn.isZero()&&z._point.subtract(F._point).isCollinear(X._point.subtract(G._point))}function d(Y){var W=D[Y],F=W.getNext(),z=W._handleOut,G=F._handleIn;if(z.isOrthogonal(G)){var X=W._point,A=F._point,N=new H(X,z,!0).intersect(new H(A,G,!0),!0);return N&&c.isZero(z.getLength()/N.subtract(X).getLength()-.5522847498307936)&&c.isZero(G.getLength()/N.subtract(A).getLength()-.5522847498307936)}return!1}function x(Y,W){return D[Y]._point.getDistance(D[W]._point)}if(!this._closed)return null;var E,C,b,U,D=this._segments;if(!this.hasHandles()&&D.length===4&&h(0,2)&&h(1,3)&&function(Y){var W=D[Y],F=W.getPrevious(),z=W.getNext();return F._handleOut.isZero()&&W._handleIn.isZero()&&W._handleOut.isZero()&&z._handleIn.isZero()&&W._point.subtract(F._point).isOrthogonal(z._point.subtract(W._point))}(1)?(E=K.Rectangle,C=new y(x(0,3),x(0,1)),U=D[1]._point.add(D[2]._point).divide(2)):D.length===8&&d(0)&&d(2)&&d(4)&&d(6)&&h(1,5)&&h(3,7)?(E=K.Rectangle,b=(C=new y(x(1,6),x(0,3))).subtract(new y(x(0,7),x(1,2))).divide(2),U=D[3]._point.add(D[4]._point).divide(2)):D.length===4&&d(0)&&d(1)&&d(2)&&d(3)&&(c.isZero(x(0,2)-x(1,3))?(E=K.Circle,b=x(0,2)/2):(E=K.Ellipse,b=new y(x(2,0)/2,x(3,1)/2)),U=D[1]._point),E){var k=this.getPosition(!0),Z=new E({center:k,size:C,radius:b,insert:!1});return Z.copyAttributes(this,!0),Z._matrix.prepend(this._matrix),Z.rotate(U.subtract(k).getAngle()+90),(t===r||t)&&Z.insertAbove(this),Z}return null},toPath:"#clone",compare:function t(h){if(!h||h instanceof _e)return t.base.call(this,h);var d=this.getCurves(),x=h.getCurves(),E=d.length,C=x.length;if(!E||!C)return E==C;for(var b,U,D=d[0].getValues(),k=[],Z=0,Y=0,W=0;W<C;W++)if(G=x[W].getValues(),k.push(G),X=ue.getOverlaps(D,G)){b=!W&&X[0][0]>0?C-1:W,U=X[0][1];break}for(var F,z=Math.abs,G=k[b];D&&G;){var X=ue.getOverlaps(D,G);if(X&&z(X[0][0]-Y)<1e-8){(Y=X[1][0])===1&&(D=++Z<E?d[Z].getValues():null,Y=0);var A=X[0][1];if(z(A-U)<1e-8){if(F||(F=[b,A]),(U=X[1][1])===1&&(++b>=C&&(b=0),G=k[b]||x[b].getValues(),U=0),!D)return F[0]===b&&F[1]===U;continue}}break}return!1},_hitTestSelf:function(t,h,d,x){function E(Ge,Ze){return t.subtract(Ge).divide(Ze).length<=1}function C(Ge,Ze,Je){if(!h.selected||Ze.isSelected()){var tt=Ge._point;if(Ze!==tt&&(Ze=Ze.add(tt)),E(Ze,fe))return new re(Je,G,{segment:Ge,point:Ze})}}function b(Ge,Ze){return(Ze||h.segments)&&C(Ge,Ge._point,"segment")||!Ze&&h.handles&&(C(Ge,Ge._handleIn,"handle-in")||C(Ge,Ge._handleOut,"handle-out"))}function U(Ge){W.add(Ge)}function D(Ge){var Ze=I||Ge._index>0&&Ge._index<N-1;if((Ze?k:Z)==="round")return E(Ge._point,fe);if(W=new ne({internal:!0,closed:!0}),Ze?Ge.isSmooth()||ne._addBevelJoin(Ge,k,ie,Y,null,x,U,!0):Z==="square"&&ne._addSquareCap(Ge,Z,ie,null,x,U,!0),!W.isEmpty()){var Je;return W.contains(t)||(Je=W.getNearestLocation(t))&&E(Je.getPoint(),te)}}var k,Z,Y,W,F,z,G=this,X=this.getStyle(),A=this._segments,N=A.length,I=this._closed,te=h._tolerancePadding,fe=te,S=h.stroke&&X.hasStroke(),de=h.fill&&X.hasFill(),se=h.curves,ie=S?X.getStrokeWidth()/2:de&&h.tolerance>0||se?0:null;if(ie!==null&&(ie>0?(k=X.getStrokeJoin(),Z=X.getStrokeCap(),Y=X.getMiterLimit(),fe=fe.add(ne._getStrokePadding(ie,x))):k=Z="round"),!h.ends||h.segments||I){if(h.segments||h.handles){for(Pe=0;Pe<N;Pe++)if(z=b(A[Pe]))return z}}else if(z=b(A[0],!0)||b(A[N-1],!0))return z;if(ie!==null){if(F=this.getNearestLocation(t)){var ge=F.getTime();ge===0||ge===1&&N>1?D(F.getSegment())||(F=null):E(F.getPoint(),fe)||(F=null)}if(!F&&k==="miter"&&N>1)for(var Pe=0;Pe<N;Pe++){var Ye=A[Pe];if(t.getDistance(Ye._point)<=Y*ie&&D(Ye)){F=Ye.getLocation();break}}}return!F&&de&&this._contains(t)||F&&!S&&!se?new re("fill",this):F?new re(S?"stroke":"curve",this,{location:F,point:F.getPoint()}):null}},a.each(ue._evaluateMethods,function(t){this[t+"At"]=function(h){var d=this.getLocationAt(h);return d&&d[t]()}},{beans:!1,getLocationOf:function(){for(var t=f.read(arguments),h=this.getCurves(),d=0,x=h.length;d<x;d++){var E=h[d].getLocationOf(t);if(E)return E}return null},getOffsetOf:function(){var t=this.getLocationOf.apply(this,arguments);return t?t.getOffset():null},getLocationAt:function(t){if(typeof t=="number"){for(var h=this.getCurves(),d=0,x=0,E=h.length;x<E;x++){var C=d,b=h[x];if((d+=b.getLength())>t)return b.getLocationAt(t-C)}if(h.length>0&&t<=this.getLength())return new $(h[h.length-1],1)}else if(t&&t.getPath&&t.getPath()===this)return t;return null}}),new function(){function t(d,x,E,C){function b(X){var A=Z[X],N=Z[X+1];U==A&&D==N||(d.beginPath(),d.moveTo(U,D),d.lineTo(A,N),d.stroke(),d.beginPath(),d.arc(A,N,k,0,2*Math.PI,!0),d.fill())}for(var U,D,k=C/2,Z=new Array(6),Y=0,W=x.length;Y<W;Y++){var F=x[Y],z=F._selection;if(F._transformCoordinates(E,Z),U=Z[0],D=Z[1],2&z&&b(2),4&z&&b(4),d.fillRect(U-k,D-k,C,C),!(1&z)){var G=d.fillStyle;d.fillStyle="#ffffff",d.fillRect(U-k+1,D-k+1,C-2,C-2),d.fillStyle=G}}}function h(d,x,E){function C(I){if(E)I._transformCoordinates(E,X),b=X[0],U=X[1];else{var te=I._point;b=te._x,U=te._y}if(A?(d.moveTo(b,U),A=!1):(E?(Z=X[2],Y=X[3]):(fe=I._handleIn,Z=b+fe._x,Y=U+fe._y),Z===b&&Y===U&&W===D&&F===k?d.lineTo(b,U):d.bezierCurveTo(W,F,Z,Y,b,U)),D=b,k=U,E)W=X[4],F=X[5];else{var fe=I._handleOut;W=D+fe._x,F=k+fe._y}}for(var b,U,D,k,Z,Y,W,F,z=x._segments,G=z.length,X=new Array(6),A=!0,N=0;N<G;N++)C(z[N]);x._closed&&G>0&&C(z[0])}return{_draw:function(d,x,E,C){function b(I){return W[(I%F+F)%F]}var U=x.dontStart,D=x.dontFinish||x.clip,k=this.getStyle(),Z=k.hasFill(),Y=k.hasStroke(),W=k.getDashArray(),F=!paper.support.nativeDash&&Y&&W&&W.length;if(U||d.beginPath(),(Z||Y&&!F||D)&&(h(d,this,C),this._closed&&d.closePath()),!D&&(Z||Y)&&(this._setStyles(d,x,E),Z&&(d.fill(k.getFillRule()),d.shadowColor="rgba(0,0,0,0)"),Y)){if(F){U||d.beginPath();var z,G=new ae(this,.25,32,!1,C),X=G.length,A=-k.getDashOffset(),N=0;for(A%=X;A>0;)A-=b(N--)+b(N--);for(;A<X;)z=A+b(N++),(A>0||z>0)&&G.drawPart(d,Math.max(A,0),Math.max(z,0)),A=z+b(N++)}d.stroke()}},_drawSelected:function(d,x){d.beginPath(),h(d,this,x),d.stroke(),t(d,this._segments,x,paper.settings.handleSize)}}},new function(){function t(h){var d=h._segments;if(!d.length)throw new Error("Use a moveTo() command first");return d[d.length-1]}return{moveTo:function(){var h=this._segments;h.length===1&&this.removeSegment(0),h.length||this._add([new oe(f.read(arguments))])},moveBy:function(){throw new Error("moveBy() is unsupported on Path items.")},lineTo:function(){this._add([new oe(f.read(arguments))])},cubicCurveTo:function(){var h=f.read(arguments),d=f.read(arguments),x=f.read(arguments),E=t(this);E.setHandleOut(h.subtract(E._point)),this._add([new oe(x,d.subtract(x))])},quadraticCurveTo:function(){var h=f.read(arguments),d=f.read(arguments),x=t(this)._point;this.cubicCurveTo(h.add(x.subtract(h).multiply(1/3)),h.add(d.subtract(h).multiply(1/3)),d)},curveTo:function(){var h=f.read(arguments),d=f.read(arguments),x=a.pick(a.read(arguments),.5),E=1-x,C=t(this)._point,b=h.subtract(C.multiply(E*E)).subtract(d.multiply(x*x)).divide(2*x*E);if(b.isNaN())throw new Error("Cannot put a curve through points with parameter = "+x);this.quadraticCurveTo(b,d)},arcTo:function(){var h,d,x,E,C=Math.abs,b=Math.sqrt,U=t(this),D=U._point,k=f.read(arguments),Z=a.peek(arguments);if(typeof(G=a.pick(Z,!0))=="boolean")var Y=(A=D.add(k).divide(2)).add(A.subtract(D).rotate(G?-90:90));else if(a.remain(arguments)<=2)Y=k,k=f.read(arguments);else{var W=y.read(arguments),F=c.isZero;if(F(W.width)||F(W.height))return this.lineTo(k);var z=a.read(arguments),G=!!a.read(arguments),X=!!a.read(arguments),A=D.add(k).divide(2),N=(ct=D.subtract(A).rotate(-z)).x,I=ct.y,te=C(W.width),fe=C(W.height),S=te*te,de=fe*fe,se=N*N,ie=I*I,ge=b(se/S+ie/de);if(ge>1&&(S=(te*=ge)*te,de=(fe*=ge)*fe),ge=(S*de-S*ie-de*se)/(S*ie+de*se),C(ge)<1e-12&&(ge=0),ge<0)throw new Error("Cannot create an arc with the given arguments");h=new f(te*I/fe,-fe*N/te).multiply((X===G?-1:1)*b(ge)).rotate(z).add(A),d=(x=(E=new B().translate(h).rotate(z).scale(te,fe))._inverseTransform(D)).getDirectedAngle(E._inverseTransform(k)),!G&&d>0?d-=360:G&&d<0&&(d+=360)}if(Y){var Pe=new H(D.add(Y).divide(2),Y.subtract(D).rotate(90),!0),Ye=new H(Y.add(k).divide(2),k.subtract(Y).rotate(90),!0),Ge=new H(D,k),Ze=Ge.getSide(Y);if(!(h=Pe.intersect(Ye,!0))){if(!Ze)return this.lineTo(k);throw new Error("Cannot create an arc with the given arguments")}d=(x=D.subtract(h)).getDirectedAngle(k.subtract(h));var Je=Ge.getSide(h);Je===0?d=Ze*C(d):Ze===Je&&(d+=d<0?360:-360)}for(var tt=C(d),nt=tt>=360?4:Math.ceil((tt-1e-7)/90),at=d/nt,ut=at*Math.PI/360,st=4/3*Math.sin(ut)/(1+Math.cos(ut)),gt=[],ft=0;ft<=nt;ft++){var ct=k,_t=null;if(ft<nt&&(_t=x.rotate(90).multiply(st),E?(ct=E._transformPoint(x),_t=E._transformPoint(x.add(_t)).subtract(ct)):ct=h.add(x)),ft){var Et=x.rotate(-90).multiply(st);E&&(Et=E._transformPoint(x.add(Et)).subtract(ct)),gt.push(new oe(ct,Et,_t))}else U.setHandleOut(_t);x=x.rotate(at)}this._add(gt)},lineBy:function(){var h=f.read(arguments),d=t(this)._point;this.lineTo(d.add(h))},curveBy:function(){var h=f.read(arguments),d=f.read(arguments),x=a.read(arguments),E=t(this)._point;this.curveTo(E.add(h),E.add(d),x)},cubicCurveBy:function(){var h=f.read(arguments),d=f.read(arguments),x=f.read(arguments),E=t(this)._point;this.cubicCurveTo(E.add(h),E.add(d),E.add(x))},quadraticCurveBy:function(){var h=f.read(arguments),d=f.read(arguments),x=t(this)._point;this.quadraticCurveTo(x.add(h),x.add(d))},arcBy:function(){var h=t(this)._point,d=h.add(f.read(arguments)),x=a.pick(a.peek(arguments),!0);typeof x=="boolean"?this.arcTo(d,x):this.arcTo(d,h.add(f.read(arguments)))},closePath:function(h){this.setClosed(!0),this.join(this,h)}}},{_getBounds:function(t,h){var d=h.handle?"getHandleBounds":h.stroke?"getStrokeBounds":"getBounds";return ne[d](this._segments,this._closed,this,t,h)},statics:{getBounds:function(t,h,d,x,E,C){function b(G){G._transformCoordinates(x,D);for(var X=0;X<2;X++)ue._addBounds(k[X],k[X+4],D[X+2],D[X],X,C?C[X]:0,Z,Y,W);var A=k;k=D,D=A}var U=t[0];if(!U)return new M;for(var D=new Array(6),k=U._transformCoordinates(x,new Array(6)),Z=k.slice(0,2),Y=Z.slice(),W=new Array(2),F=1,z=t.length;F<z;F++)b(t[F]);return h&&b(U),new M(Z[0],Z[1],Y[0]-Z[0],Y[1]-Z[1])},getStrokeBounds:function(t,h,d,x,E){function C(S){z=z.include(S)}function b(S){z=z.unite(I.setCenter(S._point.transform(x)))}function U(S,de){de==="round"||S.isSmooth()?b(S):ne._addBevelJoin(S,de,G,N,x,W,C)}function D(S,de){de==="round"?b(S):ne._addSquareCap(S,de,G,x,W,C)}var k=d.getStyle(),Z=k.hasStroke(),Y=k.getStrokeWidth(),W=Z&&d._getStrokeMatrix(x,E),F=Z&&ne._getStrokePadding(Y,W),z=ne.getBounds(t,h,d,x,E,F);if(!Z)return z;for(var G=Y/2,X=k.getStrokeJoin(),A=k.getStrokeCap(),N=k.getMiterLimit(),I=new M(new y(F)),te=t.length-(h?0:1),fe=1;fe<te;fe++)U(t[fe],X);return h?U(t[0],X):te>0&&(D(t[0],A),D(t[t.length-1],A)),z},_getStrokePadding:function(t,h){if(!h)return[t,t];var d=new f(t,0).transform(h),x=new f(0,t).transform(h),E=d.getAngleInRadians(),C=d.getLength(),b=x.getLength(),U=Math.sin(E),D=Math.cos(E),k=Math.tan(E),Z=Math.atan2(b*k,C),Y=Math.atan2(b,k*C);return[Math.abs(C*Math.cos(Z)*D+b*Math.sin(Z)*U),Math.abs(b*Math.sin(Y)*D+C*Math.cos(Y)*U)]},_addBevelJoin:function(t,h,d,x,E,C,b,U){var D=t.getCurve(),k=D.getPrevious(),Z=D.getPoint1().transform(E),Y=k.getNormalAtTime(1).multiply(d).transform(C),W=D.getNormalAtTime(0).multiply(d).transform(C);if(Y.getDirectedAngle(W)<0&&(Y=Y.negate(),W=W.negate()),U&&b(Z),b(Z.add(Y)),h==="miter"){var F=new H(Z.add(Y),new f(-Y.y,Y.x),!0).intersect(new H(Z.add(W),new f(-W.y,W.x),!0),!0);F&&Z.getDistance(F)<=x*d&&b(F)}b(Z.add(W))},_addSquareCap:function(t,h,d,x,E,C,b){var U=t._point.transform(x),D=t.getLocation(),k=D.getNormal().multiply(D.getTime()===0?d:-d).transform(E);h==="square"&&(b&&(C(U.subtract(k)),C(U.add(k))),U=U.add(k.rotate(-90))),C(U.add(k)),C(U.subtract(k))},getHandleBounds:function(t,h,d,x,E){var C,b,U=d.getStyle();if(E.stroke&&U.hasStroke()){var D=d._getStrokeMatrix(x,E),k=U.getStrokeWidth()/2,Z=k;U.getStrokeJoin()==="miter"&&(Z=k*U.getMiterLimit()),U.getStrokeCap()==="square"&&(Z=Math.max(Z,k*Math.SQRT2)),C=ne._getStrokePadding(k,D),b=ne._getStrokePadding(Z,D)}for(var Y=new Array(6),W=1/0,F=-W,z=W,G=F,X=0,A=t.length;X<A;X++){t[X]._transformCoordinates(x,Y);for(var N=0;N<6;N+=2){var I=N?C:b,te=I?I[0]:0,fe=I?I[1]:0,S=Y[N],de=Y[N+1],se=S-te,ie=S+te,ge=de-fe,Pe=de+fe;se<W&&(W=se),ie>F&&(F=ie),ge<z&&(z=ge),Pe>G&&(G=Pe)}}return new M(W,z,F-W,G-z)}}});ne.inject({statics:new function(){function t(E,C,b){var U=a.getNamed(b),D=new ne(U&&U.insert==0&&Q.NO_INSERT);return D._add(E),D._closed=C,D.set(U,{insert:!0})}function h(E,C,b){for(var U=new Array(4),D=0;D<4;D++){var k=x[D];U[D]=new oe(k._point.multiply(C).add(E),k._handleIn.multiply(C),k._handleOut.multiply(C))}return t(U,!0,b)}var d=.5522847498307936,x=[new oe([-1,0],[0,d],[0,-d]),new oe([0,-1],[-d,0],[d,0]),new oe([1,0],[0,-d],[0,d]),new oe([0,1],[d,0],[-d,0])];return{Line:function(){return t([new oe(f.readNamed(arguments,"from")),new oe(f.readNamed(arguments,"to"))],!1,arguments)},Circle:function(){var E=f.readNamed(arguments,"center"),C=a.readNamed(arguments,"radius");return h(E,new y(C),arguments)},Rectangle:function(){var E,C=M.readNamed(arguments,"rectangle"),b=y.readNamed(arguments,"radius",0,{readNull:!0}),U=C.getBottomLeft(!0),D=C.getTopLeft(!0),k=C.getTopRight(!0),Z=C.getBottomRight(!0);if(!b||b.isZero())E=[new oe(U),new oe(D),new oe(k),new oe(Z)];else{var Y=(b=y.min(b,C.getSize(!0).divide(2))).width,W=b.height,F=Y*d,z=W*d;E=[new oe(U.add(Y,0),null,[-F,0]),new oe(U.subtract(0,W),[0,z]),new oe(D.add(0,W),null,[0,-z]),new oe(D.add(Y,0),[-F,0],null),new oe(k.subtract(Y,0),null,[F,0]),new oe(k.add(0,W),[0,-z],null),new oe(Z.subtract(0,W),null,[0,z]),new oe(Z.subtract(Y,0),[F,0])]}return t(E,!0,arguments)},RoundRectangle:"#Rectangle",Ellipse:function(){var E=K._readEllipse(arguments);return h(E.center,E.radius,arguments)},Oval:"#Ellipse",Arc:function(){var E=f.readNamed(arguments,"from"),C=f.readNamed(arguments,"through"),b=f.readNamed(arguments,"to"),U=a.getNamed(arguments),D=new ne(U&&U.insert==0&&Q.NO_INSERT);return D.moveTo(E),D.arcTo(C,b),D.set(U)},RegularPolygon:function(){for(var E=f.readNamed(arguments,"center"),C=a.readNamed(arguments,"sides"),b=a.readNamed(arguments,"radius"),U=360/C,D=C%3==0,k=new f(0,D?-b:b),Z=D?-1:.5,Y=new Array(C),W=0;W<C;W++)Y[W]=new oe(E.add(k.rotate((W+Z)*U)));return t(Y,!0,arguments)},Star:function(){for(var E=f.readNamed(arguments,"center"),C=2*a.readNamed(arguments,"points"),b=a.readNamed(arguments,"radius1"),U=a.readNamed(arguments,"radius2"),D=360/C,k=new f(0,-1),Z=new Array(C),Y=0;Y<C;Y++)Z[Y]=new oe(E.add(k.rotate(D*Y).multiply(Y%2?U:b)));return t(Z,!0,arguments)}}}});var _e=ee.extend({_class:"CompoundPath",_serializeFields:{children:[]},beans:!0,initialize:function(t){this._children=[],this._namedChildren={},this._initialize(t)||(typeof t=="string"?this.setPathData(t):this.addChildren(Array.isArray(t)?t:arguments))},insertChildren:function t(h,d){var x=d,E=x[0];E&&typeof E[0]=="number"&&(x=[x]);for(var C=d.length-1;C>=0;C--){var b=x[C];x!==d||b instanceof ne||(x=a.slice(x)),Array.isArray(b)?x[C]=new ne({segments:b,insert:!1}):b instanceof _e&&(x.splice.apply(x,[C,1].concat(b.removeChildren())),b.remove())}return t.base.call(this,h,x)},reduce:function t(h){for(var d=this._children,x=d.length-1;x>=0;x--)(E=d[x].reduce(h)).isEmpty()&&E.remove();if(!d.length){var E=new ne(Q.NO_INSERT);return E.copyAttributes(this),E.insertAbove(this),this.remove(),E}return t.base.call(this)},isClosed:function(){for(var t=this._children,h=0,d=t.length;h<d;h++)if(!t[h]._closed)return!1;return!0},setClosed:function(t){for(var h=this._children,d=0,x=h.length;d<x;d++)h[d].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,h=[],d=0,x=t.length;d<x;d++)h.push.apply(h,t[d].getCurves());return h},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,h=0,d=0,x=t.length;d<x;d++)h+=t[d].getArea();return h},getLength:function(){for(var t=this._children,h=0,d=0,x=t.length;d<x;d++)h+=t[d].getLength();return h},getPathData:function(t,h){for(var d=this._children,x=[],E=0,C=d.length;E<C;E++){var b=d[E],U=b._matrix;x.push(b.getPathData(t&&!U.isIdentity()?t.appended(U):t,h))}return x.join("")},_hitTestChildren:function t(h,d,x){return t.base.call(this,h,d.class===ne||d.type==="path"?d:a.set({},d,{fill:!1}),x)},_draw:function(t,h,d,x){var E=this._children;if(E.length){h=h.extend({dontStart:!0,dontFinish:!0}),t.beginPath();for(var C=0,b=E.length;C<b;C++)E[C].draw(t,h,x);if(!h.clip){this._setStyles(t,h,d);var U=this._style;U.hasFill()&&(t.fill(U.getFillRule()),t.shadowColor="rgba(0,0,0,0)"),U.hasStroke()&&t.stroke()}}},_drawSelected:function(t,h,d){for(var x=this._children,E=0,C=x.length;E<C;E++){var b=x[E],U=b._matrix;d[b._id]||b._drawSelected(t,U.isIdentity()?h:h.appended(U))}}},new function(){function t(h,d){var x=h._children;if(d&&!x.length)throw new Error("Use a moveTo() command first");return x[x.length-1]}return a.each(["lineTo","cubicCurveTo","quadraticCurveTo","curveTo","arcTo","lineBy","cubicCurveBy","quadraticCurveBy","curveBy","arcBy"],function(h){this[h]=function(){var d=t(this,!0);d[h].apply(d,arguments)}},{moveTo:function(){var h=t(this),d=h&&h.isEmpty()?h:new ne(Q.NO_INSERT);d!==h&&this.addChild(d),d.moveTo.apply(d,arguments)},moveBy:function(){var h=t(this,!0),d=h&&h.getLastSegment(),x=f.read(arguments);this.moveTo(d?x.add(d._point):x)},closePath:function(h){t(this,!0).closePath(h)}})},a.each(["reverse","flatten","simplify","smooth"],function(t){this[t]=function(h){for(var d,x=this._children,E=0,C=x.length;E<C;E++)d=x[E][t](h)||d;return d}},{}));ee.inject(new function(){function t(G,X){var A=G.clone(!1).reduce({simplify:!0}).transform(null,!0,!0);return X?A.resolveCrossings().reorient(A.getFillRule()==="nonzero",!0):A}function h(G,X,A,N,I){var te=new _e(Q.NO_INSERT);return te.addChildren(G,!0),te=te.reduce({simplify:X}),I&&I.insert==0||te.insertAbove(N&&A.isSibling(N)&&A.getIndex()<N.getIndex()?N:A),te.copyAttributes(A,!0),te}function d(G,X,A,N){function I(nt){for(var at=0,ut=nt.length;at<ut;at++){var st=nt[at];Pe.push.apply(Pe,st._segments),Ye.push.apply(Ye,st.getCurves()),st._overlapsOnly=!0}}if(N&&(N.trace==0||N.stroke)&&/^(subtract|intersect)$/.test(A))return x(G,X,A);var te=t(G,!0),fe=X&&G!==X&&t(X,!0),S=z[A];S[A]=!0,fe&&(S.subtract||S.exclude)^fe.isClockwise()^te.isClockwise()&&fe.reverse();var de,se=U($.expand(te.getCrossings(fe))),ie=te._children||[te],ge=fe&&(fe._children||[fe]),Pe=[],Ye=[];if(se.length){I(ie),ge&&I(ge);for(var Ge=0,Ze=se.length;Ge<Ze;Ge++)k(se[Ge]._segment,te,fe,Ye,S);for(var Ge=0,Ze=Pe.length;Ge<Ze;Ge++){var Je=Pe[Ge],tt=Je._intersection;Je._winding||k(Je,te,fe,Ye,S),tt&&tt._overlap||(Je._path._overlapsOnly=!1)}de=Z(Pe,S)}else de=b(ge?ie.concat(ge):ie.slice(),function(nt){return!!S[nt]});return h(de,!0,G,X,N)}function x(G,X,A){function N(Ye){if(!se[Ye._id]&&(de||te.contains(Ye.getPointAt(Ye.getLength()/2))^S))return ie.unshift(Ye),se[Ye._id]=!0}for(var I=t(G),te=t(X),fe=I.getCrossings(te),S=A==="subtract",de=A==="divide",se={},ie=[],ge=fe.length-1;ge>=0;ge--){var Pe=fe[ge].split();Pe&&(N(Pe)&&Pe.getFirstSegment().setHandleIn(0,0),I.getLastSegment().setHandleOut(0,0))}return N(I),h(ie,!1,G,X)}function E(G,X){for(var A=G;A;){if(A===X)return;A=A._previous}for(;G._next&&G._next!==X;)G=G._next;if(!G._next){for(;X._previous;)X=X._previous;G._next=X,X._previous=G}}function C(G){for(var X=G.length-1;X>=0;X--)G[X].clearHandles()}function b(G,X,A){var N=G&&G.length;if(N){var I=a.each(G,function(Je,tt){this[Je._id]={container:null,winding:Je.isClockwise()?1:-1,index:tt}},{}),te=G.slice().sort(function(Je,tt){return F(tt.getArea())-F(Je.getArea())}),fe=te[0];A==null&&(A=fe.isClockwise());for(var S=0;S<N;S++){for(var de=te[S],se=I[de._id],ie=de.getInteriorPoint(),ge=0,Pe=S-1;Pe>=0;Pe--){var Ye=te[Pe];if(Ye.contains(ie)){var Ge=I[Ye._id];ge=Ge.winding,se.winding+=ge,se.container=Ge.exclude?Ge.container:Ye;break}}if(X(se.winding)===X(ge))se.exclude=!0,G[se.index]=null;else{var Ze=se.container;de.setClockwise(Ze?!Ze.isClockwise():A)}}}return G}function U(G,X,A){function N(ct){return ct._path._id+"."+ct._segment1._index}for(var I,te,fe,S=X&&[],de=!1,se=A||[],ie=A&&{},ge=(A&&A.length)-1;ge>=0;ge--)(tt=A[ge])._path&&(ie[N(tt)]=!0);for(ge=G.length-1;ge>=0;ge--){var Pe,Ye=G[ge],Ge=Ye._time,Ze=Ge,Je=X&&!X(Ye),tt=Ye._curve;if(tt&&(tt!==te?(de=!tt.hasHandles()||ie&&ie[N(tt)],I=[],fe=null,te=tt):fe>=1e-8&&(Ge/=fe)),Je)I&&I.push(Ye);else{if(X&&S.unshift(Ye),fe=Ze,Ge<1e-8)Pe=tt._segment1;else if(Ge>1-1e-8)Pe=tt._segment2;else{var nt=tt.divideAtTime(Ge,!0);de&&se.push(tt,nt),Pe=nt._segment1;for(var at=I.length-1;at>=0;at--){var ut=I[at];ut._time=(ut._time-Ge)/(1-Ge)}}Ye._setSegment(Pe);var st=Pe._intersection,gt=Ye._intersection;if(st){E(st,gt);for(var ft=st;ft;)E(ft._intersection,st),ft=ft._next}else Pe._intersection=gt}}return A||C(se),S||G}function D(G,X,A,N,I){function te(yt){var Ut=yt[ie+0],Dt=yt[ie+6];if(!(Ye<Y(Ut,Dt)||Ye>W(Ut,Dt))){var Ct=yt[se+0],Wt=yt[se+2],Kt=yt[se+4],$t=yt[se+6];if(Ut!==Dt){var Ft=Ye===Ut?0:Ye===Dt||Ze>W(Ct,Wt,Kt,$t)||Je<Y(Ct,Wt,Kt,$t)?1:ue.solveCubic(yt,ie,Ye,ct,0,1)>0?ct[0]:1,Gt=Ft===0?Ct:Ft===1?$t:ue.getPoint(yt,Ft)[A?"y":"x"],Nt=Ut>Dt?1:-1,hr=S[ie]>S[ie+6]?1:-1,rr=S[se+6];return Ye!==Ut?(Gt<Ze?at+=Nt:Gt>Je?ut+=Nt:st=!0,Gt>Pe-Ge&&Gt<Pe+Ge&&(ft/=2)):(Nt!==hr?Ct<Ze?at+=Nt:Ct>Je&&(ut+=Nt):Ct!=rr&&(rr<Je&&Gt>Je?(ut+=Nt,st=!0):rr>Ze&&Gt<Ze&&(at+=Nt,st=!0)),ft=0),S=yt,!I&&Gt>Ze&&Gt<Je&&ue.getTangent(yt,Ft)[A?"x":"y"]===0&&D(G,X,!A,N,!0)}(Ct<Je&&$t>Ze||$t<Je&&Ct>Ze)&&(st=!0)}}function fe(yt){var Ut=yt[ie+0],Dt=yt[ie+2],Ct=yt[ie+4],Wt=yt[ie+6];if(Ye<=W(Ut,Dt,Ct,Wt)&&Ye>=Y(Ut,Dt,Ct,Wt)){for(var Kt,$t=yt[se+0],Ft=yt[se+2],Gt=yt[se+4],Nt=yt[se+6],hr=Ze>W($t,Ft,Gt,Nt)||Je<Y($t,Ft,Gt,Nt)?[yt]:ue.getMonoCurves(yt,A),rr=0,zr=hr.length;rr<zr;rr++)if(Kt=te(hr[rr]))return Kt}}for(var S,de,se=A?1:0,ie=1^se,ge=[G.x,G.y],Pe=ge[se],Ye=ge[ie],Ge=1e-6,Ze=Pe-1e-9,Je=Pe+1e-9,tt=0,nt=0,at=0,ut=0,st=!1,gt=!1,ft=1,ct=[],_t=0,Et=X.length;_t<Et;_t++){var mt,vt=X[_t],lt=vt._path,St=vt.getValues();if(!(_t&&X[_t-1]._path===lt||(S=null,lt._closed||(de=ue.getValues(lt.getLastCurve().getSegment2(),vt.getSegment1(),null,!N))[ie]!==de[ie+6]&&(S=de),S))){S=St;for(var Rt=lt.getLastCurve();Rt&&Rt!==vt;){var Bt=Rt.getValues();if(Bt[ie]!==Bt[ie+6]){S=Bt;break}Rt=Rt.getPrevious()}}if(mt=fe(St))return mt;if(_t+1===Et||X[_t+1]._path!==lt){if(de&&(mt=fe(de)))return mt;!st||at||ut||(at=ut=lt.isClockwise(N)^A?1:-1),tt+=at,nt+=ut,at=ut=0,st&&(gt=!0,st=!1),de=null}}return tt=F(tt),nt=F(nt),{winding:W(tt,nt),windingL:tt,windingR:nt,quality:ft,onPath:gt}}function k(G,X,A,N,I){var te=[],fe=G,S=0;do ge=(Je=G.getCurve()).getLength(),te.push({segment:G,curve:Je,length:ge}),S+=ge,G=G.getNext();while(G&&!G._intersection&&G!==fe);for(var de=[.5,.25,.75],se={winding:0,quality:-1},ie=0;ie<de.length&&se.quality<.5;ie++)for(var ge=S*de[ie],Pe=0,Ye=te.length;Pe<Ye;Pe++){var Ge=te[Pe],Ze=Ge.length;if(ge<=Ze){var Je=Ge.curve,tt=Je._path,nt=tt._parent,at=nt instanceof _e?nt:tt,ut=c.clamp(Je.getTimeAt(ge),1e-8,1-1e-8),st=Je.getPointAtTime(ut),gt=F(Je.getTangentAtTime(ut).y)<Math.SQRT1_2,ft=I.subtract&&A&&(at===X&&A._getWinding(st,gt,!0).winding||at===A&&!X._getWinding(st,gt,!0).winding)?{winding:0,quality:1}:D(st,N,gt,!0);ft.quality>se.quality&&(se=ft);break}ge-=Ze}for(Pe=te.length-1;Pe>=0;Pe--)te[Pe].segment._winding=se}function Z(G,X){function A(mt){var vt;return!(!mt||mt._visited||X&&(!X[(vt=mt._winding||{}).winding]||X.unite&&vt.winding===2&&vt.windingL&&vt.windingR))}function N(mt){if(mt){for(var vt=0,lt=te.length;vt<lt;vt++)if(mt===te[vt])return!0}return!1}function I(mt){for(var vt=mt._segments,lt=0,St=vt.length;lt<St;lt++)vt[lt]._visited=!0}var te,fe=[];G.sort(function(mt,vt){var lt=mt._intersection,St=vt._intersection,Rt=!(!lt||!lt._overlap),Bt=!(!St||!St._overlap),yt=mt._path,Ut=vt._path;return Rt^Bt?Rt?1:-1:!lt^!St?lt?1:-1:yt!==Ut?yt._id-Ut._id:mt._index-vt._index});for(var S=0,de=G.length;S<de;S++){var se,ie,ge,Pe=G[S],Ye=A(Pe),Ge=null,Ze=!1,Je=!0,tt=[];if(Ye&&Pe._path._overlapsOnly){var nt=Pe._path,at=Pe._intersection._segment._path;nt.compare(at)&&(nt.getArea()&&fe.push(nt.clone(!1)),I(nt),I(at),Ye=!1)}for(;Ye;){var ut=!Ge,st=function(mt,vt){function lt(yt,Ut){for(;yt&&yt!==Ut;){var Dt=yt._segment,Ct=Dt&&Dt._path;if(Ct){var Wt=Dt.getNext()||Ct.getFirstSegment(),Kt=Wt._intersection;Dt!==mt&&(N(Dt)||N(Wt)||Wt&&A(Dt)&&(A(Wt)||Kt&&A(Kt._segment)))&&Bt.push(Dt),vt&&te.push(Dt)}yt=yt._next}}var St=mt._intersection,Rt=St,Bt=[];if(vt&&(te=[mt]),St){for(lt(St);St&&St._prev;)St=St._prev;lt(St,Rt)}return Bt}(Pe,ut),gt=st.shift(),ft=!(Ze=!ut&&(N(Pe)||N(gt)))&>if(ut&&(Ge=new ne(Q.NO_INSERT),se=null),Ze){(Pe.isFirst()||Pe.isLast())&&(Je=Pe._path._closed),Pe._visited=!0;break}if(ft&&se&&(tt.push(se),se=null),se||(ft&&st.push(Pe),se={start:Ge._segments.length,crossings:st,visited:ie=[],handleIn:ge}),ft&&(Pe=gt),!A(Pe)){Ge.removeSegments(se.start);for(var ct=0,_t=ie.length;ct<_t;ct++)ie[ct]._visited=!1;ie.length=0;do(Pe=se&&se.crossings.shift())&&Pe._path||(Pe=null,(se=tt.pop())&&(ie=se.visited,ge=se.handleIn));while(se&&!A(Pe));if(!Pe)break}var Et=Pe.getNext();Ge.add(new oe(Pe._point,ge,Et&&Pe._handleOut)),Pe._visited=!0,ie.push(Pe),Pe=Et||Pe._path.getFirstSegment(),ge=Et&&Et._handleIn}Ze&&(Je&&(Ge.getFirstSegment().setHandleIn(ge),Ge.setClosed(Je)),Ge.getArea()!==0&&fe.push(Ge))}return fe}var Y=Math.min,W=Math.max,F=Math.abs,z={unite:{1:!0,2:!0},intersect:{2:!0},subtract:{1:!0},exclude:{1:!0,"-1":!0}};return{_getWinding:function(G,X,A){return D(G,this.getCurves(),X,A)},unite:function(G,X){return d(this,G,"unite",X)},intersect:function(G,X){return d(this,G,"intersect",X)},subtract:function(G,X){return d(this,G,"subtract",X)},exclude:function(G,X){return d(this,G,"exclude",X)},divide:function(G,X){return X&&(X.trace==0||X.stroke)?x(this,G,"divide"):h([this.subtract(G,X),this.intersect(G,X)],!0,this,G,X)},resolveCrossings:function(){function G(Je,tt){var nt=Je&&Je._intersection;return nt&&nt._overlap&&nt._path===tt}var X=this._children,A=X||[this],N=!1,I=!1,te=this.getIntersections(null,function(Je){return Je.hasOverlap()&&(N=!0)||Je.isCrossing()&&(I=!0)}),fe=N&&I&&[];if(te=$.expand(te),N)for(var S=U(te,function(Je){return Je.hasOverlap()},fe),de=S.length-1;de>=0;de--){var se=S[de],ie=se._path,ge=se._segment,Pe=ge.getPrevious(),Ye=ge.getNext();G(Pe,ie)&&G(Ye,ie)&&(ge.remove(),Pe._handleOut._set(0,0),Ye._handleIn._set(0,0),Pe===ge||Pe.getCurve().hasLength()||(Ye._handleIn.set(Pe._handleIn),Pe.remove()))}I&&(U(te,N&&function(Je){var tt=Je.getCurve(),nt=Je.getSegment(),at=Je._intersection,ut=at._curve,st=at._segment;if(tt&&ut&&tt._path&&ut._path)return!0;nt&&(nt._intersection=null),st&&(st._intersection=null)},fe),fe&&C(fe),A=Z(a.each(A,function(Je){this.push.apply(this,Je._segments)},[])));var Ge,Ze=A.length;return Ze>1&&X?(A!==X&&this.setChildren(A),Ge=this):Ze!==1||X||(A[0]!==this&&this.setSegments(A[0].removeSegments()),Ge=this),Ge||((Ge=new _e(Q.NO_INSERT)).addChildren(A),(Ge=Ge.reduce()).copyAttributes(this),this.replaceWith(Ge)),Ge},reorient:function(G,X){var A=this._children;return A&&A.length?this.setChildren(b(this.removeChildren(),function(N){return!!(G?N:1&N)},X)):X!==r&&this.setClockwise(X),this},getInteriorPoint:function(){var G=this.getBounds().getCenter(!0);if(!this.contains(G)){for(var X=this.getCurves(),A=G.y,N=[],I=[],te=0,fe=X.length;te<fe;te++){var S=X[te].getValues(),de=S[1],se=S[3],ie=S[5],ge=S[7];if(A>=Y(de,se,ie,ge)&&A<=W(de,se,ie,ge))for(var Pe=ue.getMonoCurves(S),Ye=0,Ge=Pe.length;Ye<Ge;Ye++){var Ze=Pe[Ye],Je=Ze[1],tt=Ze[7];if(Je!==tt&&(A>=Je&&A<=tt||A>=tt&&A<=Je)){var nt=A===Je?Ze[0]:A===tt?Ze[6]:ue.solveCubic(Ze,1,A,I,0,1)===1?ue.getPoint(Ze,I[0]).x:(Ze[0]+Ze[6])/2;N.push(nt)}}}N.length>1&&(N.sort(function(at,ut){return at-ut}),G.x=(N[0]+N[1])/2)}return G}}});var ae=a.extend({_class:"PathFlattener",initialize:function(t,h,d,x,E){function C(X,A){var N=ue.getValues(X,A,E);D.push(N),b(N,X._index,0,1)}function b(X,A,N,I){if(!(I-N>Y)||x&&ue.isStraight(X)||ue.isFlatEnough(X,h||.25)){var te=X[6]-X[0],fe=X[7]-X[1],S=Math.sqrt(te*te+fe*fe);S>0&&(Z+=S,k.push({offset:Z,curve:X,index:A,time:I}))}else{var de=ue.subdivide(X,.5),se=(N+I)/2;b(de[0],A,N,se),b(de[1],A,se,I)}}for(var U,D=[],k=[],Z=0,Y=1/(d||32),W=t._segments,F=W[0],z=1,G=W.length;z<G;z++)C(F,U=W[z]),F=U;t._closed&&C(U,W[0]),this.curves=D,this.parts=k,this.length=Z,this.index=0},_get:function(t){for(var h,d=this.parts,x=d.length,E=this.index;h=E,E&&!(d[--E].offset<t););for(;h<x;h++){var C=d[h];if(C.offset>=t){this.index=h;var b=d[h-1],U=b&&b.index===C.index?b.time:0,D=b?b.offset:0;return{index:C.index,time:U+(C.time-U)*(t-D)/(C.offset-D)}}}return{index:d[x-1].index,time:1}},drawPart:function(t,h,d){for(var x=this._get(h),E=this._get(d),C=x.index,b=E.index;C<=b;C++){var U=ue.getPart(this.curves[C],C===x.index?x.time:0,C===E.index?E.time:1);C===x.index&&t.moveTo(U[0],U[1]),t.bezierCurveTo.apply(t,U.slice(2))}}},a.each(ue._evaluateMethods,function(t){this[t+"At"]=function(h){var d=this._get(h);return ue[t](this.curves[d.index],d.time)}},{})),Me=a.extend({initialize:function(t){for(var h,d=this.points=[],x=t._segments,E=t._closed,C=0,b=x.length;C<b;C++){var U=x[C].point;h&&h.equals(U)||d.push(h=U.clone())}E&&(d.unshift(d[d.length-1]),d.push(d[1])),this.closed=E},fit:function(t){var h=this.points,d=h.length,x=null;return d>0&&(x=[new oe(h[0])],d>1&&(this.fitCubic(x,t,0,d-1,h[1].subtract(h[0]),h[d-2].subtract(h[d-1])),this.closed&&(x.shift(),x.pop()))),x},fitCubic:function(t,h,d,x,E,C){var b=this.points;if(x-d!=1){for(var U,D=this.chordLengthParameterize(d,x),k=Math.max(h,h*h),Z=!0,Y=0;Y<=4;Y++){var W=this.generateBezier(d,x,D,E,C),F=this.findMaxError(d,x,W,D);if(F.error<h&&Z)return void this.addCurve(t,W);if(U=F.index,F.error>=k)break;Z=this.reparameterize(d,x,D,W),k=F.error}var z=b[U-1].subtract(b[U+1]);this.fitCubic(t,h,d,U,E,z),this.fitCubic(t,h,U,x,z.negate(),C)}else{var G=b[d],X=b[x],A=G.getDistance(X)/3;this.addCurve(t,[G,G.add(E.normalize(A)),X.add(C.normalize(A)),X])}},addCurve:function(t,h){t[t.length-1].setHandleOut(h[1].subtract(h[0])),t.push(new oe(h[3],h[2].subtract(h[3])))},generateBezier:function(t,h,d,x,E){for(var C=Math.abs,b=this.points,U=b[t],D=b[h],k=[[0,0],[0,0]],Z=[0,0],Y=0,W=h-t+1;Y<W;Y++){var F=d[Y],z=1-F,G=3*F*z,X=z*z*z,A=G*z,N=G*F,I=F*F*F,te=x.normalize(A),fe=E.normalize(N),S=b[t+Y].subtract(U.multiply(X+A)).subtract(D.multiply(N+I));k[0][0]+=te.dot(te),k[0][1]+=te.dot(fe),k[1][0]=k[0][1],k[1][1]+=fe.dot(fe),Z[0]+=te.dot(S),Z[1]+=fe.dot(S)}var de,se,ie=k[0][0]*k[1][1]-k[1][0]*k[0][1];if(C(ie)>1e-12){var ge=k[0][0]*Z[1]-k[1][0]*Z[0];de=(Z[0]*k[1][1]-Z[1]*k[0][1])/ie,se=ge/ie}else{var Pe=k[0][0]+k[0][1],Ye=k[1][0]+k[1][1];de=se=C(Pe)>1e-12?Z[0]/Pe:C(Ye)>1e-12?Z[1]/Ye:0}var Ge,Ze,Je=D.getDistance(U),tt=1e-12*Je;if(de<tt||se<tt)de=se=Je/3;else{var nt=D.subtract(U);Ge=x.normalize(de),Ze=E.normalize(se),Ge.dot(nt)-Ze.dot(nt)>Je*Je&&(de=se=Je/3,Ge=Ze=null)}return[U,U.add(Ge||x.normalize(de)),D.add(Ze||E.normalize(se)),D]},reparameterize:function(t,h,d,x){for(E=t;E<=h;E++)d[E-t]=this.findRoot(x,this.points[E],d[E-t]);for(var E=1,C=d.length;E<C;E++)if(d[E]<=d[E-1])return!1;return!0},findRoot:function(t,h,d){for(var x=[],E=[],C=0;C<=2;C++)x[C]=t[C+1].subtract(t[C]).multiply(3);for(C=0;C<=1;C++)E[C]=x[C+1].subtract(x[C]).multiply(2);var b=this.evaluate(3,t,d),U=this.evaluate(2,x,d),D=this.evaluate(1,E,d),k=b.subtract(h),Z=U.dot(U)+k.dot(D);return c.isZero(Z)?d:d-k.dot(U)/Z},evaluate:function(t,h,d){for(var x=h.slice(),E=1;E<=t;E++)for(var C=0;C<=t-E;C++)x[C]=x[C].multiply(1-d).add(x[C+1].multiply(d));return x[0]},chordLengthParameterize:function(t,h){for(var d=[0],x=t+1;x<=h;x++)d[x-t]=d[x-t-1]+this.points[x].getDistance(this.points[x-1]);for(var x=1,E=h-t;x<=E;x++)d[x]/=d[E];return d},findMaxError:function(t,h,d,x){for(var E=Math.floor((h-t+1)/2),C=0,b=t+1;b<h;b++){var U=this.evaluate(3,d,x[b-t]).subtract(this.points[b]),D=U.x*U.x+U.y*U.y;D>=C&&(C=D,E=b)}return{error:C,index:E}}}),Ne=Q.extend({_class:"TextItem",_applyMatrix:!1,_canApplyMatrix:!1,_serializeFields:{content:null},_boundsOptions:{stroke:!1,handle:!1},initialize:function(t){this._content="",this._lines=[];var h=t&&a.isPlainObject(t)&&t.x===r&&t.y===r;this._initialize(h&&t,!h&&f.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"}),Ae=Ne.extend({_class:"PointText",initialize:function(){Ne.apply(this,arguments)},getPoint:function(){var t=this._matrix.getTranslation();return new g(t.x,t.y,this,"setPoint")},setPoint:function(){var t=f.read(arguments);this.translate(t.subtract(this._matrix.getTranslation()))},_draw:function(t,h,d){if(this._content){this._setStyles(t,h,d);var x=this._lines,E=this._style,C=E.hasFill(),b=E.hasStroke(),U=E.getLeading(),D=t.shadowColor;t.font=E.getFontStyle(),t.textAlign=E.getJustification();for(var k=0,Z=x.length;k<Z;k++){t.shadowColor=D;var Y=x[k];C&&(t.fillText(Y,0,0),t.shadowColor="rgba(0,0,0,0)"),b&&t.strokeText(Y,0,0),t.translate(0,U)}}},_getBounds:function(t,h){var d=this._style,x=this._lines,E=x.length,C=d.getJustification(),b=d.getLeading(),U=this.getView().getTextWidth(d.getFontStyle(),x),D=0;C!=="left"&&(D-=U/(C==="center"?2:1));var k=new M(D,E?-.75*b:0,U,E*b);return t?t._transformBounds(k,k):k}}),Fe=a.extend(new function(){function t(U){var D,k=U.match(/^#(\w{1,2})(\w{1,2})(\w{1,2})$/);if(k)for(D=[0,0,0],Z=0;Z<3;Z++)W=k[Z+1],D[Z]=parseInt(W.length==1?W+W:W,16)/255;else if(k=U.match(/^rgba?\((.*)\)$/))for(var Z=0,Y=(D=k[1].split(",")).length;Z<Y;Z++){var W=+D[Z];D[Z]=Z<3?W/255:W}else if(s){var F=E[U];if(!F){h||((h=Oe.getContext(1,1)).globalCompositeOperation="copy"),h.fillStyle="rgba(0,0,0,0)",h.fillStyle=U,h.fillRect(0,0,1,1);var z=h.getImageData(0,0,1,1).data;F=E[U]=[z[0]/255,z[1]/255,z[2]/255]}D=F.slice()}else D=[0,0,0];return D}var h,d={gray:["gray"],rgb:["red","green","blue"],hsb:["hue","saturation","brightness"],hsl:["hue","saturation","lightness"],gradient:["gradient","origin","destination","highlight"]},x={},E={},C=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]],b={"rgb-hsb":function(U,D,k){var Z=Math.max(U,D,k),Y=Z-Math.min(U,D,k);return[Y===0?0:60*(Z==U?(D-k)/Y+(D<k?6:0):Z==D?(k-U)/Y+2:(U-D)/Y+4),Z===0?0:Y/Z,Z]},"hsb-rgb":function(U,D,k){U=(U/60%6+6)%6;var Z=Math.floor(U),Y=U-Z,W=[k,k*(1-D),k*(1-D*Y),k*(1-D*(1-Y))];return[W[(Z=C[Z])[0]],W[Z[1]],W[Z[2]]]},"rgb-hsl":function(U,D,k){var Z=Math.max(U,D,k),Y=Math.min(U,D,k),W=Z-Y,F=W===0,z=(Z+Y)/2;return[F?0:60*(Z==U?(D-k)/W+(D<k?6:0):Z==D?(k-U)/W+2:(U-D)/W+4),F?0:z<.5?W/(Z+Y):W/(2-Z-Y),z]},"hsl-rgb":function(U,D,k){if(U=(U/360%1+1)%1,D===0)return[k,k,k];for(var Z=[U+1/3,U,U-1/3],Y=k<.5?k*(1+D):k+D-k*D,W=2*k-Y,F=[],z=0;z<3;z++){var G=Z[z];G<0&&(G+=1),G>1&&(G-=1),F[z]=6*G<1?W+6*(Y-W)*G:2*G<1?Y:3*G<2?W+(Y-W)*(2/3-G)*6:W}return F},"rgb-gray":function(U,D,k){return[.2989*U+.587*D+.114*k]},"gray-rgb":function(U){return[U,U,U]},"gray-hsb":function(U){return[0,0,U]},"gray-hsl":function(U){return[0,0,U]},"gradient-rgb":function(){return[]},"rgb-gradient":function(){return[]}};return a.each(d,function(U,D){x[D]=[],a.each(U,function(k,Z){var Y=a.capitalize(k),W=/^(hue|saturation)$/.test(k),F=x[D][Z]=k==="gradient"?function(z){var G=this._components[0];return z=De.read(Array.isArray(z)?z:arguments,0,{readNull:!0}),G!==z&&(G&&G._removeOwner(this),z&&z._addOwner(this)),z}:D==="gradient"?function(){return f.read(arguments,0,{readNull:k==="highlight",clone:!0})}:function(z){return z==null||isNaN(z)?0:z};this["get"+Y]=function(){return this._type===D||W&&/^hs[bl]$/.test(this._type)?this._components[Z]:this._convert(D)[Z]},this["set"+Y]=function(z){this._type===D||W&&/^hs[bl]$/.test(this._type)||(this._components=this._convert(D),this._properties=d[D],this._type=D),this._components[Z]=F.call(this,z),this._changed()}},this)},{_class:"Color",_readIndex:!0,initialize:function U(D){var k,Z,Y,W,F=arguments,z=this.__read,G=0;Array.isArray(D)&&(D=(F=D)[0]);var X=D!=null&&typeof D;if(X==="string"&&D in d&&(k=D,D=F[1],Array.isArray(D)?(Z=D,Y=F[2]):(z&&(G=1),F=a.slice(F,1),X=typeof D)),!Z){if(W=X==="number"?F:X==="object"&&D.length!=null?D:null){k||(k=W.length>=3?"rgb":"gray");var A=d[k].length;Y=W[A],z&&(G+=W===arguments?A+(Y!=null?1:0):1),W.length>A&&(W=a.slice(W,0,A))}else if(X==="string")k="rgb",(Z=t(D)).length===4&&(Y=Z[3],Z.length--);else if(X==="object")if(D.constructor===U){if(k=D._type,Z=D._components.slice(),Y=D._alpha,k==="gradient")for(var N=1,I=Z.length;N<I;N++){var te=Z[N];te&&(Z[N]=te.clone())}}else if(D.constructor===De)k="gradient",W=F;else{var fe=d[k="hue"in D?"lightness"in D?"hsl":"hsb":"gradient"in D||"stops"in D||"radial"in D?"gradient":"gray"in D?"gray":"rgb"],S=x[k];this._components=Z=[];for(var N=0,I=fe.length;N<I;N++)(de=D[fe[N]])==null&&!N&&k==="gradient"&&"stops"in D&&(de={stops:D.stops,radial:D.radial}),(de=S[N].call(this,de))!=null&&(Z[N]=de);Y=D.alpha}z&&k&&(G=1)}if(this._type=k||"rgb",!Z){this._components=Z=[];for(var N=0,I=(S=x[this._type]).length;N<I;N++){var de=S[N].call(this,W&&W[N]);de!=null&&(Z[N]=de)}}return this._components=Z,this._properties=d[this._type],this._alpha=Y,z&&(this.__read=G),this},set:"#initialize",_serialize:function(U,D){var k=this.getComponents();return a.serialize(/^(gray|rgb)$/.test(this._type)?k:[this._type].concat(k),U,!0,D)},_changed:function(){this._canvasStyle=null,this._owner&&this._owner._changed(65)},_convert:function(U){var D;return this._type===U?this._components.slice():(D=b[this._type+"-"+U])?D.apply(this,this._components):b["rgb-"+U].apply(this,b[this._type+"-rgb"].apply(this,this._components))},convert:function(U){return new Fe(U,this._convert(U),this._alpha)},getType:function(){return this._type},setType:function(U){this._components=this._convert(U),this._properties=d[U],this._type=U},getComponents:function(){var U=this._components.slice();return this._alpha!=null&&U.push(this._alpha),U},getAlpha:function(){return this._alpha!=null?this._alpha:1},setAlpha:function(U){this._alpha=U==null?null:Math.min(Math.max(U,0),1),this._changed()},hasAlpha:function(){return this._alpha!=null},equals:function(U){var D=a.isPlainValue(U,!0)?Fe.read(arguments):U;return D===this||D&&this._class===D._class&&this._type===D._type&&this.getAlpha()===D.getAlpha()&&a.equals(this._components,D._components)||!1},toString:function(){for(var U=this._properties,D=[],k=this._type==="gradient",Z=p.instance,Y=0,W=U.length;Y<W;Y++){var F=this._components[Y];F!=null&&D.push(U[Y]+": "+(k?F:Z.number(F)))}return this._alpha!=null&&D.push("alpha: "+Z.number(this._alpha)),"{ "+D.join(", ")+" }"},toCSS:function(U){function D(Y){return Math.round(255*(Y<0?0:Y>1?1:Y))}var k=this._convert("rgb"),Z=U||this._alpha==null?1:this._alpha;return k=[D(k[0]),D(k[1]),D(k[2])],Z<1&&k.push(Z<0?0:Z),U?"#"+((1<<24)+(k[0]<<16)+(k[1]<<8)+k[2]).toString(16).slice(1):(k.length==4?"rgba(":"rgb(")+k.join(",")+")"},toCanvasStyle:function(U,D){if(this._canvasStyle)return this._canvasStyle;if(this._type!=="gradient")return this._canvasStyle=this.toCSS();var k,Z=this._components,Y=Z[0],W=Y._stops,F=Z[1],z=Z[2],G=Z[3],X=D&&D.inverted();if(X&&(F=X._transformPoint(F),z=X._transformPoint(z),G&&(G=X._transformPoint(G))),Y._radial){var A=z.getDistance(F);if(G){var N=G.subtract(F);N.getLength()>A&&(G=F.add(N.normalize(A-.1)))}var I=G||F;k=U.createRadialGradient(I.x,I.y,0,F.x,F.y,A)}else k=U.createLinearGradient(F.x,F.y,z.x,z.y);for(var te=0,fe=W.length;te<fe;te++){var S=W[te],de=S._offset;k.addColorStop(de==null?te/(fe-1):de,S._color.toCanvasStyle())}return this._canvasStyle=k},transform:function(U){if(this._type==="gradient"){for(var D=this._components,k=1,Z=D.length;k<Z;k++){var Y=D[k];U._transformPoint(Y,Y,!0)}this._changed()}},statics:{_types:d,random:function(){var U=Math.random;return new Fe(U(),U(),U())}}})},new function(){var t={add:function(h,d){return h+d},subtract:function(h,d){return h-d},multiply:function(h,d){return h*d},divide:function(h,d){return h/d}};return a.each(t,function(h,d){this[d]=function(x){x=Fe.read(arguments);for(var E=this._type,C=this._components,b=x._convert(E),U=0,D=C.length;U<D;U++)b[U]=h(C[U],b[U]);return new Fe(E,b,this._alpha!=null?h(this._alpha,x.getAlpha()):null)}},{})}),De=a.extend({_class:"Gradient",initialize:function(t,h){this._id=_.get(),t&&a.isPlainObject(t)&&(this.set(t),t=h=null),this._stops==null&&this.setStops(t||["white","black"]),this._radial==null&&this.setRadial(typeof h=="string"&&h==="radial"||h||!1)},_serialize:function(t,h){return h.add(this,function(){return a.serialize([this._stops,this._radial],t,!0,h)})},_changed:function(){for(var t=0,h=this._owners&&this._owners.length;t<h;t++)this._owners[t]._changed()},_addOwner:function(t){this._owners||(this._owners=[]),this._owners.push(t)},_removeOwner:function(t){var h=this._owners?this._owners.indexOf(t):-1;h!=-1&&(this._owners.splice(h,1),this._owners.length||(this._owners=r))},clone:function(){for(var t=[],h=0,d=this._stops.length;h<d;h++)t[h]=this._stops[h].clone();return new De(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 h=this._stops;if(h)for(var d=0,x=h.length;d<x;d++)h[d]._owner=r;for(var d=0,x=(h=this._stops=ze.readList(t,0,{clone:!0})).length;d<x;d++)h[d]._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 h=this._stops,d=t._stops,x=h.length;if(x===d.length){for(var E=0;E<x;E++)if(!h[E].equals(d[E]))return!1;return!0}}return!1}}),ze=a.extend({_class:"GradientStop",initialize:function(t,h){var d=t,x=h;typeof t=="object"&&h===r&&(Array.isArray(t)&&typeof t[0]!="number"?(d=t[0],x=t[1]):("color"in t||"offset"in t||"rampPoint"in t)&&(d=t.color,x=t.offset||t.rampPoint||0)),this.setColor(d),this.setOffset(x)},clone:function(){return new ze(this._color.clone(),this._offset)},_serialize:function(t,h){var d=this._color,x=this._offset;return a.serialize(x==null?[d]:[d,x],t,!0,h)},_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=Fe.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}}),ye=a.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 f,selectedColor:null},h=a.set({},t,{fontFamily:"sans-serif",fontWeight:"normal",fontSize:12,leading:null,justification:"left"}),d=a.set({},h,{fillColor:new Fe}),x={strokeWidth:97,strokeCap:97,strokeJoin:97,strokeScaling:105,miterLimit:97,fontFamily:9,fontWeight:9,fontSize:9,font:9,leading:9,justification:9},E={beans:!0},C={_class:"Style",beans:!0,initialize:function(b,U,D){this._values={},this._owner=U,this._project=U&&U._project||D||paper.project,this._defaults=!U||U instanceof q?h:U instanceof Ne?d:t,b&&this.set(b)}};return a.each(h,function(b,U){var D=/Color$/.test(U),k=U==="shadowOffset",Z=a.capitalize(U),Y=x[U],W="set"+Z,F="get"+Z;C[W]=function(z){var G=this._owner,X=G&&G._children;if(X&&X.length>0&&!(G instanceof _e))for(var A=0,N=X.length;A<N;A++)X[A]._style[W](z);else if(U in this._defaults){var I=this._values[U];I!==z&&(D&&(I&&I._owner!==r&&(I._owner=r),z&&z.constructor===Fe&&(z._owner&&(z=z.clone()),z._owner=G)),this._values[U]=z,G&&G._changed(Y||65))}},C[F]=function(z){var G,X=this._owner,A=X&&X._children;if(U in this._defaults&&(!A||!A.length||z||X instanceof _e))if((G=this._values[U])===r)(G=this._defaults[U])&&G.clone&&(G=G.clone());else{var N=D?Fe:k?f:null;!N||G&&G.constructor===N||(this._values[U]=G=N.read([G],0,{readNull:!0,clone:!0}),G&&D&&(G._owner=X))}else if(A)for(var I=0,te=A.length;I<te;I++){var fe=A[I]._style[F]();if(I){if(!a.equals(G,fe))return r}else G=fe}return G},E[F]=function(z){return this._style[F](z)},E[W]=function(z){this._style[W](z)}}),a.each({Font:"FontFamily",WindingRule:"FillRule"},function(b,U){var D="get"+U,k="set"+U;C[D]=E[D]="#get"+b,C[k]=E[k]="#set"+b}),Q.inject(E),C},{set:function(t){var h=t instanceof ye,d=h?t._values:t;if(d){for(var x in d)if(x in this._defaults){var E=d[x];this[x]=E&&h&&E.clone?E.clone():E}}},equals:function(t){function h(d,x,E){var C=d._values,b=x._values,U=x._defaults;for(var D in C){var k=C[D],Z=b[D];if(!(E&&D in b||a.equals(k,Z===r?U[D]:Z)))return!1}return!0}return t===this||t&&this._class===t._class&&h(this,t)&&h(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 h=t.base.call(this),d=this.getFontSize();return/pt|em|%|px/.test(d)&&(d=this.getView().getPixelSize(d)),h!=null?h:1.2*d}}),he=new function(){function t(h,d,x,E){for(var C=["","webkit","moz","Moz","ms","o"],b=d[0].toUpperCase()+d.substring(1),U=0;U<6;U++){var D=C[U],k=D?D+b:d;if(k in h){if(!x)return h[k];h[k]=E;break}}}return{getStyles:function(h){var d=h&&h.nodeType!==9?h.ownerDocument:h,x=d&&d.defaultView;return x&&x.getComputedStyle(h,"")},getBounds:function(h,d){var x,E=h.ownerDocument,C=E.body,b=E.documentElement;try{x=h.getBoundingClientRect()}catch(Z){x={left:0,top:0,width:0,height:0}}var U=x.left-(b.clientLeft||C.clientLeft||0),D=x.top-(b.clientTop||C.clientTop||0);if(!d){var k=E.defaultView;U+=k.pageXOffset||b.scrollLeft||C.scrollLeft,D+=k.pageYOffset||b.scrollTop||C.scrollTop}return new M(U,D,x.width,x.height)},getViewportBounds:function(h){var d=h.ownerDocument,x=d.defaultView,E=d.documentElement;return new M(0,0,x.innerWidth||E.clientWidth,x.innerHeight||E.clientHeight)},getOffset:function(h,d){return he.getBounds(h,d).getPoint()},getSize:function(h){return he.getBounds(h,!0).getSize()},isInvisible:function(h){return he.getSize(h).equals(new y(0,0))},isInView:function(h){return!he.isInvisible(h)&&he.getViewportBounds(h).intersects(he.getBounds(h,!0))},isInserted:function(h){return o.body.contains(h)},getPrefixed:function(h,d){return h&&t(h,d)},setPrefixed:function(h,d,x){if(typeof d=="object")for(var E in d)t(h,E,!0,d[E]);else t(h,d,!0,x)}}},ke={add:function(t,h){if(t)for(var d in h)for(var x=h[d],E=d.split(/[\s,]+/g),C=0,b=E.length;C<b;C++)t.addEventListener(E[C],x,!1)},remove:function(t,h){if(t)for(var d in h)for(var x=h[d],E=d.split(/[\s,]+/g),C=0,b=E.length;C<b;C++)t.removeEventListener(E[C],x,!1)},getPoint:function(t){var h=t.targetTouches?t.targetTouches.length?t.targetTouches[0]:t.changedTouches[0]:t;return new f(h.pageX||h.clientX+o.documentElement.scrollLeft,h.pageY||h.clientY+o.documentElement.scrollTop)},getTarget:function(t){return t.target||t.srcElement},getRelatedTarget:function(t){return t.relatedTarget||t.toElement},getOffset:function(t,h){return ke.getPoint(t).subtract(he.getOffset(h||ke.getTarget(t)))}};ke.requestAnimationFrame=new function(){function t(){var C=E;E=[];for(var b=0,U=C.length;b<U;b++)C[b]();(x=d&&E.length)&&d(t)}var h,d=he.getPrefixed(s,"requestAnimationFrame"),x=!1,E=[];return function(C){E.push(C),d?x||(d(t),x=!0):h||(h=setInterval(t,1e3/60))}};var le=a.extend(u,{_class:"View",initialize:function t(h,d){function x(Z){return d[Z]||parseInt(d.getAttribute(Z),10)}function E(){var Z=he.getSize(d);return Z.isNaN()||Z.isZero()?new y(x("width"),x("height")):Z}var C;if(s&&d){if(this._id=d.getAttribute("id"),this._id==null&&d.setAttribute("id",this._id="view-"+t._id++),ke.add(d,this._viewEvents),he.setPrefixed(d.style,{userDrag:"none",userSelect:"none",touchCallout:"none",contentZooming:"none",tapHighlightColor:"rgba(0,0,0,0)"}),l.hasAttribute(d,"resize")){var b=this;ke.add(s,this._windowEvents={resize:function(){b.setViewSize(E())}})}if(C=E(),l.hasAttribute(d,"stats")&&typeof Stats!="undefined"){this._stats=new Stats;var U=this._stats.domElement,D=U.style,k=he.getOffset(d);D.position="absolute",D.left=k.x+"px",D.top=k.y+"px",o.body.appendChild(U)}}else C=new y(d),d=null;this._project=h,this._scope=h._scope,this._element=d,this._pixelRatio||(this._pixelRatio=s&&s.devicePixelRatio||1),this._setElementSize(C.width,C.height),this._viewSize=C,t._views.push(this),t._viewsById[this._id]=this,(this._matrix=new B)._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;le._focused===this&&(le._focused=null),le._views.splice(le._views.indexOf(this),1),delete le._viewsById[this._id];var t=this._project;return t._view===this&&(t._view=null),ke.remove(this._element,this._viewEvents),ke.remove(s,this._windowEvents),this._element=this._project=null,this.off("frame"),this._animate=!1,this._frameItems={},!0},_events:a.each(Q._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;ke.requestAnimationFrame(function(){if(t._requested=!1,t._animate){t.requestUpdate();var h=t._element;he.getPrefixed(o,"hidden")&&l.getAttribute(h,"keepalive")!=="true"||!he.isInView(h)||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,h=this._last?t-this._last:0;this._last=t,this.emit("frame",new a({delta:h,time:this._time+=h,count:this._count++})),this._stats&&this._stats.update()},_animateItem:function(t,h){var d=this._frameItems;h?(d[t._id]={item:t,time:0,count:0},++this._frameItemCount==1&&this.on("frame",this._handleFrameItems)):(delete d[t._id],--this._frameItemCount==0&&this.off("frame",this._handleFrameItems))},_handleFrameItems:function(t){for(var h in this._frameItems){var d=this._frameItems[h];d.item.emit("frame",new a(t,{time:d.time+=t.delta,count:d.count++}))}},_changed:function(){this._project._changed(2049),this._bounds=this._decomposed=r},getElement:function(){return this._element},getPixelRatio:function(){return this._pixelRatio},getResolution:function(){return 72*this._pixelRatio},getViewSize:function(){var t=this._viewSize;return new w(t.width,t.height,this,"setViewSize")},setViewSize:function(){var t=y.read(arguments),h=t.subtract(this._viewSize);h.isZero()||(this._setElementSize(t.width,t.height),this._viewSize.set(t),this._changed(),this.emit("resize",{size:t,delta:h}),this._autoUpdate&&this.update())},_setElementSize:function(t,h){var d=this._element;d&&(d.width!==t&&(d.width=t),d.height!==h&&(d.height=h))},getBounds:function(){return this._bounds||(this._bounds=this._matrix.inverted()._transformBounds(new M(new f,this._viewSize))),this._bounds},getSize:function(){return this.getBounds().getSize()},isVisible:function(){return he.isInView(this._element)},isInserted:function(){return he.isInserted(this._element)},getPixelSize:function(t){var h,d=this._element;if(d){var x=d.parentNode,E=o.createElement("div");E.style.fontSize=t,x.appendChild(E),h=parseFloat(he.getStyles(E).fontSize),x.removeChild(E)}else h=parseFloat(h);return h},getTextWidth:function(t,h){return 0}},a.each(["rotate","scale","shear","skew"],function(t){var h=t==="rotate";this[t]=function(){var d=(h?a:f).read(arguments),x=f.read(arguments,0,{readNull:!0});return this.transform(new B()[t](d,x||this.getCenter(!0)))}},{_decompose:function(){return this._decomposed||(this._decomposed=this._matrix.decompose())},translate:function(){var t=new B;return this.transform(t.translate.apply(t,arguments))},getCenter:function(){return this.getBounds().getCenter()},setCenter:function(){var t=f.read(arguments);this.translate(this.getCenter().subtract(t))},getZoom:function(){var t=this._decompose(),h=t&&t.scaling;return h?(h.x+h.y)/2:0},setZoom:function(t){this.transform(new B().scale(t/this.getZoom(),this.getCenter()))},getRotation:function(){var t=this._decompose();return t&&t.rotation},setRotation:function(t){var h=this.getRotation();h!=null&&t!=null&&this.rotate(t-h)},getScaling:function(){var t=this._decompose(),h=t&&t.scaling;return h?new g(h.x,h.y,this,"setScaling"):r},setScaling:function(){var t=this.getScaling(),h=f.read(arguments,0,{clone:!0,readNull:!0});t&&h&&this.scale(h.x/t.x,h.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(f.read(arguments).negate())}}),{projectToView:function(){return this._matrix._transformPoint(f.read(arguments))},viewToProject:function(){return this._matrix._inverseTransform(f.read(arguments))},getEventPoint:function(t){return this.viewToProject(ke.getOffset(t,this._element))}},{statics:{_views:[],_viewsById:{},_id:0,create:function(t,h){return o&&typeof h=="string"&&(h=o.getElementById(h)),new(s?Ce:le)(t,h)}}},new function(){function t(Ge){var Ze=ke.getTarget(Ge);return Ze.getAttribute&&le._viewsById[Ze.getAttribute("id")]}function h(){var Ge=le._focused;if(!Ge||!Ge.isVisible()){for(var Ze=0,Je=le._views.length;Ze<Je;Ze++)if((Ge=le._views[Ze]).isVisible()){le._focused=b=Ge;break}}}function d(Ge,Ze,Je){Ge._handleMouseEvent("mousemove",Ze,Je)}function x(Ge,Ze,Je,tt,nt,at,ut){function st(ct,_t){if(ct.responds(_t)){if(gt||(gt=new Ie(_t,tt,nt,Ze||ct,at?nt.subtract(at):null)),ct.emit(_t,gt)&&(se=!0,gt.prevented&&(ie=!0),gt.stopped))return ft=!0}else{var Et=ge[_t];if(Et)return st(ct,Et)}}for(var gt,ft=!1;Ge&&Ge!==ut&&!st(Ge,Je);)Ge=Ge._parent;return ft}function E(Ge,Ze,Je,tt,nt,at){return Ge._project.removeOn(Je),ie=se=!1,te&&x(te,null,Je,tt,nt,at)||Ze&&Ze!==te&&!Ze.isDescendant(te)&&x(Ze,null,Je,tt,nt,at,te)||x(Ge,te||Ze||Ge,Je,tt,nt,at)}if(s){var C,b,U,D,k,Z=!1,Y=!1,W=s.navigator;W.pointerEnabled||W.msPointerEnabled?(U="pointerdown MSPointerDown",D="pointermove MSPointerMove",k="pointerup pointercancel MSPointerUp MSPointerCancel"):(U="touchstart",D="touchmove",k="touchend touchcancel","ontouchstart"in s&&W.userAgent.match(/mobile|tablet|ip(ad|hone|od)|android|silk/i)||(U+=" mousedown",D+=" mousemove",k+=" mouseup"));var F={},z={mouseout:function(Ge){var Ze=le._focused,Je=ke.getRelatedTarget(Ge);if(Ze&&(!Je||Je.nodeName==="HTML")){var tt=ke.getOffset(Ge,Ze._element),nt=tt.x,at=Math.abs,ut=at(nt),st=ut-(1<<25);tt.x=at(st)<ut?st*(nt<0?-1:1):nt,d(Ze,Ge,Ze.viewToProject(tt))}},scroll:h};F[U]=function(Ge){var Ze=le._focused=t(Ge);Z||(Z=!0,Ze._handleMouseEvent("mousedown",Ge))},z[D]=function(Ge){var Ze=le._focused;if(!Y){var Je=t(Ge);Je?Ze!==Je&&(Ze&&d(Ze,Ge),C||(C=Ze),Ze=le._focused=b=Je):b&&b===Ze&&(C&&!C.isInserted()&&(C=null),Ze=le._focused=C,C=null,h())}Ze&&d(Ze,Ge)},z[U]=function(){Y=!0},z[k]=function(Ge){var Ze=le._focused;Ze&&Z&&Ze._handleMouseEvent("mouseup",Ge),Y=Z=!1},ke.add(o,z),ke.add(s,{load:h});var G,X,A,N,I,te,fe,S,de,se=!1,ie=!1,ge={doubleclick:"click",mousedrag:"mousemove"},Pe=!1,Ye={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:F,_handleMouseEvent:function(Ge,Ze,Je){function tt(lt){return nt.virtual[lt]||gt.responds(lt)||st&&st.responds(lt)}var nt=this._itemEvents,at=nt.native[Ge],ut=Ge==="mousemove",st=this._scope.tool,gt=this;ut&&Z&&tt("mousedrag")&&(Ge="mousedrag"),Je||(Je=this.getEventPoint(Ze));var ft=this.getBounds().contains(Je),ct=at&&ft&>._project.hitTest(Je,{tolerance:0,fill:!0,stroke:!0}),_t=ct&&ct.item||null,Et=!1,mt={};if(mt[Ge.substr(5)]=!0,at&&_t!==I&&(I&&x(I,null,"mouseleave",Ze,Je),_t&&x(_t,null,"mouseenter",Ze,Je),I=_t),Pe^ft&&(x(this,null,ft?"mouseenter":"mouseleave",Ze,Je),G=ft?this:null,Et=!0),!ft&&!mt.drag||Je.equals(A)||(E(this,_t,ut?Ge:"mousemove",Ze,Je,A),Et=!0),Pe=ft,mt.down&&ft||mt.up&&X){if(E(this,_t,Ge,Ze,Je,X),mt.down){if(de=_t===fe&&Date.now()-S<300,N=fe=_t,!ie&&_t){for(var vt=_t;vt&&!vt.responds("mousedrag");)vt=vt._parent;vt&&(te=_t)}X=Je}else mt.up&&(ie||_t!==N||(S=Date.now(),E(this,_t,de?"doubleclick":"click",Ze,Je,X),de=!1),N=te=null);Pe=!1,Et=!0}A=Je,Et&&st&&(se=st._handleMouseEvent(Ge,Ze,Je,mt)||se),(se&&!mt.move||mt.down&&tt("mouseup"))&&Ze.preventDefault()},_handleKeyEvent:function(Ge,Ze,Je,tt){function nt(gt){gt.responds(Ge)&&(paper=ut,gt.emit(Ge,at=at||new we(Ge,Ze,Je,tt)))}var at,ut=this._scope,st=ut.tool;this.isVisible()&&(nt(this),st&&st.responds(Ge)&&nt(st))},_countItemEvent:function(Ge,Ze){var Je=this._itemEvents,tt=Je.native,nt=Je.virtual;for(var at in Ye)tt[at]=(tt[at]||0)+(Ye[at][Ge]||0)*Ze;nt[Ge]=(nt[Ge]||0)+Ze},statics:{updateFocus:h}}}}),Ce=le.extend({_class:"CanvasView",initialize:function(t,h){if(!(h instanceof s.HTMLCanvasElement)){var d=y.read(arguments,1);if(d.isZero())throw new Error("Cannot create CanvasView with the provided argument: "+a.slice(arguments,1));h=Oe.getCanvas(d)}var x=this._context=h.getContext("2d");if(x.save(),this._pixelRatio=1,!/^off|false$/.test(l.getAttribute(h,"hidpi"))){var E=s.devicePixelRatio||1,C=he.getPrefixed(x,"backingStorePixelRatio")||1;this._pixelRatio=E/C}le.call(this,t,h),this._needsUpdate=!0},remove:function t(){return this._context.restore(),t.base.call(this)},_setElementSize:function t(h,d){var x=this._pixelRatio;if(t.base.call(this,h*x,d*x),x!==1){var E=this._element,C=this._context;if(!l.hasAttribute(E,"resize")){var b=E.style;b.width=h+"px",b.height=d+"px"}C.restore(),C.save(),C.scale(x,x)}},getPixelSize:function t(h){var d,x=paper.agent;if(x&&x.firefox)d=t.base.call(this,h);else{var E=this._context,C=E.font;E.font=h+" serif",d=parseFloat(E.font),E.font=C}return d},getTextWidth:function(t,h){var d=this._context,x=d.font,E=0;d.font=t;for(var C=0,b=h.length;C<b;C++)E=Math.max(E,d.measureText(h[C]).width);return d.font=x,E},update:function(){if(!this._needsUpdate)return!1;var t=this._project,h=this._context,d=this._viewSize;return h.clearRect(0,0,d.width+1,d.height+1),t&&t.draw(h,this._matrix,this._pixelRatio),this._needsUpdate=!1,!0}}),Be=a.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 xe.modifiers}}),we=Be.extend({_class:"KeyEvent",initialize:function(t,h,d,x){this.type=t,this.event=h,this.key=d,this.character=x},toString:function(){return"{ type: '"+this.type+"', key: '"+this.key+"', character: '"+this.character+"', modifiers: "+this.getModifiers()+" }"}}),xe=new function(){function t(k){var Z=k.key||k.keyIdentifier;return Z=/^U\+/.test(Z)?String.fromCharCode(parseInt(Z.substr(2),16)):/^Arrow[A-Z]/.test(Z)?Z.substr(5):Z==="Unidentified"||Z===r?String.fromCharCode(k.keyCode):Z,E[Z]||(Z.length>1?a.hyphenate(Z):Z.toLowerCase())}function h(k,Z,Y,W){var F,z=le._focused;if(b[Z]=k,k?U[Z]=Y:delete U[Z],Z.length>1&&(F=a.camelize(Z))in D){D[F]=k;var G=paper&&paper.agent;if(F==="meta"&&G&&G.mac)if(k)d={};else{for(var X in d)X in U&&h(!1,X,d[X],W);d=null}}else k&&d&&(d[Z]=Y);z&&z._handleKeyEvent(k?"keydown":"keyup",W,Z,Y)}var d,x,E={" ":"tab"," ":"space","\b":"backspace","\x7F":"delete",Spacebar:"space",Del:"delete",Win:"meta",Esc:"escape"},C={tab:" ",space:" ",enter:"\r"},b={},U={},D=new a({shift:!1,control:!1,alt:!1,meta:!1,capsLock:!1,space:!1}).inject({option:{get:function(){return this.alt}},command:{get:function(){var k=paper&&paper.agent;return k&&k.mac?this.meta:this.control}}});return ke.add(o,{keydown:function(k){var Z=t(k),Y=paper&&paper.agent;Z.length>1||Y&&Y.chrome&&(k.altKey||Y.mac&&k.metaKey||!Y.mac&&k.ctrlKey)?h(!0,Z,C[Z]||(Z.length>1?"":Z),k):x=Z},keypress:function(k){if(x){var Z=t(k),Y=k.charCode,W=Y>=32?String.fromCharCode(Y):Z.length>1?"":Z;Z!==x&&(Z=W.toLowerCase()),h(!0,Z,W,k),x=null}},keyup:function(k){var Z=t(k);Z in U&&h(!1,Z,U[Z],k)}}),ke.add(s,{blur:function(k){for(var Z in U)h(!1,Z,U[Z],k)}}),{modifiers:D,isDown:function(k){return!!b[k]}}},Ie=Be.extend({_class:"MouseEvent",initialize:function(t,h,d,x,E){this.type=t,this.event=h,this.point=d,this.target=x,this.delta=E},toString:function(){return"{ type: '"+this.type+"', point: "+this.point+", target: "+this.target+(this.delta?", delta: "+this.delta:"")+", modifiers: "+this.getModifiers()+" }"}}),Re=Be.extend({_class:"ToolEvent",_item:null,initialize:function(t,h,d){this.tool=t,this.type=h,this.event=d},_choosePoint:function(t,h){return t||(h?h.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 h=t.item,d=h._parent;/^(Group|CompoundPath)$/.test(d._class);)h=d,d=d._parent;this._item=h}}return this._item},setItem:function(t){this._item=t},toString:function(){return"{ type: "+this.type+", point: "+this.getPoint()+", count: "+this.getCount()+", modifiers: "+this.getModifiers()+" }"}}),Le=(v.extend({_class:"Tool",_list:"tools",_reference:"tool",_events:["onMouseDown","onMouseUp","onMouseDrag","onMouseMove","onActivate","onDeactivate","onEditOptions","onKeyDown","onKeyUp"],initialize:function(t){v.call(this),this._moveCount=-1,this._downCount=-1,this.set(t)},getMinDistance:function(){return this._minDistance},setMinDistance:function(t){this._minDistance=t,t!=null&&this._maxDistance!=null&&t>this._maxDistance&&(this._maxDistance=t)},getMaxDistance:function(){return this._maxDistance},setMaxDistance:function(t){this._maxDistance=t,this._minDistance!=null&&t!=null&&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,h,d,x){function E(W,F){var z=d,G=b?Y._point:Y._downPoint||z;if(b){if(Y._moveCount&&z.equals(G))return!1;if(G&&(W!=null||F!=null)){var X=z.subtract(G),A=X.getLength();if(A<(W||0))return!1;F&&(z=G.add(X.normalize(Math.min(A,F))))}Y._moveCount++}return Y._point=z,Y._lastPoint=G||z,x.down&&(Y._moveCount=-1,Y._downPoint=z,Y._downCount++),!0}function C(){U&&(Z=Y.emit(t,new Re(Y,t,h))||Z)}paper=this._scope,x.drag&&!this.responds(t)&&(t="mousemove");var b=x.move||x.drag,U=this.responds(t),D=this.minDistance,k=this.maxDistance,Z=!1,Y=this;if(x.down)E(),C();else if(x.up)E(null,k),C();else if(U)for(;E(D,k);)C();return Z}}),{request:function(t){var h=new e.XMLHttpRequest;return h.open((t.method||"get").toUpperCase(),t.url,a.pick(t.async,!0)),t.mimeType&&h.overrideMimeType(t.mimeType),h.onload=function(){var d=h.status;d===0||d===200?t.onLoad&&t.onLoad.call(h,h.responseText):h.onerror()},h.onerror=function(){var d=h.status,x='Could not load "'+t.url+'" (Status: '+d+")";if(!t.onError)throw new Error(x);t.onError(x,d)},h.send(null)}}),Oe={canvases:[],getCanvas:function(t,h){if(!s)return null;var d,x=!0;typeof t=="object"&&(h=t.height,t=t.width),this.canvases.length?d=this.canvases.pop():(d=o.createElement("canvas"),x=!1);var E=d.getContext("2d");if(!E)throw new Error("Canvas "+d+" is unable to provide a 2D context.");return d.width===t&&d.height===h?x&&E.clearRect(0,0,t+1,h+1):(d.width=t,d.height=h),E.save(),d},getContext:function(t,h){var d=this.getCanvas(t,h);return d?d.getContext("2d"):null},release:function(t){var h=t&&t.canvas?t.canvas:t;h&&h.getContext&&(h.getContext("2d").restore(),this.canvases.push(h))}},Ve=new function(){function t(fe,S,de){return .2989*fe+.587*S+.114*de}function h(fe,S,de,se){var ie=se-t(fe,S,de),se=t(W=fe+ie,F=S+ie,z=de+ie),ge=G(W,F,z),Pe=X(W,F,z);if(ge<0){var Ye=se-ge;W=se+(W-se)*se/Ye,F=se+(F-se)*se/Ye,z=se+(z-se)*se/Ye}if(Pe>255){var Ge=255-se,Ze=Pe-se;W=se+(W-se)*Ge/Ze,F=se+(F-se)*Ge/Ze,z=se+(z-se)*Ge/Ze}}function d(fe,S,de){return X(fe,S,de)-G(fe,S,de)}function x(fe,S,de,se){var ie,ge=[fe,S,de],Pe=X(fe,S,de),Ye=G(fe,S,de);ie=G(Ye=Ye===fe?0:Ye===S?1:2,Pe=Pe===fe?0:Pe===S?1:2)===0?X(Ye,Pe)===1?2:1:0,ge[Pe]>ge[Ye]?(ge[ie]=(ge[ie]-ge[Ye])*se/(ge[Pe]-ge[Ye]),ge[Pe]=se):ge[ie]=ge[Pe]=0,ge[Ye]=0,W=ge[0],F=ge[1],z=ge[2]}var E,C,b,U,D,k,Z,Y,W,F,z,G=Math.min,X=Math.max,A=Math.abs,N={multiply:function(){W=D*E/255,F=k*C/255,z=Z*b/255},screen:function(){W=D+E-D*E/255,F=k+C-k*C/255,z=Z+b-Z*b/255},overlay:function(){W=D<128?2*D*E/255:255-2*(255-D)*(255-E)/255,F=k<128?2*k*C/255:255-2*(255-k)*(255-C)/255,z=Z<128?2*Z*b/255:255-2*(255-Z)*(255-b)/255},"soft-light":function(){var fe=E*D/255;W=fe+D*(255-(255-D)*(255-E)/255-fe)/255,F=(fe=C*k/255)+k*(255-(255-k)*(255-C)/255-fe)/255,z=(fe=b*Z/255)+Z*(255-(255-Z)*(255-b)/255-fe)/255},"hard-light":function(){W=E<128?2*E*D/255:255-2*(255-E)*(255-D)/255,F=C<128?2*C*k/255:255-2*(255-C)*(255-k)/255,z=b<128?2*b*Z/255:255-2*(255-b)*(255-Z)/255},"color-dodge":function(){W=D===0?0:E===255?255:G(255,255*D/(255-E)),F=k===0?0:C===255?255:G(255,255*k/(255-C)),z=Z===0?0:b===255?255:G(255,255*Z/(255-b))},"color-burn":function(){W=D===255?255:E===0?0:X(0,255-255*(255-D)/E),F=k===255?255:C===0?0:X(0,255-255*(255-k)/C),z=Z===255?255:b===0?0:X(0,255-255*(255-Z)/b)},darken:function(){W=D<E?D:E,F=k<C?k:C,z=Z<b?Z:b},lighten:function(){W=D>E?D:E,F=k>C?k:C,z=Z>b?Z:b},difference:function(){(W=D-E)<0&&(W=-W),(F=k-C)<0&&(F=-F),(z=Z-b)<0&&(z=-z)},exclusion:function(){W=D+E*(255-D-D)/255,F=k+C*(255-k-k)/255,z=Z+b*(255-Z-Z)/255},hue:function(){x(E,C,b,d(D,k,Z)),h(W,F,z,t(D,k,Z))},saturation:function(){x(D,k,Z,d(E,C,b)),h(W,F,z,t(D,k,Z))},luminosity:function(){h(D,k,Z,t(E,C,b))},color:function(){h(E,C,b,t(D,k,Z))},add:function(){W=G(D+E,255),F=G(k+C,255),z=G(Z+b,255)},subtract:function(){W=X(D-E,0),F=X(k-C,0),z=X(Z-b,0)},average:function(){W=(D+E)/2,F=(k+C)/2,z=(Z+b)/2},negation:function(){W=255-A(255-E-D),F=255-A(255-C-k),z=255-A(255-b-Z)}},I=this.nativeModes=a.each(["source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","lighter","darker","copy","xor"],function(fe){this[fe]=!0},{}),te=Oe.getContext(1,1);te&&(a.each(N,function(fe,S){var de=S==="darken",se=!1;te.save();try{te.fillStyle=de?"#300":"#a00",te.fillRect(0,0,1,1),te.globalCompositeOperation=S,te.globalCompositeOperation===S&&(te.fillStyle=de?"#a00":"#300",te.fillRect(0,0,1,1),se=te.getImageData(0,0,1,1).data[0]!==de?170:51)}catch(ie){}te.restore(),I[S]=se}),Oe.release(te)),this.process=function(fe,S,de,se,ie){var ge=S.canvas,Pe=fe==="normal";if(Pe||I[fe])de.save(),de.setTransform(1,0,0,1,0,0),de.globalAlpha=se,Pe||(de.globalCompositeOperation=fe),de.drawImage(ge,ie.x,ie.y),de.restore();else{var Ye=N[fe];if(!Ye)return;for(var Ge=de.getImageData(ie.x,ie.y,ge.width,ge.height),Ze=Ge.data,Je=S.getImageData(0,0,ge.width,ge.height).data,tt=0,nt=Ze.length;tt<nt;tt+=4){E=Je[tt],D=Ze[tt],C=Je[tt+1],k=Ze[tt+1],b=Je[tt+2],Z=Ze[tt+2],U=Je[tt+3],Y=Ze[tt+3],Ye();var at=U*se/255,ut=1-at;Ze[tt]=at*W+ut*D,Ze[tt+1]=at*F+ut*k,Ze[tt+2]=at*z+ut*Z,Ze[tt+3]=U*se+ut*Y}de.putImageData(Ge,ie.x,ie.y)}}},Xe=new function(){function t(C,b,U){for(var D in b){var k=b[D],Z=E[D];typeof k=="number"&&U&&(k=U.number(k)),Z?C.setAttributeNS(Z,D,k):C.setAttribute(D,k)}return C}var h="http://www.w3.org/2000/svg",d="http://www.w3.org/2000/xmlns",x="http://www.w3.org/1999/xlink",E={href:x,xlink:d,xmlns:d+"/","xmlns:xlink":d+"/"};return{svg:h,xmlns:d,xlink:x,create:function(C,b,U){return t(o.createElementNS(h,C),b,U)},get:function(C,b){var U=E[b],D=U?C.getAttributeNS(U,b):C.getAttribute(b);return D==="null"?null:D},set:t}},We=a.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,h){return!h&&(t instanceof ee||t instanceof K||t instanceof Ne)}],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,h){var d=a.capitalize(h),x=t[2];this[h]={type:t[1],property:h,attribute:t[0],toSVG:x,fromSVG:x&&a.each(x,function(E,C){this[E]=C},{}),exportFilter:t[3],get:"get"+d,set:"set"+d}},{});return new function(){function t(F,z,G){var X=new a,A=F.getTranslation();if(z){var N=(F=F._shiftless())._inverseTransform(A);X[G?"cx":"x"]=N.x,X[G?"cy":"y"]=N.y,A=null}if(!F.isIdentity()){var I=F.decompose();if(I){var te=[],fe=I.rotation,S=I.scaling,de=I.skewing;A&&!A.isZero()&&te.push("translate("+Z.point(A)+")"),fe&&te.push("rotate("+Z.number(fe)+")"),c.isZero(S.x-1)&&c.isZero(S.y-1)||te.push("scale("+Z.point(S)+")"),de.x&&te.push("skewX("+Z.number(de.x)+")"),de.y&&te.push("skewY("+Z.number(de.y)+")"),X.transform=te.join(" ")}else X.transform="matrix("+F.getValues().join(",")+")"}return X}function h(F,z){for(var G=t(F._matrix),X=F._children,A=Xe.create("g",G,Z),N=0,I=X.length;N<I;N++){var te=X[N],fe=D(te,z);if(fe)if(te.isClipMask()){var S=Xe.create("clipPath");S.appendChild(fe),b(te,S,"clip"),Xe.set(A,{"clip-path":"url(#"+S.id+")"})}else A.appendChild(fe)}return A}function d(F){var z=F._type,G=F._radius,X=t(F._matrix,!0,z!=="rectangle");if(z==="rectangle"){z="rect";var A=F._size,N=A.width,I=A.height;X.x-=N/2,X.y-=I/2,X.width=N,X.height=I,G.isZero()&&(G=null)}return G&&(z==="circle"?X.r=G:(X.rx=G.width,X.ry=G.height)),Xe.create(z,X,Z)}function x(F){var z=C(F,"color");if(!z){var G,X=F.getGradient(),A=X._radial,N=F.getOrigin(),I=F.getDestination();if(A){G={cx:N.x,cy:N.y,r:N.getDistance(I)};var te=F.getHighlight();te&&(G.fx=te.x,G.fy=te.y)}else G={x1:N.x,y1:N.y,x2:I.x,y2:I.y};G.gradientUnits="userSpaceOnUse",z=Xe.create((A?"radial":"linear")+"Gradient",G,Z);for(var fe=X._stops,S=0,de=fe.length;S<de;S++){var se=fe[S],ie=se._color,ge=ie.getAlpha(),Pe=se._offset;G={offset:Pe==null?S/(de-1):Pe},ie&&(G["stop-color"]=ie.toCSS(!0)),ge<1&&(G["stop-opacity"]=ge),z.appendChild(Xe.create("stop",G,Z))}b(F,z,"color")}return"url(#"+z.id+")"}function E(F,z,G){var X={},A=!G&&F.getParent(),N=[];return F._name!=null&&(X.id=F._name),a.each(We,function(I){var te=I.get,fe=I.type,S=F[te]();if(I.exportFilter?I.exportFilter(F,S):!A||!a.equals(A[te](),S)){if(fe==="color"&&S!=null){var de=S.getAlpha();de<1&&(X[I.attribute+"-opacity"]=de)}fe==="style"?N.push(I.attribute+": "+S):X[I.attribute]=S==null?"none":fe==="color"?S.gradient?x(S,F):S.toCSS(!0):fe==="array"?S.join(","):fe==="lookup"?I.toSVG[S]:S}}),N.length&&(X.style=N.join(";")),X.opacity===1&&delete X.opacity,F._visible||(X.visibility="hidden"),Xe.set(z,X,Z)}function C(F,z){return Y||(Y={ids:{},svgs:{}}),F&&Y.svgs[z+"-"+(F._id||F.__id||(F.__id=_.get("svg")))]}function b(F,z,G){Y||C();var X=Y.ids[G]=(Y.ids[G]||0)+1;z.id=G+"-"+X,Y.svgs[G+"-"+(F._id||F.__id)]=z}function U(F,z){var G=F,X=null;if(Y){G=F.nodeName.toLowerCase()==="svg"&&F;for(var A in Y.svgs)X||(G||(G=Xe.create("svg")).appendChild(F),X=G.insertBefore(Xe.create("defs"),G.firstChild)),X.appendChild(Y.svgs[A]);Y=null}return z.asString?new e.XMLSerializer().serializeToString(G):G}function D(F,z,G){var X=W[F._class],A=X&&X(F,z);if(A){var N=z.onExport;N&&(A=N(F,A,z)||A);var I=JSON.stringify(F._data);I&&I!=="{}"&&I!=="null"&&A.setAttribute("data-paper-data",I)}return A&&E(F,A,G)}function k(F){return F||(F={}),Z=new p(F.precision),F}var Z,Y,W={Group:h,Layer:h,Raster:function(F,z){var G=t(F._matrix,!0),X=F.getSize(),A=F.getImage();return G.x-=X.width/2,G.y-=X.height/2,G.width=X.width,G.height=X.height,G.href=z.embedImages==0&&A&&A.src||F.toDataURL(),Xe.create("image",G,Z)},Path:function(F,z){var G=z.matchShapes;if(G){var X=F.toShape(!1);if(X)return d(X)}var A,N=F._segments,I=N.length,te=t(F._matrix);if(G&&I>=2&&!F.hasHandles())if(I>2){A=F._closed?"polygon":"polyline";for(var fe=[],S=0;S<I;S++)fe.push(Z.point(N[S]._point));te.points=fe.join(" ")}else{A="line";var de=N[0]._point,se=N[1]._point;te.set({x1:de.x,y1:de.y,x2:se.x,y2:se.y})}else A="path",te.d=F.getPathData(null,z.precision);return Xe.create(A,te,Z)},Shape:d,CompoundPath:function(F,z){var G=t(F._matrix),X=F.getPathData(null,z.precision);return X&&(G.d=X),Xe.create("path",G,Z)},SymbolItem:function(F,z){var G=t(F._matrix,!0),X=F._definition,A=C(X,"symbol"),N=X._item,I=N.getBounds();return A||((A=Xe.create("symbol",{viewBox:Z.rectangle(I)})).appendChild(D(N,z)),b(X,A,"symbol")),G.href="#"+A.id,G.x+=I.x,G.y+=I.y,G.width=I.width,G.height=I.height,G.overflow="visible",Xe.create("use",G,Z)},PointText:function(F){var z=Xe.create("text",t(F._matrix,!0),Z);return z.textContent=F._content,z}};Q.inject({exportSVG:function(F){return F=k(F),U(D(this,F,!0),F)}}),J.inject({exportSVG:function(F){F=k(F);var z=this._children,G=this.getView(),X=a.pick(F.bounds,"view"),A=F.matrix||X==="view"&&G._matrix,N=A&&B.read([A]),I=X==="view"?new M([0,0],G.getViewSize()):X==="content"?Q._getBounds(z,N,{stroke:!0}).rect:M.read([X],0,{readNull:!0}),te={version:"1.1",xmlns:Xe.svg,"xmlns:xlink":Xe.xlink};I&&(te.width=I.width,te.height=I.height,(I.x||I.y)&&(te.viewBox=Z.rectangle(I)));var fe=Xe.create("svg",te,Z),S=fe;N&&!N.isIdentity()&&(S=fe.appendChild(Xe.create("g",t(N),Z)));for(var de=0,se=z.length;de<se;de++)S.appendChild(D(z[de],F,!0));return U(fe,F)}})},new function(){function t(N,I,te,fe,S){var de=Xe.get(N,I),se=de==null?fe?null:te?"":0:te?de:parseFloat(de);return/%\s*$/.test(de)?se/100*(S?1:z[/x|^width/.test(I)?"width":"height"]):se}function h(N,I,te,fe,S){return I=t(N,I||"x",!1,fe,S),te=t(N,te||"y",!1,fe,S),!fe||I!=null&&te!=null?new f(I,te):null}function d(N,I,te,fe,S){return I=t(N,I||"width",!1,fe,S),te=t(N,te||"height",!1,fe,S),!fe||I!=null&&te!=null?new y(I,te):null}function x(N,I,te){return N==="none"?null:I==="number"?parseFloat(N):I==="array"?N?N.split(/[\s,]+/g).map(parseFloat):[]:I==="color"?Y(N)||N:I==="lookup"?te[N]:N}function E(N,I,te,fe){var S=N.childNodes,de=I==="clippath",se=I==="defs",ie=new q,ge=ie._project,Pe=ge._currentStyle,Ye=[];if(de||se||(ie=Z(ie,N,fe),ge._currentStyle=ie._style.clone()),fe)for(var Ge=N.querySelectorAll("defs"),Ze=0,Je=Ge.length;Ze<Je;Ze++)W(Ge[Ze],te,!1);for(var Ze=0,Je=S.length;Ze<Je;Ze++){var tt,nt=S[Ze];nt.nodeType!==1||/^defs$/i.test(nt.nodeName)||!(tt=W(nt,te,!1))||tt instanceof Te||Ye.push(tt)}return ie.addChildren(Ye),de&&(ie=Z(ie.reduce(),N,fe)),ge._currentStyle=Pe,(de||se)&&(ie.remove(),ie=null),ie}function C(N,I){for(var te=N.getAttribute("points").match(/[+-]?(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?/g),fe=[],S=0,de=te.length;S<de;S+=2)fe.push(new f(parseFloat(te[S]),parseFloat(te[S+1])));var se=new ne(fe);return I==="polygon"&&se.closePath(),se}function b(N,I){var te,fe=(t(N,"href",!0)||"").substring(1),S=I==="radialgradient";if(fe)(te=G[fe].getGradient())._radial^S&&((te=te.clone())._radial=S);else{for(var de=N.childNodes,se=[],ie=0,ge=de.length;ie<ge;ie++){var Pe=de[ie];Pe.nodeType===1&&se.push(Z(new ze,Pe))}te=new De(se,S)}var Ye,Ge,Ze,Je=t(N,"gradientUnits",!0)!=="userSpaceOnUse";return S?(Ge=(Ye=h(N,"cx","cy",!1,Je)).add(t(N,"r",!1,!1,Je),0),Ze=h(N,"fx","fy",!0,Je)):(Ye=h(N,"x1","y1",!1,Je),Ge=h(N,"x2","y2",!1,Je)),Z(new Fe(te,Ye,Ge,Ze),N)._scaleToBounds=Je,null}function U(N,I,te,fe){if(N.transform){for(var S=(fe.getAttribute(te)||"").split(/\)\s*/g),de=new B,se=0,ie=S.length;se<ie;se++){var ge=S[se];if(!ge)break;for(var Pe=ge.split(/\(\s*/),Ye=Pe[0],Ge=Pe[1].split(/[\s,]+/g),Ze=0,Je=Ge.length;Ze<Je;Ze++)Ge[Ze]=parseFloat(Ge[Ze]);switch(Ye){case"matrix":de.append(new B(Ge[0],Ge[1],Ge[2],Ge[3],Ge[4],Ge[5]));break;case"rotate":de.rotate(Ge[0],Ge[1],Ge[2]);break;case"translate":de.translate(Ge[0],Ge[1]);break;case"scale":de.scale(Ge);break;case"skewX":de.skew(Ge[0],0);break;case"skewY":de.skew(0,Ge[0])}}N.transform(de)}}function D(N,I,te){var fe=te==="fill-opacity"?"getFillColor":"getStrokeColor",S=N[fe]&&N[fe]();S&&S.setAlpha(parseFloat(I))}function k(N,I,te){var fe=N.attributes[I],S=fe&&fe.value;if(!S){var de=a.camelize(I);(S=N.style[de])||te.node[de]===te.parent[de]||(S=te.node[de])}return S?S==="none"?null:S:r}function Z(N,I,te){if(I.style){var fe=I.parentNode,S={node:he.getStyles(I)||{},parent:!te&&!/^defs$/i.test(fe.tagName)&&he.getStyles(fe)||{}};a.each(A,function(de,se){var ie=k(I,se,S);N=ie!==r&&de(N,ie,se,I,S)||N})}return N}function Y(N){var I=N&&N.match(/\((?:["'#]*)([^"')]+)/),te=I&&I[1],fe=te&&G[s?te.replace(s.location.href.split("#")[0]+"#",""):te];return fe&&fe._scaleToBounds&&((fe=fe.clone())._scaleToBounds=!0),fe}function W(N,I,te){var fe,S,de,se=N.nodeName.toLowerCase(),ie=se!=="#document",ge=o.body;te&&ie&&(z=paper.getView().getSize(),z=d(N,null,null,!0)||z,fe=Xe.create("svg",{style:"stroke-width: 1px; stroke-miterlimit: 10"}),S=N.parentNode,de=N.nextSibling,fe.appendChild(N),ge.appendChild(fe));var Pe=paper.settings,Ye=Pe.applyMatrix,Ge=Pe.insertItems;Pe.applyMatrix=!1,Pe.insertItems=!1;var Ze=X[se],Je=Ze&&Ze(N,se,I,te)||null;if(Pe.insertItems=Ge,Pe.applyMatrix=Ye,Je){!ie||Je instanceof q||(Je=Z(Je,N,te));var tt=I.onImport,nt=ie&&N.getAttribute("data-paper-data");tt&&(Je=tt(N,Je,I)||Je),I.expandShapes&&Je instanceof K&&(Je.remove(),Je=Je.toPath()),nt&&(Je._data=JSON.parse(nt))}return fe&&(ge.removeChild(fe),S&&(de?S.insertBefore(N,de):S.appendChild(N))),te&&(G={},Je&&a.pick(I.applyMatrix,Ye)&&Je.matrix.apply(!0,!0)),Je}function F(N,I,te){function fe(Pe){try{var Ye=typeof Pe=="object"?Pe:new e.DOMParser().parseFromString(Pe,"image/svg+xml");if(!Ye.nodeName)throw Ye=null,new Error("Unsupported SVG source: "+N);paper=de,se=W(Ye,I,!0),I&&I.insert===!1||te._insertItem(r,se);var Ge=I.onLoad;Ge&&Ge(se,Pe)}catch(Ze){S(Ze)}}function S(Pe,Ye){var Ge=I.onError;if(!Ge)throw new Error(Pe);Ge(Pe,Ye)}if(!N)return null;I=typeof I=="function"?{onLoad:I}:I||{};var de=paper,se=null;if(typeof N!="string"||/^.*</.test(N)){if(typeof File!="undefined"&&N instanceof File){var ie=new FileReader;return ie.onload=function(){fe(ie.result)},ie.onerror=function(){S(ie.error)},ie.readAsText(N)}fe(N)}else{var ge=o.getElementById(N);ge?fe(ge):Le.request({url:N,async:!0,onLoad:fe,onError:S})}return se}var z,G={},X={"#document":function(N,I,te,fe){for(var S=N.childNodes,de=0,se=S.length;de<se;de++){var ie=S[de];if(ie.nodeType===1)return W(ie,te,fe)}},g:E,svg:E,clippath:E,polygon:C,polyline:C,path:function(N){return ee.create(N.getAttribute("d"))},lineargradient:b,radialgradient:b,image:function(N){var I=new pe(t(N,"href",!0));return I.on("load",function(){var te=d(N);this.setSize(te);var fe=this._matrix._transformPoint(h(N).add(te.divide(2)));this.translate(fe)}),I},symbol:function(N,I,te,fe){return new Te(E(N,I,te,fe),!0)},defs:E,use:function(N){var I=(t(N,"href",!0)||"").substring(1),te=G[I],fe=h(N);return te?te instanceof Te?te.place(fe):te.clone().translate(fe):null},circle:function(N){return new K.Circle(h(N,"cx","cy"),t(N,"r"))},ellipse:function(N){return new K.Ellipse({center:h(N,"cx","cy"),radius:d(N,"rx","ry")})},rect:function(N){return new K.Rectangle(new M(h(N),d(N)),d(N,"rx","ry"))},line:function(N){return new ne.Line(h(N,"x1","y1"),h(N,"x2","y2"))},text:function(N){var I=new Ae(h(N).add(h(N,"dx","dy")));return I.setContent(N.textContent.trim()||""),I}},A=a.set(a.each(We,function(N){this[N.attribute]=function(I,te){if(I[N.set]&&(I[N.set](x(te,N.type,N.fromSVG)),N.type==="color")){var fe=I[N.get]();if(fe&&fe._scaleToBounds){var S=I.getBounds();fe.transform(new B().translate(S.getPoint()).scale(S.getSize()))}}}},{}),{id:function(N,I){G[I]=N,N.setName&&N.setName(I)},"clip-path":function(N,I){var te=Y(I);if(te){if((te=te.clone()).setClipMask(!0),!(N instanceof q))return new q(te,N);N.insertChild(0,te)}},gradientTransform:U,transform:U,"fill-opacity":D,"stroke-opacity":D,visibility:function(N,I){N.setVisible&&N.setVisible(I==="visible")},display:function(N,I){N.setVisible&&N.setVisible(I!==null)},"stop-color":function(N,I){N.setColor&&N.setColor(I)},"stop-opacity":function(N,I){N._color&&N._color.setAlpha(parseFloat(I))},offset:function(N,I){if(N.setOffset){var te=I.match(/(.*)%$/);N.setOffset(te?te[1]/100:parseFloat(I))}},viewBox:function(N,I,te,fe,S){var de,se=new M(x(I,"array")),ie=d(fe,null,null,!0);if(N instanceof q){var ge=ie?ie.divide(se.getSize()):1,Pe=new B().scale(ge).translate(se.getPoint().negate());de=N}else N instanceof Te&&(ie&&se.setSize(ie),de=N._item);if(de){if(k(fe,"overflow",S)!=="visible"){var Ye=new K.Rectangle(se);Ye.setClipMask(!0),de.addChild(Ye)}Pe&&de.transform(Pe)}}});Q.inject({importSVG:function(N,I){return F(N,I,this)}}),J.inject({importSVG:function(N,I){return this.activate(),F(N,I,this)}})},(paper=new(l.inject(a.exports,{Base:a,Numerical:c,Key:xe,DomEvent:ke,DomElement:he,document:o,window:s,Symbol:Te,PlacedSymbol:R}))).agent.node&&require("./node/extend.js")(paper),typeof define=="function"&&define.amd?define("paper",paper):typeof module=="object"&&module&&(module.exports=paper),paper}.call(this,typeof self=="object"?self:null);if(typeof NETXUS=="undefined")var NETXUS=function(){};NETXUS.RectanglePacker=function(e,r){this.root={},this.reset(e,r)},NETXUS.RectanglePacker.prototype.reset=function(e,r){this.root.x=0,this.root.y=0,this.root.w=e,this.root.h=r,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(e,r){function s(a,u,l){function v(c){return{x:c.x,y:c.y,w:c.w,h:c.h}}if(a.lft){var p=s(a.lft,u,l);return p||s(a.rgt,u,l)}else return a.used||u>a.w||l>a.h?null:u==a.w&&l==a.h?(a.used=!0,{x:a.x,y:a.y}):(a.lft=v(a),a.rgt=v(a),a.w-u>a.h-l?(a.lft.w=u,a.rgt.x=a.x+u,a.rgt.w=a.w-u):(a.lft.h=l,a.rgt.y=a.y+l,a.rgt.h=a.h-l),s(a.lft,u,l))}var o=s(this.root,e,r);return o&&(this.usedWidth<o.x+e&&(this.usedWidth=o.x+e),this.usedHeight<o.y+r&&(this.usedHeight=o.y+r)),o};function UnionFind(e){this.roots=new Array(e),this.ranks=new Array(e);for(var r=0;r<e;++r)this.roots[r]=r,this.ranks[r]=0}UnionFind.prototype.find=function(e){for(var r=e,s=this.roots;s[e]!=e;)e=s[e];for(;s[r]!=e;){var o=s[r];s[r]=e,r=o}return e},UnionFind.prototype.link=function(e,r){var s=this.find(e),o=this.find(r);if(s!=o){var a=this.ranks,u=this.roots,l=a[s],v=a[o];l<v?u[s]=o:v<l?u[o]=s:(u[o]=s,++a[s])}};var ICC=function(){var e=new Int16Array(1),r=new Uint8Array(e.buffer);function s(R,Te){return R[Te]<<8|R[Te+1]}function o(R,Te){return r[0]=R[Te+1],r[1]=R[Te],e[0]}function a(R,Te){return R[Te]<<24|R[Te+1]<<16|R[Te+2]<<8|R[Te+3]}function u(R,Te,re){for(var oe="",me=0;me<re;me++)oe+=String.fromCharCode(R[Te+me]);return oe}function l(R,Te,re){for(var oe=[],me=0;me<re;me++)oe.push(String.fromCharCode(R[Te+me]));return oe}function v(R,Te,re){for(var oe="",me=0;me<re;me++){var ue=R[Te++]<<8|R[Te++];oe+=String.fromCharCode(ue)}return oe}function p(R){var Te=new Uint8Array(R);return{header:c(Te,0),tags:_(Te,128)}}function c(R,Te){var re=u,oe=a,me={};me.I=re(R,4,4),me.version=R[8]+"."+(R[9]>>>4)+"."+(R[9]&15),me.P=re(R,12,4),me.a=re(R,16,4),me.p=re(R,20,4),me.v=s(R,24);for(var ue=0;ue<5;ue++)me.v+="."+s(R,26+2*ue);return me.platform=re(R,40,4),me.d=oe(R,44),me.k=re(R,48,4),me.l=oe(R,52),me.Q=[oe(R,56),oe(R,60)],me.U=oe(R,64),me.A=pe(R,68),me.h=re(R,80,4),me}function _(R,Te){var re=a,oe={},me=re(R,Te);Te+=4;for(var ue=0;ue<me;ue++){var $=u(R,Te,4);Te+=4;var ee=re(R,Te);Te+=4;var ne=re(R,Te);Te+=4,oe[$]=f(R,ee,ne)}return oe}function f(R,Te,re){var oe=u(R,Te,4),me={C:oe,T:re};if(Te+=4,Te+=4,oe=="mluc")for(var ue=[],$=0;$<re;$++)ue.push(R[Te-8+$]);return oe=="mluc"?g(me,R,Te,re):oe=="text"?q(me,R,Te,re):oe=="desc"?y(me,R,Te,re):oe=="mAB "?w(me,R,Te,re):oe=="mft1"?M(me,R,Te,re):oe=="XYZ "?Q(me,R,Te,re):oe=="para"?H(me,R,Te,re):oe=="curv"?J(me,R,Te,re):oe!="pseq"&&console.log("unknown tag",oe,Te,Te,re),(me.T&3)!=0&&(me.T+=4-(me.T&3)),me}function g(R,Te,re,oe){var me=re-8,ue=a(Te,re);re+=4;var $=a(Te,re);re+=4,R.b=[];for(var ee=0;ee<ue;ee++){var ne={};R.b.push(ne),ne.code=u(Te,re,4);var _e=a(Te,re+4),ae=a(Te,re+8);re+=12,ne.text=v(Te,me+ae,_e>>>1)}}function y(R,Te,re,oe){var me=a(Te,re);re+=4,R.r=u(Te,re,me-1),re+=me;var ue=a(Te,re);re+=4;var $=a(Te,re);re+=4,R.e=v(Te,re,$),re+=$;var ee=s(Te,re);re+=2;var ne=Te[re];re++,R.z=u(Te,re,ne)}function w(R,Te,re,oe){var me=re-8;R.L=Te[re],re++,R.u=Te[re],re++,re+=2;var ue=a(Te,re);re+=4;var $=a(Te,re);re+=4;var ee=a(Te,re);re+=4;var ne=a(Te,re);re+=4;var _e=a(Te,re);if(re+=4,ue!=0){R.S=[],re=me+ue;for(var ae=0;ae<R.u;ae++){var Me=f(Te,re,0);re+=Me.T,R.S.push(Me)}}if($!=0){R.F=[];for(var ae=0;ae<12;ae++)R.F.push(K(Te,me+$+ae*4))}if(ee!=0){R.o=[],re=me+ee;for(var ae=0;ae<R.u;ae++){var Me=f(Te,re,0);re+=Me.T,R.o.push(Me)}}if(ne!=0){R.c=[],re=me+ne,R.n=[];for(var ae=0;ae<R.L;ae++)R.n.push(Te[re+ae]);re+=16;var Ne=Te[re];re+=4;for(var Ae=R.u,ae=0;ae<R.L;ae++)Ae*=R.n[ae];if(Ne==1)for(var ae=0;ae<Ae;ae++)R.c.push(Te[re+ae]*(1/255));if(Ne==2)for(var ae=0;ae<Ae;ae++)R.c.push(s(Te,re+2*ae)*(1/65535))}if(_e!=0){R.V=[],re=me+_e;for(var ae=0;ae<R.L;ae++){var Me=f(Te,re,0);re+=Me.T,R.V.push(Me)}}}function M(R,Te,re,oe){T(R,Te,re),re+=40,R.K=B(Te,re,R.L,256),re+=R.L*256,R.c=[];for(var me=Math.round(Math.pow(R.q,R.L))*R.u,ue=0;ue<me;ue++)R.c.push(Te[re+ue]*(1/255));re+=me,R.D=B(Te,re,R.u,256),re+=R.u*256}function T(R,Te,re){R.L=Te[re],re++,R.u=Te[re],re++,R.q=Te[re],re++,re++,R.F=[];for(var oe=0;oe<9;oe++)R.F.push(K(Te,re)),re+=4}function B(R,Te,re,oe){for(var me=[],ue=0;ue<re;ue++){var $=[];me.push($);for(var ee=0;ee<oe;ee++)$.push(R[Te]),Te++}return me}function H(R,Te,re,oe){R.s=s(Te,re),re+=2,re+=2;var me=[1,3,4,5,7];R.f=[];for(var ue=0;ue<me[R.s];ue++)R.f.push(K(Te,re+ue*4))}function J(R,Te,re,oe){var me=a(Te,re);if(re+=4,R.b=[],me==1)R.b.push(O(Te,re));else for(var ue=0;ue<me;ue++)R.b.push(s(Te,re+ue*2));R.T=12+2*me}function Q(R,Te,re){R.value=pe(Te,re)}function q(R,Te,re,oe){R.value=u(Te,re,oe-9)}function O(R,Te){return R[Te]+R[Te+1]/256}function K(R,Te){return o(R,Te)+s(R,Te+2)*(1/65536)}function pe(R,Te){for(var re=[],oe=0;oe<3;oe++)re.push(K(R,Te+oe*4));return re}return{R:p}}();ICC.U=function(){var e={O:[3.1338561,-1.6168667,-.4906146,-.9787684,1.9161415,.033454,.0719453,-.2289914,1.4052427],H:[.4360747,.3850649,.14308038,.2225045,.7168786,.0606169,.0139322,.0971045,.7141733],m:function(_){return _<.0031308?12.92*_:1.055*Math.pow(_,1/2.4)-.055},G:function(_){return _<.04045?_/12.92:Math.pow((_+.055)/1.055,2.4)},J:function(_,f,g){var y=e.R[0],w=e.R[1];_=y[~~(_*(1e3/255))],f=y[~~(f*(1e3/255))],g=y[~~(g*(1e3/255))];var M=e.H,T=M[0]*_+M[1]*f+M[2]*g,B=M[3]*_+M[4]*f+M[5]*g,H=M[6]*_+M[7]*f+M[8]*g;return T=T*(100/96.72),B=B*(100/100),H=H*(100/81.427),e.i(T,B,H)},i:function(_,f,g){var y=e.R[1],w=y[~~(_*1e3)],M=y[~~(f*1e3)],T=y[~~(g*1e3)];return{t:116*M-16,j:500*(w-M),N:200*(M-T)}},w:function(_,f,g){for(var y=903.3,w=.008856,M=(_+16)/116,T=M*M*M,B=M-g/200,H=B*B*B,J=f/500+M,Q=J*J*J,q=H>w?H:(116*B-16)/y,O=T>w?T:(116*M-16)/y,K=Q>w?Q:(116*J-16)/y,pe=K*96.72,R=O*100,Te=q*81.427,re=pe/100,oe=R/100,g=Te/100,me=e.O,ue=[me[0]*re+me[1]*oe+me[2]*g,me[3]*re+me[4]*oe+me[5]*g,me[6]*re+me[7]*oe+me[8]*g],$=0;$<3;$++)ue[$]=Math.max(0,Math.min(255,e.m(ue[$])*255));return{g:ue[0],q:ue[1],N:ue[2]}}};e.R=function(){for(var _=[],f=[],g=0;g<2e3;g++){var y=g/1e3;_[g]=e.G(y),f[g]=y>.008856?Math.pow(y,1/3):(903.3*y+16)*(1/116)}return[_,f]}();function r(_,f){for(var g=f*f*f,y=g*3,w=1/(f-1),M=[],T=0;T<f;T++)for(var B=0;B<f;B++)for(var H=0;H<f;H++)M.push(T*w,B*w,H*w);var J=_.tags.A2B0,Q=_.header.a.toLowerCase();if(J.C=="mAB ")for(var q=J.F,O=J.o&&J.o[0].b.length>1?J.o:null,K=0;K<y;K+=3)O&&o(M,K,O),u(M,K,J.c,J.n[0]),J.F&&s(M,K,J.F);else if(J.C=="mft1")if(Q=="rgb ")for(var K=0;K<y;K+=3)u(M,K,J.c,J.q);else for(var K=0;K<y;K+=3){var pe=e.J(M[K]*255,M[K+1]*255,M[K+2]*255);M[K]=pe.t/100,M[K+1]=(128+pe.j)/255,M[K+2]=(128+pe.N)/255,u(M,K,J.c,J.q);var R=e.w(M[K]*100,-128+255*M[K+1],-128+255*M[K+2]);M[K]=R.g/255,M[K+1]=R.q/255,M[K+2]=R.N/255}return M}function s(_,f,g){var y=_[f],w=_[f+1],M=_[f+2];_[f]=Math.max(0,Math.min(1,g[0]*y+g[1]*w+g[2]*M+g[9])),_[f+1]=Math.max(0,Math.min(1,g[3]*y+g[4]*w+g[5]*M+g[10])),_[f+2]=Math.max(0,Math.min(1,g[6]*y+g[7]*w+g[8]*M+g[11]))}function o(_,f,g){_[f]=a(_[f],g[0].b),_[f+1]=a(_[f+1],g[1].b),_[f+2]=a(_[f+2],g[2].b)}function a(_,f){var g=f.length,y=_*(g-1)*.99999,w=~~y,M=y-w;return((1-M)*f[w]+M*f[w+1])*(1/65535)}function u(_,f,g,y){var w=[0,0,0,0,0,0,0,0,0,0,0,0],M=y-1.000001,T=M*_[f+0],B=M*_[f+1],H=M*_[f+2],J=~~T,Q=~~B,q=~~H;l(3*(q+y*Q+y*y*J),3*(q+1+y*Q+y*y*J),g,H-q,0,w),l(3*(q+y*(Q+1)+y*y*J),3*(q+1+y*(Q+1)+y*y*J),g,H-q,3,w),l(0,3,w,B-Q,6,w),l(3*(q+y*Q+y*y*(J+1)),3*(q+1+y*Q+y*y*(J+1)),g,H-q,0,w),l(3*(q+y*(Q+1)+y*y*(J+1)),3*(q+1+y*(Q+1)+y*y*(J+1)),g,H-q,3,w),l(0,3,w,B-Q,9,w),l(6,9,w,T-J,0,w),_[f]=w[0],_[f+1]=w[1],_[f+2]=w[2]}function l(_,f,g,y,w,M){var T=1-y;M[w+0]=T*g[_]+y*g[f],M[w+1]=T*g[_+1]+y*g[f+1],M[w+2]=T*g[_+2]+y*g[f+2]}function v(_,f){for(var g=f*f*f,y=new Uint8Array(g*4),w=0;w<g;w++){var M=w*3,T=M+w,B=Math.max(0,Math.min(1,_[M])),H=Math.max(0,Math.min(1,_[M+1])),J=Math.max(0,Math.min(1,_[M+2]));y[T]=~~(.5+B*255),y[T+1]=~~(.5+H*255),y[T+2]=~~(.5+J*255),y[T+3]=255,_[M]=B,_[M+1]=H,_[M+2]=J}return y}function p(_,f,g,y,w,M){var T=1-y;M[w+0]=T*g[_]+y*g[f],M[w+1]=T*g[_+1]+y*g[f+1],M[w+2]=T*g[_+2]+y*g[f+2]}function c(_,f,g,y){for(var w=[0,0,0,0,0,0,0,0,0,0,0,0],M=(f-1.000001)/255,T=3,B=0;B<g.length;B+=4){var H=M*g[B],J=M*g[B+1],Q=M*g[B+2],q=~~H,O=~~J,K=~~Q;p(T*(K+f*O+f*f*q),T*(K+1+f*O+f*f*q),_,Q-K,0,w),p(T*(K+f*(O+1)+f*f*q),T*(K+1+f*(O+1)+f*f*q),_,Q-K,3,w),p(0,3,w,J-O,6,w),p(T*(K+f*O+f*f*(q+1)),T*(K+1+f*O+f*f*(q+1)),_,Q-K,0,w),p(T*(K+f*(O+1)+f*f*(q+1)),T*(K+1+f*(O+1)+f*f*(q+1)),_,Q-K,3,w),p(0,3,w,J-O,9,w),p(6,9,w,H-q,0,w),y[B]=~~(.5+w[0]*255),y[B+1]=~~(.5+w[1]*255),y[B+2]=~~(.5+w[2]*255)}}return{rgba8LUT:v,sampleLUT:r,applyLUT:c}}();/*
|
|
* [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(e){e?(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=typeof window=="object"?window:{},s=!h.JS_SHA1_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s&&(h=global);var i=!h.JS_SHA1_NO_COMMON_JS&&typeof module=="object"&&module.exports,e=typeof define=="function"&&define.amd,r="0123456789abcdef".split(""),o=[-2147483648,8388608,32768,128],n=[24,16,8,0],a=["hex","array","digest","arrayBuffer"],f=[],u=function(e){return function(r){return new t(!0).update(r)[e]()}},c=function(){var e=u("hex");s&&(e=p(e)),e.create=function(){return new t},e.update=function(o){return e.create().update(o)};for(var r=0;r<a.length;++r){var s=a[r];e[s]=u(s)}return e},p=function(t){var h=eval("require('crypto')"),s=eval("require('buffer').Buffer"),i=function(e){if(typeof e=="string")return h.createHash("sha1").update(e,"utf8").digest("hex");if(e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(e.length===void 0)return t(e);return h.createHash("sha1").update(new s(e)).digest("hex")};return i};t.prototype.update=function(e){if(!this.finalized){var r=typeof e!="string";r&&e.constructor===h.ArrayBuffer&&(e=new Uint8Array(e));for(var s,o,a=0,u=e.length||0,l=this.blocks;a<u;){if(this.hashed&&(this.hashed=!1,l[0]=this.block,l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),r)for(o=this.start;a<u&&o<64;++a)l[o>>2]|=e[a]<<n[3&o++];else for(o=this.start;a<u&&o<64;++a)(s=e.charCodeAt(a))<128?l[o>>2]|=s<<n[3&o++]:s<2048?(l[o>>2]|=(192|s>>6)<<n[3&o++],l[o>>2]|=(128|63&s)<<n[3&o++]):s<55296||s>=57344?(l[o>>2]|=(224|s>>12)<<n[3&o++],l[o>>2]|=(128|s>>6&63)<<n[3&o++],l[o>>2]|=(128|63&s)<<n[3&o++]):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),l[o>>2]|=(240|s>>18)<<n[3&o++],l[o>>2]|=(128|s>>12&63)<<n[3&o++],l[o>>2]|=(128|s>>6&63)<<n[3&o++],l[o>>2]|=(128|63&s)<<n[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=l[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}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 e=this.blocks,r=this.lastByteIndex;e[16]=this.block,e[r>>2]|=o[3&r],this.block=e[16],r>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},t.prototype.hash=function(){var e,r,s=this.h0,o=this.h1,a=this.h2,u=this.h3,l=this.h4,v=this.blocks;for(e=16;e<80;++e)r=v[e-3]^v[e-8]^v[e-14]^v[e-16],v[e]=r<<1|r>>>31;for(e=0;e<20;e+=5)s=(r=(o=(r=(a=(r=(u=(r=(l=(r=s<<5|s>>>27)+(o&a|~o&u)+l+1518500249+v[e]<<0)<<5|l>>>27)+(s&(o=o<<30|o>>>2)|~s&a)+u+1518500249+v[e+1]<<0)<<5|u>>>27)+(l&(s=s<<30|s>>>2)|~l&o)+a+1518500249+v[e+2]<<0)<<5|a>>>27)+(u&(l=l<<30|l>>>2)|~u&s)+o+1518500249+v[e+3]<<0)<<5|o>>>27)+(a&(u=u<<30|u>>>2)|~a&l)+s+1518500249+v[e+4]<<0,a=a<<30|a>>>2;for(;e<40;e+=5)s=(r=(o=(r=(a=(r=(u=(r=(l=(r=s<<5|s>>>27)+(o^a^u)+l+1859775393+v[e]<<0)<<5|l>>>27)+(s^(o=o<<30|o>>>2)^a)+u+1859775393+v[e+1]<<0)<<5|u>>>27)+(l^(s=s<<30|s>>>2)^o)+a+1859775393+v[e+2]<<0)<<5|a>>>27)+(u^(l=l<<30|l>>>2)^s)+o+1859775393+v[e+3]<<0)<<5|o>>>27)+(a^(u=u<<30|u>>>2)^l)+s+1859775393+v[e+4]<<0,a=a<<30|a>>>2;for(;e<60;e+=5)s=(r=(o=(r=(a=(r=(u=(r=(l=(r=s<<5|s>>>27)+(o&a|o&u|a&u)+l-1894007588+v[e]<<0)<<5|l>>>27)+(s&(o=o<<30|o>>>2)|s&a|o&a)+u-1894007588+v[e+1]<<0)<<5|u>>>27)+(l&(s=s<<30|s>>>2)|l&o|s&o)+a-1894007588+v[e+2]<<0)<<5|a>>>27)+(u&(l=l<<30|l>>>2)|u&s|l&s)+o-1894007588+v[e+3]<<0)<<5|o>>>27)+(a&(u=u<<30|u>>>2)|a&l|u&l)+s-1894007588+v[e+4]<<0,a=a<<30|a>>>2;for(;e<80;e+=5)s=(r=(o=(r=(a=(r=(u=(r=(l=(r=s<<5|s>>>27)+(o^a^u)+l-899497514+v[e]<<0)<<5|l>>>27)+(s^(o=o<<30|o>>>2)^a)+u-899497514+v[e+1]<<0)<<5|u>>>27)+(l^(s=s<<30|s>>>2)^o)+a-899497514+v[e+2]<<0)<<5|a>>>27)+(u^(l=l<<30|l>>>2)^s)+o-899497514+v[e+3]<<0)<<5|o>>>27)+(a^(u=u<<30|u>>>2)^l)+s-899497514+v[e+4]<<0,a=a<<30|a>>>2;this.h0=this.h0+s<<0,this.h1=this.h1+o<<0,this.h2=this.h2+a<<0,this.h3=this.h3+u<<0,this.h4=this.h4+l<<0},t.prototype.hex=function(){this.finalize();var e=this.h0,r=this.h1,s=this.h2,o=this.h3,a=this.h4;return 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]+r[r>>28&15]+r[r>>24&15]+r[r>>20&15]+r[r>>16&15]+r[r>>12&15]+r[r>>8&15]+r[r>>4&15]+r[15&r]+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[o>>28&15]+r[o>>24&15]+r[o>>20&15]+r[o>>16&15]+r[o>>12&15]+r[o>>8&15]+r[o>>4&15]+r[15&o]+r[a>>28&15]+r[a>>24&15]+r[a>>20&15]+r[a>>16&15]+r[a>>12&15]+r[a>>8&15]+r[a>>4&15]+r[15&a]},t.prototype.toString=t.prototype.hex,t.prototype.digest=function(){this.finalize();var e=this.h0,r=this.h1,s=this.h2,o=this.h3,a=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o,a>>24&255,a>>16&255,a>>8&255,255&a]},t.prototype.array=t.prototype.digest,t.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),r=new DataView(e);return r.setUint32(0,this.h0),r.setUint32(4,this.h1),r.setUint32(8,this.h2),r.setUint32(12,this.h3),r.setUint32(16,this.h4),e};var y=c();i?module.exports=y:(h.sha1=y,e&&define(function(){return y}))})();
|